From d609ad50e7443d82605db4cbc6d9fcd32374d4d8 Mon Sep 17 00:00:00 2001 From: hummusonrails Date: Mon, 11 May 2026 09:03:04 +0300 Subject: [PATCH] Implement black_hole event --- __pycache__/bank.cpython-314.pyc | Bin 0 -> 6694 bytes __pycache__/game.cpython-314.pyc | Bin 0 -> 6761 bytes game.py | 294 +++++++++++++++---------------- 3 files changed, 147 insertions(+), 147 deletions(-) create mode 100644 __pycache__/bank.cpython-314.pyc create mode 100644 __pycache__/game.cpython-314.pyc diff --git a/__pycache__/bank.cpython-314.pyc b/__pycache__/bank.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae8c5599687fac3b205f0bd4346f1731d3316629 GIT binary patch literal 6694 zcmb_g+ix6K8K2pm-JQMJPJCZq6AROAtdN!#LKU^4lu{%xVHCyOl3_eMwx^z*S-5oy+%~ z%kR6Kb3^5V1m!;s`AvO7lKzPwVNrrg`%S2{q;cttq)C&KCclvKTbR#F0WTf#WYJFn zUMAwD1TPD`T*ONYo(jBt#8b4wl2k34p$7Ob2OsTgP%%J{>k^YSiKTAHEIlE4pwFbl z6b-as87&PotATWu(=tF+4WzQXmIGSQKpHD*d7ve&z{=MoHl!6nVu>rS8t%3ktV>A5 zdRmgy_9dvaq_q)Ou#udXu1RjFm;V)w6m2lhFPgL@?a8ZEg)6R6x43GUrq^^CSUS1|e(c2`J!7M!(#7BjeNhWq|qmY*L54A*w zpqAM5K{}BU=((5bQp;`D*DVrkl&?f_(_)bZBSM212WKJUNQC6*2!Zo>$+D14u~V?x zvSZUo66L3bs02^Q=?IH%$diPTN$8PSRM~Vq+SyoNR)SZ7A+d!i@EMlJF088fTUy#6 zUOn2k0`sDJ)~JgMi&Mf;hi5Hr?}kP6jiy_p!C5Dn3owG_fV8AXSt(yW;c547LuJ!) zEfTw8I%V)xw_L^-f}G}_vh7+_5>-vUGD06Jray?xqC7fXt$uttQL1YohGLkBi6(pYl!pC)ST(+qj zj1hai$t(&YPU*Voz#i6YlbM#|==z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|;7VpGj!Zugg22P3K}CKk4t)V3;;(!*Xk(5_~ox zysLFLDK~UI!0i_^R^{83*KHRbH{h9LQG+;?u*I(gX=lw3CcEv-bd;8Egd=q#M)Ku^ zW&``Z3(C+85O@_CJ}2%Bsl(@LwKy2#1Ue95E`Er$J4glt9qlhcavOeh2}l6+bY>be zqe{n{BidImM_TbU!BPFu{u;C-(Ei@>&<>b~7dch{%ojBkFrVkj*C3seHi^Yg5vy*%>zBJ32JfL)Z^5h`q>{Jr zQy{OeS1;o-Bg63kI*YRa!yytWKeH0veD2wOwQ?Y;XFmN==qJ&7gaxlMSQfR7l49?7 z15%z+-PpFmHv@i3C=zG=4rYk~^a(%_FNOW_Fpk+s&wlZWkl45F_n(yL)1Ake@ErN1 zklWkvhon#iKEv|ZoejMO=GZ)IyQT;4x+Qq#tijtXH9bgsaIPqv;}hnVWp4XVHkM;= z+UvGsvmHL;E7rI1PcTF5FyhCKlZ#{j1ysO+$XDV=1w1Soyii|>kMh}4_|hJKzaB7y z3^T+xrFVvCek}zUPK#?V0C2UM=4m+T4kt{V@|Ze7YFMX=3Ij-H>ER~|_~jxL^+$J!DQ HG4=ld7&}oC literal 0 HcmV?d00001 diff --git a/__pycache__/game.cpython-314.pyc b/__pycache__/game.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09a26b8623c1487cb4295e1942ad915bf09cfa09 GIT binary patch literal 6761 zcmb_hO>7&-6`m!z)QTc0N+KyMmcw-n|bri`&k`HCSn9i>`m?sHBHFBvC%9Mud?$2RMtq5NZj+pCK+;&NTER@g{MO9 z2%BTP2=Mq8FT{9J;B~cl;qwtmc=#1U%J&d5OwNZ7k||G!&7bGbB)mr8r`ewa=_Bkf z-~A2t&y)hA2nRFH`?c2GrYbhF8Wd@3t5(7+lZh^z)yQqMSZX{hu&asVzdSza;A zRUPYbS$?ys=w45+EH7%*vUSZ+4O5nBAFeQnWIvL7k=zHw$;j-UwUVsZHq{oYwrat0 zeX?BA70W7XCA*~Rx-0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ysE#%Oz7cja8VsfEzK?vTQAD6(_c!Lkub}o4VRGMLZ;z&E&(gMAM)N zXP+)S;z5u?)aBejmeYs$&+85ZA`yXpMK@axnkp- zRzIiR;6u3!+ztu#>D(p$W|VX%KkC|zY&7`{*$7QHJM|N-U9WBi2026i0XuF7;~qc6 zZ41`WO)@!uW^#frsCaLYpMpLt0X|opC<=SJ9SeU=a&kH(b)UQIhEYB)=|g^j(dQT#xsC za(I1VWbjWx%G@_1oFV`z;)9~D*iwiJJt- zt)Fyb4alwZ635MQHwpW>A%#gKeyO$@9{Rc`{hP 0 and self.player.fuel > 0: - action = self.main_menu() - if action == "1": - self.explore_planet() - elif action == "2": - self.player.check_status() - elif action == "3": - self.player.use_oxygen() - elif action == "4": - print("You decide to return to your home planet. Game Over.") - break - - def main_menu(self): - # Presents the main menu options to the player - print("\nWhat would you like to do?") - print("1. Explore a new planet") - print("2. Check status") - print("3. Use oxygen supply") - print("4. Exit game") - return input("Enter your choice: ") - - def explore_planet(self): - # Randomly selects an event when exploring a new planet - print("\nYou approach a new planet...") - event = random.choice([self.alien_encounter, self.find_resources, self.empty_planet, - self.fuel_station, self.asteroid_field, self.space_pirates, - self.ancient_ruins, self.lost_colony, self.abandoned_ship, self.black_hole]) - event() - - def alien_encounter(self): - # Creates a random alien encounter for combat, call create_alien() and combat() and display appropriate message - pass - - def create_alien(self): - # Defines possible alien enemies with varying stats - aliens = [ - Alien("Martian", 30, 5), - Alien("Venusian", 50, 8), - Alien("Zorgon", 100, 15), - Alien("Cybertronian", 40, 6), - Alien("Void Entity", 70, 10) - ] - return random.choice(aliens) - - def combat(self, alien): - # Combat loop: Player and alien take turns attacking until one is defeated, loot alien if you win and - # print appropriate messages for each outcome - pass - - def attack_alien(self, alien): - # Player deals random damage between 5 and 15 to the alien; print appropriate message as well - pass - - def loot_alien(self, alien): - # Player loots between 10 and 50 gold from a defeated alien by calling collect_gold() - pass - - def find_resources(self): - # Player finds resources, adding between 5 and 50 gold by calling collect_gold() - pass - - def fuel_station(self): - # Fuel station restores between 5 and 20 fuel and print appropriate message - pass - - def empty_planet(self): - # display "This planet is barren. Nothing to see here." - pass - - def asteroid_field(self): - # display "You navigate through an asteroid field, avoiding collisions!" - pass - - def space_pirates(self): - # display "Pirates attack your ship! Will you fight or escape?" - pass - - def ancient_ruins(self): - # display "You discovered ancient alien ruins with hidden technology!" - pass - - def lost_colony(self): - # display "You find a lost human colony struggling to survive." - pass - - def abandoned_ship(self): - print("An abandoned spaceship drifts in the void. Do you explore it?") - - def black_hole(self): - # display "A black hole is nearby! Will you attempt to study it or flee?" - pass - -if __name__ == "__main__": - game = SpaceGame() - game.start_game() +import random + +class Player: + def __init__(self): + # Initial values: Health = 100, Fuel = 50, Gold = 0, Oxygen = 100, XP = 0, Level = 1 + self.health = 100 + self.fuel = 50 + self.gold = 0 + self.items = [] + self.oxygen = 100 + self.xp = 0 + self.level = 1 + + def check_status(self): + # Displays current player status, show None if no items + pass + + def level_up(self): + # XP required to level up: 100; resets XP to 0 after leveling up and print appropriate message + pass + + def use_oxygen(self): + # Oxygen limit: 100; cannot use oxygen if supply is below 10 and print appropriate message + pass + + def collect_gold(self, amount): + # Collects gold and increment amount with appropriate message + pass + +class Alien: + def __init__(self, name, health, attack): + # Alien health typically ranges from 30 to 100; attack power ranges from 5 to 15 + self.name = name + self.health = health + self.attack = attack + + def attack_player(self, player): + # Alien attack damage varies between 3 and its max attack power, reduce player health and show appropriate message + pass +class SpaceGame: + def __init__(self): + # Initializes game with a player character + self.player = Player() + + def start_game(self): + # Displays game introduction and starts the main loop + print("Welcome to the Space Exploration Adventure!") + print("Travel across planets, meet aliens, and gather resources.") + self.game_loop() + + def game_loop(self): + # Runs the game loop until player health or fuel reaches 0 + while self.player.health > 0 and self.player.fuel > 0: + action = self.main_menu() + if action == "1": + self.explore_planet() + elif action == "2": + self.player.check_status() + elif action == "3": + self.player.use_oxygen() + elif action == "4": + print("You decide to return to your home planet. Game Over.") + break + + def main_menu(self): + # Presents the main menu options to the player + print("\nWhat would you like to do?") + print("1. Explore a new planet") + print("2. Check status") + print("3. Use oxygen supply") + print("4. Exit game") + return input("Enter your choice: ") + + def explore_planet(self): + # Randomly selects an event when exploring a new planet + print("\nYou approach a new planet...") + event = random.choice([self.alien_encounter, self.find_resources, self.empty_planet, + self.fuel_station, self.asteroid_field, self.space_pirates, + self.ancient_ruins, self.lost_colony, self.abandoned_ship, self.black_hole]) + event() + + def alien_encounter(self): + # Creates a random alien encounter for combat, call create_alien() and combat() and display appropriate message + pass + + def create_alien(self): + # Defines possible alien enemies with varying stats + aliens = [ + Alien("Martian", 30, 5), + Alien("Venusian", 50, 8), + Alien("Zorgon", 100, 15), + Alien("Cybertronian", 40, 6), + Alien("Void Entity", 70, 10) + ] + return random.choice(aliens) + + def combat(self, alien): + # Combat loop: Player and alien take turns attacking until one is defeated, loot alien if you win and + # print appropriate messages for each outcome + pass + + def attack_alien(self, alien): + # Player deals random damage between 5 and 15 to the alien; print appropriate message as well + pass + + def loot_alien(self, alien): + # Player loots between 10 and 50 gold from a defeated alien by calling collect_gold() + pass + + def find_resources(self): + # Player finds resources, adding between 5 and 50 gold by calling collect_gold() + pass + + def fuel_station(self): + # Fuel station restores between 5 and 20 fuel and print appropriate message + pass + + def empty_planet(self): + # display "This planet is barren. Nothing to see here." + pass + + def asteroid_field(self): + # display "You navigate through an asteroid field, avoiding collisions!" + pass + + def space_pirates(self): + # display "Pirates attack your ship! Will you fight or escape?" + pass + + def ancient_ruins(self): + # display "You discovered ancient alien ruins with hidden technology!" + pass + + def lost_colony(self): + # display "You find a lost human colony struggling to survive." + pass + + def abandoned_ship(self): + print("An abandoned spaceship drifts in the void. Do you explore it?") + + def black_hole(self): + # display "A black hole is nearby! Will you attempt to study it or flee?" + print("A black hole is nearby! Will you attempt to study it or flee?") + +if __name__ == "__main__": + game = SpaceGame() + game.start_game()