From a891fa680bb15d38f0f40bbacfae0e6a54e8d171 Mon Sep 17 00:00:00 2001 From: Splatink Date: Fri, 18 Apr 2025 08:55:37 +0300 Subject: [PATCH] updated police warrants, updated README, fixed a bug --- README.md | 2 +- main.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7a50bf0..889940d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you are successful at negotiating you get 2 points. Lose the negotiation howe Don't have it? Buy it. You buy items at half the price. -But be careful! Items 7-9 (Ink, Weed and Crypto) are illegal! Sell them and the police will get suspicous. If you keep it up you might get arrested and give a hefty fine, unless... +But be careful! Items 7-9 (Ink, Weed and Crypto) are illegal! Sell them and the police will get suspicious. If you keep it up you might get arrested and give a hefty fine, unless... Illegal items are very negotiable in their price making them much more profitable. Sometimes they may be worth the risk. diff --git a/main.c b/main.c index 259a95f..e41fe1a 100644 --- a/main.c +++ b/main.c @@ -16,8 +16,10 @@ //values below control the police fines, and when they will get suspicous or attempt to arrest the player #define POLICE_FINE_NORMAL 400 #define POLICE_FINE_INCREASE 100 +#define POLICE_FINE_WARRANT 600 #define POLICE_WARNING 1 //warn at X amount of illegal items sold #define POLICE_ARREST 3 //attempt arrest at X amount of illegal items sold +#define POLICE_WARRANT 4 //execute arrest with warrant at X amount of illegal items sold //values below control how the player starts the game, default is 100 gold and 1 banana #define PLAYER_STARTING_MONEY 100 @@ -206,8 +208,16 @@ bool checkForItem(int itemPicked) void policeAccept() { - printf("You were arrested by the police and issued a %d gold fine\n"); - player.playerMoney -= POLICE_FINE_NORMAL; + if(player.warrantForArrest) + { + player.playerMoney -= POLICE_FINE_WARRANT; + printf("You were arrested by the police and issued a hefty %d gold fine\n", POLICE_FINE_WARRANT); + } + else + { + player.playerMoney -= POLICE_FINE_NORMAL; + printf("You were arrested by the police and issued a %d gold fine\n", POLICE_FINE_NORMAL); + } player.illegalItemsSold = 0; } @@ -284,9 +294,11 @@ void warrantUI() { case 'A': policeAccept(); + player.warrantForArrest = false; return; case 'S': policeShoot(); + player.warrantForArrest = false; return; } } @@ -294,7 +306,7 @@ void warrantUI() void checkPolice() { - if (player.warrantForArrest) + if (player.warrantForArrest && player.illegalItemsSold >= POLICE_WARRANT) { printf("Police: %s, WE HAVE A WARRANT FOR YOUR ARREST. PUT YOUR HANDS BEHIND YOUR BACK AND INTERLOCK YOUR FINGERS\n", player.playerName); warrantUI(); @@ -305,7 +317,7 @@ void checkPolice() printf("You have sold an illegal item, if you keep this up the police might start asking questions\n"); player.playerNotified = true; } - else if (player.illegalItemsSold >= POLICE_ARREST) + else if (player.illegalItemsSold >= POLICE_ARREST && player.warrantForArrest == false) { printf("Police: You seem to be selling contraband, you are under arrest!\n"); policeUI();