FLARE damage types
So I note the following chunks of code:
flare/src/PowerManager.h, Lines 62-71
// this elemental list covers the western 4, eastern 5, and classic rpg light vs. shadow
// TODO: user-defined element list?
const int ELEMENT_WOOD = 0;
const int ELEMENT_METAL = 1;
const int ELEMENT_WIND = 2;
const int ELEMENT_WATER = 3;
const int ELEMENT_EARTH = 4;
const int ELEMENT_FIRE = 5;
const int ELEMENT_SHADOW = 6;
const int ELEMENT_LIGHT = 7;
Which define the elements. The default, no-value for this is, according to the same file, line 247, is
trait_elemental = -1;
Elemental traits are further defined in PowerManager.cpp around line 252.
Elemental attributes are defined in Enemy.cpp, as such, at line 156:
// apply elemental resistance
// TODO: make this generic
if (h.trait_elemental == ELEMENT_FIRE) {
dmg = (dmg * stats.attunement_fire) / 100;
}
if (h.trait_elemental == ELEMENT_WATER) {
dmg = (dmg * stats.attunement_ice) / 100;
SO should it be possible to add
const int ELEMENT_NONE = -1;
to PowerManager.h
else if (infile.val == "none") powers[input_id].trait_elemental = ELEMENT_NONE;
to PowerManager.cpp
and
if (h.trait_elemental == ELEMENT_NONE) {
dmg = (dmg * stats.attunement_physical) / 100;
to Enemy.cpp
All with appropriate tabs, of course, to be able to create a Physical Resistance (or Untyped Resistance) attribute?
We haven't really decided the way to go with the core engine. It comes down to some game design choices. Some games have a Physical damage type, some games have Blunt/Slashing/Piercing subtypes.
Right now Armor Absorption is a flat # reduction while Resistance is a % reduction. Where to put Physical damage (absorption, resistance, both?) it's hard to say.
So physical vs. elemental damage, flat reduction vs. % reduction, there are lots of combinations. I'm not sure which the engine should handle, or the best way to make it generic.
Further, whether to treat these reductions as a fixed value or have diminishing returns. Maybe 100 resistance reduces incoming damage by 50%, but 200 resistance reduces damage by 75%. 300 resist for 87.5%. etc. Maybe the level difference betwen the attacker and defender adds in to the formula. Maybe the attacker can have a Piercing stat that ignores some amount of resistance.
At any rate, instead of making a very convoluted system to handle all cases, maybe it's best to isolate these calculations into a calculations class. Then at least someone changing the engine would have to do so in one place.
ok, so I ALSO had to add attunement_physical lines into StatBlock.cpp, StatBlock.h, and I'm getting a little further...
and the line in PowerManager.cpp that I suggested was extraneous.
Ha! I'd totally forgotten about Blunt/Slashing/Piercing since immersing myself in D&D4e... Skinny little skeletons. Good point.
I am not a programmer, but had an idea regarding this as I was perusing the forum..
To treat damage types as a table of sorts (put together in 1 table to explain)
Id // Name // Category // Resist // View // Type // Max // Per
1 // Fire // Elemental // Y // Y // % // 50 // 100
2 // Blunt // Physical // Y // N // # // Null // Null
3 // Light // Magic // Y // Y // % // 100 // 50
4 // Laser // Alien // N // Y // Null // Null // Null
5 // Fire // Elemental // Y // N // # // 25 // Null
The ones I have above would say that Fire is elemental damage that can have a % resistance of 50% remaining for every 100 added (your example above) and also allow you to have items to remove damage directly up to a max of 25 (can be done by not offering items high enough) - Order would be take the % out first, then the number based on it's entry order
Blunt would be not shown as a resistance, but items would inherently have resistance to, there would be no max amount had.
Light would be shown as a resistance and you could achieve immunity (100%) if you can get resist up to 50.
Anyway, as I said before I am not a programmer, so this could be impossible to implement, but thought I would share the idea anyway.
By the way I am enjoying playing the game quite a bit