American Young Coder Academy – Indo

Loading Events

« All Events

  • This event has passed.

4:30 PM – Python OOP

May 10, 2022 @ 4:30 pm - 5:30 pm

Homework
  1. When monster has been defeated, display monster in the menu like this “<species> has been defeated. For example
    1. You have 112 health remaining.
      Please choose a monster that you want to fight: 
      Dragon has been defeated
      Troll - 27.0 health - max damage: 30
      Water Golem - 40 health - max damage: 25
      Enter your selection (enter 'exit' to quit):
  2. Inside Dragon class, override do_magic_damage method so it will be immune to fire magic attack. It will print “Dragon is immune to fire magic attack. No damage is done.” .
  3. Inside Dragon.do_magic_damage, if it is water magic attack, then you want to double the damage and print “Water magic is super effective against dragon. The damage is doubled.”
  4. Create water_golem.py, inside put WaterGolem class. This class should inherits from Monster class.
  5. Inside WaterGolem class, override do_magic_damage. 
    • a. water magic do half damage
    • b. fire magic do no damage
    • c. wind magic do double damage.
  6. Inside monster_inheritance_main.magic_attack, add code to enable water, wind and earth magic attack.

Details

Date:
May 10, 2022
Time:
4:30 pm - 5:30 pm
Event Categories:
,
Verified by MonsterInsights