# ------------------------- #
# Main Program
# メイン処理
# ------------------------- #
&decode;
&openinpetdata;
&titlecheck;
if ($FORM{'mode'} eq "end") { &error("$endmsg"); }
elsif ($FORM{'mode'} eq "newpet") { &newpet; }
elsif ($FORM{'mode'} eq "nopet") { &nopet; }
elsif ($FORM{'mode'} eq "owner") { &ownerlist; }
elsif ($FORM{'mode'} eq "owner1") { &ownerdisp; }
elsif ($FORM{'mode'} eq "entername") { &petform; }
elsif ($FORM{'mode'} eq "back") { &petform; }
elsif (!$FORM{'mode'}) { &entername; }
else { &action; }
exit;
|
# ------------------------- #
# Sub Pet Form
# ペットフォーム
# ------------------------- #
sub petform {
&checkname;
if (!$petname) { &nopet;exit; }
&header;
&title;
&bodytop("ペットデータ($num代目)");
&petdata;
&condition;
if ($noaction == 0 && $enter != 1) {
print "<tr>\n";
print "<td>\n";
&tabletop;
&input('radio','mode','feed',' checked','餌をあげる<br>');
&input('radio','mode','pat','','なでる<br>');
&input('radio','mode','out','','外に出す');
print "</td>\n";
print "<td>\n";
&input('radio','mode','play','','遊ぶ<br>');
&input('radio','mode','hit','','しかる<br>');
&input('radio','mode','owner','','飼い主ランキング<br>');
&input('radio','mode','owner1','','飼い主個人情報');
print "</td>\n";
print "</tr>\n";
|
# ------------------------- #
# Sub Pet Form
# ペットフォーム
# ------------------------- #
sub petform {
&checkname;
if (!$petname) { &nopet;exit; }
&header;
&title;
&bodytop("ペットデータ($num代目)");
&petdata;
&condition;
if ($noaction == 0 && $enter != 1) {
print "<tr>\n";
print "<td>\n";
# &tabletop;
print "<table width=\"100%\" border=\"0\" cellspacing=\"$f_space\" cellpadding=\"0\">\n";
print "<tr>\n";
print "<td valign=top>\n";
&input('radio','mode','feed',' checked','餌をあげる<br>');
&input('radio','mode','pat','','なでる<br>');
&input('radio','mode','out','','外に出す');
print "</td>\n";
print "<td valign=top>\n";
&input('radio','mode','play','','遊ぶ<br>');
&input('radio','mode','hit','','しかる<br>');
&input('radio','mode','owner','','飼い主ランキング<br>');
&input('radio','mode','owner1','','飼い主個人情報');
print "</td>\n";
print "</tr>\n";
|
&tablebottom;
&bodybottom;
&footer;
}
# ------------------------- #
# Sub Owner Disp
# 飼い主個人情報
# ------------------------- #
sub ownerdisp {
&header;
&title;
$bestlove = $lovenum = $hatenum = $othernum = 0;
&openinuserdata('ownerlist');
&bodytop('飼い主個人情報');
&tabletop;
if ($bestowner eq $ownername) {
$ownerrank = '一番なついている人';
}
print "$ownernameさん<br>";
print "$ownerrank<br>";
print "$ownerloveポイント<br>";
&tablebottom;
&bodybottom;
&footer;
}
# ------------------------- #
# Sub Pet Now
# ペットの現在の状況
# ------------------------- #
sub petnow {
print "<tr>\n";
print "<td align=\"center\">";
|
if ($_[0] eq 'ownerlist') {
if ($love >= $loved) {
@lovelist[$lovenum] = "$name";
$lovenum++;
if ($FORM{'name'} eq $name) {
$ownername = $name;
$ownerrank = 'なついている人';
$ownerlove = $love;
}
if ($bestlove < $love)
{ $bestowner = "$name"; $bestlove = $love; }
} elsif ($love <= $disliked) {
@hatelist[$hatenum] = "$name";
$hatenum++;
if ($FORM{'name'} eq $name) {
$ownername = $name;
$ownerrank = '嫌いな人';
$ownerlove = $love;
}
} else {
@otherlist[$othernum] = "$name";
$othernum++;
if ($FORM{'name'} eq $name) {
$ownername = $name;
$ownerrank = 'それ以外の人';
$ownerlove = $love;
}
}
}
}
}
# ------------------------- #
# Sub Open Out User Data
# ユーザーデータの書きこみ
|