Skip to content
Snippets Groups Projects
Commit a0f11f57 authored by DarkGod's avatar DarkGod
Browse files

Merge branch 'LogFix' into 'master'

Remove extra log messages for weapon procs

Removes the ITEM_ damage types from the combat log and touches up some misc numbers and displays on them.

I kept the item proc melee_project damage types out of the combat log for a reason.  They are essentially hacky ways of having a special_on_hit variant that can scale its chance and power with how many items have it.  It was left in the melee_project table mostly because the stuff I was revising was already there, I was just changing how it worked to be normalized, how it was displayed to convey more information (30 arcane silence?  what is that?), and removing the actual damage done in part to clean up the combat log.

Technically this should be its own special proc system, and that should be changed eventually as there are some other consequences of this method that have come up (block damage types, wielder and combat table not summing in intuitive ways).  I'm not surprised someone got confused and added these to the logs as it really was a silly way to do it.  I don't have time to fix this right now, though.

The display of these effects is already handled by the messages setEffect gives.  Putting special combat log entries is the equivalent of putting <20% chance to cast Nova rank 5> in the combat log when making unarmed attacks with Storm Bringer Gauntlets.  We only need to display this when the proc goes off, and the engine already handles that.  As is, my combat log is completely unreadable.

See merge request !402
parents 61fb64a7 e0fdb12c
No related branches found
No related tags found
No related merge requests found
......@@ -2074,9 +2074,6 @@ newDamageType{
end
name = "slow'"
end
game:delayedLogDamage(src, target, 0, ("%s<gloom %s>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", name), false)
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% gloom chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2096,7 +2093,7 @@ newDamageType{
parens = (" (#RED#%d%%#LAST#)"):format(diff)
end
end
return ("* #LIGHT_GREEN#%d%%#LAST# chance to inflict #GREY#damage reduction#LAST#%s")
return ("* #LIGHT_GREEN#%d%%#LAST# chance to inflict 15%% #GREY#damage reduction#LAST#%s")
:format(dam, parens)
end,
projector = function(src, x, y, type, dam, state)
......@@ -2107,10 +2104,7 @@ newDamageType{
if rng.percent(dam) then
local check = math.max(src:combatAttack(), src:combatSpellpower(), src:combatMindpower())
local reduction = 15
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% damage reduction>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", reduction), false)
target:setEffect(target.EFF_ITEM_NUMBING_DARKNESS, 4, {reduce = reduction, apply_power=check, no_ct_effect=true})
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% dark numbing chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2130,7 +2124,7 @@ newDamageType{
parens = (" (#RED#%d%%#LAST#)"):format(diff)
end
end
return ("* #LIGHT_GREEN#%d%%#LAST# chance to gain #LIGHT_STEEL_BLUE#10%% of a turn#LAST#%s")
return ("* #LIGHT_GREEN#%d%%#LAST# chance to gain #LIGHT_STEEL_BLUE#10%% of a turn#LAST# (3/turn limit)%s")
:format(dam, parens)
end,
projector = function(src, x, y, type, dam, state)
......@@ -2138,20 +2132,13 @@ newDamageType{
useImplicitCrit(src, state)
local target = game.level.map(x, y, Map.ACTOR)
if target and src and src.name and rng.percent(dam) then
if src.turn_procs and src.turn_procs.item_temporal_energize and src.turn_procs.item_temporal_energize > 3 then
game.logSeen(src, "#LIGHT_STEEL_BLUE#%s can't gain any more energy this turn! ", src.name:capitalize())
if src.turn_procs and src.turn_procs.item_temporal_energize and src.turn_procs.item_temporal_energize > 3 then
game.logSeen(src, "#LIGHT_STEEL_BLUE#%s can't gain any more energy this turn! ", src.name:capitalize())
return
end
game:delayedLogDamage(src, target, 0, ("%s<temporal energize>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#"), false)
local energy = (game.energy_to_act * 0.1)
src.energy.value = src.energy.value + energy
--game.logSeen(target, "Time seems to bend and quicken energizing %s!", src.name:capitalize())
src.turn_procs.item_temporal_energize = 1 + (src.turn_procs.item_temporal_energize or 0)
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% chance to energize>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
local energy = (game.energy_to_act * 0.1)
src.energy.value = src.energy.value + energy
src.turn_procs.item_temporal_energize = 1 + (src.turn_procs.item_temporal_energize or 0)
end
end,
}
......@@ -2169,7 +2156,7 @@ newDamageType{
parens = (" (#RED#%d%%#LAST#)"):format(diff)
end
end
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #GREEN#corrode armour#LAST#%s")
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #GREEN#corrode armour#LAST# by 30%%%s")
:format(dam, parens)
end,
projector = function(src, x, y, type, dam, state)
......@@ -2178,12 +2165,8 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target then
if rng.percent(dam) then
game:delayedLogDamage(src, target, 0, ("%s<30%%%% armour corrode>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
local check = math.max(src:combatAttack(), src:combatSpellpower(), src:combatMindpower())
--local param = { atk=dam/3, armor=dam/3, defense=dam/3, src=src, apply_power = check, no_ct_effect=true }
target:setEffect(target.EFF_ITEM_ACID_CORRODE, 5, {pct = 0.3, no_ct_effect = true, apply_power = check})
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% corrode armour chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2213,14 +2196,11 @@ newDamageType{
if target then
if rng.percent(dam) then
if target:canBe("blind") then
game:delayedLogDamage(src, target, 0, ("%s<blinding light>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#"), false)
local check = math.max(src:combatAttack(), src:combatSpellpower(), src:combatMindpower())
target:setEffect(target.EFF_BLINDED, 4, {apply_power=(check), no_ct_effect=true})
target:setEffect(target.EFF_BLINDED, 2, {apply_power=(check), no_ct_effect=true})
else
--game.logSeen(target, "%s resists the blinding light!", target.name:capitalize())
game.logSeen(target, "%s resists the blinding light!", target.name:capitalize())
end
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% blind chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2240,7 +2220,7 @@ newDamageType{
parens = (" (#RED#%d%%#LAST#)"):format(diff)
end
end
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #ROYAL_BLUE#daze#LAST#%s")
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #ROYAL_BLUE#daze#LAST# at end of turn%s")
:format(dam, parens)
end,
projector = function(src, x, y, type, dam, state)
......@@ -2249,13 +2229,10 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target then
if rng.percent(dam) then
game:delayedLogDamage(src, target, 0, ("%s<lightning daze>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#"), false)
if target:canBe("stun") then
local check = math.max(src:combatAttack(), src:combatSpellpower(), src:combatMindpower())
game:onTickEnd(function() target:setEffect(target.EFF_DAZED, 4, {apply_power=check, no_ct_effect=true}) end) --onTickEnd to avoid breaking the daze
end
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% daze chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2284,13 +2261,10 @@ newDamageType{
if target then
if rng.percent(dam) then
if target:canBe("disease") then
game:delayedLogDamage(src, target, 0, ("%s<blight disease>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#"), false)
local check = math.max(src:combatSpellpower(), src:combatMindpower(), src:combatAttack())
local disease_power = math.min(30, dam / 2)
target:setEffect(target.EFF_ITEM_BLIGHT_ILLNESS, 5, {reduce = disease_power})
end
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% disease chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......@@ -2345,8 +2319,6 @@ newDamageType{
useImplicitCrit(src, state)
local target = game.level.map(x, y, Map.ACTOR)
if target then
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% slow>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
-- target:setEffect(target.EFF_SLOW, 3, {power= math.min(60, dam / 100), no_ct_effect=true})
target:setEffect(target.EFF_SLOW, 3, {power= math.min(0.6, dam / 100), no_ct_effect=true})
end
end,
......@@ -2366,7 +2338,7 @@ newDamageType{
parens = (" (#RED#%d%%#LAST#)"):format(diff)
end
end
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #ORCHID#reduce powers#LAST# by %d%%%s")
return ("* #LIGHT_GREEN#%d%%#LAST# chance to #ORCHID#reduce effective powers#LAST# by %d%%%s")
:format(dam, 20, parens)
end,
projector = function(src, x, y, type, dam, state)
......@@ -2375,10 +2347,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target then
if rng.percent(dam) then
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% scouring>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", 20), false)
target:setEffect(target.EFF_ITEM_ANTIMAGIC_SCOURED, 3, {pct = 0.2, no_ct_effect=true})
else
game:delayedLogDamage(src, target, 0, ("%s<%d%%%% scour chance>#LAST#"):format(DamageType:get(type).text_color or "#aaaaaa#", dam), false)
end
end
end,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment