Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Internal-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,6 @@ Returned a signed string of `val` as dollars, prefixed with "$" if positive and
Returns the result of multiplying `base` and `perma + 1`.
#### `SMODS.add_to_pool(prototype_obj, args) -> bool?, table?`
Helper function to check if an object can be added into a pool,
- If `prototype_obj.in_pool` is defined, returns the result of `in_pool`, otherwise returns `true`.
- If `prototype_obj.in_pool` is defined, returns the result of `in_pool`, otherwise returns `true`.
#### `SMODS.pinch_and_remove(card)`
Destroys the card with the vanilla food Joker animations. In most cases you should use [`SMODS.destroy_cards()`](https://github.com/Steamodded/smods/wiki/Utility) instead.
15 changes: 11 additions & 4 deletions Utility.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,18 @@ Returns true if the card is cosidered to be "eternal" (cannot be destroyed).
Returns a shallow copy of the provided table.
#### `time(func, ...) -> number`
Calls an input function with any given additional arguments: `func(...)` and returns the time the function took to execute in milliseconds. The return value from `func` is lost.
#### `SMODS.destroy_cards(cards, bypass_eternal, immediate, skip_anim)`
Destroys any type of cards given to the function appropriately, with respect to further calculations if called during the scoring loop.
#### `SMODS.is_playing_card(card) -> boolean`
Checks if `card` is a playing card.
#### `SMODS.destroy_cards(cards, args) -> table`
Destroys any type of cards given to the function appropriately, with respect to further calculations if called during the scoring loop. Returns the cards to be destroyed.
- `cards` - Can be an individual `Card` object, or a table of `Card` objects.
- `bypass_eternal` - Destroys cards even if they're Eternal.
- `immediate` - Destroys the cards immediately not creating an event (Note: Card.start_dissolve and Card.shatter internally still create an event)
- `args` is a table that can have the following fields:
- `bypass_eternal` - Destroys cards even if they're Eternal.
- `immediate` - Destroys the cards immediately not creating an event (Note: Card.start_dissolve and Card.shatter internally still create an event)
- `pinch_anim` - Destroys the cards with the vanilla food Joker animation.
- `colours` - Replaces the colours used by `start_dissolve`.
- `delay` - Adds a delay to the event.
- `destroy_func` - Replaces the destroy function used (i.e. replaces `Card.start_dissolve` or `Card.shatter`)
- `skip_anim` - Skips the normal animation and changes it to that of food jokers.
#### `SMODS.add_voucher_to_shop(key)`/`SMODS.add_booster_to_shop(key)`
Adds a `Voucher` or a `Booster` to the current shop.
Expand Down