NPC 행동 코드 재 구현중

This commit is contained in:
2018-10-06 04:08:53 +09:00
parent 7cfc8f0269
commit 3f65424d99
5 changed files with 505 additions and 39 deletions
+8
View File
@@ -159,6 +159,14 @@ class GameUnitDetail{
return min(50, $ratio) / 100;
}
public function pickScore($tech){
$defaultWar = GameConst::$armperphase + $this->attack + $this->defence + getTechAbil($tech) * 2;
$defaultWar *= 1 + $this->speed / 2;
$defaultWar /= Util::valueFit(1 - $this->avoid / 100, 0.1);
$defaultWar *= 1 + $this->magicCoef / 2;
return sqrt($defaultWar);
}
public function isValid($ownCities, $ownRegions, $relativeYear, $tech){
//음수 없음
$relativeYear = max(0, $relativeYear);