전투 엔진 중간 반영

This commit is contained in:
2018-08-18 19:04:13 +09:00
parent 0cca2d5bda
commit 4bc78dba1e
5 changed files with 170 additions and 80 deletions
+7 -3
View File
@@ -7,8 +7,6 @@ class WarUnitCity extends WarUnit{
protected $logger;
protected $crewType;
protected $killed = 0;
protected $death = 0;
protected $rice = 0;
protected $updatedVar = [];
@@ -20,6 +18,7 @@ class WarUnitCity extends WarUnit{
function __construct($raw, $rawNation, $year, $month){
$this->raw = $raw;
$this->rawNation = $rawNation;
$this->isAttacker = false;
$this->logger = new ActionLogger(0, $raw['nation'], $year, $month);
@@ -27,7 +26,7 @@ class WarUnitCity extends WarUnit{
$this->def = $raw['def'] * 10;
$this->wall = $raw['wall'] * 10;
$this->rice = $rawNation['rice'];
$this->rice = $this->rawNation['rice'];
$this->crewType = GameUnitConst::byID(GameUnitConst::T_CASTLE);
}
@@ -40,6 +39,11 @@ class WarUnitCity extends WarUnit{
return $this->raw['name'];
}
function tryAttackInPhase():int{
$warPower = $this->getWarPower();
$warPower *= Util::randRange(0.9, 1.1);
}
function continueWar(&$noRice):bool{
//전투가 가능하면 true
$noRice = false;