A spell is represented as a node containing some pieces of data seperated by colons. spell:dependent spell:on/off:type:casting_flag:is_a_target_flag
Chris Brien (christopher_brien@hotmail.com) Paul Mahon (pmahon@sourcemage.org)
(C) 2002 The Source Mage Team
Functions for dealing with dependencies as a non-cyclic directed graph. Since that's such a mouthful, it will simply be referred to as a tree, even though it's not.
SCRIPT_DIRECTORY
Run the spell's PREPARE script if it exists
This will be home to all "other" questions we are supposed to ask about during this phase of things, right now its a placeholder
Run the spell's CONFIGURE script if it exists
Run a spell's DEPENDS if it exists
Run a spell's UP_TRIGGERS if it exists
process any sub-depends the current spell is going to provide These come from the live sub-depends table and from spells that have already been processed
run any sub-depends that we requested on behalf of the sub-dependee
Run a spell's SUB_DEPENDS file for a specific sub-depends. This is idempotent, if a sub-depends has already been processed it will not run the SUB_DEPENDS file again. Expects the sub-dependee to be loaded. If the spell does not have a SUB_DEPENDS file, it is a failure.
Create a map of spells to their dependent spells. Then for all installed or held spells, output a libhash command to join the spell name and dependency info. Then evaluate the output, thus filling a libhash with dependency info.
Create a map of spells to their dependent spells. Then for all installed or held spells, output a libhash command to join the spell name and dependency info. Then evaluate the output, thus filling a libhash with dependency info.
calling this will accomplish several things:
A private function for running a spell's DEPENDS script. No functions except libdepends functions should use this.
Decides if a spell should be cast, or if we can leave it alone. Check if the spell is installed, or if theres some other reason to rebuild it.
Find all the spells that depend on the spell given as $1
Find spells that optionally depended on the current spell but had the dependency disabled, ask if the user wants to recast the spell. Also finds disabled features that the current spell is a provider of.
Delegates provider and spell cases to different worker functions. and gets grimoires if necessary for cross grimoire depends Called by real_depends and real_runtime_depends
Passthrough to real_generic_required_depends, specifies the parts that differ from runtime depends
Passthrough to real_generic_required_depends, specifies the parts that differ from required depends
Delegates provider and spell cases to different worker functions. Called by real_depends and real_runtime_depends
Passthrough to real_generic_optional_depends, specifies the parts that differ from suggest depends
Passthrough to real_generic_required_depends, specifies the parts that differ from optional depends
Asks the user what provider for a depends is desired if a choice has not ben made before.
One of the worker functions. Checks for exiled spell and passes on to the common dependency function, private_common_depends
Handles optional dependency on a provider.
Works just like normal query but can show short description of a spell and stops the timer for taking the default answer if h/H is pressed. Type of query is chosen in sorcery feature menu.
Handles optional dependency on a spell.
Present a list to the user complete with info about whats installed and what isnt and allow a default value to be used
Create a trigger on ourself effecting the target spell, shorthand for putting a TRIGGERS file in the target spell.
Register a trigger, when $SPELL is cast, a $ACTION is executed on $TARGET
Request a sub-depends from $SPELL on $1 for $2 This queues the sub-depends for later processing, if the sub-dependee does not already support the sub-depends.
Force a spell to be recast, if it comes up for processing if the spell was already looked at and processed nothing happens if the spell was already looked at and didnt need processing, then it'll get re-processed (assuming the caller also did a depends on it)
all the depends callbacks eventually bottom out here if a spell depends or doesnt depend on some other spell
Default trigger checking function. Asks user if they want to run the trigger.
Inspects each trigger, asks the user if they want to run it.
Adds the dependency to the hastable
Determine if spell should be lazily updated, possible asks the user what to do.
Removes a dependency and its dependees from the to_cast list.
Does the actual removal
Find all the spells already processed that depend on the spell given as $1 Unlike private_upward_depends, this one works with the uncommitted info
SPELL
Sets a spell's aux. config info.
spell depth (optional) fast -- if set only show spells, not full depends db entries all - if set returns also runtime dependencies
Output the upward dependencies of the specified spell