Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.45 KB | None | 0 0
  1. ------------------------------------------------------------------------------
  2. Spellcasting using the spellcasting system
  3. Starhound 3/30/2017
  4. ------------------------------------------------------------------------------
  5.  
  6. This file outlines and describes concepts related to proper and
  7. balanced spell formulation utilizing the new spellcasting system
  8. standards.
  9.  
  10. Note: some functions and constructions are too long to
  11. have a single line due to the 80 character width limitation
  12. on man pages. If this happens, the function will be broken
  13. into two lines, the bottom being indented four spaces forward.
  14.  
  15. [ General Concepts ]
  16.  
  17. Parts of a spell are broken into sections which are defined as
  18. spell steps. In each step, the caster performs or initializes a
  19. telesmatic process, eventually building up to a specific effect.
  20. Each of these steps can vary greatly in ways one can construct
  21. and formulate them, you have entire control of how the
  22. spellcasting process acts during the time of the step. This
  23. amount of control offers the highest degree of customization
  24. from not only step to step, or spell to spell, but affiliation to
  25. affiliation. However, as a draw back, some methods used
  26. to utilize this spellcasting system might not be instantly
  27. obvious.
  28.  
  29. [ File Inheritance ]
  30.  
  31. All spells must include the following header files :
  32.  
  33. #include <Project_Name.h>
  34. #include <daemon.h>
  35. #include <spell_step.h>
  36. #include <spellcasting_process.h>
  37. #include <spells.h>
  38.  
  39. As well as the Spell.c definition file located in the /def
  40. folder in the project. Which appears directly under the
  41. section of the file we include the list of header files.
  42.  
  43. inherit Project_Example_Definition(“Spell”);
  44.  
  45. [ Overloading Functions ]
  46.  
  47. Before you initialize the spellcasting process, you
  48. might want specific control on things like, what the
  49. spell can be cast on, to check the target(s) of a
  50. spell to ensure they’re valid, or if the
  51. caster is using a valid spell argument or component.
  52. Specific and detailed usage of these functions will be
  53. described later, but for now you must overload the
  54. necessary functions to your spell construction, usually
  55. placed directly under the line of where you defined
  56. the spell file inheritance. Only spell_complete is
  57. needed for the most basic of attack spells, as there
  58. are methods to filter out valid and invalid times
  59. one can cast spells with the usage of flags. Note
  60. that you only need overload the functions that your
  61. spell will utilize.
  62.  
  63. Examples:
  64.  
  65. inherit Project_Example_Definition(“Spell”);
  66.  
  67. void spell_complete(descriptor process);
  68.  
  69. varargs mixed spell_check_components_rule(object array components,
  70. object who, status initial);
  71.  
  72. mixed spell_check_targets_rule(object array targets, object who,
  73. status initial);
  74.  
  75. object array spell_generate_default_targets_rule(object who);
  76.  
  77. varargs mixed spell_check_arguments_rule(mixed arguments,
  78. object who, status initial);
  79.  
  80. Methods like automatically generating component usage
  81. can also be performed, however it is generally discouraged as
  82. using default targeting can allow us to prevent the caster from
  83. also specifying targets. It is also worth mentioning that keeping a
  84. consistent naming scheme for these functions is moderately desired,
  85. as it allows other developers to easily understand your spell and its
  86. processes.
  87.  
  88. [ Configure ]
  89.  
  90. A good portion of the code for a spell is placed on configure(),
  91. this is where we define spell steps and other key spell settings.
  92. The following sections marked with double brackets are all
  93. settings and concepts housed in configure on a spell.
  94.  
  95. [[ Spell Names ]]
  96.  
  97. For hermetic spellcasters, all spells must have two separate
  98. names. A regular spell name which must be pronounced in Latin,
  99. and a common spell name, written in plain English. It is best
  100. practice to define these values first.
  101.  
  102. Example:
  103.  
  104. void configure() {
  105. ::configure();
  106. set_spell_name(“magicae telum”);
  107. set_spell_common_name(“magick bolt”);
  108. }
  109.  
  110. [[ Spell Types ]]
  111.  
  112. Each spell must be categorized into an overall generic
  113. class dependent upon the spells’ effect. Usually common
  114. sense plays a large factor here, if the spell fires off only a
  115. special attack, it is an “attack” spell, or if the spell only adds
  116. some form of enchantment to an object, it is an “enchantment”
  117. spell. This function simply takes a string as a argument, the
  118. string being the specified spell type.
  119.  
  120. Example:
  121.  
  122. set_spell_type(“attack”);
  123.  
  124. [[ Spell Summary ]]
  125.  
  126. A brief description of the spell, usually no longer
  127. than a handful of words
  128.  
  129. Examples:
  130.  
  131. set_spell_summary(“magickal dart attack”);
  132.  
  133. [[ Spell Targets/Components/Arguments Flags ]]
  134.  
  135. These three aspects of a spell can have predefined
  136. flags set for them as a method to impose restrictions
  137. on how the caster can use these parts of the system.
  138. Typically defined after the spell type as they are the
  139. foundation for how a spell can be cast.
  140.  
  141. Examples:
  142. //will require the target to be the caster or a object that is
  143. //befriended to the caster
  144. set_spell_targets_flags(Spell_Targets_Flags_Single_Friendly);
  145.  
  146. //will require the caster to specify a single, common object contained
  147. //in their inventory to cast the spell
  148. set_spell_components_flags(Spell_Components_Flags_Single_Mundane_Inventory);
  149.  
  150. //will require the caster to specify arguments for the spell
  151. set_spell_arguments_flags(Spell_Arguments_Flag_Required);
  152.  
  153. The following list describes all the possibilities one can have in these
  154. fields.
  155.  
  156. Spell_Components_Flag_Inventory
  157. Spell_Components_Flag_Environment
  158. Spell_Components_Flag_Magickal
  159. Spell_Components_Flag_Mundane
  160. Spell_Components_Flag_Single
  161. Spell_Components_Flag_Equipped
  162. Spell_Components_Flag_Unequipped
  163. Spell_Components_Flag_Static
  164. Spell_Components_Flag_Indestructible
  165. Spell_Components_Flag_Required
  166. Spell_Components_Flag_None
  167. Spell_Components_Flag_Reacquire
  168. Spell_Components_Flag_Track
  169. Spell_Components_Flag_Nonmanifestation
  170. Spell_Components_Flags_Single_Mundane_Inventory
  171.  
  172. Spell_Targets_Flag_Inventory
  173. Spell_Targets_Flag_Environment
  174. Spell_Targets_Flag_Living
  175. Spell_Targets_Flag_Nonliving
  176. Spell_Targets_Flag_Single
  177. Spell_Targets_Flag_Nonself
  178. Spell_Targets_Flag_Equipped
  179. Spell_Targets_Flag_Unequipped
  180. Spell_Targets_Flag_Friendly
  181. Spell_Targets_Flag_Hostile
  182. Spell_Targets_Flag_Static
  183. Spell_Targets_Flag_Indestructible
  184. Spell_Targets_Flag_Required
  185. Spell_Targets_Flag_None
  186. Spell_Targets_Flag_Reacquire
  187. Spell_Targets_Flag_Track
  188. Spell_Targets_Flag_Handle_Automatically
  189. Spell_Targets_Flag_Trusting
  190. Spell_Targets_Flags_Single_Friendly
  191. Spell_Targets_Flags_Single_Friendly_Exclude_Self
  192. Spell_Targets_Flags_Single_Trusting
  193. Spell_Targets_Flags_Single_Trusting_Exclude_Self
  194. Spell_Targets_Flags_Single_Hostile
  195. Spell_Targets_Flags_Environment_Nonliving
  196.  
  197. Spell_Arguments_Flag_None
  198. Spell_Arguments_Flag_Required
  199. Spell_Arguments_Flag_Optional
  200.  
  201. Should you wish to combine multipule flags from the same
  202. category, simply:
  203.  
  204. set_spell_targets_flags(Spell_Targets_Flag_Single |
  205. Spell_Targets_Flag_Required);
  206.  
  207. But always attempt to use the predefined combination flags if applicable.
  208.  
  209. [[ Spell Check Rules ]]
  210.  
  211. Once the flags have been defined for a spell,
  212. you will then want to ensure that objects or arguments
  213. considered valid are checked in more depth before
  214. determining if the spellcasting process should be
  215. performed or not. This is where the overloaded
  216. functions defined earlier are linked to the spellcasting
  217. system to determine how a spell should check
  218. valid objects passed to it. How to create these
  219. functions will be explained later, but for now
  220. right under the flags is the best place to define them.
  221.  
  222. Examples:
  223.  
  224. set_spell_check_targets_rule(#’spell_check_targets_rule);
  225. set_spell_check_arguments_rule(#’spell_check_arguments_rule);
  226. set_spell_check_components_rule(#’spell_check_components_rule);
  227.  
  228. These processes are defined as closures then passed to the spellcasting
  229. system, which calls the defined functions before conducting the spellcasting
  230. process itself. Greater detail about how to formulate these functions will
  231. be found after we finish the rest of configure().
  232.  
  233. [[ Spell Help ]]
  234.  
  235. This is where a large portion of the individual spell help
  236. file is contained, as a general rule of thumb, this setting
  237. should typical contain no less than two complete sentences.
  238.  
  239. Examples:
  240.  
  241. set_spell_requirements_description(
  242. "One of the more common enchantments from the time "
  243. "of the orignal White Order was to shift the very essence of "
  244. "ones' spirit to the elemental qualities of snow. Doing so results "
  245. "in various physical side effects for the student, most notablly "
  246. "the ability to pass through ones enviornment at will, "
  247. "and also introduces a form of weakness to several magickal manipulations."
  248. );
  249.  
  250. Notice how the setting is one complete string, using spaces at
  251. the end of each line and a double space at the start of a new sentence.
  252. Some ideas to consider when creating a spell help setting:
  253.  
  254. Why does the spell have that name?
  255. How was the spell discovered?
  256. Who discovered the spell?
  257. Why does the spell work the way it does?
  258. Are there any side effects of the spell?
  259.  
  260. [[ Spell Knowledge Requirements ]]
  261.  
  262. This is the section for formulating a condition
  263. descriptor to check if the caster has knowledge of a
  264. spell or not. You can use all available settings and
  265. configurations of a normal condition descriptor here,
  266. most usually however these are skill based.
  267.  
  268. Examples:
  269.  
  270. set_spell_knowledge_requirement(([
  271. Condition_Type_Code : Condition_Type_Total,
  272. Condition_Value : 300,
  273. Condition_Info : ({
  274. ([
  275. //1:1 ratio
  276. Condition_Type_Code : Condition_Type_Skill,
  277. Condition_Info : Skill_Aretophrasty,
  278. ]),
  279. //1:1 ratio
  280. ([
  281. Condition_Type_Code : Condition_Type_Skill,
  282. Condition_Info : Skill_Arcane_Lore,
  283. ]),
  284. //1:1 ratio
  285. ([
  286. Condition_Type_Code : Condition_Type_Skill,
  287. Condition_Info : Skill_Metaphysics,
  288. ]),
  289. //1:0.25 ratio
  290. ([
  291. Condition_Type_Code : Condition_Type_Skill,
  292. Condition_Info : Skill_Evocation,
  293. Condition_Value : 0.25,
  294. ]),
  295. //1:0.25 ratio
  296. ([
  297. Condition_Type_Code : Condition_Type_Skill,
  298. Condition_Info : Skill_Cryoturgy,
  299. Condition_Value : 0.25,
  300. ]),
  301. }),
  302. }));
  303.  
  304. [[ Spell Incantation Step ]]
  305.  
  306. For all hermetic spellcasters, each spell must
  307. be started with an incantation step. Spells can
  308. contain more than a single incantation, and
  309. generally never more than a single incantation
  310. in a row. Due to the wide spread use of incantation
  311. steps, it is standard to factor this step out entirely,
  312. altering the default configurations defined by
  313. Spell.c when needed. By default, the speech
  314. content of an incantation step is set to the
  315. spell common name, meaning for additional
  316. incantation steps you must override some
  317. default values.
  318.  
  319. Examples:
  320.  
  321. //default step
  322. add_spell_step(spell_incantation_step());
  323.  
  324. //secondary incantation
  325. add_spell_step(spell_incantation_step(([
  326. Spell_Step_Order : foo, //where foo == some integer
  327. Spell_Step_Speech_Content : “bar”,
  328. ])));
  329.  
  330. There is a great deal of customization regarding
  331. incantation steps, from the language used, to the quote
  332. styles the caster has during the incantation. The available
  333. values to use in this step are:
  334.  
  335. Spell_Step_Language
  336. Spell_Step_Speech_Command
  337. Spell_Step_Speech_Content
  338. Spell_Step_Speech_Quote_Style
  339.  
  340. Other settings available in all spell steps, like
  341. settings for costs or activity are also available, these
  342. are just the ones specific to speech based steps.
  343.  
  344. From here on, topics surrounded by triple brackets
  345. are classified for values and settings that specifically
  346. apply to add_spell_step().
  347.  
  348. [[[ Spell Step General Concepts ]]]
  349.  
  350. Each time a spell step is added, a mapping
  351. containing key values and settings must be passed
  352. as an argument to add_spell_step(). Unless there
  353. is great reason not to, we define this mapping
  354. by hand for each step. As stated above, one
  355. reason not to do such a thing was for the incantation
  356. step, or if you have a handful of spells which will all
  357. use a similar step, it can generally be worth factoring
  358. out with its own inheritable for the various spells.
  359.  
  360. [[[ Spell Step Order ]]]
  361.  
  362. The first value which should be defined in the
  363. spell step mapping, this setting arranges the order
  364. in which the spellcasting system executes spell
  365. steps. For maintenance and standardization reasons,
  366. all your spell steps should be defined in ascending
  367. order down.
  368.  
  369. Examples :
  370.  
  371. add_spell_step(([
  372. Spell_Step_Order : 2,
  373. ]));
  374.  
  375. Doing this now specifies that said step is the second
  376. step in the spell, and any containing code or values will
  377. not be executed or formulated until the spellcasting process
  378. reaches the second step. Spell step order must be defined
  379. for each step.
  380.  
  381. [[[ Spell Step Descriptions ]]]
  382.  
  383. This is where the name for the spell step is defined, and
  384. is used by the system for things like skipping steps, or the
  385. help files for spells which list step descriptions and skills.
  386. Usually kept to a few words, this string should give a basic
  387. overview of what the step is doing.
  388.  
  389. Examples:
  390.  
  391. add_spell_step(([
  392. Spell_Step_Order : 2,
  393. Spell_Step_Description : “manifesting the required energy”,
  394. ]));
  395.  
  396. Now, if the caster has verbose spellcasting enabled, when they complete
  397. above step the result of the step performance and the step description will be
  398. displayed such as:
  399.  
  400. Your performance in manifesting the required energy was perfect.
  401.  
  402. If the spell step was skippable, the caster could cast the spell via:
  403.  
  404. cast spell without manifesting the required energy
  405.  
  406. And the spellcasting system would automatically remove the
  407. step from this instance of the spellcasting process conduction,
  408. handling the adjustments for cost and difficulty automatically.
  409.  
  410. [[[ Spell Step Activity ]]]
  411.  
  412. How much activity performing the individual spell step costs,
  413. defined as a integer.
  414.  
  415. Examples:
  416.  
  417. add_spell_step(([
  418. Spell_Step_Order : 2,
  419. Spell_Step_Description : “manifesting the required energy”,
  420. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  421. Spell_Step_Activity : 20,
  422. ]));
  423.  
  424. [[[ Spell Step Required ]]]
  425.  
  426. A value which can be True or False depending upon
  427. if the step can be skipped or not.
  428.  
  429. Examples:
  430.  
  431. add_spell_step(([
  432. Spell_Step_Order : 2,
  433. Spell_Step_Description : “manifesting the required energy”,
  434. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  435. Spell_Step_Activity : 20,
  436. Spell_Step_Required : False,
  437. ]));
  438.  
  439. [[[ Spell Step Difficulty ]]]
  440.  
  441. How difficult a spell step is, each step will have skills
  442. defined in a mapping with how much of the skill is used to
  443. get an overall combined value, which is checked against
  444. the set step difficulty. The following values for spell step
  445. difficulty are as followed:
  446.  
  447. (Per Step)
  448. Difficulty Min Max
  449. None 0 0
  450. Very Easy 0 110
  451. Easy 55 220
  452. Moderate 110 330
  453. Hard 165 440
  454. Very Hard 220 550
  455.  
  456. Examples:
  457.  
  458. add_spell_step(([
  459. Spell_Step_Order : 2,
  460. Spell_Step_Description : “manifesting the required energy”,
  461. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  462. Spell_Step_Activity : 20,
  463. Spell_Step_Required : False,
  464. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  465. ]));
  466.  
  467. [[[ Spell Step Importance ]]]
  468.  
  469. How important a step is to the overall spellcasting process.
  470. Used to determine the overall performance of a spell by taking the
  471. weighted average of each step against the value of step importance.
  472.  
  473. Skipping steps which have importance set will offset the spell step
  474. cost and overall difficulty values of the spell. The current importance
  475. values and their adjustments are as follows:
  476.  
  477. Skipped Step Difficulty Modifier
  478. Importance Min Max
  479. None (1) 0 0
  480. Minor (2) 10 25
  481. Lesser(3) 20 50
  482. Major (4) 30 75
  483. Greater (5) 40 100
  484. Great (6) 50 125
  485. (cost adjust only affects energy costs, not difficulty)
  486.  
  487. Examples:
  488.  
  489. add_spell_step(([
  490. Spell_Step_Order : 2,
  491. Spell_Step_Description : “manifesting the required energy”,
  492. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  493. Spell_Step_Activity : 20,
  494. Spell_Step_Required : False,
  495. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  496. Spell_Step_Importance : Spell_Step_Importance_Minor,
  497. ]));
  498.  
  499. [[[ Spell Step Skip Cost Adjust ]]]
  500.  
  501. A float used to modify the cost of a step based on if the step
  502. is skipped of not, this setting can only be used if the spell step
  503. is not required.
  504.  
  505. Examples:
  506.  
  507. add_spell_step(([
  508. Spell_Step_Order : 2,
  509. Spell_Step_Description : “manifesting the required energy”,
  510. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  511. Spell_Step_Activity : 20,
  512. Spell_Step_Required : False,
  513. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  514. Spell_Step_Importance : Spell_Step_Importance_Minor,
  515. //1.5x the cost of the step if skipped
  516. Spell_Step_Skip_Cost_Adjust : 1.50,
  517. ]));
  518.  
  519. [[[ Spell Step Skills ]]]
  520.  
  521. The field of a spell step containing a mapping of all
  522. the skills used in the step along with their ratios at
  523. which the skill is counted. The amount of skills used
  524. along with the ratios are which each skill is counted is
  525. heavily dependent upon the difficulty and importance of
  526. a step. Spell step skills, difficulty and importance are
  527. the three most vital settings to spell balance. Most often
  528. easier steps should contain 3-4 different skills, at least
  529. one of which at a 1:1 ratio, for slightly mid-tier spells
  530. at around the moderate difficulty, 3-5 skills should be
  531. used, with two of which at a 1:1 ratio. Lastly, for the
  532. most difficult of spells, 4-5 skills should be used,
  533. two with a 1:1 ratio and a third with an almost complete
  534. ratio, around 1:0.75.
  535.  
  536. As an additional note, any spell steps using the gesture
  537. spell step code must contain Skill_Prestidigitation, at an
  538. extremely reduced ratio, usually 1:0.10, to 1:0.25. This
  539. is because we have standardized the usage of the prestidigitation
  540. skill to be related with the act of performing gestures in spells.
  541. If the spell step requires drawing or tracing a rune, you can use
  542. Skill_Drawing or Skill_Calligraphy in conjunction with Skill_Rune_Lore
  543. instead of, not in addition to, prestidigitation.
  544.  
  545. Examples:
  546.  
  547. add_spell_step(([
  548. Spell_Step_Order : 2,
  549. Spell_Step_Description : “manifesting the required energy”,
  550. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  551. Spell_Step_Activity : 20,
  552. Spell_Step_Required : False,
  553. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  554. Spell_Step_Importance : Spell_Step_Importance_Minor,
  555. Spell_Step_Skip_Cost_Adjust : 1.50,
  556. Spell_Step_Skills : ([
  557. Skill_Thaumaturgy : 1.00,
  558. Skill_Evocation : 0.75,
  559. Skill_Prestidigitation : 0.20,
  560. ]),
  561. ]));
  562.  
  563. [[[ Spell Step Fumble Threshold ]]]
  564.  
  565. Specifies a minimum performance that must be meet to
  566. complete a spell step. Fumbled steps can also have control
  567. over specialized messages or damage types the said step will
  568. cause if fumbled. The current options for adding fumble
  569. support to spell steps are as follows:
  570.  
  571. Spell_Step_Fumble_Message
  572. Spell_Step_Fumble_Damage_Type
  573.  
  574. Both of the settings above are not directly required in
  575. the formulation of a spell, however they can add depth
  576. and more customization of the spellcasting process.
  577.  
  578. [[[ Spell Step Costs ]]]
  579.  
  580. This value holds arrays defined for energy costs
  581. of a given step. Each step can hold multiple types of
  582. energy costs, usually the cost of the step has some
  583. dependence upon the difficulty of the step, overall
  584. goal of the spell, and even how many steps are in the
  585. spell entirely. A good rule of thumb is to determine how
  586. much energy total a spell will require, then figure out how to
  587. best break up that cost among the spells individual steps. This
  588. is also where we can set the option to allow the spellcasting
  589. process to automatically convert energy for the caster if
  590. needed, or directly require that the energy be already present
  591. at the time of casting. If one picks the latter of the two options
  592. and the caster does not have the required energy to complete the
  593. step costs, the spell will fail, where-as if the former options is chosen
  594. the system will attempt to convert spiritual energy into the desired
  595. energy, ending in failure if the caster does not have the needed energy
  596. to convert as well.
  597.  
  598. Examples:
  599.  
  600. add_spell_step(([
  601. Spell_Step_Order : 2,
  602. Spell_Step_Description : “manifesting the required energy”,
  603. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  604. Spell_Step_Activity : 20,
  605. Spell_Step_Required : False,
  606. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  607. Spell_Step_Importance : Spell_Step_Importance_Minor,
  608. Spell_Step_Skip_Cost_Adjust : 1.50,
  609. Spell_Step_Skills : ([
  610. Skill_Thaumaturgy : 1.00,
  611. Skill_Evocation : 0.75,
  612. Skill_Prestidigitation : 0.20,
  613. ]),
  614. Spell_Step_Costs : ({
  615. //this step costs 10 magickal energy, 15 if it is skipped.
  616. ({ Energy_Magickal, 10.0 }),
  617. }),
  618. ]));
  619.  
  620. [[[ Spell Step Limbs Required ]]]
  621.  
  622. An int array which specifies which limbs the caster must have
  623. to perform the step. For gestural spells, the caster must use at least
  624. one hand. If the planned step has a message that requires two hands,
  625. then obviously two hands must be required. This value allows us to
  626. easily reference all or specific limbs used in the step when it is time
  627. to construct the spell messages.
  628.  
  629. Spells steps that are thoughts, speech content, vocalizations,
  630. or passive events have no use for this setting.
  631.  
  632. Examples:
  633.  
  634. add_spell_step(([
  635. Spell_Step_Order : 2,
  636. Spell_Step_Description : “manifesting the required energy”,
  637. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  638. Spell_Step_Activity : 20,
  639. Spell_Step_Required : False,
  640. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  641. Spell_Step_Importance : Spell_Step_Importance_Minor,
  642. Spell_Step_Skip_Cost_Adjust : 1.50,
  643. Spell_Step_Skills : ([
  644. Skill_Thaumaturgy : 1.00,
  645. Skill_Evocation : 0.75,
  646. Skill_Prestidigitation : 0.20,
  647. ]),
  648. Spell_Step_Costs : ({
  649. ({ Energy_Magickal, 10.0 }),
  650. }),
  651. //performing this step requires the caster to have 2 functioning hands.
  652. Spell_Step_Limbs_Required : ([
  653. Limb_Type_Hand : 2,
  654. ]),
  655. ]));
  656.  
  657. [[[ Spell Step Message/Display ]]]
  658.  
  659. For this field, we can specify a message or display to be performed
  660. at the time of the spell step. Spells that use the gesture type code should
  661. always contain at least a Spell_Step_Message, while Display is generally a
  662. optional setting that can add some depth and pad the length of a spell.
  663.  
  664. Spell_Step_Display is a more used setting for spell steps which
  665. have thoughts or vocalization type codes, as with it you can display
  666. messages to the caster about their senses or emotions.
  667.  
  668. To be able to construct proper spell step messages, we first have to
  669. understand how the spellcasting system allows us to define specific
  670. objects in the message. This is done by the core system using a
  671. replacement styled function to let us reference objects or limbs
  672. inside Message_Content.
  673.  
  674. The list of options are as follows:
  675.  
  676. “%caster”
  677. “%targets”
  678. “%target”
  679. “%target_or_self”
  680. “%components”
  681. “%component”
  682. “%arguments”
  683. “%argument”
  684. “%limbs” //will reference all the limbs or single limb if only one is required.
  685. “%limb_1” //will reference the first limb if more than one is required,
  686. this can be repeated up the N amount of limbs required. Such as,
  687. “%limb_2”, ect.
  688.  
  689. It is usually best practice to nest another message within the first,
  690. one part showing the gesture or actions the caster performs visually,
  691. and a secondary message showing a brief effect of the telesmatic
  692. process for those with astral perception. This is not required, but
  693. does add depth to the spell. Spells can also nest other forms of
  694. messages, such as for auditory or thermal based messages.
  695.  
  696. Examples:
  697.  
  698. add_spell_step(([
  699. Spell_Step_Order : 2,
  700. Spell_Step_Description : “manifesting the required energy”,
  701. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  702. Spell_Step_Activity : 20,
  703. Spell_Step_Required : False,
  704. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  705. Spell_Step_Importance : Spell_Step_Importance_Minor,
  706. Spell_Step_Skip_Cost_Adjust : 1.50,
  707. Spell_Step_Skills : ([
  708. Skill_Thaumaturgy : 1.00,
  709. Skill_Evocation : 0.75,
  710. Skill_Prestidigitation : 0.20,
  711. ]),
  712. Spell_Step_Costs : ({
  713. ({ Energy_Magickal, 10.0 }),
  714. }),
  715. Spell_Step_Limbs_Required : ([
  716. Limb_Type_Hand : 2,
  717. ]),
  718. Spell_Step_Message : ([
  719. Message_Content : ({
  720. "%caster", ({ "wave", "%caster", "%limbs" }), "through",
  721. ({ 't', Description(Description_Type_Ambient_Medium_Colored_Name) }),
  722. "gently",
  723. Message(([
  724. Message_Content : ({
  725. "as", 'a', self_color("auroric", 0, 0, False, "haze of energy"),
  726. "falls upon the surrounding area",
  727. }),
  728. Message_Senses : Message_Sense_Astral,
  729. ])),
  730. }),
  731. Message_Senses : Message_Sense_Visual |
  732. Message_Sense_Kinesthetic_For_Participants,
  733. ]),
  734. ]));
  735.  
  736. [[[ Spell_Step_Do_Call ]]]
  737.  
  738. Accepts a closure pointing to what function the spell step
  739. should call at step completion. Most usually for calling
  740. spell_complete() on the last step of the spell. Should be
  741. defined last in the step as it signifies that the step itself is
  742. almost finished.
  743.  
  744. Examples:
  745.  
  746. add_spell_step(([
  747. Spell_Step_Order : 2,
  748. Spell_Step_Description : “manifesting the required energy”,
  749. Spell_Step_Type_Code : Spell_Step_Type_Gesture,
  750. Spell_Step_Activity : 20,
  751. Spell_Step_Required : False,
  752. Spell_Step_Difficulty : Spell_Step_Difficulty_Easy,
  753. Spell_Step_Importance : Spell_Step_Importance_Minor,
  754. Spell_Step_Skip_Cost_Adjust : 1.50,
  755. Spell_Step_Skills : ([
  756. Skill_Thaumaturgy : 1.00,
  757. Skill_Evocation : 0.75,
  758. Skill_Prestidigitation : 0.20,
  759. ]),
  760. Spell_Step_Costs : ({
  761. ({ Energy_Magickal, 10.0 }),
  762. }),
  763. Spell_Step_Limbs_Required : ([
  764. Limb_Type_Hand : 2,
  765. ]),
  766. Spell_Step_Message : ([
  767. Message_Content : ({
  768. "%caster", ({ "wave", "%caster", "%limbs" }), "through",
  769. ({ 't', Description(Description_Type_Ambient_Medium_Colored_Name) }),
  770. "gently",
  771. Message(([
  772. Message_Content : ({
  773. "as", 'a', self_color("auroric", 0, 0, False, "haze of energy"),
  774. "falls upon the surrounding area",
  775. }),
  776. Message_Senses : Message_Sense_Astral,
  777. ])),
  778. }),
  779. Message_Senses : Message_Sense_Visual |
  780. Message_Sense_Kinesthetic_For_Participants,
  781. ]),
  782. Spell_Step_Do_Call : #'spell_complete,
  783. ]));
  784.  
  785. Congratulations, you should know have a basic understanding
  786. of how spell steps should be formulated and the various settings
  787. and options within them. Now, we’ll talk about what comes
  788. after configure().
  789.  
  790. [ Spell Check Targets Rules ]
  791.  
  792. Remember those functions we overloaded near the top of
  793. the file, then used as closures near the top of configure() ?
  794. Well, directly under configure() is where we define and place
  795. these functions. Initially, all the targets of a spell are kept in
  796. an object array, even if the target is only a single object. For
  797. spells which have a single target, first define the target object
  798. as the first value in the targets object array.
  799.  
  800. After this, we can now check the target object for various
  801. statuses or results to ensure it’s valid for the spell to be cast
  802. upon should the spell targeting flags determine the target to be
  803. valid. The types of checks performed will vary greatly spell
  804. by spell. Here is where you check for things like, is the target
  805. undead, do they already contain a copy of the enchantment the
  806. spell generates, or pretty much any other bit of information
  807. contained on the object. For a spell to be cast, this function
  808. must return True. If it’s determined that the target object
  809. defined is not a valid target for whatever reason, use the
  810. Error() function along with a string array explaining why
  811. the target is not valid to the caster.
  812.  
  813. Examples:
  814.  
  815. mixed spell_check_targets_rule(object array targets,
  816. object who, status initial) {
  817. //for single target spells, define the single target object from the
  818. //target object array
  819. object target = targets[0];
  820. //checks if the target has the capability for emotions, returns True if so,
  821. //or a error if not.
  822. if(!target->sentience()->query_sentience_emotion())
  823. return Error(({
  824. ({ 't', target }), ({ "are", target }),
  825. "devoid of emotions so you are unable to augment",
  826. ({ 'r', target, "feelings" })
  827. }));
  828. return True;
  829. }
  830.  
  831. [ Spell Generate Default Targets Rules ]
  832.  
  833. Generates a target object array by default, values
  834. returned must be an object array and fit the conditions
  835. of the defined target flags. Extremely useful for spells
  836. that should target the caster by default, or target
  837. all the junk items in a room by default. When using
  838. this function in conjunction with the
  839. Spell_Targets_Flag_Handle_Automatically
  840. the spell in question will attempt to locate targets
  841. by default while preventing the caster from specifying
  842. additional targets entirely.
  843.  
  844. Examples:
  845.  
  846. //will specify the caster by default
  847. object array spell_generate_default_targets_rule(object who) {
  848. return ({ who });
  849. }
  850.  
  851. Any other formulation of targets that can be located
  852. and derived from the caster object, or defined from
  853. outside methods can be used here.
  854.  
  855. [ Spell Check Arguments Rule ]
  856.  
  857. By default, the spellcasting system can handle
  858. multiple spell arguments for a single spell, so it places
  859. all the arguments used into a mixed value. The individual
  860. arguments are housed within as strings, and for spells which
  861. only accept one argument, pulling the single argument from the
  862. mixed value and then checking it against a defined list of
  863. valid strings is acceptable. Just as the targets rule, this
  864. function must return either True or an Error().
  865.  
  866. Examples:
  867.  
  868. varargs mixed spell_check_arguments(mixed arguments,
  869. object who, status initial) {
  870. //for spells with optional arguments
  871. unless(sizeof(arguments))
  872. return True;
  873. //for turning the mixed arguments into a string
  874. string arg = implode(arguments, "_");
  875. if(arg == "allowed argument")
  876. return True;
  877. return Error(({
  878. arg, "is not a valid argument for this spell.",
  879. }));
  880. }
  881.  
  882. [ Spell Check Components Rule ]
  883.  
  884. Checks the component(s) specified during the spellcasting
  885. attempt, checks the object if deemed valid by the components
  886. flags. Not all spells that use components have to destruct the
  887. component either, however for spells using typical or common
  888. place items with the goal of transforming it into some
  889. new other magickal based item, the component should
  890. be destructed in spell_complete() with a message regarding
  891. the object transformation. Just as the check targets and arguments
  892. rules, this function must also return True or an Error().
  893.  
  894. Examples:
  895.  
  896. varargs mixed spell_check_components_rule(object array components,
  897. object who, status initial) {
  898. object component = components[0];
  899. //if the component is a gemstone, return true, else, return error
  900. unless(component->query_property(Prop_Gemstone))
  901. return Error(({
  902. component, "is not the type of thing that can be ",
  903. "used as component for this spell",
  904. }));
  905. return True;
  906. }
  907.  
  908. [ Spell Complete ]
  909.  
  910. This is what performs the main desired outcome of the spell,
  911. and here you have access to the entirety of the spellcasting process
  912. descriptor and thus all the objects, messages, and values utilized
  913. in constructing the spellcasting process. Effects from firing off
  914. special attacks, to installing item or personal enchantments all
  915. go here. Firstly, you must define some objects and values to
  916. pull the most desired information from the spellcasting descriptor.
  917. Then you’re free to manipulate or use these objects at will,
  918. including them in messages, applying modifiers, whatever the
  919. spell does.
  920.  
  921. Examples:
  922.  
  923. void spell_complete(descriptor process) {
  924. //pulls the spellcasting process descriptor
  925. descriptor s_p = Process_Query_Info(process, "Spellcasting_Process");
  926. //caster object
  927. object who = Spellcasting_Process_Query(s_p, Spellcasting_Process_Actor);
  928. //overall spell performance float.
  929. float performance = Spellcasting_Process_Query(s_p,
  930. Spellcasting_Process_Performance);
  931. //the component object array
  932. object array components = Spellcasting_Process_Query(s_p,
  933. Spellcasting_Process_Components);
  934. //defining single component usage
  935. mixed component = components[0];
  936. //targets object array
  937. object array targets = Spellcasting_Process_Query(s_p,
  938. Spellcasting_Process_Targets);
  939. //single target from said array
  940. object target = targets[0];
  941. //spell arguments
  942. string array arg = Spellcasting_Process_Query(s_p,
  943. Spellcasting_Process_Arguments);
  944. //single arg
  945. string args = implode(arg, "_");
  946. //followed by whatever code or manipulations should be performed after the
  947. //definition of these values.
  948. }
  949.  
  950. //simple attack spell_complete
  951. void spell_complete(descriptor process) {
  952. spell_execute_typical_special_attack(process, ([
  953. Special_Attack_Type : ({ "magick" }),
  954. Special_Attack_Vector : Vector_Dart,
  955. Special_Attack_Power : ({
  956. Special_Attack_Power_Somewhat_Strong,
  957. Special_Attack_Power_Very_Strong,
  958. }),
  959. Special_Attack_Skill : ({
  960. Skill_Telesmatic_Weapon,
  961. Skill_Conjuration,
  962. Skill_Thaumaturgy,
  963. }),
  964. Special_Attack_Strike : ({ 10, 15 }),
  965. Special_Attack_From : ({ ({ 's', "%caster", "%limbs" }) }),
  966. Special_Attack_Size : Special_Attack_Size_Small,
  967. ]));
  968. }
  969.  
  970. //simple enchantment installing on spell_complete
  971. //note that this assumes you check for valid targets not already
  972. //in possession of the enchantment
  973.  
  974. void spell_complete(descriptor process) {
  975. descriptor s_p = Process_Query_Info(process, "Spellcasting_Process");
  976. object array targets = Spellcasting_Process_Query(s_p,
  977. Spellcasting_Process_Targets);
  978. object target = targets[0];
  979. object new_enchantment = new(Project_Name_Misc("enchantment"));
  980. spell_install_personal_enchantment(process, new_enchantment);
  981. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement