Difference between revisions of "Template:AttackSpell"

From CrawlWiki
Jump to: navigation, search
(experiment)
m (experiment (again))
Line 1: Line 1:
<div style="margin-top:0; margin-right:0; padding: 0px; float: right; border:none;">
+
<div style="margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;">
 
{| class="prettytable" style="border:none; margin:0; padding:0; width:20em;"
 
{| class="prettytable" style="border:none; margin:0; padding:0; width:20em;"
 
! colspan="2" style="font-size:larger;" | Spell Details
 
! colspan="2" style="font-size:larger;" | Spell Details
Line 24: Line 24:
 
| {{{special|}}}
 
| {{{special|}}}
 
|}</div><!--{{#set:power cap={{{power_cap|{{{maxsp}}} }}} }}{{#set:hit type={{{hit_type}}}}}{{#set:hit adder={{{hit_adder}}}}}{{#set:hit num={{{hit_num}}}}}{{#set:hit denom={{{hit_denom}}}}}{{#set:damage calculator={{{dam_calculator}}}}}{{#set:damage numdice={{{dam_numdice}}}}}{{#set:damage adder={{{dam_adder}}}}}{{#set:damage num={{{dam_num}}}}}{{#set:damage denom={{{dam_denom}}}}}[[Category:Attack spells]]-->
 
|}</div><!--{{#set:power cap={{{power_cap|{{{maxsp}}} }}} }}{{#set:hit type={{{hit_type}}}}}{{#set:hit adder={{{hit_adder}}}}}{{#set:hit num={{{hit_num}}}}}{{#set:hit denom={{{hit_denom}}}}}{{#set:damage calculator={{{dam_calculator}}}}}{{#set:damage numdice={{{dam_numdice}}}}}{{#set:damage adder={{{dam_adder}}}}}{{#set:damage num={{{dam_num}}}}}{{#set:damage denom={{{dam_denom}}}}}[[Category:Attack spells]]-->
 +
 +
<noinclude>
 +
 +
Use this template for pages about specific attack [[spell]]s; put it at the top of every such page.  Example usage:
 +
<nowiki>{{</nowiki>AttackSpell
 +
|name=Bolt of Fire
 +
|formula = 6d(3+Power/9) [[fire]]
 +
|maxdmg = 6d(25)
 +
|maxsp = 200
 +
|range = 7
 +
|target = Bolt
 +
|tohit = 10+Power/25
 +
|special = N/A
 +
<!-- |hit_type = normal
 +
|hit_adder = 10
 +
|hit_num = 1
 +
|hit_denom = 25
 +
|dam_calculator = calcdice
 +
|dam_numdice = 6
 +
|dam_adder = 18
 +
|dam_num = 2
 +
|dam_denom = 3--> }}
 +
 +
The above example produces:
  
 
{{AttackSpell
 
{{AttackSpell
|name=Kiss of Death
+
|name=Bolt of Fire
|formula = 2d(5.5 + 3*Power/10)
+
|formula = 6d(3+Power/9) [[fire]]
|maxdmg = 2d13 negative
+
|maxdmg = 6d(25)
|maxsp = 25
+
|maxsp = 200
|range = 1
+
|range = 7
|target = Random
+
|target = Bolt
|tohit = Never misses
+
|tohit = 10+Power/25
}}
+
|special = N/A
 +
<!--|hit_type = normal
 +
|hit_adder = 10
 +
|hit_num = 1
 +
|hit_denom = 25
 +
|dam_calculator = calcdice
 +
|dam_numdice = 6
 +
|dam_adder = 18
 +
|dam_num = 2
 +
|dam_denom = 3--> }}
 +
 
 +
==How to Help==
 +
* You can help by inserting this template into attack spell pages. Many of these pages already have the needed info. However if not, you can source dive for missing spell information. The spell damage info should be listed [http://s-z.org/neil/git/?p=crawl.git;a=blob;f=crawl-ref/source/zap-data.h;h=4b15cc68ab81163007eff942e875e69a9169ee4b;hb=stone_soup-0.14 here], and the spell range info is listed [http://s-z.org/neil/git/?p=crawl.git;a=blob;f=crawl-ref/source/spl-data.h;h=b89e529fdc8811638a0670a74048a003a2506a32;hb=stone_soup-0.14 here].
 +
 
 +
===Damage Formula and Max Power===
 +
Each spell is listed [ here] in a structure with the following properties:
 +
369 struct zap_info
 +
370 {
 +
371    zap_type ztype;
 +
372    const char* name;          // Name of spell
 +
373    int power_cap;              // Max spell power
 +
374    dam_deducer* damage;        // Damage formula
 +
375    tohit_deducer* tohit;     
 +
376    int colour;
 +
377    bool is_enchantment;
 +
378    beam_type flavour;
 +
379    dungeon_char_type glyph;
 +
380    bool always_obvious;
 +
381    bool can_beam;
 +
382    bool is_explosion;
 +
383    int hit_loudness;
 +
384 };
 +
 
 +
For example, bolt of fire is listed as,
 +
 
 +
121 {
 +
122    ZAP_FIRE,
 +
123    "bolt of fire",
 +
124    200,                                    // Max Power = 200
 +
125    new calcdice_calculator<6, 18, 2, 3>,  // Damage formula = see below
 +
126    new tohit_calculator<10, 1, 25>,
 +
127    RED,
 +
128    false,
 +
129    BEAM_FIRE,
 +
130    DCHAR_FIRED_ZAP,
 +
131    true,
 +
132    true,
 +
133    false,
 +
134    6
 +
135 },
 +
 
 +
*The damage formula is as follows:
 +
  362 template<int numdice, int adder, int mult_num, int mult_denom>
 +
  368 return calc_dice(numdice, adder + (pow * mult_num) / mult_denom);
 +
*So bolt of fire will have a damage formula using 6 dice to roll damage between 1 and (18+(power * 2)/3)/6
 +
*At 200 spell power, the max damage is equal to
 +
    18+(200*2/3) = 151
 +
*This damage will be calculated with 6 dice. So the dice calculation ends up actually being:
 +
    6d(151/6) = 6d(25)
 +
 
 +
In general the field zap_info->damage can be defined using two different functions:
 +
* calcdice_calculator(numdice, adder, mult_num, mult_denom). In this case the game uses numdice dice and each die has (adder + (pow * mult_num) / mult_denom) / numdice sides. The dam_type of the AttackSpell template should be set to "calcdice", and these coefficients should be assigned to the dam_xxx parameters.
 +
 
 +
* dicedef_calculator(numdice, adder, mult_num, mult_denom). In this case the game uses numdice dice and each die has adder + (pow * mult_num) / mult_denom sides. These values should be passed as the dam_xxx parameters of the AttackSpell template. The dam_type of the AttackSpell template should be set to "dicedef", and these coefficients should be assigned to the dam_xxx parameters (important: dam_adder=adder*numdice and dam_num=mult_num*numdice).
 +
 
 +
 
 +
===Spell Range===
 +
*Data on spell range is listed [http://s-z.org/neil/git/?p=crawl.git;a=blob;f=crawl-ref/source/spl-data.h;h=b89e529fdc8811638a0670a74048a003a2506a32;hb=stone_soup-0.14 here]. Max range is listed in the 5th field of the struct.
 +
*For example, Fireball has a range of 6, while Magic Dart has the range of your LOS.
 +
 
 +
===Relevant Spell Pages===
 +
*[http://crawl.chaosforge.org/index.php?title=Special:WhatLinksHere/Template:AttackSpell Pages that use this template] (template already inserted, may need filling in)
 +
*[[:Category:Needs Attack Spell Template | Pages that need this template]] (no template inserted yet, needs inserting and filling in)
 +
 
 +
==Target==
 +
The Target field should use one of the following entries:
 +
*Beam - Fires a projectile at the targeted tile which affects the first monster it strikes
 +
*Bolt - Fires a projectile at the targeted tile which affects all monsters it strikes until it runs out of range
 +
*Homing - Fires a projectile at the targeted monster which moves each turn toward its destination
 +
*Smite - Affects the targeted tile with perfect accuracy
 +
*Touch - Affects an adjacent tile with perfect accuracy
 +
*Self - Affects all monsters with a set radius of the caster
 +
*LOS - Affects all monsters you can currently see - (Move this to effect?)
 +
 
 +
==Special==
 +
The Special field describes any special effects of the attack spell:
 +
* Cloud/AOE
 +
* Accuracy specifics
 +
* Additional status effects (confusion, poison, etc.)
 +
* Anything else that sets this spell apart!
 +
 
 +
[[Category:Templates]]</noinclude>

Revision as of 20:46, 27 December 2022

Spell Details
Damage Formula
Max Damage
Max Power
Range
Targeting
To-hit
Special


Use this template for pages about specific attack spells; put it at the top of every such page. Example usage:

{{AttackSpell
|name=Bolt of Fire
|formula = 6d(3+Power/9) fire
|maxdmg = 6d(25)
|maxsp = 200
|range = 7
|target = Bolt
|tohit = 10+Power/25
|special = N/A
}}

The above example produces:

Spell Details
Damage Formula 6d(3+Power/9) fire
Max Damage 6d(25)
Max Power 200
Range 7
Targeting Bolt
To-hit 10+Power/25
Special N/A

How to Help

  • You can help by inserting this template into attack spell pages. Many of these pages already have the needed info. However if not, you can source dive for missing spell information. The spell damage info should be listed here, and the spell range info is listed here.

Damage Formula and Max Power

Each spell is listed [ here] in a structure with the following properties:

369 struct zap_info
370 {
371     zap_type ztype;
372     const char* name;           // Name of spell
373     int power_cap;              // Max spell power
374     dam_deducer* damage;        // Damage formula
375     tohit_deducer* tohit;       
376     int colour;
377     bool is_enchantment;
378     beam_type flavour;
379     dungeon_char_type glyph;
380     bool always_obvious;
381     bool can_beam;
382     bool is_explosion;
383     int hit_loudness;
384 };

For example, bolt of fire is listed as,

121 {
122     ZAP_FIRE,
123     "bolt of fire",
124     200,                                    // Max Power = 200
125     new calcdice_calculator<6, 18, 2, 3>,   // Damage formula = see below
126     new tohit_calculator<10, 1, 25>,
127     RED,
128     false,
129     BEAM_FIRE,
130     DCHAR_FIRED_ZAP,
131     true,
132     true,
133     false,
134     6
135 },
  • The damage formula is as follows:
 362 template<int numdice, int adder, int mult_num, int mult_denom>
 368 return calc_dice(numdice, adder + (pow * mult_num) / mult_denom);
  • So bolt of fire will have a damage formula using 6 dice to roll damage between 1 and (18+(power * 2)/3)/6
  • At 200 spell power, the max damage is equal to
   18+(200*2/3) = 151
  • This damage will be calculated with 6 dice. So the dice calculation ends up actually being:
   6d(151/6) = 6d(25)

In general the field zap_info->damage can be defined using two different functions:

  • calcdice_calculator(numdice, adder, mult_num, mult_denom). In this case the game uses numdice dice and each die has (adder + (pow * mult_num) / mult_denom) / numdice sides. The dam_type of the AttackSpell template should be set to "calcdice", and these coefficients should be assigned to the dam_xxx parameters.
  • dicedef_calculator(numdice, adder, mult_num, mult_denom). In this case the game uses numdice dice and each die has adder + (pow * mult_num) / mult_denom sides. These values should be passed as the dam_xxx parameters of the AttackSpell template. The dam_type of the AttackSpell template should be set to "dicedef", and these coefficients should be assigned to the dam_xxx parameters (important: dam_adder=adder*numdice and dam_num=mult_num*numdice).


Spell Range

  • Data on spell range is listed here. Max range is listed in the 5th field of the struct.
  • For example, Fireball has a range of 6, while Magic Dart has the range of your LOS.

Relevant Spell Pages

Target

The Target field should use one of the following entries:

  • Beam - Fires a projectile at the targeted tile which affects the first monster it strikes
  • Bolt - Fires a projectile at the targeted tile which affects all monsters it strikes until it runs out of range
  • Homing - Fires a projectile at the targeted monster which moves each turn toward its destination
  • Smite - Affects the targeted tile with perfect accuracy
  • Touch - Affects an adjacent tile with perfect accuracy
  • Self - Affects all monsters with a set radius of the caster
  • LOS - Affects all monsters you can currently see - (Move this to effect?)

Special

The Special field describes any special effects of the attack spell:

  • Cloud/AOE
  • Accuracy specifics
  • Additional status effects (confusion, poison, etc.)
  • Anything else that sets this spell apart!