#---------------------------------------------------------------------- # 箱庭諸島 ver2.30 # トップモジュール(ver1.00) # 使用条件、使用方法等は、hako-readme.txtファイルを参照 # # 箱庭諸島のページ: http://www.bekkoame.ne.jp/~tokuoka/hakoniwa.html #---------------------------------------------------------------------- #---------------------------------------------------------------------- # トップページモード #---------------------------------------------------------------------- # メイン sub topPageMain { # 開放 unlock(); # テンプレート出力 tempTopPage(); } # トップページ sub tempTopPage { my $timestamp = $HislandLastTime + $HunitTime; my ($sec, $min, $hour, $day, $mon, $year) = localtime($timestamp); $year += 1900; $mon += 1; my $nextTurnDate = sprintf("%04d/%02d/%02d %02d:%02d", $year, $mon, $day, $hour, $min); my $turnLength = $HunitTime / 60 / 60; # Calculate time until next turn my $currentTime = time(); my $timeUntilNextTurn = $timestamp - $currentTime; my $hoursUntilNextTurn = int($timeUntilNextTurn / 3600); my $minutesUntilNextTurn = int(($timeUntilNextTurn % 3600) / 60); # タイトル out(< END } my($mStr1) = ''; if($HhideMoneyMode != 0) { $mStr1 = "${HtagTH_}Funds${H_tagTH}"; } # フォーム out(<Next turn: $nextTurnDate (UTC) ($hoursUntilNextTurn hours $minutesUntilNextTurn mins)
Turns are automated to occur once every $turnLength hours.

${HtagHeader_}Go to your island${H_tagHeader}
What is the name of your island?

Password please!!



${HtagHeader_}Island status${H_tagHeader}

Click on the name of an island to take a tour.

$mStr1 END my($island, $j, $farm, $factory, $mountain, $name, $id, $prize, $ii); for($ii = 0; $ii < $HislandNumber; $ii++) { $j = $ii + 1; $island = $Hislands[$ii]; $id = $island->{'id'}; $farm = $island->{'farm'}; $factory = $island->{'factory'}; $mountain = $island->{'mountain'}; $farm = ($farm == 0) ? "None owned" : "${farm}0$HunitPop"; $factory = ($factory == 0) ? "None owned" : "${factory}0$HunitPop"; $mountain = ($mountain == 0) ? "None owned" : "${mountain}0$HunitPop"; if($island->{'absent'} == 0) { $name = "${HtagName_}$island->{'name'} Island${H_tagName}"; } else { $name = "${HtagName2_}$island->{'name'} Island ($island->{'absent'})${H_tagName2}"; } $prize = $island->{'prize'}; my($flags, $monsters, $turns); $prize =~ /([0-9]*),([0-9]*),(.*)/; $flags = $1; $monsters= $2; $turns = $3; $prize = ''; # ターン杯の表示 while($turns =~ s/([0-9]*),//) { $prize .= "\"$1${Hprize[0]}\" "; } # 名前に賞の文字を追加 my($f) = 1; my($i); for($i = 1; $i < 10; $i++) { if($flags & $f) { $prize .= "\"${Hprize[$i]}\" "; } $f *= 2; } # 倒した怪獣リスト $f = 1; my($max) = -1; my($mNameList) = ''; for($i = 0; $i < $HmonsterNumber; $i++) { if($monsters & $f) { $mNameList .= "[$HmonsterName[$i]] "; $max = $i; } $f *= 2; } if($max != -1) { $prize .= "\"$mNameList\" "; } my($mStr1) = ''; if($HhideMoneyMode == 1) { $mStr1 = ""; } elsif($HhideMoneyMode == 2) { my($mTmp) = aboutMoney($island->{'money'}); $mStr1 = ""; } out(< $mStr1 END } out(<
${HtagHeader_}Discover a new island${H_tagHeader} END if($HislandNumber < $HmaxIsland) { out(< What name do you plan to give your island?
Island
And the password?

Just to be sure, enter the password again

END } else { out(< ${HtagHeader_}Change island name and password${H_tagHeader}

(Note) A name change costs $HcostChangeName${HunitMoney}.

Which island?

What would you like to change the name to? (only needed if you are changing the name)
Island
And the password? (required)

What is the new password? (only needed if you are changing the password)

Just to be sure, enter the password again (only needed if you are changing the password)


${HtagHeader_}Recent events${H_tagHeader} END logPrintTop(); out(<) { chomp($l); push(@line, $l); } @line = reverse(@line); foreach $l (@line) { $l =~ /^([0-9]*),(.*)$/; ## out("${HtagNumber_}Turn ${1}${H_tagNumber}: ${2}
\n"); out("${HtagNumber_}Turn ${1}${H_tagNumber}: ${2}
\n"); ## mod } close(HIN); } 1;
${HtagTH_}Rank${H_tagTH} ${HtagTH_}Island${H_tagTH} ${HtagTH_}Population${H_tagTH} ${HtagTH_}Area${H_tagTH}${HtagTH_}Food${H_tagTH} ${HtagTH_}Farms${H_tagTH} ${HtagTH_}Factories${H_tagTH} ${HtagTH_}Mines${H_tagTH}
$island->{'money'}$HunitMoney$mTmp${HtagNumber_}$j${H_tagNumber} $name
$prize
$island->{'pop'}$HunitPop $island->{'area'}$HunitArea$island->{'food'}$HunitFood $farm $factory $mountain
${HtagTH_}Comment: ${H_tagTH}$island->{'comment'}