Moderator
M
Moderator
| Reviewed by Maker, Battle Focus v 1.3, 27th Dec |
Approved. Possible improvements:
|
| Maker, Battle Focus v 1.1, 22nd Dec |
|
Init

Events


Map initialization

Conditions

Actions


For each (Integer A) from 1 to 12, do (Actions)



Loop - Actions




Player - Disable Battle Focus Book for (Player((Integer A)))




Player - Disable Battle Focus Caster Book for (Player((Integer A)))


-------- First copy the dummy units then the buffs and abilities. After that copy the triggers and make sure it automatically generate new variables. --------


-------- After the copy the triggers may screw up sometimes. Check if the triggers you copied and the original triggers are the same. If not, fox the changes. --------
Battle Focus

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Battle Focus

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




BFHas[BFLastRecycled] Equal to True



Then - Actions




Set BFMax = (BFMax + 1)




Set BFIndex = BFMax



Else - Actions




Set BFIndex = BFLastRecycled




Set BFLastRecycled = BFRecycledList[BFLastRecycled]


Set BFCaster[BFIndex] = (Triggering unit)


Set BFHas[BFIndex] = True


Set BFCount = (BFCount + 1)


Set BFTimer[BFIndex] = (3.75 + (0.25 x (Real((Level of Battle Focus for BFCaster[BFIndex])))))


Set BFAbility[BFIndex] = Battle Focus Book


Set BFCasterAbility[BFIndex] = Battle Focus Caster Book


Unit - Add BFCasterAbility[BFIndex] to BFCaster[BFIndex]


Set TempLoc = (Position of (Triggering unit))


Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees


Set BFAura[BFIndex] = (Last created unit)


Animation - Change BFAura[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency


Animation - Change BFAura[BFIndex]'s size to (350.00%, 350.00%, 350.00%) of its original size


Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees


Set BFAura2[BFIndex] = (Last created unit)


Animation - Change BFAura2[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency


Animation - Change BFAura[BFIndex]'s size to (250.00%, 250.00%, 250.00%) of its original size


Animation - Change BFAura2[BFIndex]'s animation speed to 15.00% of its original speed


Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees


Set BFAura3[BFIndex] = (Last created unit)


Animation - Change BFAura3[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency


Animation - Change BFAura3[BFIndex]'s size to (175.00%, 175.00%, 175.00%) of its original size


Animation - Change BFAura3[BFIndex]'s animation speed to 10.00% of its original speed


Set BFGroup[BFIndex] = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of BFCaster[BFIndex])) Equal to True))))


Unit Group - Pick every unit in BFGroup[BFIndex] and do (Actions)



Loop - Actions




Unit - Add BFAbility[BFIndex] to (Picked unit)


Custom script: call RemoveLocation (udg_TempLoc)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Battle Focus Loop <gen> is on) Equal to False



Then - Actions




Trigger - Turn on Battle Focus Loop <gen>



Else - Actions
Battle Focus Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer BFInteger) from 0 to BFMax, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






BFHas[BFInteger] Equal to True





Then - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








BFTimer[BFInteger] Greater than 0.00







Then - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(BFCaster[BFIndex] is dead) Equal to True









Then - Actions










Set BFTimer[BFInteger] = 0.00









Else - Actions










Set BFTimer[BFInteger] = (BFTimer[BFInteger] - 0.03)










Set TempLoc = (Position of BFCaster[BFInteger])










Unit - Move BFAura[BFInteger] instantly to TempLoc










Unit - Move BFAura2[BFInteger] instantly to TempLoc










Unit - Move BFAura3[BFInteger] instantly to TempLoc










Set TempGroup = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of BFCaster[BFInteger])) Equal to True))))










Unit Group - Pick every unit in TempGroup and do (Actions)











Loop - Actions












If (All Conditions are True) then do (Then Actions) else do (Else Actions)













If - Conditions














((Picked unit) is in BFGroup[BFInteger]) Equal to False













Then - Actions














Unit Group - Add (Picked unit) to BFGroup[BFInteger]














If (All Conditions are True) then do (Then Actions) else do (Else Actions)















If - Conditions
















(Level of Battle Focus Critical for (Picked unit)) Greater than 0















Then - Actions















Else - Actions
















Unit - Add BFAbility[BFInteger] to (Picked unit)













Else - Actions










Unit Group - Pick every unit in BFGroup[BFInteger] and do (Actions)











Loop - Actions












If (All Conditions are True) then do (Then Actions) else do (Else Actions)













If - Conditions














((Picked unit) is in TempGroup) Equal to False













Then - Actions














Unit Group - Remove (Picked unit) from BFGroup[BFInteger]














If (All Conditions are True) then do (Then Actions) else do (Else Actions)















If - Conditions
















(Level of Battle Focus Critical for (Picked unit)) Greater than 0















Then - Actions
















Unit - Remove BFAbility[BFInteger] from (Picked unit)















Else - Actions













Else - Actions










Custom script: call RemoveLocation (udg_TempLoc)










Custom script: call DestroyGroup (udg_TempGroup)







Else - Actions








Unit - Remove BFCasterAbility[BFInteger] from BFCaster[BFInteger]








Unit Group - Pick every unit in BFGroup[BFInteger] and do (Unit - Remove BFAbility[BFInteger] from (Picked unit))








Unit Group - Pick every unit in BFGroup[BFInteger] and do (Unit - Remove Battle Focus buff from (Picked unit))








Unit - Remove BFAura[BFInteger] from the game








Unit - Remove BFAura2[BFInteger] from the game








Unit - Remove BFAura3[BFInteger] from the game








Custom script: call DestroyGroup (udg_BFGroup[udg_BFInteger])








Set BFCount = (BFCount - 1)








Set BFHas[BFInteger] = False








Set BFRecycledList[BFInteger] = BFLastRecycled








Set BFLastRecycled = BFInteger








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










BFCount Equal to 0









Then - Actions










Trigger - Turn off (This trigger)










For each (Integer A) from 0 to BFMax, do (Set BFRecycledList[(Integer A)] = 0)










Set BFLastRecycled = 0










Set BFMax = 0









Else - Actions





Else - Actions