Your attacks strike a ghastly wasp 2 times, with ***DISMEMBERING*** viciousness!
**************************************************************************************************
**************************************************************************************************
if not CritCounter then
display("Loading Crit Table")
CritCounter = {
_totalHits = 0,
_loaded = false,
_enabled = true,
}
local cc = CritCounter
cc._critDisplayOrder = {
"pathetic", "weak", "punishing", "surprising",
"amazing", "astonishing", "mauling", "decimating",
"devastating", "pulverizing", "maiming", "eviscerating",
"mutilating", "disemboweling", "dismembering", "massacring",
"mangling", "demolishing", "obliterating", "annihilating",
"eradicating", "vaporizing", "destructive", "extreme",
"porcine", "divine", "daunting", "terminal",
}
cc._critTable = {
pathetic = 0, weak = 0, punishing = 0, surprising = 0,
amazing = 0, astonishing = 0, mauling = 0, decimating = 0,
devastating = 0, pulverizing = 0, maiming = 0, eviscerating = 0,
mutilating = 0, disemboweling = 0, dismembering = 0, massacring = 0,
mangling = 0, demolishing = 0, obliterating = 0, annihilating = 0,
eradicating = 0, vaporizing = 0, destructive = 0, extreme = 0,
porcine = 0, divine = 0, daunting = 0, terminal = 0,
}
cc._critLast = {
pathetic = 0, weak = 0, punishing = 0, surprising = 0,
amazing = 0, astonishing = 0, mauling = 0, decimating = 0,
devastating = 0, pulverizing = 0, maiming = 0, eviscerating = 0,
mutilating = 0, disemboweling = 0, dismembering = 0, massacring = 0,
mangling = 0, demolishing = 0, obliterating = 0, annihilating = 0,
eradicating = 0, vaporizing = 0, destructive = 0, extreme = 0,
porcine = 0, divine = 0, daunting = 0, terminal = 0,
}
cc._critNames = {}
cc._critNames["pathetic"] = "pathetic"
cc._critNames["weak"] = "weak"
cc._critNames["punishing"] = "punishing"
cc._critNames["surprising"] = "surprising"
cc._critNames["amazing"] = "amazing"
cc._critNames["astonishing"] = "astonishing"
cc._critNames["mauling MAULING *MAULING* **MAULING** ***MAULING***"] = "mauling"
cc._critNames["decimating DECIMATING *DECIMATING* **DECIMATING** ***DECIMATING***"] = "decimating"
cc._critNames["devastating DEVASTATING *DEVASTATING* **DEVASTATING** ***DEVASTATING***"] = "devastating"
cc._critNames["pulverizing PULVERIZING *PULVERIZING* **PULVERIZING** ***PULVERIZING***"] = "pulverizing"
cc._critNames["maiming MAIMING *MAIMING* **MAIMING** ***MAIMING***"] = "maiming"
cc._critNames["eviscerating EVISCERATING *EVISCERATING* **EVISCERATING** ***EVISCERATING***"] = "eviscerating"
cc._critNames["mutilating MUTILATING *MUTILATING* **MUTILATING** ***MUTILATING***"] = "mutilating"
cc._critNames["disemboweling DISEMBOWELING *DISEMBOWELING* **DISEMBOWELING** ***DISEMBOWELING***"] = "disemboweling"
cc._critNames["dismembering DISMEMBERING *DISMEMBERING* **DISMEMBERING** ***DISMEMBERING***"] = "dismembering"
cc._critNames["massacring MASSACRING *MASSACRING* *MASSACRING** ***MASSACRING***"] = "massacring"
cc._critNames["mangling MANGLING *MANGLING* **MANGLING** ***MANGLING***"] = "mangling"
cc._critNames["demolishing DEMOLISHING *DEMOLISHING* **DEMOLISHING** ***DEMOLISHING***"] = "demolishing"
cc._critNames["obliterating OBLITERATING *OBLITERATING* **OBLITERATING** ***OBLITERATING***"] = "obliterating"
cc._critNames["annihilating ANNIHILATING *ANNIHILATING* **ANNIHILATING** ***ANNIHILATING*** >***ANNIHILATING***< >>***ANNIHILATING***<< >>>***ANNIHILATING***<<< >>>>***ANNIHILATING***<<<<"] = "annihilating"
cc._critNames["eradicating ERADICATING *ERADICATING* **ERADICATING** ***ERADICATING*** >***ERADICATING***< >>***ERADICATING***<< >>>***ERADICATING***<<< >>>>***ERADICATING***<<<<"] = "eradicating"
cc._critNames["vaporizing VAPORIZING *VAPORIZING* **VAPORIZING** ***VAPORIZING*** >***VAPORIZING***< >>***VAPORIZING***<< >>>***VAPORIZING***<<< >>>>***VAPORIZING***<<<<"] = "vaporizing"
cc._critNames["destructive DESTRUCTIVE *DESTRUCTIVE* **DESTRUCTIVE** ***DESTRUCTIVE*** ****DESTRUCTIVE**** >****DESTRUCTIVE****< >>****DESTRUCTIVE****<< >>>****DESTRUCTIVE****<<< >>>>****DESTRUCTIVE****<<<< =>>>>DESTRUCTIVE***<<<<= ==>>>>DESTRUCTIVE**<<<<== ===>>>>DESTRUCTIVE*<<<<=== ====>>>>DESTRUCTIVE<<<<===="] = "destructive"
cc._critNames["extreme EXTREME *EXTREME* **EXTREME** ***EXTREME*** ****EXTREME**** >****EXTREME****< >>****EXTREME****<< >>>****EXTREME****<<< >>>>****EXTREME****<<<< =>>>>***EXTREME***<<<<= ==>>>>**EXTREME**<<<<== ===>>>>*EXTREME*<<<<=== ====>>>>EXTREME<<<<===="] = "extreme"
cc._critNames["porcine PORCINE *PORCINE* **PORCINE** ***PORCINE*** >***PORCINE***< >>***PORCINE***<< >>>***PORCINE***<<< >>>>***PORCINE***<<<<"] = "porcine"
cc._critNames["divine"] = "divine"
cc._critNames["daunting"] = "daunting"
cc._critNames["terminal"] = "terminal"
end
function CritCounter:Enable(enable)
self._enabled = enable
cecho("\n<light_grey>[ <yellow>DAMAGE REPORT <light_grey>]: Counter has been ")
if enable then cecho("<light_grey>enabled!")
else cecho("<light_grey>disabled!") end
echo("\n")
end
function CritCounter:Load(force)
if self._loaded and not force then return end
local loadTable = {}
if string.char(getMudletHomeDir():byte()) == "/" then _sep = "/" else _sep = "\\" end
local l_SettingsFile = getMudletHomeDir() .. _sep .. "DmgCounter.lua"
if (io.exists(l_SettingsFile)) then
table.load(l_SettingsFile, loadTable)
end
if not loadTable.critTable or not loadTable.totalHits or not loadTable.critLast then
cecho("<red>Failed to load DAMAGE REPORT saved data!")
cecho("<white>Ignore this warning if you have just")
cecho("<white> installed the counter")
return
end
self._critTable = loadTable.critTable
self._totalHits = loadTable.totalHits
self._critLast = loadTable.critLast
self._loaded = true
end
function CritCounter:Save()
if string.char(getMudletHomeDir():byte()) == "/" then _sep = "/" else _sep = "\\" end
local l_SettingsFile = getMudletHomeDir() .. _sep .. "CritCounter.lua"
local savetable = {}
savetable.critTable = self._critTable
savetable.totalHits = self._totalHits
savetable.critLast = self._critLast
table.save(l_SettingsFile, savetable)
end
function CritCounter:display()
local totalcrits = 0
for _, num in pairs(self._critTable) do
totalcrits = totalcrits + num
end
local critrate = self._totalHits == 0 and 0 or (totalcrits / self._totalHits) * 100
cecho("\n<grey>" .. string.rep("-", 31) .. "[ <yellow>DAMAGE REPORT:<grey> ]" .. string.rep("-", 31) .. "\n\n")
cecho("<RoyalBlue>Total hits: <white>" .. self._totalHits .. "\n")
cecho("<RoyalBlue>Total crits: <white>" .. totalcrits .. "\n")
cecho("<RoyalBlue>Total crit-rate: <white>" .. string.format("%.3f", critrate) .. "\n")
cecho("\n\n<dodger_blue>Statistics:\n")
for _, crit in ipairs(self._critDisplayOrder) do
local rate = totalcrits == 0 and 0.0 or (self._critTable[crit] / totalcrits) * 100
if not crit then print("NIL VARIABLE: crit") end
if not self._critTable[crit] then
print("NIL VARIABLE: self._critTable[crit]")
display(crit)
display(self._critTable)
end
if not rate then print("NIL VARIABLE: rate") end
if not self._critLast[crit] then print("NIL VARIABLE: self._critLast[crit]") end
local format_str = "<yellow>%-20s<white>%s <LimeGreen>[ %-8.3f ] - %s hits ago!\n"
local line = string.format(format_str,crit,self._critTable[crit],rate,self._critLast[crit])
cecho(line)
end
cecho("\n<grey>" .. string.rep("-", 80) .. "\n")
end
function CritCounter:Reset()
for crit, _ in pairs(self._critTable) do
self._critTable[crit] = 0
self._critLast[crit] = 0
end
self._totalHits = 0
self:Save()
cecho("\n<light_grey>[ <yellow>DAMAGE REPORT <light_grey>]: Counter has been reset!")
end
function CritCounter:AddHit()
if not self._enabled then return end
self._totalHits = self._totalHits + 1
for crit, _ in pairs(self._critLast) do
self._critLast[crit] = self._critLast[crit] + 1
end
end
function CritCounter:AddCrit(type)
if not self._enabled or not type then return end
type = self._critNames[type]
self._critTable[type] = self._critTable[type] + 1
self._critLast[type] = 0
self:Save()
end
CritCounter:Load()