public override void Apply(TowerProperties p, ShotProperties s) { PawnProperties props = p as PawnProperties; Debug.Log("Tower Properties: " + p.GetType() + " " + (props == null) + " " + this.name + " ShotProperties: " + s.GetType()); effect(p as PawnProperties, s); }
protected override bool Attack() { PawnProperties p = (PawnProperties)TowerProperties; Retarget(TowerProperties.Range); if (!TargetSet) { return(false); } CurrentCooldown = TowerProperties.Cooldown; // Magic to make the gaining of attack speed to work. CurrentCooldown = p.IncreasingSpeedPerShot ? CurrentCooldown * (1f - p.AttackSpeedBonusMax * (0.01f * p.AttackSpeedBonusPercentOfMax)) : CurrentCooldown; float randomNumber = UnityEngine.Random.Range(0, 1f); float doubleShotChance = p.DoubleShotChance; if (randomNumber < doubleShotChance) { DoubleShoot(); } else { Shoot(); } return(true); }
private void increaseAttackSpeedWithShot() { PawnProperties p = (PawnProperties)TowerProperties; if (p.IncreasingSpeedPerShot && p.AttackSpeedBonusPercentOfMax < 100) { p.AttackSpeedBonusPercentOfMax += 2; } }
public void RoundReset() { PawnProperties p = (PawnProperties)TowerProperties; p.AttackSpeedBonusPercentOfMax = 0; }