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

- 직접 전투력보정을 위한 WarUnitTrigger 추가
This commit is contained in:
2022-02-20 03:08:24 +09:00
parent 95921ae727
commit 919c44c727
4 changed files with 89 additions and 1 deletions
@@ -0,0 +1,24 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\ObjectTrigger;
class 전투력보정 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
public function __construct(protected int|float $attackerWarPowerMultiplier, protected int|float $defenderWarPowerMultiplier = 1){
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
$self->multiplyWarPowerMultiply($this->attackerWarPowerMultiplier);
$oppose->multiplyWarPowerMultiply($this->defenderWarPowerMultiplier);
$this->processConsumableItem();
return true;
}
}