game,feat: 계략 커맨드 방어 유니크
- 계략 방어 확률에 보정 trigger 추가
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use sammo\WarUnit;
|
||||
|
||||
class che_농성_위공자병법 extends \sammo\BaseItem{
|
||||
|
||||
protected $rawName = '위공자병법';
|
||||
protected $name = '위공자병법(농성)';
|
||||
protected $info = '[계략] 장수 주둔 도시 화계·탈취·파괴·선동 : 성공률 -30%p<br>[전투] 상대 계략 시도 확률 -10%p, 상대 계략 성공 확률 -10%p';
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName === 'sabotageDefence'){
|
||||
return $value + 0.3;
|
||||
}
|
||||
if($statName === 'warMagicTrialProb'){
|
||||
return $value - 0.1;
|
||||
}
|
||||
if($statName === 'warMagicSuccessProb'){
|
||||
return $value - 0.1;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace sammo\ActionItem;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use sammo\WarUnit;
|
||||
|
||||
class che_농성_주서음부 extends \sammo\BaseItem{
|
||||
|
||||
protected $rawName = '주서음부';
|
||||
protected $name = '주서음부(농성)';
|
||||
protected $info = '[계략] 장수 주둔 도시 화계·탈취·파괴·선동 : 성공률 -30%p<br>[전투] 상대 계략 시도 확률 -10%p, 상대 계략 성공 확률 -10%p';
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName === 'sabotageDefence'){
|
||||
return $value + 0.3;
|
||||
}
|
||||
if($statName === 'warMagicTrialProb'){
|
||||
return $value - 0.1;
|
||||
}
|
||||
if($statName === 'warMagicSuccessProb'){
|
||||
return $value - 0.1;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,7 @@ class che_화계 extends Command\GeneralCommand
|
||||
$destNationID = $destNation['nation'];
|
||||
|
||||
$maxGenScore = 0;
|
||||
$probCorrection = 0;
|
||||
foreach ($destCityGeneralList as $destGeneral) {
|
||||
/** @var General $destGeneral */
|
||||
if ($destGeneral->getNationID() != $destNationID) {
|
||||
@@ -92,9 +93,11 @@ class che_화계 extends Command\GeneralCommand
|
||||
throw new \sammo\MustNotBeReachedException();
|
||||
}
|
||||
$maxGenScore = max($maxGenScore, $genScore);
|
||||
$probCorrection = $destGeneral->onCalcStat($destGeneral, 'sabotageDefence', $probCorrection);
|
||||
}
|
||||
|
||||
$prob = $maxGenScore / GameConst::$sabotageProbCoefByStat;
|
||||
$prob += $probCorrection;
|
||||
|
||||
$prob += $destCity['secu'] / $destCity['secu_max'] / 5; //최대 20%p
|
||||
$prob += $destCity['supply'] ? 0.1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user