#-----------------------------------------------------------#
#  죄와 벌++ 이율배반										#
#  Copyright(C) 2001-2002 by Vivid Studio. BLANK BOARD		#
#  Vivid Studio.[ http://www17.big.or.jp/~obochan/vivid/ ]	#
#  BLANK BOARD [ http://pom.to/ ]							#
#-----------------------------------------------------------#
# PC용 서브루틴	Version 1.1								#
#--- [주의사항] --------------------------------------------#
# 1.이 스크립트는 이하의 이용규정에 따라 배포되고 있습니다.	#
#   http://www24.big.or.jp/~obo/game/ore_/gild/				#
#-----------------------------------------------------------#

#-------------------------------------------------------------------------------
# 화면 레이아웃
sub html{

	# 헤더 & 압축 전송 유무
	&content_type;

	# 마우스 자동 조작 치트 격퇴 전투 시에 4/400 확률로 발동
	my $no_mouse = ($no_mouse && $type eq '수행중') ? int(rand(400)) : 100 ;

	# 활성화된 이미지 결정 (동적 이미지 매핑)
	my $menu_img = "lobby.png";
	if ($type eq '수행' || $type eq '수행중' || $cmd == 1) { $menu_img = "training.png"; }
	elsif ($type eq '내정' || $cmd == 2) { $menu_img = "politics.png"; }
	elsif ($type eq '전쟁' || $type eq '전쟁중' || $cmd == 3) { $menu_img = "war.png"; }
	elsif ($type eq '능력' || $cmd == 4) { $menu_img = "ability.png"; }
	elsif ($type eq '사관' || $cmd == 5) { $menu_img = "changes.png"; }
	elsif ($type eq '정보' || $cmd == 6) { $menu_img = "infomation.png"; }
	elsif ($type eq '토벌' || $type eq '토벌 중' || $cmd == 7) { $menu_img = "subdue.png"; }
	elsif ($type eq '군사' || $cmd == 8) { $menu_img = "mission.png"; }
	elsif ($type eq '쇼핑' || $cmd == 20) { $menu_img = "shop.png"; }

	print <<EOM;
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>$titleh</title>
<link rel="stylesheet" type="text/css" href="$css">
EOM

# Javascript 자동 조작 치트 방어(frame 방어)
if($no_js){
	print <<EOM;
<script language="javascript">
<!--
	if(self!=top){
		top.location = self.location;
	}
//-->
</script>
EOM
}

	print <<EOM;
</head>
<body>
<div class="game-container">
    <div class="card">
        <div class="title-section">
            <div class="title-images">
                <img src="./imgs/title_text.png">
                <img src="./imgs/title_game.png">
            </div>
        </div>
        
        <!-- 하위 메뉴 맞춤형 동적 이미지 영역 -->
        <img class="menu-illustration" src="./imgs/$menu_img" alt="Menu Illustration">
    </div>

    <div class="game-layout">
        <!-- 메인 콘텐츠 영역 (로그 및 행동 폼) -->
        <main class="card">
            $log1
        </main>
        
        <!-- 사이드바 네비게이션 메뉴 -->
        <aside class="card">
            <div class="card-title">네비게이션</div>
EOM

	# 사이드바 버튼 출력
	print <<EOM;
            <form method="get" action="$index">
                <input type="submit" value="† 타이틀로 돌아가기 †" class="button1">
            </form>
EOM

	if($no_mouse==0){
		# $log2 는 수행 등 커맨드 폼의 셀렉트 및 NEXT 버튼
		print $log2;
	}

	print <<EOM;
            <form method="$method" action="$park">
                <input type="hidden" name="id" value="$id">
                <input type="hidden" name="pw" value="$pw">
                <input type="hidden" name="camp" value="$camp">
                <input type="hidden" name="sogo" value="$sogo">
                <input type="submit" value="† 국제 교류 광장 †" class="button1">
            </form>
EOM

	if($no_mouse==1){
		print $log2;
	}

	print <<EOM;
            <form method="$method" action="$hist">
                <input type="hidden" name="id" value="$id">
                <input type="hidden" name="pw" value="$pw">
                <input type="submit" value="†   과거의 영광   †" class="button1">
            </form>
EOM

	if(!$type && $cmd<=0){
		print <<EOM;
            <form method="$method" action="$script">
                <input type="hidden" name="id" value="$id">
                <input type="hidden" name="pw" value="$pw">
                <input type="hidden" name="cmd" value="20">
                <input type="submit" value="†  쇼핑몰  †" class="button1">
            </form>
EOM
	}

	print <<EOM;
            <form method="$method" action="$public">
                <input type="hidden" name="id" value="$id">
                <input type="hidden" name="pw" value="$pw">
                <input type="submit" value="†     공식 조약     †" class="button1">
            </form>
EOM

	if($no_mouse==2){
		print $log2;
	}

	print <<EOM;
            <form method="$method" action="$campbbs">
                <input type="hidden" name="id" value="$id">
                <input type="hidden" name="pw" value="$pw">
                <input type="submit" value="† 국가별 작전 회의실 †" class="button1">
            </form>
EOM

	if($no_mouse>=3){
		print $log2;
	}

	print <<EOM;
        </aside>
    </div>
EOM

	my($uti, $sti, $cuti, $csti) = times();
	$uti += $cuti;
	$sti += $csti;
	my($cpu) = $uti + $sti;
	my $disp="<div class='moji2'>CPUs($cpu): User($uti) System($sti)</div>";

	if($layout_flag==1){
		print <<EOM;
</tr>
</table>
<br><br>
EOM
	}elsif(!$layout_flag){
		require './inc/ore_sub-base-p1_pc.cgi';&layout_flag_0;
	}

	print <<"EOM";
$disp<br>
<br>
$kakiko
EOM

}

#-------------------------------------------------------------------------------
#스태터스 표시
sub status{

	&settei;#설정 읽기

	my(
		$hp_v,$hp_c,$hp_y,
		$mp_v,$mp_c,$mp_y,
		$ua_v,$ua_c,
		$ud_v,$ud_c,
		$lr_v,$lr_c,
	);

	#HP 그래프
	if($max_hp <= 75){
		$hp_v = $hp*2;
		$hp_c = "#00bbff";
		$hp_y = $max_hp*2-$hp*2;
	}elsif($max_hp <= 300){
		$hp_v = $hp;
		$hp_c = "#0099ff";
		$hp_y = $max_hp-$hp;
	}elsif($max_hp <= 600){ 
		$hp_v = int($hp/2);
		$hp_c = "#0077ff";
		$hp_y = int($max_hp/2-$hp/2);
	}elsif($max_hp <= 1200){
		$hp_v = int($hp/4);
		$hp_c = "#0055ff";
		$hp_y = int($max_hp/4-$hp/4);
	}elsif($max_hp <= 2400){
		$hp_v = int($hp/8);
		$hp_c = "#0033ff";
		$hp_y = int($max_hp/8-$hp/8);
	}elsif($max_hp <= 4800){
		$hp_v = int($hp/16);
		$hp_c = "#0011ff";
		$hp_y = int($max_hp/16-$hp/16);
	}else{
		$hp_v = int($hp/32);
		$hp_c = "#0011ff";
		$hp_y = int($max_hp/32-$hp/32);
	}
	#MP 그래프
	if($max_mp <= 75){
		$mp_v = $mp*2;
		$mp_c = "#00ffcc";
		$mp_y = $max_mp*2-$mp*2;
	}elsif($max_mp <= 300){
		$mp_v = $mp;
		$mp_c = "#00ddcc";
		$mp_y = $max_mp-$mp;
	}elsif($max_mp <= 600){ 
		$mp_v = int($mp/2);
		$mp_c = "#00bbcc";
		$mp_y = int($max_mp/2-$mp/2);
	}elsif($max_mp <= 1200){
		$mp_v = int($mp/4);
		$mp_c = "#0099cc";
		$mp_y = int($max_mp/4-$mp/4);
	}elsif($max_mp <= 2400){
		$mp_v = int($mp/8);
		$mp_c = "#0077cc";
		$mp_y = int($max_mp/8-$mp/8);
	}elsif($max_mp <= 4800){
		$mp_v = int($mp/16);
		$mp_c = "#0055cc";
		$mp_y = int($max_mp/16-$mp/16);
	}else{
		$mp_v = int($mp/32);
		$mp_c = "#0033cc";
		$mp_y = int($max_mp/32-$mp/32);
	}
	#UA 그래프
	if($ua <= 25){
		$ua_v = $ua*4;
		$ua_c = "#99ccff";
	}elsif($ua <= 50){
		$ua_v = $ua*2;
		$ua_c = "#9999ff";
	}elsif($ua <= 100){ 
		$ua_v = $ua;
		$ua_c = "#9966ff";
	}elsif($ua <= 500){ 
		$ua_v = int($ua/2);
		$ua_c = "#9933ff";
	}else{ 
		$ua_v = int($ua/4);
		$ua_c = "#9900ff";
	}
	#UD 그래프
	if($ud <= 25){
		$ud_v = $ud*4;
		$ud_c = "#33ffff";
	}elsif($ud <= 50){
		$ud_v = $ud*2;
		$ud_c = "#33ccff";
	}elsif($ud <= 100){ 
		$ud_v = $ud;
		$ud_c = "#3399ff";
	}elsif($ud <= 500){ 
		$ud_v = int($ud/2);
		$ud_c = "#3366ff";
	}else{ 
		$ud_v = int($ud/4);
		$ud_c = "#3333ff";
	}
	#LR 그래프
	if($lr <= 25){
		$lr_v = $lr*4;
		$lr_c = "#ccccff";
	}elsif($lr <= 50){
		$lr_v = $lr*2;
		$lr_c = "#cc99ff";
	}elsif($lr <= 100){ 
		$lr_v = $lr;
		$lr_c = "#cc66ff";
	}elsif($lr <= 500){ 
		$lr_v = int($lr/2);
		$lr_c = "#cc33ff";
	}else{ 
		$lr_v = int($lr/4);
		$lr_c = "#cc00ff";
	}
	#AG 그래프
	if($ag <= 25){
		$ag_v = $ag*4;
		$ag_c = "#ccccff";
	}elsif($ag <= 50){
		$ag_v = $ag*2;
		$ag_c = "#cc99ff";
	}elsif($ag <= 100){ 
		$ag_v = $ag;
		$ag_c = "#cc66ff";
	}elsif($ag <= 500){ 
		$ag_v = int($ag/2);
		$ag_c = "#cc33ff";
	}else{ 
		$ag_v = int($ag/4);
		$ag_c = "#cc00ff";
	}

	$hp_y = (!$hp_y) ? "" : "<img src=\"$imgs/spc.gif\" height=\"8\" width=\"$hp_y\" style=\"background-color:#555555\">";
	$mp_y = (!$mp_y) ? "" : "<img src=\"$imgs/spc.gif\" height=\"8\" width=\"$mp_y\" style=\"background-color:#555555\">";
	$ua_y = (!$dg_a) ? "" : "<img src=\"$imgs/spc.gif\" height=\"8\" width=\"$dg_data[$dg_a][4]\" style=\"background-color:#6666cc\">";
	$ud_y = (!$df_a) ? "" : "<img src=\"$imgs/spc.gif\" height=\"8\" width=\"$df_data[$df_a][4]\" style=\"background-color:#6666cc\">";

	$log1.=<<EOM;
<tt class="moji1">
<b>$nm</b>　　　<span style="font-size:12px">$seibetu[$sei]</span>&nbsp;&nbsp;&nbsp;&nbsp;ID: $id<br>
레벨 <b>$lv</b>　계　급 <b>$cl[$rank]</b>　칭　호 [<b>$sogo_p[$sogo]</b>]<br>
<br>
체　력[HP] <img src="$imgs/spc.gif" height="8" width="$hp_v" style="background-color:$hp_c">$hp_y $hp/$max_hp<br>
마　력[MP] <img src="$imgs/spc.gif" height="8" width="$mp_v" style="background-color:$mp_c">$mp_y $mp/$max_mp<br>
공격력[UA] <img src="$imgs/spc.gif" height="8" width="$ua_v" style="background-color:$ua_c">$ua_y $ua +$dg_data[$dg_a][4]<br>
방어력[UD] <img src="$imgs/spc.gif" height="8" width="$ud_v" style="background-color:$ud_c">$ud_y $ud +$df_data[$df_a][4]<br>
지휘력[LR] <img src="$imgs/spc.gif" height="8" width="$lr_v" style="background-color:$lr_c"> $lr<br>
민첩성[AG] <img src="$imgs/spc.gif" height="8" width="$ag_v" style="background-color:$ag_c"> $ag<br>
<br>
자　금 <b>$gold</b>　경험치 <b>$exe/$next_lv</b>　공헌도 <b>$rank_exe</b><br>
<br>
소　속 <b>$cmp[$camp]</b>　부　대 <b>$g_p[$rank]</b>　훈련도 <b>$sol_lv</b><br>
<br>
무　기 [<b>$dg_data[$dg_a][1]</b>]　횟수 [<b>$dg_cnt</b>]<br>
방　어구 [<b>$df_data[$df_a][1]</b>]　횟수 [<b>$df_cnt</b>]<br>
도　구 [<b>$di_data[$di_a][1]</b>]　횟수 [<b>$di_cnt</b>]
</tt>
EOM

}





1;#삭제 불가
