HW Finish the if statement chains for water magic, earth magic, and wind magic. Add an additional else statement to check if the input is invalid. Make a new Slime class to inherit from Monster, but make it so that the slime is immune to water type magic.
You can cross check your results with the following sample output:
MAGIC ATTACK
What type of magic do you want to use on Slime?
1. Fire magic – 10 damage
2. Water magic – 10 damage
3. Earth magic – 12 damage
4. Wind magic – 8 damage
Enter your selection: 2
The slime is immune to water magic. No damage is done.
Slime attacked you and did 9 damage. You have 91 health remaining.
darin has 91 health remaining.
– Troll: 100 health – (15 – 20 attack)
– Goblin: 50 health – (10 – 15 attack)
– Slime: 40 health – (5 – 10 attack)
You can email me at ddjapri@ayclogic.com if you have any questions!