x0_i0_deckmany

Library for the Deck of Many Things.

See the spell script x0_s3_deckmany for an example of combining these functions to create a deck.

To make your own deck, just add a "Do<whatever>DeckCard" function for any custom cards you want, then put those cards into the DoDeckDrawPositive/Negative functions. Then recompile the spell script x0_s3_deckmany inside your module and a deck inside your module will use your cards.

NOTE: This file includes x0_i0_henchman and x0_i0_treasure.

Constants

NameValueBrief Description
DECK_DELAY8.0Controls how long to delay the actual card effects for in order to make the message pop up before it happens.
TOKEN_CARD_NAME9324
TOKEN_NAME9323

Functions

NameBrief Description
DoAvatarDeckCardPOSITIVE CARD: The Avatar card. Caster is transformed into an avatar of their alignment.
DoAvatarDeckCardEffectInternal function. Create the avatar item on the caster.
DoAvatarDeckCardTransformInternal function. Do the avatar transformation effect.
DoBequestDeckCardPOSITIVE CARD: The Bequest card. Gain a major unique magical item (this will respect the XP1 treasure system if it is used in the module, otherwise random boss-level treasure will be generated).
DoDeckDrawNegativeDo a negative card draw.
DoDeckDrawPositiveDo a positive card draw.
DoDonjonDeckCardNEGATIVE CARD: The Donjon card. If a donjon area is available, the caster and associates are transported there. The area should be tagged X0_DECK_DONJON1. The starting location should be tagged X0_DECK_START. See the Gauntlet area in module 3 of XP1 as an example. (This is a good model to use if you want to create a "Keep" or "Void" type card for your own module.)
DoFoolDeckCardNEGATIVE CARD: The Fool card. Lose 10,000 XP and get 2 extra cards.
DoFountainDeckCardPOSITIVE CARD: The Fountain card. All of caster's items are recharged and all stacked items are filled up to the maximum possible number.
DoHatchlingDeckCardPOSITIVE CARD: The Hatchling card. A wyrmling of alignment-appropriate color appears and follows the caster as a summoned creature until damaged, at which point it transforms into an adult dragon and fights on the caster's behalf until all enemies are slain, then vanishes.
DoHatchlingDeckCardEffectInternal function. Used to create the hatchling-summoning object.
DoHatchlingDeckCardRecordInternal function. Used to record the hatchling object.
DoHatchlingDeckCardSummonInternal function. Assigned to the caster as an action to cause them to summon the hatchling.
DoHoardDeckCardPOSITIVE CARD: The Hoard card. Gain 50-100,000 gold instantly
DoJokerDeckCardPOSITIVE CARD: The Joker card. Gain 10,000 XP and get 2 extra cards.
DoKnaveDeckCardNEGATIVE CARD: The Knave card. All non-plot possessions not currently equipped are destroyed.
DoLookingGlassDeckCardNEGATIVE CARD: The Looking Glass card. Caster's henchman is replaced with an evil doppelganger.
DoLookingGlassDeckCardEffectInternal function. Run the actual henchman change after a delay.
DoOracleDeckCardPOSITIVE CARD: The Oracle card. Gain permanent premonition effect for duration of the module
DoPlagueDeckCardNEGATIVE CARD: The Plague card. Permanent disease effect applied for duration of the module.
DoPlagueDeckCardEffectInternal function. Used to apply the initial plague effect.
DoSpecialAreaDeckCardGet a special area and transport the caster (with associates but without party members) to the X0_DECK_START waypoint inside it.
DoTraitorDeckCardNEGATIVE CARD: The Traitor card. Change to diametrically-opposed alignment instantly.
DoWyrmDeckCardNEGATIVE CARD: The Wyrm card. A hostile ancient dragon is lured to the caster.
DoWyrmDeckCardEffectInternal function. Run the actual wyrm summon after a delay.
GetHasUsedDeckCheck if the deck has been used before by this creature.
GetNumberDeckDrawsGet the number of draws remaining.
GetSpecialAreaForDeckCardGet a special deck-specific area if it exists and is available. This will start by checking for an area with just the given area tag. If that doesn't exist or is taken, it will start looking for areas tagged sAreaTag + number, until it finds one that is available. X0_DECK_DONJON1, X0_DECK_DONJON2, etc.
SetHasUsedDeckMark that the deck has been used by this creature.
SetNumberDeckDrawsSet the number of draws remaining.


  author: Mistress