refac: 유산 포인트 파트를 별도의 Manager로 분리, enum 적용

This commit is contained in:
2022-05-08 04:40:36 +09:00
parent 54a5a61bee
commit c32179347c
35 changed files with 463 additions and 345 deletions
+4 -3
View File
@@ -3,6 +3,7 @@
namespace sammo;
use DateTime;
use sammo\Enums\InheritanceKey;
use sammo\Event\Action;
require_once 'process_war.php';
@@ -1617,7 +1618,7 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
if (!$availableUnique) {
if ($general->getAuxVar('inheritRandomUnique')) {
$general->setAuxVar('inheritRandomUnique', null);
$general->increaseInheritancePoint('previous', GameConst::$inheritItemRandomPoint);
$general->increaseInheritancePoint(InheritanceKey::previous, GameConst::$inheritItemRandomPoint);
$userLogger = new UserLogger($general->getVar('owner'));
$userLogger->push(sprintf("얻을 유니크가 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
}
@@ -1687,7 +1688,7 @@ function rollbackInheritUniqueTrial(General $general, string $itemKey, string $r
//두 값이 general, KVStorage 둘다 있고, 이중에선 KVStorage 값을 기준으로 하자 따르자
[,, $amount] = $ownTrial;
$trialStor->deleteValue("u{$ownerID}");
$general->increaseInheritancePoint('previous', $amount);
$general->increaseInheritancePoint(InheritanceKey::previous, $amount);
LogText("선택유니크 롤백포인트:{$ownerID}", $amount);
$userLogger = new UserLogger($ownerID);
@@ -1902,7 +1903,7 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
LogText("{$general->getName()}, {$general->getID()} 모든 아이템", $trialCnt);
if ($general->getAuxVar('inheritRandomUnique')) {
$general->setAuxVar('inheritRandomUnique', null);
$general->increaseInheritancePoint('previous', GameConst::$inheritItemRandomPoint);
$general->increaseInheritancePoint(InheritanceKey::previous, GameConst::$inheritItemRandomPoint);
$userLogger = new UserLogger($general->getVar('owner'));
$userLogger->push(sprintf("유니크를 얻을 공간이 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
}