전투 시뮬레이션 구현 (동작)

This commit is contained in:
2018-08-27 01:23:45 +09:00
parent 60ef249b5e
commit 81d12ce928
5 changed files with 124 additions and 18 deletions
+23 -2
View File
@@ -28,11 +28,32 @@ class WarUnit{
protected $warPowerMultiply = 1.0;
protected $activatedSkill = [];
protected $logActivatedSkill = [];
protected $isFinished = false;
private function __construct(){
}
protected function clearActivatedSkill(){
foreach($this->activatedSkill as $skillName=>$state){
if(!$state){
continue;
}
if(!key_exists($skillName, $this->logActivatedSkill)){
$this->logActivatedSkill[$skillName] = 1;
}
else{
$this->logActivatedSkill[$skillName] += 1;
}
}
$this->activatedSkill = [];
}
function getActivatedSkillLog():array{
return $this->logActivatedSkill;
}
function getRaw():array{
return $this->raw;
}
@@ -183,7 +204,7 @@ class WarUnit{
$this->oppose = $oppose;
$this->killedCurr = 0;
$this->deadCurr = 0;
$this->activatedSkill = [];
$this->clearActivatedSkill();
}
function getOppose():?WarUnit{
@@ -312,7 +333,7 @@ class WarUnit{
}
function beginPhase():void{
$this->activatedSkill = [];
$this->clearActivatedSkill();
$this->computeWarPower();
}