… | |
… | |
4 | |
4 | |
5 | =cut |
5 | =cut |
6 | |
6 | |
7 | package Crossfire; |
7 | package Crossfire; |
8 | |
8 | |
9 | our $VERSION = '0.96'; |
9 | our $VERSION = '0.97'; |
10 | |
10 | |
11 | use strict; |
11 | use strict; |
12 | |
12 | |
13 | use base 'Exporter'; |
13 | use base 'Exporter'; |
14 | |
14 | |
… | |
… | |
166 | '-=' => sub { $_[0][0] |= $MOVE_TYPE{$_[1]}; $_[0][1] &= ~$MOVE_TYPE{$_[1]}; &normalise }, |
166 | '-=' => sub { $_[0][0] |= $MOVE_TYPE{$_[1]}; $_[0][1] &= ~$MOVE_TYPE{$_[1]}; &normalise }, |
167 | '/=' => sub { $_[0][0] &= ~$MOVE_TYPE{$_[1]}; &normalise }, |
167 | '/=' => sub { $_[0][0] &= ~$MOVE_TYPE{$_[1]}; &normalise }, |
168 | 'x=' => sub { |
168 | 'x=' => sub { |
169 | my $cur = $_[0] >= $_[1]; |
169 | my $cur = $_[0] >= $_[1]; |
170 | if (!defined $cur) { |
170 | if (!defined $cur) { |
|
|
171 | if ($_[0] >= "all") { |
|
|
172 | $_[0] -= $_[1]; |
|
|
173 | } else { |
171 | $_[0] += $_[1]; |
174 | $_[0] += $_[1]; |
|
|
175 | } |
172 | } elsif ($cur) { |
176 | } elsif ($cur) { |
173 | $_[0] -= $_[1]; |
177 | $_[0] -= $_[1]; |
174 | } else { |
178 | } else { |
175 | $_[0] /= $_[1]; |
179 | $_[0] /= $_[1]; |
176 | } |
180 | } |