func_process에서 훈련, 사기 삭제
This commit is contained in:
@@ -399,127 +399,6 @@ function process_11(&$general, $type) {
|
|||||||
$actLog->pushGeneralActionLog($log, ActionLogger::RAWTEXT);
|
$actLog->pushGeneralActionLog($log, ActionLogger::RAWTEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_13(&$general) {
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
$date = substr($general['turntime'],11,5);
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
|
||||||
|
|
||||||
$nation = getNationStaticInfo($general['nation']);
|
|
||||||
|
|
||||||
$lbonus = setLeadershipBonus($general, $nation['level']);
|
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if($general['level'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 훈련 실패. <1>$date</>";
|
|
||||||
} elseif($city['nation'] != $general['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 훈련 실패. <1>$date</>";
|
|
||||||
} elseif($general['crew'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
|
|
||||||
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
// 훈련시
|
|
||||||
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
|
|
||||||
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:훈련치가 <C>$score</> 상승했습니다. <1>$date</>";
|
|
||||||
$exp = 100;
|
|
||||||
$ded = 70;
|
|
||||||
// 숙련도 증가
|
|
||||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 훈련치 변경
|
|
||||||
$score += $general['train'];
|
|
||||||
if($score > GameConst::$maxTrainByCommand) { $score = GameConst::$maxTrainByCommand; }
|
|
||||||
$query = "update general set train='$score' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 사기 약간 감소
|
|
||||||
$score = intval($general['atmos'] * GameConst::$atmosSideEffectByTraining);
|
|
||||||
if($score < 0 ) { $score = 0; }
|
|
||||||
$query = "update general set atmos='$score' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
// 경험치 상승 // 공헌도, 명성 상승
|
|
||||||
$general['leader2']++;
|
|
||||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
$log = uniqueItem($general, $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
pushGenLog($general, $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
function process_14(&$general) {
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
$date = substr($general['turntime'],11,5);
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
|
||||||
|
|
||||||
$nation = getNationStaticInfo($general['nation']);
|
|
||||||
|
|
||||||
$lbonus = setLeadershipBonus($general, $nation['level']);
|
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if($general['level'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 사기진작 실패. <1>$date</>";
|
|
||||||
} elseif($city['nation'] != $general['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 사기진작 실패. <1>$date</>";
|
|
||||||
} elseif($general['crew'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $general['crew']/100) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
|
|
||||||
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
|
||||||
$gold = $general['gold'] - Util::round($general['crew']/100);
|
|
||||||
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:사기치가 <C>$score</> 상승했습니다. <1>$date</>";
|
|
||||||
$exp = 100;
|
|
||||||
$ded = 70;
|
|
||||||
// 숙련도 증가
|
|
||||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 사기치 변경 // 자금 감소 // 경험치 상승 // 공헌도, 명성 상승
|
|
||||||
$score += $general['atmos'];
|
|
||||||
if($score > GameConst::$maxAtmosByCommand) { $score = GameConst::$maxAtmosByCommand; }
|
|
||||||
$general['leader2']++;
|
|
||||||
$query = "update general set resturn='SUCCESS',atmos='$score',gold='$gold',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
$log = uniqueItem($general, $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
pushGenLog($general, $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
function process_15(&$general) {
|
function process_15(&$general) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|||||||
Reference in New Issue
Block a user