public Construction(string nam, double efficiency, Unit unit) { ConstructionName = nam; //Constructionype = typ; ConstructionEfficiency = efficiency; Unit = unit; ConstructionDisabled = true; ConstructionProgress = 0; }
public Construction(string nam, int typ, double amoun, Unit unit, int owner) { ConstructionName = nam; //Constructionype = typ; ConstructionEfficiency = amoun; Unit = unit; //this.owner = owner; OWNER PUUTTUU EFSTÄ //disabled = true; DISABLED PUUTTUU DATABASESTA //progress = 0; PROGRESS PUUTTUU DATABASESTA! }
public void AddUnit(Unit u) { Unit.Add(u); int front = 0; int back = 0; foreach (Unit un in Unit) { if (un.UnitPosition == 1) front++; else if (un.UnitPosition == 2) back++; } if ((back / (1.2 * front)) >= 1.0) ArmyBacklineProtected = true; else ArmyBacklineProtected = false; }
public void Rattack(Unit target) { target.loseHP((int)((this.UnitOffense * (100 / (100 + target.UnitRangedDefense))) * (this.UnitHealth / 100.0))); }
public void attack(Unit target) { int? tHP = target.UnitHealth; target.loseHP((int)((this.UnitOffense * (100 / (100 + target.UnitDefense))) * (this.UnitHealth / 100.0))); this.loseHP((int)((target.UnitOffense * (100 / (100 + this.UnitDefense))) * (tHP / 100.0))); }