Wrda
Spell Reviewer
- Joined
- Nov 18, 2012
- Messages
- 2,010
You should make more descriptive names rather than
Use UnitAlive, declare it above globals (where you set PERIOD) with:
Should also comment that users must delete this line if they already have declared it somewhere else, or if they get an error stating duplicated function names.
You can use
In CABonus, you should use "elseif" in addBonus method instead of seperate ifs statements.
Auras are stacking by default, perhaps you could add an option for non-stacking, that the highest level takes precedence.
Aura systems are quite hard to do performance wise, so far 4 heroes with devotion aura and holy devotion both with 1500 radius against 40 enemy units hit the fps a bit. Not bad for maps where there's not a lot of units.
thistype.a
and thistype.i
in CustomAura.
JASS:
public stub method aliveCond takes nothing returns boolean
return GetUnitAbilityLevel(.theUnit, .spellId) > 0
endmethod
JASS:
native UnitAlive takes unit id returns boolean
JASS:
//: Replaces call GroupAddGroup(.affect, .last)
set bj_groupAddGroupDest = .last
call ForGroup(.affect, function GroupAddGroupEnum)
BlzGroupAddGroupFast
instead.
JASS:
call GroupClear(.affect)
call GroupEnumUnitsInRange(.affect, GetUnitX(.theUnit), GetUnitY(.theUnit), .getRadius(), Condition(function thistype.tryRegister))
call ForGroup(.last, function thistype.tryUnregister)
Condition(function thistype.tryRegister)
is a leak, must be cleaned up afterwards.In CABonus, you should use "elseif" in addBonus method instead of seperate ifs statements.
Auras are stacking by default, perhaps you could add an option for non-stacking, that the highest level takes precedence.
Aura systems are quite hard to do performance wise, so far 4 heroes with devotion aura and holy devotion both with 1500 radius against 40 enemy units hit the fps a bit. Not bad for maps where there's not a lot of units.
Last edited: