"; } function CoreTurnTable() { return " "; } function displayCharInfo(?int $type):string{ $info = getCharInfo($type); $text = getGenChar($type); $templates = new \League\Plates\Engine(__dir__.'/templates'); return $templates->render('tooltip', [ 'text'=>$text, 'info'=>$info, ]); } function displaySpecialInfo(?int $type):string{ $info = getSpecialInfo($type); $text = getGenSpecial($type); $templates = new \League\Plates\Engine(__dir__.'/templates'); return $templates->render('tooltip', [ 'text'=>$text, 'info'=>$info, ]); } function displayItemInfo(?int $type):string{ $info = getItemInfo($type); $text = getItemName($type); $templates = new \League\Plates\Engine(__dir__.'/templates'); return $templates->render('tooltip', [ 'text'=>$text, 'info'=>$info, ]); } function allButton() { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $npcmode = $gameStor->npcmode; if($npcmode == 1) { $site = "a_npcList.php"; $call = "빙의일람"; } else { $site = "a_vote.php"; $call = "설문조사"; } if(\file_exists(__dir__."/d_setting/templates/allButton.php")){ $templates = new \League\Plates\Engine(__dir__.'/d_setting/templates'); } else{ $templates = new \League\Plates\Engine(__dir__.'/templates'); } return $templates->render('allButton', [ 'call' => $call, 'site' => $site ]); } function commandButton() { $session = Session::getInstance(); $userID = Session::getUserID(); if(!$session->isGameLoggedIn()){ return ''; } $db = DB::db(); $me = $db->queryFirstRow("select no,nation,level,belong,permission,penalty from general where owner=%i", $userID); $nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[ 'nation'=>0, 'level'=>0, 'secretlimit'=>99, 'color'=>'#000000' ]; $bgColor = Util::array_get($nation['color'])?:'#000000'; $fgColor = newColor($bgColor); $templates = new \League\Plates\Engine(__dir__.'/templates'); $showSecret = false; $permission = checkSecretPermission($me); if($permission >= 1){ $showSecret = true; } else if($me['level']== 0){ $showSecret = false; } return $templates->render('commandButton', [ 'bgColor'=>$bgColor, 'fgColor'=>$fgColor, 'meLevel'=>$me['level'], 'nationLevel'=>$nation['level'], 'showSecret'=>$showSecret, 'permission'=>$permission, ]); } function formatWounded(int $value, int $wound): string{ if($wound == 0){ return "$value"; } $woundedValue = intdiv($value * (100 - $wound), 100); return "$woundedValue"; } function formatDefenceMode(int $value): string{ switch($value) { case 0: return "×"; break; case 1: return "○"; break; case 2: return "◎"; break; } return '??'; } function formatLeadershipBonus(int $value): string{ if($value == 0){ return ''; } return "+{$value}"; } function formatName(string $name, int $npc): string{ if($npc==1){ $name = "$name"; } else if($npc>1){ $name = "$name"; } return $name; } function getMapHtml(?string $mapTheme=null){ $templates = new \League\Plates\Engine(__dir__.'/templates'); if($mapTheme === null){ $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $mapTheme = $gameStor->map_theme??'che'; } return $templates->render('map', [ 'mapTheme'=>$mapTheme ]); } function getInvitationList(array $nationList){ $templates = new \League\Plates\Engine(__dir__.'/templates'); foreach($nationList as &$nation){ $nation['textColor'] = newColor($nation['color']); } return $templates->render('invitationList', [ 'nationList'=>$nationList ]); }