Whats the best solution if i want to make every unit attack is checking the condition first then the damage can increase or decrease based on the elements of the attacking unit and the unit who takes the damage
for example the condition is the attacking unit elements is fire, and the attacked unit elements is water, when fire attacks water the damage of the unit is decrease by 25%, and when water attacks fire the damage increase by 150%.
i made the codes but got stuck, when my hero attack other unit, elements calculating was fine, but when i want to increase the damage of the attacker the game crash
the example of code like this
for example the condition is the attacking unit elements is fire, and the attacked unit elements is water, when fire attacks water the damage of the unit is decrease by 25%, and when water attacks fire the damage increase by 150%.
i made the codes but got stuck, when my hero attack other unit, elements calculating was fine, but when i want to increase the damage of the attacker the game crash
the example of code like this
-
Set Unit
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
- Set Attacking_Unit = (Attacking unit)
- Trigger - Add to Damage Modifier <gen> the event (Unit - (Attacked unit) Takes damage)
-
Events
-
Damage Modifier
- Events
- Conditions
-
Actions
- Unit - Cause Attacking_Unit to damage (Attacked unit), dealing 100.00 damage of attack type Normal and damage type Normal