Template:AdjustReagent: Difference between revisions
imported>Aliser cat |
imported>Aliser cat |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Chance to|{{#ifexpr:{{{amount|0}}}<0 | <includeonly>{{Chance to|{{#ifexpr:{{{amount|0}}}<0 | ||
|{{#ifeq:{{{prob}}}|1|Removes|remove}} {{#expr:abs {{{amount|0}}}}} {{#invoke:Chemistry Lookup|readscalar|{{{reagent}}}|name}} | |{{#ifeq:{{{prob}}}|1|Removes|remove}} {{#expr:abs {{{amount|0}}}}} {{#invoke:Chemistry Lookup|readscalar|{{{reagent}}}|name}} | ||
|{{#ifeq:{{{prob}}}|1|Adds|add}} {{#expr:abs {{{amount|0}}}}} {{#invoke:Chemistry Lookup|readscalar|{{{reagent}}}|name}} | |{{#ifeq:{{{prob}}}|1|Adds|add}} {{#expr:abs {{{amount|0}}}}} {{#invoke:Chemistry Lookup|readscalar|{{{reagent}}}|name}} | ||
}}{{#if:{{{when|}}}| when {{{when}}}}}.|prob={{{prob}}}}} | }}{{#if:{{{when|}}}| when {{{when}}}}}.|prob={{{prob}}}}}</includeonly><noinclude> | ||
{{documentation}} | |||
[[Category: | [[Category:Recipe templates]] | ||
<templatedata> | |||
{ | |||
"params": { | |||
"amount": { | |||
"label": "Amount of change", | |||
"description": "Usually a whole number", | |||
"example": "4", | |||
"type": "number", | |||
"default": "0", | |||
"suggested": true | |||
}, | |||
"prob": { | |||
"label": "Probability of a change occurring", | |||
"description": "A number from 0 to 1.", | |||
"example": "0.4", | |||
"type": "number", | |||
"required": true | |||
}, | |||
"reagent": { | |||
"label": "Reagent ID", | |||
"description": "A reagent ID. See the list here: https://wiki.spacestation14.io/wiki/User:Moony/chem_prototypes.json", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"when": { | |||
"label": "Condition", | |||
"example": "more than 1u lexorin present", | |||
"type": "string", | |||
"required": true | |||
} | |||
}, | |||
"description": "Describes a chance of adding or removing certain reagent when a condition satisfies.\n\n" | |||
} | |||
</templatedata></noinclude> | |||
Latest revision as of 17:04, 24 June 2024
Template:Documentation <templatedata> { "params": { "amount": { "label": "Amount of change", "description": "Usually a whole number", "example": "4", "type": "number", "default": "0", "suggested": true }, "prob": { "label": "Probability of a change occurring", "description": "A number from 0 to 1.", "example": "0.4", "type": "number", "required": true }, "reagent": { "label": "Reagent ID", "description": "A reagent ID. See the list here: https://wiki.spacestation14.io/wiki/User:Moony/chem_prototypes.json", "type": "string", "required": true }, "when": { "label": "Condition", "example": "more than 1u lexorin present", "type": "string", "required": true } }, "description": "Describes a chance of adding or removing certain reagent when a condition satisfies.\n\n" } </templatedata>