# 国データ&キャラデータ書き込み sub write_data{ &cdat_write; &dat_write; $cdat = $cfs_temp; # 友好度 } # 友好度 $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; # 友好度 # 国データ書き込み 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, asya;$hasya,hcamp;$hcamp,ad;$addr,ht;$host,date;$date,wr_mes;$wr_mes,\n"; open (OUT,">$cdatfile") || &error("open error:$cdatfile",1); print OUT $cdat; close(OUT) or die "Can't close : $!"; } # 国データ&キャラデータ書き込み sub write_data{ &cdat_write; &dat_write; } # 国データ書き込み sub cdat_write{ # # この下1行の $cdat は、見やすいように改行しています。もともとのファイルを書き換える必要はありません # $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, asya;$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_cf=$cf5; $my_cs=$cs5; $my_ce=$ce5; } } # <--ここの「{」が違っています # 友好度 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] = ""; } }
$my_cf=$cf5; $my_cs=$cs5; $my_ce=$ce5; } # 友好度 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] = ""; } } } # <--ここに移動します |