mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 16:55:54 +00:00
Drown animation
This commit is contained in:
parent
be88896252
commit
aa2de85f9a
16 changed files with 264 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Cirno.Scripts.Components.FSM;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.Actors;
|
||||
|
|
@ -42,9 +43,13 @@ public partial class PlayerDamageReceiver : Area2D
|
|||
get => _shieldProvider.CurrentResource;
|
||||
set => _shieldProvider.CurrentResource = value;
|
||||
}
|
||||
|
||||
private IStateMachine<PlayerState, CharacterBody2D> _stateMachine;
|
||||
|
||||
public void Init()
|
||||
public void Init(IStateMachine<PlayerState, CharacterBody2D> machine)
|
||||
{
|
||||
_stateMachine = machine;
|
||||
|
||||
Invulnerable = GlobalState.Instance.SessionSettings.GodMode;
|
||||
|
||||
_healthProvider.ResourceChanged += ((value, maxValue) =>
|
||||
|
|
@ -107,7 +112,8 @@ public partial class PlayerDamageReceiver : Area2D
|
|||
{
|
||||
if (!Enabled) return;
|
||||
GD.Print("Acid death");
|
||||
_healthProvider.CurrentResource = 0;
|
||||
_stateMachine.SetState(PlayerState.Drowning);
|
||||
//_healthProvider.CurrentResource = 0;
|
||||
}
|
||||
|
||||
public void Hit(float damage, DamageType type = DamageType.Neutral)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue