예제 #1
0
 public Construction(string nam, double efficiency, Unit unit)
 {
     ConstructionName = nam;
     //Constructionype = typ;
     ConstructionEfficiency = efficiency;
     Unit = unit;
     ConstructionDisabled = true;
     ConstructionProgress = 0;
 }
예제 #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!
 }
예제 #3
0
파일: Army.cs 프로젝트: Bulltrick/DBGame
 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;
 }
예제 #4
0
파일: Unit.cs 프로젝트: Bulltrick/DBGame
 public void Rattack(Unit target)
 {
     target.loseHP((int)((this.UnitOffense * (100 / (100 + target.UnitRangedDefense))) * (this.UnitHealth / 100.0)));
 }
예제 #5
0
파일: Unit.cs 프로젝트: Bulltrick/DBGame
 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)));
 }