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