Ejemplo n.º 1
0
 public Construction(string nam, double efficiency, Unit unit)
 {
     ConstructionName = nam;
     //Constructionype = typ;
     ConstructionEfficiency = efficiency;
     Unit = unit;
     ConstructionDisabled = true;
     ConstructionProgress = 0;
 }
Ejemplo n.º 2
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!
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public void Rattack(Unit target)
 {
     target.loseHP((int)((this.UnitOffense * (100 / (100 + target.UnitRangedDefense))) * (this.UnitHealth / 100.0)));
 }
Ejemplo n.º 5
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)));
 }