feat, game: 징병 전특 리밸런싱, 징병/소집해제시 인구 변동 트리거 설정
This commit is contained in:
@@ -9,7 +9,7 @@ class che_징병_낙주 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '낙주';
|
protected $rawName = '낙주';
|
||||||
protected $name = '낙주(징병)';
|
protected $name = '낙주(징병)';
|
||||||
protected $info = '[군사] 징·모병비 -30%, 통솔 순수 능력치 보정 +15%';
|
protected $info = '[군사] 징·모병비 -30%<br>[기타] 통솔 순수 능력치 보정 +15%, 징병/모병/소집해제 시 인구 변동 없음';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -18,6 +18,10 @@ class che_징병_낙주 extends \sammo\BaseItem{
|
|||||||
if($varType == 'cost') return $value * 0.7;
|
if($varType == 'cost') return $value * 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($turnType == '징집인구' && $varType == 'score'){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class event_전투특기_징병 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '비급';
|
protected $rawName = '비급';
|
||||||
protected $name = '비급(징병)';
|
protected $name = '비급(징병)';
|
||||||
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +25%';
|
protected $info = '[군사] 징병/모병 시 훈사 70/84 제공<br>[기타] 통솔 순수 능력치 보정 +25%, 징병/모병/소집해제 시 인구 변동 없음';
|
||||||
protected $cost = 100;
|
protected $cost = 100;
|
||||||
protected $buyable = true;
|
protected $buyable = true;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
@@ -18,6 +18,18 @@ class event_전투특기_징병 extends \sammo\BaseItem{
|
|||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
if(in_array($turnType, ['징병', '모병'])){
|
if(in_array($turnType, ['징병', '모병'])){
|
||||||
if($varType == 'cost') return $value * 0.5;
|
if($varType == 'cost') return $value * 0.5;
|
||||||
|
if($varType == 'train' || $varType == 'atmos'){
|
||||||
|
if($turnType === '징병'){
|
||||||
|
return 70;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return 84;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($turnType == '징집인구' && $varType == 'score'){
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class che_event_징병 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
protected $id = 72;
|
protected $id = 72;
|
||||||
protected $name = '징병';
|
protected $name = '징병';
|
||||||
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +25%';
|
protected $info = '[군사] 징병/모병 시 훈사 70/84 제공<br>[기타] 통솔 순수 능력치 보정 +25%, 징병/모병/소집해제 시 인구 변동 없음';
|
||||||
|
|
||||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||||
static $selectWeight = 1;
|
static $selectWeight = 1;
|
||||||
@@ -22,8 +22,20 @@ class che_event_징병 extends \sammo\BaseSpecial{
|
|||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
if(in_array($turnType, ['징병', '모병'])){
|
if(in_array($turnType, ['징병', '모병'])){
|
||||||
if($varType == 'cost') return $value * 0.5;
|
if($varType == 'cost') return $value * 0.5;
|
||||||
|
if($varType == 'train' || $varType == 'atmos'){
|
||||||
|
if($turnType === '징병'){
|
||||||
|
return 70;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return 84;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($turnType == '징집인구' && $varType == 'score'){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class che_징병 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
protected $id = 72;
|
protected $id = 72;
|
||||||
protected $name = '징병';
|
protected $name = '징병';
|
||||||
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +25%';
|
protected $info = '[군사] 징병/모병 시 훈사 70/84 제공<br>[기타] 통솔 순수 능력치 보정 +25%, 징병/모병/소집해제 시 인구 변동 없음';
|
||||||
|
|
||||||
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
|
||||||
static $selectWeight = 1;
|
static $selectWeight = 1;
|
||||||
@@ -22,8 +22,20 @@ class che_징병 extends \sammo\BaseSpecial{
|
|||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
if(in_array($turnType, ['징병', '모병'])){
|
if(in_array($turnType, ['징병', '모병'])){
|
||||||
if($varType == 'cost') return $value * 0.5;
|
if($varType == 'cost') return $value * 0.5;
|
||||||
|
if($varType == 'train' || $varType == 'atmos'){
|
||||||
|
if($turnType === '징병'){
|
||||||
|
return 70;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return 84;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($turnType == '징집인구' && $varType == 'score'){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ class che_소집해제 extends Command\GeneralCommand{
|
|||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
$date = $general->getTurnTime($general::TURNTIME_HM);
|
$date = $general->getTurnTime($general::TURNTIME_HM);
|
||||||
|
|
||||||
$crew = $general->getVar('crew');
|
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
$logger->pushGeneralActionLog("병사들을 <R>소집해제</>하였습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("병사들을 <R>소집해제</>하였습니다. <1>$date</>");
|
||||||
@@ -71,8 +69,10 @@ class che_소집해제 extends Command\GeneralCommand{
|
|||||||
$exp = 70;
|
$exp = 70;
|
||||||
$ded = 100;
|
$ded = 100;
|
||||||
|
|
||||||
|
$crewUp = $general->onCalcDomestic('징집인구', 'score', $general->getVar('crew'));
|
||||||
|
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'pop'=>$db->sqleval('pop + %i', $crew)
|
'pop'=>$db->sqleval('pop + %i', $crewUp)
|
||||||
], 'city=%i', $general->getCityID());
|
], 'city=%i', $general->getCityID());
|
||||||
|
|
||||||
$general->setVar('crew', 0);
|
$general->setVar('crew', 0);
|
||||||
|
|||||||
@@ -184,10 +184,13 @@ class che_징병 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
|
$setTrain = $general->onCalcDomestic(static::$actionName, 'train', static::$defaultTrain);
|
||||||
|
$setAtmos = $general->onCalcDomestic(static::$actionName, 'atmos', static::$defaultAtmos);
|
||||||
|
|
||||||
if ($reqCrewType->id == $currCrewType->id && $currCrew > 0) {
|
if ($reqCrewType->id == $currCrewType->id && $currCrew > 0) {
|
||||||
$logger->pushGeneralActionLog("{$crewTypeName} <C>{$reqCrewText}</>명을 추가{$this->getName()}했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("{$crewTypeName} <C>{$reqCrewText}</>명을 추가{$this->getName()}했습니다. <1>$date</>");
|
||||||
$train = ($currCrew * $general->getVar('train') + $reqCrew * static::$defaultTrain) / ($currCrew + $reqCrew);
|
$train = ($currCrew * $general->getVar('train') + $reqCrew * $setTrain) / ($currCrew + $reqCrew);
|
||||||
$atmos = ($currCrew * $general->getVar('atmos') + $reqCrew * static::$defaultAtmos) / ($currCrew + $reqCrew);
|
$atmos = ($currCrew * $general->getVar('atmos') + $reqCrew * $setAtmos) / ($currCrew + $reqCrew);
|
||||||
|
|
||||||
$general->increaseVar('crew', $reqCrew);
|
$general->increaseVar('crew', $reqCrew);
|
||||||
$general->setVar('train', $train);
|
$general->setVar('train', $train);
|
||||||
@@ -196,15 +199,17 @@ class che_징병 extends Command\GeneralCommand
|
|||||||
$logger->pushGeneralActionLog("{$crewTypeName} <C>{$reqCrewText}</>명을 {$this->getName()}했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("{$crewTypeName} <C>{$reqCrewText}</>명을 {$this->getName()}했습니다. <1>$date</>");
|
||||||
$general->setVar('crewtype', $reqCrewType->id);
|
$general->setVar('crewtype', $reqCrewType->id);
|
||||||
$general->setVar('crew', $reqCrew);
|
$general->setVar('crew', $reqCrew);
|
||||||
$general->setVar('train', static::$defaultTrain);
|
$general->setVar('train', $setTrain);
|
||||||
$general->setVar('atmos', static::$defaultAtmos);
|
$general->setVar('atmos', $setAtmos);
|
||||||
}
|
}
|
||||||
|
|
||||||
$newTrust = Util::valueFit($this->city['trust'] - ($reqCrew / $this->city['pop']) / static::$costOffset * 100, 0);
|
$reqCrewDown = $general->onCalcDomestic('징집인구', 'score', $reqCrew);
|
||||||
|
|
||||||
|
$newTrust = Util::valueFit($this->city['trust'] - ($reqCrewDown / $this->city['pop']) / static::$costOffset * 100, 0);
|
||||||
|
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'trust' => $newTrust,
|
'trust' => $newTrust,
|
||||||
'pop' => $this->city['pop'] - $reqCrew
|
'pop' => $this->city['pop'] - $reqCrewDown
|
||||||
], 'city=%i', $general->getCityID());
|
], 'city=%i', $general->getCityID());
|
||||||
|
|
||||||
$exp = Util::round($reqCrew / 100);
|
$exp = Util::round($reqCrew / 100);
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ class che_병력군량소모 extends BaseGeneralTrigger{
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
$crewUp = $general->onCalcDomestic('징집인구', 'score', $general->getVar('crew'));
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'pop'=>$db->sqleval('pop + %i', $general->getVar('crew'))
|
'pop'=>$db->sqleval('pop + %i', $crewUp)
|
||||||
], 'city=%i', $general->getCityID());
|
], 'city=%i', $general->getCityID());
|
||||||
|
|
||||||
$general->setVar('crew', 0);
|
$general->setVar('crew', 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user