mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-28 13:46:06 -08:00
Apply Both damage correctly
Choices 2 and 3 should both have missile damage applied.
This commit is contained in:
@@ -168,6 +168,7 @@ NOW THEN, ';
|
||||
my $response = choose(
|
||||
'DOES THE ENEMY HAVE GUNS(1), MISSILES(2), OR BOTH(3)', 3);
|
||||
|
||||
# Apply Gun damage for responses 1 and 3
|
||||
if ($response != 2) { # there's some guns involved, ask more
|
||||
say '';
|
||||
|
||||
@@ -190,7 +191,8 @@ NOW THEN, ';
|
||||
}
|
||||
say '';
|
||||
}
|
||||
else {
|
||||
# Apply missile damage for responses 2 and 3
|
||||
if ($response > 1 ) {
|
||||
$missiles_hit_rate = 35; # remember... this is a global variable
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user