37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
namespace sammo\ActionSpecialWar;
|
|
use \sammo\iAction;
|
|
use \sammo\General;
|
|
use \sammo\SpecialityConst;
|
|
use \sammo\GameUnitConst;
|
|
use \sammo\WarUnit;
|
|
|
|
class che_기병 implements iAction{
|
|
use \sammo\DefaultAction;
|
|
|
|
protected $id = 52;
|
|
protected $name = '기병';
|
|
protected $info = '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%';
|
|
|
|
static $selectWeightType = SpecialityConst::WEIGHT_NORM;
|
|
static $selectWeight = 1;
|
|
static $type = [
|
|
SpecialityConst::STAT_LEADERSHIP | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_CAVALRY,
|
|
SpecialityConst::STAT_STRENGTH | SpecialityConst::REQ_DEXTERITY | SpecialityConst::ARMY_CAVALRY
|
|
];
|
|
|
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
|
if(in_array($turnType, ['징병', '모병'])){
|
|
if($varType == 'cost' && $aux['armType'] == GameUnitConst::T_CAVALRY) return $value * 0.9;
|
|
}
|
|
|
|
return $value;
|
|
}
|
|
|
|
public function getWarPowerMultiplier(WarUnit $unit):array{
|
|
if($unit->isAttacker()){
|
|
return [1.2, 1];
|
|
}
|
|
return [1.1, 1];
|
|
}
|
|
} |