Fix Enemy logic
This commit is contained in:
@@ -13,6 +13,7 @@ public class PlayerStatController
|
|||||||
_currentVT.OnNext(playerStats.CurrentVT);
|
_currentVT.OnNext(playerStats.CurrentVT);
|
||||||
_maximumVT.OnNext(playerStats.MaximumVT);
|
_maximumVT.OnNext(playerStats.MaximumVT);
|
||||||
_currentExp.OnNext(playerStats.CurrentExp);
|
_currentExp.OnNext(playerStats.CurrentExp);
|
||||||
|
_expToNextLevel.OnNext(playerStats.ExpToNextLevel);
|
||||||
_currentLevel.OnNext(playerStats.CurrentLevel);
|
_currentLevel.OnNext(playerStats.CurrentLevel);
|
||||||
_currentAttack.OnNext(playerStats.CurrentAttack);
|
_currentAttack.OnNext(playerStats.CurrentAttack);
|
||||||
_bonusAttack.OnNext(playerStats.BonusAttack);
|
_bonusAttack.OnNext(playerStats.BonusAttack);
|
||||||
@@ -20,7 +21,6 @@ public class PlayerStatController
|
|||||||
_currentDefense.OnNext(playerStats.CurrentDefense);
|
_currentDefense.OnNext(playerStats.CurrentDefense);
|
||||||
_bonusDefense.OnNext(playerStats.BonusDefense);
|
_bonusDefense.OnNext(playerStats.BonusDefense);
|
||||||
_maxDefense.OnNext(playerStats.MaxDefense);
|
_maxDefense.OnNext(playerStats.MaxDefense);
|
||||||
_expToNextLevel.OnNext(playerStats.ExpToNextLevel);
|
|
||||||
_luck.OnNext(playerStats.Luck);
|
_luck.OnNext(playerStats.Luck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient
|
|||||||
if (!_canMove)
|
if (!_canMove)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var enemy = GetParent() as IEnemy;
|
var enemy = GetOwner() as IEnemy;
|
||||||
enemy.Move(safeVelocity);
|
enemy.Move(safeVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient
|
|||||||
var rng = new RandomNumberGenerator();
|
var rng = new RandomNumberGenerator();
|
||||||
rng.Randomize();
|
rng.Randomize();
|
||||||
_patrolTimer.WaitTime = rng.RandfRange(5.0f, 10.0f);
|
_patrolTimer.WaitTime = rng.RandfRange(5.0f, 10.0f);
|
||||||
var enemy = GetParent() as ICanPatrol;
|
var enemy = GetOwner() as ICanPatrol;
|
||||||
enemy.Patrol();
|
enemy.Patrol();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
|||||||
|
|
||||||
private void ExpToNextLevel_Sync(int obj) => EXPValue.Text = $"{Player.Stats.CurrentExp.Value}/{obj}";
|
private void ExpToNextLevel_Sync(int obj) => EXPValue.Text = $"{Player.Stats.CurrentExp.Value}/{obj}";
|
||||||
|
|
||||||
// TODO: Change font style when EXP Bonus effect is active
|
|
||||||
private void CurrentExp_Sync(double obj) => EXPValue.Text = $"{obj}/{Player.Stats.ExpToNextLevel.Value}";
|
private void CurrentExp_Sync(double obj) => EXPValue.Text = $"{obj}/{Player.Stats.ExpToNextLevel.Value}";
|
||||||
|
|
||||||
private void MaxDefense_Sync(int obj) => DEFValue.Text = $"{Player.Stats.CurrentDefense.Value}/{obj}";
|
private void MaxDefense_Sync(int obj) => DEFValue.Text = $"{Player.Stats.CurrentDefense.Value}/{obj}";
|
||||||
|
|||||||
@@ -384,9 +384,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
|||||||
|
|
||||||
public void Equip(EquipableItem equipable)
|
public void Equip(EquipableItem equipable)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(equipable.ItemName))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (equipable is Weapon weapon)
|
if (equipable is Weapon weapon)
|
||||||
{
|
{
|
||||||
Unequip(_equippedWeapon.Value);
|
Unequip(_equippedWeapon.Value);
|
||||||
@@ -407,15 +404,10 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new NotImplementedException("Item type is not supported.");
|
throw new NotImplementedException("Item type is not supported.");
|
||||||
|
|
||||||
_gameRepo.OnEquippedItem(equipable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unequip(EquipableItem equipable)
|
public void Unequip(EquipableItem equipable)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(equipable.ItemName))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (equipable is Weapon weapon)
|
if (equipable is Weapon weapon)
|
||||||
{
|
{
|
||||||
weapon.IsEquipped = false;
|
weapon.IsEquipped = false;
|
||||||
@@ -443,8 +435,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
|||||||
|
|
||||||
if (equipable.ItemTag == ItemTag.BreaksOnChange)
|
if (equipable.ItemTag == ItemTag.BreaksOnChange)
|
||||||
Inventory.Remove(equipable);
|
Inventory.Remove(equipable);
|
||||||
|
|
||||||
_gameRepo.OnUnequippedItem(equipable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Vector3 GlobalInputVector
|
private static Vector3 GlobalInputVector
|
||||||
|
|||||||
Reference in New Issue
Block a user