experience, dedication 변경
expereince, dedication 변경을 add 함수로 변경 경험치,계급 변경을 '즉시' 하도록 변경(남은 부분 있음) 관직 임명을 c에서 j로 변경
This commit is contained in:
@@ -126,8 +126,6 @@ class che_강행 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaRo} 강행했습니다. <1>$date</>");
|
||||
|
||||
$exp = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$general->setVar('city', $destCityID);
|
||||
|
||||
if($general->getVar('level') == 12 && $this->nation['level'] == 0){
|
||||
@@ -148,7 +146,7 @@ class che_강행 extends Command\GeneralCommand{
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -157,12 +157,9 @@ class che_거병 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 100;
|
||||
$ded = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->setVar('belong', 1);
|
||||
$general->setVar('level', 12);
|
||||
$general->setVar('nation', $nationID);
|
||||
|
||||
@@ -150,12 +150,9 @@ class che_건국 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 1000;
|
||||
$ded = 1000;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
|
||||
$db->update('city', [
|
||||
'nation'=>$general->getNationID(),
|
||||
|
||||
@@ -112,9 +112,7 @@ class che_견문 extends Command\GeneralCommand{
|
||||
|
||||
$logger->pushGeneralActionLog("{$text} <1>$date</>");
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -153,18 +153,15 @@ class che_군량매매 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 30;
|
||||
$ded = 50;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
|
||||
$incStat = Util::choiceRandomUsingWeight([
|
||||
'leadership_exp'=>$general->getLeadership(false, false, false, false),
|
||||
'strength_exp'=>$general->getStrength(false, false, false, false),
|
||||
'intel_exp'=>$general->getIntel(false, false, false, false)
|
||||
]);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($incStat, 1);
|
||||
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -95,13 +95,11 @@ class che_귀환 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->setVar('city', $cityID);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -105,10 +105,6 @@ class che_기술연구 extends che_상업투자{
|
||||
$logger->pushGeneralActionLog(static::$actionName."{$josaUl} 하여 <C>$scoreText</> 상승했습니다. <1>$date</>");
|
||||
}
|
||||
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
if(TechLimit($this->env['startyear'], $this->env['year'], $this->nation['tech'])){
|
||||
$score /= 4;
|
||||
}
|
||||
@@ -124,8 +120,8 @@ class che_기술연구 extends che_상업투자{
|
||||
$db->update('nation', $nationUpdated, 'nation=%i', $general->getVar('nation'));
|
||||
|
||||
$general->increaseVarWithLimit('gold', -$this->reqGold, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -111,7 +111,6 @@ class che_단련 extends Command\GeneralCommand{
|
||||
}
|
||||
|
||||
$exp = $general->getVar('crew') / 400;
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
|
||||
$general->addDex($general->getCrewTypeObj(), $score, false);
|
||||
|
||||
@@ -124,7 +123,7 @@ class che_단련 extends Command\GeneralCommand{
|
||||
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->increaseVar($incStat, 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -140,13 +140,10 @@ class che_등용 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
$ded = 200;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
|
||||
|
||||
@@ -135,8 +135,8 @@ class che_등용수락 extends Command\GeneralCommand{
|
||||
|
||||
$isTroopLeader = ($generalID == $general->getVar('troop'));
|
||||
|
||||
$destGeneral->increaseVar('experience', $destGeneral->onCalcStat($general, 'experience', 100));
|
||||
$destGeneral->increaseVar('dedication', $destGeneral->onCalcStat($general, 'dedication', 100));
|
||||
$destGeneral->addExperience(100);
|
||||
$destGeneral->addDedication(100);
|
||||
|
||||
$setOriginalCityValues = [];
|
||||
$setOriginalNationValues = [
|
||||
@@ -169,12 +169,14 @@ class che_등용수락 extends Command\GeneralCommand{
|
||||
|
||||
// 재야가 아니면 명성N*10% 공헌N*10%감소
|
||||
$general->setVar('experience', $general->getVar('experience') * (1 - 0.1 * $general->getVar('betray')));
|
||||
$general->addExperience(0, false);
|
||||
$general->setVar('dedication', $general->getVar('dedication') * (1 - 0.1 * $general->getVar('betray')));
|
||||
$general->increaseVar('betray', 1);
|
||||
$general->addDedication(0, false);
|
||||
$general->increaseVarWithLimit('betray', 1, null, GameConst::$maxBetrayCnt);
|
||||
}
|
||||
else{
|
||||
$general->increaseVar('experience', $general->onCalcStat($general, 'experience', 100));
|
||||
$general->increaseVar('dedication', $general->onCalcStat($general, 'dedication', 100));
|
||||
$general->addExperience(100);
|
||||
$general->addDedication(100);
|
||||
}
|
||||
|
||||
if($general->getVar('npc') < 2){
|
||||
|
||||
@@ -238,7 +238,6 @@ class che_랜덤임관 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
}
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$general->setVar('nation', $destNationID);
|
||||
$general->setVar('level', 1);
|
||||
$general->setVar('belong', 1);
|
||||
@@ -262,7 +261,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
|
||||
$general->setAuxVar('joinedNations', $joinedNations);
|
||||
}
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
tryUniqueItemLottery($general, '랜덤 임관');
|
||||
|
||||
@@ -107,17 +107,14 @@ class che_물자조달 extends Command\GeneralCommand{
|
||||
$exp = $score * 0.7 / 3;
|
||||
$ded = $score * 1.0 / 3;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$incStat = Util::choiceRandomUsingWeight([
|
||||
'leadership_exp'=>$general->getLeadership(false, false, false, false),
|
||||
'strength_exp'=>$general->getStrength(false, false, false, false),
|
||||
'intel_exp'=>$general->getIntel(false, false, false, false)
|
||||
]);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($incStat, 1);
|
||||
|
||||
$db->update('nation', [
|
||||
|
||||
@@ -90,16 +90,13 @@ class che_사기진작 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVarWithLimit('atmos', $score, 0, GameConst::$maxAtmosByCommand);
|
||||
$general->setVar('train', $sideEffect);
|
||||
|
||||
$general->addDex($general->getCrewTypeObj(), $score, false);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -178,9 +178,6 @@ class che_상업투자 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog(static::$actionName."{$josaUl} 하여 <C>$scoreText</> 상승했습니다. <1>$date</>");
|
||||
}
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
if(in_array($this->city['front'], [1, 3]) && $this->nation['capital'] != $this->city['city']){
|
||||
$score *= static::$debuffFront;
|
||||
}
|
||||
@@ -196,8 +193,8 @@ class che_상업투자 extends Command\GeneralCommand{
|
||||
$db->update('city', $cityUpdated, 'city=%i', $general->getVar('city'));
|
||||
|
||||
$general->increaseVarWithLimit('gold', -$this->reqGold, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -75,17 +75,14 @@ class che_소집해제 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
|
||||
$db->update('city', [
|
||||
'pop'=>$db->sqleval('pop + %i', $crew)
|
||||
], 'city=%i', $general->getCityID());
|
||||
|
||||
$general->setVar('crew', 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -71,12 +71,9 @@ class che_요양 extends Command\GeneralCommand{
|
||||
$exp = 10;
|
||||
$ded = 7;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->setVar('injury', 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -127,7 +127,6 @@ class che_이동 extends Command\GeneralCommand{
|
||||
|
||||
$exp = 50;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$general->setVar('city', $destCityID);
|
||||
|
||||
if($general->getVar('level') == 12 && $this->nation['level'] == 0){
|
||||
@@ -146,7 +145,7 @@ class che_이동 extends Command\GeneralCommand{
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -138,13 +138,10 @@ class che_인재탐색 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($incStat, 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
@@ -299,13 +296,10 @@ class che_인재탐색 extends Command\GeneralCommand{
|
||||
$exp = 200;
|
||||
$ded = 300;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($incStat, 3);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -153,7 +153,6 @@ class che_임관 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
}
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$general->setVar('nation', $destNationID);
|
||||
$general->setVar('level', 1);
|
||||
$general->setVar('belong', 1);
|
||||
@@ -178,7 +177,7 @@ class che_임관 extends Command\GeneralCommand{
|
||||
$general->setAuxVar('joinedNations', $joinedNations);
|
||||
}
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
tryUniqueItemLottery($general);
|
||||
|
||||
@@ -168,9 +168,8 @@ class che_장비매매 extends Command\GeneralCommand{
|
||||
}
|
||||
|
||||
$exp = 10;
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->addExperience($exp);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -113,11 +113,8 @@ class che_전투태세 extends Command\GeneralCommand{
|
||||
$exp = 100 * 3;
|
||||
$ded = 70 * 3;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
|
||||
$crew = $general->getVar('crew');
|
||||
|
||||
|
||||
@@ -165,11 +165,6 @@ class che_정착장려 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog(static::$actionName."{$josaUl} 하여 주민이 <C>$scoreText</>명 증가했습니다. <1>$date</>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
//NOTE: 내정량 상승시 초과 가능?
|
||||
$cityUpdated = [
|
||||
static::$cityKey => Util::valueFit(
|
||||
@@ -181,8 +176,8 @@ class che_정착장려 extends Command\GeneralCommand{
|
||||
$db->update('city', $cityUpdated, 'city=%i', $general->getVar('city'));
|
||||
|
||||
$general->increaseVarWithLimit('rice', -$this->reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -165,9 +165,6 @@ class che_주민선정 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog(static::$actionName."{$josaUl} 하여 <C>$scoreText</> 상승했습니다. <1>$date</>");
|
||||
}
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
//NOTE: 내정량 상승시 초과 가능?
|
||||
$cityUpdated = [
|
||||
static::$cityKey => Util::valueFit(
|
||||
@@ -179,8 +176,8 @@ class che_주민선정 extends Command\GeneralCommand{
|
||||
$db->update('city', $cityUpdated, 'city=%i', $general->getVar('city'));
|
||||
|
||||
$general->increaseVarWithLimit('rice', -$this->reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -148,11 +148,8 @@ class che_증여 extends Command\GeneralCommand{
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -101,11 +101,8 @@ class che_집합 extends Command\GeneralCommand{
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -196,15 +196,12 @@ class che_징병 extends Command\GeneralCommand{
|
||||
$exp = Util::round($reqCrew / 100);
|
||||
$ded = Util::round($reqCrew / 100);
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->addDex($general->getCrewTypeObj(), $reqCrew / 100, false);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
|
||||
@@ -186,15 +186,12 @@ class che_첩보 extends Command\GeneralCommand{
|
||||
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -93,8 +93,10 @@ class che_하야 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>에서 하야");
|
||||
$logger->pushGlobalActionLog("{$generalName}</>{$josaYi} <D><b>{$nationName}</b></>에서 <R>하야</>했습니다.");
|
||||
$general->setVar('experience', $general->getVar('experience') * (1 - 0.1 * $general->getVar('betray')));
|
||||
$general->addExperience(0, false);
|
||||
$general->setVar('dedication', $general->getVar('dedication') * (1 - 0.1 * $general->getVar('betray')));
|
||||
$general->increaseVar('betray', 1);
|
||||
$general->addDedication(0, false);
|
||||
$general->increaseVarWithLimit('betray', 1, null, GameConst::$maxBetrayCnt);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -128,11 +128,8 @@ class che_헌납 extends Command\GeneralCommand{
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -265,14 +265,11 @@ class che_화계 extends Command\GeneralCommand{
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($statType.'_exp', 1);
|
||||
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
@@ -301,15 +298,12 @@ class che_화계 extends Command\GeneralCommand{
|
||||
|
||||
$exp = Util::randRangeInt(201, 300);
|
||||
$ded = Util::randRangeInt(141, 210);
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('rice', -$reqRice, 0);
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar($statType.'_exp', 1);
|
||||
$general->increaseRankVar('firenum', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -94,16 +94,13 @@ class che_훈련 extends Command\GeneralCommand{
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
|
||||
$exp = $general->onCalcStat($general, 'experience', $exp);
|
||||
$ded = $general->onCalcStat($general, 'dedication', $ded);
|
||||
|
||||
$general->increaseVarWithLimit('train', $score, 0, GameConst::$maxTrainByCommand);
|
||||
$general->setVar('atmos', $sideEffect);
|
||||
|
||||
$general->addDex($general->getCrewTypeObj(), $score, false);
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
$general->increaseVar('dedication', $ded);
|
||||
$general->addExperience($exp);
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
@@ -162,16 +162,8 @@ class che_감축 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaUl = JosaUtil::pick($destCityName, '을');
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
@@ -217,8 +217,8 @@ class che_물자원조 extends Command\NationCommand{
|
||||
'rice'=>$db->sqleval('rice + %i', $riceAmount),
|
||||
], 'nation = %i', $destNationID);
|
||||
|
||||
$general->increaseVar('experience', $general->onCalcStat($general, 'experience', 5));
|
||||
$general->increaseVar('dedication', $general->onCalcStat($general, 'dedication', 5));
|
||||
$general->addExperience(5);
|
||||
$general->addDedication(5);
|
||||
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -125,16 +125,8 @@ class che_백성동원 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
$logger->pushGeneralActionLog("백성동원 발동! <1>$date</>");
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
|
||||
@@ -125,16 +125,8 @@ class che_수몰 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
$logger->pushGeneralActionLog("수몰 발동! <1>$date</>");
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
|
||||
@@ -125,16 +125,8 @@ class che_의병모집 extends Command\NationCommand{
|
||||
$logger->pushGlobalHistoryLog("<L><b>【전략】</b></><D><b>{$nationName}</b></>{$josaYiNation} <M>{$commandName}</>{$josaUl} 발동하였습니다.");
|
||||
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env'); //TODO: 차라리 env가 이거여야..?
|
||||
|
||||
|
||||
@@ -161,16 +161,8 @@ class che_증축 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaUl = JosaUtil::pick($destCityName, '을');
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
@@ -194,16 +194,8 @@ class che_천도 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
$josaYiNation = JosaUtil::pick($nationName, '이');
|
||||
|
||||
@@ -138,16 +138,8 @@ class che_피장파장 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
$logger->pushGeneralActionLog("{$commandName} 발동! <1>$date</>");
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$broadcastMessage = "<Y>{$generalName}</>{$josaYi} <G><b>{$destNationName}</b></>에 <M>{$commandName}</>{$josaUl} 발동하였습니다.";
|
||||
|
||||
|
||||
@@ -94,16 +94,8 @@ class che_필사즉생 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
$logger->pushGeneralActionLog("필사즉생 발동! <1>$date</>");
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
|
||||
@@ -127,16 +127,8 @@ class che_허보 extends Command\NationCommand{
|
||||
$logger = $general->getLogger();
|
||||
$logger->pushGeneralActionLog("허보 발동! <1>$date</>");
|
||||
|
||||
$general->increaseVar(
|
||||
'experience',
|
||||
$general->onCalcStat($general,
|
||||
'experience', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->increaseVar(
|
||||
'dedication',
|
||||
$general->onCalcStat($general,
|
||||
'dedication', 5 * ($this->getPreReqTurn() + 1)
|
||||
));
|
||||
$general->addExperience(5 * ($this->getPreReqTurn() + 1));
|
||||
$general->addDedication(5 * ($this->getPreReqTurn() + 1));
|
||||
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ class GameConstBase
|
||||
public static $maxDedLevel = 30;
|
||||
/** @var int 최대 기술 레벨 */
|
||||
public static $maxTechLevel = 12;
|
||||
/** @var int 최대 하야 패널티 수 */
|
||||
public static $maxBetrayCnt = 9;
|
||||
|
||||
/** @var int 최소 인구 증가량 */
|
||||
public static $basePopIncreaseAmount = 5000;
|
||||
|
||||
+68
-7
@@ -444,6 +444,57 @@ class General implements iAction{
|
||||
$this->increaseVar($dexType, $exp);
|
||||
}
|
||||
|
||||
function addExperience(float $experience, bool $affectTrigger=true){
|
||||
if($affectTrigger){
|
||||
$experience = $this->onCalcStat($this, 'experience', $experience);
|
||||
}
|
||||
|
||||
$this->increaseVar('experience', $experience);
|
||||
$nextExpLevel = getExpLevel($this->getVar('experience'));
|
||||
$comp = $nextExpLevel <=> $this->getVar('explevel');
|
||||
if($comp === 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$this->updateVar('explevel', $nextExpLevel);
|
||||
|
||||
$josaRo = JosaUtil::pick($nextExpLevel, '로');
|
||||
if($comp > 0){
|
||||
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <C>레벨업</>!", ActionLogger::PLAIN);
|
||||
}
|
||||
else{
|
||||
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <R>레벨다운</>!", ActionLogger::PLAIN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function addDedication(float $dedication, bool $affectTrigger=true){
|
||||
if($affectTrigger){
|
||||
$dedication = $this->onCalcStat($this, 'dedication', $dedication);
|
||||
}
|
||||
|
||||
$this->increaseVar('dedication', $dedication);
|
||||
$nextDedLevel = getDedLevel($this->getVar('dedication'));
|
||||
$comp = $nextDedLevel <=> $this->getVar('dedlevel');
|
||||
if($comp === 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$this->updateVar('dedlevel', $nextDedLevel);
|
||||
|
||||
$dedLevelText = getDedLevelText($nextDedLevel);
|
||||
$billText = number_format(getBillByLevel($nextDedLevel));
|
||||
$josaRoDed = JosaUtil::pick($dedLevelText, '로');
|
||||
$josaRoBill = JosaUtil::pick($billText, '로');
|
||||
if($comp > 0){
|
||||
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <C>승급</>하여 봉록이 <C>{$billText}</>{$josaRoBill} <C>상승</>했습니다!", ActionLogger::PLAIN);
|
||||
}
|
||||
else{
|
||||
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <R>강등</>되어 봉록이 <C>{$billText}</>{$josaRoBill} <R>하락</>했습니다!", ActionLogger::PLAIN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateVar(string $key, $value){
|
||||
if($this->raw[$key] === $value){
|
||||
return;
|
||||
@@ -866,14 +917,14 @@ class General implements iAction{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $generalIDList
|
||||
* @param ?int[] $generalIDList
|
||||
* @param null|string[] $column
|
||||
* @param int $constructMode
|
||||
* @return \sammo\General[]
|
||||
* @throws MustNotBeReachedException
|
||||
*/
|
||||
static public function createGeneralObjListFromDB(array $generalIDList, ?array $column=null, int $constructMode=2):array{
|
||||
if(!$generalIDList){
|
||||
static public function createGeneralObjListFromDB(?array $generalIDList, ?array $column=null, int $constructMode=2):array{
|
||||
if($generalIDList === []){
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -889,10 +940,20 @@ class General implements iAction{
|
||||
|
||||
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
||||
|
||||
$rawGenerals = Util::convertArrayToDict(
|
||||
$db->queryFirstRow('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList),
|
||||
'no'
|
||||
);
|
||||
if($generalIDList === null){
|
||||
$rawGenerals = Util::convertArrayToDict(
|
||||
$db->queryFirstRow('SELECT %l FROM general WHERE 1', Util::formatListOfBackticks($column)),
|
||||
'no'
|
||||
);
|
||||
$generalIDList = array_keys($rawGenerals);
|
||||
}
|
||||
else{
|
||||
$rawGenerals = Util::convertArrayToDict(
|
||||
$db->queryFirstRow('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList),
|
||||
'no'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$rawRanks = [];
|
||||
if($rankColumn){
|
||||
|
||||
@@ -1701,7 +1701,7 @@ class GeneralAI
|
||||
|
||||
$city = $this->city;
|
||||
|
||||
if($city['trust'] < 0.4 && Util::randBool($leadership / GameConst::$chiefStatMin)){
|
||||
if($city['trust'] < 40 && Util::randBool($leadership / GameConst::$chiefStatMin)){
|
||||
$cmd = buildGeneralCommandClass('che_주민선정', $general, $env);
|
||||
if($cmd->isRunnable()){
|
||||
return $cmd;
|
||||
@@ -3123,7 +3123,7 @@ class GeneralAI
|
||||
|
||||
protected function calcCityDevelRate(array $city){
|
||||
return [
|
||||
'trust' => [$city['trust'], self::t통솔장],
|
||||
'trust' => [$city['trust'] / 100, self::t통솔장],
|
||||
'pop' => [$city['pop'] / $city['pop_max'], self::t통솔장],
|
||||
'agri' => [$city['agri'] / $city['agri_max'], self::t통솔장],
|
||||
'comm' => [$city['comm'] / $city['comm_max'], self::t통솔장],
|
||||
|
||||
@@ -135,14 +135,12 @@ class WarUnitGeneral extends WarUnit{
|
||||
if(!$this->isAttacker){
|
||||
$value *= 0.8;
|
||||
}
|
||||
$value = $general->onCalcStat($general, 'experience', $value);
|
||||
$general->increaseVar('experience', $value);
|
||||
$general->addExperience($value);
|
||||
}
|
||||
|
||||
function addDedication(float $value){
|
||||
$general = $this->general;
|
||||
$value = $general->onCalcStat($general, 'dedication', $value);
|
||||
$general->increaseVar('dedication', $value);
|
||||
$general->addDedication($value);
|
||||
}
|
||||
|
||||
function addLose(){
|
||||
|
||||
Reference in New Issue
Block a user