Hate to ask, but might I get a second pair of eyes to find where the issue is in this? Hate to ask, thought I could do it, but no matter where I look I cannot spot the fault. Maybe none and it's just a limitation I don't know. Idk...
Essentially it is a custom spell made from channel that jumps in the direction of the target point, then damages the first target/targets it hits along the way. It was checking for closest enemy before, but I simplified it to only check all units in the area and damage them before turning off the ability to do damage with Booleans; so it doesn't damage anymore along its way.
The problem is that sometimes, it literally just jumps over the unit and never deals damage...
This is my first adventure into custom spells, and I thought I had it all on my own, but apparently im missing something...
This begins the ability. Sets values and all that.
Essentially it is a custom spell made from channel that jumps in the direction of the target point, then damages the first target/targets it hits along the way. It was checking for closest enemy before, but I simplified it to only check all units in the area and damage them before turning off the ability to do damage with Booleans; so it doesn't damage anymore along its way.
The problem is that sometimes, it literally just jumps over the unit and never deals damage...
This is my first adventure into custom spells, and I thought I had it all on my own, but apparently im missing something...
This begins the ability. Sets values and all that.
-
Begin Leap
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Panther Leap [Huntress]
-
Actions
- -------- --------
- -------- Set Variables --------
- Set VariableSet Abilities_CastingUnit = (Casting unit)
- Set VariableSet Abilities_Loc00 = (Position of Abilities_CastingUnit)
- Set VariableSet Abilities_Real00 = (Angle from (Position of Abilities_CastingUnit) to (Target point of ability being cast))
- Set VariableSet Abilities_Real01 = 400.00
- -------- --------
- -------- Prepare and then start leap --------
- Unit - Make Abilities_CastingUnit face Abilities_Real00 over 0.02 seconds
- Unit - Turn collision for Abilities_CastingUnit Off.
- Trigger - Turn on Leap <gen>
- -------- --------
- -------- Add flight and begin leaping into air. --------
- Unit - Add Crow Form [Adds Flying then removed as no longer is needed] to Abilities_CastingUnit
- Unit - Remove Crow Form [Adds Flying then removed as no longer is needed] from Abilities_CastingUnit
- Animation - Change Abilities_CastingUnit flying height to 150.00 at 300.00
-
Events
-
Leap
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
- -------- --------
- -------- Set Variables --------
- Set VariableSet Abilities_Loc01 = ((Position of Abilities_CastingUnit) offset by 30.00 towards Abilities_Real00 degrees.)
- -------- --------
- -------- --------
- -------- Move Unit --------
- Unit - Move Abilities_CastingUnit instantly to Abilities_Loc01
- Animation - Play Abilities_CastingUnit's Walk animation
- -------- --------
- -------- --------
- -------- Checks for closest enemy to deal damage to. --------
- Set VariableSet Abilities_Real02 = 80.00
- Set VariableSet Abilities_UnitGroup00 = (Units within Abilities_Real02 of Abilities_Loc01.)
-
Unit Group - Pick every unit in Abilities_UnitGroup00 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Abilities_Bool00 Equal to False
- ((Picked unit) is A structure) Equal to False
- ((Picked unit) belongs to an enemy of (Owner of Abilities_CastingUnit).) Equal to True
-
Then - Actions
- Set VariableSet Abilities_Bool00 = True
- Unit - Cause Abilities_CastingUnit to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_Abilities_UnitGroup00)
- -------- --------
- -------- --------
- -------- Lower unit back to ground --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between Abilities_Loc00 and Abilities_Loc01) Greater than or equal to (Abilities_Real01 / 2.00)
-
Then - Actions
- Animation - Change Abilities_CastingUnit flying height to 0.00 at 300.00
-
Else - Actions
- Do nothing
-
If - Conditions
- -------- --------
- -------- --------
- -------- Finished Leaping --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between Abilities_Loc00 and Abilities_Loc01) Greater than or equal to Abilities_Real01
-
Then - Actions
- Set VariableSet Abilities_Bool00 = False
- Unit - Turn collision for Abilities_CastingUnit On.
- Custom script: call RemoveLocation(udg_Abilities_Loc00)
- Custom script: call RemoveLocation(udg_Abilities_Loc01)
- Trigger - Turn off (This trigger)
-
Else - Actions
- Custom script: call RemoveLocation(udg_Abilities_Loc01)
-
If - Conditions
-
Events