Draft:Two Worlds:Mana Cost: Difference between revisions

The Two Worlds Wiki - Documenting Two Worlds since 2008.
Jump to navigation Jump to search
Fandom Two Worlds>Phicr
(Adding categories)
Fandom Two Worlds>Phicr
(Simplify information by linking to Spell Level and using it as a basis for the formulas)
Line 1: Line 1:
The Mana Cost of a spell is the amount of mana points required and used up when casting that spell. Every cost follows one of two formulas:<syntaxhighlight lang="julia">
The Mana Cost of a spell is the amount of mana points required and used up when casting that spell. Every cost follows one of two formulas:<syntaxhighlight lang="julia">
floor(initial_cost + (level - initial_level - 1) * increase)
floor(initial_cost + (level - 1) * increase)
</syntaxhighlight><syntaxhighlight lang="julia">
</syntaxhighlight><syntaxhighlight lang="julia">
floor(base_cost + increase + max(0, level - initial_level - 1) * increase)
floor(base_cost + increase + max(0, level - 2) * increase)
</syntaxhighlight>Where:
</syntaxhighlight>Where:


Line 10: Line 10:
* <code>base_cost</code> = cost of the spell at level 1 minus <code>increase</code>.
* <code>base_cost</code> = cost of the spell at level 1 minus <code>increase</code>.
* <code>increase</code> = amount increased every level.
* <code>increase</code> = amount increased every level.
* <code>level</code> = sum of the amount of stacked cards, levels increased by [[Spell Booster|Spell Boosters]], and the player's skill level of the spell's [[magic]] school minus 1.
* <code>level</code> = The spell's [[Spell Level]].
* <code>initial_level</code> = skill level for the spell's school of magic at which the spell is unlocked.
* <code>initial_level</code> = skill level for the spell's school of magic at which the spell is unlocked.


Line 17: Line 17:


* 1 card, 0 spell boosters, and with [[Fire Magic]] level 1: <syntaxhighlight lang="julia">
* 1 card, 0 spell boosters, and with [[Fire Magic]] level 1: <syntaxhighlight lang="julia">
floor(15 + (1 + 0 + 1 - 1 - 1) * 5) MP =
floor(15 + (1 - 1) * 5) MP =
floor(15 + 0) MP =
floor(15 + 0) MP =
15 MP
15 MP
Line 23: Line 23:


* 2 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">
* 2 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">
floor(15 + (2 + 0 + 1 - 1 - 1) * 5) MP =
floor(15 + (2 - 1) * 5) MP =
floor(15 + 1 * 5) MP =
floor(15 + 1 * 5) MP =
20 MP
20 MP
Line 29: Line 29:


* 3 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">
* 3 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">
floor(15 + (3 + 0 + 1 - 1 - 1) * 5) MP =
floor(15 + (3 - 1) * 5) MP =
floor(15 + 2 * 5) MP =
floor(15 + 2 * 5) MP =
floor(15 + 10) MP =
floor(15 + 10) MP =
Line 35: Line 35:
</syntaxhighlight>
</syntaxhighlight>
* 3 cards, 0 spell boosters, and with Fire Magic level 8:<syntaxhighlight lang="julia">
* 3 cards, 0 spell boosters, and with Fire Magic level 8:<syntaxhighlight lang="julia">
floor(15 + (3 + 0 + 8 - 1 - 1) * 5) MP =
floor(15 + (10 - 1) * 5) MP =
floor(15 + 9 * 5) MP =
floor(15 + 9 * 5) MP =
floor(15 + 45) MP =
floor(15 + 45) MP =
Line 41: Line 41:
</syntaxhighlight>
</syntaxhighlight>
* 3 cards, 2 spell boosters, and with Fire Magic level 8: <syntaxhighlight lang="julia">
* 3 cards, 2 spell boosters, and with Fire Magic level 8: <syntaxhighlight lang="julia">
floor(15 + (3 + 3 + 8 - 1 - 1) * 5) MP =
floor(15 + (13 - 1) * 5) MP =
floor(15 + 12 * 5) MP =
floor(15 + 12 * 5) MP =
floor(15 + 60) MP =
floor(15 + 60) MP =
Line 51: Line 51:


* 1 card, 0 spell boosters, and with [[Air Magic]] level 1:<syntaxhighlight lang="julia">
* 1 card, 0 spell boosters, and with [[Air Magic]] level 1:<syntaxhighlight lang="julia">
floor(40 + 40/7 + max(0, 1 + 0 + 1 - 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, -1) * 40/7) MP =
floor(40 + 40/7 + max(0, -1) * 40/7) MP =
floor(40 + 40/7 + 0 * 40/7) MP =
floor(40 + 40/7 + 0 * 40/7) MP =
Line 61: Line 61:


* 2 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">
* 2 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">
floor(40 + 40/7 + max(0, 2 + 0 + 1 - 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 2 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 0) * 40/7) MP =
floor(40 + 40/7 + max(0, 0) * 40/7) MP =
floor(40 + 40/7 + 0 * 40/7) MP =
floor(40 + 40/7 + 0 * 40/7) MP =
Line 70: Line 70:
</syntaxhighlight>
</syntaxhighlight>
* 3 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">
* 3 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">
floor(40 + 40/7 + max(0, 3 + 0 + 1 - 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 3 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 1) * 40/7) MP =
floor(40 + 40/7 + max(0, 1) * 40/7) MP =
floor(40 + 40/7 + 1 * 40/7) MP =
floor(40 + 40/7 + 1 * 40/7) MP =
Line 80: Line 80:


* 3 cards, 0 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">
* 3 cards, 0 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">
floor(40 + 40/7 + max(0, 3 + 0 + 8 - 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 10 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 8) * 40/7) MP =
floor(40 + 40/7 + max(0, 8) * 40/7) MP =
floor(40 + 40/7 + 8 * 40/7) MP =
floor(40 + 40/7 + 8 * 40/7) MP =
Line 89: Line 89:
</syntaxhighlight>
</syntaxhighlight>
* 3 cards, 2 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">
* 3 cards, 2 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">
floor(40 + 40/7 + max(0, 3 + 3 + 8 - 1 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 13 - 2) * 40/7) MP =
floor(40 + 40/7 + max(0, 11) * 40/7) MP =
floor(40 + 40/7 + max(0, 11) * 40/7) MP =
floor(40 + 40/7 + 11 * 40/7) MP =
floor(40 + 40/7 + 11 * 40/7) MP =
Line 99: Line 99:




You can tell which spells use the second formula by checking if, at the initial skill level with no spell boosters, there is no difference between the mana cost when using 1 or 2 cards. For example, Heal has 45 cost at Air Magic level 1 when using either 1 or 2 cards, so it uses the second formula; meanwhile, Firebolt changes cost from 15 to 20 at Fire Magic level 1, when changing from 1 to 2 cards, so it uses the first formula.
You can tell which spells use the second formula by checking if there's no cost change between spell level 1 and 2. For example, Heal has 45 cost at Air Magic level 1 when using either 1 or 2 cards, so it uses the second formula; meanwhile, Firebolt changes cost from 15 to 20 at Fire Magic level 1 when changing from 1 to 2 cards, so it uses the first formula.
[[Category:Magic]]
[[Category:Magic]]

Revision as of 18:47, January 20, 2021

The Mana Cost of a spell is the amount of mana points required and used up when casting that spell. Every cost follows one of two formulas:<syntaxhighlight lang="julia"> floor(initial_cost + (level - 1) * increase) </syntaxhighlight><syntaxhighlight lang="julia"> floor(base_cost + increase + max(0, level - 2) * increase) </syntaxhighlight>Where:

  • floor(x) = Function, returns the greatest integer less than or equal to x.
  • max(x,y) = Function, returns the greater number among its arguments.
  • initial_cost = cost of the spell at level 1.
  • base_cost = cost of the spell at level 1 minus increase.
  • increase = amount increased every level.
  • level = The spell's Spell Level.
  • initial_level = skill level for the spell's school of magic at which the spell is unlocked.


Spells that use the first formula include Firebolt, Ring of Fire, and Lightning. Here are some examples using Firebolt, which has a initial cost of 15, initial level of 1, and cost increase of 5.

  • 1 card, 0 spell boosters, and with Fire Magic level 1: <syntaxhighlight lang="julia">

floor(15 + (1 - 1) * 5) MP = floor(15 + 0) MP = 15 MP </syntaxhighlight>

  • 2 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">

floor(15 + (2 - 1) * 5) MP = floor(15 + 1 * 5) MP = 20 MP </syntaxhighlight>

  • 3 cards, 0 spell boosters, and with Fire Magic level 1:<syntaxhighlight lang="julia">

floor(15 + (3 - 1) * 5) MP = floor(15 + 2 * 5) MP = floor(15 + 10) MP = 25 MP </syntaxhighlight>

  • 3 cards, 0 spell boosters, and with Fire Magic level 8:<syntaxhighlight lang="julia">

floor(15 + (10 - 1) * 5) MP = floor(15 + 9 * 5) MP = floor(15 + 45) MP = 60 MP </syntaxhighlight>

  • 3 cards, 2 spell boosters, and with Fire Magic level 8: <syntaxhighlight lang="julia">

floor(15 + (13 - 1) * 5) MP = floor(15 + 12 * 5) MP = floor(15 + 60) MP = 75 MP </syntaxhighlight>


Spells that use the second formula include Heal, Summon Octogron, and Summon Soul Defender. Here are some examples using Heal, which has a base cost of 40, initial level of 1, and cost increase of 40/7.

  • 1 card, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">

floor(40 + 40/7 + max(0, 1 - 2) * 40/7) MP = floor(40 + 40/7 + max(0, -1) * 40/7) MP = floor(40 + 40/7 + 0 * 40/7) MP = floor(40 + 40/7) MP = floor(40 + 5.72...) MP = floor(45.72...) MP = 45 MP </syntaxhighlight>

  • 2 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">

floor(40 + 40/7 + max(0, 2 - 2) * 40/7) MP = floor(40 + 40/7 + max(0, 0) * 40/7) MP = floor(40 + 40/7 + 0 * 40/7) MP = floor(40 + 40/7) MP = floor(40 + 5.72...) MP = floor(45.72...) MP = 45 MP </syntaxhighlight>

  • 3 cards, 0 spell boosters, and with Air Magic level 1:<syntaxhighlight lang="julia">

floor(40 + 40/7 + max(0, 3 - 2) * 40/7) MP = floor(40 + 40/7 + max(0, 1) * 40/7) MP = floor(40 + 40/7 + 1 * 40/7) MP = floor(40 + 80/7) MP = floor(40 + 11.42...) MP = floor(51.42...) MP = 51 MP </syntaxhighlight>

  • 3 cards, 0 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">

floor(40 + 40/7 + max(0, 10 - 2) * 40/7) MP = floor(40 + 40/7 + max(0, 8) * 40/7) MP = floor(40 + 40/7 + 8 * 40/7) MP = floor(40 + 360/7) MP = floor(40 + 51.42...) MP = floor(91.42...) MP = 91 MP </syntaxhighlight>

  • 3 cards, 2 spell boosters, and with Air Magic level 8:<syntaxhighlight lang="julia">

floor(40 + 40/7 + max(0, 13 - 2) * 40/7) MP = floor(40 + 40/7 + max(0, 11) * 40/7) MP = floor(40 + 40/7 + 11 * 40/7) MP = floor(40 + 480/7) MP = floor(40 + 68.57...) MP = floor(108.57...) MP = 108 MP </syntaxhighlight>


You can tell which spells use the second formula by checking if there's no cost change between spell level 1 and 2. For example, Heal has 45 cost at Air Magic level 1 when using either 1 or 2 cards, so it uses the second formula; meanwhile, Firebolt changes cost from 15 to 20 at Fire Magic level 1 when changing from 1 to 2 cards, so it uses the first formula.