forked from devsam/core
전투 구현 반영
This commit is contained in:
@@ -273,19 +273,16 @@ class WarUnit{
|
||||
}
|
||||
|
||||
function addWin(){
|
||||
throw new NotInheritedMethodException();
|
||||
}
|
||||
|
||||
function addLose(){
|
||||
throw new NotInheritedMethodException();
|
||||
}
|
||||
|
||||
function finishBattle(){
|
||||
throw new NotInheritedMethodException();
|
||||
}
|
||||
|
||||
function getCharacter(){
|
||||
//TODO: 나머지에 구현
|
||||
function getCharacter():int{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -356,7 +353,9 @@ class WarUnit{
|
||||
}
|
||||
|
||||
function calcDamage():int{
|
||||
return $this->getWarPower();
|
||||
$warPower = $this->getWarPower();
|
||||
$warPower *= Util::randRange(0.9, 1.1);
|
||||
return Util::round($warPower);
|
||||
}
|
||||
|
||||
function tryWound():bool{
|
||||
|
||||
@@ -41,12 +41,6 @@ class WarUnitCity extends WarUnit{
|
||||
return $this->raw[$key];
|
||||
}
|
||||
|
||||
function calcDamage():int{
|
||||
$warPower = $this->getWarPower();
|
||||
$warPower *= Util::randRange(0.9, 1.1);
|
||||
return Util::round($warPower);
|
||||
}
|
||||
|
||||
function increaseKilled(int $damage):int{
|
||||
$this->killed += $damage;
|
||||
return $this->killed;
|
||||
@@ -84,13 +78,6 @@ class WarUnitCity extends WarUnit{
|
||||
return true;
|
||||
}
|
||||
|
||||
function addWin(){
|
||||
}
|
||||
|
||||
function addLose(){
|
||||
//NOTE: 도시 정복은 외부에서 처리함
|
||||
}
|
||||
|
||||
function heavyDecreseWealth(){
|
||||
$this->multiplyVar('agri', 0.5);
|
||||
$this->multiplyVar('comm', 0.5);
|
||||
|
||||
@@ -74,6 +74,10 @@ class WarUnitGeneral extends WarUnit{
|
||||
return $this->getVar('special2');
|
||||
}
|
||||
|
||||
function getCharacter():int{
|
||||
return $this->getVar('personal');
|
||||
}
|
||||
|
||||
function getItem():int{
|
||||
return $this->getVar('item');
|
||||
}
|
||||
@@ -102,10 +106,10 @@ class WarUnitGeneral extends WarUnit{
|
||||
}
|
||||
|
||||
function getComputedAtmos(){
|
||||
$train = $this->getVar('atmos');
|
||||
$train += $this->trainBonus;
|
||||
$atmos = $this->getVar('atmos');
|
||||
$atmos += $this->atmosBonus;
|
||||
|
||||
return $train;
|
||||
return $atmos;
|
||||
}
|
||||
|
||||
function getComputedCriticalRatio():float{
|
||||
@@ -491,6 +495,17 @@ class WarUnitGeneral extends WarUnit{
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
$specialWar == 63 &&
|
||||
$this->getPhase() == 0 &&
|
||||
$this->getHP() >= 1000 &&
|
||||
$this->getComputedAtmos() >= 90 &&
|
||||
$this->getComputedTrain() >= 90
|
||||
){
|
||||
$this->activateSkill('위압');
|
||||
$activated = true;
|
||||
}
|
||||
|
||||
return $activated;
|
||||
}
|
||||
|
||||
@@ -618,17 +633,6 @@ class WarUnitGeneral extends WarUnit{
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
$specialWar == 63 &&
|
||||
$this->getPhase() == 0 &&
|
||||
$this->getHP() >= 1000 &&
|
||||
$this->getComputedAtmos() >= 90 &&
|
||||
$this->getComputedTrain() >= 90
|
||||
){
|
||||
$this->activateSkill('위압');
|
||||
$activated = true;
|
||||
}
|
||||
|
||||
if(
|
||||
($item == 23 || $item == 24) &&
|
||||
!$this->hasActivatedSkill('치료') &&
|
||||
|
||||
Reference in New Issue
Block a user