« All Events
7 PM – Python OOP – Gamas
December 4, 2023 @ 7:00 pm - 8:00 pm
Today We Did
- We continued with Monster Inheritance project. We added codes that would enable to player to do sword damage.
Homework
- Continue on mon-7pm-monster-inheritance
- When player sword attack monster, the monster also is going to attack the player causing random damage between 10 to monster.max_attack . Add code to do this.
- When player select a monster and then select “1. Magic attack” add codes so it will behave like below.
Welcome to AYC Logic adventure game
1. Add new monster
2. List all monsters
3. Start adventure
Please make your selection. Enter "quit" to exit: 3
Enter your name: Gamas
Enter player's health: 100
Hi Gamas, Welcome to AYC Logic Adventure Game
Gamas you have 100 health remaining.
Please choose your monster:
- Dragon - 100 health - 100 Max attack
- Troll - 50 health - 75 Max attack
- Water Golem - 50 health - 50 Max attack
Enter your selection (enter 'stop' to quit the game): dragon
What do you want to do with the dragon
1. Magic attack
2. Sword attack - 10 to 20 damage
Enter your selection: 2
dragon was attacked by player (20 attack points) and now have 80 health remaining.
Dragon attacked you with 64 damage. Your remaining health is 36.
Gamas you have 36 health remaining.
Please choose your monster:
- Dragon - 80 health - 100 Max attack
- Troll - 50 health - 75 Max attack
- Water Golem - 50 health - 50 Max attack
Enter your selection (enter 'stop' to quit the game): troll
What do you want to do with the troll
1. Magic attack
2. Sword attack - 10 to 20 damage
Enter your selection: 1
What kind of magic attack you want to do:
1. Fire magic - Max damage: 10
2. Water magic - Max damage: 10
3. Earth magic - Max damage: 15
4. Wind magic - Max damage: 8
Enter your selection: 1
You attacked Troll with 10 damage and the Troll has 40 health remaining.
Troll attacked you with 41 damage. Your remaining health is -5.
Gamas you have -5 health remaining.
Please choose your monster:
- Dragon - 80 health - 100 Max attack
- Troll - 40 health - 75 Max attack
- Water Golem - 50 health - 50 Max attack
Enter your selection (enter 'stop' to quit the game):