SWG-Source / dsrc

Other
11 stars 49 forks source link

Fix for trader crafting assembly build a buff #350

Closed HeronAlexandria closed 2 years ago

HeronAlexandria commented 2 years ago

The trader assembly buff is applying only food assembly. The intent of this buff is to provide an assembly buff for all kinds of crafting.

Build a buff works in "affects" which indicate what is modified for the selected buff. The existing system allows only for one affect, which is why the assembly buff is limited to food assembly.

This fix adds an mapping table, which allows multiple buffs to be applied to an effect. In this fix, the food_assembly affect was changed to crafting_assembly. The mapping mechanism searches for entries of crafting_assembly, and applies a list of effects. In the case of crafting_assembly, this is the trader assembly buffs.

If the affect is not in the mapping table, then the effect is applied normally. For example, change the effect from crafting_assembly and back to food_assembly and only food assembly will be applied.

Since the fix is table driven, it allows servers to choose how they want the system to function. The effects could be grouped, or a server can choose to apply the assembly buffs individually.

This fix should provide the intended functionality without hard coding.