나머지 조사 변경

This commit is contained in:
2018-06-01 02:49:21 +09:00
parent beb501354d
commit 663c24b31f
7 changed files with 75 additions and 42 deletions
+2 -1
View File
@@ -2429,7 +2429,8 @@ function deleteNation($general) {
$nation = getNationStaticInfo($general['nation']);
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【멸망】</b></><D><b>{$nation['name']}</b></>은(는) <R>멸망</>했습니다.";
$josaUn = JosaUtil::pick($nation['name'], '은');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【멸망】</b></><D><b>{$nation['name']}</b></>{$josaUn} <R>멸망</>했습니다.";
// 전 장수 재야로 // 전 장수 소속 무소속으로
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
+14 -8
View File
@@ -519,7 +519,8 @@ group by A.nation
$name2 = $nation2['name'];
$josaYi = JosaUtil::pick($name2, '이');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【개전】</b></><D><b>$name1</b></>(와)과 <D><b>$name2</b></>{$josaYi} <R>전쟁</>을 시작합니다.";
$josaWa = JosaUtil::pick($name1, '와');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【개전】</b></><D><b>$name1</b></>{$josaWa}과 <D><b>$name2</b></>{$josaYi} <R>전쟁</>을 시작합니다.";
}
//휴전국 로그
$query = "select A.me as me,A.you as you,A.term as term1,B.term as term2 from diplomacy A, diplomacy B where A.me=B.you and A.you=B.me and A.state='0' and A.me<A.you";
@@ -535,8 +536,9 @@ group by A.nation
$nation2 = getNationStaticInfo($dip['you']);
$name2 = $nation2['name'];
$josaWa = JosaUtil::pick($name1, '와');
$josaYi = JosaUtil::pick($name2, '이');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【휴전】</b></><D><b>$name1</b></>(와)과 <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.";
//기한 되면 휴전으로
$query = "update diplomacy set state='2',term='0' where (me='{$dip['me']}' and you='{$dip['you']}') or (me='{$dip['you']}' and you='{$dip['me']}')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -659,26 +661,29 @@ function checkMerge() {
$query = "select no,name,nation from general where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$genlog = ["<C>●</><D><b>{$mynation['name']}</b></>(와)과 통합에 성공했습니다."];
$josaWa = JosaUtil::pick($mynation['name'], '와');
$genlog = ["<C>●</><D><b>{$mynation['name']}</b></>{$josaWa} 통합에 성공했습니다."];
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result);
pushGenLog($gen, $genlog);
pushGeneralHistory($gen, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></> <D><b>{$you['makenation']}</b></>로 통합에 성공");
pushGeneralHistory($gen, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaWa} <D><b>{$you['makenation']}</b></>로 통합에 성공");
}
//항복국 장수들 역사 기록 및 로그 전달
$query = "select no,name,nation from general where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount2 = MYDB_num_rows($result);
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 통합에 성공했습니다.";
$josaWa = JosaUtil::pick($younation['name'], '와');
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>{$josaWa} 통합에 성공했습니다.";
for($i=0; $i < $gencount2; $i++) {
$gen = MYDB_fetch_array($result);
pushGenLog($gen, $genlog);
pushGeneralHistory($gen, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></> <D><b>{$you['makenation']}</b></>로 통합에 성공");
pushGeneralHistory($gen, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>{$josaWa} <D><b>{$you['makenation']}</b></>로 통합에 성공");
}
$josaRo = JosaUtil::pick($you['makenation'], '로');
$josaYi = JosaUtil::pick($younation['name'], '이');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통합】</b></><D><b>{$mynation['name']}</b></>(와)과 <D><b>{$younation['name']}</b></>{$josaYi} <D><b>{$you['makenation']}</b></>{$josaRo} 통합하였습니다.";
$josaWa = JosaUtil::pick($mynation['name'], '와');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통합】</b></><D><b>{$mynation['name']}</b></>{$josaWa} <D><b>{$younation['name']}</b></>{$josaYi} <D><b>{$you['makenation']}</b></>{$josaRo} 통합하였습니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>【혼란】</b></>통합에 반대하는 세력들로 인해 <D><b>{$you['makenation']}</b></>에 혼란이 일고 있습니다.";
pushNationHistory($younation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>과 <D><b>{$you['makenation']}</b></>로 통합");
@@ -800,9 +805,10 @@ function checkSurrender() {
}
$josaYi = JosaUtil::pick($mynation['name'], '이');
$josaWa = JosaUtil::pick($mynation['name'], '와');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【투항】</b></><D><b>{$mynation['name']}</b></>{$josaYi} <D><b>{$younation['name']}</b></>{$josaRo} 항복하였습니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>【혼란】</b></>통합에 반대하는 세력들로 인해 <D><b>{$younation['name']}</b></>에 혼란이 일고 있습니다.";
pushNationHistory($younation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 합병");
pushNationHistory($younation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaWa} 합병");
$newGenCount = $gencount + $gencount2;
if($newGenCount < 10) { $newGenCount = 10; }
+12 -8
View File
@@ -108,6 +108,7 @@ function process_25(&$general) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
$josaUn = JosaUtil::pick($nation['name'], '은');
if(!$nation) {
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
} elseif($general['nation'] != 0) {
@@ -115,11 +116,11 @@ function process_25(&$general) {
} elseif($nation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:없는 국가입니다. 임관 실패. <1>$date</>";
} elseif($nation['level'] == 0 && $gencount >= 10) {
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 제한되고 있습니다. 임관 실패.";
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
} elseif($admin['year'] < $admin['startyear']+3 && $gencount >= 10) {
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 제한되고 있습니다. 임관 실패.";
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
} elseif($nation['scout'] == 1 && $general['npc'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 금지되어 있습니다. 임관 실패.";
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 금지되어 있습니다. 임관 실패.";
} elseif($general['makelimit'] > 0 && $general['npc'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:재야가 된지 12턴이 지나야 합니다. 임관 실패. <1>$date</>";
} elseif(strpos($general['nations'], ",{$nation['nation']},") > 0) {
@@ -196,12 +197,13 @@ function process_29(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$josaUn = JosaUtil::pick($nation['name'], '은');
if($general['level'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 인재탐색 실패. <1>$date</>";
} elseif($nation['level'] <= 0) {
$log[] = "<C>●</>{$admin['month']}월:방랑군입니다. 인재탐색 실패. <1>$date</>";
} elseif($admin['year'] < $admin['startyear']+3 && $nation['gennum'] >= 10) {
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 탐색이 제한되고 있습니다. 인재탐색 실패.";
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 탐색이 제한되고 있습니다. 인재탐색 실패.";
} elseif($general['gold'] < $admin['develcost']) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 인재탐색 실패. <1>$date</>";
} else {
@@ -264,9 +266,10 @@ function process_29(&$general) {
}
$josaYi = JosaUtil::pick($general['name'], '이');
$log[] = "<C>●</>{$admin['month']}월:<Y>$name</>(이)라는 <C>인재</>를 {$scoutType}하였습니다! <1>$date</>";
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>$name</>(이)라는 <C>인재</>를 {$scoutType}하였습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>$name</>(이)라는 <C>인재</>를 {$scoutType}");
$josaRa = JosaUtil::pick($name, '라');
$log[] = "<C>●</>{$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다! <1>$date</>";
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}");
$query = "select max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -675,7 +678,8 @@ function process_47(&$general) {
$josaUl = JosaUtil::pick($nation['name'], '을');
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaUl} 버리고 방랑");
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【방랑】</b></><D><b>{$general['name']}</b></>은(는) <R>방랑</>의 길을 떠납니다.";
$josaUn = JosaUtil::pick($general['name'], '은');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【방랑】</b></><D><b>{$general['name']}</b></>{$josaUn} <R>방랑</>의 길을 떠납니다.";
//분쟁기록 모두 지움
DeleteConflict($general['nation']);
+3 -2
View File
@@ -239,13 +239,14 @@ $me = [
$log = [];
$mylog = [];
$josaRa = JosaUtil::pick($name, '라');
if ($genius) {
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
pushWorldHistory(["<C>●</>{$gameStor->year}{$gameStor->month}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $gameStor->year, $gameStor->month);
} else {
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 호걸이 천하에 이름을 알립니다.";
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.";
}
pushGeneralHistory($me, "<C>●</>{$gameStor->year}{$gameStor->month}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
$mylog[] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
+2 -1
View File
@@ -548,7 +548,8 @@ function processWar($general, $city) {
} else {
$oppose = MYDB_fetch_array($result);
$josaYi = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(와)과 <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 대결합니다.";
$josaWa = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '와');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaWa} <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 대결합니다.";
$josaUl = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '을');
$josaRo = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '로');
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."{$josaRo} <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaUl} <M>공격</>합니다.";
+41 -22
View File
@@ -93,8 +93,10 @@ class DiplomaticMessage extends Message{
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>{$josa} <C>$year</>년 불가침에 합의했습니다.";
pushGenLog(['no'=>$this->dest->generalID], $mylog);
pushGenLog(['no'=>$this->src->generalID], $youlog);
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$year}년 불가침 성공");
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$year}년 불가침 수락");
$josaWa = JosaUtil::pick($this->src->nationName, '와');
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} {$year}년 불가침 성공");
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} {$year}년 불가침 수락");
return $chk;
}
@@ -142,13 +144,24 @@ class DiplomaticMessage extends Message{
}
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>(와)과 <M>종전 합의</> 하였습니다.";
$josaWa = JosaUtil::pick($this->src->nationName, '와');
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>종전 합의</> 하였습니다.";
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
$history[] = "<C>●</>{$helper->year}{$helper->month}월:<Y><b>【종전】</b></><D><b>{$this->dest->nationName}</b></>{$josaYi} <D><b>{$this->src->nationName}</b></>(와)과 <M>종전 합의</> 하였습니다.";
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 종전에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 종전에 합의했습니다.";
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 종전 성공");
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 종전 수락");
$josaWa = JosaUtil::pick($this->src->nationName, '와');
$history[] = "<C>●</>{$helper->year}{$helper->month}월:<Y><b>【종전】</b></><D><b>{$this->dest->nationName}</b></>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>종전 합의</> 하였습니다.";
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>{$josaWa} 종전에 성공했습니다.";
$josaWa = JosaUtil::pick($this->src->nationName, '와');
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>{$josaWa} 종전에 합의했습니다.";
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} 종전 성공");
$josaWa = JosaUtil::pick($this->src->nationName, '와');
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} 종전 수락");
pushGenLog(['no'=>$this->dest->generalID], $mylog);
pushGenLog(['no'=>$this->src->generalID], $youlog);
@@ -165,31 +178,37 @@ class DiplomaticMessage extends Message{
return $chk;
}
pushGeneralHistory(
['no'=>$this->src->generalID],
["<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 통합 시도"]
);
$josaWa = JosaUtil::pick($this->src->nationName, '와');
pushGeneralHistory(
['no'=>$this->dest->generalID],
["<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 통합 시도"]
["<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} 통합 시도"]
);
pushGenLog(
['no'=>$this->dest->generalID],
["<C>●</><D><b>{$this->src->nationName}</b></>(와)과 통합에 동의했습니다."]
["<C>●</><D><b>{$this->src->nationName}</b></>{$josaWa} 통합에 동의했습니다."]
);
$josaWa = JosaUtil::pick($this->src->nationName, '와');
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
pushGeneralPublicRecord(
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>통합</>에 동의하였습니다."],
$helper->year,
$helper->month);
$josaYi = JosaUtil::pick($this->src->generalName, '이');
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
pushGeneralHistory(
['no'=>$this->src->generalID],
["<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} 통합 시도"]
);
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
pushGenLog(
['no'=>$this->src->generalID],
["<C>●</><D><b>{$this->dest->nationName}</b></>{$josaYi} 통합에 동의했습니다."]
);
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
pushGeneralPublicRecord(
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>(와)과 <M>통합</>에 동의하였습니다."],
$helper->year,
$helper->month);
$josaYi = JosaUtil::pick($this->src->generalName, '이');
pushWorldHistory(
["<C>●</>{$helper->year}{$helper->month}월:<Y><b>【통합시도】</b></><D><b>{$this->dest->nationName}</b></>(와)과 <D><b>{$this->src->nationName}</b></>{$josaYi} 통합을 시도합니다."],
["<C>●</>{$helper->year}{$helper->month}월:<Y><b>【통합시도】</b></><D><b>{$this->dest->nationName}</b></>{$josaWa}과 <D><b>{$this->src->nationName}</b></>{$josaYi} 통합을 시도합니다."],
$helper->year,
$helper->month
);
@@ -207,7 +226,7 @@ class DiplomaticMessage extends Message{
$josaRo = JosaUtil::pick($this->src->nationName, '로');
pushGeneralHistory(
['no'=>$this->src->generalID],
"<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 투항 제의"
"<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>에게 투항 제의"
);
pushGeneralHistory(
['no'=>$this->dest->generalID],
+1
View File
@@ -44,6 +44,7 @@ class JosaUtil{
"이나"=> "",
""=> "",
"으로"=> "",
"이라"=> "",
];
const JONGSUNG_HANJA = [