game,feat: 조달 효율 변경 trigger 추가, 조달 유니크 추가
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo\ActionItem;
|
||||||
|
use \sammo\iAction;
|
||||||
|
use \sammo\General;
|
||||||
|
use sammo\Util;
|
||||||
|
|
||||||
|
class che_조달_주판 extends \sammo\BaseItem{
|
||||||
|
|
||||||
|
protected $rawName = '주판';
|
||||||
|
protected $name = '주판(조달)';
|
||||||
|
protected $info = '[내정] 물자조달 성공 확률 +20%p, 물자조달 획득량 +100%p';
|
||||||
|
protected $cost = 200;
|
||||||
|
protected $consumable = false;
|
||||||
|
|
||||||
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
|
if($turnType === '조달'){
|
||||||
|
if($varType == 'success') return $value + 0.2;
|
||||||
|
if($varType == 'score') return $value * 2;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -79,13 +79,20 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
$score *= getDomesticExpLevelBonus($general->getVar('explevel'));
|
$score *= getDomesticExpLevelBonus($general->getVar('explevel'));
|
||||||
$score *= Util::randRange(0.8, 1.2);
|
$score *= Util::randRange(0.8, 1.2);
|
||||||
|
|
||||||
|
$successRatio = 0.1;
|
||||||
|
$failRatio = 0.3;
|
||||||
|
|
||||||
|
$successRatio = $general->onCalcDomestic('조달', 'success', $successRatio);
|
||||||
|
$failRatio = $general->onCalcDomestic('조달', 'fail', $failRatio);
|
||||||
|
$normalRatio = 1 - $failRatio - $successRatio;
|
||||||
|
|
||||||
$pick = Util::choiceRandomUsingWeight([
|
$pick = Util::choiceRandomUsingWeight([
|
||||||
'fail'=>0.3,
|
'fail'=>$failRatio,
|
||||||
'success'=>0.1,
|
'success'=>$successRatio,
|
||||||
'normal'=>0.6
|
'normal'=>$normalRatio
|
||||||
]);
|
]);
|
||||||
$score *= CriticalScoreEx($pick);
|
$score *= CriticalScoreEx($pick);
|
||||||
|
$score = $general->onCalcDomestic('조달', 'score', $score);
|
||||||
|
|
||||||
$score = Util::round($score);
|
$score = Util::round($score);
|
||||||
$scoreText = number_format($score, 0);
|
$scoreText = number_format($score, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user