유니크 아이템에 효과 추가

This commit is contained in:
2021-04-29 19:50:12 +09:00
parent 14fc85db51
commit bcbd69e1b9
24 changed files with 339 additions and 1 deletions
@@ -10,13 +10,19 @@ use sammo\ObjectTrigger;
class che_반계시도 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BODY + 300;
protected $prob;
public function __construct(WarUnit $unit, int $raiseType = 0, float $prob = 0.4){
$this->object = $unit;
$this->prob = $prob;
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
if(!$oppose->hasActivatedSkill('계략')){
return true;
}
if(!Util::randBool(0.4)){
if(!Util::randBool($this->prob)){
return true;
}
@@ -0,0 +1,19 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\ObjectTrigger;
class che_퇴각부상무효 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 300;
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
$self->activateSkill('퇴각부상무효');
return true;
}
}