환약 사용 기준 추가

This commit is contained in:
2020-06-01 02:31:46 +09:00
parent e56a550cff
commit e257bed6de
5 changed files with 26 additions and 5 deletions
@@ -9,13 +9,19 @@ use sammo\JosaUtil;
class che_아이템치료 extends BaseGeneralTrigger{
protected $priority = 20010;
protected $injuryTarget = 10;
public function __construct(General $general, int $injuryTarget=10){
$this->object = $general;
$this->injuryTarget = $injuryTarget;
}
public function action(?array $env=null, $arg=null):?array{
/** @var \sammo\General $general */
$general = $this->object;
if($general->getVar('injury') >= 10){
if($general->getVar('injury') >= $this->injuryTarget){
if($general->getReservedTurn(0, $env) instanceof \sammo\Command\General\che_요양){
return $env;
}