# 現在の日付取得 ($isec,$imin,$ihour,$iday,$imon,$iyear) = localtime(time); $iyear += 1900; $imon++; |
# 現在の日付取得 ($isec,$imin,$ihour,$iday,$imon,$iyear) = localtime(time); $iyear += 1900; $imon++; # ------------------------- # # Main Program # メイン処理 # ------------------------- # &decode; &openinpetdata; &titlecheck; |
# ------------------------- # # Sub Pet Now # ペットの現在の状況 # ------------------------- # sub petnow { if ($ihour < 6) { # 0:00〜6:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名01'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名02'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名03'; } # 好感度下位 else { $bgimage = '背景画像ファイル名04'; } # 好感度最低 } elsif ($ihour < 12) { # 6:00〜12:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名05'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名06'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名07'; } # 好感度下位 else { $bgimage = '背景画像ファイル名08'; } # 好感度最低 } elsif ($ihour < 18) { # 12:00〜18:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名09'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名10'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名11'; } # 好感度下位 else { $bgimage = '背景画像ファイル名12'; } # 好感度最低 } else { # 18:00〜0:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名13'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名14'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名15'; } # 好感度下位 else { $bgimage = '背景画像ファイル名16'; } # 好感度最低 } print "<tr>\n"; # print "<td align=\"center\" background=\"t_roomd.jpg\" width=\"320\" height=\"240\" valign=\"bottom\">"; print "<td align=\"center\" background=\"$bgimage\" width=\"320\" height=\"240\" valign=\"bottom\">"; print "<img src=\"$img$_[0]\" border=\"0\"></td>\n"; print "</tr>\n"; &bar('',$_[1]); } # ------------------------- # # Sub Pet Now Waku # ペットの現在の状況(吹き出し) # ------------------------- # sub petnowwaku { if ($ihour < 6) { # 0:00〜6:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名01'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名02'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名03'; } # 好感度下位 else { $bgimage = '背景画像ファイル名04'; } # 好感度最低 } elsif ($ihour < 12) { # 6:00〜12:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名05'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名06'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名07'; } # 好感度下位 else { $bgimage = '背景画像ファイル名08'; } # 好感度最低 } elsif ($ihour < 18) { # 12:00〜18:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名09'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名10'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名11'; } # 好感度下位 else { $bgimage = '背景画像ファイル名12'; } # 好感度最低 } else { # 18:00〜0:00 if ($love >= $loved) { $bgimage = '背景画像ファイル名13'; } # 好感度最大 elsif ($love >= $loved_k) { $bgimage = '背景画像ファイル名14'; } # 好感度上位 elsif ($love >= $disliked) { $bgimage = '背景画像ファイル名15'; } # 好感度下位 else { $bgimage = '背景画像ファイル名16'; } # 好感度最低 } print "<tr>\n"; # print "<td align=\"center\" background=\"t_roomd.jpg\" width=\"320\" height=\"240\" valign=\"bottom\">"; print "<td align=\"center\" background=\"$bgimage\" width=\"320\" height=\"240\" valign=\"bottom\">"; print "<img src=\"$img$_[0]\" border=\"0\">\n"; print "</td>"; print "</tr>\n"; &barwaku('',$_[1]); } |
background=\"$bgimage\" を、 background=\"$img$bgimage\" |