feat(WIP): OpenNationBetting에 보너스 상금 추가

This commit is contained in:
2022-02-05 07:43:27 +00:00
committed by Gitea
parent 2da12bb71f
commit 270f236f95
2 changed files with 20 additions and 9 deletions
+14 -3
View File
@@ -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("<B><b>【내기】</b></>천하통일을 염원하는 <C>내기</>가 진행중입니다! 호사가의 참여를 기다립니다!");
$logger->flush();
+6 -6
View File
@@ -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"]
]
]