Merge branch 'main' of https://git.zenny.quest/zenayi/GameJamDungeon
This commit is contained in:
@@ -44,6 +44,8 @@ public interface IPlayer : IKillable
|
||||
|
||||
public void ModifyBonusLuck(double amount);
|
||||
|
||||
public void SetHealthTimerStatus(bool isActive);
|
||||
|
||||
public IInventory Inventory { get; }
|
||||
|
||||
public PlayerStats Stats { get; }
|
||||
|
||||
@@ -62,6 +62,9 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
#region Exports
|
||||
[Export]
|
||||
private PlayerStatResource _playerStatResource { get; set; } = default!;
|
||||
|
||||
[Export]
|
||||
private bool HealthTimerIsActive = false;
|
||||
#endregion
|
||||
|
||||
#region Node Dependencies
|
||||
@@ -199,14 +202,14 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
{
|
||||
SetProcessInput(true);
|
||||
SetPhysicsProcess(true);
|
||||
HealthTimer.Start();
|
||||
SetHealthTimerStatus(HealthTimerIsActive);
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
HealthTimer.Stop();
|
||||
SetHealthTimerStatus(false);
|
||||
}
|
||||
|
||||
public void Attack()
|
||||
@@ -270,6 +273,14 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
Stats.SetLuck(Stats.Luck.Value + amount);
|
||||
}
|
||||
|
||||
public void SetHealthTimerStatus(bool isActive)
|
||||
{
|
||||
if (isActive)
|
||||
HealthTimer.Start();
|
||||
else
|
||||
HealthTimer.Stop();
|
||||
}
|
||||
|
||||
public void Move(float delta)
|
||||
{
|
||||
var rawInput = GlobalInputVector;
|
||||
|
||||
@@ -376,7 +376,6 @@ shape = SubResource("CapsuleShape3D_dw45s")
|
||||
unique_name_in_owner = true
|
||||
process_mode = 1
|
||||
wait_time = 3.0
|
||||
autostart = true
|
||||
|
||||
[node name="Animation" type="Node3D" parent="."]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user