[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%,
공격시 상대 병종에/수비시 자신 병종 숙련에 보병 숙련을 가산'; protected $cost = 100; protected $buyable = true; protected $consumable = false; protected $reqSecu = 3000; public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ if(in_array($turnType, ['징병', '모병'])){ if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_FOOTMAN) return $value * 0.9; } return $value; } public function getWarPowerMultiplier(WarUnit $unit):array{ if($unit->isAttacker()){ return [1, 0.9]; } return [1, 0.8]; } public function onCalcStat(General $general, string $statName, $value, $aux=null){ if(str_starts_with($statName, 'dex')){ $myArmType = 'dex'.GameUnitConst::T_FOOTMAN; $opposeArmType = 'dex'.$aux['opposeType']->armType;; if($aux['isAttacker'] && $opposeArmType === $statName){ return $value + $general->getVar($myArmType); } if(!$aux['isAttacker'] && $myArmType === $statName){ return $value + $general->getVar($myArmType); } } return $value; } }