diff --git a/hwe/sammo/ActionItem/che_계략_이추.php b/hwe/sammo/ActionItem/che_계략_이추.php index f999e5a5..1a5da8aa 100644 --- a/hwe/sammo/ActionItem/che_계략_이추.php +++ b/hwe/sammo/ActionItem/che_계략_이추.php @@ -21,7 +21,7 @@ class che_계략_이추 extends \sammo\BaseItem{ return $value; } - function isConsumableNow(string $actionType, string $command):bool{ + function tryConsumeNow(General $general, string $actionType, string $command):bool{ if($actionType == 'GeneralCommand' && $command == '계략'){ return true; } diff --git a/hwe/sammo/ActionItem/che_계략_향낭.php b/hwe/sammo/ActionItem/che_계략_향낭.php index 6035226e..ed25f8b8 100644 --- a/hwe/sammo/ActionItem/che_계략_향낭.php +++ b/hwe/sammo/ActionItem/che_계략_향낭.php @@ -21,7 +21,7 @@ class che_계략_향낭 extends \sammo\BaseItem{ return $value; } - function isConsumableNow(string $actionType, string $command):bool{ + function tryConsumeNow(General $general, string $actionType, string $command):bool{ if($actionType == 'GeneralCommand' && $command == '계략'){ return true; } diff --git a/hwe/sammo/ActionItem/che_사기_탁주.php b/hwe/sammo/ActionItem/che_사기_탁주.php index d10e4959..efddfb48 100644 --- a/hwe/sammo/ActionItem/che_사기_탁주.php +++ b/hwe/sammo/ActionItem/che_사기_탁주.php @@ -3,6 +3,7 @@ namespace sammo\ActionItem; use \sammo\iAction; use \sammo\General; use \sammo\BaseWarUnitTrigger; +use sammo\GameConst; use \sammo\WarUnit; use \sammo\WarUnitTriggerCaller; use \sammo\WarUnitTrigger\능력치변경; @@ -11,7 +12,7 @@ class che_사기_탁주 extends \sammo\BaseItem{ protected $rawName = '탁주'; protected $name = '탁주(사기)'; - protected $info = '[전투] 사기 +6. 1회용'; + protected $info = '[전투] 사기 +30(한도 내). 1회용'; protected $cost = 1000; protected $consumable = true; protected $buyable = true; @@ -19,7 +20,7 @@ class che_사기_탁주 extends \sammo\BaseItem{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ return new WarUnitTriggerCaller( - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 6) + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 30, null, GameConst::$maxAtmosByWar) ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_저격_수극.php b/hwe/sammo/ActionItem/che_저격_수극.php index 7fe46fc9..4de2a47f 100644 --- a/hwe/sammo/ActionItem/che_저격_수극.php +++ b/hwe/sammo/ActionItem/che_저격_수극.php @@ -12,7 +12,7 @@ class che_저격_수극 extends \sammo\BaseItem{ protected $rawName = '수극'; protected $name = '수극(저격)'; - protected $info = '[전투] 전투 개시 전 50% 확률로 저격 시도. 1회용'; + protected $info = '[전투] 전투 개시 시 저격. 1회용'; protected $cost = 1000; protected $consumable = true; protected $buyable = true; @@ -20,12 +20,12 @@ class che_저격_수극 extends \sammo\BaseItem{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ return new WarUnitTriggerCaller( - new che_저격시도($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 0.5, 20, 40), + new che_저격시도($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 1, 20, 40), new che_저격발동($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM) ); } - function isConsumableNow(string $actionType, string $command):bool{ + function tryConsumeNow(General $general, string $actionType, string $command):bool{ if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){ return true; } diff --git a/hwe/sammo/ActionItem/che_치료_환약.php b/hwe/sammo/ActionItem/che_치료_환약.php index 39f5d5e5..59b4b704 100644 --- a/hwe/sammo/ActionItem/che_치료_환약.php +++ b/hwe/sammo/ActionItem/che_치료_환약.php @@ -9,22 +9,47 @@ class che_치료_환약 extends \sammo\BaseItem{ protected $rawName = '환약'; protected $name = '환약(치료)'; - protected $info = '[군사] 턴 실행 전 부상 회복. 1회용'; - protected $cost = 100; + protected $info = '[군사] 턴 실행 전 부상 회복. 3회용'; + protected $cost = 200; protected $consumable = true; protected $buyable = true; protected $reqSecu = 0; + const REMAIN_KEY = 'remain환약'; + public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{ return new GeneralTriggerCaller( new GeneralTrigger\che_아이템치료($general, $general->getAuxVar('use_treatment')??10) ); } - function isConsumableNow(string $actionType, string $command):bool{ - if($actionType == 'GeneralTrigger' && $command == 'che_아이템치료'){ - return true; + function onArbitraryAction(General $general, string $actionType, ?string $phase = null, $aux = null): ?array + { + if($actionType != '장비매매'){ + return $aux; } - return false; + if($phase != '구매'){ + return $aux; + } + + $general->setAuxVar(static::REMAIN_KEY, 3); + return $aux; + } + + function tryConsumeNow(General $general, string $actionType, string $command):bool{ + if($actionType != 'GeneralTrigger'){ + return false; + } + if($command != 'che_아이템치료'){ + return false; + } + $remainCnt = $general->getAuxVar(static::REMAIN_KEY)??1; + if($remainCnt > 1){ + $general->setAuxVar(static::REMAIN_KEY, $remainCnt - 1); + return false; + } + + $general->setAuxVar(static::REMAIN_KEY, null); + return true; } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_훈련_청주.php b/hwe/sammo/ActionItem/che_훈련_청주.php index 47e4e15a..32f228e6 100644 --- a/hwe/sammo/ActionItem/che_훈련_청주.php +++ b/hwe/sammo/ActionItem/che_훈련_청주.php @@ -3,6 +3,7 @@ namespace sammo\ActionItem; use \sammo\iAction; use \sammo\General; use \sammo\BaseWarUnitTrigger; +use sammo\GameConst; use \sammo\WarUnit; use \sammo\WarUnitTriggerCaller; use \sammo\WarUnitTrigger\능력치변경; @@ -11,7 +12,7 @@ class che_훈련_청주 extends \sammo\BaseItem{ protected $rawName = '청주'; protected $name = '청주(훈련)'; - protected $info = '[전투] 훈련 +6. 1회용'; + protected $info = '[전투] 훈련 +40(한도 내). 1회용'; protected $cost = 1000; protected $consumable = true; protected $buyable = true; @@ -19,7 +20,7 @@ class che_훈련_청주 extends \sammo\BaseItem{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ return new WarUnitTriggerCaller( - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 6) + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 40, null, GameConst::$maxTrainByWar) ); } } \ No newline at end of file diff --git a/hwe/sammo/BaseItem.php b/hwe/sammo/BaseItem.php index a8a9061f..e03988ea 100644 --- a/hwe/sammo/BaseItem.php +++ b/hwe/sammo/BaseItem.php @@ -45,7 +45,7 @@ class BaseItem implements iAction{ return $this->reqSecu; } - function isConsumableNow(string $actionType, string $command):bool{ + function tryConsumeNow(General $general, string $actionType, string $command):bool{ return false; } } \ No newline at end of file diff --git a/hwe/sammo/Command/General/che_화계.php b/hwe/sammo/Command/General/che_화계.php index 835bded0..3c7f04df 100644 --- a/hwe/sammo/Command/General/che_화계.php +++ b/hwe/sammo/Command/General/che_화계.php @@ -312,7 +312,7 @@ class che_화계 extends Command\GeneralCommand $this->affectDestCity($injuryCount); $itemObj = $general->getItem(); - if ($itemObj->isConsumableNow('GeneralCommand', '계략') && $itemObj->isConsumableNow('GeneralCommand', '계략')) { + if ($itemObj->tryConsumeNow($general, 'GeneralCommand', '계략')) { $itemName = $itemObj->getName(); $itemRawName = $itemObj->getRawName(); $josaUl = JosaUtil::pick($itemRawName, '을'); diff --git a/hwe/sammo/GeneralTrigger/che_아이템치료.php b/hwe/sammo/GeneralTrigger/che_아이템치료.php index fe7283e9..dab393a1 100644 --- a/hwe/sammo/GeneralTrigger/che_아이템치료.php +++ b/hwe/sammo/GeneralTrigger/che_아이템치료.php @@ -34,7 +34,7 @@ class che_아이템치료 extends BaseGeneralTrigger{ $josaUl = JosaUtil::pick($itemRawName, '을'); $general->getLogger()->pushGeneralActionLog("{$itemName}{$josaUl} 사용하여 치료합니다!", ActionLogger::PLAIN); - if($itemObj->isConsumableNow('GeneralTrigger', 'che_아이템치료')){ + if($itemObj->tryConsumeNow($general, 'GeneralTrigger', 'che_아이템치료')){ $general->deleteItem(); } }