yoel123 / java-text-based-space-station-manger-sim

space station management/tycoon/trader game. made for fun and practice.
6 stars 8 forks source link

crazy inventor game event #27

Open yoel123 opened 3 years ago

yoel123 commented 3 years ago

this one is so easy to code, basically, the event is like this a crazy scientist offers his services for a cost, he will improve you station (add an upgrade). but there's a chance he will fail and damage the station so its a gamble.

basicly the way you code this is : go to event manger, inside do_event add an if:

if(action.equals("crazy_inventor")) {}

inside that, if ask the player using ui (user input object) if he agrees to the deal.

if he does create a random number to determine if the upgrade was a success or not.

reduce the players credits (he will pay these wether the upgrade succeeds or fails, the cost is low so its tempting).

if success add a random upgrade (a basic upgrade) and tell the player the event succeed.

if fail, do damage to the station (when station damage is implemented, you can leave it empty or leave a comment "damage here"), output a message telling the player the event failed.

it looks harder then it really is, look at if(action.equals("smuglers_sell")) for inspiration. or just ask me about this issue.

cShirley14 commented 3 years ago

I would like to take on this as a first contribution!