계략에 로그 추가
This commit is contained in:
@@ -2846,6 +2846,8 @@ function SabotageInjury($city, $type=0) {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
$log = [];
|
$log = [];
|
||||||
|
|
||||||
|
$injuryCount = 0;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$admin = $gameStor->getValues(['year', 'month']);
|
||||||
|
|
||||||
$query = "select no,name,nation from general where city='$city'";
|
$query = "select no,name,nation from general where city='$city'";
|
||||||
@@ -2867,8 +2869,11 @@ function SabotageInjury($city, $type=0) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
pushGenLog($general, $log);
|
pushGenLog($general, $log);
|
||||||
|
$injuryCount += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $injuryCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandTurn($term) {
|
function getRandTurn($term) {
|
||||||
|
|||||||
@@ -221,10 +221,10 @@ function process_32(&$general) {
|
|||||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
$destCity['agri'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax);
|
$agriAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['agri']);
|
||||||
$destCity['comm'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax);
|
$commAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['comm']);
|
||||||
if($destCity['agri'] < 0) { $destCity['agri'] = 0; }
|
$destCity['agri'] -= $agriAmount;
|
||||||
if($destCity['comm'] < 0) { $destCity['comm'] = 0; }
|
$destCity['comm'] -= $commAmount;
|
||||||
|
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'state'=>32,
|
'state'=>32,
|
||||||
@@ -232,7 +232,9 @@ function process_32(&$general) {
|
|||||||
'comm'=>$destCity['comm']
|
'comm'=>$destCity['comm']
|
||||||
], 'city=%i', $destCityID);
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
SabotageInjury($destCityID);
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 농업이 <C>{$agriAmount}</>, 상업이 <C>{$commAmount}</>만큼 감소하고, 장수 {$injuryCount}명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
$exp = Util::randRangeInt(201, 300);
|
$exp = Util::randRangeInt(201, 300);
|
||||||
$exp *= getCharExpMultiplier($general['personal']);
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
@@ -525,10 +527,13 @@ function process_34(&$general) {
|
|||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
// 파괴
|
// 파괴
|
||||||
$destCity['def'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax);
|
$defAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['def'] - 100);
|
||||||
$destCity['wall'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax);
|
$wallAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['wall'] - 100);
|
||||||
if($destCity['def'] < 100) { $destCity['def'] = 100; }
|
if($defAmount < 0){ $defAmount = 0; }
|
||||||
if($destCity['wall'] < 100) { $destCity['wall'] = 100; }
|
if($wallAmount < 0){ $wallAmount = 0; }
|
||||||
|
|
||||||
|
$destCity['def'] -= $defAmount;
|
||||||
|
$destCity['wall'] -= $wallAmount;
|
||||||
|
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'state'=>32,
|
'state'=>32,
|
||||||
@@ -536,7 +541,9 @@ function process_34(&$general) {
|
|||||||
'wall'=>$destCity['wall']
|
'wall'=>$destCity['wall']
|
||||||
], 'city=%i', $destCityID);
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
SabotageInjury($destCityID);
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 수비가 <C>{$defAmount}</>, 성벽이 <C>{$wallAmount}</>만큼 감소하고, 장수 {$injuryCount}명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
$exp = Util::randRangeInt(201, 300);
|
$exp = Util::randRangeInt(201, 300);
|
||||||
$exp *= getCharExpMultiplier($general['personal']);
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
@@ -660,10 +667,10 @@ function process_35(&$general) {
|
|||||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
// 선동 최대 10
|
// 선동 최대 10
|
||||||
$destCity['secu'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax);
|
$secuAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['secu']);
|
||||||
$destCity['rate'] -= Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) / 50;
|
$rateAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) / 50, null, $destCity['rate']);
|
||||||
if($destCity['secu'] < 0) { $destCity['secu'] = 0; }
|
$destCity['secu'] -= $secuAmount;
|
||||||
if($destCity['rate'] < 0) { $destCity['rate'] = 0; }
|
$destCity['rate'] -= $rateAmount;
|
||||||
|
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'state'=>32,
|
'state'=>32,
|
||||||
@@ -671,7 +678,9 @@ function process_35(&$general) {
|
|||||||
'rate'=>$destCity['rate']
|
'rate'=>$destCity['rate']
|
||||||
], 'city=%i', $destCityID);
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
SabotageInjury($destCityID);
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 치안이 <C>{$secuAmount}</>, 민심이 <C>{$rateAmount}</>만큼 감소하고, 장수 {$injuryCount}명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
$exp = Util::randRangeInt(201, 300);
|
$exp = Util::randRangeInt(201, 300);
|
||||||
$exp *= getCharExpMultiplier($general['personal']);
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
|||||||
Reference in New Issue
Block a user