diff --git a/Zennysoft.Game.Abstractions/Entity/IHealthComponent.cs b/Zennysoft.Game.Abstractions/Entity/IHealthComponent.cs deleted file mode 100644 index c64c587f..00000000 --- a/Zennysoft.Game.Abstractions/Entity/IHealthComponent.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Zennysoft.Game.Abstractions; - -public interface IHealthComponent -{ - int MaximumHP { get; } - - int CurrentHP { get; set; } -} diff --git a/Zennysoft.Game.Godot.Implementation/Components/AttackComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/AttackComponent.cs new file mode 100644 index 00000000..59f0909d --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/AttackComponent.cs @@ -0,0 +1,52 @@ +using Chickensoft.Collections; +using Godot; + +namespace Zennysoft.Game.Implementation.Components; + +public class AttackComponent +{ + public IAutoProp CurrentAttack => _currentAttack; + + public IAutoProp MaximumAttack => _maximumAttack; + + public IAutoProp BonusAttack => _bonusAttack; + + public int TotalAttack => CurrentAttack.Value + BonusAttack.Value; + + private readonly AutoProp _currentAttack; + + private readonly AutoProp _maximumAttack; + + private readonly AutoProp _bonusAttack; + + public AttackComponent(int attackValue) + { + _maximumAttack = new AutoProp(attackValue); + _currentAttack = new AutoProp(attackValue); + _bonusAttack = new AutoProp(0); + } + + public void Restore(int restoreAmount) + { + var cappedAmount = Math.Min(restoreAmount + _currentAttack.Value, _maximumAttack.Value); + _currentAttack.OnNext(cappedAmount); + } + + public void Reduce(int reduceAmount) + { + var cappedAmount = Math.Max(_currentAttack.Value - reduceAmount, 0); + _currentAttack.OnNext(cappedAmount); + } + + public void SetAttack(int attack) + { + var cappedAmount = Math.Min(attack, _maximumAttack.Value); + _currentAttack.OnNext(cappedAmount); + } + + public void RaiseMaximumAttack(int raiseAmount) + { + _maximumAttack.OnNext(raiseAmount); + Restore(raiseAmount); + } +} diff --git a/Zennysoft.Game.Godot.Implementation/Components/DefenseComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/DefenseComponent.cs new file mode 100644 index 00000000..1e6c501e --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/DefenseComponent.cs @@ -0,0 +1,62 @@ +using Chickensoft.Collections; +using Godot; + +namespace Zennysoft.Game.Implementation.Components; + +public class DefenseComponent +{ + public IAutoProp CurrentDefense => _currentDefense; + + public IAutoProp MaximumDefense => _maximumDefense; + + public IAutoProp BonusDefense => _bonusDefense; + + private readonly AutoProp _currentDefense; + + private readonly AutoProp _maximumDefense; + + private readonly AutoProp _bonusDefense; + + public int TotalDefense => CurrentDefense.Value + BonusDefense.Value; + + public DefenseComponent(int defenseValue) + { + _maximumDefense = new AutoProp(defenseValue); + _currentDefense = new AutoProp(defenseValue); + _bonusDefense = new AutoProp(0); + } + + public void Restore(int restoreAmount) + { + var cappedAmount = Math.Min(restoreAmount + _currentDefense.Value, _maximumDefense.Value); + _currentDefense.OnNext(cappedAmount); + } + + public void Reduce(int reduceAmount) + { + var cappedAmount = Math.Max(_currentDefense.Value - reduceAmount, 0); + _currentDefense.OnNext(cappedAmount); + } + + public void SetDefense(int attack) + { + var cappedAmount = Math.Min(attack, _maximumDefense.Value); + _currentDefense.OnNext(cappedAmount); + } + + public void RaiseMaximumDefense(int raiseAmount) + { + _maximumDefense.OnNext(raiseAmount); + Restore(raiseAmount); + } + + public void RaiseBonusDefense(int raiseAmount) + { + _bonusDefense.OnNext(_bonusDefense.Value + raiseAmount); + } + + public void ResetBonusDefense() + { + _bonusDefense.OnNext(0); + } +} diff --git a/Zennysoft.Game.Ma.Implementation/Item/Tags/ElementType.cs b/Zennysoft.Game.Godot.Implementation/Components/ElementType.cs similarity index 100% rename from Zennysoft.Game.Ma.Implementation/Item/Tags/ElementType.cs rename to Zennysoft.Game.Godot.Implementation/Components/ElementType.cs diff --git a/Zennysoft.Game.Godot.Implementation/Components/ExperiencePointsComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/ExperiencePointsComponent.cs new file mode 100644 index 00000000..a13748d5 --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/ExperiencePointsComponent.cs @@ -0,0 +1,54 @@ +using Chickensoft.Collections; + +namespace Zennysoft.Game.Implementation.Components; + +public class ExperiencePointsComponent +{ + public IAutoProp CurrentExp => _currentExp; + + public IAutoProp ExpToNextLevel => _expToNextLevel; + + public IAutoProp ExpGainRate => _expGainRate; + + public IAutoProp Level => _level; + + private readonly AutoProp _currentExp; + + private readonly AutoProp _expToNextLevel; + + private readonly AutoProp _expGainRate; + + private readonly AutoProp _level; + + public ExperiencePointsComponent() + { + var firstLevelExpRequirement = ExpToNextLevelCalculation(1); + _expToNextLevel = new AutoProp(firstLevelExpRequirement); + _currentExp = new AutoProp(0); + _expGainRate = new AutoProp(1.0); + _level = new AutoProp(1); + } + + public void Gain(int baseExpGain) + { + var modifiedExpGain = baseExpGain * _expGainRate.Value; + var newCurrentExpTotal = modifiedExpGain + _currentExp.Value; + while (modifiedExpGain + _currentExp.Value >= _expToNextLevel.Value) + LevelUp(); + var cappedAmount = Math.Min(baseExpGain + _currentExp.Value, _expToNextLevel.Value); + _currentExp.OnNext(cappedAmount); + } + + public void LevelUp() + { + _level.OnNext(_level.Value + 1); + var expToNextLevel = ExpToNextLevelCalculation(_level.Value); + _currentExp.OnNext(_currentExp.Value - _expToNextLevel.Value); + _expToNextLevel.OnNext(expToNextLevel); + } + + private int ExpToNextLevelCalculation(int nextLevel) + { + return (int)(6.5 * nextLevel + 4.5 * Math.Pow(nextLevel, 2) + Math.Pow(nextLevel, 3)); + } +} diff --git a/Zennysoft.Game.Godot.Implementation/Components/HealthComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/HealthComponent.cs new file mode 100644 index 00000000..9b3d6efb --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/HealthComponent.cs @@ -0,0 +1,54 @@ +using Chickensoft.Collections; + +namespace Zennysoft.Game.Implementation.Components; + +public class HealthComponent +{ + public IAutoProp CurrentHP => _currentHP; + + public IAutoProp MaximumHP => _maximumHP; + + private readonly AutoProp _currentHP; + + private readonly AutoProp _maximumHP; + + public event Action? HealthReachedZero; + public event Action? DamageTaken; + + public bool AtFullHealth => CurrentHP.Value == MaximumHP.Value; + + public HealthComponent(int initialHP) + { + _maximumHP = new AutoProp(initialHP); + _currentHP = new AutoProp(initialHP); + } + + public void Heal(int healAmount) + { + var cappedAmount = Math.Min(healAmount + _currentHP.Value, _maximumHP.Value); + _currentHP.OnNext(cappedAmount); + } + + public void Damage(int damageAmount) + { + var cappedAmount = Math.Max(_currentHP.Value - damageAmount, 0); + _currentHP.OnNext(cappedAmount); + + if (cappedAmount == 0) + HealthReachedZero?.Invoke(); + else + DamageTaken?.Invoke(); + } + + public void SetHealth(int health) + { + var cappedAmount = Math.Min(health, _maximumHP.Value); + _currentHP.OnNext(cappedAmount); + } + + public void RaiseMaximumHP(int raiseAmount) + { + _maximumHP.OnNext(raiseAmount); + Heal(raiseAmount); + } +} diff --git a/Zennysoft.Game.Godot.Implementation/Components/LuckComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/LuckComponent.cs new file mode 100644 index 00000000..ffc2ccd9 --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/LuckComponent.cs @@ -0,0 +1,17 @@ +using Chickensoft.Collections; + +namespace Zennysoft.Game.Implementation.Components; + +public class LuckComponent +{ + public IAutoProp Luck => _luck; + + private AutoProp _luck; + + public LuckComponent(int initialLuck) + { + _luck = new AutoProp(initialLuck); + } + + public void SetLuck(int value) => _luck.OnNext(value); +} diff --git a/Zennysoft.Game.Godot.Implementation/Components/VTComponent.cs b/Zennysoft.Game.Godot.Implementation/Components/VTComponent.cs new file mode 100644 index 00000000..666d637a --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Components/VTComponent.cs @@ -0,0 +1,46 @@ +using Chickensoft.Collections; + +namespace Zennysoft.Game.Implementation.Components; + +public class VTComponent +{ + public IAutoProp CurrentVT => _currentVT; + + public IAutoProp MaximumVT => _maximumVT; + + private readonly AutoProp _currentVT; + + private readonly AutoProp _maximumVT; + + public bool AtFullVT => CurrentVT.Value == MaximumVT.Value; + + public VTComponent(int initialVT) + { + _maximumVT = new AutoProp(initialVT); + _currentVT = new AutoProp(initialVT); + } + + public void Restore(int restoreAmount) + { + var cappedAmount = Math.Min(restoreAmount + _currentVT.Value, _maximumVT.Value); + _currentVT.OnNext(cappedAmount); + } + + public void Reduce(int reduceAmount) + { + var cappedAmount = Math.Max(_currentVT.Value - reduceAmount, 0); + _currentVT.OnNext(cappedAmount); + } + + public void SetVT(int vt) + { + var cappedAmount = Math.Min(vt, _maximumVT.Value); + _currentVT.OnNext(cappedAmount); + } + + public void RaiseMaximumVT(int raiseAmount) + { + _maximumVT.OnNext(raiseAmount); + Restore(raiseAmount); + } +} diff --git a/Zennysoft.Game.Ma.Implementation/Entity/IEnemy.cs b/Zennysoft.Game.Ma.Implementation/Entity/IEnemy.cs index 8b508df2..121c46bc 100644 --- a/Zennysoft.Game.Ma.Implementation/Entity/IEnemy.cs +++ b/Zennysoft.Game.Ma.Implementation/Entity/IEnemy.cs @@ -1,5 +1,6 @@ using Godot; using System.Collections.Immutable; +using Zennysoft.Game.Implementation.Components; using Zennysoft.Game.Ma; namespace Zennysoft.Ma.Adapter.Entity @@ -25,5 +26,15 @@ namespace Zennysoft.Ma.Adapter.Entity public void LookAtTarget(Vector3 target); public IDungeonRoom GetCurrentRoom(ImmutableList dungeonRooms); + + public AttackComponent AttackComponent { get; } + + public DefenseComponent DefenseComponent { get; } + + public int InitialHP { get; } + + public int InitialAttack { get; } + + public int InitialDefense { get; } } } \ No newline at end of file diff --git a/Zennysoft.Game.Ma.Implementation/Player/IPlayer.cs b/Zennysoft.Game.Ma.Implementation/Player/IPlayer.cs index e93adc19..f264599f 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/IPlayer.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/IPlayer.cs @@ -1,6 +1,7 @@ using Chickensoft.Collections; using Godot; using Zennysoft.Game.Abstractions; +using Zennysoft.Game.Implementation.Components; namespace Zennysoft.Ma.Adapter; @@ -18,38 +19,16 @@ public interface IPlayer : IKillable public void Knockback(float impulse); - public void GainExp(double expGained); - public void LevelUp(); public void Move(float delta); public void TeleportPlayer(Transform3D newTransform); - public void HealHP(int amount); - - public void RaiseHP(int amount); - - public void HealVT(int amount); - - public void RaiseVT(int amount); - - public void ModifyBonusAttack(int amount); - - public void ModifyBonusDefense(int amount); - - public void ModifyMaximumHP(int amount); - - public void ModifyMaximumVT(int amount); - - public void ModifyBonusLuck(double amount); - public void SetHealthTimerStatus(bool isActive); public IInventory Inventory { get; } - public PlayerStats Stats { get; } - public Vector3 CurrentPosition { get; } public Basis CurrentBasis { get; } @@ -63,4 +42,16 @@ public interface IPlayer : IKillable public void Equip(EquipableItem equipable); public void Unequip(EquipableItem equipable); + + public HealthComponent HealthComponent { get; } + + public VTComponent VTComponent { get; } + + public AttackComponent AttackComponent { get; } + + public DefenseComponent DefenseComponent { get; } + + public ExperiencePointsComponent ExperiencePointsComponent { get; } + + public LuckComponent LuckComponent { get; } } diff --git a/Zennysoft.Game.Ma.Implementation/Player/PlayerData.cs b/Zennysoft.Game.Ma.Implementation/Player/PlayerData.cs index c61a6ec4..f7e2c243 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/PlayerData.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/PlayerData.cs @@ -7,9 +7,6 @@ namespace Zennysoft.Game.Ma; [Meta, Id("player_data")] public partial record PlayerData { - [Save("player_stats")] - public required PlayerStats PlayerStats { get; init; } - [Save("player_inventory")] public required IInventory Inventory { get; init; } } diff --git a/Zennysoft.Game.Ma.Implementation/Player/PlayerStats.cs b/Zennysoft.Game.Ma.Implementation/Player/PlayerStats.cs deleted file mode 100644 index 7e384006..00000000 --- a/Zennysoft.Game.Ma.Implementation/Player/PlayerStats.cs +++ /dev/null @@ -1,115 +0,0 @@ -namespace Zennysoft.Ma.Adapter; - -using Chickensoft.Collections; -using Godot; - -public class PlayerStats -{ - public PlayerStats(AutoProp currentHP, - AutoProp maximumHP, - AutoProp currentVT, - AutoProp maximumVT, - AutoProp currentAttack, - AutoProp maxAttack, - AutoProp bonusAttack, - AutoProp currentDefense, - AutoProp maxDefense, - AutoProp bonusDefense, - AutoProp currentExp, - AutoProp expToNextLevel, - AutoProp currentLevel, - AutoProp luck) - { - CurrentHP = currentHP; - MaximumHP = maximumHP; - CurrentVT = currentVT; - MaximumVT = maximumVT; - CurrentAttack = currentAttack; - MaxAttack = maxAttack; - BonusAttack = bonusAttack; - CurrentDefense = currentDefense; - MaxDefense = maxDefense; - BonusDefense = bonusDefense; - CurrentExp = currentExp; - ExpToNextLevel = expToNextLevel; - CurrentLevel = currentLevel; - Luck = luck; - } - - public AutoProp CurrentHP { get; init; } - public AutoProp MaximumHP { get; init; } - public AutoProp CurrentVT { get; init; } - public AutoProp MaximumVT { get; init; } - public AutoProp CurrentAttack { get; init; } - public AutoProp MaxAttack { get; init; } - public AutoProp BonusAttack { get; init; } - public AutoProp CurrentDefense { get; init; } - public AutoProp MaxDefense { get; init; } - public AutoProp BonusDefense { get; init; } - public AutoProp CurrentExp { get; init; } - public AutoProp ExpToNextLevel { get; init; } - public AutoProp CurrentLevel { get; init; } - public AutoProp Luck { get; init; } - - public void SetCurrentHP(int newValue) - { - var clampedValue = Mathf.Clamp(newValue, 0, MaximumHP.Value); - CurrentHP.OnNext(clampedValue); - } - public void SetMaximumHP(int newValue) - { - MaximumHP.OnNext(newValue); - } - public void SetCurrentVT(int newValue) - { - var clampedValue = Mathf.Clamp(newValue, 0, MaximumVT.Value); - CurrentVT.OnNext(clampedValue); - } - public void SetMaximumVT(int newValue) - { - MaximumVT.OnNext(newValue); - } - public void SetCurrentExp(double newValue) - { - CurrentExp.OnNext(newValue); - } - public void SetCurrentLevel(int newValue) - { - CurrentLevel.OnNext(newValue); - } - public void SetCurrentAttack(int newValue) - { - var clampedValue = Mathf.Clamp(newValue, 0, MaxAttack.Value); - CurrentAttack.OnNext(clampedValue); - } - public void SetBonusAttack(int newValue) - { - BonusAttack.OnNext(newValue); - } - public void SetMaxAttack(int newValue) - { - MaxAttack.OnNext(newValue); - } - public void SetCurrentDefense(int newValue) - { - var clampedValue = Mathf.Clamp(newValue, 0, MaxDefense.Value); - CurrentDefense.OnNext(clampedValue); - } - public void SetBonusDefense(int newValue) - { - BonusDefense.OnNext(newValue); - } - public void SetMaxDefense(int newValue) - { - MaxDefense.OnNext(newValue); - } - public void SetExpToNextLevel(int newValue) - { - ExpToNextLevel.OnNext(newValue); - } - public void SetLuck(double newValue) - { - var clampedValue = Mathf.Clamp(newValue, 0, 1.0); - Luck.OnNext(clampedValue); - } -} \ No newline at end of file diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.Input.cs b/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.Input.cs index d35e22d6..17a5f270 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.Input.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.Input.cs @@ -14,8 +14,6 @@ public partial class PlayerLogic public readonly record struct Attack; - public readonly record struct AttackAnimationFinished; - public readonly record struct Die; } } diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.cs b/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.cs index 59fac969..7efb92c1 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/State/PlayerLogic.cs @@ -9,5 +9,5 @@ public interface IPlayerLogic : ILogicBlock; [LogicBlock(typeof(State), Diagram = true)] public partial class PlayerLogic : LogicBlock, IPlayerLogic { - public override Transition GetInitialState() => To(); + public override Transition GetInitialState() => To(); } diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Attacking.cs b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Attacking.cs deleted file mode 100644 index 38f0111a..00000000 --- a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Attacking.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Chickensoft.Introspection; - -namespace Zennysoft.Ma.Adapter; - -public partial class PlayerLogic -{ - public partial record State - { - [Meta] - public partial record Attacking : Alive, IGet - { - public Transition On(in Input.AttackAnimationFinished input) - { - return To(); - } - } - } -} diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Idle.cs b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Idle.cs deleted file mode 100644 index 08712e88..00000000 --- a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.Idle.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Chickensoft.Introspection; -using Godot; - -namespace Zennysoft.Ma.Adapter; - -public partial class PlayerLogic -{ - public abstract partial record State - { - [Meta, Id("player_logic_state_alive_idle")] - public partial record Idle : Alive, IGet - { - - public virtual Transition On(in Input.Attack input) - { - GD.Print("Attacking..."); - Output(new Output.Animations.Attack()); - return To(); - } - } - } -} diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.cs b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.cs index e4355f99..f89d21f8 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Alive.cs @@ -8,7 +8,7 @@ public partial class PlayerLogic public partial record State { [Meta, Id("player_logic_alive")] - public abstract partial record Alive : State, IGet, IGet + public partial record Alive : State, IGet, IGet { public virtual Transition On(in Input.PhysicsTick input) { diff --git a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Disabled.cs b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Disabled.cs index f22c66b6..edf0f688 100644 --- a/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Disabled.cs +++ b/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Disabled.cs @@ -16,7 +16,7 @@ public partial class PlayerLogic OnDetach(() => Get().GameEntered -= OnGameEntered); } - public Transition On(in Input.Enable input) => To(); + public Transition On(in Input.Enable input) => To(); public void OnGameEntered() => Input(new Input.Enable()); } diff --git a/Zennysoft.Game.Ma/Ma.csproj b/Zennysoft.Game.Ma/Ma.csproj index 0ca2470c..853d610d 100644 --- a/Zennysoft.Game.Ma/Ma.csproj +++ b/Zennysoft.Game.Ma/Ma.csproj @@ -1,4 +1,4 @@ - + net8.0 true diff --git a/Zennysoft.Game.Ma/src/enemy/BossTypeA.cs b/Zennysoft.Game.Ma/src/enemy/BossTypeA.cs index 74ea4d51..089713a7 100644 --- a/Zennysoft.Game.Ma/src/enemy/BossTypeA.cs +++ b/Zennysoft.Game.Ma/src/enemy/BossTypeA.cs @@ -4,97 +4,76 @@ using Godot; using System.Collections.Generic; using System; using Zennysoft.Ma.Adapter; -using System.Linq; -using Zennysoft.Ma.Adapter.Entity; -using System.Collections.Immutable; namespace Zennysoft.Game.Ma; [Meta(typeof(IAutoNode))] -public partial class BossTypeA : CharacterBody3D +public partial class BossTypeA : Enemy, IHaveEngagePlayerBehavior, IHaveFollowBehavior { public override void _Notification(int what) => this.Notify(what); - public EnemyLogic.IBinding EnemyBinding { get; set; } = default!; - - - [Dependency] protected IPlayer _player => this.DependOn(() => GetParent().GetChildren().OfType().Single()); - [Export] public ElementType PrimaryAttackElementalType { get; set; } = ElementType.None; [Export] public double PrimaryAttackElementalDamageBonus { get; set; } = 1.0; - [Export] protected EnemyStatResource _enemyStatResource { get; set; } = default!; - public ElementType SecondaryAttackElementalType { get; set; } = ElementType.None; public double SecondaryAttackElementalDamageBonus { get; set; } = 1.0; - [Node] public BossTypeAEnemyModelView _enemyModelView { get; set; } - [Node] public CollisionShape3D EnemyHitbox { get; set; } = default!; [Node] private Node3D _rotation { get; set; } = default!; - [Node] protected Timer _attackTimer { get; set; } = default!; - [Node] private CollisionShape3D _collisionShape { get; set; } = default!; - public float ThinkTime { get; } - private Vector3 _target; + [Node] public override IEnemyModelView EnemyModelView { get; set; } = default!; + + [Node] public FollowBehavior FollowBehavior { get; set; } = default!; + + [Node] public EngagePlayerBehavior EngagePlayerBehavior { get; set; } = default!; + + [Node] public NavigationAgent3D NavigationAgent { get; set; } + + [Node] public Area3D PlayerDetector { get; set; } = default!; private float _movementSpeed = 2.0f; - private void OnHPChanged(double newHP) - { - if (newHP <= 0) - Die(); - } - - public void Idle() - { - _enemyModelView.PlayIdleAnimation(); - } - - public void Move() - { - _enemyModelView.PlayWalkAnimation(); - } - - public virtual void Die() - { - SetProcess(false); - _movementSpeed = 0; - _collisionShape.SetDeferred("disabled", true); - _enemyModelView.PlayDeathAnimation(); - var tweener = CreateTween(); - tweener.TweenInterval(1.0f); - tweener.TweenCallback(Callable.From(QueueFree)); - } - public void OnReady() { - _target = GlobalPosition; + FollowBehavior.Init(NavigationAgent); + FollowBehavior.OnVelocityComputed += OnVelocityComputed; + EngagePlayerBehavior.TakeAction += PerformAction; + PlayerDetector.BodyEntered += PlayerDetector_BodyEntered; + PlayerDetector.BodyExited += PlayerDetector_BodyExited; + _enemyLogic.Input(new EnemyLogic.Input.Idle()); SetPhysicsProcess(true); - _enemyModelView.Hitbox.AreaEntered += Hitbox_AreaEntered; - _attackTimer.Start(); } public void OnPhysicsProcess(double delta) { - var direction = GlobalPosition.DirectionTo(_target).Normalized(); + var direction = GlobalPosition.DirectionTo(_player.CurrentPosition).Normalized(); var rotationAngle = GetRotationAngle(); if (GlobalBasis.Z.AngleTo(_player.CurrentBasis.Z) > Mathf.DegToRad(60)) { RotateToPlayer(rotationAngle); - _enemyModelView.PlayIdleAnimation(); + EnemyModelView.PlayIdleAnimation(); return; } } - public void PerformAction() + protected void OnVelocityComputed(Vector3 safeVelocity) + { + Velocity = safeVelocity; + if (Velocity > Vector3.Zero) + _enemyLogic.Input(new EnemyLogic.Input.Move()); + else + _enemyLogic.Input(new EnemyLogic.Input.Idle()); + MoveAndSlide(); + } + + public override void PerformAction() { var rng = new RandomNumberGenerator(); var options = new List() { PrimaryAttack, SecondaryAttack }; @@ -104,54 +83,34 @@ public partial class BossTypeA : CharacterBody3D public void PrimaryAttack() { - _enemyModelView.PlayPrimaryAttackAnimation(); + EnemyModelView.PlayPrimaryAttackAnimation(); } public void SecondaryAttack() { - _enemyModelView.PlaySecondaryAttackAnimation(); + EnemyModelView.PlaySecondaryAttackAnimation(); } - public void StartAttackTimer() - { - _attackTimer.Timeout += OnAttackTimeout; - } - - public void StopAttackTimer() - { - _attackTimer.Timeout -= OnAttackTimeout; - } - - public void SetMovementTarget(Vector3 target) => _target = target; - private void Hitbox_AreaEntered(Area3D area) { var target = area.GetOwner(); if (target is IPlayer player) - { - var damage = _enemyStatResource.CurrentAttack * PrimaryAttackElementalDamageBonus; - player.TakeDamage(new Damage((int)damage, PrimaryAttackElementalType, BattleExtensions.IsCriticalHit(_enemyStatResource.Luck), false, false)); - } + player.TakeDamage(new Damage(AttackComponent.TotalAttack, PrimaryAttackElementalType, BattleExtensions.IsCriticalHit(7), false, false)); } public void StartFight() { + Activate(); + _enemyLogic.Input(new EnemyLogic.Input.Follow()); } - public void Activate() + public override void Activate() { Show(); EnemyHitbox.SetDeferred(CollisionShape3D.PropertyName.Disabled, false); } - private void OnAttackTimeout() - { - var rng = new RandomNumberGenerator(); - rng.Randomize(); - _attackTimer.Stop(); - _attackTimer.WaitTime = rng.RandfRange(2f, 5.0f); - _attackTimer.Start(); - } + public override void Die() => QueueFree(); public void RotateToPlayer(float rotationAngle) { @@ -169,6 +128,18 @@ public partial class BossTypeA : CharacterBody3D private void RotateTowardsPlayer(float angle) => Rotation = new Vector3(Rotation.X, angle, Rotation.Z); + protected void PlayerDetector_BodyEntered(Node3D node) + { + if (node is IPlayer) + _enemyLogic.Input(new EnemyLogic.Input.ReachedPlayer()); + } + + protected void PlayerDetector_BodyExited(Node3D node) + { + if (node is IPlayer) + _enemyLogic.Input(new EnemyLogic.Input.Follow()); + } + public override void _ExitTree() { } diff --git a/Zennysoft.Game.Ma/src/enemy/Enemy.cs b/Zennysoft.Game.Ma/src/enemy/Enemy.cs index 46c64af8..48943d6b 100644 --- a/Zennysoft.Game.Ma/src/enemy/Enemy.cs +++ b/Zennysoft.Game.Ma/src/enemy/Enemy.cs @@ -3,6 +3,7 @@ using Chickensoft.Introspection; using Godot; using System.Collections.Immutable; using System.Linq; +using Zennysoft.Game.Implementation.Components; using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter.Entity; @@ -25,17 +26,35 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide this.DependOn(() => GetParent().GetChildren().OfType().Single()); #endregion - #region Node Dependencies - [Node] private Area3D LineOfSight { get; set; } = default!; - [Node] private RayCast3D Raycast { get; set; } = default!; + public HealthComponent HealthComponent { get; private set; } - [Node] private HealthComponent _healthComponent { get; set; } = default!; - #endregion + public AttackComponent AttackComponent { get; private set; } + + public DefenseComponent DefenseComponent { get; private set; } public virtual IEnemyModelView EnemyModelView { get; set; } = default!; public Vector3 TargetPosition { get; private set; } + [ExportGroup("Enemy Stats")] + [Export] public int InitialHP { get; set; } = 50; + + [Export] public int InitialAttack { get; set; } = 8; + + [Export] public int InitialDefense { get; set; } = 8; + + [Export] public int ExpGiven { get; set; } = 10; + + public Enemy() + { + HealthComponent = new HealthComponent(InitialHP); + HealthComponent.HealthReachedZero += Die; + HealthComponent.DamageTaken += TakeHit; + + AttackComponent = new AttackComponent(InitialAttack); + DefenseComponent = new DefenseComponent(InitialDefense); + } + #region Godot methods public void Setup() { @@ -43,8 +62,6 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide this.Notify(what); + [Node] private Area3D LineOfSight { get; set; } = default!; + + [Node] private RayCast3D Raycast { get; set; } = default!; + public override IEnemyModelView EnemyModelView => _enemyModelView; [Node] private EnemyModelView2D _enemyModelView { get; set; } = default!; + public void OnReady() + { + LineOfSight.BodyEntered += LineOfSight_BodyEntered; + } + public override void _PhysicsProcess(double delta) { _enemyModelView.SetCurrentDirection(GlobalBasis, -_player.CurrentBasis.Z); @@ -45,4 +54,21 @@ public abstract partial class Enemy2D : Enemy protected void EngagePlayerBehavior_TakeAction() => EnemyModelView.PlayPrimaryAttackAnimation(); protected void EngagePlayerBehavior_AcquireTarget() => LookAt(new Vector3(_player.CurrentPosition.X, GlobalPosition.Y, _player.CurrentPosition.Z), Vector3.Up, true); + + private void LineOfSight_BodyEntered(Node3D body) + { + var overlappingBodies = LineOfSight.GetOverlappingBodies(); + foreach (var _ in overlappingBodies) + { + if (Raycast.GlobalPosition != _player.CurrentPosition) + Raycast.LookAt(_player.CurrentPosition, Vector3.Up); + Raycast.ForceRaycastUpdate(); + if (Raycast.IsColliding()) + { + var collider = Raycast.GetCollider(); + if (collider is IPlayer) + _enemyLogic.Input(new EnemyLogic.Input.Follow()); + } + } + } } diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs b/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs new file mode 100644 index 00000000..43625207 --- /dev/null +++ b/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs @@ -0,0 +1,9 @@ +namespace Zennysoft.Game.Ma; + +public enum EnemyDirection +{ + Left, + Right, + Forward, + Backward +} diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs.uid b/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs.uid new file mode 100644 index 00000000..edc40b46 --- /dev/null +++ b/Zennysoft.Game.Ma/src/enemy/EnemyDirection.cs.uid @@ -0,0 +1 @@ +uid://dhhn0twwj5en0 diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyModelView.cs b/Zennysoft.Game.Ma/src/enemy/EnemyModelView.cs index 0cc2473b..1e0c7720 100644 --- a/Zennysoft.Game.Ma/src/enemy/EnemyModelView.cs +++ b/Zennysoft.Game.Ma/src/enemy/EnemyModelView.cs @@ -1,6 +1,7 @@ using Chickensoft.AutoInject; using Chickensoft.Introspection; using Godot; +using System; namespace Zennysoft.Game.Ma; @@ -9,16 +10,47 @@ public abstract partial class EnemyModelView : Node3D, IEnemyModelView { public override void _Notification(int what) => this.Notify(what); - public virtual void PlayActivateAnimation() => throw new System.NotImplementedException(); + private readonly string _idleName = "Idle"; + private readonly string _walkingName = "Walking"; + private readonly string _primaryAttackName = "Primary Attack"; + private readonly string _secondaryAttackName = "Secondary Attack"; + private readonly string _activateName = "Activate"; + private readonly string _parametersPlayback = "parameters/playback"; + + [Node] public AnimationTree AnimationTree { get; set; } = default!; + + private AnimationNodeStateMachinePlayback _stateMachine; + + public event EventHandler HitPlayer; + + public void OnReady() + { + _stateMachine = (AnimationNodeStateMachinePlayback)AnimationTree.Get(_parametersPlayback); + } + + public virtual void PlayPrimaryAttackAnimation() => _stateMachine.Travel(_primaryAttackName); + + public virtual void PlaySecondaryAttackAnimation() => _stateMachine.Travel(_secondaryAttackName); + + public virtual void PlayPrimarySkillAnimation() => _stateMachine.Travel("Primary Skill"); + + public virtual void PlayIdleAnimation() => _stateMachine.Travel(_idleName); + + public virtual void PlayWalkAnimation() => _stateMachine.Travel(_walkingName); + + public virtual void PlayActivateAnimation() => _stateMachine.Travel(_activateName); + public virtual void PlayDeathAnimation() => throw new System.NotImplementedException(); + public virtual void PlayHitAnimation() => throw new System.NotImplementedException(); - public virtual void PlayIdleAnimation() => throw new System.NotImplementedException(); - public virtual void PlayPrimaryAttackAnimation() => throw new System.NotImplementedException(); - public virtual void PlayPrimarySkillAnimation() => throw new System.NotImplementedException(); - public virtual void PlaySecondaryAttackAnimation() => throw new System.NotImplementedException(); - public virtual void PlayWalkAnimation() => throw new System.NotImplementedException(); - [Signal] - public delegate void HitPlayerEventHandler(); + protected virtual void OnPlayerHit() + { + HitPlayer?.Invoke(this, EventArgs.Empty); + } + public override void _ExitTree() + { + AnimationTree.Get(_parametersPlayback).As().Stop(); + } } diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyModelView2D.cs b/Zennysoft.Game.Ma/src/enemy/EnemyModelView2D.cs index 3355296d..fcdc92f5 100644 --- a/Zennysoft.Game.Ma/src/enemy/EnemyModelView2D.cs +++ b/Zennysoft.Game.Ma/src/enemy/EnemyModelView2D.cs @@ -7,12 +7,6 @@ namespace Zennysoft.Game.Ma; [Meta(typeof(IAutoNode))] public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView { - private readonly string _idleName = "Idle"; - private readonly string _walkingName = "Walking"; - private readonly string _primaryAttackName = "Primary Attack"; - private readonly string _secondaryAttackName = "Secondary Attack"; - private readonly string _activateName = "Activate"; - public override void _Notification(int what) => this.Notify(what); [Export] public EnemyLoreInfo EnemyLoreInfo { get; set; } = default!; @@ -23,8 +17,6 @@ public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView [Node] public AnimationPlayer AnimationPlayer { get; set; } = default!; - [Node] public AnimationTree AnimationTree { get; set; } = default!; - [ExportGroup("Enemy Model Properties")] [Export(PropertyHint.Range, "0.0, 1.0")] private float _upperThreshold { get; set; } = 0.5f; @@ -33,40 +25,24 @@ public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView EnemyDirection _enemyDirection { get; set; } = EnemyDirection.Forward; - private AnimationNodeStateMachinePlayback _stateMachine; - - public void OnReady() + public new void OnReady() { - _stateMachine = (AnimationNodeStateMachinePlayback)AnimationTree.Get("parameters/playback"); - Hitbox.BodyEntered += Hitbox_BodyEntered; + Hitbox.AreaEntered += Hitbox_AreaEntered; + base.OnReady(); } - private void Hitbox_BodyEntered(Node3D body) => EmitSignal(SignalName.HitPlayer); + private void Hitbox_AreaEntered(Area3D area) => OnPlayerHit(); public void SetCurrentDirection(Basis enemyBasis, Vector3 cameraDirection) => _enemyDirection = GetEnemyDirection(enemyBasis, cameraDirection, _upperThreshold, _lowerThreshold); - public void PlayPrimaryAttackAnimation() => _stateMachine.Travel(_primaryAttackName); - - public void PlaySecondaryAttackAnimation() => _stateMachine.Travel(_secondaryAttackName); - - public void PlayPrimarySkillAnimation() => _stateMachine.Travel("Primary Skill"); - - public void PlayIdleAnimation() => _stateMachine.Travel(_idleName); - - public void PlayWalkAnimation() => _stateMachine.Travel(_walkingName); - - public void PlayActivateAnimation() - { - } - - public void PlayHitAnimation() + public override void PlayHitAnimation() { LoadShader("res://src/vfx/shaders/DamageHit.gdshader"); var tweener = GetTree().CreateTween(); tweener.TweenMethod(Callable.From((float x) => SetShaderValue(x)), 0.0f, 1.0f, 1.0f); } - public void PlayDeathAnimation() + public override void PlayDeathAnimation() { LoadShader("res://src/vfx/shaders/PixelMelt.gdshader"); var tweener = GetTree().CreateTween(); @@ -159,12 +135,4 @@ public partial class EnemyModelView2D : EnemyModelView, IEnemyModelView { _enemyDirection = EnemyDirection.Backward; } - - private enum EnemyDirection - { - Left, - Right, - Forward, - Backward - } } diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyModelView3D.cs b/Zennysoft.Game.Ma/src/enemy/EnemyModelView3D.cs index fdbda403..5d3819ad 100644 --- a/Zennysoft.Game.Ma/src/enemy/EnemyModelView3D.cs +++ b/Zennysoft.Game.Ma/src/enemy/EnemyModelView3D.cs @@ -5,70 +5,16 @@ using Godot; namespace Zennysoft.Game.Ma; [Meta(typeof(IAutoNode))] -public partial class EnemyModelView3D : EnemyModelView, IEnemyModelView +public partial class EnemyModelView3D : EnemyModelView { - private const string PRIMARY_ATTACK = "primary_attack"; - private const string SECONDARY_ATTACK = "secondary_attack"; - private const string PRIMARY_SKILL = "primary_skill"; - private const string WALK = "walk"; - private const string IDLE = "idle"; - private const string TAKE_DAMAGE = "take_damage"; - private const string DEFEATED = "defeated"; - private const string PARAMETERS_PLAYBACK = "parameters/playback"; - public override void _Notification(int what) => this.Notify(what); [Export] public EnemyLoreInfo EnemyLoreInfo { get; set; } = default!; [Node] private AnimationPlayer _animationPlayer { get; set; } = default!; - [Node] public AnimationTree AnimationTree { get; set; } = default!; - [Node] public MeshInstance3D MeshInstance { get; set; } = default!; - public void PlayPrimaryAttackAnimation() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(PRIMARY_ATTACK); - } - - public void PlaySecondaryAttackAnimation() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(SECONDARY_ATTACK); - } - - public void PlayPrimarySkillAnimation() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(PRIMARY_SKILL); - } - - public void PlayHitAnimation() - { - var tweener = CreateTween(); - ChangeMaterial(); - tweener.TweenMethod(Callable.From((float x) => SetTransparency(x)), 0.0f, 0.5f, 0.3f); - tweener.TweenCallback(Callable.From(ClearDamageEffect)); - } - - public void PlayDeathAnimation() - { - LoadShader("res://src/enemy/EnemyDie.tres"); - var tweener = CreateTween(); - tweener.TweenMethod(Callable.From((float x) => SetTransparency(x)), 0.0f, 1.0f, 0.8f); - tweener.TweenCallback(Callable.From(QueueFree)); - } - - public void PlayWalkAnimation() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(WALK); - } - - public void PlayActivateAnimation() => AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel("Activate"); - - public void PlayIdleAnimation() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE); - } - private void ChangeMaterial() { var material = new StandardMaterial3D @@ -94,14 +40,4 @@ public partial class EnemyModelView3D : EnemyModelView, IEnemyModelView { MeshInstance.Transparency = transparencyAmount; } - - public override void _ExitTree() - { - AnimationTree.Get(PARAMETERS_PLAYBACK).As().Stop(); - } - - public void SetCurrentDirection(Basis enemyBasis, Vector3 cameraDirection) - { - - } } diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyStatResource.cs b/Zennysoft.Game.Ma/src/enemy/EnemyStatResource.cs deleted file mode 100644 index bbbb154f..00000000 --- a/Zennysoft.Game.Ma/src/enemy/EnemyStatResource.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Godot; -using Zennysoft.Ma.Adapter.Entity; - -namespace Zennysoft.Game.Ma; - -[GlobalClass] -public partial class EnemyStatResource : Resource -{ - [Export] - public int CurrentAttack { get; set; } - - [Export] - public int CurrentDefense { get; set; } - - [Export] - public int MaxAttack { get; set; } - - [Export] - public int MaxDefense { get; set; } - - [Export] - public int ExpFromDefeat { get; set; } - - [Export] - public double Luck { get; set; } = 0.05f; - - [Export] - private double _telluricResistance { get; set; } - - [Export] - private double _aeolicResistance { get; set; } - - [Export] - private double _hydricResistance { get; set; } - - [Export] - private double _igneousResistance { get; set; } - - [Export] - private double _ferrumResistance { get; set; } - - public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(_aeolicResistance, _hydricResistance, _igneousResistance, _ferrumResistance, _telluricResistance); - - [Export] - public float DropsSoulGemChance { get; set; } = 0.75f; -} diff --git a/Zennysoft.Game.Ma/src/enemy/IEnemyModelView.cs b/Zennysoft.Game.Ma/src/enemy/IEnemyModelView.cs index c9bbfb7f..23f5a3c5 100644 --- a/Zennysoft.Game.Ma/src/enemy/IEnemyModelView.cs +++ b/Zennysoft.Game.Ma/src/enemy/IEnemyModelView.cs @@ -1,4 +1,5 @@ using Chickensoft.GodotNodeInterfaces; +using System; namespace Zennysoft.Game.Ma; @@ -20,5 +21,5 @@ public interface IEnemyModelView : INode3D public void PlayDeathAnimation(); - event EnemyModelView.HitPlayerEventHandler HitPlayer; + public event EventHandler HitPlayer; } diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.cs b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.cs index 3e6a61f8..cc663cde 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.cs +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.cs @@ -1,7 +1,6 @@ using Chickensoft.AutoInject; using Chickensoft.Introspection; using Godot; -using Zennysoft.Ma.Adapter; namespace Zennysoft.Game.Ma; @@ -17,7 +16,7 @@ public partial class Sproingy : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerB [Node] public Area3D PlayerDetector { get; set; } = default!; - public void OnReady() + public new void OnReady() { FollowBehavior.Init(NavigationAgent); PatrolBehavior.Init(NavigationAgent); diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.tscn index 53e14542..17c00cae 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/Sproingy.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=13 format=3 uid="uid://bs56ccgosmu47"] +[gd_scene load_steps=12 format=3 uid="uid://bs56ccgosmu47"] [ext_resource type="Script" uid="uid://cq6b4ma3sy1en" path="res://src/enemy/enemy_types/01. sproingy/Sproingy.cs" id="1_xsluo"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_drfkj"] [ext_resource type="PackedScene" uid="uid://bimjnsu52y3xi" path="res://src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn" id="4_o3b7p"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_p4gkk"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="5_drfkj"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_moun4"] @@ -100,7 +99,3 @@ _acquireTargetTime = 2.0 unique_name_in_owner = true avoidance_enabled = true radius = 1.0 - -[node name="HealthComponent" parent="Components" instance=ExtResource("4_p4gkk")] -unique_name_in_owner = true -InitialMaximumHP = 30 diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn index 89d1f93c..279f902b 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn @@ -819,6 +819,8 @@ transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition [node name="EnemyModelView" type="Node3D"] script = ExtResource("1_oh25a") EnemyLoreInfo = SubResource("Resource_ivy74") +_upperThreshold = null +_lowerThreshold = null [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(6, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0, 0) @@ -857,9 +859,10 @@ collision_layer = 64 collision_mask = 64 [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.125, 0, -1) shape = SubResource("BoxShape3D_53wuj") disabled = true +debug_color = Color(0.913666, 0.112039, 0.248501, 0.878431) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/Michael.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/Michael.tscn index 6a6759ae..75334fa0 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/Michael.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/Michael.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=11 format=3 uid="uid://b0gwivt7cw7nd"] +[gd_scene load_steps=10 format=3 uid="uid://b0gwivt7cw7nd"] [ext_resource type="Script" uid="uid://c4pdledq3bll3" path="res://src/enemy/enemy_types/02. michael/Michael.cs" id="1_lb5oy"] [ext_resource type="PackedScene" uid="uid://bjg8wyvp8q6oc" path="res://src/enemy/enemy_types/02. michael/MichaelModelView.tscn" id="3_wrps7"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_bngst"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_fkx5j"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_bun8r"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="7_x8mrp"] @@ -71,8 +70,6 @@ shape = SubResource("SphereShape3D_wrps7") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("4_bngst")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("5_fkx5j")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/MichaelModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/MichaelModelView.tscn index 22440318..9108398d 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/MichaelModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/02. michael/MichaelModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=145 format=3 uid="uid://bjg8wyvp8q6oc"] +[gd_scene load_steps=144 format=3 uid="uid://bjg8wyvp8q6oc"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_o4cc2"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_3eot4"] @@ -71,7 +71,6 @@ [ext_resource type="Texture2D" uid="uid://vxphbifafq0q" path="res://src/enemy/enemy_types/02. michael/animations/IDLE_WALK/LEFT SIDE/Michael_IdleWalk_Left (21).png" id="68_msiau"] [ext_resource type="Texture2D" uid="uid://7r30bjydumon" path="res://src/enemy/enemy_types/02. michael/animations/IDLE_WALK/LEFT SIDE/Michael_IdleWalk_Left (22).png" id="69_lec8c"] [ext_resource type="Texture2D" uid="uid://djspx2smexhme" path="res://src/enemy/enemy_types/02. michael/animations/IDLE_WALK/LEFT SIDE/Michael_IdleWalk_Left (23).png" id="70_f0jo7"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="71_ul4dn"] [ext_resource type="PackedScene" uid="uid://dpoonda2dwwic" path="res://src/enemy/BasicEnemyAnimationTree.tscn" id="73_gby04"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="74_fxhv6"] [ext_resource type="Texture2D" uid="uid://duygq1qfer5oa" path="res://src/vfx/Enemy/michael_attack.png" id="74_mip6u"] @@ -1226,7 +1225,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("71_ul4dn") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.29986) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEater.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEater.tscn index 425471ec..268c15bc 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEater.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEater.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=13 format=3 uid="uid://cvk007twac22c"] +[gd_scene load_steps=12 format=3 uid="uid://cvk007twac22c"] [ext_resource type="Script" uid="uid://cohal8w5ceneg" path="res://src/enemy/enemy_types/03. filth_eater/FilthEater.cs" id="1_p438s"] [ext_resource type="PackedScene" uid="uid://bup8c4x1na3aw" path="res://src/enemy/enemy_types/03. filth_eater/FilthEaterModelView.tscn" id="3_rrwed"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="4_5eid5"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_hub7i"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_pvjvo"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_fccr3"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="7_8l567"] @@ -76,8 +75,6 @@ shape = SubResource("CylinderShape3D_qbmfg") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("4_hub7i")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("5_pvjvo")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEaterModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEaterModelView.tscn index 352d4d8f..31793ba5 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEaterModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/03. filth_eater/FilthEaterModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=303 format=3 uid="uid://bup8c4x1na3aw"] +[gd_scene load_steps=302 format=3 uid="uid://bup8c4x1na3aw"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_718m1"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_krqul"] @@ -117,7 +117,6 @@ [ext_resource type="Texture2D" uid="uid://nhbclk8h0vkm" path="res://src/enemy/enemy_types/03. filth_eater/animations/WALK SIDE/Layer 8.png" id="84_iqg8f"] [ext_resource type="Texture2D" uid="uid://kjq0epk60s5b" path="res://src/enemy/enemy_types/03. filth_eater/animations/WALK SIDE/Layer 9.png" id="85_8eyuc"] [ext_resource type="Texture2D" uid="uid://snhdh4kc60np" path="res://src/enemy/enemy_types/03. filth_eater/animations/WALK SIDE/Layer 10.png" id="86_k7dm5"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="87_7tggm"] [ext_resource type="Texture2D" uid="uid://tcruxp8w56ua" path="res://src/enemy/enemy_types/03. filth_eater/animations/Filth Side Attacks Frames/ATTACK 2 BACK/frame_000_delay-0.01s.png" id="117_ddwwq"] [ext_resource type="Texture2D" uid="uid://br178y748y6l1" path="res://src/enemy/enemy_types/03. filth_eater/animations/Filth Side Attacks Frames/ATTACK 2 BACK/frame_001_delay-0.01s.png" id="118_n4eka"] [ext_resource type="Texture2D" uid="uid://bk63q27kdn274" path="res://src/enemy/enemy_types/03. filth_eater/animations/Filth Side Attacks Frames/ATTACK 2 BACK/frame_002_delay-0.01s.png" id="119_ec8sv"] @@ -2345,7 +2344,6 @@ _data = { transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.97683, 0) script = ExtResource("1_718m1") EnemyLoreInfo = SubResource("Resource_pyy2h") -_enemyDirection = 1 [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0.0862446, 0) @@ -2380,7 +2378,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("87_7tggm") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/Sara.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/Sara.tscn index 9240d9bf..24cbeff2 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/Sara.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/Sara.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=11 format=3 uid="uid://bksq62muhk3h5"] +[gd_scene load_steps=10 format=3 uid="uid://bksq62muhk3h5"] [ext_resource type="Script" uid="uid://jjulhqd5g3bd" path="res://src/enemy/enemy_types/04. sara/Sara.cs" id="1_3ejdn"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_c4qcm"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_8ymq6"] [ext_resource type="PackedScene" uid="uid://bli0t0d6ommvi" path="res://src/enemy/enemy_types/04. sara/SaraModelView.tscn" id="4_82s0m"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_lxgpb"] @@ -74,8 +73,6 @@ shape = SubResource("CylinderShape3D_746fv") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_c4qcm")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_8ymq6")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/SaraModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/SaraModelView.tscn index ab9b8bbf..6ec9c8e9 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/SaraModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/04. sara/SaraModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=231 format=3 uid="uid://bli0t0d6ommvi"] +[gd_scene load_steps=230 format=3 uid="uid://bli0t0d6ommvi"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_oh25a"] [ext_resource type="Texture2D" uid="uid://nps7rrvkgews" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/FRONT/0001.png" id="2_8j76g"] @@ -57,7 +57,6 @@ [ext_resource type="Texture2D" uid="uid://bfr8x1h7l408o" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0013.png" id="55_s247p"] [ext_resource type="Texture2D" uid="uid://cf2s27x5hpabp" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0017.png" id="56_leexp"] [ext_resource type="Texture2D" uid="uid://ckp527fkvm6xd" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0021.png" id="57_2v5p8"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="57_lae8t"] [ext_resource type="Texture2D" uid="uid://bxyi0jat74f2a" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0025.png" id="58_weeva"] [ext_resource type="Texture2D" uid="uid://crivrcrwa2h4f" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0029.png" id="59_aj3g2"] [ext_resource type="Texture2D" uid="uid://bg805unedg8c6" path="res://src/enemy/enemy_types/04. sara/animations/IDLE+MOVE/SIDEL/0033.png" id="60_12udx"] @@ -1211,6 +1210,57 @@ tracks/3/keys = { "times": PackedFloat32Array(0) } +[sub_resource type="Animation" id="Animation_gv7gi"] +resource_name = "secondary_attack_back" +length = 0.583341 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"secondary_attack_back"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.583333), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0, 7] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Hitbox/CollisionShape3D:disabled") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.167084, 0.413635), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [true, false, true] +} +tracks/3/type = "animation" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Secondary Animation Player") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"clips": PackedStringArray("Attack VFX"), +"times": PackedFloat32Array(0) +} + [sub_resource type="Animation" id="Animation_qbkgi"] resource_name = "secondary_attack_left" length = 0.583341 @@ -1313,57 +1363,6 @@ tracks/3/keys = { "times": PackedFloat32Array(0) } -[sub_resource type="Animation" id="Animation_gv7gi"] -resource_name = "secondary_attack_back" -length = 0.583341 -step = 0.0833333 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:animation") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [&"secondary_attack_back"] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:frame") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 0.583333), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [0, 7] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("Hitbox/CollisionShape3D:disabled") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 0.167084, 0.413635), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 1, -"values": [true, false, true] -} -tracks/3/type = "animation" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("Secondary Animation Player") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"clips": PackedStringArray("Attack VFX"), -"times": PackedFloat32Array(0) -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_pkiq5"] _data = { &"RESET": SubResource("Animation_pkiq5"), @@ -1705,7 +1704,6 @@ _data = { [node name="EnemyModelView" type="Node3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.31442, 0) script = ExtResource("1_oh25a") -_enemyDirection = 1 [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0) @@ -1740,7 +1738,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("57_lae8t") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/Ballos.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/Ballos.tscn index e3426e87..0e0aaec8 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/Ballos.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/Ballos.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=11 format=3 uid="uid://feegakykn3fv"] +[gd_scene load_steps=10 format=3 uid="uid://feegakykn3fv"] [ext_resource type="Script" uid="uid://dwfxs5yrf7i3v" path="res://src/enemy/enemy_types/05. ballos/Ballos.cs" id="1_iy2fp"] [ext_resource type="PackedScene" uid="uid://c5xijwxkg4pf6" path="res://src/enemy/enemy_types/05. ballos/BallosModelView.tscn" id="2_v2urn"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_jhnwb"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_bjnvx"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_55sdf"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="6_2xj0s"] @@ -69,8 +68,6 @@ shape = SubResource("CylinderShape3D_jhnwb") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_jhnwb")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_bjnvx")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/BallosModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/BallosModelView.tscn index dc32a4eb..5d38c971 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/BallosModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/05. ballos/BallosModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=172 format=3 uid="uid://c5xijwxkg4pf6"] +[gd_scene load_steps=171 format=3 uid="uid://c5xijwxkg4pf6"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_ueqp5"] [ext_resource type="Texture2D" uid="uid://bgkx485uy065" path="res://src/enemy/enemy_types/05. ballos/animations/WALK BACK/1.png" id="3_b3ny6"] @@ -57,7 +57,6 @@ [ext_resource type="Texture2D" uid="uid://cygoonfqfppck" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/7.png" id="56_ims1k"] [ext_resource type="Texture2D" uid="uid://dfeitlib2eoea" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/8.png" id="57_lulp4"] [ext_resource type="Texture2D" uid="uid://lmc23b52q47q" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/9.png" id="58_airxj"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="58_mbej2"] [ext_resource type="Texture2D" uid="uid://fjoglkuxruu7" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/10.png" id="59_f1gh3"] [ext_resource type="Texture2D" uid="uid://dyf1mgbs5yyr2" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/11.png" id="60_jjoyr"] [ext_resource type="Texture2D" uid="uid://dismiomx7g71q" path="res://src/enemy/enemy_types/05. ballos/animations/ATTACK 1 FRONT/12.png" id="61_3db2k"] @@ -1468,7 +1467,6 @@ _data = { [node name="EnemyModelView" type="Node3D"] script = ExtResource("1_ueqp5") -_enemyDirection = 1 [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 1.24865, 0) @@ -1501,7 +1499,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("58_mbej2") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.145935, 0, -1.04663) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/Chariot.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/Chariot.tscn index 4b8d647c..7a854e0e 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/Chariot.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/Chariot.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=11 format=3 uid="uid://dlw5cvutvypxn"] +[gd_scene load_steps=10 format=3 uid="uid://dlw5cvutvypxn"] [ext_resource type="Script" uid="uid://djx5x5bhkku85" path="res://src/enemy/enemy_types/06. chariot/Chariot.cs" id="1_q1q0f"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_ialne"] [ext_resource type="PackedScene" uid="uid://dcm53j3rncxdm" path="res://src/enemy/enemy_types/06. chariot/ChariotModelView.tscn" id="3_q1q0f"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_ee8v4"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_uv8in"] @@ -67,8 +66,6 @@ shape = SubResource("CylinderShape3D_582pa") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_ialne")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_ee8v4")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/ChariotModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/ChariotModelView.tscn index e932e1d9..41ff1398 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/ChariotModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/06. chariot/ChariotModelView.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=1188 format=3 uid="uid://dcm53j3rncxdm"] +[gd_scene load_steps=1187 format=3 uid="uid://dcm53j3rncxdm"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_ol7va"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_6vf6u"] [ext_resource type="Texture2D" uid="uid://2gwychj1wbtx" path="res://src/enemy/enemy_types/06. chariot/animations/APPEAR/F/0051.png" id="2_1844k"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="2_yv1f1"] [ext_resource type="Texture2D" uid="uid://de60a8tqgkidj" path="res://src/enemy/enemy_types/06. chariot/animations/APPEAR/F/0053.png" id="3_486y6"] [ext_resource type="Texture2D" uid="uid://bvaas0ts6f76v" path="res://src/enemy/enemy_types/06. chariot/animations/APPEAR/F/0055.png" id="4_mtow4"] [ext_resource type="Texture2D" uid="uid://b40r460mx0dfi" path="res://src/enemy/enemy_types/06. chariot/animations/APPEAR/F/0057.png" id="5_fhspe"] @@ -6551,6 +6550,34 @@ tracks/1/keys = { "values": [Color(1, 1, 1, 1), Color(1, 0.292663, 0.80703, 1), Color(1, 1, 1, 1), Color(0.0676858, 0.916132, 1, 1), Color(1, 1, 1, 1), Color(0.953217, 0.875907, 0, 1), Color(1, 1, 1, 1), Color(0.948335, 0, 0.201769, 1), Color(1, 1, 1, 1), Color(0.0166117, 0.464766, 1, 1), Color(1, 0.292663, 0.80703, 1), Color(1, 1, 1, 1), Color(0.0676858, 0.916132, 1, 1), Color(1, 1, 1, 1), Color(0.953217, 0.875907, 0, 1), Color(1, 1, 1, 1), Color(0.948335, 0, 0.201769, 1), Color(1, 1, 1, 1), Color(0.0166117, 0.464766, 1, 1)] } +[sub_resource type="Animation" id="Animation_vxyya"] +resource_name = "ATTACK 2" +length = 2.33334 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("../Attack 2:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 2.33333), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0, 70] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("../Attack 2:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.433333, 0.533333, 0.633333, 0.766667, 0.9, 1.1, 1.23333, 1.5, 1.6, 1.7), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0.6), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.3), Color(1, 1, 1, 0.735), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.3), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.1), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} + [sub_resource type="Animation" id="Animation_mud4o"] length = 0.001 tracks/0/type = "value" @@ -6602,34 +6629,6 @@ tracks/3/keys = { "values": [Color(1, 1, 1, 1)] } -[sub_resource type="Animation" id="Animation_vxyya"] -resource_name = "ATTACK 2" -length = 2.33334 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("../Attack 2:frame") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2.33333), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [0, 70] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("../Attack 2:modulate") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.433333, 0.533333, 0.633333, 0.766667, 0.9, 1.1, 1.23333, 1.5, 1.6, 1.7), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0.6), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.3), Color(1, 1, 1, 0.735), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.3), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.1), Color(1, 1, 1, 0.8), Color(1, 1, 1, 0.1), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_jj0f0"] _data = { &"ATTACK 1": SubResource("Animation_jrkfh"), @@ -7388,7 +7387,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.153, 1, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("2_yv1f1") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, -0.96098, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn index 11086f82..984b84b1 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=470 format=3 uid="uid://byd7cwxq1be6f"] +[gd_scene load_steps=469 format=3 uid="uid://byd7cwxq1be6f"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_6dej3"] [ext_resource type="Texture2D" uid="uid://dnd6d5cx7x7i8" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0400.png" id="2_3sdh3"] @@ -58,7 +58,6 @@ [ext_resource type="Texture2D" uid="uid://w4xkkq5h5sb0" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0072.png" id="56_r614d"] [ext_resource type="Texture2D" uid="uid://dpwsperlnxaym" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0074.png" id="57_htmb3"] [ext_resource type="Texture2D" uid="uid://cwrqyrkl64llv" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0076.png" id="58_4kf8m"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="58_o4frm"] [ext_resource type="Texture2D" uid="uid://dro7woqqccuw3" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0078.png" id="59_ewt6b"] [ext_resource type="Texture2D" uid="uid://cqycft7ceudp4" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0080.png" id="60_ghf8c"] [ext_resource type="Texture2D" uid="uid://chv844k6paebl" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0082.png" id="61_40kbr"] @@ -3245,7 +3244,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("58_o4frm") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/Chinthe.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/Chinthe.tscn index 861be9c3..a305fbc3 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/Chinthe.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/07. chinthe/Chinthe.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=12 format=3 uid="uid://c6tqt27ql8s35"] +[gd_scene load_steps=11 format=3 uid="uid://c6tqt27ql8s35"] [ext_resource type="Script" uid="uid://fwtjthix6awv" path="res://src/enemy/enemy_types/07. chinthe/Chinthe.cs" id="1_120m2"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="3_567xa"] [ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn" id="3_ncr2e"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_w103a"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_t7elt"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="7_24q6i"] @@ -80,8 +79,6 @@ shape = SubResource("CylinderShape3D_q6h01") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("4_w103a")] - [node name="FollowBehavior" parent="Components" instance=ExtResource("6_t7elt")] unique_name_in_owner = true _followSpeed = 150.0 diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn index 13db250b..59534bb6 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=11 format=3 uid="uid://fosk3kt7vp8d"] +[gd_scene load_steps=10 format=3 uid="uid://fosk3kt7vp8d"] [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_m2guv"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_enaes"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_hqy0f"] [ext_resource type="PackedScene" uid="uid://c2i8ylr3y0bri" path="res://src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn" id="4_pjmem"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_gy5yi"] @@ -74,8 +73,6 @@ shape = SubResource("CylinderShape3D_sjoyv") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_enaes")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_hqy0f")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn index 8ab3a3a4..1247c374 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=298 format=3 uid="uid://c2i8ylr3y0bri"] +[gd_scene load_steps=297 format=3 uid="uid://c2i8ylr3y0bri"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_h27bt"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_yyynn"] @@ -264,7 +264,6 @@ [ext_resource type="AnimationNodeStateMachine" uid="uid://cy2ngl55c0rws" path="res://src/enemy/animation_state_machines/WalkingStateMachine.tres" id="263_312rt"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="263_sroq1"] [ext_resource type="AnimationNodeStateMachine" uid="uid://clybvwx3itfeo" path="res://src/enemy/animation_state_machines/SecondaryAttackStateMachine.tres" id="264_dcx20"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="333_u3b1r"] [sub_resource type="Resource" id="Resource_f45wt"] script = ExtResource("2_yyynn") @@ -1879,7 +1878,6 @@ transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition [node name="EnemyModelView" type="Node3D"] script = ExtResource("1_h27bt") EnemyLoreInfo = SubResource("Resource_f45wt") -_enemyDirection = 3 [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0.545209, 0) @@ -1914,7 +1912,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("333_u3b1r") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn index f2117501..b48d16ea 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn @@ -1,8 +1,6 @@ -[gd_scene load_steps=12 format=3 uid="uid://c5gbaybqm4cuk"] +[gd_scene load_steps=10 format=3 uid="uid://c5gbaybqm4cuk"] [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_4nav4"] -[ext_resource type="Resource" uid="uid://doycpt2aqxnx" path="res://src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorStats.tres" id="2_hqkeq"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_apdt1"] [ext_resource type="PackedScene" uid="uid://72lbcmp4bcx4" path="res://src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn" id="4_hqkeq"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_65xvc"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_v4xmn"] @@ -29,7 +27,6 @@ axis_lock_linear_y = true axis_lock_angular_x = true axis_lock_angular_z = true script = ExtResource("1_4nav4") -_enemyStatResource = ExtResource("2_hqkeq") [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true @@ -76,8 +73,6 @@ shape = SubResource("CylinderShape3D_o0cbq") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("4_apdt1")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("5_65xvc")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn index 631b34b8..3c8c0804 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=299 format=3 uid="uid://72lbcmp4bcx4"] +[gd_scene load_steps=298 format=3 uid="uid://72lbcmp4bcx4"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_a8qtn"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_xa3ug"] @@ -260,7 +260,6 @@ [ext_resource type="Texture2D" uid="uid://dmhttsdjpn1ed" path="res://src/enemy/enemy_types/08b. Ambassador (red)/animations/SIDE/0195.png" id="258_hwjgo"] [ext_resource type="Texture2D" uid="uid://dg7l1crtk7m3s" path="res://src/enemy/enemy_types/08b. Ambassador (red)/animations/SIDE/0197.png" id="259_ymdu4"] [ext_resource type="Texture2D" uid="uid://by2vqyh68egwr" path="res://src/enemy/enemy_types/08b. Ambassador (red)/animations/SIDE/0199.png" id="260_jtq5d"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="261_uny2s"] [ext_resource type="PackedScene" uid="uid://diaxvpmwgl65u" path="res://src/enemy/TwoAttacksEnemyAnimationTree.tscn" id="262_a3dro"] [ext_resource type="AnimationNodeStateMachine" uid="uid://co7lshemjrro8" path="res://src/enemy/animation_state_machines/IdleStateMachine.tres" id="263_qerwx"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="264_xxvov"] @@ -1921,7 +1920,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("261_uny2s") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn index 75afe94e..d70d6117 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn @@ -1,8 +1,6 @@ -[gd_scene load_steps=12 format=3 uid="uid://b4oliop60eghn"] +[gd_scene load_steps=10 format=3 uid="uid://b4oliop60eghn"] [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_ln0kc"] -[ext_resource type="Resource" uid="uid://dudtbfjfekkh1" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelStats.tres" id="2_kdt1g"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="4_bo12t"] [ext_resource type="PackedScene" uid="uid://lc5koiqn1sca" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn" id="4_kdt1g"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_fmnae"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_g5uri"] @@ -29,7 +27,6 @@ axis_lock_linear_y = true axis_lock_angular_x = true axis_lock_angular_z = true script = ExtResource("1_ln0kc") -_enemyStatResource = ExtResource("2_kdt1g") [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true @@ -75,8 +72,6 @@ shape = SubResource("CylinderShape3D_6o7lk") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("4_bo12t")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("5_fmnae")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn index 5dc63dd8..a9f4a69f 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=299 format=3 uid="uid://lc5koiqn1sca"] +[gd_scene load_steps=298 format=3 uid="uid://lc5koiqn1sca"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_s0qsg"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_84ebe"] @@ -260,7 +260,6 @@ [ext_resource type="Texture2D" uid="uid://becuxx02gf3lk" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/animations/SIDE/Layer 256.png" id="258_4nxp6"] [ext_resource type="Texture2D" uid="uid://dq238efl5je7g" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/animations/SIDE/Layer 257.png" id="259_lw74j"] [ext_resource type="Texture2D" uid="uid://biaen4nwf0tpg" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/animations/SIDE/Layer 258.png" id="260_3ft46"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="261_jsntq"] [ext_resource type="PackedScene" uid="uid://diaxvpmwgl65u" path="res://src/enemy/TwoAttacksEnemyAnimationTree.tscn" id="262_47uje"] [ext_resource type="AnimationNodeStateMachine" uid="uid://co7lshemjrro8" path="res://src/enemy/animation_state_machines/IdleStateMachine.tres" id="263_i2vbx"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="264_5tr5n"] @@ -1918,7 +1917,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("261_jsntq") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemon.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemon.tscn index 4cdb3180..17b60736 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemon.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemon.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=11 format=3 uid="uid://b8ewfgcjv60es"] +[gd_scene load_steps=10 format=3 uid="uid://b8ewfgcjv60es"] [ext_resource type="Script" uid="uid://h6duv685n6eh" path="res://src/enemy/enemy_types/09. Agni/AgniDemon.cs" id="1_e2477"] [ext_resource type="PackedScene" uid="uid://bls3mcsyld4vy" path="res://src/enemy/enemy_types/09. Agni/AgniDemonModelView.tscn" id="3_tbkej"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_xj6b3"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_dxxe5"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_j6ob5"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="6_58r4a"] @@ -69,8 +68,6 @@ shape = SubResource("CylinderShape3D_tbkej") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_xj6b3")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_dxxe5")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemonModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemonModelView.tscn index 503c3b57..66d847ea 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemonModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/09. Agni/AgniDemonModelView.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=369 format=3 uid="uid://bls3mcsyld4vy"] +[gd_scene load_steps=368 format=3 uid="uid://bls3mcsyld4vy"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_wl7dh"] [ext_resource type="Texture2D" uid="uid://dsu48b5hf48xl" path="res://src/enemy/enemy_types/09. Agni/animations/B/frame_000_delay-0.01s.png" id="2_pt8gl"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="2_rmtca"] [ext_resource type="Texture2D" uid="uid://bdhmqyiad52ea" path="res://src/enemy/enemy_types/09. Agni/animations/F/frame_066_delay-0.01s.png" id="2_wfu1u"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_y6p5p"] [ext_resource type="Texture2D" uid="uid://dw1841vsuw75d" path="res://src/enemy/enemy_types/09. Agni/animations/B/frame_001_delay-0.01s.png" id="3_8wyws"] @@ -2108,7 +2107,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("2_rmtca") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/10. Eden Pillar/Eden Pillar.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/10. Eden Pillar/Eden Pillar.tscn index a4fb0e80..23130ed0 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/10. Eden Pillar/Eden Pillar.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/10. Eden Pillar/Eden Pillar.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=15 format=3 uid="uid://cmvimr0pvsgqy"] +[gd_scene load_steps=13 format=3 uid="uid://cmvimr0pvsgqy"] [ext_resource type="Script" uid="uid://d2m7esc5ypl7y" path="res://src/enemy/enemy_types/10. Eden Pillar/EdenPillar.cs" id="1_p8jc1"] -[ext_resource type="Resource" uid="uid://dj10m1aktmu6j" path="res://src/enemy/enemy_types/10. Eden Pillar/EdenPillar.tres" id="2_nveg0"] [ext_resource type="PackedScene" uid="uid://cktycana6xxtp" path="res://src/enemy/enemy_types/10. Eden Pillar/EdenPillarModelView.tscn" id="3_o285m"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="4_5fako"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_p8jc1"] height = 3.08643 @@ -48,7 +46,6 @@ bottom_radius = 0.25 collision_layer = 10 collision_mask = 3 script = ExtResource("1_p8jc1") -_enemyStatResource = ExtResource("2_nveg0") [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true @@ -93,7 +90,6 @@ unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.152949, 0, 13.6635) collision_layer = 64 collision_mask = 64 -script = ExtResource("4_5fako") [node name="CollisionShape3D" type="CollisionShape3D" parent="PrimaryHitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0939882, 1.15479, -6.78312) @@ -110,7 +106,6 @@ unique_name_in_owner = true transform = Transform3D(-0.529919, 0, 0.848048, 0, 1, 0, -0.848048, 0, -0.529919, -1.2426, 0, -6.37338) collision_layer = 64 collision_mask = 64 -script = ExtResource("4_5fako") [node name="CollisionShape3D" type="CollisionShape3D" parent="SecondaryHitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.1241, 1.15479, 3.09662) @@ -127,7 +122,6 @@ unique_name_in_owner = true transform = Transform3D(-0.529919, 0, -0.848048, 0, 1, 0, 0.848048, 0, -0.529919, 1.50517, 0, -7.06323) collision_layer = 64 collision_mask = 64 -script = ExtResource("4_5fako") [node name="CollisionShape3D" type="CollisionShape3D" parent="TertiaryHitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.81698, 1.15479, 3.06516) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/Palan.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/Palan.tscn index 9d44e66a..4c6b7d47 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/Palan.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/Palan.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=11 format=3 uid="uid://boqjebx7yuiqy"] +[gd_scene load_steps=10 format=3 uid="uid://boqjebx7yuiqy"] [ext_resource type="Script" uid="uid://cjd7k1scp1am8" path="res://src/enemy/enemy_types/11. Palan/Palan.cs" id="1_2upgt"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_c82i6"] [ext_resource type="PackedScene" uid="uid://dxwwfbt2mtmer" path="res://src/enemy/enemy_types/11. Palan/PalanModelView.tscn" id="4_3ahu6"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_3ogbp"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_6scof"] @@ -69,8 +68,6 @@ shape = SubResource("CylinderShape3D_c82i6") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_c82i6")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_3ogbp")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/PalanModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/PalanModelView.tscn index 37844f17..6eb91cd5 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/PalanModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/11. Palan/PalanModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=320 format=3 uid="uid://dxwwfbt2mtmer"] +[gd_scene load_steps=319 format=3 uid="uid://dxwwfbt2mtmer"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_yke7o"] [ext_resource type="Texture2D" uid="uid://cob5mo4lrbkrp" path="res://src/enemy/enemy_types/11. Palan/animations/B/frame_000_delay-0.01s.png" id="2_lf0wi"] @@ -201,7 +201,6 @@ [ext_resource type="Texture2D" uid="uid://528oq2o53htb" path="res://src/enemy/enemy_types/11. Palan/animations/R/frame_178_delay-0.01s.png" id="96_aqt4x"] [ext_resource type="Texture2D" uid="uid://ckuymrppoajnk" path="res://src/enemy/enemy_types/11. Palan/animations/R/frame_179_delay-0.01s.png" id="97_83iec"] [ext_resource type="Texture2D" uid="uid://bq85jeydr4li8" path="res://src/enemy/enemy_types/11. Palan/animations/R/frame_180_delay-0.01s.png" id="98_jwe14"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="162_4qxqd"] [ext_resource type="AnimationNodeStateMachine" uid="uid://co7lshemjrro8" path="res://src/enemy/animation_state_machines/IdleStateMachine.tres" id="203_krcdq"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="204_vaycn"] [ext_resource type="AnimationNodeStateMachine" uid="uid://clybvwx3itfeo" path="res://src/enemy/animation_state_machines/SecondaryAttackStateMachine.tres" id="205_klhid"] @@ -2245,7 +2244,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("162_4qxqd") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn index f5a95269..61cab783 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=579 format=3 uid="uid://drkaq6grim1fb"] +[gd_scene load_steps=578 format=3 uid="uid://drkaq6grim1fb"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_h8pla"] [ext_resource type="Texture2D" uid="uid://clwj6yknpw74n" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Idle Back/0001.png" id="2_2eclh"] @@ -131,7 +131,6 @@ [ext_resource type="Texture2D" uid="uid://cky7x5xvv78hs" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Idle Front/0109.png" id="92_wep0u"] [ext_resource type="Texture2D" uid="uid://dc56yupiyrfuo" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Walk Back/0052.png" id="93_1lakb"] [ext_resource type="Texture2D" uid="uid://lklkc5xnj5c4" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Idle Front/0112.png" id="93_ahxi6"] -[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="94_32ire"] [ext_resource type="Texture2D" uid="uid://0k5j8eklctd0" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Idle Front/0115.png" id="94_ixnb4"] [ext_resource type="Texture2D" uid="uid://c5g8sn7rh164n" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Walk Back/0055.png" id="94_qslmt"] [ext_resource type="Texture2D" uid="uid://v5gibgt1uaq5" path="res://src/enemy/enemy_types/12. Shield of Heaven/animations/New/Walk Back/0058.png" id="95_3na3d"] @@ -3264,7 +3263,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("94_32ire") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.145935, 0, -1.04663) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldOfHeaven.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldOfHeaven.tscn index 9554c987..d1980ba8 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldOfHeaven.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/12. Shield of Heaven/ShieldOfHeaven.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=10 format=3 uid="uid://5s7c4dsb1wwk"] +[gd_scene load_steps=9 format=3 uid="uid://5s7c4dsb1wwk"] [ext_resource type="Script" uid="uid://cjdivu0v1kfhy" path="res://src/enemy/enemy_types/12. Shield of Heaven/ShieldOfHeaven.cs" id="1_oxa5b"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_7w5bn"] [ext_resource type="PackedScene" uid="uid://drkaq6grim1fb" path="res://src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn" id="3_r2swr"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_jvpqg"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_s5x4o"] @@ -59,8 +58,6 @@ unique_name_in_owner = true [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_7w5bn")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_jvpqg")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingy.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingy.tscn index 9cd15a71..d12f853d 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingy.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingy.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=9 format=3 uid="uid://b3giib0jp3uod"] +[gd_scene load_steps=8 format=3 uid="uid://b3giib0jp3uod"] [ext_resource type="Script" uid="uid://jjulhqd5g3be" path="res://src/enemy/enemy_types/13. gold sproingy/GoldSproingy.cs" id="1_o1o4d"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_58d4o"] [ext_resource type="PackedScene" uid="uid://c5asojy73n44d" path="res://src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn" id="4_58d4o"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_ik3p4"] @@ -72,8 +71,6 @@ shape = SubResource("CylinderShape3D_58d4o") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_58d4o")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_ik3p4")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn index 5f020b77..9ac51e7e 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=116 format=3 uid="uid://c5asojy73n44d"] +[gd_scene load_steps=115 format=3 uid="uid://c5asojy73n44d"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_mnn74"] [ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_e7c5t"] @@ -50,7 +50,6 @@ [ext_resource type="Texture2D" uid="uid://08wt71swke3c" path="res://src/enemy/enemy_types/13. gold sproingy/animations/sproing sparkle sheet.png" id="50_pa2de"] [ext_resource type="AnimationNodeStateMachine" uid="uid://co7lshemjrro8" path="res://src/enemy/animation_state_machines/IdleStateMachine.tres" id="50_smvnd"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cy2ngl55c0rws" path="res://src/enemy/animation_state_machines/WalkingStateMachine.tres" id="51_fynbp"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="58_ahls6"] [ext_resource type="PackedScene" uid="uid://dpoonda2dwwic" path="res://src/enemy/BasicEnemyAnimationTree.tscn" id="59_gqipt"] [sub_resource type="Resource" id="Resource_ivy74"] diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFace.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFace.tscn index d53105df..735bb487 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFace.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFace.tscn @@ -1,24 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://2wibfnu2jvlv"] +[gd_scene load_steps=8 format=3 uid="uid://2wibfnu2jvlv"] [ext_resource type="Script" uid="uid://dveonnhcxcp08" path="res://src/enemy/BossTypeA.cs" id="1_x21p4"] -[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_jl3qa"] [ext_resource type="PackedScene" uid="uid://bid6f48l0q58o" path="res://src/enemy/enemy_types/14. horse_head/HorseFaceModelView.tscn" id="2_x21p4"] - -[sub_resource type="Resource" id="Resource_jl3qa"] -script = ExtResource("2_jl3qa") -CurrentAttack = 0 -CurrentDefense = 0 -MaxAttack = 0 -MaxDefense = 0 -ExpFromDefeat = 0 -Luck = 0.05 -_telluricResistance = 0.0 -_aeolicResistance = 0.0 -_hydricResistance = 0.0 -_igneousResistance = 0.0 -_ferrumResistance = 0.0 -DropsSoulGemChance = 0.75 -metadata/_custom_type_script = "uid://dnkmr0eq1sij0" +[ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="3_wp4vi"] +[ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="4_fne8i"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_c0n4w"] radius = 10.3283 @@ -27,6 +12,10 @@ height = 50.0 [sub_resource type="SphereShape3D" id="SphereShape3D_jl3qa"] radius = 15.426 +[sub_resource type="CylinderShape3D" id="CylinderShape3D_wp4vi"] +height = 20.0 +radius = 15.0 + [node name="HorseFace" type="CharacterBody3D"] collision_layer = 10 collision_mask = 3 @@ -35,16 +24,11 @@ axis_lock_angular_x = true axis_lock_angular_y = true motion_mode = 1 script = ExtResource("1_x21p4") -_enemyStatResource = SubResource("Resource_jl3qa") [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true shape = SubResource("CapsuleShape3D_c0n4w") -[node name="AttackTimer" type="Timer" parent="."] -unique_name_in_owner = true -wait_time = 3.5 - [node name="EnemyModelView" parent="." instance=ExtResource("2_x21p4")] unique_name_in_owner = true @@ -59,3 +43,26 @@ disabled = true [node name="Rotation" type="Node3D" parent="."] unique_name_in_owner = true + +[node name="PlayerDetector" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 0 +collision_mask = 34 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] +shape = SubResource("CylinderShape3D_wp4vi") + +[node name="Components" type="Node3D" parent="."] + +[node name="FollowBehavior" parent="Components" instance=ExtResource("3_wp4vi")] +unique_name_in_owner = true +_followSpeed = 150.0 + +[node name="EngagePlayerBehavior" parent="Components" instance=ExtResource("4_fne8i")] +unique_name_in_owner = true + +[node name="NavigationAgent" type="NavigationAgent3D" parent="Components"] +unique_name_in_owner = true +avoidance_enabled = true +radius = 1.0 +debug_enabled = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFaceModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFaceModelView.tscn index 5f91f770..44499bdf 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFaceModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/HorseFaceModelView.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=38 format=4 uid="uid://bid6f48l0q58o"] +[gd_scene load_steps=34 format=4 uid="uid://bid6f48l0q58o"] -[ext_resource type="Script" uid="uid://bvcfww5827g74" path="res://src/enemy/enemy_types/BossTypeAEnemyModelView.cs" id="1_q3bfl"] +[ext_resource type="Script" uid="uid://ckv5dmrw6pvn6" path="res://src/enemy/EnemyModelView3D.cs" id="1_oxssn"] [ext_resource type="Texture2D" uid="uid://2e4cp477ex0t" path="res://src/enemy/enemy_types/14. horse_head/animation/Horse Head 1_Metal054C_1K-JPG_Color.jpg" id="1_vv6g0"] [ext_resource type="Animation" uid="uid://bhsp32c05j2o5" path="res://src/enemy/enemy_types/14. horse_head/animation/walking.res" id="2_yvw71"] [ext_resource type="Texture2D" uid="uid://dd7ocxanos2o7" path="res://src/enemy/enemy_types/14. horse_head/animation/HORSE-FACE 1_Metal054C_1K-JPG_Displacement.jpg" id="3_b3lw2"] @@ -892,9 +892,6 @@ _data = { &"walk": ExtResource("3_bkc4x") } -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_b3lw2"] -animation = &"attack_walk" - [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_q3bfl"] animation = &"idle" @@ -907,55 +904,50 @@ animation = &"secondary_attack" [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_oxssn"] animation = &"walk" +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_b3lw2"] +animation = &"attack_walk" + [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_b3lw2"] advance_mode = 2 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_oxssn"] + [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_58wyj"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qhoxi"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_lj3cb"] +switch_mode = 2 +advance_mode = 2 [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_agk0q"] +switch_mode = 2 +advance_mode = 2 [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rv3ka"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xl8ei"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_u70jw"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_f0htk"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ypx2p"] -switch_mode = 2 - [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_n4ran"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_fs50t"] - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ww3mq"] -switch_mode = 2 [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_q3bfl"] +states/End/position = Vector2(1294, 42) +states/Idle/node = SubResource("AnimationNodeAnimation_q3bfl") +states/Idle/position = Vector2(410, 78) +"states/Primary Attack/node" = SubResource("AnimationNodeAnimation_0er43") +"states/Primary Attack/position" = Vector2(614, 296) +"states/Secondary Attack/node" = SubResource("AnimationNodeAnimation_i2g67") +"states/Secondary Attack/position" = Vector2(865, 183) states/Start/position = Vector2(188, 78) +states/Walking/node = SubResource("AnimationNodeAnimation_oxssn") +states/Walking/position = Vector2(652, -44) states/attack_walk/node = SubResource("AnimationNodeAnimation_b3lw2") -states/attack_walk/position = Vector2(1330, -86) -states/idle/node = SubResource("AnimationNodeAnimation_q3bfl") -states/idle/position = Vector2(408, 66) -states/primary_attack/node = SubResource("AnimationNodeAnimation_0er43") -states/primary_attack/position = Vector2(994, 27) -states/secondary_attack/node = SubResource("AnimationNodeAnimation_i2g67") -states/secondary_attack/position = Vector2(797, 205) -states/walk/node = SubResource("AnimationNodeAnimation_oxssn") -states/walk/position = Vector2(652, -44) -transitions = ["Start", "idle", SubResource("AnimationNodeStateMachineTransition_b3lw2"), "idle", "walk", SubResource("AnimationNodeStateMachineTransition_58wyj"), "walk", "idle", SubResource("AnimationNodeStateMachineTransition_qhoxi"), "walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_lj3cb"), "idle", "primary_attack", SubResource("AnimationNodeStateMachineTransition_agk0q"), "walk", "secondary_attack", SubResource("AnimationNodeStateMachineTransition_rv3ka"), "idle", "secondary_attack", SubResource("AnimationNodeStateMachineTransition_xl8ei"), "primary_attack", "idle", SubResource("AnimationNodeStateMachineTransition_u70jw"), "secondary_attack", "walk", SubResource("AnimationNodeStateMachineTransition_f0htk"), "secondary_attack", "idle", SubResource("AnimationNodeStateMachineTransition_ypx2p"), "primary_attack", "attack_walk", SubResource("AnimationNodeStateMachineTransition_n4ran"), "attack_walk", "idle", SubResource("AnimationNodeStateMachineTransition_fs50t"), "secondary_attack", "attack_walk", SubResource("AnimationNodeStateMachineTransition_ww3mq")] +states/attack_walk/position = Vector2(912, 42) +transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_b3lw2"), "Idle", "Walking", SubResource("AnimationNodeStateMachineTransition_oxssn"), "Walking", "Idle", SubResource("AnimationNodeStateMachineTransition_58wyj"), "Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_qhoxi"), "Primary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_lj3cb"), "Secondary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_agk0q"), "Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_rv3ka"), "Idle", "attack_walk", SubResource("AnimationNodeStateMachineTransition_xl8ei"), "attack_walk", "Idle", SubResource("AnimationNodeStateMachineTransition_n4ran")] graph_offset = Vector2(0, -109.963) [node name="EnemyModelView" type="Node3D"] -script = ExtResource("1_q3bfl") +script = ExtResource("1_oxssn") [node name="Armature" type="Node3D" parent="."] @@ -964,7 +956,7 @@ bones/0/name = "spine1" bones/0/parent = -1 bones/0/rest = Transform3D(1.49012e-06, 0.00846654, -0.999964, 2.93367e-08, 0.999964, 0.00846654, 1, -4.23752e-08, 1.49012e-06, 0.000155807, -0.00105953, -2.01735) bones/0/enabled = true -bones/0/position = Vector3(0.0996386, -0.430121, -1.53144) +bones/0/position = Vector3(0.0996387, -0.364802, -1.53144) bones/0/rotation = Quaternion(0.0256267, -0.805691, 0.0118477, 0.591662) bones/0/scale = Vector3(1, 1, 1) bones/1/name = "spine0" @@ -993,7 +985,7 @@ bones/4/parent = 3 bones/4/rest = Transform3D(0.901905, -0.410135, 0.135488, 0.412416, 0.910915, 0.0120912, -0.128377, 0.0449723, 0.990705, 2.5332e-07, 0.990515, -7.07805e-08) bones/4/enabled = true bones/4/position = Vector3(2.5332e-07, 0.990515, -7.07805e-08) -bones/4/rotation = Quaternion(-0.00595614, 0.0593022, 0.184097, 0.981099) +bones/4/rotation = Quaternion(4.1386e-05, 0.0627896, 0.195289, 0.978734) bones/4/scale = Vector3(1, 1, 1) bones/5/name = "neck4" bones/5/parent = 4 @@ -1007,7 +999,7 @@ bones/6/parent = 5 bones/6/rest = Transform3D(0.0598389, 0.98531, 0.15995, -0.975271, 0.0235553, 0.219755, 0.212759, -0.169144, 0.962353, 3.65078e-07, 1.40318, 0) bones/6/enabled = true bones/6/position = Vector3(3.65078e-07, 1.40318, 0) -bones/6/rotation = Quaternion(-0.327629, 0.0506387, -0.451418, 0.828442) +bones/6/rotation = Quaternion(-0.334434, 0.0512942, -0.470392, 0.815018) bones/6/scale = Vector3(1, 1, 1) bones/7/name = "Bone.007" bones/7/parent = 6 @@ -1042,7 +1034,7 @@ bones/11/parent = 1 bones/11/rest = Transform3D(0.981457, 0.0769315, -0.175568, 0.18837, -0.217537, 0.957703, 0.035485, -0.973015, -0.227995, -1.09896e-07, 3.84743, -2.10479e-07) bones/11/enabled = true bones/11/position = Vector3(-1.09896e-07, 3.84743, -2.10479e-07) -bones/11/rotation = Quaternion(-0.814088, -0.0947363, -0.0238342, 0.572467) +bones/11/rotation = Quaternion(-0.810729, -0.0883641, -0.0236887, 0.578229) bones/11/scale = Vector3(1, 1, 1) bones/12/name = "arm2_L" bones/12/parent = 11 @@ -1069,7 +1061,7 @@ bones/15/name = "arm1_R" bones/15/parent = 1 bones/15/rest = Transform3D(-0.98213, 0.0512573, -0.181089, -0.187541, -0.185921, 0.964501, 0.0157694, 0.981227, 0.192212, 0.00107862, 3.8461, -0.0821097) bones/15/enabled = true -bones/15/position = Vector3(-0.169678, 3.39774, 0.123382) +bones/15/position = Vector3(-0.183961, 3.50758, 0.102613) bones/15/rotation = Quaternion(-0.502686, 0.531044, 0.680821, -0.0422068) bones/15/scale = Vector3(1, 1, 1) bones/16/name = "arm2_R" @@ -1084,7 +1076,7 @@ bones/17/parent = 16 bones/17/rest = Transform3D(0.998789, 0.0488077, -0.00615137, -0.0491113, 0.996528, -0.0672226, 0.00284903, 0.0674433, 0.997719, -5.21541e-08, 3.04263, -1.31503e-06) bones/17/enabled = true bones/17/position = Vector3(-5.21541e-08, 3.04263, -1.31503e-06) -bones/17/rotation = Quaternion(-0.00888877, 0.0960696, 0.277786, 0.955786) +bones/17/rotation = Quaternion(-0.0249682, 0.0966464, 0.272252, 0.957034) bones/17/scale = Vector3(1, 1, 1) bones/18/name = "hand_R" bones/18/parent = 17 @@ -1097,7 +1089,7 @@ bones/19/name = "hip_L" bones/19/parent = -1 bones/19/rest = Transform3D(0.138486, 0.897208, 0.419333, -0.129033, -0.403458, 0.905854, 0.981923, -0.179556, 0.059896, 0.000155807, -0.00105953, -2.01735) bones/19/enabled = true -bones/19/position = Vector3(0.147751, -0.369418, -1.49267) +bones/19/position = Vector3(0.147751, -0.331617, -1.49267) bones/19/rotation = Quaternion(0.427793, 0.34021, 0.687061, -0.478745) bones/19/scale = Vector3(1, 1, 1) bones/20/name = "leg1_L" @@ -1105,14 +1097,14 @@ bones/20/parent = 19 bones/20/rest = Transform3D(0.945603, 0.113405, 0.304916, -0.324072, 0.410457, 0.852351, -0.0284943, -0.9048, 0.424881, 2.08616e-07, 2.00996, -7.1153e-07) bones/20/enabled = true bones/20/position = Vector3(2.08616e-07, 2.00996, -7.1153e-07) -bones/20/rotation = Quaternion(-0.433817, -0.330204, -0.37545, 0.749537) +bones/20/rotation = Quaternion(-0.435321, -0.328349, -0.373164, 0.75062) bones/20/scale = Vector3(1, 1, 1) bones/21/name = "leg2_L" bones/21/parent = 20 bones/21/rest = Transform3D(0.990336, -0.138679, 0.00180777, 0.138628, 0.990193, 0.0173138, -0.00419111, -0.0168959, 0.999848, 5.96046e-08, 5.85994, -5.23403e-07) bones/21/enabled = true bones/21/position = Vector3(5.96046e-08, 5.85994, -5.23403e-07) -bones/21/rotation = Quaternion(-0.0494072, 0.00187672, 0.395211, 0.917259) +bones/21/rotation = Quaternion(-0.048608, 0.00188239, 0.388818, 0.92003) bones/21/scale = Vector3(1, 1, 1) bones/22/name = "foot1_L" bones/22/parent = 21 @@ -1146,7 +1138,7 @@ bones/26/name = "hip_R" bones/26/parent = -1 bones/26/rest = Transform3D(0.138486, -0.897208, -0.419333, 0.129033, -0.403458, 0.905854, -0.981923, -0.179556, 0.059896, -0.000155807, -0.00105953, -2.01735) bones/26/enabled = true -bones/26/position = Vector3(0.0289172, -0.356236, -1.59603) +bones/26/position = Vector3(0.0289171, -0.331035, -1.59603) bones/26/rotation = Quaternion(0.695067, -0.09936, -0.377924, -0.603475) bones/26/scale = Vector3(1, 1, 1) bones/27/name = "leg1_R" @@ -1154,14 +1146,14 @@ bones/27/parent = 26 bones/27/rest = Transform3D(0.945603, -0.113405, -0.304916, 0.324072, 0.410457, 0.852351, 0.0284943, -0.9048, 0.424881, -9.54606e-09, 2.00996, -3.52971e-07) bones/27/enabled = true bones/27/position = Vector3(-9.54606e-09, 2.00996, -3.52971e-07) -bones/27/rotation = Quaternion(-0.312056, 0.177992, 0.184279, 0.914867) +bones/27/rotation = Quaternion(-0.313748, 0.176775, 0.184174, 0.914545) bones/27/scale = Vector3(1, 1, 1) bones/28/name = "leg2_R" bones/28/parent = 27 bones/28/rest = Transform3D(0.990336, 0.138679, -0.00180777, -0.138628, 0.990193, 0.0173138, 0.00419111, -0.0168959, 0.999848, 4.51691e-08, 5.85994, -3.72529e-09) bones/28/enabled = true bones/28/position = Vector3(4.51691e-08, 5.85994, -3.72529e-09) -bones/28/rotation = Quaternion(-0.278157, 0.0201334, -0.181494, 0.943018) +bones/28/rotation = Quaternion(-0.273992, 0.0201705, -0.178776, 0.944754) bones/28/scale = Vector3(1, 1, 1) bones/29/name = "foot1_R" bones/29/parent = 28 @@ -1198,7 +1190,7 @@ mesh = SubResource("ArrayMesh_6e63x") skin = SubResource("Skin_yvw71") [node name="BoneAttachment3D" type="BoneAttachment3D" parent="Armature/Skeleton3D"] -transform = Transform3D(-0.370165, -0.13327, -0.919357, -0.302859, -0.918272, 0.255054, -0.878211, 0.372847, 0.29955, -2.00357, 8.72215, 6.32682) +transform = Transform3D(-0.370164, -0.13327, -0.919357, -0.283733, -0.926146, 0.248495, -0.884576, 0.352835, 0.305013, -2.00357, 8.75024, 6.24756) bone_name = "TOP OF SKULL" bone_idx = 8 diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/animation/OxFaceAnimations.tres b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/animation/OxFaceAnimations.tres index 8612b625..375eb92d 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/animation/OxFaceAnimations.tres +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/14. horse_head/animation/OxFaceAnimations.tres @@ -2,6 +2,18 @@ [sub_resource type="Animation" id="Animation_ttkyx"] length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} [sub_resource type="Animation" id="Animation_sfyuh"] resource_name = "idle" @@ -570,6 +582,18 @@ tracks/39/path = NodePath("Armature/Skeleton3D:heelIK_R") tracks/39/interp = 0 tracks/39/loop_wrap = true tracks/39/keys = PackedFloat32Array(0, 1, -0.456756, -0.539878, 0.539587, 0.456893) +tracks/40/type = "value" +tracks/40/imported = false +tracks/40/enabled = true +tracks/40/path = NodePath("Hitbox/CollisionShape3D:disabled") +tracks/40/interp = 1 +tracks/40/loop_wrap = true +tracks/40/keys = { +"times": PackedFloat32Array(0, 0.1, 0.333333), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [true, false, true] +} [sub_resource type="Animation" id="Animation_fdnqs"] resource_name = "SHIELD BASH" diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFace.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFace.tscn index cd6cf946..66189910 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFace.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFace.tscn @@ -1,24 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://6dnsw37d1uw4"] +[gd_scene load_steps=8 format=3 uid="uid://6dnsw37d1uw4"] [ext_resource type="Script" uid="uid://dveonnhcxcp08" path="res://src/enemy/BossTypeA.cs" id="1_v6b2s"] -[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_j7u30"] [ext_resource type="PackedScene" uid="uid://dnomfbym36ivg" path="res://src/enemy/enemy_types/15. ox_face/OxFaceModelView.tscn" id="2_v6b2s"] - -[sub_resource type="Resource" id="Resource_j7u30"] -script = ExtResource("2_j7u30") -CurrentAttack = 0 -CurrentDefense = 0 -MaxAttack = 0 -MaxDefense = 0 -ExpFromDefeat = 0 -Luck = 0.05 -_telluricResistance = 0.0 -_aeolicResistance = 0.0 -_hydricResistance = 0.0 -_igneousResistance = 0.0 -_ferrumResistance = 0.0 -DropsSoulGemChance = 0.75 -metadata/_custom_type_script = "uid://dnkmr0eq1sij0" +[ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="3_ow3fn"] +[ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="4_lwyi7"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_7uhtm"] radius = 12.4931 @@ -27,6 +12,10 @@ height = 50.0 [sub_resource type="SphereShape3D" id="SphereShape3D_j7u30"] radius = 15.426 +[sub_resource type="CylinderShape3D" id="CylinderShape3D_ow3fn"] +height = 20.0 +radius = 15.0 + [node name="OX FACE" type="CharacterBody3D"] collision_layer = 10 collision_mask = 3 @@ -34,68 +23,56 @@ axis_lock_linear_y = true axis_lock_angular_z = true motion_mode = 1 script = ExtResource("1_v6b2s") -_enemyStatResource = SubResource("Resource_j7u30") [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.3517, 0, 1.32912) shape = SubResource("CapsuleShape3D_7uhtm") -[node name="CollisionShape2" type="CollisionShape3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.3517, 0, 1.32912) -shape = SubResource("CapsuleShape3D_7uhtm") - [node name="EnemyModelView" parent="." instance=ExtResource("2_v6b2s")] unique_name_in_owner = true [node name="Skeleton3D" parent="EnemyModelView/Armature" index="0"] -bones/0/position = Vector3(-0.259338, -0.946665, -1.97492) +bones/0/position = Vector3(-0.260271, -1.05324, -1.96773) bones/0/rotation = Quaternion(0.0915277, -0.692111, -0.0341586, 0.715149) bones/1/rotation = Quaternion(0.0828172, 0.0642671, -0.39627, 0.91213) bones/2/rotation = Quaternion(-0.137837, 0.137086, 0.403643, 0.894025) bones/3/rotation = Quaternion(-0.00338816, 0.00852271, 0.0152662, 0.999842) bones/4/rotation = Quaternion(0.037164, 0.133882, 0.101977, 0.985036) bones/5/rotation = Quaternion(-0.0397875, -0.0104688, 0.0235613, 0.998875) -bones/6/rotation = Quaternion(-0.076622, -0.304817, -0.744794, 0.58864) +bones/6/rotation = Quaternion(-0.0474983, -0.294201, -0.744151, 0.597854) bones/7/rotation = Quaternion(0.0788712, -0.0306685, -0.220772, 0.971647) bones/8/rotation = Quaternion(-0.127286, 0.0273856, -0.425308, 0.895635) bones/9/rotation = Quaternion(-0.0931654, 0.0493592, -0.752794, 0.649757) bones/10/rotation = Quaternion(0.0429966, 0.0102923, 0.363547, 0.930526) -bones/11/rotation = Quaternion(-0.785686, -0.0625038, 0.0698825, 0.61148) +bones/11/rotation = Quaternion(-0.779773, -0.0573165, 0.0817155, 0.618054) bones/12/rotation = Quaternion(-0.607818, -0.670503, -0.284916, 0.31592) bones/13/rotation = Quaternion(-0.255941, 0.586097, -0.127235, 0.758153) bones/14/rotation = Quaternion(-0.513517, -0.227335, -0.228787, 0.795157) -bones/15/rotation = Quaternion(-0.20973, 0.736399, 0.623199, -0.159227) +bones/15/rotation = Quaternion(-0.215465, 0.745342, 0.613525, -0.147065) bones/16/rotation = Quaternion(-0.486067, -0.16412, -0.362283, 0.778174) bones/17/rotation = Quaternion(-0.0553629, -0.0361614, 0.62832, 0.77514) bones/18/rotation = Quaternion(-0.119289, 0.0998131, -0.0173011, 0.987678) -bones/19/position = Vector3(-0.295208, -1.11872, -2.00073) -bones/19/rotation = Quaternion(0.60979, 0.314261, 0.573867, -0.447296) -bones/20/rotation = Quaternion(-0.309203, -0.443293, -0.269813, 0.796923) -bones/21/rotation = Quaternion(-0.0601099, 0.00130101, 0.486592, 0.871558) +bones/19/position = Vector3(-0.381043, -1.19992, -1.71791) +bones/19/rotation = Quaternion(0.627663, 0.29282, 0.545153, -0.472338) +bones/20/rotation = Quaternion(-0.327815, -0.422723, -0.300673, 0.789581) +bones/21/rotation = Quaternion(-0.0604945, 0.00129838, 0.489705, 0.869786) bones/22/rotation = Quaternion(0.156218, 0.0483037, -0.624744, 0.763516) bones/23/rotation = Quaternion(0.123936, -0.00678731, -0.347765, 0.92933) bones/24/rotation = Quaternion(0.427621, 0.561851, 0.530083, 0.469549) bones/25/position = Vector3(4.82744, -12.3397, 0.183847) bones/25/rotation = Quaternion(-0.400051, 0.463947, -0.598439, 0.516317) -bones/26/position = Vector3(-0.275647, -1.11395, -2.01745) +bones/26/position = Vector3(-0.0233502, -1.11395, -2.01916) bones/26/rotation = Quaternion(0.608697, -0.3155, -0.575514, -0.445793) -bones/27/rotation = Quaternion(-0.208716, 0.421093, 0.142569, 0.871087) -bones/28/rotation = Quaternion(-0.0642794, -0.00115481, -0.513201, 0.855857) +bones/27/rotation = Quaternion(-0.202236, 0.424675, 0.137941, 0.871622) +bones/28/rotation = Quaternion(-0.0627838, -0.00116445, -0.50126, 0.863015) bones/29/rotation = Quaternion(0.150998, -0.0515735, 0.668372, 0.726511) bones/31/position = Vector3(-7.29038, -6.72226, -0.133983) bones/31/rotation = Quaternion(-0.453784, 0.542292, 0.542291, -0.453784) bones/32/rotation = Quaternion(0.456756, 0.539878, -0.539587, -0.456893) [node name="BoneAttachment3D" parent="EnemyModelView/Armature/Skeleton3D" index="0"] -transform = Transform3D(-0.29961, -0.088055, -0.949989, -0.328337, -0.925392, 0.189326, -0.895783, 0.368641, 0.248345, -1.65943, 8.32036, 4.94649) - -[node name="Hitbox" parent="EnemyModelView" index="3"] -script = null - -[node name="AttackTimer" type="Timer" parent="."] -unique_name_in_owner = true -wait_time = 3.5 +transform = Transform3D(-0.266252, -0.0359368, -0.963233, -0.333724, -0.934064, 0.127095, -0.904288, 0.355294, 0.236703, -1.68948, 8.20049, 4.9569) [node name="Collision" type="Area3D" parent="."] collision_layer = 2048 @@ -109,4 +86,27 @@ disabled = true [node name="Rotation" type="Node3D" parent="."] unique_name_in_owner = true +[node name="PlayerDetector" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 0 +collision_mask = 34 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] +shape = SubResource("CylinderShape3D_ow3fn") + +[node name="Components" type="Node3D" parent="."] + +[node name="FollowBehavior" parent="Components" instance=ExtResource("3_ow3fn")] +unique_name_in_owner = true +_followSpeed = 150.0 + +[node name="EngagePlayerBehavior" parent="Components" instance=ExtResource("4_lwyi7")] +unique_name_in_owner = true + +[node name="NavigationAgent" type="NavigationAgent3D" parent="Components"] +unique_name_in_owner = true +avoidance_enabled = true +radius = 1.0 +debug_enabled = true + [editable path="EnemyModelView"] diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFaceModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFaceModelView.tscn index 635e3936..413a195d 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFaceModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/15. ox_face/OxFaceModelView.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=30 format=4 uid="uid://dnomfbym36ivg"] +[gd_scene load_steps=25 format=4 uid="uid://dnomfbym36ivg"] [ext_resource type="Script" uid="uid://ckv5dmrw6pvn6" path="res://src/enemy/EnemyModelView3D.cs" id="1_6miqu"] -[ext_resource type="Script" uid="uid://bvcfww5827g74" path="res://src/enemy/enemy_types/BossTypeAEnemyModelView.cs" id="1_f2iok"] [ext_resource type="Texture2D" uid="uid://dp6hwvuhfkji8" path="res://src/enemy/enemy_types/15. ox_face/models/OX FACE_Metal054C_1K-JPG_Color.jpg" id="1_lsf8e"] [ext_resource type="AnimationLibrary" uid="uid://dn4501qsypsu" path="res://src/enemy/enemy_types/14. horse_head/animation/OxFaceAnimations.tres" id="3_pmgg3"] [ext_resource type="Texture2D" uid="uid://d3nsmrs41cpxs" path="res://src/enemy/enemy_types/14. horse_head/animation/Metal054C_1K-JPG_Metalness.jpg" id="4_q73y1"] @@ -149,23 +148,20 @@ bind/32/name = &"heelIK_R" bind/32/bone = -1 bind/32/pose = Transform3D(-0.16376, 0.9865, -2.58876e-07, 1.58082e-06, 2.84217e-14, -1, -0.9865, -0.16376, -1.55948e-06, 0.296279, -1.51158, -0.141545) -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pmgg3"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i5d3v"] animation = &"idle" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_f2iok"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5s5ab"] animation = &"primary_attack" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i5d3v"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_q73y1"] animation = &"secondary_attack" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5s5ab"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_desgq"] animation = &"walk" -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_q73y1"] - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_desgq"] - [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_1ch7e"] +advance_mode = 2 [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_v4mpe"] @@ -174,38 +170,33 @@ animation = &"walk" [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_srfnr"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4g1p4"] -switch_mode = 2 [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_evyqg"] switch_mode = 2 +advance_mode = 2 [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_x3fo8"] switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_m5y5t"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_pmgg3"] advance_mode = 2 [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_f2iok"] states/End/position = Vector2(1062, 114) -states/idle/node = SubResource("AnimationNodeAnimation_pmgg3") -states/idle/position = Vector2(450, 114) -states/primary_attack/node = SubResource("AnimationNodeAnimation_f2iok") -states/primary_attack/position = Vector2(841, 43) -states/secondary_attack/node = SubResource("AnimationNodeAnimation_i5d3v") -states/secondary_attack/position = Vector2(827, 183) -states/walk/node = SubResource("AnimationNodeAnimation_5s5ab") -states/walk/position = Vector2(493, 30) -transitions = ["idle", "primary_attack", SubResource("AnimationNodeStateMachineTransition_q73y1"), "idle", "secondary_attack", SubResource("AnimationNodeStateMachineTransition_desgq"), "idle", "walk", SubResource("AnimationNodeStateMachineTransition_1ch7e"), "walk", "idle", SubResource("AnimationNodeStateMachineTransition_v4mpe"), "walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_nb428"), "walk", "secondary_attack", SubResource("AnimationNodeStateMachineTransition_srfnr"), "primary_attack", "walk", SubResource("AnimationNodeStateMachineTransition_4g1p4"), "primary_attack", "idle", SubResource("AnimationNodeStateMachineTransition_evyqg"), "secondary_attack", "walk", SubResource("AnimationNodeStateMachineTransition_x3fo8"), "secondary_attack", "idle", SubResource("AnimationNodeStateMachineTransition_m5y5t"), "Start", "idle", SubResource("AnimationNodeStateMachineTransition_pmgg3")] +states/Idle/node = SubResource("AnimationNodeAnimation_i5d3v") +states/Idle/position = Vector2(347, 100) +"states/Primary Attack/node" = SubResource("AnimationNodeAnimation_5s5ab") +"states/Primary Attack/position" = Vector2(427, 225.889) +"states/Secondary Attack/node" = SubResource("AnimationNodeAnimation_q73y1") +"states/Secondary Attack/position" = Vector2(651, 225.889) +states/Walking/node = SubResource("AnimationNodeAnimation_desgq") +states/Walking/position = Vector2(651, 100) +transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_1ch7e"), "Idle", "Walking", SubResource("AnimationNodeStateMachineTransition_v4mpe"), "Walking", "Idle", SubResource("AnimationNodeStateMachineTransition_nb428"), "Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_srfnr"), "Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_4g1p4"), "Primary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_evyqg"), "Secondary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_x3fo8")] graph_offset = Vector2(0, -71.1111) [sub_resource type="BoxShape3D" id="BoxShape3D_pmgg3"] size = Vector3(5, 24.0327, 5.50244) [node name="EnemyModelView" type="Node3D"] -script = ExtResource("1_f2iok") +script = ExtResource("1_6miqu") [node name="Armature" type="Node3D" parent="."] script = ExtResource("1_6miqu") @@ -215,7 +206,7 @@ bones/0/name = "spine1" bones/0/parent = -1 bones/0/rest = Transform3D(1.49012e-06, 0.00846654, -0.999964, 2.93367e-08, 0.999964, 0.00846654, 1, -4.23752e-08, 1.49012e-06, 0.000155807, -0.00105953, -2.01735) bones/0/enabled = true -bones/0/position = Vector3(-0.260226, -1.04815, -1.96808) +bones/0/position = Vector3(-0.259283, -0.9404, -1.97534) bones/0/rotation = Quaternion(0.0915277, -0.692111, -0.0341586, 0.715149) bones/0/scale = Vector3(1, 1, 1) bones/1/name = "spine0" @@ -258,7 +249,7 @@ bones/6/parent = 5 bones/6/rest = Transform3D(0.0598389, 0.98531, 0.15995, -0.975271, 0.0235553, 0.219755, 0.212759, -0.169144, 0.962353, 3.65078e-07, 1.40318, 0) bones/6/enabled = true bones/6/position = Vector3(3.65078e-07, 1.40318, 0) -bones/6/rotation = Quaternion(-0.0474983, -0.294201, -0.744151, 0.597854) +bones/6/rotation = Quaternion(-0.0777813, -0.305234, -0.744803, 0.58826) bones/6/scale = Vector3(1, 1, 1) bones/7/name = "Bone.007" bones/7/parent = 6 @@ -293,7 +284,7 @@ bones/11/parent = 1 bones/11/rest = Transform3D(0.981457, 0.0769315, -0.175568, 0.18837, -0.217537, 0.957703, 0.035485, -0.973015, -0.227995, -1.09896e-07, 3.84743, -2.10479e-07) bones/11/enabled = true bones/11/position = Vector3(-1.09896e-07, 3.84743, -2.10479e-07) -bones/11/rotation = Quaternion(-0.779862, -0.0573929, 0.0815417, 0.617959) +bones/11/rotation = Quaternion(-0.786087, -0.0628615, 0.0690646, 0.61102) bones/11/scale = Vector3(1, 0.999999, 1) bones/12/name = "arm2_L" bones/12/parent = 11 @@ -321,21 +312,21 @@ bones/15/parent = 1 bones/15/rest = Transform3D(-0.98213, 0.0512573, -0.181089, -0.187541, -0.185921, 0.964501, 0.0157694, 0.981227, 0.192212, 0.00107862, 3.8461, -0.0821097) bones/15/enabled = true bones/15/position = Vector3(0.00107886, 3.8461, -0.0821095) -bones/15/rotation = Quaternion(-0.215266, 0.745035, 0.613865, -0.14749) +bones/15/rotation = Quaternion(-0.209386, 0.735858, 0.623768, -0.15995) bones/15/scale = Vector3(1, 1, 1) bones/16/name = "arm2_R" bones/16/parent = 15 bones/16/rest = Transform3D(0.999962, -0.00846545, 0.00203661, 0.00853768, 0.99922, -0.0385481, -0.0017087, 0.038564, 0.999254, -4.28408e-07, 3.65838, -2.16067e-06) bones/16/enabled = true bones/16/position = Vector3(-4.28408e-07, 3.65838, -2.16067e-06) -bones/16/rotation = Quaternion(-0.486067, -0.16412, -0.362283, 0.778174) +bones/16/rotation = Quaternion(-0.424022, 0.233298, -0.489444, 0.725412) bones/16/scale = Vector3(1, 1, 0.999999) bones/17/name = "arm3_R" bones/17/parent = 16 bones/17/rest = Transform3D(0.998789, 0.0488077, -0.00615137, -0.0491113, 0.996528, -0.0672226, 0.00284903, 0.0674433, 0.997719, -5.21541e-08, 3.04263, -1.31503e-06) bones/17/enabled = true bones/17/position = Vector3(-5.21541e-08, 3.04263, -1.31503e-06) -bones/17/rotation = Quaternion(-0.0553629, -0.0361614, 0.62832, 0.77514) +bones/17/rotation = Quaternion(-0.0553628, -0.0361614, 0.62832, 0.77514) bones/17/scale = Vector3(1, 0.999999, 1) bones/18/name = "hand_R" bones/18/parent = 17 @@ -348,22 +339,22 @@ bones/19/name = "hip_L" bones/19/parent = -1 bones/19/rest = Transform3D(0.138486, 0.897208, 0.419333, -0.129033, -0.403458, 0.905854, 0.981923, -0.179556, 0.059896, 0.000155807, -0.00105953, -2.01735) bones/19/enabled = true -bones/19/position = Vector3(-0.376941, -1.19604, -1.73142) -bones/19/rotation = Quaternion(0.626841, 0.29386, 0.546553, -0.471165) +bones/19/position = Vector3(-0.290163, -1.11395, -2.01735) +bones/19/rotation = Quaternion(0.608697, 0.3155, 0.575514, -0.445793) bones/19/scale = Vector3(1, 1, 1) bones/20/name = "leg1_L" bones/20/parent = 19 bones/20/rest = Transform3D(0.945603, 0.113405, 0.304916, -0.324072, 0.410457, 0.852351, -0.0284943, -0.9048, 0.424881, 2.08616e-07, 2.00996, -7.1153e-07) bones/20/enabled = true bones/20/position = Vector3(2.08616e-07, 2.00996, -7.1153e-07) -bones/20/rotation = Quaternion(-0.326944, -0.42372, -0.299222, 0.789959) +bones/20/rotation = Quaternion(-0.30808, -0.444485, -0.267974, 0.797314) bones/20/scale = Vector3(1, 0.999999, 1) bones/21/name = "leg2_L" bones/21/parent = 20 bones/21/rest = Transform3D(0.990336, -0.138679, 0.00180777, 0.138628, 0.990193, 0.0173138, -0.00419111, -0.0168959, 0.999848, 5.96046e-08, 5.85994, -5.23403e-07) bones/21/enabled = true bones/21/position = Vector3(5.96046e-08, 5.85994, -5.23403e-07) -bones/21/rotation = Quaternion(-0.0604797, 0.00129848, 0.489585, 0.869855) +bones/21/rotation = Quaternion(-0.060049, 0.00130142, 0.4861, 0.871837) bones/21/scale = Vector3(1, 1, 1) bones/22/name = "foot1_L" bones/22/parent = 21 @@ -397,7 +388,7 @@ bones/26/name = "hip_R" bones/26/parent = -1 bones/26/rest = Transform3D(0.138486, -0.897208, -0.419333, 0.129033, -0.403458, 0.905854, -0.981923, -0.179556, 0.059896, -0.000155807, -0.00105953, -2.01735) bones/26/enabled = true -bones/26/position = Vector3(-0.0354083, -1.11395, -2.01909) +bones/26/position = Vector3(-0.290475, -1.11395, -2.01735) bones/26/rotation = Quaternion(0.608697, -0.3155, -0.575514, -0.445793) bones/26/scale = Vector3(1, 1, 1) bones/27/name = "leg1_R" @@ -405,14 +396,14 @@ bones/27/parent = 26 bones/27/rest = Transform3D(0.945603, -0.113405, -0.304916, 0.324072, 0.410457, 0.852351, 0.0284943, -0.9048, 0.424881, -9.54606e-09, 2.00996, -3.52971e-07) bones/27/enabled = true bones/27/position = Vector3(-9.54606e-09, 2.00996, -3.52971e-07) -bones/27/rotation = Quaternion(-0.202394, 0.424587, 0.138062, 0.871609) +bones/27/rotation = Quaternion(-0.209385, 0.420724, 0.143017, 0.871031) bones/27/scale = Vector3(1, 0.999999, 1) bones/28/name = "leg2_R" bones/28/parent = 27 bones/28/rest = Transform3D(0.990336, 0.138679, -0.00180777, -0.138628, 0.990193, 0.0173138, 0.00419111, -0.0168959, 0.999848, 4.51691e-08, 5.85994, -3.72529e-09) bones/28/enabled = true bones/28/position = Vector3(4.51691e-08, 5.85994, -3.72529e-09) -bones/28/rotation = Quaternion(-0.0628067, -0.0011643, -0.501442, 0.862908) +bones/28/rotation = Quaternion(-0.0643786, -0.00115414, -0.513993, 0.855374) bones/28/scale = Vector3(1, 1, 1) bones/29/name = "foot1_R" bones/29/parent = 28 @@ -444,7 +435,7 @@ bones/32/rotation = Quaternion(0.456756, 0.539878, -0.539587, -0.456893) bones/32/scale = Vector3(1, 1, 1) [node name="BoneAttachment3D" type="BoneAttachment3D" parent="Armature/Skeleton3D"] -transform = Transform3D(-0.266252, -0.0359368, -0.963233, -0.333724, -0.934064, 0.127095, -0.904288, 0.355294, 0.236703, -1.68944, 8.20558, 4.95656) +transform = Transform3D(-0.300929, -0.0901167, -0.949379, -0.328078, -0.924976, 0.191792, -0.895436, 0.369186, 0.248787, -1.6582, 8.32712, 4.94593) bone_name = "TOP OF SKULL" bone_idx = 8 diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.cs b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.cs index 5ae7e867..9e7f214c 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.cs +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.cs @@ -1,28 +1,19 @@ using Chickensoft.AutoInject; using Chickensoft.Introspection; using Godot; -using System; -using System.Collections.Immutable; -using System.Linq; -using Zennysoft.Ma.Adapter; - namespace Zennysoft.Game.Ma; [Meta(typeof(IAutoNode))] -public partial class DemonWall : CharacterBody3D +public partial class DemonWall : Enemy3D { public override void _Notification(int what) => this.Notify(what); - [Dependency] protected IPlayer _player => this.DependOn(() => GetParent().GetChildren().OfType().Single()); - - [Export] protected EnemyStatResource _enemyStatResource { get; set; } = default!; - - [Node] public DemonWallModelView EnemyModelView { get; set; } = default!; - public float ThinkTime { get; } [Export] private double _maximumWallMoveAmount = 24; + [Node] private new DemonWallModelView EnemyModelView { get; set; } = default!; + private Timer _attackTimer; public void OnReady() @@ -32,33 +23,26 @@ public partial class DemonWall : CharacterBody3D AddChild(_attackTimer); } - public void Activate() + public override void Activate() { - EnemyModelView.PlayActivateAnimation(); SetPhysicsProcess(true); + EnemyModelView.PlayActivateAnimation(); + _attackTimer.Start(); } + public override void Idle() + { + } + + public override void Die() => QueueFree(); + private void AttackTimer_Timeout() { PerformAction(); } - public void PerformAction() + public override void PerformAction() { EnemyModelView.Attack(_maximumWallMoveAmount); } - - public void TakeDamage(int damage) - { - EnemyModelView.PlayHitAnimation(); - } - - public IDungeonRoom GetCurrentRoom(ImmutableList roomList) => throw new NotImplementedException(); - - public async void Die() - { - EnemyModelView.PlayDeathAnimation(); - await ToSignal(GetTree().CreateTimer(0.8f), "timeout"); - CallDeferred(MethodName.QueueFree); - } } diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.tscn index d8775645..d0bc3d2b 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWall.tscn @@ -1,27 +1,8 @@ -[gd_scene load_steps=7 format=3 uid="uid://6kck5vborfyk"] +[gd_scene load_steps=5 format=3 uid="uid://6kck5vborfyk"] [ext_resource type="Script" uid="uid://dlvk70cr20nva" path="res://src/enemy/enemy_types/16. demon wall/DemonWall.cs" id="1_dqcrh"] -[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_bpd8u"] [ext_resource type="PackedScene" uid="uid://l4413jwn0m8v" path="res://src/enemy/enemy_types/16. demon wall/DemonWallModelView.tscn" id="4_affkc"] -[sub_resource type="Resource" id="Resource_ccv8a"] -script = ExtResource("2_bpd8u") -CurrentHP = 100.0 -MaximumHP = 100 -CurrentAttack = null -CurrentDefense = null -MaxAttack = null -MaxDefense = null -ExpFromDefeat = null -Luck = 0.05 -_telluricResistance = null -_aeolicResistance = null -_hydricResistance = null -_igneousResistance = null -_ferrumResistance = null -DropsSoulGemChance = 0.0 -metadata/_custom_type_script = "uid://dnkmr0eq1sij0" - [sub_resource type="BoxShape3D" id="BoxShape3D_5ht6q"] size = Vector3(28.3283, 10.355, 4.45671) @@ -32,8 +13,6 @@ size = Vector3(28.4577, 8.476, 8.04248) collision_layer = 2 collision_mask = 2 script = ExtResource("1_dqcrh") -_enemyStatResource = SubResource("Resource_ccv8a") -_maximumWallMoveAmount = null [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.40558, 8.3319, 2.53654) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWallModelView.cs b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWallModelView.cs index df2ac5f4..4208056e 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWallModelView.cs +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/16. demon wall/DemonWallModelView.cs @@ -8,7 +8,7 @@ using Zennysoft.Ma.Adapter; namespace Zennysoft.Game.Ma; [Meta(typeof(IAutoNode))] -public partial class DemonWallModelView : EnemyModelView3D +public partial class DemonWallModelView : EnemyModelView3D, IEnemyModelView { public override void _Notification(int what) => this.Notify(what); @@ -24,7 +24,7 @@ public partial class DemonWallModelView : EnemyModelView3D [Node] private AnimatableBody3D _opposingWall { get; set; } = default!; - public void PlayActivateAnimation() + public override void PlayActivateAnimation() { _opposingWall.Show(); var collisionShape = _opposingWall.GetChildren().OfType().Single(); diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemon.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemon.tscn index 450a3cda..bddb11a0 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemon.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemon.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=11 format=3 uid="uid://dpq17ej06uah1"] +[gd_scene load_steps=10 format=3 uid="uid://dpq17ej06uah1"] [ext_resource type="Script" uid="uid://8f4alhh2ubvg" path="res://src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemon.cs" id="1_wtipe"] [ext_resource type="PackedScene" uid="uid://cu7n814hhtjwm" path="res://src/enemy/enemy_types/9b. Aqueos Demon/AqueosModelView.tscn" id="2_0hbxv"] -[ext_resource type="PackedScene" uid="uid://bxymnqkoi78oa" path="res://src/system/stats/HealthComponent.tscn" id="3_gxowl"] [ext_resource type="PackedScene" uid="uid://2nkvacxsd46b" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_5pbfd"] [ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_ha827"] [ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="6_7afhy"] @@ -69,8 +68,6 @@ shape = SubResource("CylinderShape3D_gxowl") [node name="Components" type="Node3D" parent="."] -[node name="HealthComponent" parent="Components" instance=ExtResource("3_gxowl")] - [node name="PatrolBehavior" parent="Components" instance=ExtResource("4_5pbfd")] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosModelView.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosModelView.tscn index c3c78636..9d8bdb21 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosModelView.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/9b. Aqueos Demon/AqueosModelView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=368 format=3 uid="uid://cu7n814hhtjwm"] +[gd_scene load_steps=367 format=3 uid="uid://cu7n814hhtjwm"] [ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_vf7er"] [ext_resource type="Resource" uid="uid://co0eq5nl2ai24" path="res://src/enemy/enemy_types/9b. Aqueos Demon/AqueosDemonInfo.tres" id="2_ejhrk"] @@ -332,7 +332,6 @@ [ext_resource type="Texture2D" uid="uid://ywccbgt3bao8" path="res://src/enemy/enemy_types/9b. Aqueos Demon/animations/WATER LOOP/0186.png" id="330_cmwvy"] [ext_resource type="Texture2D" uid="uid://daos4dnmaq6xx" path="res://src/enemy/enemy_types/9b. Aqueos Demon/animations/WATER LOOP/0188.png" id="331_p8xq6"] [ext_resource type="Texture2D" uid="uid://c311su0a86yii" path="res://src/enemy/enemy_types/9b. Aqueos Demon/animations/WATER LOOP/0190.png" id="332_8j4qa"] -[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="333_ylptm"] [ext_resource type="AnimationNodeStateMachine" uid="uid://co7lshemjrro8" path="res://src/enemy/animation_state_machines/IdleStateMachine.tres" id="334_sm161"] [ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="335_6g4mi"] [ext_resource type="AnimationNodeStateMachine" uid="uid://clybvwx3itfeo" path="res://src/enemy/animation_state_machines/SecondaryAttackStateMachine.tres" id="336_oklrx"] @@ -2102,7 +2101,6 @@ unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 collision_mask = 64 -script = ExtResource("333_ylptm") [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -1.45579) diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/BossTypeAEnemyModelView.cs b/Zennysoft.Game.Ma/src/enemy/enemy_types/BossTypeAEnemyModelView.cs deleted file mode 100644 index c2862269..00000000 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/BossTypeAEnemyModelView.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Chickensoft.AutoInject; -using Chickensoft.Introspection; -using Godot; - -namespace Zennysoft.Game.Ma; -[Meta(typeof(IAutoNode))] -public partial class BossTypeAEnemyModelView : EnemyModelView3D -{ - public override void _Notification(int what) => this.Notify(what); - - [Node] public Area3D Hitbox { get; set; } = default!; -} diff --git a/Zennysoft.Game.Ma/src/game/Game.cs b/Zennysoft.Game.Ma/src/game/Game.cs index 2a9721dd..f4092328 100644 --- a/Zennysoft.Game.Ma/src/game/Game.cs +++ b/Zennysoft.Game.Ma/src/game/Game.cs @@ -11,6 +11,7 @@ using Zennysoft.Game.Abstractions; using Zennysoft.Ma.Adapter; using System.IO; using System.Threading.Tasks; +using Zennysoft.Game.Implementation.Components; [Meta(typeof(IAutoNode))] public partial class Game : Node3D, IGame @@ -94,7 +95,6 @@ public partial class Game : Node3D, IGame PlayerData = new PlayerData() { - PlayerStats = _player.Stats, Inventory = _player.Inventory }, MapData = new MapData() @@ -321,12 +321,6 @@ public partial class Game : Node3D, IGame public IDungeonFloor CurrentFloor => _map.CurrentFloor; - public void EnemyDefeated(Vector3 defeatedLocation) - { - _player.GainExp(10 * GameRepo.ExpRate); - DropRestorative(defeatedLocation); - } - public InventoryItem RerollItem(InventoryItem itemToReroll, bool insertIntoInventory = true) { var itemDb = new ItemDatabase(); @@ -390,7 +384,7 @@ public partial class Game : Node3D, IGame GameRepo.Resume(); } - private void GameEventDepot_RestorativePickedUp(IHealthPack obj) => _player.Stats.SetCurrentVT(_player.Stats.CurrentVT.Value + (int)obj.RestoreAmount); + private void GameEventDepot_RestorativePickedUp(IHealthPack obj) => _player.VTComponent.Restore((int)obj.RestoreAmount); private void IsPaused_Sync(bool isPaused) => GetTree().Paused = isPaused; @@ -398,15 +392,15 @@ public partial class Game : Node3D, IGame private void EnactConsumableItemEffects(ConsumableItem consumableItem) { - if (_player.Stats.CurrentHP == _player.Stats.MaximumHP && consumableItem.RaiseHPAmount > 0) - _player.RaiseHP(consumableItem.RaiseHPAmount); - if (_player.Stats.CurrentVT == _player.Stats.MaximumVT && consumableItem.RaiseVTAmount > 0) - _player.RaiseVT(consumableItem.RaiseVTAmount); + if (_player.HealthComponent.AtFullHealth && consumableItem.RaiseHPAmount > 0) + _player.HealthComponent.RaiseMaximumHP(consumableItem.RaiseHPAmount); + if (_player.VTComponent.AtFullVT && consumableItem.RaiseVTAmount > 0) + _player.VTComponent.RaiseMaximumVT(consumableItem.RaiseVTAmount); - if (consumableItem.HealHPAmount > 0 && _player.Stats.CurrentHP != _player.Stats.MaximumHP) - _player.HealHP(consumableItem.HealHPAmount); - if (consumableItem.HealVTAmount > 0 && _player.Stats.CurrentVT != _player.Stats.MaximumVT) - _player.HealVT(consumableItem.HealVTAmount); + if (consumableItem.HealHPAmount > 0) + _player.HealthComponent.Heal(consumableItem.HealHPAmount); + if (consumableItem.HealVTAmount > 0) + _player.VTComponent.Restore(consumableItem.HealVTAmount); } private void EnactEffectItemEffects(EffectItem effectItem) @@ -478,9 +472,9 @@ public partial class Game : Node3D, IGame } if (throwableItem.HealHPAmount > 0) - _player.HealHP(throwableItem.HealHPAmount); + _player.HealthComponent.Heal(throwableItem.HealHPAmount); if (throwableItem.HealVTAmount > 0) - _player.HealVT(throwableItem.HealVTAmount); + _player.VTComponent.Restore(throwableItem.HealVTAmount); } private void RemoveItemOrSubtractFromItemCount(InventoryItem item) diff --git a/Zennysoft.Game.Ma/src/game/IGame.cs b/Zennysoft.Game.Ma/src/game/IGame.cs index 617c1e88..54e3f395 100644 --- a/Zennysoft.Game.Ma/src/game/IGame.cs +++ b/Zennysoft.Game.Ma/src/game/IGame.cs @@ -26,8 +26,6 @@ public interface IGame : IProvide, IProvide, IProvide public void FloorExitReached(); - public void EnemyDefeated(Vector3 defeatedLocation); - public InventoryItem RerollItem(InventoryItem itemToReroll, bool insertIntoInventory = true); public void GameOver(); diff --git a/Zennysoft.Game.Ma/src/items/EffectService.cs b/Zennysoft.Game.Ma/src/items/EffectService.cs index f845d9de..515b6d97 100644 --- a/Zennysoft.Game.Ma/src/items/EffectService.cs +++ b/Zennysoft.Game.Ma/src/items/EffectService.cs @@ -98,7 +98,7 @@ public class EffectService var currentEnemies = currentRoom.EnemiesInRoom; //foreach (var enemy in currentEnemies) // enemy.SetCurrentHP(enemy.GetMaximumHP()); - _player.Stats.SetCurrentHP(_player.Stats.MaximumHP.Value); + _player.HealthComponent.SetHealth(_player.HealthComponent.MaximumHP.Value); } public void AbsorbHPFromAllEnemiesInRoom() @@ -112,7 +112,7 @@ public class EffectService var hpToAbsorb = 0.0; //foreach (var enemy in currentEnemies) // hpToAbsorb += enemy.CurrentHP.Value * 0.05; - _player.Stats.SetCurrentHP(_player.Stats.CurrentHP.Value + (int)hpToAbsorb); + _player.HealthComponent.Heal((int)hpToAbsorb); GD.Print("HP to absorb: " + hpToAbsorb); } @@ -133,11 +133,11 @@ public class EffectService public void SwapHPandVT() { - var oldHp = _player.Stats.CurrentHP.Value; - var oldVt = _player.Stats.CurrentVT.Value; + var oldHp = _player.HealthComponent.CurrentHP.Value; + var oldVt = _player.VTComponent.CurrentVT.Value; - _player.Stats.SetCurrentHP(oldVt); - _player.Stats.SetCurrentVT(oldHp); + _player.HealthComponent.SetHealth(oldVt); + _player.VTComponent.SetVT(oldHp); } public void RandomEffect(EffectItem item) @@ -157,7 +157,7 @@ public class EffectService var currentWeapon = (Weapon)_player.EquippedWeapon.Value; currentWeapon.IncreaseWeaponAttack(1); - _player.ModifyBonusAttack(1); + //_player.ModifyBonusAttack(1); } public void RaiseCurrentArmorDefense() @@ -167,7 +167,7 @@ public class EffectService var currentArmor = (Armor)_player.EquippedArmor.Value; currentArmor.IncreaseArmorDefense(1); - _player.ModifyBonusDefense(1); + _player.DefenseComponent.RaiseBonusDefense(1); } public void RaiseLevel() diff --git a/Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs b/Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs index 415deb1f..c4097538 100644 --- a/Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs +++ b/Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs @@ -27,14 +27,18 @@ public partial class BossRoomA : Node3D, IBossRoom, IDungeonFloor [Node] public Node3D GateCollision { get; set; } = default!; + [Node] public MeshInstance3D LOCKEDGATE { get; set; } = default!; + [Node] private Area3D _exit { get; set; } = default!; public ImmutableList Rooms { get; } public bool FloorIsLoaded { get; set; } - public void Setup() + public void OnReady() { ActivateTrap.BodyEntered += ActivateTrap_BodyEntered; _exit.AreaEntered += Exit_AreaEntered; + OxFace.HealthComponent.HealthReachedZero += CheckForBossFightEnd; + HorseFace.HealthComponent.HealthReachedZero += CheckForBossFightEnd; } private void ActivateTrap_BodyEntered(Node3D body) @@ -51,9 +55,16 @@ public partial class BossRoomA : Node3D, IBossRoom, IDungeonFloor HorseFace.StartFight(); } + private void CheckForBossFightEnd() + { + if (OxFace.HealthComponent.CurrentHP.Value <= 0 && HorseFace.HealthComponent.CurrentHP.Value <= 0) + OnBossFightEnded(); + } + public void OnBossFightEnded() { GateCollision.CallDeferred(MethodName.QueueFree); + LOCKEDGATE.Hide(); } public void ExitReached() diff --git a/Zennysoft.Game.Ma/src/map/dungeon/floors/Special Floors/15. Boss Floor A.tscn b/Zennysoft.Game.Ma/src/map/dungeon/floors/Special Floors/15. Boss Floor A.tscn index d390827d..f68ad6bc 100644 --- a/Zennysoft.Game.Ma/src/map/dungeon/floors/Special Floors/15. Boss Floor A.tscn +++ b/Zennysoft.Game.Ma/src/map/dungeon/floors/Special Floors/15. Boss Floor A.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=274 format=4 uid="uid://5ja3qxn8h7iw"] +[gd_scene load_steps=276 format=4 uid="uid://5ja3qxn8h7iw"] [ext_resource type="Script" uid="uid://tqyybt313web" path="res://src/map/dungeon/code/BossRoomA.cs" id="1_0h3lb"] [ext_resource type="Texture2D" uid="uid://vjbe1lg810gh" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/15_A1_BOSS FLOOR A_VER_swirled_column.png" id="2_06eum"] @@ -4280,6 +4280,13 @@ shader_parameter/uv1_offset = Vector3(0, 0, 0) shader_parameter/color1 = Color(1, 1, 1, 1) shader_parameter/color2 = Color(1, 1, 1, 1) +[sub_resource type="NavigationMesh" id="NavigationMesh_eanap"] +vertices = PackedVector3Array(-148.246, 0.5, 7.6195, -148.246, 0.5, 31.6195, -99.246, 0.5, 31.6195, -99.246, 0.5, 7.6195) +polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)] + +[sub_resource type="PlaneMesh" id="PlaneMesh_m8pjb"] +size = Vector2(50, 25) + [node name="Boss Floor A" type="Node3D"] script = ExtResource("1_0h3lb") @@ -4445,7 +4452,8 @@ libraries = { [node name="Boss Floor 1 Ver_ 3" type="Node3D" parent="Model"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.547867, -15.9756, 0) -[node name="LOCKED GATE" type="MeshInstance3D" parent="Model/Boss Floor 1 Ver_ 3"] +[node name="LOCKEDGATE" type="MeshInstance3D" parent="Model/Boss Floor 1 Ver_ 3"] +unique_name_in_owner = true transform = Transform3D(0.816274, 0, 0, 0, 1.99383, 0, 0, 0, 1.99383, -145.76, 15.2976, 17.4223) mesh = SubResource("ArrayMesh_j7o60") skeleton = NodePath("") @@ -4855,14 +4863,18 @@ shape = SubResource("BoxShape3D_pkvyy") [node name="HorseHeadStatue" parent="Room" instance=ExtResource("24_r1rk5")] unique_name_in_owner = true -transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -102.157, -2.30863, 13.0139) +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -102.157, -2.30863, 13.3664) [node name="HorseFace" parent="Room" instance=ExtResource("25_a482y")] unique_name_in_owner = true -transform = Transform3D(-6.55671e-09, 0, -0.15, 0, 0.15, 0, 0.15, 0, -6.55671e-09, -102.157, -0.510939, 13.0139) +transform = Transform3D(-6.55671e-09, 0, -0.15, 0, 0.15, 0, 0.15, 0, -6.55671e-09, -102.157, -0.510939, 13.3664) visible = false -PrimaryAttackElementalType = 0 -PrimaryAttackElementalDamageBonus = 1.0 +PrimaryAttackElementalType = null +PrimaryAttackElementalDamageBonus = null +AttackValue = null +DefenseValue = null +InitialHP = null +ExpAmount = null [node name="OxFaceStatue" parent="Room" instance=ExtResource("26_futcf")] unique_name_in_owner = true @@ -4872,6 +4884,12 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -101.5 unique_name_in_owner = true transform = Transform3D(-6.55671e-09, 0, -0.15, 0, 0.15, 0, 0.15, 0, -6.55671e-09, -101.703, -0.479859, 22.0955) visible = false +PrimaryAttackElementalType = null +PrimaryAttackElementalDamageBonus = null +AttackValue = null +DefenseValue = null +InitialHP = null +ExpAmount = null [node name="Exit" type="Area3D" parent="Room"] unique_name_in_owner = true @@ -4937,3 +4955,11 @@ transform = Transform3D(0.565, 0, 0, 0, 0.565, 0, 0, 0, 0.565, -92.0811, -2.7728 [node name="sarco" parent="." instance=ExtResource("59_ucaw1")] transform = Transform3D(0.55, 0, 0, 0, 0.55, 0, 0, 0, 0.55, -92.04, -2.83756, 3.9847) + +[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."] +navigation_mesh = SubResource("NavigationMesh_eanap") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationRegion3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -123.746, 0, 19.6195) +visible = false +mesh = SubResource("PlaneMesh_m8pjb") diff --git a/Zennysoft.Game.Ma/src/player/Player.cs b/Zennysoft.Game.Ma/src/player/Player.cs index 3b4bd605..1e232d4e 100644 --- a/Zennysoft.Game.Ma/src/player/Player.cs +++ b/Zennysoft.Game.Ma/src/player/Player.cs @@ -6,6 +6,7 @@ using Chickensoft.SaveFileBuilder; using Godot; using SimpleInjector; using System; +using Zennysoft.Game.Implementation.Components; using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter.Entity; @@ -26,14 +27,22 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide PlayerChunk { get; set; } = default!; #endregion - public double CurrentHP => Stats.CurrentHP.Value; + public HealthComponent HealthComponent { get; private set; } + + public VTComponent VTComponent { get; private set; } + + public AttackComponent AttackComponent { get; private set; } + + public DefenseComponent DefenseComponent { get; private set; } + + public ExperiencePointsComponent ExperiencePointsComponent { get; private set; } + + public LuckComponent LuckComponent { get; private set; } public Vector3 CurrentPosition => GlobalPosition; public Basis CurrentBasis => Transform.Basis; - public PlayerStats Stats { get; set; } = default!; - public IInventory Inventory { get; private set; } = default!; public AutoProp EquippedWeapon => _equippedWeapon; @@ -61,8 +70,25 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide(Lifestyle.Singleton); - //container.Verify(); PlayerLogic = container.GetInstance(); PlayerLogic.Set(this as IPlayer); PlayerLogic.Set(Settings); - PlayerLogic.Set(Stats); PlayerLogic.Set(_gameRepo); Hitbox.AreaEntered += Hitbox_AreaEntered; CollisionDetector.AreaEntered += CollisionDetector_AreaEntered; - AnimationPlayer.AnimationFinished += OnAnimationFinished; } public void OnResolved() { - Settings = new PlayerLogic.Settings() { RotationSpeed = _playerStatResource.RotationSpeed, MoveSpeed = _playerStatResource.MoveSpeed, Acceleration = _playerStatResource.Acceleration }; + Settings = new PlayerLogic.Settings() { RotationSpeed = RotationSpeed, MoveSpeed = MoveSpeed, Acceleration = Acceleration }; PlayerChunk = new SaveChunk( onSave: (chunk) => new PlayerData() { - PlayerStats = Stats, Inventory = Inventory }, onLoad: (chunk, data) => { - Stats = new PlayerStats( - data.PlayerStats.CurrentHP, - data.PlayerStats.MaximumHP, - data.PlayerStats.CurrentVT, - data.PlayerStats.MaximumVT, - data.PlayerStats.CurrentAttack, - data.PlayerStats.BonusAttack, - data.PlayerStats.MaxAttack, - data.PlayerStats.CurrentDefense, - data.PlayerStats.BonusDefense, - data.PlayerStats.MaxDefense, - data.PlayerStats.CurrentExp, - data.PlayerStats.CurrentLevel, - data.PlayerStats.ExpToNextLevel, - data.PlayerStats.Luck); Inventory = data.Inventory; } ); @@ -160,18 +161,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide - { - if (PlayerIsHittingGeometry()) - { - AnimationPlayer.Play("hit_wall"); - _gameRepo.OnPlayerAttackedWall(); - } - else - { - PlayAttackAnimation(); - } - }) .Handle((in PlayerLogic.Output.ThrowItem output) => { }) @@ -192,6 +181,14 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide 0) - { - var damageDone = DamageCalculator.CalculateDamage(damage, Stats.CurrentDefense.Value + Stats.BonusDefense.Value, ((Armor)_equippedArmor.Value).Stats.ElementalResistanceSet); - Stats.SetCurrentHP(Stats.CurrentHP.Value - damageDone); - } + var damageReceived = DamageCalculator.CalculateDamage(damage, DefenseComponent.TotalDefense, ((Armor)_equippedArmor.Value).Stats.ElementalResistanceSet); + HealthComponent.Damage(damageReceived); } public void Knockback(float impulse) @@ -314,42 +260,22 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide Input.GetActionStrength(GameInputs.StrafeLeft); - private static float RightStrafeInputVector - { - get - { - return Input.GetActionStrength(GameInputs.StrafeRight); - } - } + private static float RightStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeRight); private void ThrowItem() { @@ -475,68 +382,28 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide GlobalPosition = globalPosition; private void OnHealthTimerTimeout() { - if (Stats.CurrentHP.Value <= 0) - return; - - if (Stats.CurrentVT.Value > 0) + if (VTComponent.CurrentVT.Value > 0) { if (((Accessory)EquippedAccessory.Value).AccessoryTag == AccessoryTag.HalfVTConsumption) - { reduceOnTick = !reduceOnTick; - } - Stats.SetCurrentHP(Stats.CurrentHP.Value + 1); + + HealthComponent.Heal(1); + if (reduceOnTick) - Stats.SetCurrentVT(Stats.CurrentVT.Value - 1); + VTComponent.Reduce(1); } else - Stats.SetCurrentHP(Stats.CurrentHP.Value - 1); - } - - private void EquippedWeapon_Sync(EquipableItem obj) - { - ModifyBonusAttack(((Weapon)obj).Damage); - } - - private void EquippedArmor_Sync(EquipableItem obj) - { - ModifyBonusDefense(((Armor)obj).Defense); - } - - private void EquippedAccessory_Sync(EquipableItem accessory) - { - ModifyMaximumHP(((Accessory)accessory).MaxHPUp); - ModifyMaximumVT(((Accessory)accessory).MaxVTUp); - ModifyBonusAttack(((Accessory)accessory).ATKUp); - ModifyBonusDefense(((Accessory)accessory).DEFUp); - ModifyBonusLuck(((Accessory)accessory).LuckUp); - } - - private void CurrentHP_Sync(int newHealth) - { - if (newHealth <= 0) - Die(); - } - - private void CurrentEXP_Sync(double newExp) - { - if (Stats.CurrentExp.Value >= Stats.ExpToNextLevel.Value) - LevelUp(); + HealthComponent.Damage(1); } private void Hitbox_AreaEntered(Area3D area) @@ -548,17 +415,16 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide(_playerStatResource.CurrentHP), - maximumHP: new AutoProp(_playerStatResource.MaximumHP), - currentVT: new AutoProp(_playerStatResource.CurrentVT), - maximumVT: new AutoProp(_playerStatResource.MaximumVT), - currentAttack: new AutoProp(_playerStatResource.CurrentAttack), - currentDefense: new AutoProp(_playerStatResource.CurrentDefense), - maxAttack: new AutoProp(_playerStatResource.MaxAttack), - maxDefense: new AutoProp(_playerStatResource.MaxDefense), - bonusAttack: new AutoProp(_playerStatResource.BonusAttack), - bonusDefense: new AutoProp(_playerStatResource.BonusDefense), - currentExp: new AutoProp(_playerStatResource.CurrentExp), - expToNextLevel: new AutoProp(_playerStatResource.ExpToNextLevel), - currentLevel: new AutoProp(_playerStatResource.CurrentLevel), - luck: new AutoProp(_playerStatResource.Luck)); - - return playerStats; - } - private bool PlayerIsHittingGeometry() { var collisions = WallCheck.GetCollidingBodies(); @@ -640,7 +485,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide this.Notify(what); - - [Export] - public int InitialMaximumAttack { get; set; } - - public AutoProp MaximumAttack { get; private set; } - - public AutoProp CurrentAttack { get; private set; } - - public void OnReady() - { - MaximumAttack = new AutoProp(InitialMaximumAttack); - CurrentAttack = new AutoProp(InitialMaximumAttack); - } -} diff --git a/Zennysoft.Game.Ma/src/system/stats/BattleExtensions.cs b/Zennysoft.Game.Ma/src/system/stats/BattleExtensions.cs index d4af4ea9..1bb48481 100644 --- a/Zennysoft.Game.Ma/src/system/stats/BattleExtensions.cs +++ b/Zennysoft.Game.Ma/src/system/stats/BattleExtensions.cs @@ -4,12 +4,12 @@ namespace Zennysoft.Game.Ma; public static class BattleExtensions { - public static bool IsCriticalHit(double luckStat) + public static bool IsCriticalHit(int luckStat) { var rng = new RandomNumberGenerator(); rng.Randomize(); var roll = rng.Randf(); - var isCriticalHit = roll <= luckStat; + var isCriticalHit = roll <= (luckStat / 100); return isCriticalHit; } } diff --git a/Zennysoft.Game.Ma/src/system/stats/HealthComponent.cs b/Zennysoft.Game.Ma/src/system/stats/HealthComponent.cs deleted file mode 100644 index b955b1cc..00000000 --- a/Zennysoft.Game.Ma/src/system/stats/HealthComponent.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Chickensoft.AutoInject; -using Chickensoft.Collections; -using Chickensoft.Introspection; -using Godot; - -namespace Zennysoft.Game.Ma; - -[Meta(typeof(IAutoNode))] -public partial class HealthComponent : Node -{ - public override void _Notification(int what) => this.Notify(what); - - [Export] - public int InitialMaximumHP { get; set; } - - public AutoProp MaximumHP { get; private set; } - - public AutoProp CurrentHP { get; private set; } - - [Signal] - public delegate void HealthReachedZeroEventHandler(); - [Signal] - public delegate void HealthLoweredEventHandler(); - - public void OnReady() - { - MaximumHP = new AutoProp(InitialMaximumHP); - CurrentHP = new AutoProp(InitialMaximumHP); - CurrentHP.Changed += CurrentHP_Changed; - } - - private void CurrentHP_Changed(int obj) - { - if (obj <= 0) - EmitSignal(SignalName.HealthReachedZero); - else - EmitSignal(SignalName.HealthLowered); - } -} diff --git a/Zennysoft.Game.Ma/src/system/stats/HealthComponent.tscn b/Zennysoft.Game.Ma/src/system/stats/HealthComponent.tscn deleted file mode 100644 index b38f2861..00000000 --- a/Zennysoft.Game.Ma/src/system/stats/HealthComponent.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://bxymnqkoi78oa"] - -[ext_resource type="Script" uid="uid://bne4tlmh1i5e8" path="res://src/system/stats/HealthComponent.cs" id="1_177fp"] - -[node name="HealthComponent" type="Node"] -script = ExtResource("1_177fp") diff --git a/Zennysoft.Game.Ma/src/system/stats/ICharacterStats.cs b/Zennysoft.Game.Ma/src/system/stats/ICharacterStats.cs index ab5fdbd1..dee64b50 100644 --- a/Zennysoft.Game.Ma/src/system/stats/ICharacterStats.cs +++ b/Zennysoft.Game.Ma/src/system/stats/ICharacterStats.cs @@ -1,10 +1,11 @@ using Chickensoft.Collections; +using Zennysoft.Game.Implementation.Components; namespace Zennysoft.Game.Ma; public interface ICharacterStats { - public IAutoProp HP { get; } + public HealthComponent HP { get; } public IAutoProp CurrentAttack { get; } diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs index d4913cbc..81595ea7 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs @@ -5,7 +5,6 @@ using Godot; using System.Linq; using System.Threading.Tasks; using Zennysoft.Ma.Adapter; -using static Zennysoft.Game.Ma.AudioManager; namespace Zennysoft.Game.Ma; @@ -39,16 +38,9 @@ public partial class InventoryMenu : Control, IInventoryMenu private int _currentIndex = 0; - private IItemSlot[] ItemSlots => ItemsPage.GetChildren().OfType().ToArray(); + private IItemSlot[] ItemSlots => [.. ItemsPage.GetChildren().OfType()]; #region Control Nodes - [Node] public Label FloorLabel { get; set; } = default!; - [Node] public Label CurrentLevelLabel { get; set; } = default!; - [Node] public Label EXPValue { get; set; } = default!; - [Node] public Label HPValue { get; set; } = default!; - [Node] public Label HPBonusLabel { get; set; } = default!; - [Node] public Label VTValue { get; set; } = default!; - [Node] public Label VTBonusLabel { get; set; } = default!; [Node] public Label ATKValue { get; set; } = default!; [Node] public Label ATKBonusLabel { get; set; } = default!; [Node] public Label DEFValue { get; set; } = default!; @@ -77,9 +69,25 @@ public partial class InventoryMenu : Control, IInventoryMenu DropButton.Pressed += DropButtonPressed; } + public void OnExitTree() + { + Player.AttackComponent.CurrentAttack.Sync -= AttackSync; + Player.AttackComponent.MaximumAttack.Sync -= AttackSync; + Player.AttackComponent.BonusAttack.Sync -= BonusAttack_Sync; + Player.DefenseComponent.CurrentDefense.Sync -= DefenseSync; + Player.DefenseComponent.MaximumDefense.Sync -= DefenseSync; + Player.DefenseComponent.BonusDefense.Sync -= BonusDefense_Sync; + } + public void OnResolved() { SetProcessInput(false); + Player.AttackComponent.CurrentAttack.Sync += AttackSync; + Player.AttackComponent.MaximumAttack.Sync += AttackSync; + Player.AttackComponent.BonusAttack.Sync += BonusAttack_Sync; + Player.DefenseComponent.CurrentDefense.Sync += DefenseSync; + Player.DefenseComponent.MaximumDefense.Sync += DefenseSync; + Player.DefenseComponent.BonusDefense.Sync += BonusDefense_Sync; } public async Task DisplayMessage(string message) @@ -93,56 +101,17 @@ public partial class InventoryMenu : Control, IInventoryMenu SetProcessInput(true); } - private void BonusAttack_Sync(int bonus) - { - ATKBonusLabel.Text = $"{bonus:+0;-#;\\.\\.\\.}"; - DEFBonusLabel.Text = $"{Player.Stats.BonusDefense.Value:+0;-#;\\.\\.\\.}"; - } + private void AttackSync(int obj) => ATKValue.Text = $"{Player.AttackComponent.CurrentAttack.Value}/{Player.AttackComponent.MaximumAttack.Value}"; - private void BonusDefense_Sync(int bonus) - { - ATKBonusLabel.Text = $"{Player.Stats.BonusAttack.Value:+0;-#;\\.\\.\\.}"; - DEFBonusLabel.Text = $"{bonus:+0;-#;\\.\\.\\.}"; - } + private void BonusAttack_Sync(int bonus) => ATKBonusLabel.Text = $"{bonus:+0;-#;\\.\\.\\.}"; - private void CurrentLevel_Sync(int obj) => CurrentLevelLabel.Text = $"Level {obj:D2}"; + private void DefenseSync(int obj) => DEFValue.Text = $"{Player.DefenseComponent.CurrentDefense.Value}/{Player.DefenseComponent.MaximumDefense.Value}"; - private void ExpToNextLevel_Sync(int obj) => EXPValue.Text = $"{Player.Stats.CurrentExp.Value}/{obj}"; + private void BonusDefense_Sync(int bonus) => DEFBonusLabel.Text = $"{bonus:+0;-#;\\.\\.\\.}"; - 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 CurrentDefense_Sync(int obj) => DEFValue.Text = $"{obj}/{Player.Stats.MaxDefense.Value}"; - - private void MaxAttack_Sync(int obj) => ATKValue.Text = $"{Player.Stats.CurrentAttack.Value}/{obj}"; - - private void CurrentAttack_Sync(int obj) => ATKValue.Text = $"{obj}/{Player.Stats.MaxAttack.Value}"; - - private void MaximumVT_Sync(int obj) => VTValue.Text = $"{Player.Stats.CurrentVT.Value}/{obj}"; - - private void CurrentVT_Sync(int obj) => VTValue.Text = $"{obj}/{Player.Stats.MaximumVT.Value}"; - - private void MaximumHP_Sync(int obj) => HPValue.Text = $"{Player.Stats.CurrentHP.Value}/{obj}"; - - private void CurrentHP_Sync(int obj) => HPValue.Text = $"{obj}/{Player.Stats.MaximumHP.Value}"; public async Task RefreshInventoryScreen() { - Player.Stats.CurrentHP.Sync += CurrentHP_Sync; - Player.Stats.MaximumHP.Sync += MaximumHP_Sync; - Player.Stats.CurrentVT.Sync += CurrentVT_Sync; - Player.Stats.MaximumVT.Sync += MaximumVT_Sync; - Player.Stats.CurrentAttack.Sync += CurrentAttack_Sync; - Player.Stats.MaxAttack.Sync += MaxAttack_Sync; - Player.Stats.CurrentDefense.Sync += CurrentDefense_Sync; - Player.Stats.MaxDefense.Sync += MaxDefense_Sync; - Player.Stats.CurrentExp.Sync += CurrentExp_Sync; - Player.Stats.ExpToNextLevel.Sync += ExpToNextLevel_Sync; - Player.Stats.CurrentLevel.Sync += CurrentLevel_Sync; - Player.Stats.BonusAttack.Sync += BonusAttack_Sync; - Player.Stats.BonusDefense.Sync += BonusDefense_Sync; - await ClearItems(); PopulateInventory(); PopulatePlayerInfo(); @@ -165,19 +134,6 @@ public partial class InventoryMenu : Control, IInventoryMenu } else { - Player.Stats.CurrentHP.Sync -= CurrentHP_Sync; - Player.Stats.MaximumHP.Sync -= MaximumHP_Sync; - Player.Stats.CurrentVT.Sync -= CurrentVT_Sync; - Player.Stats.MaximumVT.Sync -= MaximumVT_Sync; - Player.Stats.CurrentAttack.Sync -= CurrentAttack_Sync; - Player.Stats.MaxAttack.Sync -= MaxAttack_Sync; - Player.Stats.CurrentDefense.Sync -= CurrentDefense_Sync; - Player.Stats.MaxDefense.Sync -= MaxDefense_Sync; - Player.Stats.CurrentExp.Sync -= CurrentExp_Sync; - Player.Stats.ExpToNextLevel.Sync -= ExpToNextLevel_Sync; - Player.Stats.CurrentLevel.Sync -= CurrentLevel_Sync; - Player.Stats.BonusAttack.Sync -= BonusAttack_Sync; - Player.Stats.BonusDefense.Sync -= BonusDefense_Sync; Autoload.AudioManager.Play(SoundEffect.Cancel); _gameRepo.CloseInventory(); } @@ -261,8 +217,6 @@ public partial class InventoryMenu : Control, IInventoryMenu private void PopulatePlayerInfo() { - FloorLabel.Text = $"Floor {_map.CurrentFloorNumber:D2}"; - if (ItemSlots.Length != 0) { var item = ItemSlots.ElementAt(_currentIndex).Item; diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn index 9a24501d..895c3c17 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=35 format=3 uid="uid://dlj8qdg1c5048"] +[gd_scene load_steps=29 format=3 uid="uid://dlj8qdg1c5048"] [ext_resource type="Script" uid="uid://cmtet15hi5oiy" path="res://src/ui/inventory_menu/InventoryMenu.cs" id="1_l64wl"] [ext_resource type="Shader" uid="uid://cnphwvmr05hp1" path="res://src/ui/inventory_menu/InventoryMenu.gdshader" id="2_0fvsh"] @@ -36,36 +36,6 @@ font = ExtResource("3_lm4o1") font_size = 80 font_color = Color(0.737255, 0.705882, 0.690196, 1) -[sub_resource type="LabelSettings" id="LabelSettings_q0afw"] -font = ExtResource("3_lm4o1") -font_size = 48 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - -[sub_resource type="LabelSettings" id="LabelSettings_yw3yo"] -font = ExtResource("3_lm4o1") -font_size = 64 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - -[sub_resource type="LabelSettings" id="LabelSettings_xxgnh"] -font = ExtResource("4_rg5yb") -font_size = 46 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - -[sub_resource type="LabelSettings" id="LabelSettings_biilt"] -font = ExtResource("5_2qnnx") -font_size = 40 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - -[sub_resource type="LabelSettings" id="LabelSettings_dot3k"] -font = ExtResource("4_rg5yb") -font_size = 46 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - -[sub_resource type="LabelSettings" id="LabelSettings_th0sm"] -font = ExtResource("4_rg5yb") -font_size = 40 -font_color = Color(0.737255, 0.705882, 0.690196, 1) - [sub_resource type="LabelSettings" id="LabelSettings_ankkq"] font = ExtResource("4_rg5yb") font_size = 46 @@ -247,97 +217,6 @@ layout_mode = 2 layout_mode = 2 theme_override_constants/separation = 20 -[node name="FloorBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false -layout_mode = 2 - -[node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/FloorBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="FloorLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/FloorBox"] -unique_name_in_owner = true -layout_mode = 2 -text = "FLOOR 00" -label_settings = SubResource("LabelSettings_q0afw") - -[node name="LevelBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false -layout_mode = 2 - -[node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/LevelBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="CurrentLevelLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/LevelBox"] -unique_name_in_owner = true -layout_mode = 2 -text = "LEVEL 0" -label_settings = SubResource("LabelSettings_yw3yo") - -[node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -custom_minimum_size = Vector2(0, 12) -layout_mode = 2 - -[node name="EXPBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false -layout_mode = 2 - -[node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/EXPBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="EXPLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/EXPBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 -text = "EXP" -label_settings = SubResource("LabelSettings_xxgnh") - -[node name="ReferenceRect" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/EXPBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="EXPValue" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/EXPBox"] -unique_name_in_owner = true -layout_mode = 2 -text = "444/888" -label_settings = SubResource("LabelSettings_biilt") - -[node name="HPBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false -layout_mode = 2 - -[node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="HPLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -text = "HP" -label_settings = SubResource("LabelSettings_dot3k") - -[node name="ReferenceRect" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -custom_minimum_size = Vector2(50, 0) -layout_mode = 2 - -[node name="HPValue" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -unique_name_in_owner = true -custom_minimum_size = Vector2(200, 0) -layout_mode = 2 -text = "222/222" -label_settings = SubResource("LabelSettings_th0sm") - -[node name="ReferenceRect3" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -custom_minimum_size = Vector2(18, 0) -layout_mode = 2 - -[node name="HPBonusLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/HPBox"] -unique_name_in_owner = true -layout_mode = 2 -text = "..." -label_settings = ExtResource("6_tmdno") - [node name="VTBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] visible = false layout_mode = 2 @@ -374,7 +253,6 @@ text = "..." label_settings = ExtResource("6_tmdno") [node name="ATKBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false layout_mode = 2 [node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/ATKBox"] @@ -409,7 +287,6 @@ text = "..." label_settings = ExtResource("6_tmdno") [node name="DEFBox" type="HBoxContainer" parent="InventoryInfo/HBoxContainer/PlayerInfo"] -visible = false layout_mode = 2 [node name="ReferenceRect2" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/DEFBox"] @@ -419,8 +296,7 @@ layout_mode = 2 [node name="DEFLabel" type="Label" parent="InventoryInfo/HBoxContainer/PlayerInfo/DEFBox"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 -text = "DEF -" +text = "DEF" label_settings = SubResource("LabelSettings_ankkq") [node name="ReferenceRect" type="ReferenceRect" parent="InventoryInfo/HBoxContainer/PlayerInfo/DEFBox"] diff --git a/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs b/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs index 80f9943f..1d852838 100644 --- a/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs +++ b/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs @@ -37,15 +37,15 @@ public partial class PlayerInfoUI : Control, IPlayerInfoUI public void Activate() { - Player.Stats.CurrentHP.Sync += CurrentHP_Sync; - Player.Stats.MaximumHP.Sync += MaximumHP_Sync; + Player.HealthComponent.CurrentHP.Sync += HPSync; + Player.HealthComponent.MaximumHP.Sync += HPSync; - Player.Stats.CurrentVT.Sync += CurrentVT_Sync; - Player.Stats.MaximumVT.Sync += MaximumVT_Sync; + Player.VTComponent.CurrentVT.Sync += VTSync; + Player.VTComponent.MaximumVT.Sync += VTSync; - Player.Stats.CurrentLevel.Sync += CurrentLevel_Sync; - Player.Stats.CurrentExp.Sync += CurrentExp_Sync; - Player.Stats.ExpToNextLevel.Sync += ExpToNextLevel_Sync; + Player.ExperiencePointsComponent.Level.Sync += CurrentLevel_Sync; + Player.ExperiencePointsComponent.CurrentExp.Sync += ExpSync; + Player.ExperiencePointsComponent.ExpToNextLevel.Sync += ExpSync; } private void CurrentLevel_Sync(int obj) @@ -53,36 +53,22 @@ public partial class PlayerInfoUI : Control, IPlayerInfoUI LevelNumber.Text = $"{obj}"; } - private void MaximumVT_Sync(int obj) + private void VTSync(int obj) { - VTNumber.Text = $"{Player.Stats.CurrentVT.Value}/{obj}"; - VTProgressBar.MaxValue = obj; + VTNumber.Text = $"{Player.VTComponent.CurrentVT.Value}/{Player.VTComponent.MaximumVT.Value}"; + VTProgressBar.Value = Player.VTComponent.CurrentVT.Value; + VTProgressBar.MaxValue = Player.VTComponent.MaximumVT.Value; } - private void CurrentVT_Sync(int obj) + private void HPSync(int obj) { - VTNumber.Text = $"{obj}/{Player.Stats.MaximumVT.Value}"; - VTProgressBar.Value = obj; + HPNumber.Text = $"{Player.HealthComponent.CurrentHP.Value}/{Player.HealthComponent.MaximumHP.Value}"; + HPProgressBar.Value = Player.HealthComponent.CurrentHP.Value; + HPProgressBar.MaxValue = Player.HealthComponent.MaximumHP.Value; } - private void MaximumHP_Sync(int obj) + private void ExpSync(int obj) { - HPNumber.Text = $"{Player.Stats.CurrentHP.Value}/{obj}"; - HPProgressBar.MaxValue = obj; - } - - private void CurrentHP_Sync(int obj) - { - HPNumber.Text = $"{obj}/{Player.Stats.MaximumHP.Value}"; - HPProgressBar.Value = obj; - } - - private void CurrentExp_Sync(double obj) - { - EXPNumber.Text = $"{(int)obj}/{Player.Stats.ExpToNextLevel.Value}"; - } - private void ExpToNextLevel_Sync(int obj) - { - EXPNumber.Text = $"{Player.Stats.CurrentExp.Value}/{obj}"; + EXPNumber.Text = $"{Player.ExperiencePointsComponent.CurrentExp.Value}/{Player.ExperiencePointsComponent.ExpToNextLevel.Value}"; } }