Merge pull request #449 from havoclad/main

Apply Both damage correctly
This commit is contained in:
Jeff Atwood
2022-01-07 12:14:32 -08:00
committed by GitHub

View File

@@ -168,6 +168,7 @@ NOW THEN, ';
my $response = choose( my $response = choose(
'DOES THE ENEMY HAVE GUNS(1), MISSILES(2), OR BOTH(3)', 3); '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 if ($response != 2) { # there's some guns involved, ask more
say ''; say '';
@@ -190,7 +191,8 @@ NOW THEN, ';
} }
say ''; say '';
} }
else { # Apply missile damage for responses 2 and 3
if ($response > 1 ) {
$missiles_hit_rate = 35; # remember... this is a global variable $missiles_hit_rate = 35; # remember... this is a global variable
} }