Zukero / andors-trail

Andor's Trail
135 stars 68 forks source link

EffectiveActorConditions track applied effects, fixes bug #119 and other issues #126

Open Chriz76 opened 5 years ago

Chriz76 commented 5 years ago

Up to now when an effect was applied to an actor it was applied to existing conditions of the same type but not tracked. This led to problems like #119 when a higher magnitude temporary condition removed a lower magnitude infinite condition.

Now all applied effects are tracked. All the data and logic regarding conditions is encapsulated in the EffectiveActorConditions class, which replaces the conditions member of the Actor class. Most of the logic is moved away from the ActorStatsController and all views now use the EffectiveActorConditions class.

The added information does not only prevent bugs but is also displayed to the user. So he knows how many effects are sources for the current conditions and if conditions will follow when the current conditions timeout. All this does not apply to immunities; their behaviour is unchanged.

To try to make sure everything is working like intended two integration test classes were added which should address most usecases. The tests should be run manually when changing logic regarding the actor conditions to make sure everything is still working.

Manually testing (including rejuvenate, etc) is mandatory after merging this pull request.