Party, Player Party, Scenarios - MSUTeam/MSU GitHub Wiki
Party, Player Party, Scenarios
MSU adds a robust movement speed system for parties on the world map. This is accomplished via new fields, new functions as well as some modified vanilla functions.
party
New fields
MSU adds the following new fields to party:
BaseMovementSpeedMultMovementSpeedMultRealBaseMovementSpeedwhich is equal toBaseMovementSpeedMovementSpeedFunctionswhich is an array to which functions can be added which change theMovementSpeedMultiplier
New functions
MSU adds the following new functions to party:
setBaseMovementSpeed ( _speed )
Sets the this.m.BaseMovementSpeed field to _speed.
resetBaseMovementSpeed()
Sets the this.m.BaseMovementSpeed to this.m.RealBaseMovementSpeed.
getBaseMovementSpeedMult()
Returns this.m.BaseMovementSpeedMult.
setBaseMovementSpeedMult( _mult )
Sets this.m.BaseMovementSpeedMult to _mult.
getMovementSpeedMult()
Returns this.m.MovementSpeedMult.
setMovementSpeedMult( _mult )
Sets this.m.MovementSpeedMult to _mult.
getFinalMovementSpeedMult()
Calls all the functions in the this.m.MovementSpeedFunctions array and multiplies the returned values together. Then returns this resulting multiplier.
updateMovementSpeedMult()
Sets this.m.MovementSpeedMult to the return value of getFinalMovementSpeedMult(). Intended to be called after any movement speed factors might have changed.
Modified functions
getMovementSpeed()
Now returns the produce of this.m.BaseMovementSpeed and this.m.MovementSpeedMult.
onUpdate()
Hooked to set this.m.BaseMovementSpeed equal to getMovementSpeed(). Calls resetBaseMovementSpeed() after onUpdate().
player_party
Calls resetBaseMovementSpeed() and sets this.m.BaseMovementSpeedMult to 1.05 to result in the vanilla player party movement speed of 105.
New Functions
getRosterMovementSpeedMult()
Queries any movementSpeedMult changes due to the roster, checks for getMovementSpeedMult key in each brother. Returns mult float.
getStashMovementSpeedMult()
Queries any movementSpeedMult changes due to items, checks for getMovementSpeedMult key in each item in the player stash. Returns mult float.
getOriginMovementSpeedMult()
Queries any movementSpeedMult changes due to the origin/scenario, checks for getMovementSpeedMult key in the origin. Returns mult float.
getRetinueMovementSpeedMult()
Queries any movementSpeedMult changes due to the retinue, checks for getMovementSpeedMult key in each follower. Returns mult float.
Modified Functions
create()
Hooked to push the previous four functions to this.m.MovementSpeedMultFunctions.
Scenarios
The following scenarios were hooked to conform to the new MSU standards while achieving the same results as vanilla:
- Rangers scenario:
onInit()was hooked to reset thethis.m.BaseMovementSpeedto 100 and then added thegetMovementSpeedMult()function to return the appropriate value to achieve the same speed as vanilla rangers scenario.