SPEED CHANGE CONDITION
Current:
The framework handles and tracks the slowed condition, and allows you to manually edit a token's speed, but does not automate speed changes from powers such as Razorclaw Shifting.
Proposed improvement:
Create a condition that records and tracks speed changes.
Method:
Buckle up. This one's a long one.
Go to your campaign properties and into the States tab.
Add a new state named SpeedChange. Its 'group' is Movement, 'type' is Grid Image, 'grid size' is 3x3. Pick an appropriate icon to represent it (this is the icon that will appear on the token when the condition is in effect). I used the 'running person'.
Still in Campaign Propeties, move to the properties tab. Add a new property called MoveAdjusts.
Find the Lib:States4e token and edit it. In the token properties, add SpeedChange next to the entry for MoveAdjusts and add SpeedChange to the list of conditions next to the entry for AllConditions.
In the selection window, find and edit the onCampaignLoad macro. Add this text to the end of the macro:
Code: Select all
[h:defineFunction("procTempMovement", "procTempMovement@this")]
[h:defineFunction("restoreMovement", "restoreMovement@this")]
Save the changes, close the edit window, then click on the macro to run it.
Find and edit the procStates macro. Find this text:
Code: Select all
[h:vlnAdjust=getLibProperty("VAdjusts")]
and add this text below it:
Code: Select all
[h:MAdjust=getLibProperty("MoveAdjusts")]
Find and edit the handleStates macro. Find this text:
Code: Select all
[if(state == "Insubstantial"): procInsub(0)]
[if(state == "Invisible"): setVisible(0)]
and add this text below it:
Code: Select all
[if(listFind(MAdjust,state)!=-1):procTempMovement(state,newDmgVal)]
Create a new Macro (rick click in the selection window and select 'new'). Name the new macro procTempMovement. Edit it to make its group 'Movement Handling'. Paste the following text into the new macro:
Code: Select all
[h:assert(argCount() == 2, "procTempMovement() requires exactly 2
arguments", 0)]
[h:state = arg(0)]
[h:amount = arg(1)]
[h:Speed = Speed + amount]
Find and edit the procAllyStates macro. Find this text:
Code: Select all
[h:vlnAdjust=getLibProperty("VAdjusts")]
and insert this text after it:
Code: Select all
[h:MAdjust=getLibProperty("MoveAdjusts")]
Still in procAllyStates, find this text:
Code: Select all
[h,if(listFind(vlnAdjust,state)!=-1):procTempVulnerable(state,val)]
and add this text below it:
Code: Select all
[h,if(listFind(MAdjust,state)!=-1):procTempMovement(state,val)]
Intermission: The above mods create and integrate the new Speedchange condition. The following mods allow that condition to auto expire.
Select the Lib:States4e token and open its selection window. In the expireCondition macro, find this text:
Code: Select all
[h:tokenET = getConditions(token, 0)]
[h:tokenSE = getConditions(token, 1)]
[h:tokenOD = getConditions(token, 2)]
and beneath it add:
Code: Select all
[h:changeValue = json.get(condInfo, "ogDamAmt")]
Then find this text:
Code: Select all
[h:rvAdjust =getLibProperty("RVAdjusts")]
and beneath it add:
Code: Select all
[h:MAdjust =getLibProperty("MoveAdjusts")]
Then find:
Code: Select all
[h,if(listFind(rvAdjust,condition)!=-1): restoreRV(condition)]
and beneath it add:
Code: Select all
[h,if(listFind(MAdjust,condition)!=-1): restoreMovement(condition, changeValue)]
In the selection window, create a new macro. Call it restoreMovement and allocate it to group Bonus & Penalty Handling. Paste this text into the new macro:
Code: Select all
[h:assert(argCount() == 2, "restoreMovement() requires exactly 2 argument", 0)]
[h:defAdjSource = arg(0)]
[h:changeValue = arg(1)]
[h:setProperty("Speed", Speed-changeValue)]
Outcome:
When you go into the power edit screen, your list of available conditions will now include SpeedChange. Eg. If you add a SpeedChange condition to a power, with a duration of End of Encounter and give it the value 2, the token's speed will increase by 2 until the end of the encounter.
I must say that after following all these instructions, I have a new respect for my player and Rumble.