sub cdata_open{ .... ( 省略 ) .... # 友好度 ---------------------------------------------ここから for ($self=1; $self<6;$self++){ for ($other=1; $other<6;$other++){ $cfs[$self.$other] = $CP{'cfs'.$self.$other}; if ($other<$self){ # 友好度 $cfs[$self.$other] = int(rand(30)+40) if ($cfs[$self.$other]==""); } elsif ($other>$self) { # 条約 # $cfs[$self.$other] = 0; } # 設定値をクリア # $cfs[$self.$other] = ""; } } # ----------------------------------------------------ここまで } # ログデータ読み込み sub read_data{ # キャラデータ読み込み &usr_file_open; # 国データ書き込み sub cdat_write{ $cdat = "cn1;$cn1,cg1;$cg1,cf1;$cf1,cs1;$cs1,ce1;$ce1,c1;$c1,c1a;$c1a,cn2;$cn2,cg2;$cg2,cf2;$cf2,cs2;$cs2,ce2;$ce2,c2;$c2,c2a;$c2a,cn3;$cn3,cg3;$cg3,cf3;$cf3,cs3;$cs3,ce3;$ce3,c3;$c3,c3a;$c3a,cn4;$cn4,cg4;$cg4,cf4;$cf4,cs4;$cs4,ce4;$ce4,c4;$c4,c4a;$c4a,cn5;$cn5,cg5;$cg5,cf5;$cf5,cs5;$cs5,ce5;$ce5,c5;$c5,c5a;$c5a,set;$set,all_mem;$all_mem,goal_no;$goal_no,hasya;$hasya,hcamp;$hcamp,ad;$addr,ht;$host,date;$date,wr_mes;$wr_mes,\n"; # ---------------------------------------------ここから追加 $cfs_temp = ""; for ($self=1;$self<6;$self++){ for ($other=1;$other<6;$other++){ $cfs_temp .= "cfs$self$other;$cfs[$self.$other],"; }} $cdat = $cfs_temp . $cdat; # ---------------------------------------------ここまでを追加 open (OUT,">>$cdatfile") || &error("open error:$cdatfile",1); print OUT $cdat; close(OUT) or die "Can't close : $!"; } my @metu=('','(亡)'); my $reset_time_out = int(($set-$time)/(3600*24)); # 友好度 $table_fs = ""; $ce[1] = $ce1; $ce[2] = $ce2; $ce[3] = $ce3; $ce[4] = $ce4; $ce[5] = $ce5; $table_fs .= "<tr><td bgcolor=#CCCCFF align=center colspan=6>各国状態(友好度/条約)</td></tr>"; @cfs_str = ('-','同盟','交戦'); for ($a=1;$a<6;$a++){ $table_fs .= "<tr>"; $table_fs .= "<td bgcolor=#CCCCFF style=size:8px;white-space:nowrap; >$cmp[$a] $metu[$ce[$a]]</td>"; for ($b=1;$b<6;$b++){ if ($a>$b) { # 友好度 $table_fs .= "<td bgcolor=$color[$b] align=center >$cfs[$a.$b]</td>"; } elsif ($a<$b) { # 条約 $table_fs .= "<td bgcolor=$color[$b] align=center >$cfs_str[$cfs[$a.$b]]</td>"; } else { $table_fs .= "<td bgcolor=$color[$b] ></td>"; } } $table_fs .= "</tr>"; } <td bgcolor=#CCCCFF>所属人数</td> <td bgcolor=$color[1] align=center>$c1/$c1a</td> <td bgcolor=$color[2] align=center>$c2/$c2a</td> <td bgcolor=$color[3] align=center>$c3/$c3a</td> <td bgcolor=$color[4] align=center>$c4/$c4a</td> <td bgcolor=$color[5] align=center>$c5/$c5a</td> </tr> $table_fs |