Implement passive relics and six-family defense towers
This commit is contained in:
@@ -99,6 +99,8 @@ namespace BumpCombat.Enemies
|
||||
private Vector2 knockbackVelocity;
|
||||
private float stateTimer;
|
||||
private float stunTimer;
|
||||
private float slowRemaining;
|
||||
private float slowFraction;
|
||||
private float igniteRemaining;
|
||||
private float igniteNextTickIn;
|
||||
private float igniteTickInterval;
|
||||
@@ -224,10 +226,14 @@ namespace BumpCombat.Enemies
|
||||
? groggyTier
|
||||
: null;
|
||||
public bool IsStunned => stunTimer > 0f;
|
||||
public float MovementSpeedMultiplier => slowRemaining > 0f ? 1f - slowFraction : 1f;
|
||||
public bool IsIgnited => igniteRemaining > 0f;
|
||||
public bool IsShocked => shockRemaining > 0f;
|
||||
public bool IsBumpVulnerable => vulnerabilityRemaining > 0f;
|
||||
public float IgniteRemaining => igniteRemaining;
|
||||
public float IgniteRemainingAtDeath { get; private set; }
|
||||
public float IgniteTickIntervalAtDeath { get; private set; }
|
||||
public float IgniteTickDamageAtDeath { get; private set; }
|
||||
public float ShockRemaining => shockRemaining;
|
||||
public float BumpVulnerabilityRemaining => vulnerabilityRemaining;
|
||||
public float ShockIncrease => shockIncrease;
|
||||
@@ -265,7 +271,7 @@ namespace BumpCombat.Enemies
|
||||
public EnemyAttackShape AttackShape => definition != null
|
||||
? CurrentAttackPattern.AttackShape
|
||||
: EnemyAttackShape.Box;
|
||||
public float MoveSpeed => EnsureEnemyModel().MoveSpeed;
|
||||
public float MoveSpeed => EnsureEnemyModel().MoveSpeed * MovementSpeedMultiplier;
|
||||
public float AttackDamage => EnsureEnemyModel().CalculatePatternDamage(
|
||||
CurrentAttackPattern.DamageMultiplier,
|
||||
IsEventEnemy);
|
||||
@@ -659,6 +665,15 @@ namespace BumpCombat.Enemies
|
||||
return;
|
||||
}
|
||||
|
||||
if (slowRemaining > 0f)
|
||||
{
|
||||
slowRemaining = Mathf.Max(0f, slowRemaining - Time.fixedDeltaTime);
|
||||
if (slowRemaining <= 0f)
|
||||
{
|
||||
slowFraction = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (stunTimer > 0f)
|
||||
{
|
||||
stunTimer = Mathf.Max(
|
||||
@@ -1622,6 +1637,22 @@ namespace BumpCombat.Enemies
|
||||
EnterState(EnemyState.Recovery, 0f);
|
||||
}
|
||||
|
||||
public bool ApplySlow(float duration, float fraction)
|
||||
{
|
||||
if (IsDead
|
||||
|| IsDamageInvulnerable
|
||||
|| isGroggy
|
||||
|| duration <= 0f
|
||||
|| fraction <= 0f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
slowRemaining = Mathf.Max(slowRemaining, duration);
|
||||
slowFraction = Mathf.Max(slowFraction, Mathf.Clamp01(fraction));
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ApplyStun(float duration)
|
||||
{
|
||||
if (IsDead || duration <= 0f)
|
||||
@@ -2884,6 +2915,9 @@ namespace BumpCombat.Enemies
|
||||
|
||||
private void Die()
|
||||
{
|
||||
IgniteRemainingAtDeath = igniteRemaining;
|
||||
IgniteTickIntervalAtDeath = igniteTickInterval;
|
||||
IgniteTickDamageAtDeath = igniteTickDamage;
|
||||
ClearTimedEffects();
|
||||
EnterState(EnemyState.Dead, 0f);
|
||||
ReleaseAttackToken();
|
||||
|
||||
Reference in New Issue
Block a user