void TraitorAction() { print(name + " has become a TRAITOR!!!"); townTile.TakeDamage(townTile.tileHitPoints); Debug.Log("Destroying " + townTile.name); KillSurvivor(); }
void CalcDamage(int ar, float dmg, TownTile_Properties tile) { int defense = tile.defenseRating; int dmgRoll = (Random.Range(0, ar) + 1) - defense; Debug.Log("HORDE rolls: " + dmgRoll); tile.beingAttacked = true; if (dmgRoll > 0) { float damage = (float)dmgRoll; tile.TakeDamage(damage); } else { print("Miss!"); } canHit = true; }