Charles Haynes
Member
CanAdventure 1.2
What is it?
A set of functions to determine if it's possible to adventure in a location. Inspired by zarqon's canadv, but takes a different approach. It's data driven, using a map of locations and predicates, and a general purpose predicate evaluator.
Note: Depends on zarqon's excellent zlib.ash and my log_lib.ash, pageCache.ash, and predicate.ash make sure you install them first.
For Users
canadv location will print whether you can/could adventure in location. Canadv with no parameters will pop up a dialog asking for a location name, an empty location name will cause canadv to list all possible locations and whether you can/could adventure in them.
For Script Authors
Canadv exports methods to check if you can currently adventure in a location, if you could possibly adventure in a location, and if you could adventure somewhere to do what's needed to prepare.
Methods
boolean can_adv(location where)
Returns true if your character can currently adventure in location where.
boolean could_adv(location where)
Returns true if your character could adventure in location where. (The location is open and you can satisfy the prerequisites.)
boolean doit_adv(location where)
Returns true if you could adventure in the location, and takes whatever actions are needed to prepare you to adventure there. Will not do anything that takes an adventure, consume food, drink booze, or use spleen items. Will use items to get effects, equip or unequip items, shrug buffs, uneffect unwanted effects, or change familiars.
Data Files
canadv_location_predicates.txt
Maps from location name to minimum buffed prime stat, "sticky", and a list of predicates. "Sticky" locations are ones that once opened, stay open. Examples of non-sticky locations are the cola wars battlefield, defiled cyrpt, and most boss locations.
Put this file in your data directory.
Issues
The issues are inherited from predicate's limitations. Doesn't go to the guild or council to get new quests or complete ones that you've finished. Won't adventure in the oasis to get ultrahydrated because that would take an adventure. Others as well.
Change Log
1.0 2009/11/18 Initial release
1.1 2009/11/19 added can_adv(location, boolean) for compatibility
1.2 2009/11/20 renamed to avoid confusion with zarqon's canadv
What is it?
A set of functions to determine if it's possible to adventure in a location. Inspired by zarqon's canadv, but takes a different approach. It's data driven, using a map of locations and predicates, and a general purpose predicate evaluator.
Note: Depends on zarqon's excellent zlib.ash and my log_lib.ash, pageCache.ash, and predicate.ash make sure you install them first.
For Users
canadv location will print whether you can/could adventure in location. Canadv with no parameters will pop up a dialog asking for a location name, an empty location name will cause canadv to list all possible locations and whether you can/could adventure in them.
For Script Authors
Canadv exports methods to check if you can currently adventure in a location, if you could possibly adventure in a location, and if you could adventure somewhere to do what's needed to prepare.
Methods
boolean can_adv(location where)
Returns true if your character can currently adventure in location where.
boolean could_adv(location where)
Returns true if your character could adventure in location where. (The location is open and you can satisfy the prerequisites.)
boolean doit_adv(location where)
Returns true if you could adventure in the location, and takes whatever actions are needed to prepare you to adventure there. Will not do anything that takes an adventure, consume food, drink booze, or use spleen items. Will use items to get effects, equip or unequip items, shrug buffs, uneffect unwanted effects, or change familiars.
Data Files
canadv_location_predicates.txt
Maps from location name to minimum buffed prime stat, "sticky", and a list of predicates. "Sticky" locations are ones that once opened, stay open. Examples of non-sticky locations are the cola wars battlefield, defiled cyrpt, and most boss locations.
Put this file in your data directory.
Issues
The issues are inherited from predicate's limitations. Doesn't go to the guild or council to get new quests or complete ones that you've finished. Won't adventure in the oasis to get ultrahydrated because that would take an adventure. Others as well.
Change Log
1.0 2009/11/18 Initial release
1.1 2009/11/19 added can_adv(location, boolean) for compatibility
1.2 2009/11/20 renamed to avoid confusion with zarqon's canadv
Attachments
Last edited: