Incorrect combat power checked for certain damage types?
Posted: Sat Jan 19, 2013 12:15 pm
Late night yesterday we had an interesting conversation on IRC with jinsediaoying and greycat. It begun with checking whether Wyrmic's Acid Blind from Dissolve uses Mindpower or something else. After checking the code it turned out to actually be... Spellpower. 
The talent itself does this:
Just applying ACID_BLIND damage type. How does ACID_BLIND work?
Uh-huh. It seems to always go with Spellpower, no matter what talent invoked the effect. I'm no expert on ToME code and/or LUA, but it does certainly seem fishy. Tying a specific damage type to spellpower/mindpower/whatever seems like a bad idea - it should probably check whatever power the talent itself uses.
Ice Claw does ICE damage on sufficiently high level. It in turn has 25% chance to apply FREEZE type. FREEZE also uses Spellpower... That would explain why I've heard from many people that Ice Claw hardly ever freezes.
LIGHTNING_DAZE also uses Spellpower.
Bellowing Roar uses CONFUSION that uses Spellpower again, but the talent itself seems to be handling it appropriately:
It seems to replace the power with Physical Power which is expected.
Also unrelated, LEAVES (from Leaves Tide?) doesn't seem to check for cut immunity.
ACID_DISARM and ACID_CORRODE both use Mindpower which is good.
Still I think reworking the damage types so they use whatever power the invoking talent tells them to might be a better idea. I'll leave that to actual developer to think over though.

The talent itself does this:
Code: Select all
self:attackTarget(target, (self:getTalentLevel(t) >= 2) and DamageType.ACID_BLIND or DamageType.ACID, self:combatTalentWeaponDamage(t, 0.1, 0.60), true)
self:attackTarget(target, (self:getTalentLevel(t) >= 4) and DamageType.ACID_BLIND or DamageType.ACID, self:combatTalentWeaponDamage(t, 0.1, 0.60), true)
self:attackTarget(target, (self:getTalentLevel(t) >= 6) and DamageType.ACID_BLIND or DamageType.ACID, self:combatTalentWeaponDamage(t, 0.1, 0.60), true)
self:attackTarget(target, (self:getTalentLevel(t) >= 8) and DamageType.ACID_BLIND or DamageType.ACID, self:combatTalentWeaponDamage(t, 0.1, 0.60), true)
return true
Code: Select all
if target and rng.percent(25) then
if target:canBe("blind") then
target:setEffect(target.EFF_BLINDED, 3, {src=src, apply_power=src:combatSpellpower()})
else
game.logSeen(target, "%s resists!", target.name:capitalize())
end
end
Ice Claw does ICE damage on sufficiently high level. It in turn has 25% chance to apply FREEZE type. FREEZE also uses Spellpower... That would explain why I've heard from many people that Ice Claw hardly ever freezes.

LIGHTNING_DAZE also uses Spellpower.
Bellowing Roar uses CONFUSION that uses Spellpower again, but the talent itself seems to be handling it appropriately:
Code: Select all
self:project(tg, self.x, self.y, DamageType.CONFUSION, {
dur=3,
dam=40 + 6 * self:getTalentLevel(t),
power_check=function() return self:combatPhysicalpower() end,
resist_check=self.combatPhysicalResist,
}, {type="flame"})
Also unrelated, LEAVES (from Leaves Tide?) doesn't seem to check for cut immunity.
ACID_DISARM and ACID_CORRODE both use Mindpower which is good.
Still I think reworking the damage types so they use whatever power the invoking talent tells them to might be a better idea. I'll leave that to actual developer to think over though.
