In an alternate universe, arguements are won through strength instead of intellect; therefore whenever someone disagrees with someone else, they initiate a duel with one another until only one of them is left standing.
One day, Aurick was arguing with his senior, Dunqian, about whether or not cereal is a soup. Because they cannot seem to agree with each other, they must duel.
The mechanic of the duel is as follows:
(If the Defense/Resistance stat is more than the Strength/Magic stat, the damage dealt will be 0)
Your job is to code the following functions:
void magicalAttack(struct Duelist* self, struct Duelist* target); (attack using magic against resistance, switch to physical attack)
void physicalAttack(struct Duelist* self, struct Duelist* target); (attack using physical against defense, switch to heal)
void heal(struct Duelist* self, struct Duelist* target); (heal user's hp, switch to magical attack)
struct Duelist getDuelist();
*Do not forget to include the struct and the 4 function declaration at the top of the submitted code*
**Healing can go over the starting health value**
The input comes in 2 lines.
Each line contains the variables of each participant as follows:
name - health - strength - magic - healing power - defense - resistance - move
(0 <= stats <= 100)
The health value of each duelist every round (already done in main)
The result of the match (already done in main)