I need your help. Say I have unit x and unit y. I want to make it such that:
When unit x attacks unit y, unit y will gain health equal to the amount of damage that unit x deals, regardless of unit y's armor. So for example, if unit x deals 150 damage every 1.5 second and unit y has 4 armor, unit y will gain 150 health every 1.5 second.
If unit x can deal a fatal attack to unit y, unit y will still be alive. Like for example, if unit y has 300 health and unit x deals 800 damage, unit y must not die.
Same thing for unit x's abilities that can cause damage to unit y (unit y will still gain health like stated above).
why do you need this? making it invulnerable seems to be your thing. or set the damage response to 0 damage. or do i miss anything?
i don't think you can do that in data. so create a new trigger: Event - Unit takes damage
Condtion - Unittype of triggering unit == YourUnit
Action - Add "damage Amount" to hitpoints "triggering unit"
Thanks for your response. But I don't think doing this will fulfill the second condition:
If unit x deals a fatal attack to unit y, unit y will still be alive. Like for example, if unit y has 300 health and unit x deals 800 damage, unit y must not die.
And answering why I need this, well, I am working on an arcade game where attacking a particular unit with any of your units will heal him.
I don't want to go into data (I want to do it with pure triggers). Will something like this work:
Event - Unit takes damage
Condtion - Unit type of triggering unit == YourUnit
Action - Set "triggering unit" life = (damage taken) + (damage absorbed) + (current life of "triggering unit")
I have to add the damage absorbed so that it will seem as if the unit that gets attacked did not even minus health.
Do you agree?
This will work but I would caution you that the event will fire when ANY unit takes damage, regardless of your condition. I don't mean to say that the actions will execute, but the event will use some system resources at every event call. This will not be noticeable if your map only has a small handful of units that can be damaged at once, but if your unit count is approaching the 50-100+ range you might want to consider a different approach. Either way, try it and see how it turns out.
(damage taken) can be set to the function "Triggering Damage Amount."
(damage absorbed) is irrelevant and should be kept out of the function.
To prevent fatal damage to the unit, give the unit a damage response buff which negates fatal damage. This will work better than any trigger you could come up with.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I need your help. Say I have unit x and unit y. I want to make it such that:
Would appreciate your help. Thanks.
@Chris97Ong: Go
why do you need this? making it invulnerable seems to be your thing. or set the damage response to 0 damage. or do i miss anything?
i don't think you can do that in data. so create a new trigger: Event - Unit takes damage
Condtion - Unittype of triggering unit == YourUnit
Action - Add "damage Amount" to hitpoints "triggering unit"
@FunkyUserName: Go
Thanks for your response. But I don't think doing this will fulfill the second condition:
And answering why I need this, well, I am working on an arcade game where attacking a particular unit with any of your units will heal him.
@Chris97Ong: Go
This is easily done in data via damage response.
so tell us how you would go about this with damage response. a modify unit effect?
@FunkyUserName: Go
I don't want to go into data (I want to do it with pure triggers). Will something like this work:
Event - Unit takes damage
Condtion - Unit type of triggering unit == YourUnit
Action - Set "triggering unit" life = (damage taken) + (damage absorbed) + (current life of "triggering unit")
I have to add the damage absorbed so that it will seem as if the unit that gets attacked did not even minus health.
Do you agree?
This will work but I would caution you that the event will fire when ANY unit takes damage, regardless of your condition. I don't mean to say that the actions will execute, but the event will use some system resources at every event call. This will not be noticeable if your map only has a small handful of units that can be damaged at once, but if your unit count is approaching the 50-100+ range you might want to consider a different approach. Either way, try it and see how it turns out.
(damage taken) can be set to the function "Triggering Damage Amount."
(damage absorbed) is irrelevant and should be kept out of the function.
To prevent fatal damage to the unit, give the unit a damage response buff which negates fatal damage. This will work better than any trigger you could come up with.