@q @program asys-defrem 1 99999 d i ( asys-defrem v1.2 Jessy @ FurryMUCK 6/97, 2/99 asys-defrem runs the Argo +define command, which is add, modify or remove entries in the Argo database of skills, spells, psiabs, items, weapons, groups, templates, creatures and NPCs. INSTALLATION: asys-defrem uses the default Argo installation method. Port and install lib-argo. Set asys-defrem W. Type '+install asys-deferm' to install this program and its action. USAGE: +define ............... Follow prompts to add or modify entries in the Argo database +remove ............... Follow prompts to remove entries from the Argo database See lib-argo and the Argo manual for further information. asys-defrem may be freely ported. Please comment any changes. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $include $lib/lmgr $include $lib/edit $include $lib/editor $include $lib/strings $include $lib/reflist $include $lib/argo lvar ourArg (* inital arg string, unmodified *) lvar ourBoolean (* i: flow control var *) lvar ourCom (* string: 'official' name of command *) lvar ourCat (* string: category to be defined *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourObject (* string: object we're defining or removing *) lvar scratch (* workspace var *) : DoInstall ( -- ) (* install program into Argo system *) caller program? not if (* confirm installation method *) ">> Programs must be installed via the " "+install" GetCommandName strcat " command." strcat Tell exit then prog "@a/version" getpropstr if (* confirm re-install *) ">> Reinstalling..." Tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-defrem" setprop RecOldActions #0 "+define" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+define" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+define" setprop #0 "+remove" newexit dup scratch ! (* create command *) prog setlink scratch @ "@a/version" thisVersion setprop (* set version *) #0 "@a/comm_list/+remove" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+remove" setprop (* set category props *) #0 "@a/cat_list/advantages" "Advantage" setprop #0 "@a/cat_list/creatures" "Creature" setprop #0 "@a/cat_list/disadvantages" "Disadvantage" setprop #0 "@a/cat_list/groups" "Group" setprop #0 "@a/cat_list/jobs" "Job" setprop #0 "@a/cat_list/npcs" "NPC" setprop #0 "@a/cat_list/objects" "Object" setprop #0 "@a/cat_list/psiabs" "Psiab" setprop #0 "@a/cat_list/skills" "Skill" setprop #0 "@a/cat_list/spells" "Spell" setprop #0 "@a/cat_list/template" "Template" setprop #0 "@a/stats/str" "Strength" setprop #0 "@a/stats/con" "Constitution" setprop #0 "@a/stats/dex" "Dexterity" setprop #0 "@a/stats/int" "Intelligence" setprop #0 "@a/stats/pre" "Presence" setprop #0 "@a/stats/cra" "Craft Skill" setprop #0 "@a/stats/phy" "Physical Skill" setprop #0 "@a/realms" REF-allrefs ourCounter ! begin ourCounter @ while dup "@a/cat_list/advantages" "Advantage" setprop dup "@a/cat_list/creatures" "Creature" setprop dup "@a/cat_list/disadvantages" "Disadvantage" setprop dup "@a/cat_list/groups" "Group" setprop dup "@a/cat_list/jobs" "Job" setprop dup "@a/cat_list/npcs" "NPC" setprop dup "@a/cat_list/objects" "Object" setprop dup "@a/cat_list/psiabs" "Psiab" setprop dup "@a/cat_list/skills" "Skill" setprop dup "@a/cat_list/spells" "Spell" setprop dup "@a/cat_list/template" "Template" setprop dup "@a/stats/str" "Strength" setprop dup "@a/stats/con" "Constitution" setprop dup "@a/stats/dex" "Dexterity" setprop dup "@a/stats/int" "Intelligence" setprop dup "@a/stats/pre" "Presence" setprop dup "@a/stats/cra" "Craft Skill" setprop dup "@a/stats/phy" "Physical Skill" setprop pop ourCounter @ 1 - ourCounter ! repeat ">> Installed." Tell ; : DoUninstall (* uninstall program from Argo *) prog "@a/name" getpropstr if ourDataObj @ "@a/prog_list/" prog "@a/name" getpropstr strcat getprop not if ">> " prog name strcat " is not currently installed." strcat Tell pid kill then else ">> " prog name strcat " is not currently installed." strcat Tell pid kill then ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then background "@a/comm_list/+define" RemoveCommand "@a/comm_list/+remove" RemoveCommand #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop RecOldActions ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoHelp ( -- ) (* display help screen *) " " Tell "asys-defrem (#" prog intostr strcat ")" strcat Tell " " Tell "The " command @ strcat " command is a staff-only command used to add or modify skills, " "spells, psionic abilities, advantages, disadvantages, groups, " "objects, NPCs, or templates to the Argo system. The syntax is " "simply typing the '$com' command, and following prompts. See " "the Argo manual for more information about creating definitions." strcat strcat strcat strcat strcat command @ "$com" subst Tell " " Tell ; : DoClassHelp ( -- ) (* show help screen about object classes *) " " Tell "Objects defined for use in Argo have 'classes': settings that indicate what " "they are. For example, a Long Sword object might have the classes 'weapons' " "and 'metals'. Some classes, such as 'weapons' here, cause this program to ask " "additional questions, so that it can make appropriate settings on the " "object. Others, such as 'metals', would not trigger additional questions, " "but would cause created objects to have the appropriate class. The Long " "Sword would have the class 'metals', and programs that detect or require " "metal would recognize it as metallic. All objects must have at least " "one class." strcat strcat strcat strcat strcat strcat strcat strcat Tell " " Tell "Objects also have a 'class value', which -- depending on the class -- is " "treated either as an arbitrary indication of 'how much' or 'how well' the " "object instantiates its class, or as an indication of 'how many' instances " "of the class it provides. Examples: A powerful magic item could have the " "class 'magic' with a class value of '6', while a weaker magic item would " "have a class value of '1'. Or, an object called '9mm Clip' could have the " "class 'ammo' with a class value of '13', indicating that it provides 13 " "instances of ammo. If you are not sure what to enter for class value, " "enter '1'." strcat strcat strcat strcat strcat strcat strcat strcat Tell " " Tell ; : DoTimeHelp ( -- ) (* show help for time format *) "To enter a time required, combine a positvie number and a standard unit " "of time such as minutes, hours, or weeks. Valid example time strings " "would include '1 hour', '12 weeks', 'two months', etc." strcat strcat Tell " " Tell "If no time is required, enter 0." Tell ; : DoDiceHelp ( -- ) (* show help for dice strings *) "Dice strings use the following syntax:" Tell " " Tell " d[+|-]" Tell " " Tell "For example, to indicate a roll of three six-sided dice, use " "'3d6'. To indicate a roll of two eight-sided dice minus two, use " "'2d8-2'." strcat strcat Tell ; : DoWeaponTypeHelp ( -- ) (* show help for weapon types *) "Most weapons, including melee weapons such as swords and pikes, missle " "weapons such as arrows and spears, and projectile weapons such as guns, " "do 'conventional' damge. For any 'normal' weapon, you should enter " "'conventional' (or the first few letters of 'conventional') as the " "damage type. " strcat strcat strcat strcat Tell " " Tell "Additionally, magic weapons and spells should, as a rule, be defined as " "doing 'conventional' damage. A fireball spell uses magical fire to do " "'conventional' damage. A magic sword is magically enhanced, but it still " "does 'conventional' damage. " strcat strcat strcat Tell " " Tell "Normal armor defends against 'conventional' damage." Tell " " Tell "But, you are free to define weapons that do some other type of damage, " "and which would only be affected by armor that is defined as effective " "against this other, non-conventional type. For example, on an SF world " "you might want to define high-tech weapons that do 'cellular' damage; " "only armor that is also specified as effective for 'cellular' damage " "would be effective against these weapons." strcat strcat strcat strcat strcat Tell ; : DoRangeHelp ( -- ) (* show help for weapon ranges *) "Ranged weapon definitions require that you enter a 'range modifier' " "and a 'maximum range'. The basic Argo combat system does not use " "these values, but players may use them to determine whether targets " "are in range and whether modifiers should be applied to rolls because " "of range. (Positioning programs that allow coded use of target ranges " "may be added at some point.)" strcat strcat strcat strcat strcat Tell " " Tell "The units for both values is meters. Do not type 'meters' in your " "entries; simply type a number indicating a distance in meters." strcat Tell " " Tell "The 'maximum range' is simply the maximum range at which the weapon " "may be used. The 'range modifier' is the increment at which a -1 " "modifier should be applied. For example, a throwing knife might be " "defined as having a maximum range of 20 and a range modifier of 5. " "This would indicate that the knife may be thrown at targets up to " "20 meters away. If the target is 5 to 9 meters away, a -1 modifier " "should be applied. If the target is 10 to 14 meters away, a -2 " "modifier should be applied. If the target is 15 to 19 meters away, " "a -2 modifier should be applied. If the target is exactly 20 meters " "away, a -4 modifier should be applied." strcat strcat strcat strcat strcat strcat strcat strcat strcat Tell ; : DoRollModHelp ( -- ) (* show help screen for roll modifiers *) "A difficulty modifier may be applied to die rolls, such as those made " "against abilities when rolling to make an object. When prompted for " "a difficulty modifier, use negative numbers for more difficult rolls, " "positive numbers for easy rolls, and zero for standard rolls" strcat strcat strcat Tell " " Tell "Some examples: A difficulty modifier of -4 would indicate that the " "roll is quite difficult. A difficulty modifer of 1 would indicate that " "the roll is a bit easier than a standard roll. A difficulty modifier of " "0 would mean that it is a standard roll: an unmodified roll against " "the ability would be made by the command to make or modify the object." strcat strcat strcat strcat Tell ; : DoHiringModHelp ( -- ) (* show help screen for hiring modifiers *) "Some jobs are difficult to find, even for qualified applicants. " "Other jobs are easy to find. Use a hiring modifier to reflect this: " "a hard-to-find job, such as 'movie star', should have a negative " "modifier, -4 to -6 in this case; and easy-to-find job such as " "'dishwasher' should have a positive modifier, 3 to 4 in this case." "Use a modifier of 0 zero for jobs that are neither especially " "difficult nor especially easy to find." strcat strcat strcat strcat strcat strcat Tell ; : DoCatList ( -- ) (* display category choices *) " " Tell (* loop through category list; get names; format to 3 cols *) "1" ourCounter ! #0 "@a/cat_list/" nextprop scratch ! begin (* begin cat-listing loop *) scratch @ while (* first column *) ourCounter @ 4 LPad ") " strcat ourDataObj @ scratch @ getpropstr strcat 24 Pad ourDataObj @ scratch @ nextprop scratch ! ourCounter @ atoi 1 + intostr ourCounter ! scratch @ not if (* second column *) Tell break else ourCounter @ 4 LPad ") " strcat ourDataObj @ scratch @ getpropstr strcat strcat 48 Pad ourDataObj @ scratch @ nextprop scratch ! ourCounter @ atoi 1 + intostr ourCounter ! then scratch @ not if (* third column *) Tell break else ourCounter @ 4 LPad ") " strcat ourDataObj @ scratch @ getpropstr strcat strcat Tell ourDataObj @ scratch @ nextprop scratch ! ourCounter @ atoi 1 + intostr ourCounter ! then repeat (* end cat-listing loop *) " " Tell ; : DoClassList (* list object classes *) "@a/dtemp/" me @ intostr strcat "/" strcat scratch ! ourDataObj @ scratch @ RemoveDir-r NukeStack begin depth while ourDataObj @ scratch @ 3 pick strcat rot setprop repeat ourDataObj @ "@a/objects/" nextprop dup if begin dup while ourDataObj @ over "/class/" strcat nextprop begin dup while dup dup "/" rinstr strcut swap pop dup ourDataObj @ scratch @ rot CapAll strcat rot CapAll setprop ourDataObj @ swap nextprop repeat pop ourDataObj @ swap nextprop repeat pop else pop then ourDataObj @ scratch @ 3-coln-prop ourDataObj @ scratch @ RemoveDir-r ; : FindNumCat ( s -- s i ) (* find skill specified by number in list; return name and T|F *) atoi scratch ! (* store num string as int *) #0 "@a/cat_list/" nextprop ourCounter ! 0 begin (* begin cat-finding loop *) ourCounter @ not if scratch @ intostr 0 rot pop break then 1 + dup scratch @ = if pop ourDataObj @ ourCounter @ getpropstr 1 exit then ourDataObj @ ourCounter @ nextprop ourCounter ! repeat (* end cat-finding loop *) ; : DoDefWeapon ( -- ) (* get data for weapon def *) (* get weapon type *) begin ">> What type of damage does this weapon cause?" Tell ">> [Enter type, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoWeaponTypeHelp pop continue then "conventional" over stringpfx if ourDataObj @ scratch @ "combat/type" strcat "conventional" setprop pop ">> Damage type set to 'conventional'." Tell break else ourDataObj @ scratch @ "combat/type" strcat 3 pick CapAll setprop ">> Damage type set to '$type'." swap "$type" subst Tell break then repeat (* get weapon damage *) begin ">> How much damage does this weapon do?" Tell ">> [Enter dice to be rolled for damage, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoDiceHelp pop continue then dup "d" instr if ourDataObj @ scratch @ "combat/dam" strcat rot setprop break else ">> Sorry, that doesn't look like a dice string." Tell pop continue then repeat (* get skill to roll against *) begin ">> What skill is rolled against when using this weapon?" Tell ">> [Enter a skill name, or .q to quit]" Tell ReadLine strip QCheck ourDataObj @ "@a/skills/" 3 pick strcat getpropstr if ourDataObj @ scratch @ "combat/skills/" strcat rot strcat "1" setprop else ">> Skill not found. " Tell pop continue then ">> Skill entered." Tell ">> Do you want to enter another skill that can be used? (y/n)" Tell ReadYesNo not if break then repeat (* is it a ranged weapon? *) ">> Is this a ranged weapon, such as a bow or gun? (y/n)" Tell ReadYesNo if ourDataObj @ scratch @ "combat/ranged" strcat "1" setprop then (* is it a thrown weapon? *) ">> Is this a thrown weapon, such as a throwing knife or shurken? (y/n)" Tell ReadYesNo if ourDataObj @ scratch @ "combat/thrown" strcat "1" setprop then (* can weapon be dodged? *) ">> Can this weapon be dodged? (y/n)" Tell ReadYesNo If ourDataObj @ scratch @ "combat/dable" strcat "1" setprop then (* can weapon be blocked? *) ">> Can this weapon be blocked? (y/n)" Tell ReadYesNo If ourDataObj @ scratch @ "combat/bable" strcat "1" setprop then (* can weapon be parried? *) ">> Can this weapon be parried? (y/n)" Tell ReadYesNo If ourDataObj @ scratch @ "combat/pable" strcat "1" setprop then (* get hands required *) begin ">> Is this a one- or two-handed weapon?" Tell ">> [Enter 1, 2, or .q to quit]" Tell ReadLine strip QCheck dup "1" smatch "one" 3 pick stringpfx or if ourDataObj @ scratch @ "combat/hands" strcat "1" setprop break then dup "2" smatch "two" 3 pick stringpfx or if ourDataObj @ scratch @ "combat/hands" strcat "2" setprop break then ">> Sorry, invalid entry." Tell pop repeat ">> Can this weapon be used to parry? (y/n)" Tell ReadYesNo if ourDataObj @ scratch @ "combat/parry" strcat "1" setprop then (* get minimum str *) begin ">> What is the minimum Strength required to use this weapon?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, minimum Strength must be a positive number." Tell pop continue then ourDataObj @ scratch @ "combat/minstr" strcat rot setprop break repeat (* get range data, if applicable *) ourDataObj @ scratch @ "combat/ranged" strcat getpropstr if begin ">> What is the maximum range of this weapon?" Tell ">> [Enter a number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoRangeHelp pop continue then dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the maximum range must be a positive number." Tell pop continue then ourDataObj @ scratch @ "combat/maxrange" strcat rot setprop break repeat then ourDataObj @ scratch @ "combat/ranged" strcat getpropstr if begin ">> What is the range modifier of this weapon?" Tell ">> [Enter a number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoRangeHelp pop continue then dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the range modifier must be a positive number." Tell pop continue then ourDataObj @ scratch @ "combat/rangemod" strcat rot setprop break repeat then (* get ammo data *) ">> Does this weapon require ammunition or charges? (y/n)" Tell ReadYesNo if begin ">> What class or ammo or charge units does the weapon require?" Tell ">> [Enter *class* of ammo or charges, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if " weapon can be used." " You will need to define an object of this class before this" ">> NOTE: No objects of this class have been defined." Tell Tell Tell then ourDataObj @ scratch @ "combat/ammo" strcat rot setprop break repeat begin ">> How many rounds or charges does the weapon hold?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, number of rounds must be positive." Tell pop continue then ourDataObj @ scratch @ "combat/rounds" strcat rot setprop break repeat begin ">> How long does it take to reload the weapon?" Tell ">> [Enter time, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoTimeHelp pop continue then ParseTimeString if ourDataObj @ scratch @ "combat/reload" strcat rot setprop break else ">> Sorry, unable to parse entry." Tell pop continue then repeat then ; (* i'm tired of writing comments; these are all self-explanatory *) : DoDefArmor ( -- ) (* get data for an armor object *) begin ">> What types of damage is this armor effective against?" Tell ">> Enter damage type, .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoWeaponTypeHelp pop continue then "conventional" over stringpfx if ourDataObj @ scratch @ "armor/type/conventional" strcat "yes" setprop ">> Set. Armor is effective against conventional damage." Tell else ourDataObj @ scratch @ "armor/type/" strcat 3 pick strcat "yes" setprop ">> Set. Armor is effective against $type damage." swap "$type" subst Tell then ">> Do you want to enter additional types of damage? (y/n)" Tell ReadYesNo not if break then repeat ">> Does this $armor make the wearer harder to hit? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> By how many points does it reduce chance to hit?" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "armor/hitred" strcat rot setprop break repeat then ">> Does this $armor reduce damage when the user is hit? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> By how many points does it reduce damage?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "armor/damred" strcat rot setprop break repeat then ">> Does this $armor reduce the user's Dexterity in combat? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> By how many points does it reduce Dexterity?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "armor/dexred" strcat rot setprop break repeat then ">> Does wearing this $armor accelerate fatigue? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> By how many points per turn does it accelerate fatigue?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "armor/fatacc" strcat rot setprop break repeat then ">> Does wearing this $armor slow the wearer's actions? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> How many seconds does it add to the wearer's turn?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "armor/turnslow" strcat rot setprop break repeat then ">> Does this $armor require a power source? (y/n)" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ReadYesNo if begin ">> What type of power source does the $armor require?" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ">> [Enter *class* of power source, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if ">> NOTE: No objects of that class are currently defined." Tell " You will need to define one before the $armor can be used." ourBoolean @ if "shield" else "armor" then "$armor" subst Tell then ourDataObj @ scratch @ "armor/power" strcat rot setprop break repeat begin ">> How many charges of this power source does the $armor hold?" ourBoolean @ if "shield" else "armor" then "$armor" subst Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the number of charges must be positive." Tell pop continue then ourDataObj @ scratch @ "armor/charges" strcat rot setprop break repeat then ; : DoDefShield ( -- ) (* get data for making a shield *) (* use same queries as armor; use ourBoolean to indicate formatting *) 1 ourBoolean ! DoDefArmor ; : DoDefMake ( -- ) (* get data for making an object *) ">> Are any abilities required to make this object? (y/n)" Tell ">> NOTE: These are simply abilities the character has to have." Tell ">> No rolls will be made against abilities specified here." Tell ReadYesNo if begin ReadAbilitySet if "," explode pop ourDataObj @ scratch @ "create/prereqs/$cat/$inst" strcat rot "$cat" subst rot "$inst" subst rot setprop ">> Ability recorded. Do you want to add another? (y/n)" Tell ReadYesNo not if break then else break then repeat then " successfully make the object." " specified, the player must succeed on all rolls in order to " ">> NOTE: More than one roll may be specified. If multiple rolls are " ">> Is one or more rolls required to successfully make this object? (y/n)" Tell Tell Tell Tell ReadYesNo if begin begin ">> What is the category of this ability?" Tell ">> [Enter stat, skill, spell, or psiab (no dis-ads), or .q to quit" Tell ReadLine strip QCheck "stats" over stringpfx if pop "stats" break then "skills" over stringpfx if pop "skills" break then "spells" over stringpfx if pop "spells" break then "psiabs" over stringpfx if pop "psiabs" break then ">> Category not found." Tell pop repeat begin ">> What is the instance of this ability?" Tell ">> [Enter instance ('str', 'mechanic', etc.), or .q to quit]" Tell ReadLine strip QCheck over "stats" smatch if AbbreviateStat then ourDataObj @ "@a/$cat/$inst" 3 pick "$inst" subst 4 pick "$cat" subst getpropstr if scratch @ "create/rolls/$cat/$inst" strcat rot "$cat" subst swap "$inst" subst break else ">> Ability not found." Tell pop pop then repeat begin ">> What is the difficulty modifier for this roll?" Tell ">> [Enter roll modifier number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoRollModHelp pop continue then dup number? if ourDataObj @ rot rot setprop break else ">> Sorry, that's not a number." Tell pop continue then repeat ">> Roll entered. Do you want to enter an additional roll? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any tools required to make this object? (y/n)" Tell ReadYesNo if begin ">> What tools are required to make the object?" Tell ">> [Enter *class* of tool, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if ">> You will need to define one before this object " "can be made." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this tool are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ scratch @ "create/tools/" strcat 4 rotate strcat rot setprop ">> Tool entered. Are any other tools required? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any materials required to make this object? (y/n)" Tell ReadYesNo if begin ">> What materials are required to make the object?" Tell ">> [Enter *class* of tool, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if ">> You will need to define one before this object " "can be made." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this material are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ scratch @ "/create/materials/" strcat 4 rotate strcat rot setprop ">> Material entered. Are any other materials required? (y/n)" Tell ReadYesNo not if break then repeat then begin ">> How long does it take to make this object?" Tell ">> [Enter time, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoTimeHelp pop continue then dup ParseTimeString if ourDataObj @ scratch @ "create/time" strcat rot setprop pop break else ">> Unable to parse time required." Tell pop continue then repeat ">> Does it cost money to make this object? (y/n)" Tell ReadYesNo if begin ">> How much does it cost to make this object?" Tell ">> [Enter cost in $coins, or .q to quit]" ourDataObj @ "@a/sysparms/small_coins" getpropstr "$coins" subst Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> NOTE: You have entered a negative number." Tell ">> Players' money will INCREASE each time they make this." Tell then ourDataObj @ scratch @ "create/cost" strcat rot setprop break repeat then ; : DoDefMods ( -- ) (* get ability modifiers for object *) begin (* get ability modifiers *) ReadAbilitySet if "," explode pop ourDataObj @ scratch @ "$cat/$inst" strcat rot "$cat" subst rot "$inst" subst rot setprop ">> Ability recorded. Do you want to add an additional modification? (y/n)" Tell ReadYesNo not if break then else break then repeat ">> Does the object need to be readied in order to modify abilities? (y/n)" Tell ReadYesNo if ourDataObj @ scratch @ "ready_mod" strcat "1" setprop then ; : DoDefRepair ( -- ) (* get an object's repair info *) ">> Are any abilities required to repair the object? (y/n)" Tell ReadYesNo if begin ReadAbilitySet if "," explode pop ourDataObj @ scratch @ "repair/prereqs/$cat/$inst" strcat rot "$cat" subst rot "$inst" subst rot setprop ">> Ability recorded. Do you want to add an additional ability? (y/n)" Tell ReadYesNo not if break then else break then repeat then ">> Are an rolls required to repair the object? (y/n)" Tell ReadYesNo if begin begin ">> What is the category of this ability?" Tell ">> [Enter stat, skill, spell, or psiab (no dis-ads), or .q to quit" Tell ReadLine strip QCheck "stats" over stringpfx if pop "stats" break then "skills" over stringpfx if pop "skills" break then "spells" over stringpfx if pop "spells" break then "psiabs" over stringpfx if pop "psiabs" break then ">> Category not found." Tell pop repeat begin ">> What is the instance of this ability?" Tell ">> [Enter instance ('str', 'mechanic', etc.), or .q to quit]" Tell ReadLine strip QCheck over "stats" smatch if AbbreviateStat then ourDataObj @ "@a/$cat/$inst" 3 pick "$inst" subst 4 pick "$cat" subst getpropstr if scratch @ "repair/rolls/$cat/$inst" strcat rot "$cat" subst swap "$inst" subst break else ">> Ability not found." Tell pop pop then repeat begin ">> What is the difficulty modifier for this roll?" Tell ">> [Enter roll modifier number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoRollModHelp pop continue then dup number? if ourDataObj @ rot rot setprop break else ">> Sorry, that's not a number." Tell pop continue then repeat ">> Roll entered. Do you want to enter an additional roll? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any tools required to repair this object? (y/n)" Tell ReadYesNo if begin ">> What tools are required to repair the object?" Tell ">> [Enter *class* of tool, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if ">> You will need to define one before this object " "can be repaired." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this tool are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ scratch @ "repair/tools/" strcat 4 rotate strcat rot setprop ">> Tool entered. Are any other tools required? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any materials required to repair this object? (y/n)" Tell ReadYesNo if begin ">> What materials are required to repair the object?" Tell ">> [Enter *class* of tool, or .q to quit]" Tell ReadLine strip QCheck dup VerifyClass not if ">> You will need to define one before this object " "can be repaired." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this material are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ scratch @ "/repair/materials/" strcat 4 rotate strcat rot setprop ">> Material entered. Are any other materials required? (y/n)" Tell ReadYesNo not if break then repeat then begin ">> How long does it take to repair this object?" Tell ">> [Enter time, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoTimeHelp pop continue then dup ParseTimeString if ourDataObj @ scratch @ "repair/time" strcat rot setprop break else ">> Unable to parse time required." Tell pop continue then repeat ">> Does it cost money to repair this object? (y/n)" Tell ReadYesNo if begin ">> How much does it cost to repair this object?" Tell ">> [Enter cost in $coins, or .q to quit]" ourDataObj @ "@a/sysparms/small_coins" getpropstr "$coins" subst Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, entry must be a positive number." Tell pop continue then ourDataObj @ scratch @ "repair/cost" strcat rot setprop break repeat then ; : DoDefDurability ( -- ) (* get an objects durability *) begin ">> How many times can this object be used before it wears out?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the number of uses must be positive." Tell pop continue then ourDataObj @ scratch @ "uses" strcat rot setprop break repeat ; : DoDefObject ( s -- i ) (* define an object *) pop begin ">> What is the name of this object?" Tell ">> [Enter a name string, or .q to quit]" Tell ReadLine strip QCheck dup "&" instr over "me" smatch or over "home" smatch or over "here" smatch or if ">> Sorry, that's not a valid name for a MUCK object." Tell pop continue then CapAll ourDataObj @ "@a/objects/" 3 pick strcat "/" strcat nextprop if ">> An object called $object has already been defined." over "$object" subst Tell ">> Do you want to redefine it? (y/n)" Tell ReadYesNo not if ">> Aborted." Tell exit then then "@a/dtemp/$me/$object/" me @ intostr "$me" subst over "$object" subst scratch ! ourObject ! ourDataObj @ scratch @ "name" strcat ourObject @ setprop break repeat begin begin ">> What class is $object?" ourObject @ "$object" subst Tell ">> [Enter a class, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoClassHelp pop continue else break then repeat begin ">> What is the $class class value for $object?" ourObject @ "$object" subst over "$class" subst Tell ">> [Enter a number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck ".help" over stringpfx if DoClassHelp pop continue then dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ scratch @ "class/" strcat 4 rotate strcat rot setprop ">> Class entered. Do you want to enter another class? (y/n)" Tell ReadYesNo not if break then repeat ourDataObj @ scratch @ "class/weapons" strcat getpropstr if DoDefWeapon then ourDataObj @ scratch @ "class/armor" strcat getpropstr if 0 ourBoolean ! DoDefArmor then ourDataObj @ scratch @ "class/shields" strcat getpropstr if 1 ourBoolean ! DoDefShield then ">> Does this object modify abilities? (y/n)" Tell ReadYesNo if DoDefMods then ">> Does this object wear out with use? (y/n)" Tell ReadYesNo if DoDefDurability then ">> Can players make this object? (y/n)" Tell ReadYesNo if DoDefMake then ">> Can the object be repaired if it breaks or wears out? (y/n)" Tell ReadYesNo if DoDefRepair then begin ">> What is the book price of this object?" Tell ">> [Enter price in $coins, or .q to quit]" ourDataObj @ "@a/sysparms/small_coins" getpropstr "$coins" subst Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, the price cannot be a negative number." Tell pop continue then ourDataObj @ scratch @ "cost" strcat rot setprop break repeat ">> Finally, please enter a description for the object:" Tell ourDataObj @ scratch @ "desc" strcat EditList scratch @ "objects/" "dtemp/$me/" me @ intostr "$me" subst subst ourDataObj @ over RemoveDir-r ourDataObj @ scratch @ ourDataObj @ 4 rotate MoveDir-r ">> $object defined." ourObject @ "$object" subst Tell 1 ; : DoRemoveObject ( s -- ) (* remove an object *) begin ">> What object do you want to remove?" Tell ">> [Enter name of object, or .l to list choices, or .q to quit]" Tell ReadLine strip QCheck ".list" over stringpfx if ourDataObj @ "@a/prog_list/asys-list" getprop dup if "objects" swap call NukeStack continue else pop ">> Sorry, asys-list is not installed." Tell pop continue then then dup VerifyObject if ourDataObj @ "@a/objects/" 3 pick strcat "/" strcat RemoveDir-r ">> $object removed." swap CapAll "$object" subst Tell break else ">> Object not found." Tell pop continue then repeat ; : DoDefGen ( s -- ) (* define or redefine a skill, spell or psiab *) dup tolower "s/" strcat "@a/" swap strcat ourCounter ! ourCat ! (* get info about skell *) begin (* begin info-getting loop *) ">> What is the name of this XXX?" ourCat @ "XXX" subst Tell ">> [Enter name, or .q to quit]" Tell ReadLine strip QCheck Capitalize dup "&" instr if ">> Sorry, XXX names cannot include & ampersands." ourCat @ "XXX" subst Tell pop continue then dup "/" instr if ">> Sorry, XXX names cannot include / slash marks." ourCat @ "XXX" subst Tell pop continue then (* check: already defined? *) ourDataObj @ ourCounter @ 3 pick strcat getpropstr if ">> This XXX has already been defined." ourCat @ "XXX" subst Tell ">> Do you want to overwrite it? (y/n)" Tell ReadYesNo if ourDataObj @ ourCounter @ 3 pick strcat remove_prop ourDataObj @ ourCounter @ 3 pick strcat "/" strcat RemoveDir-r else pop exit then then (* store *) ourCounter @ swap strcat ourCounter ! (* get base stat *) begin (* begin stat-reading loop *) ">> What stat is this XXX based on?" ourCat @ "XXX" subst Tell ">> [Enter stat, or .q to quit]" Tell ReadLine strip QCheck dup "str" stringpfx if "str" scratch ! else dup "con" stringpfx if "con" scratch ! else dup "dex" stringpfx if "dex" scratch ! else dup "int" stringpfx if "int" scratch ! else dup "pre" stringpfx if "pre" scratch ! else dup "cra" stringpfx if "cra" scratch ! else dup "phy" stringpfx if "phy" scratch ! else ">> Sorry, that's not a valid stat." Tell pop continue then then then then then then then pop break repeat (* end stat-reading loop *) (* get int base *) begin (* begin int-getting loop *) ">> What is the minimum Intelligence to learn this XXX?" ourCat @ "XXX" subst Tell ">> [Enter Intelligence Rating, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the Intelligence Rating must be a positive number." Tell pop continue then scratch @ "," strcat swap strcat scratch ! break repeat (* end int-getting loop *) ">> Does this XXX have prerequisites? (y/n)" ourCat @ "XXX" subst Tell ReadYesNo if begin (* begin prereq loop *) ">> What is the category of this prerequisite?" Tell ">> [Enter stat, skill, spell, psiab, advantage, disadvantage, " "or .q to quit]" strcat Tell ReadLine strip QCheck dup "{stat|skill|spell|psiab|advantage|disadvantage}" smatch not if ">> Sorry, invalid entry." Tell pop continue then dup "{advantage|disadvantage}" smatch if "dis-ad" else dup "s" strcat then "@a/" swap strcat "/" strcat begin (* begin instance-finding loop *) ">> Which " 3 pick Capitalize " is a prerequisite?" strcat strcat Tell ">> [Enter " 3 pick Capitalize strcat ", or .q to quit]" strcat Tell ReadLine strip QCheck "craft skill" over stringpfx if pop "cra" then "physyical skill" over stringpfx if pop "phy" then strcat dup "@a/stats/cra" smatch over "@a/stats/phy" smatch or ourDataObj @ 3 pick getpropstr or me @ 3 pick getpropstr or if begin (* begin level-reading loop *) ">> What level of this prequisite is required?" Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then swap "" "@a/" subst "," strcat swap strcat "," "/" subst swap pop ourDataObj @ ourCounter @ "/preqs#/" strcat "1" begin (* begin list-slot-finding loop *) 3 pick 3 pick 3 pick strcat getpropstr while atoi 1 + intostr repeat (* end list-slot-finding loop *) 3 pick 3 pick dup strlen 1 - strcut pop over over getpropstr atoi 1 + intostr setprop strcat rot setprop break repeat (* end level-reading loop *) break else dup "/" rinstr strcut ">> " swap CapAll strcat " not found." strcat Tell continue then break repeat (* end instance-finding loop *) ">> Prerequisite added." Tell ">> Do you want to specify another prerequisite? (y/n)" Tell ReadYesNo not if break then repeat (* end prereq loop *) then (* get money cost of ability *) ">> Is there a monetary cost to learning this XXX? (y/n)" ourCat @ "XXX" subst Tell ReadYesNo if begin (* begin money loop *) ">> How much does it cost per level to learn this XXX?" ourCat @ "XXX" subst Tell ">> [Enter cost in " ourDataObj @ "@a/sysparms/small_coins" getpropstr strcat ", or .q to quit]" strcat Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 < if ">> Sorry, the cost cannot be a negative number." Tell pop continue then scratch @ "," strcat swap strcat scratch ! break repeat (* end money loop *) else scratch @ ",0" strcat scratch ! then break repeat (* end info-getting loop *) ourDataObj @ ourCounter @ scratch @ setprop ourCat @ "skill" smatch if ">> Can this XXX be rolled at default values if a player " "does not know it?" strcat ourCat @ "XXX" subst Tell ReadYesNo not if ourDataObj @ ourCounter @ "/nodef" strcat "yes" setprop then then ourCat @ "skill" smatch if ">> Are any tools required to use this skill? (y/n)" Tell ReadYesNo if begin ">> What tools are required to use the skill?" Tell ">> [Enter *class* of tool, .l to list " "classes, or .q to quit]" strcat Tell ReadLine strip QCheck ".list" over stringpfx if DoClassList pop continue then dup VerifyClass not if ">> You will need to define one before this skill " "can be used." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this tool are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ ourCounter @ "/tools/" strcat 4 rotate strcat rot setprop ">> Tool entered. Are any other tools required? (y/n)" Tell ReadYesNo not if break then repeat then (* get tools and materials *) ">> Are any materials required to use this skill? (y/n)" Tell ReadYesNo if begin ">> What materials are required to use the skill?" Tell ">> [Enter *class* of material, .l to list " "classes, or .q to quit]" strcat Tell ReadLine strip QCheck ".list" over stringpfx if DoClassList pop continue then dup VerifyClass not if ">> You will need to define one before this skill " "can be cast." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this material are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ ourCounter @ "/materials/" strcat 4 rotate strcat rot setprop ">> Material entered. Are any other materials required? (y/n)" Tell ReadYesNo not if break then repeat then then ourCat @ "spell" smatch if ">> Are any objects required to learn this spell? (y/n)" Tell ReadYesNo if begin ">> What objects are required to learn the spell?" Tell ">> [Enter *class* of object, .l to list " "classes, or .q to quit]" strcat Tell ReadLine strip QCheck ".list" over stringpfx if DoClassList pop continue then dup VerifyClass not if ">> You will need to define one before this spell " "can be learned." strcat ">> NOTE: No objects with this name have been defined yet." Tell Tell then ourDataObj @ ourCounter @ "/tolearn/" strcat rot strcat "1" setprop ">> Object entered. Are any other objects required? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any components required to cast this spell? (y/n)" Tell ReadYesNo if begin ">> What components are required to cast the spell?" Tell ">> [Enter *class* of component, .l to list " "classes, or .q to quit]" strcat Tell ReadLine strip QCheck ".list" over stringpfx if DoClassList pop continue then dup VerifyClass not if ">> You will need to define one before this spell " "can be cast." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this component are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat ourDataObj @ ourCounter @ "/tools/" strcat 4 rotate strcat rot setprop ">> Component entered. Are any other components required? (y/n)" Tell ReadYesNo not if break then repeat then ">> Are any materials required to cast this spell? (y/n)" Tell ReadYesNo if begin ">> What materials are required to cast the spell?" Tell ">> [Enter *class* of material, .l to list classes, or .q to quit]" Tell ReadLine strip QCheck ".list" over stringpfx if DoClassList pop continue then dup VerifyClass not if ">> You will need to define one before this spell " "can be cast." strcat ">> NOTE: No objects with this class have been defined yet." Tell Tell then begin ">> How many instances of this material are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue else break then repeat begin ">> How many instances of this material are required?" Tell ">> [Enter a number, or .q to quit]" Tell ReadLine strip QCheck dup atoi 0 <= if ">> Sorry, we need a *positive* number here." Tell pop continue else break then repeat ourDataObj @ ourCounter @ "/materials/" strcat 4 rotate strcat rot setprop ">> Material entered. Are any other materials required? (y/n)" Tell ReadYesNo not if break then repeat then then ourCat @ "{spell|psiab}" smatch if begin ">> What is the Fatigue Cost of casting this $cat?" ourCat @ "$cat" subst Tell ">> [Enter cost, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi 0 <= if ">> Sorry, the Fatigue Cost must be a positive number." Tell pop continue then ourDataObj @ ourCounter @ "/fat" strcat rot setprop break repeat ">> Does the target of this $cat get a roll to defend? (y/n)" ourCat @ "$cat" subst Tell ReadYesNo if ourDataObj @ ourCounter @ "/def" strcat begin ">> What is the category of the ability the roll is based on?" Tell ">> [Enter stat, skill, spell, psiab, or .q to quit]" Tell ReadLine strip QCheck "stat" over stringpfx if pop "stat" else "skill" over stringpfx if pop "skill" else "spell" over stringpfx if pop "spell" else "psiab" over stringpfx if pop "psiab" else ">> Invalid entry." Tell pop continue then then then then dup "stat" smatch if pop begin ">> Which stat is the roll based on?" Tell ">> [Enter STR, CON, DEX, INT, PRE, PHY, or CRA, " "or .q to quit]" strcat Tell ReadLine strip QCheck "strength" over stringpfx if "@a/stats/str" else "consitution" over stringpfx if "@a/stats/con" else "dexterity" over stringpfx if "@a/stats/dex" else "intelligence" over stringpfx if "@a/stats/int" else "presence" over stringpfx if "@a/stats/pre" else "physical skill" over stringpfx if "@a/stats/phy" else "craft skill" over stringpfx if "@a/stats/cra" else ">> Invalid entry." Tell pop continue then then then then then then then swap pop break repeat else begin ">> Which $cat is the roll based on?" over "$cat" subst Tell ">> [Enter $cat, or .q to quit]" over "$cat" subst Tell ReadLine strip QCheck "@a/$cats/$inst" swap "$inst" subst over "$cat" subst ourDataObj @ swap getpropstr dup if swap pop break else pop ">> $cat not found." over "$cat" subst Tell continue then repeat then setprop break repeat then then ">> XXX defined. Please edit the online manual as appropriate." ourCat @ CapAll "XXX" subst Tell ; : DoDefGroup ( -- ) (* add a group to the Argo system *) NukeStack begin ">> What is the name of this group?" Tell ">> [Enter a name, or .q to quit]" Tell ReadLine strip QCheck CapAll dup "&" instr if ">> Sorry, group names cannot include & ampersands." Tell pop continue then dup "/" instr if ">> Sorry, group names cannot include / slash marks." Tell pop continue then ourCounter ! break repeat (* check: already defined? *) ourDataObj @ "@a/groups/" ourCounter @ strcat getpropstr if ">> The " ourCounter @ strcat " group has already been defined." strcat Tell ">> Do you want to redefine it? (y/n)" Tell ReadYesNo not if ">> Definition aborted." Tell exit then then begin (* begin info-getting loop *) ">> Is there a minimum Status level for this group?" Tell ">> [Enter 'yes', 'no', or .q to quit]" Tell ReadYesNo if begin (* begin status-info loop *) ">> What is the minimum Status level to be in the " ourCounter @ strcat " group?" strcat Tell ">> [Enter a number between 1 and 18, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi dup 18 > swap 1 < or if ">> Sorry, that's outside the allowed range." Tell pop continue then (* store status info at bottom of stack *) break repeat (* end status-info loop *) else "1" (* store status info at bottom of stack *) then ">> Please enter a tag sring for rumors in this group." Tell ">> Example: 'It's going around amoung the that... '" Tell ">> [Enter tag string, or .q to quit]" Tell ReadLine strip QCheck (* set values *) "@a/skills/" ourCounter @ strcat " Influence/preqs" strcat "dis-ad,Status," depth pick strcat AddListLine ourDataObj @ "@a/skills/" ourCounter @ strcat " Influence" strcat "pre,7,0" setprop ourDataObj @ "@a/rumors/" ourCounter @ strcat rot setprop ourDataObj @ "@a/groups/" ourCounter @ strcat rot setprop (* notify *) ">> Group defined. Please edit the online manual as appropriate." Tell break repeat (* end info-getting loop *) ; : DoDefTplate ( -- ) (* add a template to the Argo system *) NukeStack "" scratch ! 0 ourCounter ! (* clear working vars *) (* remove old working list dir, just in case *) #0 "@a/dtemp/" me @ intostr strcat RemoveDir-r (* give instructions *) " another effect of the template, or quit." " number. Once all three have been specified, you may either enter " " added to the character's current values. Level may be a negative " " are STR, CON, DEX, INT, and PRE. 'Level' is the amount to be " " category. For example, valid Instances for the stats category " " disadvantage. The 'instance' is the particular value within that " " ability affected: stat, skill, spell, psiab, advantage or " " category, instance, and level. The 'category' is the class of " ">> To define a template, respond to the following prompts for a " " " Tell Tell Tell Tell Tell Tell Tell Tell Tell Tell " " Tell (* get template name *) begin ">> What is the name of this template?" Tell ">> [Enter name, or .q to quit]" Tell ReadLine strip QCheck dup "&" instr if ">> Sorry, template names cannot include & ampersands." Tell pop continue then dup "/" instr if ">> Sorry, template names cannot include / slash marks." Tell pop continue then break repeat (* check: template exists? *) "@a/tplates/" over strcat ourDataObj @ LMGR-GetCount if ">> The " over Capitalize strcat " template already exists. Do you want to overwrite? (y/n)" strcat Tell ReadYesNo not if pop exit then then CapAll scratch ! (* put temp working list name on stack *) "@a/dtemp/" me @ intostr strcat ">> Defining template for " scratch @ strcat "..." strcat Tell begin (* begin info-reading loop *) ">> What is the category of this effect?" Tell ">> [Enter category ('stats', 'skills', etc), or .q to quit]" Tell ReadLine strip QCheck "stats" over stringpfx if pop "stats" else "skills" over stringpfx if pop "skills" else "spells" over stringpfx if pop "spells" else "psiabs" over stringpfx if pop "psiabs" else "advantages" over stringpfx if pop "dis-ad" else "disadvantages" over stringpfx if pop "dis-ad" else ">> Category not found." Tell pop continue then then then then then then begin (* begin instance-reading loop *) ">> What is the instance of this effect?" Tell ">> [Enter instance ('str', 'climbing', etc), or .q to quit]" Tell ReadLine strip QCheck ourDataObj @ "@a/" 4 pick strcat "/" strcat 3 pick strcat getpropstr over "{str|con|dex|int|pre}" smatch or not if ">> Instance not found." Tell pop continue then swap "," strcat swap strcat "," strcat break repeat (* end instance-reading loop *) dup "dis-ad," instr over "wealth" instr not and over "poverty" instr not and over "status" instr not and if ourDataObj @ "@a/" 3 pick strcat dup strlen 1 - strcut pop "/" "," subst getpropstr dup atoi ourCounter @ swap + ourCounter ! dup atoi 0 < if dup atoi ourDataObj @ "@a/dtemp/" me @ intostr strcat "#/dis-ad" strcat over over getpropstr atoi 4 rotate + intostr setprop then strcat else begin (* begin level-reading loop *) ">> What is the level of this effect?" Tell ">> [Enter level ('2', '-1', etc), or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then dup atoi ourCounter @ swap + ourCounter ! strcat break repeat (* end level-reading loop *) then over rot rot AddListLine (* add to temp working list *) ">> Effect entered. Do you want to enter another effect? (y/n)" Tell ReadYesNo if continue else begin (* begin cost-reading loop *) ">> The " scratch @ strcat " template would cost " strcat ourCounter @ intostr strcat " points if each ability you " strcat Tell " have entered were purchased separately." Tell ">> How much do you want the actual cost of the template to be?" Tell ">> [Enter a point cost, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, the cost must be a number." Tell pop continue then ourDataObj @ "@a/dtemp/" me @ intostr strcat "#/cost" strcat rot setprop break repeat (* end cost-reading loop *) " " Tell ">> Entries for " scratch @ strcat " template:" strcat Tell dup ourDataObj @ LMGR-GetList begin (* begin result-displaying loop *) dup while " " rot strcat Tell 1 - repeat (* end result-displaying loop *) pop ">> Cost: " ourDataObj @ "@a/dtemp/" me @ intostr strcat "#/cost" strcat getpropstr strcat Tell " " Tell ">> Please confirm: You wish to enter this template? (y/n)" Tell ReadYesNo not if ourDataObj @ LMGR-DeleteList ">> Definition aborted." Tell pop pop exit then "@a/tplates/" scratch @ strcat ourDataObj @ LMGR-DeleteList dup ourDataObj @ LMGR-GetCount intostr ourDataObj @ "@a/tplates/" scratch @ strcat "#" strcat rot setprop ourDataObj @ over "#" strcat ourDataObj @ "@a/tplates/" scratch @ strcat "#" strcat MoveDir ourDataObj @ LMGR-DeleteList ">> Template defined." Tell break then repeat (* end info-reading loop *) ; : DoDefNPC ( -- ) (* and an npc to the Argo system *) dup tolower "s/" strcat "@a/" swap strcat ourCounter ! ourCat ! NukeStack 0 ourBoolean ! ourDataObj @ "@a/dtemp/" me @ intostr strcat "/" strcat dup ourCounter ! RemoveDir-r begin (* begin info-reading loop *) ">> What is the name of this $type?" ourCat @ "npc" smatch if "NPC" else "creature" then "$type" subst Tell ">> [Enter name, or .q to quit]" Tell ReadLine strip QCheck dup .pmatch if ">> Sorry, that name is in use." Tell pop continue then dup "/" instr over "#*" smatch or if ">> Sorry, that's not a valid name." Tell pop continue then dup " " instr if ">> Sorry, character or creature names cannot include spaces." Tell pop continue then dup "&" instr if ">> Sorry, character or creature names cannot include & ampersands." Tell pop continue then dup "/" instr if ">> Sorry, character or creature names cannot include / slash marks." Tell pop continue then scratch ! ourDataObj @ "@a/creatures/" scratch @ strcat "/name" strcat getpropstr if " " Tell "************************************************************************" Tell ">> At any prompt, enter .n for 'no change'" Tell "************************************************************************" Tell then 5 begin (* begin stat-reading loop *) dup while dup 5 = if "str" else dup 4 = if "con" else dup 3 = if "dex" else dup 2 = if "int" else dup 1 = if "pre" then then then then then ">> What is " scratch @ strcat "'s " strcat over UnabbreviateStat strcat "?" strcat Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch if pop pop 1 - continue then dup number? not if ">> Sorry, that's not a number." Tell pop continue then ourDataObj @ ourCounter @ "stats/" strcat 4 pick strcat "_mod" strcat "0" setprop ourDataObj @ ourCounter @ "stats/" strcat 4 rotate strcat rot setprop 1 - repeat (* end stat-reading loop *) pop (* read abilities *) 3 begin (* begin outer ability-reading loop *) dup while dup 3 = if "skills" else dup 2 = if "spells" else dup 1 = if "psiabs" then then then over 3 = ourDataObj @ "@a/skills/" nextprop not and 3 pick 2 = ourDataObj @ "@a/spells/" nextprop not and 4 pick 1 = ourDataObj @ "@a/psiabs/" nextprop not and or or if pop 1 - continue then over 2 = ourDataObj @ "@a/sysparms/magic" getpropstr "no" smatch and if pop 1 - continue then over 1 = ourDataObj @ "@a/sysparms/psionics" getpropstr "no" smatch and if pop 1 - continue then ">> What XXX does " scratch @ strcat " have?" strcat over Capitalize "XXX" subst Tell begin (* begin inner ability-reading loop *) ">> [Enter XXX, .d when done with QQQ, or .q to quit]" over Capitalize dup strlen 1 - strcut pop "XXX" subst over Capitalize "QQQ" subst Tell ReadLine strip QCheck CapAll dup ".n" smatch over ".d" smatch or if begin dup int? not while pop repeat break then ourDataObj @ "@a/" 4 pick strcat "/" strcat 3 pick strcat getpropstr not if pop ">> " over Capitalize dup strlen 1 - strcut pop strcat " not found." strcat Tell continue then ">> How many levels of this " 3 pick Capitalize dup strlen 1 - strcut pop strcat " does " strcat scratch @ strcat " have?" strcat Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch over ".d" smatch or if pop break then dup number? not if ">> Sorry, that's not a number." Tell pop pop continue then dup atoi 0 < if ">> Sorry, ability levels must be positive numbers." Tell pop pop continue then ourDataObj @ ourCounter @ 5 pick strcat "/" strcat 4 rotate strcat rot setprop dup strlen 1 - strcut pop Capitalize dup ">> " swap strcat " entered." strcat Tell ">> Do you want to enter another " over strcat "? (y/n)" strcat Tell ReadYesNo if "s" strcat continue else pop break then repeat (* end inner ability-reading loop *) 1 - repeat (* end outer ability-reading loop *) pop (*read dis-ads *) 2 ourBoolean ! begin (* begin outer dis-ad reading loop *) ourBoolean @ while ">> What " ourBoolean @ 2 = if "advantages " else "disadvantages " then strcat "does " strcat scratch @ strcat " have?" strcat Tell begin (* begin inner dis-ad-reading loop *) ">> [Enter " ourBoolean @ 2 = if "advantage, .d if done with Advantages, or .q to quit]" else "disadvantage, .d if done with disadvantages, or .q to quit]" then strcat Tell ReadLine strip QCheck CapAll dup ".n" smatch over ".d" smatch or if pop break then Capitalize ">> What is the point value of " over strcat "?" strcat Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch over ".d" smatch or if pop pop break then dup number? not if ">> Sorry, that's not a number." Tell pop pop continue then dup atoi 0 > ourBoolean @ 1 = and if 0 swap atoi - intostr then ourDataObj @ ourCounter @ "dis-ad/" strcat 4 rotate strcat rot setprop ">> " ourBoolean @ 2 = if "Entered. Do you want to add another advantage (y/n)" else "Entered. Do you want to add another disadvantage? (y/n)" then strcat Tell ReadYesNo not if break then repeat (* end inner dis-ad-reading loop *) ourBoolean @ 1 - ourBoolean ! repeat (* end dis-ad reading loop *) ourCat @ "npc" smatch if ">> What is " scratch @ strcat "'s gender?" strcat Tell ">> [Enter string, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch not if ourDataObj @ ourCounter @ "sex" strcat rot setprop then ">> Entered." Tell then ourCat @ "npc" smatch if ">> What is " scratch @ strcat "'s profession or species?" strcat Tell ReadLine strip QCheck dup ".n" smatch not if ourDataObj @ ourCounter @ "species" strcat rot setprop then ">> Entered." Tell else ourDataObj @ ourCounter @ "species" strcat scratch @ CapAll setprop then ">> How many " ourDataObj @ "@a/sysparms/large_coins" getpropstr strcat " does " strcat scratch @ strcat " usually have?" strcat Tell begin (* begin large-coin-reading loop *) ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch if break then dup number? not if ">> Sorry, that's not a number." Tell then ourDataObj @ ourCounter @ "money/large_coins" strcat rot setprop break repeat (* end large-coin-reading loop *) ">> How many " ourDataObj @ "@a/sysparms/small_coins" getpropstr strcat " does " strcat scratch @ strcat " usually have?" strcat Tell begin (* begin large-coin-reading loop *) ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup ".n" smatch if break then dup number? not if ">> Sorry, that's not a number." Tell then ourDataObj @ ourCounter @ "money/small_coins" strcat rot setprop break repeat (* end large-coin-reading loop *) ">> Finally, please enter a description for " scratch @ strcat "." strcat Tell ourDataObj @ ourCounter @ "desc" strcat EditList ourDataObj @ ourCounter @ "name" strcat scratch @ setprop ourDataObj @ ourCounter @ ourDataObj @ "@a/$types/" ourCat @ tolower "$type" subst scratch @ strcat CopyDir-r ourCat @ "creature" smatch if #0 "@a/prog_list/asys-stdspells" getprop dup if #0 "@a/calls/castsummon $creature" scratch @ tolower "$creature" subst rot setprop else pop then then ">> $type entered." ourCat @ "npc" smatch if "NPC" else "creature" then "$type" subst Tell break repeat (* end outer info-reading loop *) ; : DoDefJob ( s -- ) (* define a job *) ourCat ! "@a/jobs/" ourCounter ! ">> What is the name of this job?" Tell ">> [Enter job name, or .q to quit]" Tell ReadLine strip QCheck CapAll ourDataObj @ "@a/jobs/$job/" 3 pick "$job" subst nextprop if ">> A job named '$job' has already been defined." over "$job" subst Tell ">> Do you want to redefine it? (y/n)" Tell ReadYesNo not if ">> Done." Tell NukeStack exit then then ourCounter @ swap strcat ourCounter ! ">> Does this job have prerequisites? (y/n)" Tell ReadYesNo if begin (* begin prereq loop *) ">> What is the category of this prerequisite?" Tell ">> [Enter stat, skill, spell, psiab, advantage, disadvantage, " "or .q to quit]" strcat Tell ReadLine strip QCheck dup "{stat|skill|spell|psiab|advantage|disadvantage}" smatch not if ">> Sorry, invalid entry." Tell pop continue then dup "{advantage|disadvantage}" smatch if "dis-ad" else dup "s" strcat then "@a/" swap strcat "/" strcat begin (* begin instance-finding loop *) ">> Which " 3 pick Capitalize " is a prerequisite?" strcat strcat Tell ">> [Enter " 3 pick Capitalize strcat ", or .q to quit]" strcat Tell ReadLine strip QCheck "craft skill" over stringpfx if pop "cra" then "physyical skill" over stringpfx if pop "phy" then strcat dup "@a/stats/cra" smatch over "@a/stats/phy" smatch or ourDataObj @ 3 pick getpropstr or me @ 3 pick getpropstr or if begin (* begin level-reading loop *) ">> What level of this prequisite is required?" Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then swap "" "@a/" subst "," strcat swap strcat "," "/" subst swap pop ourDataObj @ ourCounter @ "/preqs#/" strcat "1" begin (* begin list-slot-finding loop *) 3 pick 3 pick 3 pick strcat getpropstr while atoi 1 + intostr repeat (* end list-slot-finding loop *) 3 pick 3 pick dup strlen 1 - strcut pop over over getpropstr atoi 1 + intostr setprop strcat rot setprop break repeat (* end level-reading loop *) break else dup "/" rinstr strcut ">> " swap CapAll strcat " not found." strcat Tell continue then break repeat (* end instance-finding loop *) ">> Prerequisite added." Tell ">> Do you want to specify another prerequisite? (y/n)" Tell ReadYesNo not if break then repeat (* end prereq loop *) then begin ">> What is the salary for this job?" Tell ">> [Enter number of $coins does the worker " "receive per income period." strcat ourDataObj @ "@a/sysparms/small_coins" getpropstr "$coins" subst Tell ReadLine strip QCheck dup number? if ourDataObj @ ourCounter @ "/salary" strcat rot setprop break else ">> Sorry, that's not a number." Tell pop then repeat begin ">> What is the hiring modifier for this job?" Tell ">> [Enter number, or .h for help, or .q to quit]" Tell ReadLine strip QCheck dup number? if ourDataObj @ ourCounter @ "/hmod" strcat rot setprop break else ">> Sorry, that's not a number." Tell pop then repeat 0 ourBoolean ! begin ">> [Enter percentage chance per income period, or .q to quit]" ">> What is the chance for injury on this job?" Tell Tell ReadLine strip QCheck "" "%" subst dup number? not if ">> Invalid entry." Tell pop continue then 100 over atoi < if ">> Sorry, a percentage must be less than or equal to 100." Tell pop continue then 0 over atoi > if ">> Sorry, a percentage must be greater than or equal to 0." Tell pop continue then 1 ourBoolean ! ourDataObj @ ourCounter @ "/injchance" strcat rot setprop break repeat ourBoolean @ if begin ">> How much damage does on-the-job injury cause?" Tell ">> [Enter damage as a dice string, or .q to quit]" Tell ">> [Examples: 1d4-1, 2d3, 3d6+1]" Tell ReadLine strip QCheck dup "d" instr if ourDataObj @ ourCounter @ "/injdam" strcat rot setprop break else ">> That doesn't look like a dice string." Tell pop then repeat then ">> Job defined." Tell NukeStack ; : DoDefDisad ( s -- ) (* define advantage or disadvantage *) ourCat ! (* store category *) "@a/dis-ad/" ourCounter ! (* get info about disad *) begin (* begin info-getting loop *) ">> What is the name of this XXX?" ourCat @ "XXX" subst Tell ">> [Enter name, or .q to quit]" Tell ReadLine strip QCheck Capitalize dup "&" instr if ">> Sorry, XXX names cannot include & ampersands." ourCat @ "XXX" subst Tell pop continue then dup "/" instr if ">> Sorry, XXX names cannot include / slash marks." ourCat @ "XXX" subst Tell pop continue then (* check: already defined? *) ourDataObj @ ourCounter @ 3 pick strcat getpropstr if ">> This XXX has already been defined." ourCat @ "XXX" subst Tell ">> Do you want to modify it? (y/n)" Tell ReadYesNo not if pop exit then then (* store *) ourCounter @ swap strcat ourCounter ! (* get point value *) begin (* begin point-getting loop *) ">> How many points is this XXX worth?" ourCat @ "XXX" subst Tell ">> [Enter point value, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, the point value must be a number." Tell pop continue then (* check: valid number for category? *) ourCat @ "advantage" smatch if dup atoi 0 < if 0 swap atoi - intostr then else dup atoi 0 > if 0 swap atoi - intostr then then scratch ! break repeat (* end point-getting loop *) ">> Does this XXX have triggered effects? (y/n)" ourCat @ "XXX" subst Tell ReadYesNo if begin (* begin trigef loop *) ">> What is the category of this effect?" Tell ">> [Enter stat, skill, spell, psiab, advantage, disadvantage, " "or .q to quit]" strcat Tell ReadLine strip QCheck dup "{stat|skill|spell|psiab|advantage|disadvantage}" smatch not if ">> Sorry, invalid entry." Tell pop continue then dup "{advantage|disadvantage}" smatch if "dis-ad" else dup "s" strcat then "@a/" swap strcat "/" strcat begin (* begin instance-finding loop *) ">> Which " 3 pick Capitalize " is an effect?" strcat strcat Tell ">> [Enter " 3 pick Capitalize strcat ", or .q to quit]" strcat Tell ReadLine strip QCheck strcat ourDataObj @ over getpropstr me @ 3 pick getpropstr or if begin (* begin level-reading loop *) ">> What is the level of this effect?" Tell ">> [Enter number, or .q to quit]" Tell ReadLine strip QCheck dup number? not if ">> Sorry, that's not a number." Tell pop continue then swap "" "@a/" subst "," strcat swap strcat "," "/" subst swap pop ourDataObj @ ourCounter @ "/trigs#/" strcat "1" begin (* begin list-slot-finding loop *) 3 pick 3 pick 3 pick strcat getpropstr while atoi 1 + intostr repeat (* end list-slot-finding loop *) 3 pick 3 pick dup strlen 1 - strcut pop over over getpropstr atoi 1 + intostr setprop strcat rot setprop break repeat (* end level-reading loop *) break else dup "/" rinstr strcut ">> " swap strcat " not found." strcat Tell continue then break repeat (* end instance-finding loop *) ">> Effect added." Tell ">> Do you want to specify another effect? (y/n)" Tell ReadYesNo not if ourDataObj @ ourCounter @ scratch @ setprop ">> XXX defined. Please edit the online manual as appropriate." ourCat @ Capitalize "XXX" subst Tell break break then repeat (* end trigef loop *) else ourDataObj @ ourCounter @ scratch @ setprop ">> XXX defined. Please edit the online manual as appropriate." ourCat @ "XXX" subst Tell break then break repeat (* end info-getting loop *) ; : DoDefine ( -- ) (* install or modify an Argo feature *) StaffCheck not if (* check permission *) ">> Permission denied." Tell exit then (* get category; dispatch to appropriate function *) begin (* begin category-getting loop *) 0 ourBoolean ! ">> What is the category for this definition?" Tell ">> [Enter category, or .l to list choices, or .q to quit]" Tell ReadLine strip QCheck dup ".l" smatch if DoCatList pop continue then dup number? if FindNumCat not if ">> There is no category number " swap strcat "." strcat Tell continue then then "advantages" over stringpfx if pop "advantage" DoDefDisad else "creatures" over stringpfx if pop "creature" DoDefNPC else "disadvantages" over stringpfx if pop "disadvantage" DoDefDisad else "groups" over stringpfx if pop "group" DoDefGroup else "jobs" over stringpfx if pop "job" DoDefJob else "npcs" over stringpfx if pop "NPC" DoDefNPC else "objects" over stringpfx if pop "object" DoDefObject else "psiabs" over stringpfx if pop "psiab" DoDefGen else "skills" over stringpfx if pop "skill" DoDefGen else "spells" over stringpfx if pop "spell" DoDefGen else "templates" over stringpfx if pop "template" DoDefTplate else #0 "@a/calls/" nextprop dup if begin dup while dup "" "@a/calls/def" subst 3 pick smatch if 1 ourBoolean ! swap "#def" swap strcat swap #0 swap getprop MakeDbref call "popthis" break then #0 swap nextprop repeat pop ourBoolean @ not if ">> Category '" over strcat "' not found." strcat Tell NukeStack continue then else ">> Category '" over strcat "' not found." strcat Tell NukeStack continue then then then then then then then then then then then then ">> Do you wish to enter another definition? (y/n)" Tell ReadYesNo not if ">> Done." Tell exit then repeat (* end category-getting loop *) ; : DoRemove StaffCheck not if (* check permission *) ">> Permission denied." Tell exit then (* get category; dispatch to appropriate function *) begin (* begin category-getting loop *) 0 ourBoolean ! ">> What is the category of the thing you want to remove?" Tell ">> [Enter category, or .l to list choices, or .q to quit]" Tell ReadLine strip QCheck dup ".l" smatch if DoCatList pop continue then dup number? if FindNumCat not if ">> There is no category number " swap strcat "." strcat Tell continue then then "Skills" over stringpfx if pop "skill" "@a/skills/" else "Spells" over stringpfx if pop "spell" "@a/spells/" else "Psiabs" over stringpfx if pop "psiab" "@a/psiabs/" else "Groups" over stringpfx if pop "group" "@a/groups/" else "Advantages" over stringpfx if pop "advantage" "@a/dis-ad/" else "Disadvantages" over stringpfx if pop "disavantage" "@a/dis-ad/" else "Templates" over stringpfx if pop "template" "@a/tplates/" else "NPCs" over stringpfx if pop "NPC" "@a/npcs/" else "Jobs" over stringpfx if pop "job" "@a/jobs/" else "Creatures" over stringpfx if pop "creature" "@a/creatures/" else "Objects" over stringpfx if pop "object" "@a/objects/" else (* if we made it this far, no native asys-defrem categories apply; check for calls added by other programs *) #0 "@a/calls/" nextprop dup if begin dup while dup "" "@a/calls/rem" subst 3 pick smatch if 1 ourBoolean ! swap "#rem" swap strcat swap #0 swap getprop MakeDbref call "popthis" break then #0 swap nextprop repeat pop ourBoolean @ if ">> Do you want to remove something else? (y/n)" Tell ReadYesNo if NukeStack continue else ">> Done." Tell exit then else ">> Category '" over strcat "' not found." strcat Tell pop continue then then then then then then then then then then then then then begin (* begin instance-finding loop *) ">> Which " 3 pick Capitalize strcat " do you want to remove?" strcat Tell ">> [Enter " 3 pick Capitalize strcat ", or .q to quit]" strcat Tell ReadLine strip QCheck over "@a/creatures/" smatch if #0 "@a/calls/cast summon$creature" 3 pick "$creature" subst remove_prop then over "@a/tplates/" smatch if "#" strcat then strcat ourDataObj @ swap over over over over getpropstr rot rot "/" strcat nextprop or if dup "@a/groups/" instr if over over "@a/rumors/" "@a/groups/" subst remove_prop over over "@a/skills/" "@a/groups/" subst " Influence" strcat over over "/" strcat RemoveDir-r remove_prop then over over RemoveDir-R remove_prop ">> " swap CapAll strcat " removed." strcat Tell ">> Please edit the online manual as appropriate." Tell break else swap pop dup "/" rinstr strcut ">> %disad not found." swap Capitalize "%disad" subst Tell then repeat (* end instance-finding loop *) ">> Do you wish to remove something else? (y/n)" Tell ReadYesNo not if ">> Done." Tell exit then repeat (* end category-getting loop *) ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update ourArg @ if ourArg @ "#" stringpfx if "#help" ourArg @ stringpfx if DoHelp else "#enable" ourArg @ stringpfx if DoEnable else "#version" ourArg @ stringpfx if DoVersion else "#disable" ourArg @ stringpfx if DoDisable else "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ">> #Argument not understood." Tell then then then then then then exit then then me @ ArgoPermCheck Disabled? ourCom @ "+define" smatch if DoDefine else DoRemove then ; . c q @set asys-defrem=W