Math: Difference between revisions

From FetishQuest Wiki
Jump to navigation Jump to search
JasX (talk | contribs)
JasX (talk | contribs)
No edit summary
Line 190: Line 190:
|healingActionsDoneSinceLast
|healingActionsDoneSinceLast
|Nr healing actions done since their last turn start.
|Nr healing actions done since their last turn start.
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|
|
|-
|-
|
|

Revision as of 00:10, 19 February 2024

The math system in FQ is pretty powerful, and is gradually receiving additional functions which allows you to use it for custom scripts. If a field states that it's a formula, then it uses the math system. The system is based on math.js and all features are supported in FQ, plus a few extras. For an instance, if a field supports a formula, then typing 3+2 into the field would evaluate to 5. Not very useful, but it becomes useful when you use math vars.

Math Vars

Math vars are variables you can reference. The available vars depend on the game event that caused the formula to be evaluated (if any). For an instance, you could use 5/g_team_1 as a formula to divide 5 by the nr of players on team 1.

Game vars (always available):

Var Explanation
g_rain Amount of rain, between 0 and 1.
g_sod Nr of seconds into the current day.
g_team_n Nr of players on team n (like g_team_0 etc)
g_time Time in seconds since the game started (in-game time, any action will affect time)

Dungeon vars (Always available):

Dungeon vars all use the formula: d_<dungeonLabel>_<dVarLabel>

For an instance: the dungeon yuug_portswood_cave has the dungeon var exit_found. You'd reference it by d_yuug_portswood_cave_exit_found.

You can also use %d to automatically target the current dungeon, like %d_exit_found instead of d_yuug_portswood_cave_exit_found.

Factions

Factions all use the formula: f_<factionLabel> such as fac_rattani for the rattani faction value. See the faction help in the editor for more info.

Quests

Currently quest vars only store information about when they were completed (game time): q_<questLabel>__time

RP

Var Explation
rp_targs Nr of RP targs in active roleplay.
rp_<rpLabel>_<rpVar> Fetch an RP var from any RP. Note: To use this, the RP must be set as rpVars Persistent.

You can also use %rp for short to target the currently active roleplay. Such as %rp_var instead of rp_borm_tavern_mayah_var

Players

If a sender is in the event, their mathvars (see Player.js function appendMathVars for a full list) are added with the prefix se_ - If there's a target, they're added with the prefix ta_

Here's a list of mathvars for the players, though don't expect this to be up to date, check the code!

se_ or ta_ is prepended to the var
Var Explanation
SvPhysical Physical avoidance.
SvArcane Arcane avoidance.
SvCorruption Corruption avoidance.
BonPhysical Physical proficiency.
BonArcane Arcane proficiency.
BonCorruption Corruption proficiency.
Lv Player level.
HP Player HP.
Off Player offensive momentum.
Def Player defensive momentum.
Uti Player utility momentum.
tReroll Rerolls used this turn.
Mom Total momentum.
Arousal Arousal.
Team Team.
Size Size.
TeamPlayers Nr players on team (including player).
MaxHP Max HP.
MaxArousal Max arousal.
Money Money in copper.
apSpentThisTurn Momentum spent this turn.
actionUsedThisTurn Nr actions used this turn.
stdCombo Legacy.
aTypes Nr action types used this turn (physical/arcane/corruption), 0-3
ButtSize
BreastSize
PenisSize
Turns Turns taken this battle.
SecondWindUsed Nr second winds used this battle.
SecondWindActive Second wind is active.
SecondWindMax Max second winds for the player.
Talkative
Sadistic
Dominant
Hetero
Emotive
Intelligence
Casting 1 if charging an ability.
UntappedBlock Amount of block that fell off last turn.
Block Amount of block for the player.
Tag_<tag> All tags active on the player. Value is always 1.
damagingReceivedSinceLast Nr damaging attacks received since their last turn start.
damageReceivedSinceLast Damage received since their last turn start.
healingActionsDoneSinceLast Nr healing actions done since their last turn start.

Advanced Formulas

Functions