A_RelayCustomValue

From SRB2 Wiki
Jump to navigation Jump to search

A_RelayCustomValue is an action that changes the custom value of the actor's target or tracer. If Var1's upper 16 bits are 0, the target is used; if they are 1, the tracer is used. Var1's lower 16 bits and Var2 control how the custom value is modified:

Var2 New custom value
0 Var1's lower 16 bits
1 Old custom value - Var1's lower 16 bits
2 Old custom value + Var1's lower 16 bits
3 Apply modulo of Var1's lower 16 bits to old custom value
4 Old custom value ÷ Var1's lower 16 bits
5 Old custom value × Var1's lower 16 bits

If Var1's lower 16 bits are 0, the actor's own custom value is used in the above calculations instead. Note that if an attempt is made to divide by zero (i.e.: both Var1's lower 16 bits and the actor's custom value are 0, and Var2 is 4), this action will do nothing.

This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.

  Actions – Custom value [view]
A_CheckCustomValueA_CheckCusValMemoA_CusValActionA_RelayCustomValueA_SetCustomValueA_UseCusValMemo