|
@@ -397,7 +397,6 @@ fn cops_event(player: &mut Player) {
|
|
|
println!("The cops found you, but you're not holding so it's chill.");
|
|
|
thread::sleep(one_second);
|
|
|
thread::sleep(one_second);
|
|
|
- thread::sleep(one_second);
|
|
|
} else {
|
|
|
println!("The cops found you! Run!");
|
|
|
thread::sleep(one_second);
|
|
@@ -432,6 +431,9 @@ fn cops_event(player: &mut Player) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ thread::sleep(one_second);
|
|
|
+ thread::sleep(one_second);
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////
|
|
@@ -659,20 +661,6 @@ fn main() {
|
|
|
while ! main_loop {
|
|
|
clear_term();
|
|
|
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
- let event_chance = rng.gen_range(0,9);
|
|
|
- if event_chance == 2 {
|
|
|
- trenchcoat_event(&mut player);
|
|
|
- }
|
|
|
-
|
|
|
- if event_chance == 1 {
|
|
|
- body_armor_event(&mut player);
|
|
|
- }
|
|
|
-
|
|
|
- if event_chance == 0 {
|
|
|
- cops_event(&mut player);
|
|
|
- }
|
|
|
-
|
|
|
if player.health == 0 {
|
|
|
println!("You died! Game over!");
|
|
|
main_loop = true;
|
|
@@ -706,6 +694,27 @@ fn main() {
|
|
|
go_to_location(&mut player, &mut market);
|
|
|
player.debt_interest();
|
|
|
player.decrease_loan_timer(1);
|
|
|
+
|
|
|
+ // Only have events trigger after 'jetting'
|
|
|
+ let mut rng = rand::thread_rng();
|
|
|
+ let event_chance = rng.gen_range(0,9);
|
|
|
+ if event_chance == 2 {
|
|
|
+ trenchcoat_event(&mut player);
|
|
|
+ }
|
|
|
+
|
|
|
+ if event_chance == 1 {
|
|
|
+ body_armor_event(&mut player);
|
|
|
+ }
|
|
|
+
|
|
|
+ if event_chance == 0 {
|
|
|
+ cops_event(&mut player);
|
|
|
+ }
|
|
|
+
|
|
|
+ if player.health == 0 {
|
|
|
+ println!("You died! Game over!");
|
|
|
+ main_loop = true;
|
|
|
+ }
|
|
|
+
|
|
|
} else if action.contains("loanshark") {
|
|
|
loan_shark(&mut player);
|
|
|
} else if action.contains("headstash") {
|