From a2340cbd2515fc72e7612a4d4307df9ac99737ac Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Thu, 15 Aug 2019 00:41:43 +0300 Subject: [PATCH] Improve crab attack telegraphing Also, make the Armadillo explosions smaller and therefore closer to the visual explosion, but this should've been in the last commit already. --- Assets/Prefabs/Enemies/Enemy (Armadillo).prefab | 6 ++++-- Assets/Scripts/AI/Behaviours/MeleeAttackFollowed.cs | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Prefabs/Enemies/Enemy (Armadillo).prefab b/Assets/Prefabs/Enemies/Enemy (Armadillo).prefab index b80d1fa..a7b70d0 100644 --- a/Assets/Prefabs/Enemies/Enemy (Armadillo).prefab +++ b/Assets/Prefabs/Enemies/Enemy (Armadillo).prefab @@ -159,7 +159,9 @@ MonoBehaviour: - {fileID: 3847767376140256459, guid: ef8e91f8ee034b54187172730881ede2, type: 3} - {fileID: 3847767376140256459, guid: 18cee0d8962f9124cbe00dcb3e6a009b, type: 3} DebugExplode: 0 - KillOnZeroHealth: 1 + ParticlesPerBodypart: 70 + BodypartCountMultiplier: 1 + DebrisType: 0 --- !u!114 &3362493323285318061 MonoBehaviour: m_ObjectHideFlags: 0 @@ -220,7 +222,7 @@ MonoBehaviour: CurrentStatus: StartExplodingRadius: 3.5 ExplodeOnImpactRadius: 1.5 - ExplosionRadius: 2.5 + ExplosionRadius: 1.5 FuseDuration: 1.5 MinDamage: 7 MaxDamage: 13 diff --git a/Assets/Scripts/AI/Behaviours/MeleeAttackFollowed.cs b/Assets/Scripts/AI/Behaviours/MeleeAttackFollowed.cs index e3e7ca4..3b22910 100644 --- a/Assets/Scripts/AI/Behaviours/MeleeAttackFollowed.cs +++ b/Assets/Scripts/AI/Behaviours/MeleeAttackFollowed.cs @@ -45,19 +45,17 @@ namespace Saltosion.OneWeapon.AI.Behaviours { CurrentStatus = "Cooldown"; CooldownProgress -= Time.deltaTime / CooldownLength; } + Attacking = CooldownProgress < 0.4f && Follow.Target != null && + (Follow.Target.position - Enemy.transform.position).magnitude <= MeleeRange * 2f; } public override bool CanBehave() { bool CanBehave = Follow.Target != null && (Follow.Target.position - Enemy.transform.position).magnitude <= MeleeRange; - if (!CanBehave) { - Attacking = false; - } return CanBehave; } public override void Execute() { if (CooldownProgress > 0) { - Attacking = false; return; } else { Attacking = true;