diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index ef014fdb83267fcabdc1e1a8c517b01265a1aebb..51b1b2453c5aeb44eff27296868cb4d468fbf95c 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -1909,6 +1909,59 @@ function _M:colorStats(stat) end end +-- Get the combat stats for weapon by inventory and slot +function _M:getCombatStats(type, inven_id, item) + local o = table.get(self:getInven(inven_id), item) + local mean + local ammo + local atk + local dmg + local apr + local crit + local crit_power = 0 + local aspeed + local range + local mspeed + local dam, archery + ammo = table.get(self:getInven("QUIVER"), 1) + archery = o and o.archery and ammo and ammo.archery_ammo == o.archery and ammo.combat and (type ~= "offhand" or self:attr("can_offshoot")) and (type ~= "psionic" or self:attr("psi_focus_combat")) -- ranged combat + if type == "psionic" then + if not o or o.archery and not archery then return end + self:attr("use_psi_combat", 1) + end + if not o or (o.archery and not archery) or self:attr("disarmed") then -- unarmed + mean = self.combat + dmg = self:combatDamage(mean) * (mean.dam_mult or 1) + atk = self:combatAttack(mean) + apr = self:combatAPR(mean) + crit = self:combatCrit(mean) + crit_power = mean.crit_power + aspeed = 1/self:combatSpeed(mean) + archery = false + else -- weapon combat + mean = o and (o.special_combat and (o.slot == self.inven[inven_id].name or self:knowTalent(self.T_STONESHIELD)) and o.special_combat) or self:getObjectCombat(o, type == "psionic" and "mainhand" or type) or self.combat -- handles stone wardens + if archery then -- ranged combat + dam = ammo.combat + atk = self:combatAttackRanged(mean, dam) + dmg = self:combatDamage(mean, nil, dam) * (mean.dam_mult or 1) + apr = self:combatAPR(mean) + (dam.apr or 0) + crit_power = (mean.crit_power or 0) + (dam.crit_power or 0) + range = math.max(mean.range or 6, self:attr("archery_range_override") or 1) + mspeed = 10 + (self.combat.travel_speed or 0) + (mean.travel_speed or 0) + (dam.travel_speed or 0) + else -- melee combat + dam = o.combat + atk = self:combatAttack(mean) + dmg = self:combatDamage(mean) * (type == "offhand" and mean.talented ~= "shield" and self:getOffHandMult(dam) or 1) * (mean.dam_mult or 1) + apr = self:combatAPR(mean) + crit_power = mean.crit_power + end + crit = self:combatCrit(dam) + aspeed = 1/self:combatSpeed(mean) + end + if type == "psionic" then self:attr("use_psi_combat", -1) end + return {obj=o, atk=atk, dmg=dmg, apr=apr, crit=crit, crit_power=crit_power or 0, aspeed=aspeed, range=range, mspeed=mspeed, archery=archery, mean=mean, ammo=ammo, block=mean.block, talented=mean.talented} +end + function _M:tooltip(x, y, seen_by) if seen_by and not seen_by:canSee(self) then return end local factcolor, factstate, factlevel = "#ANTIQUE_WHITE#", "neutral", Faction:factionReaction(self.faction, game.player.faction) @@ -2028,6 +2081,9 @@ function _M:tooltip(x, y, seen_by) ts:add("#0080FF#S. save#FFFFFF#: ", self:colorStats("combatSpellResist"), true) ts:add("#FFD700#M. power#FFFFFF#: ", self:colorStats("combatMindpower"), " ") ts:add("#0080FF#M. save#FFFFFF#: ", self:colorStats("combatMentalResist"), true) + if self:knowTalent(self.T_STEAM_POOL) then + ts:add("#FFD700#St. power#FFFFFF#: ", self:colorStats("combatSteampower"), true) + end ts:add({"color", "WHITE"}) if (150 + (self.combat_critical_power or 0) ) > 150 then @@ -2043,7 +2099,8 @@ function _M:tooltip(x, y, seen_by) local tst = ("#LIGHT_BLUE#Main:#LAST#"..o:getShortName({force_id=true, do_color=true, no_add_name=true})):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(o.combat))..")") + local stats = self:getCombatStats("mainhand", self.INVEN_MAINHAND, i ) + tst:add(" (#RED#"..math.floor(stats.dmg).."#LAST#)") table.append(ts, tst) ts:add(true) end @@ -2052,8 +2109,9 @@ function _M:tooltip(x, y, seen_by) for i, o in ipairs(self:getInven("OFFHAND")) do local tst = ("#LIGHT_BLUE#Off :#LAST#"..o:getShortName({force_id=true, do_color=true, no_add_name=true})):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) - tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(o.combat))..")") + tst = tst:extractLines(true)[1] + local stats = self:getCombatStats("offhand", self.INVEN_OFFHAND, i) + tst:add(" (#RED#"..math.floor(stats.dmg).."#LAST#)") table.append(ts, tst) ts:add(true) end @@ -2063,7 +2121,8 @@ function _M:tooltip(x, y, seen_by) local tst = ("#LIGHT_BLUE#Psi :#LAST#"..o:getShortName({force_id=true, do_color=true, no_add_name=true})):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(o.combat))..")") + local stats = self:getCombatStats("psionic", self.INVEN_PSIONIC_FOCUS, i) + tst:add(" (#RED#"..math.floor(stats.dmg).."#LAST#)") table.append(ts, tst) ts:add(true) end @@ -2073,7 +2132,6 @@ function _M:tooltip(x, y, seen_by) local tst = ("#LIGHT_BLUE#Ammo:#LAST#"..o:getShortName({force_id=true, do_color=true, no_add_name=true})):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(o.combat))..")") table.append(ts, tst) ts:add(true) end @@ -2085,7 +2143,8 @@ function _M:tooltip(x, y, seen_by) local tst = ("#LIGHT_BLUE#Unarmed:#LAST#"..o:getShortName({force_id=true, do_color=true, no_add_name=true})):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(self.combat))..") ") + local stats = self:getCombatStats("barehand", self.INVEN_MAINHAND, i) + tst:add(" (#RED#"..math.floor(stats.dmg).."#LAST#)") table.append(ts, tst) ts:add(true) end @@ -2094,7 +2153,8 @@ function _M:tooltip(x, y, seen_by) local tst = ("#LIGHT_BLUE#Unarmed:#LAST#"):toTString() tst = tst:splitLines(game.tooltip.max-1, game.tooltip.font, 2) tst = tst:extractLines(true)[1] - tst:add(" ("..math.floor(self:combatDamage(self.combat))..") ") + local stats = self:getCombatStats("barehand", self.INVEN_MAINHAND, i) + tst:add(" (#RED#"..math.floor(stats.dmg).."#LAST#)") table.append(ts, tst) ts:add(true) end @@ -7943,6 +8003,7 @@ function _M:checkStillInCombat() -- Ok no more in combat! self.in_combat = nil + self:checkSustainDeactivate("no_combat") self:updateInCombatStatus() end @@ -7996,4 +8057,19 @@ function _M:projectDoAct(typ, tg, damtype, dam, particles, px, py, tmp) DamageType:projectingFor(self, nil) end end +end + +function _M:checkSustainDeactivate(check) + for tid, _ in pairs(self.sustain_talents) do + local t = self:getTalentFromId(tid) + if t.deactivate_on and t.deactivate_on[check] then + local ok = false + if type(t.deactivate_on[check]) == "function" then + ok = t.deactivate_on[check](self, t) + else + ok = true + end + if ok then self:forceUseTalent(tid, {ignore_energy=true, ignore_cd=true}) end + end + end end \ No newline at end of file diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua index b6223205188fc43e74fa3d1cad4647b88cdc65c3..42bf4b6b31452a2323941bb04bcbd796c6294c73 100644 --- a/game/modules/tome/class/GameState.lua +++ b/game/modules/tome/class/GameState.lua @@ -828,7 +828,11 @@ function _M:spawnWorldAmbush(enc, dx, dy, kind) }, reload_lists = false, - npc_list = mod.class.NPC:loadList("/data/general/npcs/all.lua", nil, nil, function(e) e.make_escort=nil end), + npc_list = mod.class.NPC:loadList("/data/general/npcs/all.lua", nil, nil, + function(e) + e.make_escort=nil + e.instakill_immune = 1 + end), grid_list = terrains, object_list = mod.class.Object:loadList("/data/general/objects/objects.lua"), trap_list = {}, diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 65ea22ea60dae1e7fd7f83d3e4893e387ed7b168..a5134d06809c378c0fa4fcbedcc46b96ad4deaa2 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -574,6 +574,25 @@ function _M:playerFOV() end, true, true, true) end + -- See everything and ignore all forms of blocking, dev mode feature + if self:attr("omnivision") then + self:computeFOV(self:attr("omnivision"), "we_need_useless_string_not_nil", function(x, y) + local ok = false + if game.level.map(x, y, game.level.map.ACTOR) then ok = true end + if game.level.map(x, y, game.level.map.OBJECT) then ok = true end + if game.level.map(x, y, game.level.map.TRAP) then + game.level.map(x, y, game.level.map.TRAP):setKnown(self, true, x, y) + game.level.map.remembers(x, y, true) + game.level.map:updateMap(x, y) + ok = true + end + + if ok then + game.level.map.seens(x, y, 0.6) + end + end, true, true, true) + end + -- Handle arcane eye if self:hasEffect(self.EFF_ARCANE_EYE) then local eff = self:hasEffect(self.EFF_ARCANE_EYE) @@ -1132,6 +1151,10 @@ function _M:restStep() self:useEnergy() self.resting.cnt = self.resting.cnt + 1 self:fireTalentCheck("callbackOnWait") + + -- Disable sustains that deactivate on rest + self:checkSustainDeactivate("rest") + return true end end @@ -1208,8 +1231,11 @@ function _M:runCheck(ignore_memory) if game.level.map:checkAllEntities(x, y, "store") then noticed = "store entrance spotted" ; return false, noticed end end) if noticed then return false, noticed end - - return engine.interface.PlayerRun.runCheck(self) + local can, noticed = engine.interface.PlayerRun.runCheck(self) + if can then + self:checkSustainDeactivate("run") + end + return can, noticed end --- Move with the mouse diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 68d8352f91f1a565bef626f0c0d824bf2fd8361c..c17a57d181a8cbc0873233370ab3a612dfebd655 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -1246,6 +1246,7 @@ end --- Gets the defense ranged function _M:combatDefense(fake, add) + if self.combat_precomputed_defense then return self.combat_precomputed_defense end local base_defense = self:combatDefenseBase(true) if not fake then base_defense = self:combatDefenseBase() end local d = math.max(0, base_defense + (add or 0)) @@ -1255,6 +1256,7 @@ end --- Gets the defense ranged function _M:combatDefenseRanged(fake, add) + if self.combat_precomputed_defense then return self.combat_precomputed_defense end local base_defense = self:combatDefenseBase(true) if not fake then base_defense = self:combatDefenseBase() end local d = math.max(0, base_defense + (self.combat_def_ranged or 0) + (add or 0)) @@ -1341,6 +1343,7 @@ function _M:combatAttackBase(weapon, ammo) return atk end function _M:combatAttack(weapon, ammo) + if self.combat_precomputed_accuracy then return self.combat_precomputed_accuracy end local stats if self:attr("use_psi_combat") then stats = (self:getCun(100, true) - 10) * (0.6 + self:callTalent(self.T_RESONANT_FOCUS, "bonus")/100) elseif weapon and weapon.wil_attack then stats = self:getWil(100, true) - 10 @@ -1357,6 +1360,7 @@ function _M:combatAttack(weapon, ammo) end function _M:combatAttackRanged(weapon, ammo) + if self.combat_precomputed_accuracy then return self.combat_precomputed_accuracy end local stats if self:attr("use_psi_combat") then stats = (self:getCun(100, true) - 10) * (0.6 + self:callTalent(self.T_RESONANT_FOCUS, "bonus")/100) elseif weapon and weapon.wil_attack then stats = self:getWil(100, true) - 10 @@ -1689,6 +1693,7 @@ function _M:combatDamagePower(weapon_combat, add) end function _M:combatPhysicalpower(mod, weapon, add) + if self.combat_precomputed_physpower then return self.combat_precomputed_physpower end mod = mod or 1 add = add or 0 @@ -1744,6 +1749,7 @@ end --- Gets spellpower function _M:combatSpellpower(mod, add) + if self.combat_precomputed_spellpower then return self.combat_precomputed_spellpower end mod = mod or 1 add = add or 0 @@ -2059,6 +2065,8 @@ end --- Gets mindpower function _M:combatMindpower(mod, add) + if self.combat_precomputed_mindpower then return self.combat_precomputed_mindpower end + mod = mod or 1 add = add or 0 diff --git a/game/modules/tome/data/general/objects/egos/ranged.lua b/game/modules/tome/data/general/objects/egos/ranged.lua index 3b535d75d4e83bf6c4a9ae2ab34870e6fe8535b4..8e6094386f03022f023a708fe615769dc4cb0164 100644 --- a/game/modules/tome/data/general/objects/egos/ranged.lua +++ b/game/modules/tome/data/general/objects/egos/ranged.lua @@ -222,7 +222,7 @@ newEntity{ }, }, combat = { - talent_on_hit = { [Talents.T_ARCANE_VORTEX] = {level=3, chance=10} }, + talent_on_hit = { [Talents.T_ARCANE_VORTEX] = {level=resolvers.genericlast(function(e) return e.material_level end), chance=10}, }, } } diff --git a/game/modules/tome/data/general/objects/egos/totems-powers.lua b/game/modules/tome/data/general/objects/egos/totems-powers.lua index 93b29ac99f0352c932e7669740f4dc6c98e9ebaa..3f58d768f56dadda9e65015981e953a6feb69117 100644 --- a/game/modules/tome/data/general/objects/egos/totems-powers.lua +++ b/game/modules/tome/data/general/objects/egos/totems-powers.lua @@ -185,13 +185,14 @@ newEntity{ m:resolve() who:logCombat(target or {name = "a spot nearby"}, "#Source# points %s %s at #target#, releasing a writhing tentacle!", who:his_her(), self:getName({do_color = true, no_add_name = true})) game.zone:addEntity(game.level, m, "actor", x, y) - m.remove_from_party_on_death = true, - game.party:addMember(m, { - control=false, - type="summon", - title="Summon", - }) - + m.remove_from_party_on_death = true + if game.party:hasMember(who) then + game.party:addMember(m, { + control=false, + type="summon", + title="Summon", + }) + end local stats = self.use_power.tentacleStats(self, who) table.mergeAdd(m, stats, true) m.life = m.max_life diff --git a/game/modules/tome/data/general/objects/scrolls.lua b/game/modules/tome/data/general/objects/scrolls.lua index 66b584b2c9c5ac656d548d03ce575a4ec0731fa7..a84bf09054e5d51905350f22705a7a35abacad7a 100644 --- a/game/modules/tome/data/general/objects/scrolls.lua +++ b/game/modules/tome/data/general/objects/scrolls.lua @@ -311,7 +311,7 @@ newEntity{ base = "BASE_RUNE", material_level = 1, inscription_kind = "movement", inscription_data = { - cooldown = resolvers.rngrange(13, 20), + cooldown = resolvers.rngrange(10, 20), range = resolvers.mbonus_level(5, 3, function(e, v) return v * 0.06 end), power = resolvers.mbonus_level(20, 10, function(e, v) return v * 1 end), use_stat_mod = 0.04, -- +4 range at 100 stat diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index 4f67fb959898460d077bbb7550c9466249cc6db0..b54da59d2dde4b0a4d3e08371398fae9722d0c81 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -76,7 +76,7 @@ newEntity{ base = "BASE_INFUSION", inscription_kind = "protect", inscription_data = { cooldown = 18, - dur = 5, + dur = 4, reduce = 2, power = 10, use_stat_mod = 0.01, -- +2 duration reduction and +10% affinity at 100 stat diff --git a/game/modules/tome/data/talents/cunning/shadow-magic.lua b/game/modules/tome/data/talents/cunning/shadow-magic.lua index c0ff1a9f4379bb6bc202f68fc3cafbe8408d2021..37cda19a0c0902f015a20f5fbf71feb63c9a6bd1 100644 --- a/game/modules/tome/data/talents/cunning/shadow-magic.lua +++ b/game/modules/tome/data/talents/cunning/shadow-magic.lua @@ -32,7 +32,7 @@ newTalent{ if not p then return "" end return tostring(math.floor(damDesc(self, DamageType.DARKNESS, t.getDamage(self, t)))), "buff_font_smaller" end, - getDamage = function(self, t) return self:combatTalentSpellDamage(t, 1, 70) end, -- This doesn't crit or generally scale easily so its safe to be aggressive + getDamage = function(self, t) return self:combatTalentSpellDamage(t, 1, 70)+10 end, -- This doesn't crit or generally scale easily so its safe to be aggressive getManaCost = function(self, t) return 0 end, activate = function(self, t) local ret = {} diff --git a/game/modules/tome/data/talents/cursed/gloom.lua b/game/modules/tome/data/talents/cursed/gloom.lua index 02619dc1c7f0945e683cbb38f278a10af0beb489..95f115d26e7e6700c0dd574ec268f6b71ae20c31 100644 --- a/game/modules/tome/data/talents/cursed/gloom.lua +++ b/game/modules/tome/data/talents/cursed/gloom.lua @@ -121,7 +121,7 @@ newTalent{ local chance = t.getChance(self, t) local duration = t.getDuration(self, t) local mindpowerChange = gloomTalentsMindpower(self) - return ([[A terrible gloom surrounds you, affecting all those who approach to within radius 3. At the end of each turn, those caught in your gloom must save against your Mindpower, or have a %d%% chance to suffer from slowness (30%%), stun or confusion (30%%) for %d turns. + return ([[A terrible gloom surrounds you, affecting all those who approach to within radius 3. At the end of each game turn, those caught in your gloom must save against your Mindpower, or have a %d%% chance to suffer from slowness (30%%), stun or confusion (30%%) for %d turns. The chance increases with your mind speed. This ability is innate, and carries no cost to activate or deactivate. Each point in Gloom talents increases your Mindpower (current total: %d).]]):format(chance, duration, mindpowerChange) diff --git a/game/modules/tome/data/talents/techniques/conditioning.lua b/game/modules/tome/data/talents/techniques/conditioning.lua index 8a75e72efd9efa3eae8c82ae6d89a4c8019de09c..c5bd6169113bb83aefc69a78dab5f4741eba5815 100644 --- a/game/modules/tome/data/talents/techniques/conditioning.lua +++ b/game/modules/tome/data/talents/techniques/conditioning.lua @@ -61,21 +61,25 @@ newTalent{ local e = self.tempeffect_def[eff_id] if e.status == "detrimental" then if e.subtype.stun then - effs[#effs+1] = {"effect", eff_id} + effs[#effs+1] = {"effect", eff_id, priority=1} elseif e.subtype.blind and self:getTalentLevel(t) >=2 then - effs[#effs+1] = {"effect", eff_id} + effs[#effs+1] = {"effect", eff_id, priority=2} elseif e.subtype.confusion and self:getTalentLevel(t) >=3 then - effs[#effs+1] = {"effect", eff_id} + effs[#effs+1] = {"effect", eff_id, priority=3} elseif e.subtype.pin and self:getTalentLevel(t) >=4 then - effs[#effs+1] = {"effect", eff_id} - elseif (e.subtype.slow or e.subtype.wound) and self:getTalentLevel(t) >=5 then - effs[#effs+1] = {"effect", eff_id} + effs[#effs+1] = {"effect", eff_id, priority=4} + elseif e.subtype.slow and self:getTalentLevel(t) >=5 then + effs[#effs+1] = {"effect", eff_id, priority=5} + elseif e.subtype.disarm and self:getTalentLevel(t) >=5 then + effs[#effs+1] = {"effect", eff_id, priority=6} end end end + + table.sort(effs, "priority") if #effs > 0 then - local eff = rng.tableRemove(effs) + local eff = effs[1] if eff[1] == "effect" and rng.percent(t.getChance(self, t)) then self:removeEffect(eff[2]) game.logSeen(self, "#ORCHID#%s has recovered!#LAST#", self.name:capitalize()) @@ -85,7 +89,8 @@ newTalent{ info = function(self, t) local chance = t.getChance(self, t) return ([[You've learned to recover quickly from effects that would disable you. Each turn, you have a %d%% chance to recover from a single stun effect. - At talent level 2 you may also recover from blindness, at level 3 confusion, level 4 pins, and level 5 slows and wounds. + At talent level 2 you may also recover from blindness, at level 3 confusion, level 4 pins, and level 5 disarms and slows. + Effects will be cleansed with the priority order Stun > Blind > Confusion > Pin > Slow > Disarm. Only one effect may be recovered from each turn, and the chance to recover from an effect scales with your Constitution.]]): format(chance) end, diff --git a/game/modules/tome/data/talents/techniques/thuggery.lua b/game/modules/tome/data/talents/techniques/thuggery.lua index 92df31f13c38e28db8fe6d70ec8810db240e10e1..c47a7ae700d3cb4f9925843e2c637e627a960102 100644 --- a/game/modules/tome/data/talents/techniques/thuggery.lua +++ b/game/modules/tome/data/talents/techniques/thuggery.lua @@ -102,8 +102,8 @@ newTalent{ mode = "passive", points = 5, require = techs_req3, - critpower = function(self, t) return self:combatTalentScale(t, 6, 25, 0.75) end, - getAPR = function(self, t) return self:combatTalentScale(t, 5, 20, 0.75) end, + critpower = function(self, t) return self:combatTalentScale(t, 6, 25) end, + getAPR = function(self, t) return self:combatTalentScale(t, 5, 20) end, passives = function(self, t, p) self:talentTemporaryValue(p, "combat_critical_power", t.critpower(self, t)) self:talentTemporaryValue(p, "combat_apr", t.getAPR(self, t)) diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 2f94a4d6b87201b61f7d6c5cb398317737d7bd99..97b009c543ad97bee408f7a4e23e5b27506935ea 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -3824,7 +3824,8 @@ newEffect{ desc = "Feeding", long_desc = function(self, eff) return ("%s is feeding from %s."):format(self.name:capitalize(), eff.target.name) end, type = "other", - subtype = { psychic_drain=true }, + subtype = { }, + no_stop_enter_worlmap = true, cancel_on_level_change = true, status = "beneficial", parameters = { }, activate = function(self, eff, ed) @@ -3924,6 +3925,7 @@ newEffect{ subtype = { psychic_drain=true }, status = "detrimental", remove_on_clone = true, + no_stop_enter_worlmap = true, cancel_on_level_change = true, no_remove = true, parameters = { }, activate = function(self, eff) @@ -3975,6 +3977,23 @@ newEffect{ end, } +newEffect{ + name = "OMNIVISION", image = "talents/track.png", + desc = "Sensing Everything", + long_desc = function(self, eff) return "Improves senses, allowing the detection of everything." end, + type = "other", + subtype = { sense=true }, + status = "beneficial", + parameters = { range=10,}, + activate = function(self, eff) + self:effectTemporaryValue(eff, "omnivision", eff.range) + game.level.map.changed = true + end, + deactivate = function(self, eff) + + end, +} + newEffect{ name = "DOZING", image = "talents/sleep.png", desc = "Dozing", @@ -3988,4 +4007,4 @@ newEffect{ end, deactivate = function(self, eff) end, -} \ No newline at end of file +} diff --git a/game/modules/tome/data/zones/last-hope-graveyard/zone.lua b/game/modules/tome/data/zones/last-hope-graveyard/zone.lua index b940860a16332d8c5b2cd93d0f6d70e7095c7bd7..bb02b7a568928c080d8eceee62d9c3791505cbb0 100644 --- a/game/modules/tome/data/zones/last-hope-graveyard/zone.lua +++ b/game/modules/tome/data/zones/last-hope-graveyard/zone.lua @@ -101,6 +101,7 @@ return { fct = function(self, x, y, who) local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true}) if self.sumomn_npc and x and y then + self.sumomn_npc.instakill_immune = 1 game.zone:addEntity(game.level, self.sumomn_npc, "actor", x, y) self.sumomn_npc = nil game.log("You were not the first here: the corpse was turned into an undead.") diff --git a/game/modules/tome/dialogs/CharacterSheet.lua b/game/modules/tome/dialogs/CharacterSheet.lua index 19c8cdda1c78bbd62b7016c909ab70350bddfb32..97ed1017415a7c5a353313a5c94222ecdd3e5157 100644 --- a/game/modules/tome/dialogs/CharacterSheet.lua +++ b/game/modules/tome/dialogs/CharacterSheet.lua @@ -866,64 +866,11 @@ The amount of %s automatically gained or lost each turn.]]):format(res_def.name, h = 0 w = 0 - -- get the combat stats for weapon by inventory and slot - local function get_combat_stats(actor, type, inven_id, item) - local o = table.get(actor:getInven(inven_id), item) - local mean - local ammo - local atk - local dmg - local apr - local crit - local crit_power = 0 - local aspeed - local range - local mspeed - local dam, archery - ammo = table.get(actor:getInven("QUIVER"), 1) - archery = o and o.archery and ammo and ammo.archery_ammo == o.archery and ammo.combat and (type ~= "offhand" or actor:attr("can_offshoot")) and (type ~= "psionic" or actor:attr("psi_focus_combat")) -- ranged combat - if type == "psionic" then - if not o or o.archery and not archery then return end - actor:attr("use_psi_combat", 1) - end - if not o or (o.archery and not archery) or actor:attr("disarmed") then -- unarmed - mean = actor.combat - dmg = actor:combatDamage(mean) * (mean.dam_mult or 1) - atk = actor:combatAttack(mean) - apr = actor:combatAPR(mean) - crit = actor:combatCrit(mean) - crit_power = mean.crit_power - aspeed = 1/actor:combatSpeed(mean) - archery = false - else -- weapon combat - mean = o and (o.special_combat and (o.slot == actor.inven[inven_id].name or actor:knowTalent(actor.T_STONESHIELD)) and o.special_combat) or actor:getObjectCombat(o, type == "psionic" and "mainhand" or type) or actor.combat -- handles stone wardens - if archery then -- ranged combat - dam = ammo.combat - atk = actor:combatAttackRanged(mean, dam) - dmg = actor:combatDamage(mean, nil, dam) * (mean.dam_mult or 1) - apr = actor:combatAPR(mean) + (dam.apr or 0) - crit_power = (mean.crit_power or 0) + (dam.crit_power or 0) - range = math.max(mean.range or 6, actor:attr("archery_range_override") or 1) - mspeed = 10 + (actor.combat.travel_speed or 0) + (mean.travel_speed or 0) + (dam.travel_speed or 0) - else -- melee combat - dam = o.combat - atk = actor:combatAttack(mean) - dmg = actor:combatDamage(mean) * (type == "offhand" and mean.talented ~= "shield" and actor:getOffHandMult(dam) or 1) * (mean.dam_mult or 1) - apr = actor:combatAPR(mean) - crit_power = mean.crit_power - end - crit = actor:combatCrit(dam) - aspeed = 1/actor:combatSpeed(mean) - end - if type == "psionic" then actor:attr("use_psi_combat", -1) end - return {obj=o, atk=atk, dmg=dmg, apr=apr, crit=crit, crit_power=crit_power or 0, aspeed=aspeed, range=range, mspeed=mspeed, archery=archery, mean=mean, ammo=ammo, block=mean.block, talented=mean.talented} - end - -- display the combat (comparison) stats for a combat slot local function display_combat_stats(text, player, actor_to_compare, inven_id, type, item) - local combat = get_combat_stats(player, type, inven_id, item) + local combat = player:getCombatStats(type, inven_id, item) if not combat then return end - local combatc = actor_to_compare and get_combat_stats(actor_to_compare, type, inven_id, item) or {} + local combatc = actor_to_compare and actor_to_compare:getCombatStats(type, inven_id, item) or {} local color local weap_type = combat.talented or table.get(combat.mean, "talented") local text2 = (combat.obj and combat.obj.slot_forbid == "OFFHAND" and "Two-Handed, " or "")..(weap_type and weap_type or "") diff --git a/game/modules/tome/dialogs/debug/DebugMain.lua b/game/modules/tome/dialogs/debug/DebugMain.lua index a4388b959be8cd0c75012fb7a2a1259e17a4be9d..f4c6116e1720f9eab335ccf5880c7adadd40175e 100644 --- a/game/modules/tome/dialogs/debug/DebugMain.lua +++ b/game/modules/tome/dialogs/debug/DebugMain.lua @@ -93,6 +93,9 @@ function _M:use(item) end end end + game.player:setEffect(game.player.EFF_OMNIVISION, 100, { + range = 200, + }) elseif act == "change_level" then game:registerDialog(GetQuantity.new("Zone: "..game.zone.name, "Level 1-"..game.zone.max_level, game.level.level, game.zone.max_level, function(qty) game:changeLevel(qty)