diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index d22d98aa531206102fcf580898d215e4eb12efca..90a6fcd61aac49c4f59a9d81c5648c8a36e54ebe 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -108,7 +108,7 @@ function _M:init(t, no_default) t.positive_negative_rating = t.positive_negative_rating or 3 t.psi_rating = t.psi_rating or 1 - t.esp = t.esp or {range=10} + t.esp = t.esp or {} t.talent_cd_reduction = t.talent_cd_reduction or {} @@ -1961,14 +1961,14 @@ end function _M:canSeeNoCache(actor, def, def_pct) if not actor then return false, 0 end - -- ESP, see all, or only types/subtypes - if self:attr("esp") then - local esp = self:attr("esp") - -- Full ESP - if esp.all and esp.all > 0 then - return true, 100 - end + -- Full ESP + if self.esp_all and self.esp_all > 0 then + return true, 100 + end + -- ESP, see all, or only types/subtypes + if self.esp then + local esp = self.esp -- Type based ESP if esp[actor.type] and esp[actor.type] > 0 then return true, 100 diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index 2519b004482e0682f24772d122d2a9c7892b03ca..ab9f59cb4780daccbd912291d878747af6fd25ad 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -323,21 +323,21 @@ function _M:getTextualDesc() desc:add(("Increases damage type: %s."):format(table.concat(rs, ',')), true) end + local esps = {} + if w.esp_all then esps[#esps+1] = "all" end + if w.esp_range then esps[#esps+1] = "increase range by "..w.esp_range end if w.esp then - local rs = {} for type, i in pairs(w.esp) do - if type == "all" then rs[#rs+1] = "all" - elseif type == "range" then rs[#rs+1] = "increase range by "..i + local _, _, t, st = type:find("^([^/]+)/?(.*)$") + if st and st ~= "" then + esps[#esps+1] = st else - local _, _, t, st = type:find("^([^/]+)/?(.*)$") - if st and st ~= "" then - rs[#rs+1] = st - else - rs[#rs+1] = t - end + esps[#esps+1] = t end end - desc:add(("Grants telepathy: %s."):format(table.concat(rs, ',')), true) + end + if #esps > 0 then + desc:add(("Grants telepathy: %s."):format(table.concat(esps, ',')), true) end if w.talents_types_mastery then diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 3ea70ce589c96059055ec2085816b9b0b3374a22..5d06d1cd0f79e69375c778485b233a74eacabfb4 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -284,7 +284,9 @@ function _M:playerFOV() end -- Compute ESP FOV, using cache - self:computeFOV(self.esp.range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y, 0.6) end, true, true, true) + if (self.esp_all and self.esp_all > 0) or next(self.esp) then + self:computeFOV(self.esp_range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y, 0.6) end, true, true, true) + end -- Handle Sense spell, a simple FOV, using cache. Note that this means some terrain features can be made to block sensing if self:attr("detect_range") then diff --git a/game/modules/tome/data/general/objects/egos/amulets.lua b/game/modules/tome/data/general/objects/egos/amulets.lua index f786cb42ad10a807349428705a05df83a78dccd9..bdb2e56ec4c7fbf74f6bd8877e1fcf84e0bd476b 100644 --- a/game/modules/tome/data/general/objects/egos/amulets.lua +++ b/game/modules/tome/data/general/objects/egos/amulets.lua @@ -75,7 +75,7 @@ newEntity{ cost = 25, wielder = { life_regen = -3, - esp = {all=1}, + esp_all = 1, }, } newEntity{ @@ -85,7 +85,7 @@ newEntity{ rarity = 15, cost = 15, wielder = { - esp = {range=10}, + esp_range = 10, }, } newEntity{ diff --git a/game/modules/tome/data/general/objects/egos/helm.lua b/game/modules/tome/data/general/objects/egos/helm.lua index 4828c5dbd7bca25dc49e2def98eda70edd85fafb..5bca313221f55899a52c541c28115d4416c8c6f4 100644 --- a/game/modules/tome/data/general/objects/egos/helm.lua +++ b/game/modules/tome/data/general/objects/egos/helm.lua @@ -63,7 +63,7 @@ newEntity{ cost = 25, wielder = { life_regen = -3, - esp = {all=1}, + esp_all = 1, }, } newEntity{ @@ -73,7 +73,7 @@ newEntity{ rarity = 15, cost = 15, wielder = { - esp = {range=10}, + esp_range = 10, }, } newEntity{ diff --git a/game/modules/tome/data/general/objects/egos/wizard-hat.lua b/game/modules/tome/data/general/objects/egos/wizard-hat.lua index 43649c7d90c10fe7029d711ce0a577343e4ed772..bb49a975ce7d6e629b52397ab9e9498b1d3c7bb3 100644 --- a/game/modules/tome/data/general/objects/egos/wizard-hat.lua +++ b/game/modules/tome/data/general/objects/egos/wizard-hat.lua @@ -76,7 +76,7 @@ newEntity{ cost = 25, wielder = { life_regen = -3, - esp = {all=1}, + esp_all = 1, }, } newEntity{ @@ -86,7 +86,7 @@ newEntity{ rarity = 15, cost = 15, wielder = { - esp = {range=10}, + esp_range = 10, }, } newEntity{ diff --git a/game/modules/tome/data/general/objects/random-artifacts.lua b/game/modules/tome/data/general/objects/random-artifacts.lua index 126bc0f70529af54a8dc96f7c485f23df4ee3cf8..8d32e3a90474b250c9f4616ad1ebb188dc8201a2 100644 --- a/game/modules/tome/data/general/objects/random-artifacts.lua +++ b/game/modules/tome/data/general/objects/random-artifacts.lua @@ -295,7 +295,7 @@ newEntity{ theme={nature=true}, name="water breathing", points = 10, rarity = 15 wielder = { can_breath = {water=1}, }, } newEntity{ theme={psionic=true}, name="telepathy", points = 60, rarity = 65, level_range = {1, 50}, - wielder = { esp = {all=1}, }, + wielder = { esp_all = 1 }, } newEntity{ theme={psionic=true}, name="orc telepathy", points = 15, rarity = 25, level_range = {1, 50}, wielder = { esp = {["humanoid/orc"]=1}, }, diff --git a/game/modules/tome/dialogs/DeathDialog.lua b/game/modules/tome/dialogs/DeathDialog.lua index 09ee999aec046934d54872cbb57f23fb680528e3..7713168ca5ac01ca02180287634c96c2ac8f78fb 100644 --- a/game/modules/tome/dialogs/DeathDialog.lua +++ b/game/modules/tome/dialogs/DeathDialog.lua @@ -193,7 +193,7 @@ function _M:use(item) end end self:eidolonPlane() - game.log("#LIGHT_RED#You have %s left.", self.actor:attr("easy_mode_lifes") and (self.actor:attr("easy_mode_lifes").." life(s)" or "no more lifes")) + game.log("#LIGHT_RED#You have %s left.", (self.actor:attr("easy_mode_lifes") and self.actor:attr("easy_mode_lifes").." life(s)") or "no more lifes") elseif act == "skeleton" then self.actor:attr("re-assembled", 1) game.logPlayer(self.actor, "#YELLOW#Your bones magically come back together. You are once more able to dish out pain to your foes!") diff --git a/game/modules/tome/dialogs/debug/DebugMain.lua b/game/modules/tome/dialogs/debug/DebugMain.lua index 4c8c602e21c6faea7e0661094bb8e5a7b24e0ab2..e0c925bd047e654d2fc665160b05643d989b6e35 100644 --- a/game/modules/tome/dialogs/debug/DebugMain.lua +++ b/game/modules/tome/dialogs/debug/DebugMain.lua @@ -55,13 +55,11 @@ function _M:use(item) if act == "godmode" then game.player:forceLevelup(50) game.player.invulnerable = 1 - game.player.esp.all = 1 - game.player.esp.range = 50 + game.player.esp_all = 1 + game.player.esp_range = 50 game.player.no_breath = 1 game.player.invulnerable = 1 game.player.money = 500 - game.player.esp.all = 1 - game.player.esp.range = 50 game.player.auto_id = 100 game.player.inc_damage.all = 100000 game.player:incStat("str", 100) game.player:incStat("dex", 100) game.player:incStat("mag", 100) game.player:incStat("wil", 100) game.player:incStat("cun", 100) game.player:incStat("con", 100)