Difference between revisions of "Template:AttackSpell"
(Remove <includeonly> tags. This is a test to see what the <includeonly> tag does, and it is likely I will revert this very shortly.) |
(Comment out the lines of this template which are not displayed anywhere and therefore are not necessary to include in this template. If someone could find a way for these to be incorporated, then you are very welcome to do so.) |
||
Line 20: | Line 20: | ||
! 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]] | + | |}</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> | <noinclude> | ||
Line 33: | Line 33: | ||
|target = Bolt | |target = Bolt | ||
|special = N/A | |special = N/A | ||
− | + | |hit_type = normal | |
|hit_adder = 10 | |hit_adder = 10 | ||
|hit_num = 1 | |hit_num = 1 | ||
Line 41: | Line 41: | ||
|dam_adder = 18 | |dam_adder = 18 | ||
|dam_num = 2 | |dam_num = 2 | ||
− | |dam_denom = 3}} | + | |dam_denom = 3}} |
The above example produces: | The above example produces: |
Revision as of 17:59, 21 February 2018
Spell Details | |
---|---|
Damage Formula | |
Max Damage | |
Max Power | |
Range | |
Targeting | |
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 |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:
Spell Details | |
---|---|
Damage Formula | 6d(3+Power/9) fire |
Max Damage | 6d(25) |
Max Power | 200 |
Range | 7 |
Targeting | Bolt |
To-hit | |
Special | N/A |
Contents
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
- Pages that use this template (template already inserted, may need filling in)
- 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!