diff --git a/hwe/sammo/Event/Action/OpenNationBetting.php b/hwe/sammo/Event/Action/OpenNationBetting.php index d551c41d..feea37d2 100644 --- a/hwe/sammo/Event/Action/OpenNationBetting.php +++ b/hwe/sammo/Event/Action/OpenNationBetting.php @@ -11,11 +11,14 @@ use sammo\KVStorage; class OpenNationBetting extends \sammo\Event\Action { - public function __construct(private int $nationCnt = 1) + public function __construct(private int $nationCnt = 1, private int $bonusPoint = 0) { if ($nationCnt < 1) { throw new \RuntimeException("1 미만의 숫자"); } + if ($bonusPoint < 0){ + throw new \RuntimeException("0 미만의 보너스 포인트"); + } } public function run(array $env) @@ -51,8 +54,6 @@ class OpenNationBetting extends \sammo\Event\Action ); $nationBettingStor->setValue("id_{$bettingID}", $bettingInfo->toArray()); - //TODO: 초기에 부여할 포인트는 어디서 나는가? - $db->insert('event', [ 'target' => 'DESTROY_NATION', 'priority' => 1000, @@ -64,6 +65,16 @@ class OpenNationBetting extends \sammo\Event\Action ["DeleteEvent"], ]), ]); + + if($this->bonusPoint > 0){ + $db->insert('ng_betting', [ + 'betting_id' => $bettingID, + 'general_id' => 0, + 'betting_type' => '0', + 'amount' => $this->bonusPoint + ]); + } + $logger = new \sammo\ActionLogger(0, 0, $year, $month); $logger->pushGlobalHistoryLog("【내기】천하통일을 염원하는 내기가 진행중입니다! 호사가의 참여를 기다립니다!"); $logger->flush(); diff --git a/hwe/scenario/scenario_904.json b/hwe/scenario/scenario_904.json index c6ad8f3e..05452c20 100644 --- a/hwe/scenario/scenario_904.json +++ b/hwe/scenario/scenario_904.json @@ -148,8 +148,8 @@ [ "month", 1000, ["Date", "==", 181, 1], - ["OpenNationBetting", 4], - ["OpenNationBetting", 1], + ["OpenNationBetting", 4, 1000], + ["OpenNationBetting", 1, 1000], ["DeleteEvent"] ], [ @@ -158,8 +158,8 @@ ["Date", ">=", 183, 1], ["RemainNation", "<=", 16] ], - ["OpenNationBetting", 4], - ["OpenNationBetting", 1], + ["OpenNationBetting", 4, 1000], + ["OpenNationBetting", 1, 1000], ["DeleteEvent"] ], [ @@ -168,7 +168,7 @@ ["Date", ">=", 183, 1], ["RemainNation", "<=", 8] ], - ["OpenNationBetting", 1], + ["OpenNationBetting", 1, 1000], ["DeleteEvent"] ], [ @@ -177,7 +177,7 @@ ["Date", ">=", 183, 1], ["RemainNation", "<=", 4] ], - ["OpenNationBetting", 1], + ["OpenNationBetting", 1, 1000], ["DeleteEvent"] ] ]