game,feat: 새 도구 아이템 추가, 아이템 효과에 필요한 기능 추가 #206

Merged
Hide_D merged 25 commits from items_add into devel 2022-02-22 00:50:13 +09:00
3 changed files with 4 additions and 6 deletions
Showing only changes of commit d8f4056f46 - Show all commits
+1 -1
View File
@@ -25,7 +25,7 @@ class che_불굴_상편 extends \sammo\BaseItem
$crewRatio = Util::valueFit($crew / ($leadership * 100), 0, 1);
return new WarUnitTriggerCaller(
new 전투력보정(1 + 0.5 * (1 - $crewRatio))
new 전투력보정($unit, 1 + 0.5 * (1 - $crewRatio))
);
}
}
@@ -17,15 +17,12 @@ class che_상성보정_과실주 extends \sammo\BaseItem{
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)
new 전투력보정($unit, 1.1, 0.9)
);
}
}
+2 -1
View File
@@ -10,7 +10,8 @@ use sammo\ObjectTrigger;
class 전투력보정 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
public function __construct(protected int|float $attackerWarPowerMultiplier, protected int|float $defenderWarPowerMultiplier = 1){
public function __construct(WarUnit $unit, protected int|float $attackerWarPowerMultiplier, protected int|float $defenderWarPowerMultiplier = 1){
$this->object = $unit;
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{