Commit 963c9a66 authored by Unknown's avatar Unknown

Merge remote-tracking branch 'origin/master'

parents fe2a09da 8fa23c3e
......@@ -16,6 +16,28 @@ variables:
variables:
- $RUN_NON_RELEASE_BUILDS
.release_build:
artifacts:
expire_in: 1 week
WebGL [Release]:
when: on_success
pages:
when: on_success
start_in:
Deploy Nextcloud:
when: manual
allow_failure: false
start_in:
Release:
when: manual
allow_failure: false
dependencies:
- Deploy Nextcloud
include:
# Base
- https://gitlab.dragonixx.de/Dragonixx/gitlab-ci-toolbox/raw/master/scripts/unity/build-base.yml
......
......@@ -12,15 +12,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 353b156b7c59b1c45a8767d7500b31fb, type: 3}
m_Name: PlayerState
m_EditorClassIdentifier:
currentInfusedElement: 0
currentInfusedElement: 1
currentMoveState:
jumpForce: 10
jumpForce: 15
smoothing: 0.03
airControl: 1
canSwim: 1
moveSpeed: 20
maxJumpCount: 1
maxJumpCount: 2
mass: 1
gravity: 3
movementStates: {fileID: 11400000, guid: c757aad6925b37a46b916f609fa9012b, type: 2}
charges: 2
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
charges: 0
......@@ -956,6 +956,12 @@ PrefabInstance:
propertyPath: m_MaxJumpCount
value: 2
objectReference: {fileID: 0}
- target: {fileID: 52145075018362291, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: r_State
value:
objectReference: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639,
type: 2}
- target: {fileID: 6060985002925283250, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: lowJumpMultiplier
......@@ -1000,7 +1006,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 83eb4399ff535ee4cbc76de3b8a32e46, type: 3}
m_Name:
m_EditorClassIdentifier:
Cooldown: 0
cooldown: 0
volleySize: 10
launchPower: 10
attackSpeed: 0.1
......@@ -1018,6 +1024,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ad90db0185377664288543ce4696c6b8, type: 3}
m_Name:
m_EditorClassIdentifier:
cooldown: 0
massIncrease: 0
isStomping: 0
--- !u!114 &1876157330
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -1049,8 +1058,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
state: {fileID: 11400000, guid: c5777bcc7b64ce24c9bd65d2c4b7c639, type: 2}
onElementInfused: {fileID: 11400000, guid: 7e5b80a8353af1846a878c3a997bdb4a, type: 2}
onChargeChange: {fileID: 11400000, guid: 6ec6544f645a9d1458383b111fcaf8b6, type: 2}
onElementChanged: {fileID: 0}
--- !u!4 &1876157337 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
......
using UnityEngine;
using _Game.Scripts.Scriptable_Object;
namespace _Game.Scripts.Elements
{
public class InteractionObject : MonoBehaviour
{
[SerializeField] private InfusedElement element;
public void InfuseElement()
{
//this.GetComponent<SpriteRenderer>().color = Color.green;
Debug.Log("Infused " + this.gameObject.tag);
}
public InfusedElement GetElement()
{
return element;
}
}
}
......@@ -19,9 +19,7 @@ namespace _Game.Scripts.Player
[SerializeField] private PlayerState state;
[SerializeField] private ElementGameEvent onElementInfused;
[SerializeField] private ChargeGameEvent onChargeChange;
[SerializeField] private ElementGameEventListener onElementChanged;
private PlayerAirAttack _airAttack;
private PlayerEarthAttack _earthAttack;
......@@ -44,7 +42,7 @@ namespace _Game.Scripts.Player
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
//_controller.SetMovementParameters(state.GetCurrentMovementState());
// _controller.SetMovementParameters(state.GetCurrentMovementState());
}
private void Update()
......@@ -64,88 +62,77 @@ namespace _Game.Scripts.Player
if (_earthAttack.Attack())
{
state.ChangeCharges(-1);
onChargeChange.Raise();
}
break;
case InfusedElement.Fire:
if (_fireAttack.Attack())
{
state.ChangeCharges(-1);
onChargeChange.Raise();
}
break;
case InfusedElement.Water:
print("done");
if(_waterAttack.Attack())
{
state.ChangeCharges(-1);
onChargeChange.Raise();
}
break;
case InfusedElement.None:
break;
case InfusedElement.Air:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
if (!Input.GetButtonDown("Interact") || !_currentObject) return;
if (Input.GetButtonDown("Interact") && _currentObject)
{
switch (_currentObject.tag)
{
case "Air":
state.UpdateElement(InfusedElement.Air);
_airAttack.enabled = true;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
break;
case "Earth":
state.UpdateElement(InfusedElement.Earth);
_airAttack.enabled = false;
_earthAttack.enabled = true;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
break;
case "Fire":
state.UpdateElement(InfusedElement.Fire);
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = true;
_waterAttack.enabled = false;
break;
case "Water":
state.UpdateElement(InfusedElement.Water);
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = true;
break;
default:
throw new ArgumentOutOfRangeException();
}
_targetScript.InfuseElement();
}
switch (_currentObject.tag)
if (Input.GetButtonDown("Cancel Element"))
{
case "Air":
state.UpdateElement(InfusedElement.Air);
state.ChangeCharges(3);
onElementInfused.Raise(InfusedElement.Air);
onChargeChange.Raise();
_airAttack.enabled = true;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
break;
case "Earth":
state.UpdateElement(InfusedElement.Earth);
state.ChangeCharges(3);
onElementInfused.Raise(InfusedElement.Earth);
onChargeChange.Raise();
_airAttack.enabled = false;
_earthAttack.enabled = true;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
break;
case "Fire":
state.UpdateElement(InfusedElement.Fire);
state.ChangeCharges(3);
onElementInfused.Raise(InfusedElement.Fire);
onChargeChange.Raise();
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = true;
_waterAttack.enabled = false;
break;
case "Water":
state.UpdateElement(InfusedElement.Water);
state.ChangeCharges(3);
onElementInfused.Raise(InfusedElement.Water);
onChargeChange.Raise();
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = true;
break;
default:
state.UpdateElement(InfusedElement.None);
state.ChangeCharges(3);
onElementInfused.Raise(InfusedElement.None);
onChargeChange.Raise();
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
break;
state.UpdateElement(InfusedElement.None);
state.ChangeCharges(-5);
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
}
//_controller.SetMovementParameters(state.GetCurrentMovementState());
_targetScript.InfuseElement();
}
......
......@@ -17,6 +17,9 @@ namespace _Game.Scripts.Scriptable_Object
[SerializeField] private MovementStates movementStates;
[SerializeField] private ElementGameEvent onElementInfused;
[SerializeField] private ChargeGameEvent onChargeChange;
[SerializeField][Range(0, 5)] private int charges;
// [SerializeField] private float currentJumpForce;
......@@ -31,6 +34,11 @@ namespace _Game.Scripts.Scriptable_Object
{
currentInfusedElement = newElement;
currentMoveState = movementStates.GetMovementState(newElement);
onElementInfused.Raise(newElement);
if (newElement == InfusedElement.None) return;
ChangeCharges(5);
onChargeChange.Raise();
}
public MovementState GetCurrentMovementState()
......
......@@ -54,13 +54,13 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
m_Name: Cancel Element
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
positiveButton: q
altNegativeButton:
altPositiveButton: mouse 1
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment