Commit 4b786555 authored by Sebastian Frey's avatar Sebastian Frey

PlayerInteract geändert

parent af1096a5
......@@ -133,16 +133,6 @@ namespace _Game.Scripts.Player
_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;
}
_controller.SetMovementParameters(state.GetCurrentMovementState());
_targetScript.InfuseElement();
......
......@@ -38,19 +38,22 @@ namespace _Game.Scripts.Scriptable_Object
return currentMoveState;
}
public void ChangeCharges(int amount)
public bool ChangeCharges(int amount)
{
if ((charges + amount) > 5)
{
charges = 5;
return true;
} else if ((charges + amount) <= 0)
{
charges = 0;
UpdateElement(InfusedElement.None);
return false;
}
else
{
charges += amount;
return true;
}
}
......
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