Difference between revisions of "Manual:DIL Manual/cast spell()"
Jump to navigation
Jump to search
(XML import) |
(XML import) |
||
| Line 1: | Line 1: | ||
| + | <span id="bpcast_s"></span> | ||
| + | cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr ) | ||
| + | WILL EVENTUALLY BE OBSOLETE AND REPLACED BY THE CAST_SPELL BELOW. | ||
| + | i : Spell index to cast. See SPL_* in values.h and/or vme.h. | ||
| + | caster : The caster of the spell. | ||
| + | medium : The medium, with which the spell is cast, might be caster. | ||
| + | target : The target of the spell. | ||
| + | |||
| + | Use this to cast spells without performing all the usual mana stuff, etc. | ||
| + | Very useful with for example rings / items possessing magical abilities. | ||
| + | |||
| + | integer cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr, effect : string ) | ||
| + | i : Spell index to cast. See SPL_* in values.h and/or vme.h. | ||
| + | caster : The caster of the spell. | ||
| + | medium : The medium, with which the spell is cast, might be caster. | ||
| + | target : The target of the spell. | ||
| + | effect : A symbolic DIL program which takes no arguments. This will | ||
| + | cause all effects to be suppressed and leave this to the program | ||
| + | specified. A string of "" will cause the ordinary messages to | ||
| + | appear. | ||
| + | returns: The result of the spell. | ||
| + | |||
| + | Use this to cast spells without performing all the usual mana stuff, etc. | ||
| + | Very useful with for example rings / items possessing magical abilities. | ||
| + | Please note that in the two programs below the variable 'hm' represents | ||
| + | the number of hitpoints that will be deducted from the target. | ||
| + | |||
| + | '''Example:''' | ||
| + | |||
| + | %dil | ||
| + | |||
| + | <nowiki> | ||
| + | |||
| + | dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer); | ||
| + | code | ||
| + | dilend</nowiki> | ||
| + | |||
| + | ..... | ||
| + | |||
| + | %... | ||
| + | |||
| + | <nowiki> | ||
| + | |||
| + | dilbegin test(); | ||
| + | var | ||
| + | n : integer; | ||
| + | code | ||
| + | dilend</nowiki> | ||
| + | |||
| + | ---~---~---~---~---~---~---~---~--- | ||
<span id="bpcast_s"></span> | <span id="bpcast_s"></span> | ||
cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr ) | cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr ) | ||
| Line 38: | Line 88: | ||
dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer); | dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer); | ||
code | code | ||
| − | + | dilend</nowiki> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
..... | ..... | ||
| Line 56: | Line 100: | ||
n : integer; | n : integer; | ||
code | code | ||
| − | + | dilend</nowiki> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
---~---~---~---~---~---~---~---~--- | ---~---~---~---~---~---~---~---~--- | ||
Latest revision as of 22:33, 4 December 2025
cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr )
WILL EVENTUALLY BE OBSOLETE AND REPLACED BY THE CAST_SPELL BELOW.
i : Spell index to cast. See SPL_* in values.h and/or vme.h. caster : The caster of the spell. medium : The medium, with which the spell is cast, might be caster. target : The target of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities.
integer cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr, effect : string )
i : Spell index to cast. See SPL_* in values.h and/or vme.h.
caster : The caster of the spell.
medium : The medium, with which the spell is cast, might be caster.
target : The target of the spell.
effect : A symbolic DIL program which takes no arguments. This will
cause all effects to be suppressed and leave this to the program
specified. A string of "" will cause the ordinary messages to
appear.
returns: The result of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities. Please note that in the two programs below the variable 'hm' represents the number of hitpoints that will be deducted from the target.
Example:
%dil
dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer);
code
dilend
.....
%...
dilbegin test();
var
n : integer;
code
dilend
---~---~---~---~---~---~---~---~---
cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr )
WILL EVENTUALLY BE OBSOLETE AND REPLACED BY THE CAST_SPELL BELOW.
i : Spell index to cast. See SPL_* in values.h and/or vme.h. caster : The caster of the spell. medium : The medium, with which the spell is cast, might be caster. target : The target of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities.
integer cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr, effect : string )
i : Spell index to cast. See SPL_* in values.h and/or vme.h.
caster : The caster of the spell.
medium : The medium, with which the spell is cast, might be caster.
target : The target of the spell.
effect : A symbolic DIL program which takes no arguments. This will
cause all effects to be suppressed and leave this to the program
specified. A string of "" will cause the ordinary messages to
appear.
returns: The result of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities. Please note that in the two programs below the variable 'hm' represents the number of hitpoints that will be deducted from the target.
Example:
%dil
dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer);
code
dilend
.....
%...
dilbegin test();
var
n : integer;
code
dilend
---~---~---~---~---~---~---~---~---