-
Notifications
You must be signed in to change notification settings - Fork 0
Game Functions
Game functions are used to manage game status. And used by game. But also plugins can use them.
Returns true if game started. Usefull if you have a async job does something and you want to do something while game is running without using hooks.
Resets:
-
cr.playervariables (hp=100, level=0, clear inventory) - current level id to 0
cr.stat.card_setcr.stat.logs- Every
levelof all buffs insidecr.stat.buffsto 0 -
cr.stat.slot*'sbackandfrontfields to nil cr.stat.levels
Takes one required bool parameter full. If full is true resets the things below too:
cr.stat.biomescr.stat.deckcr.stat.buffs- All hooks of plugins
Warning
Avoid using cr.reset_game(full)
This parameter says function to reset everything created from plugins. If you use this, you will destroy everything done before. If you want to remove just one thing from these variables just delete them manualy using :erase() method of the containers. Bu you can't delete hooks.
- Runs
card_eventhooks. If one of hooks returnstrue, returns. - Calls event of the card and applies extra damage with result of event
Takes 2 required arguments:
-
card: (Shared Card) The card. -
extra: (integer) Extra damage
Runs a action depending on card type:
-
cr.card_type.BASICorcr.card_type.EXITorcr.card_type.ENEMY: Runscr.basic_card_eventfor the card. -
cr.card_type.ITEM: Adds card to inventory.
Takes 2 required arguments:
-
card: (Shared Card) The card. -
extra: (integer) Extra damage, passed tocr.basic_card_eventif called.
The thing when user picks a slot.
Takes a required cr.obj.card_slot parameter, the slot picked.
Calls event of the buffs if level of the buff is not 0.
Generates cr.stat.levels from cr.stat.biomes.
Only run if cr.stat.levels is empty. If its not empty, function will does not clears it.
Generates cr.stat.cards randomly from cr.stat.deck using game seed and current level.
Only run if cr.stat.cards is empty. If its not empty, function will does not clears it.
Fills cr.stat.slot* 's back and front.
Removes existing cards inside slots.
-
Getting Started
-
Metadata
-
Variable Types and Variables
-
Game Status
-
TUI