- This event has passed.
4:30pm – Python OOP – Roland
May 16 @ 4:30 pm - 5:30 pm
Today We Did
- Continued working on MonsterInheritance Project
- Dragon Class
- Started the MonsterSystem
- Initialization
- Application Loop Menu
- Add monsters
- List all monsters
- Started working on the adventure game
Homework
Continue working on the MonsterInheritance project, implement the WaterGolem class in a new file called watergolem.py following the instructions below:
- WaterGolem should inherit from Monster
- __init__
- Should take in 2 attributes: health, max_attack
- Call super() with “water golem” as the species type, and the two attributes passed in
- Override receive_magic_attack
- If the magic_type is “fire” then print “Water Golem is immune to fire. Therefore, the water golem suffer no damage” and DO NOTHING ELSE
- If the magic_type is “water” then print “Water Golem is resistance to water. Therefore, the water golem only takes half the damage!”
- Call receive_magic_attack from the parent with HALF THE DAMAGE and magic_type passed in!
- Refer to #3 below if you need a hint on how to do this
- Call receive_magic_attack from the parent with HALF THE DAMAGE and magic_type passed in!
- If the magic_type is anything ELSE, then user super() to call receive_magic_attack from the parent with the damage and magic_type passed in
- hint: super().receive_magic_attack…
If you have any questions, feel free to email me at rolandyang@ayclogic.com