2-24-16 build changes
This commit is contained in:
@@ -7,6 +7,7 @@ using System;
|
||||
using System.Linq;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
using Zennysoft.Ma.Adapter.Entity;
|
||||
using static Zennysoft.Ma.Adapter.AppLogic;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -203,6 +204,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
SetProcessInput(true);
|
||||
SetPhysicsProcess(true);
|
||||
SetHealthTimerStatus(HealthTimerIsActive);
|
||||
Hitbox.SetDeferred(Area3D.PropertyName.Monitoring, true);
|
||||
Hitbox.SetDeferred(Area3D.PropertyName.Monitorable, true);
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
@@ -211,6 +214,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
SetHealthTimerStatus(false);
|
||||
Hitbox.SetDeferred(Area3D.PropertyName.Monitoring, false);
|
||||
Hitbox.SetDeferred(Area3D.PropertyName.Monitorable, false);
|
||||
}
|
||||
|
||||
public void SetHealthTimerStatus(bool isActive)
|
||||
@@ -264,6 +269,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
|
||||
public void PlayJumpScareAnimation() => PlayerFXAnimations.Play("jump_scare");
|
||||
|
||||
|
||||
public void IdentifyItem(IBaseInventoryItem unidentifiedItem) => _itemReroller.RerollItem(unidentifiedItem, Inventory);
|
||||
|
||||
public int TotalAttack => AttackComponent.CurrentAttack.Value + EquipmentComponent.BonusAttack;
|
||||
@@ -564,7 +570,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
{
|
||||
get
|
||||
{
|
||||
var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
|
||||
var rawInput = Godot.Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
|
||||
var input = new Vector3
|
||||
{
|
||||
X = rawInput.X,
|
||||
@@ -600,11 +606,11 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
HealthComponent.LowerMaximumHP(hpIncrease);
|
||||
}
|
||||
|
||||
private static float LeftStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeLeft);
|
||||
private static float LeftStrafeInputVector => Godot.Input.GetActionStrength(GameInputs.StrafeLeft);
|
||||
|
||||
private static float RightStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeRight);
|
||||
private static float RightStrafeInputVector => Godot.Input.GetActionStrength(GameInputs.StrafeRight);
|
||||
|
||||
private void Attack()
|
||||
private async void Attack()
|
||||
{
|
||||
var weapon = EquipmentComponent.EquippedWeapon.Value as Weapon;
|
||||
if (weapon.WeaponTag == WeaponTag.ElementalProjectile || weapon.WeaponTag == WeaponTag.KineticProjectile)
|
||||
@@ -612,13 +618,18 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
HandleProjectile(weapon);
|
||||
return;
|
||||
}
|
||||
if (WeaponAnimations.IsPlaying())
|
||||
return;
|
||||
|
||||
PlayAttackAnimation();
|
||||
|
||||
if (PlayerIsHittingGeometry())
|
||||
WeaponAnimations.Play("hit_wall");
|
||||
else if (!WeaponAnimations.IsPlaying())
|
||||
PlayAttackAnimation();
|
||||
else
|
||||
{
|
||||
await ToSignal(GetTree().CreateTimer(0.15f), "timeout");
|
||||
WeaponAnimations.Stop();
|
||||
WeaponAnimations.Play("Hit Wall");
|
||||
return;
|
||||
}
|
||||
|
||||
if (weapon.WeaponTag == WeaponTag.DegradeOnSwing)
|
||||
_playerEffectService.Degrade();
|
||||
|
||||
Reference in New Issue
Block a user