ActionTrigger 초안 추가
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
trait DefaultActionTrigger{
|
||||
public function onPreTurnExecute(General $general, ?array $nation):array{
|
||||
return [];
|
||||
}
|
||||
public function onCalcDomesticTurnScore(General $general, string $turnType, float $score, float $cost, float $successRate, float $failRate){
|
||||
return [$score, $cost, $successRate, $failRate];
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onCalcStragicDelay(array $nation, int $commandType, int $turn):int{
|
||||
return $turn;
|
||||
}
|
||||
|
||||
public function onCalcNationalIncome(array $nation, string $type, int $amount):int{
|
||||
return $amount;
|
||||
}
|
||||
|
||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||
return [1, 1];
|
||||
}
|
||||
public function getBattleInitSkillTriggerList(WarUnit $unit):array{
|
||||
return [];
|
||||
}
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):array{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
interface iActionTrigger{
|
||||
|
||||
const PRIORITY_BEGIN = 50000;
|
||||
const PRIORITY_PRE = 40000;
|
||||
const PRIORITY_BODY = 30000;
|
||||
const PRIORITY_POST = 20000;
|
||||
const PRIORITY_FINAL = 10000;
|
||||
|
||||
public function onPreTurnExecute(General $general, ?array $nation):array;
|
||||
public function onCalcDomesticTurnScore(General $general, string $turnType, float $score, float $cost, float $successRate, float $failRate):array;
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value);
|
||||
|
||||
public function onCalcStragicDelay(array $nation, int $commandType, int $turn):int;
|
||||
public function onCalcNationalIncome(array $nation, string $type, int $amount):int;
|
||||
|
||||
public function getWarPowerMultiplier(WarUnit $unit):array;
|
||||
public function getBattleInitSkillTriggerList(WarUnit $unit):array;
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):array;
|
||||
}
|
||||
Reference in New Issue
Block a user