mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Generate: remove tag "-" (#3036)
* Generate: introduce Remove, similar to Merge * make + dict behave as + for each value --------- Co-authored-by: Zach Parks <zach@alliware.com>
This commit is contained in:
@@ -123,10 +123,21 @@ again using the new options `normal`, `pupdunk_hard`, and `pupdunk_mystery`, and
|
||||
new weights for 150 and 200. This allows for two more triggers that will only be used for the new `pupdunk_hard`
|
||||
and `pupdunk_mystery` options so that they will only be triggered on "pupdunk AND hard/mystery".
|
||||
|
||||
Options that define a list, set, or dict can additionally have the character `+` added to the start of their name, which applies the contents of
|
||||
the activated trigger to the already present equivalents in the game options.
|
||||
## Adding or Removing from a List, Set, or Dict Option
|
||||
|
||||
List, set, and dict options can additionally have values added to or removed from itself without overriding the existing
|
||||
option value by prefixing the option name in the trigger block with `+` (add) or `-` (remove). The exact behavior for
|
||||
each will depend on the option type.
|
||||
|
||||
- For sets, `+` will add the value(s) to the set and `-` will remove any value(s) of the set. Sets do not allow
|
||||
duplicates.
|
||||
- For lists, `+` will add new values(s) to the list and `-` will remove the first matching values(s) it comes across.
|
||||
Lists allow duplicate values.
|
||||
- For dicts, `+` will add the value(s) to the given key(s) inside the dict if it exists, or add it otherwise. `-` is the
|
||||
inverse operation of addition (and negative values are allowed).
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
Super Metroid:
|
||||
start_location:
|
||||
@@ -134,18 +145,21 @@ Super Metroid:
|
||||
aqueduct: 50
|
||||
start_hints:
|
||||
- Morph Ball
|
||||
triggers:
|
||||
- option_category: Super Metroid
|
||||
option_name: start_location
|
||||
option_result: aqueduct
|
||||
options:
|
||||
Super Metroid:
|
||||
+start_hints:
|
||||
- Gravity Suit
|
||||
start_inventory:
|
||||
Power Bombs: 1
|
||||
triggers:
|
||||
- option_category: Super Metroid
|
||||
option_name: start_location
|
||||
option_result: aqueduct
|
||||
options:
|
||||
Super Metroid:
|
||||
+start_hints:
|
||||
- Gravity Suit
|
||||
```
|
||||
|
||||
In this example, if the `start_location` option rolls `landing_site`, only a starting hint for Morph Ball will be created.
|
||||
If `aqueduct` is rolled, a starting hint for Gravity Suit will also be created alongside the hint for Morph Ball.
|
||||
In this example, if the `start_location` option rolls `landing_site`, only a starting hint for Morph Ball will be
|
||||
created. If `aqueduct` is rolled, a starting hint for Gravity Suit will also be created alongside the hint for Morph
|
||||
Ball.
|
||||
|
||||
Note that for lists, items can only be added, not removed or replaced. For dicts, defining a value for a present key will
|
||||
replace that value within the dict.
|
||||
Note that for lists, items can only be added, not removed or replaced. For dicts, defining a value for a present key
|
||||
will replace that value within the dict.
|
||||
|
||||
Reference in New Issue
Block a user