Difference between revisions of "Template:AttackSpell"

From CrawlWiki
Jump to: navigation, search
(Added to-hit)
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| cellpadding="5" style="border: 1px solid silver; font-size: 90%; float: right; float: top; width: 200px; margin: 0 0 1em 1em;"
+
<div style="margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; clear: right; border:none;">
|-
+
{| class="prettytable" style="border:none; margin:0; padding:0; width:20em;"
! style="background-color: lightblue;"| ''CrawlWiki''    [http://crawl.chaosforge.org/index.php?title=Template:Community&action=edit (Edit box)]
+
! colspan="2" style="font-size:larger;" | Spell Details
 
|-
 
|-
 
! align="left" | Damage Formula
 
! align="left" | Damage Formula
Line 17: Line 17:
 
! align="left" | Targeting
 
! align="left" | Targeting
 
|{{{target|}}}
 
|{{{target|}}}
 +
|-
 +
! align="left" | To-hit
 +
|{{{tohit|}}}
 
|-
 
|-
 
! align="left" | Special
 
! align="left" | Special
 
| {{{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]]-->
 
 
<noinclude>
 
[[Category:Templates]]
 
</noinclude>
 
 
 
 
 
 
 
 
 
 
 
 
 
<includeonly>[[Category:Attack spells]]</includeonly>
 
  
 
<noinclude>
 
<noinclude>
Line 43: Line 35:
 
  |range = 7
 
  |range = 7
 
  |target = Bolt
 
  |target = Bolt
  |special = N/A}}
+
|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:
 
The above example produces:
Line 54: Line 56:
 
|range = 7
 
|range = 7
 
|target = Bolt
 
|target = Bolt
|special = N/A}}
+
|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==
 
==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://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/zap-data.h here], and the spell range info is listed [http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/spl-data.h here].
+
* 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===
 
===Damage Formula and Max Power===
Each spell is listed [http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/zap-data.h here] in a structure with the following properties:
+
Each spell is listed [ here] in a structure with the following properties:
 
  369 struct zap_info
 
  369 struct zap_info
 
  370 {
 
  370 {
Line 106: Line 118:
  
 
In general the field zap_info->damage can be defined using two different functions:
 
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.
+
* 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.
+
 
 +
* 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===
 
===Spell Range===
*Data on spell range is listed [http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/spl-data.h here]. Max range is listed in the 5th field of the struct.  
+
*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.  
 
*For example, Fireball has a range of 6, while Magic Dart has the range of your LOS.  
  
Line 133: Line 147:
 
* Additional status effects (confusion, poison, etc.)
 
* Additional status effects (confusion, poison, etc.)
 
* Anything else that sets this spell apart!
 
* Anything else that sets this spell apart!
 
  
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 16:31, 31 May 2018

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!