season merge

This commit is contained in:
2019-10-04 11:44:03 +09:00
24 changed files with 85 additions and 51 deletions
+11 -1
View File
@@ -98,11 +98,21 @@ foreach($emperiors as $emperior){
<td align=center><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td align=center><?=$emperior['l11name']?></td>
<td id=bg1 align=center> 장 군</td>
<td id=bg1 align=center>표 기 장 군</td>
<td align=center><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td align=center><?=$emperior['l9name']?></td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td align=center><?=$emperior['l8name']?></td>
<td id=bg1 align=center>태 위</td>
<td align=center><?=$emperior['l7name']?></td>
<td id=bg1 align=center>위 장 군</td>
<td align=center><?=$emperior['l6name']?></td>
<td id=bg1 align=center>사 도</td>
<td align=center><?=$emperior['l5name']?></td>
</tr>
</table>
+2
View File
@@ -26,6 +26,8 @@ $scenarioList = (function(){
return $scenarioList;
})();
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
+1
View File
@@ -4,6 +4,7 @@ namespace sammo;
class UniqueConst{
public static $serverID = '_tK_serverID_';
public static $serverName = '_tK_serverName_';
public static $seasonIdx = '_tK_seasonIdx_';
private function __construct(){}
+19 -2
View File
@@ -654,7 +654,24 @@ function generalInfo($no) {
$lbonus = "";
}
$troopName = getTroopName($general['troop'])??'-';
if($general['troop'] == 0){
$troopInfo = '-';
}
else{
$troopCity = $db->queryFirstField('SELECT city FROM general WHERE no=%i', $general['troop']);
$troopTurn = $db->queryFirstField('SELECT `action` FROM general_turn WHERE general_id = %i AND turn_idx = 0', $general['troop']);
$troopInfo = $db->queryFirstField('SELECT name FROM troop WHERE troop_leader = %i', $general['troop']);
$troopInfo = $troop['name'];
if($troopTurn == 'che_집합'){
$troopInfo = "<strike style='color:gray;'>{$troopInfo}</strike>";
}
else if($troopCity != $general['city']){
$troopCityName = CityConst::byID($troopCity)->name;
$troopInfo = "<span style='color:orange;'>{$troopInfo}({$troopCityName})</span>";
}
}
$level = getLevel($general['level'], $nation['level']);
if($general['level'] == 2) {
@@ -796,7 +813,7 @@ function generalInfo($no) {
</tr>
<tr height=20>
<td style='text-align:center;' class='bg1'><b>부대</b></td>
<td style='text-align:center;' colspan=3>{$troopName}</td>
<td style='text-align:center;' colspan=3>{$troopInfo}</td>
<td style='text-align:center;' class='bg1'><b>벌점</b></td>
<td style='text-align:center;' colspan=5>".getConnect($general['connect'])." {$general['connect']}({$general['con']})</td>
</tr>
+1 -1
View File
@@ -43,7 +43,7 @@ foreach(range(1, GameConst::$maxChiefTurn - 1) as $turnIdx){
$turnText = join("\n", $turnList);
return "
<select id='chiefTurnSelector' name=turn[] size=3 multiple>
<select id='chiefTurnSelector' name=turn[] size=6 multiple>
{$turnText}
</select>
";
+4 -2
View File
@@ -79,11 +79,13 @@ if ($gameStor->npcmode == 0) {
}
$color = "cyan";
$mapTheme = $gameStor->map_theme;
$serverName = UniqueConst::$serverName;
$serverCnt = $gameStor->server_cnt;
?>
<!DOCTYPE html>
<html>
<head>
<title><?=UniqueConst::$serverName?>: 메인</title>
<title><?=$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
@@ -129,7 +131,7 @@ $(function(){
<div><?=allButton()?></div>
<table class="tb_layout bg0" style="width:1000px;">
<tr height=50>
<td colspan=5 align=center><font size=4>삼국지 모의전투 HiDCHe (<font color=cyan><?=$scenario?></font>)</font></td>
<td colspan=5 id="server_title" align=center><font size=4>삼국지 모의전투 HiDCHe <?=$serverName.$serverCnt?>기 (<font color=cyan><?=$scenario?></font>)</font></td>
</tr>
<?php if ($valid == 1): ?>
<tr height=30>
+1 -1
View File
@@ -32,7 +32,7 @@ $nationID = $me['nation'];
if($isAmbassador){
$targetType = 'ambassador';
$targetLevel = 4;
if(count($genlist) > 2){
if($genlist && count($genlist) > 2){
Json::die([
'result'=>false,
'reason'=>'외교권자는 최대 둘까지만 설정 가능합니다.'
+1 -1
View File
@@ -73,7 +73,7 @@ foreach($rawGeneralList as $rawGeneral){
getGeneralSpecialWarName($special2),
getGenChar($personal),
$name,
$name2,
$npc==1?$name2:null,
$injury,
$leader,
$lbonus,
+1
View File
@@ -223,6 +223,7 @@ $affinity = rand()%150 + 1;
$db->insert('general', [
'owner' => $userID,
'name' => $name,
'name2' => $member['name'],
'picture' => $face,
'imgsvr' => $imgsvr,
'nation' => 0,
@@ -7,13 +7,13 @@ class che_사기_의적주 extends \sammo\BaseItem{
protected static $id = 15;
protected static $name = '두강주(사기)';
protected static $info = '[전투] 사기 보정 +5';
protected static $info = '[전투] 사기 보정 +10';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 5;
return $value + 10;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_사기_보령압주 extends \sammo\BaseItem{
protected static $id = 16;
protected static $name = '보령압주(사기)';
protected static $info = '[전투] 사기 보정 +5';
protected static $info = '[전투] 사기 보정 +10';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 5;
return $value + 10;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_사기_의적주 extends \sammo\BaseItem{
protected static $id = 14;
protected static $name = '의적주(사기)';
protected static $info = '[전투] 사기 보정 +5';
protected static $info = '[전투] 사기 보정 +10';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 5;
return $value + 10;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_사기_초선화 extends \sammo\BaseItem{
protected static $id = 20;
protected static $name = '초선화(사기)';
protected static $info = '[전투] 사기 보정 +7';
protected static $info = '[전투] 사기 보정 +14';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 7;
return $value + 14;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_사기_춘화첩 extends \sammo\BaseItem{
protected static $id = 19;
protected static $name = '춘화첩(사기)';
protected static $info = '[전투] 사기 보정 +7';
protected static $info = '[전투] 사기 보정 +14';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusAtmos'){
return $value + 7;
return $value + 14;
}
return $value;
}
+2 -2
View File
@@ -8,7 +8,7 @@ class che_사기_탁주 extends \sammo\BaseItem{
protected static $id = 3;
protected static $name = '탁주(사기)';
protected static $info = '[전투] 사기 +3. 1회용';
protected static $info = '[전투] 사기 +6. 1회용';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
@@ -16,7 +16,7 @@ class che_사기_탁주 extends \sammo\BaseItem{
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 3)
new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 6)
);
}
}
@@ -7,13 +7,13 @@ class che_훈련_과실주 extends \sammo\BaseItem{
protected static $id = 12;
protected static $name = '과실주(훈련)';
protected static $info = '[전투] 훈련 보정 +5';
protected static $info = '[전투] 훈련 보정 +10';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 5;
return $value + 10;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_훈련_단결도 extends \sammo\BaseItem{
protected static $id = 18;
protected static $name = '단결도(훈련)';
protected static $info = '[전투] 훈련 보정 +7';
protected static $info = '[전투] 훈련 보정 +14';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 7;
return $value + 14;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_훈련_이강주 extends \sammo\BaseItem{
protected static $id = 13;
protected static $name = '이강주(훈련)';
protected static $info = '[전투] 훈련 보정 +5';
protected static $info = '[전투] 훈련 보정 +10';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 5;
return $value + 10;
}
return $value;
}
@@ -7,13 +7,13 @@ class che_훈련_철벽서 extends \sammo\BaseItem{
protected static $id = 17;
protected static $name = '철벽서(훈련)';
protected static $info = '[전투] 훈련 보정 +7';
protected static $info = '[전투] 훈련 보정 +14';
protected static $cost = 200;
protected static $consumable = false;
public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'bonusTrain'){
return $value + 7;
return $value + 14;
}
return $value;
}
+2 -2
View File
@@ -8,7 +8,7 @@ class che_훈련_청주 extends \sammo\BaseItem{
protected static $id = 4;
protected static $name = '청주(훈련)';
protected static $info = '[전투] 훈련 +3. 1회용';
protected static $info = '[전투] 훈련 +6. 1회용';
protected static $cost = 1000;
protected static $consumable = true;
protected static $buyable = true;
@@ -16,7 +16,7 @@ class che_훈련_청주 extends \sammo\BaseItem{
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 3)
new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 6)
);
}
}
+2 -2
View File
@@ -277,7 +277,7 @@ class General implements iAction{
$db->delete('troop', 'troop_leader=%i', $troopLeaderID);
}
$dyingMessage = new TextDecoration\DyingMessage($this->getName(), $this->getVar('npc'));
$dyingMessage = new TextDecoration\DyingMessage($this);
$logger->pushGlobalActionLog($dyingMessage->getText());
$db->delete('general', 'no=%i', $generalID);
@@ -563,7 +563,7 @@ class General implements iAction{
'no', 'name', 'name2', 'picture', 'imgsvr', 'nation', 'nations', 'city', 'troop', 'injury', 'affinity',
'leader', 'leader2', 'power', 'power2', 'intel', 'intel2', 'weap', 'book', 'horse', 'item',
'experience', 'dedication', 'level', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime',
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'belong',
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong',
'personal', 'special', 'special2', 'mode', 'npc', 'npc_org', 'deadyear', 'npcmsg',
'dex0', 'dex10', 'dex20', 'dex30', 'dex40',
'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew', 'recwar', 'last_turn', 'myset'
+3 -1
View File
@@ -96,7 +96,7 @@ class ResetHelper{
$servRoot.'/d_setting/UniqueConst.php',[
'serverID'=>$serverID,
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
'seasonIdx'=>$seasonIdx
'seasonIdx'=>$seasonIdx,
], true
);
@@ -235,6 +235,7 @@ class ResetHelper{
'init_year'=> $year,
'init_month'=>$month,
'map_theme' => $scenarioObj->getMapTheme(),
'season'=>$seasonIdx,
'msg'=>'공지사항',//TODO:공지사항
'maxgeneral'=>GameConst::$defaultMaxGeneral,
'maxnation'=>GameConst::$defaultMaxNation,
@@ -256,6 +257,7 @@ class ResetHelper{
'tnmt_trig'=>$tournament_trig,
'prev_winner'=>$prevWinner,
'tournament'=>0,
'server_cnt'=>$db->queryFirstField('SELECT count(*) FROM ng_games')
];
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
+14 -18
View File
@@ -7,6 +7,7 @@ use \sammo\JosaUtil;
class DyingMessage{
private $name;
private $realName;
private $npc;
static protected $defaultMessage = '<Y>:name:</>:이: <R>사망</>했습니다.';
@@ -88,31 +89,21 @@ class DyingMessage{
static::$utilNPCMessages = static::getUtilNPCMessageList();
}
protected function _constructWithObj(General $general){
$this->name = $general->getName();
$this->npc = $general->getVar('npc');
}
protected function _constructWithRawValue(string $name, int $npc){
$this->name = $name;
$this->npc = $npc;
}
function __construct($name, ?int $npc = null)
function __construct(General $general)
{
if(static::$messages === null){
static::initMessageList();
}
if($name instanceof General){
$this->_constructWithObj($name);
}
else{
$this->_constructWithRawValue($name, $npc);
$this->general = $general;
$this->name = $general->getName();
$this->npc = $general->getVar('npc');
if($general['owner'] > 0 && $general->getVar('startage') - $general->getVar('age') > 1){
$this->realName = $general->getVar('name2');
}
}
public function getText():string{
$name = $this->name ;
$name = $this->name;
$npc = $this->npc;
if($npc == 0){
@@ -128,7 +119,12 @@ class DyingMessage{
$text = static::$defaultMessage;
}
$text = str_replace(':name:', $name, $text);
if($this->realName){
$text = str_replace(':name:', $name."({$this->realName})", $text);
}
else{
$text = str_replace(':name:', $name, $text);
}
JosaUtil::batch($text, $name);
return $text;
+3
View File
@@ -154,6 +154,9 @@ class WebUtil
}
$config = \HTMLPurifier_HTML5Config::createDefault();
$config->set('Filter.Custom', array (new \HTMLPurifier_Filter_YouTube()));
$config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vime
$def = $config->getHTMLDefinition();
$def->info_global_attr['data-flip'] = new \HTMLPurifier_AttrDef_Text;
$purifier = new \HTMLPurifier($config);