game,feat: 전투력보정 관련 유니크 도구 추가

- 직접 전투력보정을 위한 WarUnitTrigger 추가
This commit is contained in:
2022-02-20 03:08:24 +09:00
parent 4e97c6f7a2
commit 90b51d5a21
4 changed files with 89 additions and 1 deletions
@@ -0,0 +1,31 @@
<?php
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\전투력보정;
use sammo\WarUnitTriggerCaller;
class che_상성보정_과실주 extends \sammo\BaseItem{
protected $rawName = '과실주';
protected $name = '과실주(상성)';
protected $info = '[전투] 유리한 병종 전투시 공격력 +10%, 피해 -10%';
protected $cost = 200;
protected $consumable = false;
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
$oppose = $unit->getOppose();
if($oppose === null){
return null;
}
$attackCoef = $unit->getCrewType()->getAttackCoef($oppose->getCrewType());
if($attackCoef <= 1){
return null;
}
return new WarUnitTriggerCaller(
new 전투력보정(1.1, 0.9)
);
}
}