Rewrite buffs
Closes #1832 (closed)
Effect Stacking Design Summary
- CC needs to be completely mitigated eventually, because any duration of stun can interrupt a cast
- X instances of Y type of cc in Z timeframe, otherwise the cc is ignored
- Squash's non-resetting stacks are an exception
- (future) CC resistance should be reworked into new stats to mitigate durations
- Effects should provide
shouldStack(config)
/incrementStack(config)
methods to determine if a new effect of a matching type should be created or combined - If an effect type template doesn't have shouldStack, always make a new effect
- XYZ check -> new duration mitigation -> shouldStack/incStack/new effect
Todo
-
Track effects by IDs instead of by types -
Implement client-side effect objects w/ lifecycle ( init
,update
,destroy
) -
Move auras to effect template -
Implement sync-extending data to client effects -
Replace noMsg
withsilent
flag -
Handle rezoning/death (should -stun
/-slowed
text show when an object is destroyed? what about when rezoning?) -
Implement shouldStack
&incrementStack
-
Fix uses of noMsg
inaddEffect
-
Fix uses of new
inaddEffect
-
Move buff icon management to client-side (remove onGetBuff
/onRemoveBuff
) -
Create and use new silent selfStun
effect (for charging/etc, that doesn't cancel damage but stops movement and casting) -
Re-implement TTL stacking (create new method to stack ttl or create new effect if needed) -
Test sync-extending data to client effects -
Test (including with multiple players) -
Test shouldStack/incStack -
Remove debug logging -
IDs of persisted effects? (should the ID stay the same, so later callbacks can still remove it? ID counter's interaction with rezoning?)
API changes
- Removed
noMsg
from addEffect (usesilent
) - Removed
new
from addEffect - Removed
removeEffectByName
-
effects.syncRemove
now takes only an effect ID (removedtype
andnoMsg
parameters) -
effects.removeEffect
now takes only an effect ID (removeEffect destroys the effect first and remove it from the array and calls syncRemove; syncRemove removes it on the client-side)
Other Changes/Additions
- Removed double popup text from ice spear
- Client-side effects have lifecycle methods (
init
,update
,destroy
) andsetVisible
method - Call
this.defaultDamageText(removing: boolean)
from custom effect init/destroy methods to create the default popup text - Client-side effects also have
this.obj
,this.self
(boolean) - Server-side effects can call
this.syncExtend(data: object)
to call the matchingextend(data)
function with thedata
on the client-side effect object, or copy the properties from thedata
object on to the client-side effect object - Server-side effects have
this.silent
for changing their behavior - Updated existing spells/effects
Future
- Show target's effects in target UI
- Show party member's effects?
- Visually show durations/stacks of effects
- Indicate CC resists and when they kick in/wear off
- Tooltips on effect icons
- Add particles to existing effects?
- New stats to mitigate CC duration before applying
- Balance XYZ cc resist + duration mitigation stats
- Tags for mobs that make them fully immune to a type of cc (no knockbacks for bosses, etc; use
canApplyEffect
to check before doing pushbacks WITHOUT incrementing the cc resist counter) - Cache
onBeforeGetEffect
requests (build a dict at startup instead of emitting on eachbuildEffect
) - Self vs non-self effect syncing (when needed)
Edited by hazel