8000 [Battlemod] Added damaging drain msg to dmg coloring by KenshiDRK · Pull Request #1963 · Windower/Lua · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Battlemod] Added damaging drain msg to dmg coloring #1963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/battlemod/battlemod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require 'generic_helpers'
require 'parse_action_packet'
require 'statics'

_addon.version = '3.28'
_addon.version = '3.29'
_addon.name = 'BattleMod'
_addon.author = 'Byrth, maintainer: SnickySnacks'
_addon.commands = {'bm','battlemod'}
Expand Down
16 changes: 8 additions & 8 deletions addons/battlemod/parse_action_packet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function parse_action_packet(act)
end
local msg,numb = simplify_message(m.message)
if not color_arr[act.actor.owner or act.actor.type] then windower.add_to_chat(123,'Battlemod error, missing filter:'..tostring(act.actor.owner)..' '..tostring(act.actor.type)) end
if m.fields.status then numb = m.status else numb = pref_suf((m.cparam or m.param),m.message) end
if m.fields.status then numb = m.status else numb = pref_suf((m.cparam or m.param),m.message,act.actor.damage,col) end

if msg and m.message == 70 and not simplify then -- fix pronoun on parry
if v.target[1].race == 0 then
Expand Down Expand Up @@ -292,7 +292,7 @@ function parse_action_packet(act)
:gsub('${item2}',color_it(act.action.item2 or 'ERROR 121',color_arr.itemcol))
:gsub('${weapon_skill}',color_it(act.action.weapon_skill or 'ERROR 114',color_arr.wscol))
:gsub('${abil}',m.simp_name or 'ERROR 115')
:gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 116', color_arr[act.actor.damage]) or (numb or 'ERROR 116'))
:gsub('${numb}',numb or 'ERROR 116')
:gsub('${actor}',color_it((act.actor.name or 'ERROR 117' ) .. (act.actor.owner_name or "") ,color_arr[act.actor.owner or act.actor.type]))
:gsub('${target}',targ)
:gsub('${lb}','\7'..prefix2)
Expand All @@ -316,7 +316,7 @@ function parse_action_packet(act)
else m.simp_add_name = 'AE'
end
local msg,numb = simplify_message(m.add_effect_message)
if m.add_effect_fields.status then numb = m.add_effect_status else numb = pref_suf((m.cadd_effect_param or m.add_effect_param),m.add_effect_message) end
if m.add_effect_fields.status then numb = m.add_effect_status else numb = pref_suf((m.cadd_effect_param or m.add_effect_param),m.add_effect_message,act.actor.damage,col) end
if not act.action then
-- windower.add_to_chat(color, 'act.action==nil : '..m.message..' - '..m.add_effect_message..' - '..msg)
else
Expand All @@ -326,7 +326,7 @@ function parse_action_packet(act)
:gsub('${item}',act.action.item or 'ERROR 129')
:gsub('${weapon_skill}',act.action.weapon_skill or 'ERROR 130')
:gsub('${abil}',m.simp_add_name or act.action.name or 'ERROR 131')
:gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 132', color_arr[act.actor.damage]) or (numb or 'ERROR 132'))
:gsub('${numb}',numb or 'ERROR 132')
:gsub('${actor}',color_it(act.actor.name,color_arr[act.actor.owner or act.actor.type]))
:gsub('${target}',targ)
:gsub('${lb}','\7')
Expand Down Expand Up @@ -361,14 +361,14 @@ function parse_action_packet(act)
end

local msg = simplify_message(m.spike_effect_message)
if m.spike_effect_fields.status then numb = m.spike_effect_status else numb = pref_suf((m.cspike_effect_param or m.spike_effect_param),m.spike_effect_message) end
if m.spike_effect_fields.status then numb = m.spike_effect_status else numb = pref_suf((m.cspike_effect_param or m.spike_effect_param),m.spike_effect_message,actor.damage,col) end
windower.add_to_chat(color,make_condensedamage_number(m.spike_effect_number)..(msg
:gsub('${spell}',act.action.spell or 'ERROR 142')
:gsub('${ability}',act.action.ability or 'ERROR 143')
:gsub('${item}',act.action.item or 'ERROR 144')
:gsub('${weapon_skill}',act.action.weapon_skill or 'ERROR 145')
:gsub('${abil}',m.simp_spike_name or act.action.name or 'ERROR 146')
:gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 147', color_arr[actor.damage]) or (numb or 'ERROR 147'))
:gsub('${numb}',numb or 'ERROR 147')
:gsub((simplify and '${target}' or '${actor}'),color_it(act.actor.name,color_arr[act.actor.owner or act.actor.type]))
:gsub((simplify and '${actor}' or '${target}'),targ)
:gsub('${lb}','\7')
Expand All @@ -384,8 +384,8 @@ function parse_action_packet(act)
return act
end

function pref_suf(param,msg_ID)
local outstr = tostring(param)
function pref_suf(param,msg_ID,actor_dmg,col)
local outstr = (col == 'D' or dmg_drain_msg:contains(msg_ID)) and color_it(tostring(param),color_arr[actor_dmg]) or tostring(param)
if res.action_messages[msg_ID] and res.action_messages[msg_ID].prefix then
outstr = res.action_messages[msg_ID].prefix..' '..outstr
end
Expand Down
1 change: 1 addition & 0 deletions addons/battlemod/statics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ color_redundant = T{26,33,41,71,72,89,94,109,114,164,173,181,184,186,70,84,104,1
block_messages = T{12}
block_modes = T{20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,40,41,42,43,56,57,59,60,61,63,104,109,114,162,163,164,165,181,185,186,187,188}
black_colors = T{}--352,354,356,388,390,400,402,430,432,442,444,472,474,484,486}
dmg_drain_msg = T{132,161,187,227,274,281,736,748,749,802,803}

domain_buffs = S{
250, -- EF Badge
Expand Down
0