diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 8608486fc4ab196cae9ce025d81dba6d2ff6a072..52aeeef3cba3df05ddaba34ca5179aacbcf3860b 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1248,7 +1248,7 @@ function _M:setupCommands() end end end end, [{"_g","ctrl"}] = function() if config.settings.cheat then - local f, err = loadfile("/data/general/events/drake-cave.lua") + local f, err = loadfile("/data/general/events/glowing-chest.lua") print(f, err) setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G})) print(pcall(f)) diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index b1dcb20f5511cd3d36631a2e05e99c17c13585e4..b49ab47158f95aa974aaa0838795b5a1ee28aa35 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -2344,7 +2344,7 @@ newDamageType{ projector = function(src, x, y, type, dam) local realdam = DamageType:get(DamageType.ACID).projector(src, x, y, DamageType.ACID, dam) local target = game.level.map(x, y, Map.ACTOR) - if target and rng.percent(50) then + if target and rng.percent(25) then if target:canBe("disarm") then target:setEffect(target.EFF_DISARMED, 3, {src=src, apply_power=src:combatMindpower()}) else diff --git a/game/modules/tome/data/general/events/glowing-chest.lua b/game/modules/tome/data/general/events/glowing-chest.lua new file mode 100644 index 0000000000000000000000000000000000000000..ccf1c60c670e90afd554743f8f49d73fa6e22bea --- /dev/null +++ b/game/modules/tome/data/general/events/glowing-chest.lua @@ -0,0 +1,86 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +-- Find a random spot +local x, y = game.state:findEventGrid(level) +if not x then return false end + +local o +local r = rng.range(0, 99) +if r < 10 then + o = game.state:generateRandart{lev=resolvers.current_level+10} +elseif r < 40 then + o = game.zone:makeEntity(game.level, "object", {tome={double_greater=1}}, nil, true) +else + o = game.zone:makeEntity(game.level, "object", {tome={greater_normal=1}}, nil, true) +end +r = 99 - r +local ms +if rng.percent(r * 2) then + ms = {} + r = rng.range(0, 99) + if r < 8 then + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {random_boss=true}, nil, true) + elseif r < 25 then + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {random_elite=true}, nil, true) + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {random_elite=true}, nil, true) + elseif r < 60 then + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {random_elite=true}, nil, true) + else + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {}, nil, true) + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {}, nil, true) + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {}, nil, true) + ms[#ms+1] = game.zone:makeEntity(game.level, "actor", {}, nil, true) + end +end + +local g = game.level.map(x, y, engine.Map.TERRAIN):cloneFull() +g.name = "glowing chest" +g.display='~' g.color_r=255 g.color_g=215 g.color_b=0 g.notice = true +g.add_displays = g.add_displays or {} +g.add_displays[#g.add_displays+1] = mod.class.Grid.new{image="object/chest3.png", z=5} +g.nice_tiler = nil +g.chest_item = o +g.chest_guards = ms +g.block_move = function(self, x, y, who, act, couldpass) + if not who or not who.player or not act then return false end + if self.chest_opened then return false end + + require("engine.ui.Dialog"):yesnoPopup("Glowing Chest", "Open the chest?", function(ret) if ret then + self.chest_opened = true + if self.chest_item then + game.zone:addEntity(game.level, self.chest_item, "object", x, y) + game.logSeen(who, "#GOLD#An object rolls from the chest!") + if self.chest_guards then + for _, m in ipairs(self.chest_guards) do + local mx, my = util.findFreeGrid(x, y, 5, true, {[engine.Map.ACTOR]=true}) + if mx then game.zone:addEntity(game.level, m, "actor", mx, my) end + end + game.logSeen(who, "#GOLD#But the chest was guarded!") + end + end + self.chest_item = nil + self.chest_guards = nil + end end, "Open", "Leave") + + return false +end +game.zone:addEntity(game.level, g, "terrain", x, y) + +return true diff --git a/game/modules/tome/data/talents/gifts/venom-drake.lua b/game/modules/tome/data/talents/gifts/venom-drake.lua index b25107f9e0a0fe9a318466cc77c33a5720004527..779fc93e5867921346e85ec0d4672b6d2a2db9f7 100644 --- a/game/modules/tome/data/talents/gifts/venom-drake.lua +++ b/game/modules/tome/data/talents/gifts/venom-drake.lua @@ -56,7 +56,7 @@ newTalent{ local damage = t.getDamage(self, t) return ([[Spray forth a glob of acidic moisture at your enemy. The target will take %0.2f mindpower-based acid damage. - Enemies struck have a 50%% chance to be Disarmed for three turns, as their weapon is rendered useless by an acid coating. + Enemies struck have a 25%% chance to be Disarmed for three turns, as their weapon is rendered useless by an acid coating. At Talent Level 5, this becomes a piercing line of acid. Each point in acid drake talents also increases your acid resistance by 1%%.]]):format(damDesc(self, DamageType.ACID, damage)) end, @@ -186,8 +186,8 @@ newTalent{ end, info = function(self, t) return ([[You breathe acid in a frontal cone of radius %d. Any target caught in the area will take %0.2f acid damage. - Enemies caught in the acid have a 50%% chance of their weapons becoming useless for three turns. + Enemies caught in the acid have a 25%% chance of their weapons becoming useless for three turns. The damage will increase with the Strength stat. - Each point in acid drake talents also increases your acid resistance by 1%%.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.COLD, self:combatTalentStatDamage(t, "str", 30, 420))) + Each point in acid drake talents also increases your acid resistance by 1%%.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.ACID, self:combatTalentStatDamage(t, "str", 30, 420))) end, } \ No newline at end of file diff --git a/game/modules/tome/data/zones/ancient-elven-ruins/events.lua b/game/modules/tome/data/zones/ancient-elven-ruins/events.lua index bfdcdb52251ec93cc4483e3f85cd1edd7d41f746..f24701539b8770977c321ef3b01dcb2fc8b398c7 100644 --- a/game/modules/tome/data/zones/ancient-elven-ruins/events.lua +++ b/game/modules/tome/data/zones/ancient-elven-ruins/events.lua @@ -20,4 +20,5 @@ return { one_per_level=true, {group="majeyal-generic"}, {name="cultists", percent=10}, + {name="glowing-chest", minor=true, percent=40}, } diff --git a/game/modules/tome/data/zones/blighted-ruins/events.lua b/game/modules/tome/data/zones/blighted-ruins/events.lua index da254bcaf7cbd0c8730f1e42f7221c4816dde5e7..1cc7ec2f8dce0b9004b45d392bbbe909bc71440e 100644 --- a/game/modules/tome/data/zones/blighted-ruins/events.lua +++ b/game/modules/tome/data/zones/blighted-ruins/events.lua @@ -20,4 +20,5 @@ return { one_per_level=true, {name="glimmerstone", minor=true, percent=50}, {name="necrotic-air", minor=true, percent=100, max_repeat=2}, + {name="glowing-chest", minor=true, percent=10}, } diff --git a/game/modules/tome/data/zones/crypt-kryl-feijan/events.lua b/game/modules/tome/data/zones/crypt-kryl-feijan/events.lua new file mode 100644 index 0000000000000000000000000000000000000000..e2ddde7ddaa948c467b58942231cdb4938dbeda2 --- /dev/null +++ b/game/modules/tome/data/zones/crypt-kryl-feijan/events.lua @@ -0,0 +1,22 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return { one_per_level=true, + {name="glowing-chest", minor=true, percent=100}, +} diff --git a/game/modules/tome/data/zones/dreadfell/events.lua b/game/modules/tome/data/zones/dreadfell/events.lua index a3a17cb34e6bfac812826b6d160f815892f3b2b2..8747fda182b778ac75e8c05939abc191ac90be07 100644 --- a/game/modules/tome/data/zones/dreadfell/events.lua +++ b/game/modules/tome/data/zones/dreadfell/events.lua @@ -24,4 +24,5 @@ return { one_per_level=true, {name="protective-aura", minor=true, percent=20}, {name="necrotic-air", minor=true, percent=60, max_repeat=3}, {name="fell-aura", minor=true, percent=40}, + {name="glowing-chest", minor=true, percent=45}, } diff --git a/game/modules/tome/data/zones/golem-graveyard/events.lua b/game/modules/tome/data/zones/golem-graveyard/events.lua index 23bc748334f188eaadf8250d35d1f64b9dd45b36..1d1395fa60eacc06b8ec758745941c5e89d7e449 100644 --- a/game/modules/tome/data/zones/golem-graveyard/events.lua +++ b/game/modules/tome/data/zones/golem-graveyard/events.lua @@ -23,4 +23,5 @@ return { one_per_level=true, {group="majeyal-generic"}, {name="bligthed-soil", minor=true, percent=40}, {name="spellblaze-scar", minor=true, percent=40}, + {name="glowing-chest", minor=true, percent=80, max_repeat=3}, } diff --git a/game/modules/tome/data/zones/gorbat-pride/events.lua b/game/modules/tome/data/zones/gorbat-pride/events.lua index ba72d6c1f51416281abd79dbf31979566d04b3ae..2d289663c42cb22cdf431bde0bfc2f3046d4054f 100644 --- a/game/modules/tome/data/zones/gorbat-pride/events.lua +++ b/game/modules/tome/data/zones/gorbat-pride/events.lua @@ -21,4 +21,6 @@ return { one_per_level=true, {group="fareast-generic", percent_factor=1.5}, {name="antimagic-bush", minor=true, percent=60}, {name="whistling-vortex", minor=true, percent=50}, + {name="glowing-chest", minor=true, percent=30}, + {name="glowing-chest", minor=true, percent=30}, } diff --git a/game/modules/tome/data/zones/grushnak-pride/events.lua b/game/modules/tome/data/zones/grushnak-pride/events.lua index e3db9754d43622b62c572f0d7f2a280f90d69116..fe619344afc137ccb5f6867f8434037f53982bf7 100644 --- a/game/modules/tome/data/zones/grushnak-pride/events.lua +++ b/game/modules/tome/data/zones/grushnak-pride/events.lua @@ -20,4 +20,5 @@ return { one_per_level=true, {group="fareast-generic", percent_factor=1.5}, {name="antimagic-bush", minor=true, percent=80, max_repeat=3, forbid={1,3,5}}, + {name="glowing-chest", minor=true, percent=30}, } diff --git a/game/modules/tome/data/zones/halfling-ruins/events.lua b/game/modules/tome/data/zones/halfling-ruins/events.lua index 399eec53394baa2a0b39803206d86fc6a7bc5c57..c224606d2577d5b4f7815f8cd6c9afabc6b363f4 100644 --- a/game/modules/tome/data/zones/halfling-ruins/events.lua +++ b/game/modules/tome/data/zones/halfling-ruins/events.lua @@ -21,4 +21,4 @@ return { one_per_level=true, {group="majeyal-generic"}, {name="protective-aura", minor=true, percent=50}, {name="necrotic-air", minor=true, percent=50}, -} + {name="glowing-chest", minor=true, percent=20}, diff --git a/game/modules/tome/data/zones/infinite-dungeon/events.lua b/game/modules/tome/data/zones/infinite-dungeon/events.lua index a3d5ac0fa14f9f591f8df07c197772656d96430e..588077ad6f02e76ee16ecd812bbb91d582d39f8d 100644 --- a/game/modules/tome/data/zones/infinite-dungeon/events.lua +++ b/game/modules/tome/data/zones/infinite-dungeon/events.lua @@ -31,4 +31,5 @@ return { one_per_level=true, {name="necrotic-air", minor=true, percent=20}, {name="protective-aura", minor=true, percent=20}, {name="spellblaze-scar", minor=true, percent=20}, + {name="glowing-chest", minor=true, percent=30}, } diff --git a/game/modules/tome/data/zones/maze/events.lua b/game/modules/tome/data/zones/maze/events.lua new file mode 100644 index 0000000000000000000000000000000000000000..92f386f4eb8262e80caf8666921789f36712120b --- /dev/null +++ b/game/modules/tome/data/zones/maze/events.lua @@ -0,0 +1,29 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return { one_per_level=true, + {name="font-life", minor=true, percent=20}, + {name="whistling-vortex", minor=true, percent=20}, + {name="antimagic-bush", minor=true, percent=20}, + {name="bligthed-soil", minor=true, percent=20}, + {name="fell-aura", minor=true, percent=20}, + {name="protective-aura", minor=true, percent=20}, + {name="spellblaze-scar", minor=true, percent=20}, + {name="glowing-chest", minor=true, percent=100, max_repeat=3}, +} diff --git a/game/modules/tome/data/zones/rak-shor-pride/events.lua b/game/modules/tome/data/zones/rak-shor-pride/events.lua index 9271e10137d2fed06ed8b1b8d9af83b174ce1a21..b31da73d98747baf97d877c46fbd34eab063733f 100644 --- a/game/modules/tome/data/zones/rak-shor-pride/events.lua +++ b/game/modules/tome/data/zones/rak-shor-pride/events.lua @@ -21,4 +21,5 @@ return { one_per_level=true, {group="fareast-generic", percent_factor=1.5}, {name="whistling-vortex", minor=true, percent=50}, {name="necrotic-air", minor=true, percent=100, max_repeat=3}, + {name="glowing-chest", minor=true, percent=30}, } diff --git a/game/modules/tome/data/zones/reknor/events.lua b/game/modules/tome/data/zones/reknor/events.lua index ede0258fd87eda8e926bcb3110d031111a8708b5..0de3c1d7621feb9c05f998debb3218fbf59000b7 100644 --- a/game/modules/tome/data/zones/reknor/events.lua +++ b/game/modules/tome/data/zones/reknor/events.lua @@ -23,4 +23,5 @@ return { one_per_level=true, {name="glimmerstone", minor=true, percent=100, max_repeat=4}, {name="whistling-vortex", minor=true, percent=50}, {name="fell-aura", minor=true, percent=50, max_repeat=3}, + {name="glowing-chest", minor=true, percent=80, max_repeat=4}, } diff --git a/game/modules/tome/data/zones/rhaloren-camp/events.lua b/game/modules/tome/data/zones/rhaloren-camp/events.lua new file mode 100644 index 0000000000000000000000000000000000000000..d687aa125615f67a48e3c5be796a246c8621910f --- /dev/null +++ b/game/modules/tome/data/zones/rhaloren-camp/events.lua @@ -0,0 +1,24 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return { one_per_level=true, + {name="glimmerstone", minor=true, percent=30}, + {name="fell-aura", minor=true, percent=50}, + {name="glowing-chest", minor=true, percent=20}, +} diff --git a/game/modules/tome/data/zones/ruins-kor-pul/events.lua b/game/modules/tome/data/zones/ruins-kor-pul/events.lua index 2d587d202a1120d5e7d5ddecf3f68261779baa9d..f16ea9bbb8a20178841b1c79a078f3daced815ff 100644 --- a/game/modules/tome/data/zones/ruins-kor-pul/events.lua +++ b/game/modules/tome/data/zones/ruins-kor-pul/events.lua @@ -20,4 +20,5 @@ return { one_per_level = true, {name="protective-aura", minor=true, percent=50}, {name="necrotic-air", minor=true, percent=50}, + {name="glowing-chest", minor=true, percent=30}, } diff --git a/game/modules/tome/data/zones/sandworm-lair/events.lua b/game/modules/tome/data/zones/sandworm-lair/events.lua index c1771c4df067cd40f2c729130e5025c7f34bcd08..e80b5242032153bd96a83459b1a2d6f3478aeab2 100644 --- a/game/modules/tome/data/zones/sandworm-lair/events.lua +++ b/game/modules/tome/data/zones/sandworm-lair/events.lua @@ -19,4 +19,5 @@ return { one_per_level=true, {group="majeyal-generic"}, + {name="glowing-chest", minor=true, percent=100, max_repeat=3}, } diff --git a/game/modules/tome/data/zones/shadow-crypt/events.lua b/game/modules/tome/data/zones/shadow-crypt/events.lua index 0362725c89e4757c2c61729a94cc9632b54f1dca..1d88ebeb223055daa9dfff58176716607947b76d 100644 --- a/game/modules/tome/data/zones/shadow-crypt/events.lua +++ b/game/modules/tome/data/zones/shadow-crypt/events.lua @@ -21,4 +21,5 @@ return { one_per_level=true, {name="spellblaze-scar", minor=true, percent=50}, {name="fell-aura", minor=true, percent=50}, {name="necrotic-air", minor=true, percent=50}, + {name="glowing-chest", minor=true, percent=10}, } diff --git a/game/modules/tome/data/zones/tempest-peak/events.lua b/game/modules/tome/data/zones/tempest-peak/events.lua index c6a0eff9956e84cef2b6d1be894d8560a8f91256..ecf88367ad7dfc098517d58b47cf89bc91fd3f5f 100644 --- a/game/modules/tome/data/zones/tempest-peak/events.lua +++ b/game/modules/tome/data/zones/tempest-peak/events.lua @@ -22,4 +22,5 @@ return { one_per_level=true, {group="majeyal-generic"}, {name="icy-ground", minor=true, percent=40}, {name="whistling-vortex", minor=true, percent=100}, + {name="glowing-chest", minor=true, percent=20}, } diff --git a/game/modules/tome/data/zones/thieves-tunnels/events.lua b/game/modules/tome/data/zones/thieves-tunnels/events.lua new file mode 100644 index 0000000000000000000000000000000000000000..638394f5d8ffd2714e29f25ef596ed2802159382 --- /dev/null +++ b/game/modules/tome/data/zones/thieves-tunnels/events.lua @@ -0,0 +1,22 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return { one_per_level=true, + {name="glowing-chest", minor=true, percent=70}, +} diff --git a/game/modules/tome/data/zones/unremarkable-cave/events.lua b/game/modules/tome/data/zones/unremarkable-cave/events.lua new file mode 100644 index 0000000000000000000000000000000000000000..e2ddde7ddaa948c467b58942231cdb4938dbeda2 --- /dev/null +++ b/game/modules/tome/data/zones/unremarkable-cave/events.lua @@ -0,0 +1,22 @@ +-- ToME - Tales of Maj'Eyal +-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- +-- Nicolas Casalini "DarkGod" +-- darkgod@te4.org + +return { one_per_level=true, + {name="glowing-chest", minor=true, percent=100}, +} diff --git a/game/modules/tome/data/zones/vor-pride/events.lua b/game/modules/tome/data/zones/vor-pride/events.lua index 50222baa39bcb2a024e4e13f84c1ea863292a436..597f381d0d924be345adbc580818f7d68aed5a11 100644 --- a/game/modules/tome/data/zones/vor-pride/events.lua +++ b/game/modules/tome/data/zones/vor-pride/events.lua @@ -21,4 +21,5 @@ return { one_per_level=true, {group="fareast-generic", percent_factor=1.5}, {name="fell-aura", minor=true, percent=100, max_repeat=3}, {name="spellblaze-scar", minor=true, percent=50}, + {name="glowing-chest", minor=true, percent=30}, }