-
Notifications
You must be signed in to change notification settings - Fork 3
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.
MSU adds the following new fields to party
:
BaseMovementSpeedMult
MovementSpeedMult
-
RealBaseMovementSpeed
which is equal toBaseMovementSpeed
-
MovementSpeedFunctions
which is an array to which functions can be added which change theMovementSpeedMultiplier
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.
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()
.
Calls resetBaseMovementSpeed()
and sets this.m.BaseMovementSpeedMult
to 1.05 to result in the vanilla player party movement speed of 105.
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.
create()
Hooked to push the previous four functions to this.m.MovementSpeedMultFunctions
.
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.BaseMovementSpeed
to 100 and then added thegetMovementSpeedMult()
function to return the appropriate value to achieve the same speed as vanilla rangers scenario.
- NOTE: MSU guarantees backwards compatibility for documented features and code only. Undocumented features/code of MSU may be changed at any time without notice, so we advise against using/referencing such code in your projects.
- For bug reports or feature requests, please create issues.
- If you would like to join the team, write to us at msu.team@protonmail.com.