Skip to content
Snippets Groups Projects
Commit 9bf34c6a authored by dg's avatar dg
Browse files

Fix character sheet for controlled summmons

git-svn-id: http://svn.net-core.org/repos/t-engine4@1140 51575b47-30f0-44d4-a5cc-537603b46e54
parent 353592c3
No related branches found
No related tags found
No related merge requests found
......@@ -43,135 +43,136 @@ function _M:init(actor)
end
function _M:drawDialog(s)
local cur_exp, max_exp = game.player.exp, game.player:getExpChart(game.player.level+1)
local player = self.actor
local cur_exp, max_exp = player.exp, player:getExpChart(player.level+1)
local h = 0
local w = 0
s:drawStringBlended(self.font, "Sex: "..game.player.descriptor.sex, w, h, 0, 200, 255) h = h + self.font_h
s:drawStringBlended(self.font, "Race: "..game.player.descriptor.subrace, w, h, 0, 200, 255) h = h + self.font_h
s:drawStringBlended(self.font, "Class: "..game.player.descriptor.subclass, w, h, 0, 200, 255) h = h + self.font_h
s:drawStringBlended(self.font, "Sex: "..(player.descriptor.sex or (player.female and "Female" or "Male")), w, h, 0, 200, 255) h = h + self.font_h
s:drawStringBlended(self.font, "Race: "..(player.descriptor.subrace or player.type:capitalize()), w, h, 0, 200, 255) h = h + self.font_h
s:drawStringBlended(self.font, "Class: "..(player.descriptor.subclass or player.subtype:capitalize()), w, h, 0, 200, 255) h = h + self.font_h
h = h + self.font_h
s:drawColorStringBlended(self.font, "Level: #00ff00#"..game.player.level, w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, "Level: #00ff00#"..player.level, w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Exp: #00ff00#%2d%%"):format(100 * cur_exp / max_exp), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Gold: #00ff00#%0.2f"):format(game.player.money), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Gold: #00ff00#%0.2f"):format(player.money), w, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
s:drawColorStringBlended(self.font, ("#c00000#Life: #00ff00#%d/%d"):format(game.player.life, game.player.max_life), w, h, 255, 255, 255) h = h + self.font_h
if game.player:knowTalent(game.player.T_STAMINA_POOL) then
s:drawColorStringBlended(self.font, ("#ffcc80#Stamina: #00ff00#%d/%d"):format(game.player:getStamina(), game.player.max_stamina), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("#c00000#Life: #00ff00#%d/%d"):format(player.life, player.max_life), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_STAMINA_POOL) then
s:drawColorStringBlended(self.font, ("#ffcc80#Stamina: #00ff00#%d/%d"):format(player:getStamina(), player.max_stamina), w, h, 255, 255, 255) h = h + self.font_h
end
if game.player:knowTalent(game.player.T_MANA_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Mana: #00ff00#%d/%d"):format(game.player:getMana(), game.player.max_mana), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_MANA_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Mana: #00ff00#%d/%d"):format(player:getMana(), player.max_mana), w, h, 255, 255, 255) h = h + self.font_h
end
if game.player:knowTalent(game.player.T_POSITIVE_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Positive:#00ff00#%d/%d"):format(game.player:getPositive(), game.player.max_positive), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_POSITIVE_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Positive:#00ff00#%d/%d"):format(player:getPositive(), player.max_positive), w, h, 255, 255, 255) h = h + self.font_h
end
if game.player:knowTalent(game.player.T_NEGATIVE_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Negative:#00ff00#%d/%d"):format(game.player:getNegative(), game.player.max_negative), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_NEGATIVE_POOL) then
s:drawColorStringBlended(self.font, ("#7fffd4#Negative:#00ff00#%d/%d"):format(player:getNegative(), player.max_negative), w, h, 255, 255, 255) h = h + self.font_h
end
if game.player:knowTalent(game.player.T_VIM_POOL) then
s:drawColorStringBlended(self.font, ("#904010#Vim: #00ff00#%d/%d"):format(game.player:getVim(), game.player.max_vim), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_VIM_POOL) then
s:drawColorStringBlended(self.font, ("#904010#Vim: #00ff00#%d/%d"):format(player:getVim(), player.max_vim), w, h, 255, 255, 255) h = h + self.font_h
end
if game.player:knowTalent(game.player.T_EQUILIBRIUM_POOL) then
s:drawColorStringBlended(self.font, ("#00ff74#Equi: #00ff00#%d"):format(game.player:getEquilibrium()), w, h, 255, 255, 255) h = h + self.font_h
if player:knowTalent(player.T_EQUILIBRIUM_POOL) then
s:drawColorStringBlended(self.font, ("#00ff74#Equi: #00ff00#%d"):format(player:getEquilibrium()), w, h, 255, 255, 255) h = h + self.font_h
end
h = h + self.font_h
s:drawColorStringBlended(self.font, ("STR: #00ff00#%3d"):format(game.player:getStr()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("DEX: #00ff00#%3d"):format(game.player:getDex()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("MAG: #00ff00#%3d"):format(game.player:getMag()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("WIL: #00ff00#%3d"):format(game.player:getWil()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("CUN: #00ff00#%3d"):format(game.player:getCun()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("CON: #00ff00#%3d"):format(game.player:getCon()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("STR: #00ff00#%3d"):format(player:getStr()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("DEX: #00ff00#%3d"):format(player:getDex()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("MAG: #00ff00#%3d"):format(player:getMag()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("WIL: #00ff00#%3d"):format(player:getWil()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("CUN: #00ff00#%3d"):format(player:getCun()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("CON: #00ff00#%3d"):format(player:getCon()), w, h, 255, 255, 255) h = h + self.font_h
h = 0
w = 200
-- All weapons in main hands
if self.actor:getInven(self.actor.INVEN_MAINHAND) then
for i, o in ipairs(self.actor:getInven(self.actor.INVEN_MAINHAND)) do
if player:getInven(player.INVEN_MAINHAND) then
for i, o in ipairs(player:getInven(player.INVEN_MAINHAND)) do
if o.combat then
s:drawColorStringBlended(self.font, ("Attack(Main Hand): #00ff00#%3d"):format(game.player:combatAttack(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Damage(Main Hand): #00ff00#%3d"):format(game.player:combatDamage(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("APR (Main Hand): #00ff00#%3d"):format(game.player:combatAPR(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Crit (Main Hand): #00ff00#%3d%%"):format(game.player:combatCrit(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Speed (Main Hand): #00ff00#%0.2f"):format(game.player:combatSpeed(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Attack(Main Hand): #00ff00#%3d"):format(player:combatAttack(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Damage(Main Hand): #00ff00#%3d"):format(player:combatDamage(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("APR (Main Hand): #00ff00#%3d"):format(player:combatAPR(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Crit (Main Hand): #00ff00#%3d%%"):format(player:combatCrit(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Speed (Main Hand): #00ff00#%0.2f"):format(player:combatSpeed(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
end
end
end
h = h + self.font_h
-- All wpeaons in off hands
-- Offhand atatcks are with a damage penality, taht can be reduced by talents
if self.actor:getInven(self.actor.INVEN_OFFHAND) then
if player:getInven(player.INVEN_OFFHAND) then
local offmult = (mult or 1) / 2
if self.actor:knowTalent(Talents.T_DUAL_WEAPON_TRAINING) then
offmult = (mult or 1) / (2 - (self.actor:getTalentLevel(Talents.T_DUAL_WEAPON_TRAINING) / 6))
if player:knowTalent(Talents.T_DUAL_WEAPON_TRAINING) then
offmult = (mult or 1) / (2 - (player:getTalentLevel(Talents.T_DUAL_WEAPON_TRAINING) / 6))
end
for i, o in ipairs(self.actor:getInven(self.actor.INVEN_OFFHAND)) do
for i, o in ipairs(player:getInven(player.INVEN_OFFHAND)) do
if o.combat then
s:drawColorStringBlended(self.font, ("Attack (Off Hand): #00ff00#%3d"):format(game.player:combatAttack(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Damage (Off Hand): #00ff00#%3d"):format(game.player:combatDamage(o.combat) * offmult), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("APR (Off Hand): #00ff00#%3d"):format(game.player:combatAPR(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Crit (Off Hand): #00ff00#%3d%%"):format(game.player:combatCrit(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Speed (Off Hand): #00ff00#%0.2f"):format(game.player:combatSpeed(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Attack (Off Hand): #00ff00#%3d"):format(player:combatAttack(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Damage (Off Hand): #00ff00#%3d"):format(player:combatDamage(o.combat) * offmult), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("APR (Off Hand): #00ff00#%3d"):format(player:combatAPR(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Crit (Off Hand): #00ff00#%3d%%"):format(player:combatCrit(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Speed (Off Hand): #00ff00#%0.2f"):format(player:combatSpeed(o.combat)), w, h, 255, 255, 255) h = h + self.font_h
end
end
end
h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spellpower: #00ff00#%3d"):format(game.player:combatSpellpower()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Crit: #00ff00#%3d%%"):format(game.player:combatSpellCrit()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Speed: #00ff00#%3d"):format(game.player:combatSpellSpeed()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spellpower: #00ff00#%3d"):format(player:combatSpellpower()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Crit: #00ff00#%3d%%"):format(player:combatSpellCrit()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Speed: #00ff00#%3d"):format(player:combatSpellSpeed()), w, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
if self.actor.inc_damage.all then s:drawColorStringBlended(self.font, ("All damage: #00ff00#%3d%%"):format(self.actor.inc_damage.all), w, h, 255, 255, 255) h = h + self.font_h end
if player.inc_damage.all then s:drawColorStringBlended(self.font, ("All damage: #00ff00#%3d%%"):format(player.inc_damage.all), w, h, 255, 255, 255) h = h + self.font_h end
for i, t in ipairs(DamageType.dam_def) do
if self.actor.inc_damage[DamageType[t.type]] and self.actor.inc_damage[DamageType[t.type]] ~= 0 then
s:drawColorStringBlended(self.font, ("%s damage: #00ff00#%3d%%"):format(t.name:capitalize(), self.actor.inc_damage[DamageType[t.type]]), w, h, 255, 255, 255) h = h + self.font_h
if player.inc_damage[DamageType[t.type]] and player.inc_damage[DamageType[t.type]] ~= 0 then
s:drawColorStringBlended(self.font, ("%s damage: #00ff00#%3d%%"):format(t.name:capitalize(), player.inc_damage[DamageType[t.type]]), w, h, 255, 255, 255) h = h + self.font_h
end
end
h = 0
w = 400
s:drawColorStringBlended(self.font, ("Fatigue: #00ff00#%3d%%"):format(game.player.fatigue), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Armor: #00ff00#%3d"):format(game.player:combatArmor()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Defense: #00ff00#%3d"):format(game.player:combatDefense()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Ranged Defense: #00ff00#%3d"):format(game.player:combatDefenseRanged()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Fatigue: #00ff00#%3d%%"):format(player.fatigue), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Armor: #00ff00#%3d"):format(player:combatArmor()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Defense: #00ff00#%3d"):format(player:combatDefense()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Ranged Defense: #00ff00#%3d"):format(player:combatDefenseRanged()), w, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
s:drawColorStringBlended(self.font, ("Physical Save: #00ff00#%3d"):format(game.player:combatPhysicalResist()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Save: #00ff00#%3d"):format(game.player:combatSpellResist()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Mental Save: #00ff00#%3d"):format(game.player:combatMentalResist()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Physical Save: #00ff00#%3d"):format(player:combatPhysicalResist()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Spell Save: #00ff00#%3d"):format(player:combatSpellResist()), w, h, 255, 255, 255) h = h + self.font_h
s:drawColorStringBlended(self.font, ("Mental Save: #00ff00#%3d"):format(player:combatMentalResist()), w, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
if self.actor.resists.all then s:drawColorStringBlended(self.font, ("All Resists: #00ff00#%3d%%"):format(self.actor.resists.all), w, h, 255, 255, 255) h = h + self.font_h end
if player.resists.all then s:drawColorStringBlended(self.font, ("All Resists: #00ff00#%3d%%"):format(player.resists.all), w, h, 255, 255, 255) h = h + self.font_h end
for i, t in ipairs(DamageType.dam_def) do
if self.actor.resists[DamageType[t.type]] and self.actor.resists[DamageType[t.type]] ~= 0 then
s:drawColorStringBlended(self.font, ("%s Resist: #00ff00#%3d%%"):format(t.name:capitalize(), self.actor.resists[DamageType[t.type]]), w, h, 255, 255, 255) h = h + self.font_h
if player.resists[DamageType[t.type]] and player.resists[DamageType[t.type]] ~= 0 then
s:drawColorStringBlended(self.font, ("%s Resist: #00ff00#%3d%%"):format(t.name:capitalize(), player.resists[DamageType[t.type]]), w, h, 255, 255, 255) h = h + self.font_h
end
end
immune_type = "poison_immune" immune_name = "Poison Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "cut_immune" immune_name = "Bleed Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "confusion_immune" immune_name = "Confusion Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "blind_immune" immune_name = "Blind Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "silence_immune" immune_name = "Silence Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "disarm_immune" immune_name = "Disarm Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "pin_immune" immune_name = "Pinning Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "stun_immune" immune_name = "Stun Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "fear_immune" immune_name = "Fear Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "knockback_immune" immune_name = "Knockback Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "stone_immune" immune_name = "Stoning Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "instakill_immune" immune_name = "Instadeath Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "teleport_immune" immune_name = "Teleport Resistance" if self.actor:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "poison_immune" immune_name = "Poison Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "cut_immune" immune_name = "Bleed Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "confusion_immune" immune_name = "Confusion Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "blind_immune" immune_name = "Blind Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "silence_immune" immune_name = "Silence Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "disarm_immune" immune_name = "Disarm Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "pin_immune" immune_name = "Pinning Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "stun_immune" immune_name = "Stun Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "fear_immune" immune_name = "Fear Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "knockback_immune" immune_name = "Knockback Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "stone_immune" immune_name = "Stoning Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "instakill_immune" immune_name = "Instadeath Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
immune_type = "teleport_immune" immune_name = "Teleport Resistance" if player:attr(immune_type) then s:drawColorStringBlended(self.font, ("%s: #00ff00#%3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100)), w, h, 255, 255, 255) h = h + self.font_h end
h = 0
w = 600
s:drawColorStringBlended(self.font, "#LIGHT_BLUE#Current effects:", w, h, 255, 255, 255) h = h + self.font_h
for tid, act in pairs(game.player.sustain_talents) do
if act then s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s"):format(game.player:getTalentFromId(tid).name), w, h, 255, 255, 255) h = h + self.font_h end
for tid, act in pairs(player.sustain_talents) do
if act then s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s"):format(player:getTalentFromId(tid).name), w, h, 255, 255, 255) h = h + self.font_h end
end
for eff_id, p in pairs(game.player.tmp) do
local e = game.player.tempeffect_def[eff_id]
for eff_id, p in pairs(player.tmp) do
local e = player.tempeffect_def[eff_id]
if e.status == "detrimental" then
s:drawColorStringBlended(self.font, ("#LIGHT_RED#%s"):format(e.desc), w, h, 255, 255, 255) h = h + self.font_h
else
......@@ -183,8 +184,10 @@ function _M:drawDialog(s)
end
function _M:dump()
local player = self.actor
fs.mkdir("/character-dumps")
local file = "/character-dumps/"..(game.player.name:gsub("[^a-zA-Z0-9_-.]", "_")).."-"..os.date("%Y%m%d-%H%M%S")..".txt"
local file = "/character-dumps/"..(player.name:gsub("[^a-zA-Z0-9_-.]", "_")).."-"..os.date("%Y%m%d-%H%M%S")..".txt"
local fff = fs.open(file, "w")
local labelwidth = 17
local nl = function(s) s = s or "" fff:write(s:removeColorCodes()) fff:write("\n") end
......@@ -192,169 +195,169 @@ function _M:dump()
--prepare label and value
local makelabel = function(s,r) while s:len() < labelwidth do s = s.." " end return ("%s: %s"):format(s, r) end
local cur_exp, max_exp = game.player.exp, game.player:getExpChart(game.player.level+1)
local cur_exp, max_exp = player.exp, player:getExpChart(player.level+1)
nl(" [Tome 4.00 @ www.te4.org Character Dump]")
nl()
nnl(("%-32s"):format(makelabel("Sex", game.player.descriptor.sex)))
nl(("STR: %d"):format(game.player:getStr()))
nnl(("%-32s"):format(makelabel("Sex", player.descriptor.sex or (player.female and "Female" or "Male"))))
nl(("STR: %d"):format(player:getStr()))
nnl(("%-32s"):format(makelabel("Race", game.player.descriptor.subrace)))
nl(("DEX: %d"):format(game.player:getDex()))
nnl(("%-32s"):format(makelabel("Race", player.descriptor.subrace or player.type:capitalize())))
nl(("DEX: %d"):format(player:getDex()))
nnl(("%-32s"):format(makelabel("Class", game.player.descriptor.subclass)))
nl(("MAG: %d"):format(game.player:getMag()))
nnl(("%-32s"):format(makelabel("Class", player.descriptor.subclass or player.subtype:capitalize())))
nl(("MAG: %d"):format(player:getMag()))
nnl(("%-32s"):format(makelabel("Level", ("%d"):format(game.player.level))))
nl(("WIL: %d"):format(game.player:getWil()))
nnl(("%-32s"):format(makelabel("Level", ("%d"):format(player.level))))
nl(("WIL: %d"):format(player:getWil()))
nnl(("%-32s"):format(makelabel("Exp", ("%d%%"):format(100 * cur_exp / max_exp))))
nl(("CUN: %d"):format(game.player:getCun()))
nl(("CUN: %d"):format(player:getCun()))
nnl(("%-32s"):format(makelabel("Gold", ("%.2f"):format(game.player.money))))
nl(("CON: %d"):format(game.player:getCon()))
nnl(("%-32s"):format(makelabel("Gold", ("%.2f"):format(player.money))))
nl(("CON: %d"):format(player:getCon()))
-- All weapons in main hands
local strings = {}
for i = 1, 5 do strings[i]="" end
if self.actor:getInven(self.actor.INVEN_MAINHAND) then
for i, o in ipairs(self.actor:getInven(self.actor.INVEN_MAINHAND)) do
if player:getInven(player.INVEN_MAINHAND) then
for i, o in ipairs(player:getInven(player.INVEN_MAINHAND)) do
if o.combat then
strings[1] = ("Attack(Main Hand): %3d"):format(game.player:combatAttack(o.combat))
strings[2] = ("Damage(Main Hand): %3d"):format(game.player:combatDamage(o.combat))
strings[3] = ("APR (Main Hand): %3d"):format(game.player:combatAPR(o.combat))
strings[4] = ("Crit (Main Hand): %3d%%"):format(game.player:combatCrit(o.combat))
strings[5] = ("Speed (Main Hand): %0.2f"):format(game.player:combatSpeed(o.combat))
strings[1] = ("Attack(Main Hand): %3d"):format(player:combatAttack(o.combat))
strings[2] = ("Damage(Main Hand): %3d"):format(player:combatDamage(o.combat))
strings[3] = ("APR (Main Hand): %3d"):format(player:combatAPR(o.combat))
strings[4] = ("Crit (Main Hand): %3d%%"):format(player:combatCrit(o.combat))
strings[5] = ("Speed (Main Hand): %0.2f"):format(player:combatSpeed(o.combat))
end
end
end
local enc, max = game.player:getEncumbrance(), game.player:getMaxEncumbrance()
local enc, max = player:getEncumbrance(), player:getMaxEncumbrance()
nl()
nnl(("%-32s"):format(strings[1]))
nnl(("%-32s"):format(makelabel("Life", (" %d/%d"):format(game.player.life, game.player.max_life))))
nnl(("%-32s"):format(makelabel("Life", (" %d/%d"):format(player.life, player.max_life))))
nl(makelabel("Encumbrance", enc .. "/" .. max))
nnl(("%-32s"):format(strings[2]))
if game.player:knowTalent(game.player.T_STAMINA_POOL) then
nnl(("%-32s"):format(makelabel("Stamina", (" %d/%d"):format(game.player:getStamina(), game.player.max_stamina))))
if player:knowTalent(player.T_STAMINA_POOL) then
nnl(("%-32s"):format(makelabel("Stamina", (" %d/%d"):format(player:getStamina(), player.max_stamina))))
else
nnl(("%-32s"):format(" "))
end
nl(makelabel("Difficulty", game.player.descriptor.difficulty))
nl(makelabel("Difficulty", player.descriptor.difficulty))
nnl(("%-32s"):format(strings[3]))
if game.player:knowTalent(game.player.T_MANA_POOL) then
nl(makelabel("Mana", (" %d/%d"):format(game.player:getMana(), game.player.max_mana)))
if player:knowTalent(player.T_MANA_POOL) then
nl(makelabel("Mana", (" %d/%d"):format(player:getMana(), player.max_mana)))
else
nl()
end
nnl(("%-32s"):format(strings[4]))
if game.player:knowTalent(game.player.T_POSITIVE_POOL) then
nl(makelabel("Positive", (" %d/%d"):format(game.player:getPositive(), game.player.max_positive)))
if player:knowTalent(player.T_POSITIVE_POOL) then
nl(makelabel("Positive", (" %d/%d"):format(player:getPositive(), player.max_positive)))
else
nl()
end
nnl(("%-32s"):format(strings[4]))
if game.player:knowTalent(game.player.T_NEGATIVE_POOL) then
nl(makelabel("Negative", (" %d/%d"):format(game.player:getNegative(), game.player.max_negative)))
if player:knowTalent(player.T_NEGATIVE_POOL) then
nl(makelabel("Negative", (" %d/%d"):format(player:getNegative(), player.max_negative)))
else
nl()
end
nnl(("%-32s"):format(strings[4]))
if game.player:knowTalent(game.player.T_VIM_POOL) then
nl(makelabel("Vim", (" %d/%d"):format(game.player:getVim(), game.player.max_vim)))
if player:knowTalent(player.T_VIM_POOL) then
nl(makelabel("Vim", (" %d/%d"):format(player:getVim(), player.max_vim)))
else
nl()
end
nnl(("%-32s"):format(strings[5]))
if game.player:knowTalent(game.player.T_EQUILIBRIUM_POOL) then
nl((makelabel("Equilibrium", (" %d"):format(game.player:getEquilibrium()))))
if player:knowTalent(player.T_EQUILIBRIUM_POOL) then
nl((makelabel("Equilibrium", (" %d"):format(player:getEquilibrium()))))
else
nl()
end
-- All wpeaons in off hands
-- Offhand atatcks are with a damage penality, taht can be reduced by talents
if self.actor:getInven(self.actor.INVEN_OFFHAND) then
if player:getInven(player.INVEN_OFFHAND) then
local offmult = (mult or 1) / 2
if self.actor:knowTalent(Talents.T_DUAL_WEAPON_TRAINING) then
offmult = (mult or 1) / (2 - (self.actor:getTalentLevel(Talents.T_DUAL_WEAPON_TRAINING) / 6))
if player:knowTalent(Talents.T_DUAL_WEAPON_TRAINING) then
offmult = (mult or 1) / (2 - (player:getTalentLevel(Talents.T_DUAL_WEAPON_TRAINING) / 6))
end
for i, o in ipairs(self.actor:getInven(self.actor.INVEN_OFFHAND)) do
for i, o in ipairs(player:getInven(player.INVEN_OFFHAND)) do
if o.combat then
nl()
nl(("Attack (Off Hand): %3d"):format(game.player:combatAttack(o.combat)))
nl(("Damage (Off Hand): %3d"):format(game.player:combatDamage(o.combat) * offmult))
nl(("APR (Off Hand): %3d"):format(game.player:combatAPR(o.combat)))
nl(("Crit (Off Hand): %3d%%"):format(game.player:combatCrit(o.combat)))
nl(("Speed (Off Hand): %0.2f"):format(game.player:combatSpeed(o.combat)))
nl(("Attack (Off Hand): %3d"):format(player:combatAttack(o.combat)))
nl(("Damage (Off Hand): %3d"):format(player:combatDamage(o.combat) * offmult))
nl(("APR (Off Hand): %3d"):format(player:combatAPR(o.combat)))
nl(("Crit (Off Hand): %3d%%"):format(player:combatCrit(o.combat)))
nl(("Speed (Off Hand): %0.2f"):format(player:combatSpeed(o.combat)))
end
end
end
nl()
nnl(("%-32s"):format(makelabel("Fatigue", game.player.fatigue .. "%")))
nl(makelabel("Spellpower", game.player:combatSpellpower() ..""))
nnl(("%-32s"):format(makelabel("Armor", game.player:combatArmor() .. "")))
nl(makelabel("Spell Crit", game.player:combatSpellCrit() .."%"))
nnl(("%-32s"):format(makelabel("Defense", game.player:combatDefense() .. "")))
nl(makelabel("Spell Speed", game.player:combatSpellSpeed() ..""))
nnl(("%-32s"):format(makelabel("Ranged Defense", game.player:combatDefenseRanged() .. "")))
nnl(("%-32s"):format(makelabel("Fatigue", player.fatigue .. "%")))
nl(makelabel("Spellpower", player:combatSpellpower() ..""))
nnl(("%-32s"):format(makelabel("Armor", player:combatArmor() .. "")))
nl(makelabel("Spell Crit", player:combatSpellCrit() .."%"))
nnl(("%-32s"):format(makelabel("Defense", player:combatDefense() .. "")))
nl(makelabel("Spell Speed", player:combatSpellSpeed() ..""))
nnl(("%-32s"):format(makelabel("Ranged Defense", player:combatDefenseRanged() .. "")))
nl()
nl()
if self.actor.inc_damage.all then nl(makelabel("All damage", self.actor.inc_damage.all.."%")) end
if player.inc_damage.all then nl(makelabel("All damage", player.inc_damage.all.."%")) end
for i, t in ipairs(DamageType.dam_def) do
if self.actor.inc_damage[DamageType[t.type]] and self.actor.inc_damage[DamageType[t.type]] ~= 0 then
nl(makelabel(t.name:capitalize().." damage", self.actor.inc_damage[DamageType[t.type]].."%"))
if player.inc_damage[DamageType[t.type]] and player.inc_damage[DamageType[t.type]] ~= 0 then
nl(makelabel(t.name:capitalize().." damage", player.inc_damage[DamageType[t.type]].."%"))
end
end
nl()
nl(makelabel("Physical Save",game.player:combatPhysicalResist() ..""))
nl(makelabel("Spell Save",game.player:combatSpellResist() ..""))
nl(makelabel("Mental Save",game.player:combatMentalResist() ..""))
nl(makelabel("Physical Save",player:combatPhysicalResist() ..""))
nl(makelabel("Spell Save",player:combatSpellResist() ..""))
nl(makelabel("Mental Save",player:combatMentalResist() ..""))
nl()
if self.actor.resists.all then nl(("All Resists: %3d%%"):format(self.actor.resists.all)) end
if player.resists.all then nl(("All Resists: %3d%%"):format(player.resists.all)) end
for i, t in ipairs(DamageType.dam_def) do
if self.actor.resists[DamageType[t.type]] and self.actor.resists[DamageType[t.type]] ~= 0 then
nl(("%s Resist: %3d%%"):format(t.name:capitalize(), self.actor.resists[DamageType[t.type]]))
if player.resists[DamageType[t.type]] and player.resists[DamageType[t.type]] ~= 0 then
nl(("%s Resist: %3d%%"):format(t.name:capitalize(), player.resists[DamageType[t.type]]))
end
end
immune_type = "poison_immune" immune_name = "Poison Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "cut_immune" immune_name = "Bleed Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "confusion_immune" immune_name = "Confusion Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "blind_immune" immune_name = "Blind Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "silence_immune" immune_name = "Silence Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "disarm_immune" immune_name = "Disarm Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "pin_immune" immune_name = "Pinning Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "stun_immune" immune_name = "Stun Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "fear_immune" immune_name = "Fear Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "knockback_immune" immune_name = "Knockback Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "stone_immune" immune_name = "Stoning Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "instakill_immune" immune_name = "Instadeath Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "teleport_immune" immune_name = "Teleport Resistance" if self.actor:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(self.actor:attr(immune_type) * 100, 0, 100))) end
immune_type = "poison_immune" immune_name = "Poison Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "cut_immune" immune_name = "Bleed Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "confusion_immune" immune_name = "Confusion Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "blind_immune" immune_name = "Blind Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "silence_immune" immune_name = "Silence Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "disarm_immune" immune_name = "Disarm Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "pin_immune" immune_name = "Pinning Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "stun_immune" immune_name = "Stun Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "fear_immune" immune_name = "Fear Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "knockback_immune" immune_name = "Knockback Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "stone_immune" immune_name = "Stoning Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "instakill_immune" immune_name = "Instadeath Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
immune_type = "teleport_immune" immune_name = "Teleport Resistance" if player:attr(immune_type) then nl(("%s: %3d%%"):format(immune_name, util.bound(player:attr(immune_type) * 100, 0, 100))) end
nl()
local most_kill, most_kill_max = "none", 0
local total_kill = 0
for name, nb in pairs(game.player.all_kills or {}) do
for name, nb in pairs(player.all_kills or {}) do
if nb > most_kill_max then most_kill_max = nb most_kill = name end
total_kill = total_kill + nb
end
nl(("Number of NPC killed: %s"):format(total_kill))
nl(("Most killed NPC: %s (%d)"):format(most_kill, most_kill_max))
if self.actor.winner then
if player.winner then
nl()
nl(" [Winner!]")
nl()
for i, line in ipairs(self.actor.winner_text) do
for i, line in ipairs(player.winner_text) do
nl(("%s"):format(line:removeColorCodes()))
end
end
......@@ -364,12 +367,12 @@ function _M:dump()
nl(" [Talents Chart]")
nl()
for i, tt in ipairs(self.actor.talents_types_def) do
local ttknown = self.actor:knowTalentType(tt.type)
if not (self.actor.talents_types[tt.type] == nil) and ttknown then
for i, tt in ipairs(player.talents_types_def) do
local ttknown = player:knowTalentType(tt.type)
if not (player.talents_types[tt.type] == nil) and ttknown then
local cat = tt.type:gsub("/.*", "")
local catname = ("%s / %s"):format(cat:capitalize(), tt.name:capitalize())
nl((" - %-35s(mastery %.02f)"):format(catname, self.actor:getTalentTypeMastery(tt.type)))
nl((" - %-35s(mastery %.02f)"):format(catname, player:getTalentTypeMastery(tt.type)))
-- Find all talents of this school
if (ttknown) then
......@@ -378,7 +381,7 @@ function _M:dump()
local typename = "class"
if t.generic then typename = "generic" end
local skillname = (" %s (%s)"):format(t.name, typename)
nl(("%-37s %d/%d"):format(skillname, self.actor:getTalentLevelRaw(t.id), t.points))
nl(("%-37s %d/%d"):format(skillname, player:getTalentLevelRaw(t.id), t.points))
end
end
end
......@@ -391,11 +394,11 @@ function _M:dump()
nl(" [Current Effects]")
nl()
for tid, act in pairs(game.player.sustain_talents) do
if act then nl("- "..game.player:getTalentFromId(tid).name) end
for tid, act in pairs(player.sustain_talents) do
if act then nl("- "..player:getTalentFromId(tid).name) end
end
for eff_id, p in pairs(game.player.tmp) do
local e = game.player.tempeffect_def[eff_id]
for eff_id, p in pairs(player.tmp) do
local e = player.tempeffect_def[eff_id]
if e.status == "detrimental" then
nl("+ "..e.desc)
else
......@@ -406,7 +409,7 @@ function _M:dump()
-- Quests, Active and Completed
local first = true
for id, q in pairs(self.actor.quests or {}) do
for id, q in pairs(player.quests or {}) do
if q:isEnded() then
if first then
nl()
......@@ -415,12 +418,12 @@ function _M:dump()
first=false
end
nl(" -- ".. q.name)
nl(q:desc(self.actor):gsub("#.-#", " "))
nl(q:desc(player):gsub("#.-#", " "))
end
end
first=true
for id, q in pairs(self.actor.quests or {}) do
for id, q in pairs(player.quests or {}) do
if not q:isEnded() then
if first then
first=false
......@@ -429,7 +432,7 @@ function _M:dump()
nl()
end
nl(" -- ".. q.name)
nl(q:desc(self.actor):gsub("#.-#", " "))
nl(q:desc(player):gsub("#.-#", " "))
end
end
......@@ -439,11 +442,11 @@ function _M:dump()
nl(" [Character Equipment]")
nl()
local index = 0
for inven_id = 1, #self.actor.inven_def do
if self.actor.inven[inven_id] and self.actor.inven_def[inven_id].is_worn then
nl((" %s"):format(self.actor.inven_def[inven_id].name))
for inven_id = 1, #player.inven_def do
if player.inven[inven_id] and player.inven_def[inven_id].is_worn then
nl((" %s"):format(player.inven_def[inven_id].name))
for item, o in ipairs(self.actor.inven[inven_id]) do
for item, o in ipairs(player.inven[inven_id]) do
if not self.filter or self.filter(o) then
local char = string.char(string.byte('a') + index)
nl(("%s) %s"):format(char, o:getName{force_id=true}))
......@@ -461,7 +464,7 @@ function _M:dump()
nl(" [Player Achievements]")
nl()
local achs = {}
for id, data in pairs(self.actor.achievements or {}) do
for id, data in pairs(player.achievements or {}) do
local a = world:getAchievementFromId(id)
achs[#achs+1] = {id=id, data=data, name=a.name}
end
......@@ -474,7 +477,7 @@ function _M:dump()
nl()
nl(" [Character Inventory]")
nl()
for item, o in ipairs(self.actor:getInven("INVEN")) do
for item, o in ipairs(player:getInven("INVEN")) do
if not self.filter or self.filter(o) then
local char = string.char(string.byte('a') + item - 1)
nl(("%s) %s"):format(char, o:getName{force_id=true}))
......
No preview for this file type
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