「sea.cgi」の編集履歴(バックアップ)一覧はこちら
「sea.cgi」(2010/09/20 (月) 20:03:34) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
<p>require 'jcode.pl';<br />
require 'setting.cgi'; # セッティングファイル<br />
require 'sys.cgi';<br /><font color="#339966"><br />
requireはファイルの読み込みと考えてください。</font><br /><br /><br />
# 設定ここまで<br /><br />
# ###################################################################<br />
&error("ユーザーディレクトリ名を変更して下さい[setting.cgi]") if $usrdir eq 'userdir';<br />
&decode;<br />
if ($F{'id'} =~ /\W/) { &error('不正な入力です') }<br />
if (!$F{'mode'}) { require 'rank.cgi'; &start_view }<br />
else {<br />
if (($F{'mode'} eq 'trade_sell') || ($F{'mode'} eq
'trade_buy')) { require 'trade.cgi' }<br />
elsif ($F{'mode'} eq 'move') { require 'move.cgi' }<br />
elsif (($F{'mode'} eq 'bar_trade') || ($F{'mode'} eq 'adven'))
{ require 'bar.cgi' }<br />
elsif (($F{'mode'} eq 'rep_ship') || ($F{'mode'} eq 'buy_ship')
|| ($F{'mode'} eq 'sell_ship')) { require 'yard.cgi' } <br />
elsif ($F{'mode'} eq 'battle') { require 'battle.cgi' }<br />
elsif ($F{'mode'} =~ /city/) { require 'city.cgi' }<br />
elsif ($F{'mode'} =~ /ctrade/) { require 'ctrade.cgi' }<br />
elsif ($F{'mode'} =~ /cadmin/) { require 'cadmin.cgi' }<br />
elsif ($F{'mode'} eq 'cbattle_atk') { require 'cbattle.cgi'
}<br />
&{$F{'mode'}} }<br />
exit;<br />
# ###################################################################<br /><font color="#339966"><br />
ここでは例えばtrade_sellの場合、交易の売却を選択した場合、trade.cgiを読み込むという処理をしています。<br />
交易に新しい処理、例えば交易品の発明を追加した場合、選択判定を追加しないと処理されませんので注意してください。</font><br /><br />
# Sub Ships #<br />
sub ships {<br />
if ( $#ship_ind < 0 && $money < 2000 ) {<br />
print qq|<form method=$method
action=$seacgi>船を失い、<br>資金も底をつきました。<br>一から出直しますか?<br>\n|;<br />
print qq|<input type=hidden name=mode value="restart">\n|;<br />
&id_ps;<br />
&submit_button;<br />
print qq|</form>\n|;<br />
return<br />
}<br />
for ($i=0; $i <= 16; $i++){<br />
if(!$ship[$i][0]){ $ship[$i][0] = $damgif; }<br />
}<br />
print <<SHIP_TABLE;<br />
<table border=0 cellspacing=0 cellpadding=0 background="$img/$seaimg"
cols=5><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[11][0]" alt="$ship[11][4](HP$ship[11][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[15][0]" alt="$ship[15][4](HP$ship[15][2])"></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[9][0]" alt="$ship[9][4](HP$ship[9][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[3][0]" alt="$ship[3][4](HP$ship[3][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[7][0]" alt="$ship[7][4](HP$ship[7][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[13][0]" alt="$ship[13][4](HP$ship[13][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[6][0]" alt="$ship[6][4](HP$ship[6][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[2][0]" alt="$ship[2][4](HP$ship[2][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[0][0]" alt="$ship[0][4](HP$ship[0][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[1][0]" alt="$ship[1][4](HP$ship[1][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[5][0]" alt="$ship[5][4](HP$ship[5][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[10][0]" alt="$ship[10][4](HP$ship[10][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[4][0]" alt="$ship[4][4](HP$ship[4][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[8][0]" alt="$ship[8][4](HP$ship[8][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[14][0]" alt="$ship[14][4](HP$ship[14][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[12][0]" alt="$ship[12][4](HP$ship[12][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[16][0]" alt="$ship[16][4](HP$ship[16][2])"></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
</tr><br />
</table><br />
SHIP_TABLE<br />
}<br /><br /><font color="#339966">再出発の処理とプレー画面の船の表示設定です。<br />
$img/$ship[11][0]" alt="$ship[11][4](HP$ship[11][2])<br />
は12番目の船の0番目のデータ(画像名)で画像を表示し、12番目の船の5番目のデータ(船の名前)と3番目のデータ(HP)を表示しています。<br />
ここを弄る事で他のデータも表示が可能です。例えば2番目のデータ(積載)を表示等</font></p>
<p>sea.cgiの簡単な説明。<br />
間違っていたらすみません。<br /><br /><br />
require 'jcode.pl';<br />
require 'setting.cgi'; # セッティングファイル<br />
require 'sys.cgi';<br /><font color="#339966"><br />
requireはファイルの読み込みと考えてください。</font><br /><br /><br />
# 設定ここまで<br /><br />
# ###################################################################<br />
&error("ユーザーディレクトリ名を変更して下さい[setting.cgi]") if $usrdir eq 'userdir';<br />
&decode;<br />
if ($F{'id'} =~ /\W/) { &error('不正な入力です') }<br />
if (!$F{'mode'}) { require 'rank.cgi'; &start_view }<br />
else {<br />
if (($F{'mode'} eq 'trade_sell') || ($F{'mode'} eq
'trade_buy')) { require 'trade.cgi' }<br />
elsif ($F{'mode'} eq 'move') { require 'move.cgi' }<br />
elsif (($F{'mode'} eq 'bar_trade') || ($F{'mode'} eq 'adven'))
{ require 'bar.cgi' }<br />
elsif (($F{'mode'} eq 'rep_ship') || ($F{'mode'} eq 'buy_ship')
|| ($F{'mode'} eq 'sell_ship')) { require 'yard.cgi' } <br />
elsif ($F{'mode'} eq 'battle') { require 'battle.cgi' }<br />
elsif ($F{'mode'} =~ /city/) { require 'city.cgi' }<br />
elsif ($F{'mode'} =~ /ctrade/) { require 'ctrade.cgi' }<br />
elsif ($F{'mode'} =~ /cadmin/) { require 'cadmin.cgi' }<br />
elsif ($F{'mode'} eq 'cbattle_atk') { require 'cbattle.cgi'
}<br />
&{$F{'mode'}} }<br />
exit;<br />
# ###################################################################<br /><font color="#339966"><br />
ここでは例えばtrade_sellの場合、交易の売却を選択した場合、trade.cgiを読み込むという処理をしています。<br />
交易に新しい処理、例えば交易品の発明を追加した場合、選択判定を追加しないと処理されませんので注意してください。</font><br /><br />
# Sub Ships #<br />
sub ships {<br />
if ( $#ship_ind < 0 && $money < 2000 ) {<br />
print qq|<form method=$method
action=$seacgi>船を失い、<br>資金も底をつきました。<br>一から出直しますか?<br>\n|;<br />
print qq|<input type=hidden name=mode value="restart">\n|;<br />
&id_ps;<br />
&submit_button;<br />
print qq|</form>\n|;<br />
return<br />
}<br />
for ($i=0; $i <= 16; $i++){<br />
if(!$ship[$i][0]){ $ship[$i][0] = $damgif; }<br />
}<br />
print <<SHIP_TABLE;<br />
<table border=0 cellspacing=0 cellpadding=0 background="$img/$seaimg"
cols=5><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[11][0]" alt="$ship[11][4](HP$ship[11][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[15][0]" alt="$ship[15][4](HP$ship[15][2])"></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[9][0]" alt="$ship[9][4](HP$ship[9][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[3][0]" alt="$ship[3][4](HP$ship[3][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[7][0]" alt="$ship[7][4](HP$ship[7][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[13][0]" alt="$ship[13][4](HP$ship[13][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[6][0]" alt="$ship[6][4](HP$ship[6][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[2][0]" alt="$ship[2][4](HP$ship[2][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[0][0]" alt="$ship[0][4](HP$ship[0][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[1][0]" alt="$ship[1][4](HP$ship[1][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[5][0]" alt="$ship[5][4](HP$ship[5][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[10][0]" alt="$ship[10][4](HP$ship[10][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[4][0]" alt="$ship[4][4](HP$ship[4][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[8][0]" alt="$ship[8][4](HP$ship[8][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[14][0]" alt="$ship[14][4](HP$ship[14][2])"></td><br />
</tr><br />
<tr><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[12][0]" alt="$ship[12][4](HP$ship[12][2])"></td><br />
<td height=40 width=40 align=center valign=center><img
src="$img/$ship[16][0]" alt="$ship[16][4](HP$ship[16][2])"></td><br />
<td height=40 width=40 align=center
valign=center><br></td><br />
</tr><br />
</table><br />
SHIP_TABLE<br />
}<br /><br /><font color="#339966">再出発の処理とプレー画面の船の表示設定です。<br />
$img/$ship[11][0]" alt="$ship[11][4](HP$ship[11][2])<br />
は12番目の船の0番目のデータ(画像名)で画像を表示し、12番目の船の5番目のデータ(船の名前)と3番目のデータ(HP)を表示しています。<br />
ここを弄る事で他のデータも表示が可能です。例えば2番目のデータ(積載)を表示等</font></p>