- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
my ($_bonus1_l, $_bonus1_y, $_bonus2_l, $_bonus2_y) = ($l1*10 > rand(100) ? 1 : 0, $y1*10 > rand(100) ? 1 : 0, $l2*10 > rand(100) ? 1 : 0, $y2*10 > rand(100) ? 1 : 0);
($_bonus1_l, $_bonus2_l) = (0, 0) if $_bonus1_l == 1 and $_bonus2_l == 1;
($_bonus1_y, $_bonus2_y) = (0, 0) if $_bonus1_y == 1 and $_bonus2_y == 1;
if($turn > 12){
my ($_a1_def, $_b1_def, $_c1_def) = mass($pl1_mov, $User1, "def");
my ($_a1_att, $_b1_att, $_c1_att) = mass($pl1_att, $User1, "att");
my ($_a2_def, $_b2_def, $_c2_def) = mass($pl2_mov, $User2, "def");
my ($_a2_att, $_b2_att, $_c2_att) = mass($pl2_att, $User2, "att");
$N1 += $_a1_att if $_a2_def < 1000000;
$N1 += $_b1_att if $_b2_def < 1000000;
$N1 += $_c1_att if $_c2_def < 1000000;
$N2 += $_a2_att if $_a1_def < 1000000;
$N2 += $_b2_att if $_b1_def < 1000000;
$N2 += $_c2_att if $_c1_def < 1000000;
if($_bonus1_l){
my $l = int(rand(3));
## сБНПНР
if($l == 0){
my $r = 0;
($_a2_att, $r) = (0, 1) if $_a2_att > 0 and $_a1_def < 1000000;
($_b2_att, $r) = (0, 1) if $_b2_att > 0 and $_a1_def < 1000000 and $r == 0;
($_c2_att, $r) = (0, 1) if $_c2_att > 0 and $_a1_def < 1000000 and $r == 0;
$U1 = $r;
} elsif($l == 1){
my $r = 0;
($_a1_att, $r, $K2) = (int($_a1_att * 1.5), 1, int($_a1_att/2)) if $_a1_att > 0 and $_a2_def < 1000000;
($_b1_att, $r, $K2) = (int($_b1_att * 1.5), 1, int($_b1_att/2)) if $_b1_att > 0 and $_b2_def < 1000000 and $r == 0;
($_c1_att, $r, $K2) = (int($_c1_att * 1.5), 1, int($_c1_att/2)) if $_c1_att > 0 and $_c2_def < 1000000 and $r == 0;
} elsif($l == 2){
my ($r, $ov, $v) = (0, 0, int(rand(3)));
($_a1_att, $r, $ov) = (0, 1, (int($_a2_att/2))) if $_a2_att > 0 and $_a1_def > 1000000;
($_b1_att, $r, $ov) = (0, 1, (int($_b2_att/2))) if $_b2_att > 0 and $_b1_def > 1000000 and $r == 0;
($_c1_att, $r, $ov) = (0, 1, (int($_c2_att/2))) if $_c2_att > 0 and $_c1_def > 1000000 and $r == 0;
$_a1_att += $ov if $v == 0;
$_b1_att += $ov if $v == 1;
$_c1_att += $ov if $v == 2;
$O1 = $ov;
}
}
if($_bonus2_l){
my $l = int(rand(100));
if($l == 0){
my $r = 0;
($_a1_att, $r) = (0, 1) if $_a1_att > 0 and $_a2_def < 1000000;
($_b1_att, $r) = (0, 1) if $_b1_att > 0 and $_a2_def < 1000000 and $r == 0;
($_c1_att, $r) = (0, 1) if $_c1_att > 0 and $_a2_def < 1000000 and $r == 0;
$U2 = $r;
} elsif($l == 1){
my $r = 0;
($_a2_att, $r, $K1) = (int($_a2_att * 1.5), 1, int($_a2_att/2)) if $_a2_att > 0 and $_a1_def < 1000000;
($_b2_att, $r, $K1) = (int($_b2_att * 1.5), 1, int($_b2_att/2)) if $_b2_att > 0 and $_b1_def < 1000000 and $r == 0;
($_c2_att, $r, $K1) = (int($_c2_att * 1.5), 1, int($_c2_att/2)) if $_c2_att > 0 and $_c1_def < 1000000 and $r == 0;
} elsif($l == 2){
my ($r, $ov, $v) = (0, 0, int(rand(3)));
($_a2_att, $r, $ov) = (0, 1, (int($_a1_att/2))) if $_a1_att > 0 and $_a2_def > 1000000;
($_b2_att, $r, $ov) = (0, 1, (int($_b1_att/2))) if $_b1_att > 0 and $_b2_def > 1000000 and $r == 0;
($_c2_att, $r, $ov) = (0, 1, (int($_c1_att/2))) if $_c1_att > 0 and $_c2_def > 1000000 and $r == 0;
$_a2_att += $ov if $v == 0;
$_b2_att += $ov if $v == 1;
$_c2_att += $ov if $v == 2;
$O2 = $ov;
}
}
if($_bonus1_y){
my $l = int(rand(2));
if($l == 0){
my ($r, $rik, $V1) = (0, 0, int(rand(3)) + 1);
($r, $rik) = (1, (int($_a1_att/2))) if $_a1_att > 0 and $_a2_def < 1000000 and $V1 == 1;
($r, $rik) = (1, (int($_b1_att/2))) if $_b1_att > 0 and $_b2_def < 1000000 and $r == 0 and $V1 == 2;
($r, $rik) = (1, (int($_c1_att/2))) if $_c1_att > 0 and $_c2_def < 1000000 and $r == 0 and $V1 == 3;
$R2 = $rik;
$db->query("UPDATE duel set pl1_rik = CONCAT(pl1_rik, $V1) where sid = \"$dsid\"") if $R2 > 0;
} elsif($l == 1){
my $r = 0;
($_a2_def, $r) = ($_a2_def - 1000000, 1) if $_a1_att > 0 and $_a2_def > 1000000;
($_b2_def, $r) = ($_b2_def - 1000000, 2) if $_b1_att > 0 and $_b2_def > 1000000 and $r == 0;
($_c2_def, $r) = ($_c2_def - 1000000, 3) if $_c1_att > 0 and $_c2_def > 1000000 and $r == 0;
$T2 = $r;
}
}
if($_bonus2_y){
my $l = int(rand(2));
if($l == 0){
my ($r, $rik, $V2) = (0, 0, int(rand(3)) + 1);
($r, $rik) = (1, (int($_a2_att/2))) if $_a2_att > 0 and $_a1_def < 1000000 and $V2 == 1;
($r, $rik) = (1, (int($_b2_att/2))) if $_b2_att > 0 and $_b1_def < 1000000 and $r == 0 and $V2 == 2;
($r, $rik) = (1, (int($_c2_att/2))) if $_c2_att > 0 and $_c1_def < 1000000 and $r == 0 and $V2 == 3;
#$_a2_att += $rik if $V2 == 1;
#$_b2_att += $rik if $V2 == 2;
#$_c2_att += $rik if $V2 == 3;
$R1 = $rik;
$db->query("UPDATE duel set pl2_rik = CONCAT(pl2_rik, $V2) where sid = \"$dsid\"") if $R1 > 0;
} elsif($l == 1){
my $r = 0;
($_a1_def, $r) = ($_a1_def - 1000000, 1) if $_a2_att > 0 and $_a1_def > 1000000;
($_b1_def, $r) = ($_b1_def - 1000000, 2) if $_b2_att > 0 and $_b1_def > 1000000 and $r == 0;
Из браузерной игрушки на mod_perl/mysql. Код наглядно демонстрирует, что говнокод зависит не от языка, а от программиста.