- Joined
- Aug 1, 2013
- Messages
- 4,658
Hi all.
I am trying to make some nice abilities for my new map but I do have a little problem in here.
For example:
I have an ability that is basically a light beam towards a direction. Every unit hit by the light beam will take damage. The damage is reduced by 5% for every unit hit with a minimum of 40%.
So I need:
1. Pick every units in angled rectangle.
2. Pick the units in the order of closest to starting point.
I know how to get all units in a rectangle.
Every unit in (Max range of caster)
- Picked unit x > left side and unit x < right side.
- Picked unit y > down side and unit y < up side.
But how do I do that for angled rectangles?
And how do I order the units in the group to the order of closest to caster?
(I can also use unit array if that is better.)
I am trying to make some nice abilities for my new map but I do have a little problem in here.
For example:
I have an ability that is basically a light beam towards a direction. Every unit hit by the light beam will take damage. The damage is reduced by 5% for every unit hit with a minimum of 40%.
So I need:
1. Pick every units in angled rectangle.
2. Pick the units in the order of closest to starting point.
I know how to get all units in a rectangle.
Every unit in (Max range of caster)
- Picked unit x > left side and unit x < right side.
- Picked unit y > down side and unit y < up side.
But how do I do that for angled rectangles?
And how do I order the units in the group to the order of closest to caster?
(I can also use unit array if that is better.)