diff --git a/game/engine/interface/ObjectIdentify.lua b/game/engine/interface/ObjectIdentify.lua index a7e7e31a0cbe2346c59f15a2d793391c7606c48b..18318913a7dd55a0d6a168573bd065b932d35b49 100644 --- a/game/engine/interface/ObjectIdentify.lua +++ b/game/engine/interface/ObjectIdentify.lua @@ -31,6 +31,10 @@ function _M:isIdentified() self.identified = game.object_known_types[self.type][self.subtype][self.name] end + if self.auto_id then + self.identified = self.auto_id + end + return self.identified end diff --git a/game/modules/tome/data/general/traps/natural_forest.lua b/game/modules/tome/data/general/traps/natural_forest.lua new file mode 100644 index 0000000000000000000000000000000000000000..8fc080f7b3a86ffb2077763141e741999e656afd --- /dev/null +++ b/game/modules/tome/data/general/traps/natural_forest.lua @@ -0,0 +1,32 @@ +newEntity{ define_as = "TRAP_NATURAL_FOREST", + type = "natural", subtype="forest", id_by_type=true, unided_name = "trap", + display = '^', + triggered = function(self, x, y, who) + (self.src or who):project({type="hit"}, x, y, self.damtype, self.dam, self.particles and {type=self.particles}) + return true + end, +} + +newEntity{ base = "TRAP_NATURAL_FOREST", + name = "sliding rock", auto_id = true, + detect_power = 6, disarm_power = 16, + rarity = 3, level_range = {1, 50}, + color=colors.UMBER, + message = "@Target@ slides on a rock!", + triggered = function(self, x, y, who) + if who:checkHit(self.disarm_power + 5, who:combatPhysicalResist(), 0, 95, 15) and who:canBe("stun") then + who:setEffect(who.EFF_STUNNED, 4, {}) + else + game.logSeen(who, "%s resists!", who.name:capitalize()) + end + end +} + +newEntity{ base = "TRAP_NATURAL_FOREST", + name = "poison vine", auto_id = true, + detect_power = 8, disarm_power = 2, + rarity = 3, level_range = {1, 50}, + color=colors.GREEN, + message = "A poisonous vine strikes at @Target@!", + dam = resolvers.mbonus(150, 15), damtype = DamageType.POISON, +} diff --git a/game/modules/tome/data/zones/maze/traps.lua b/game/modules/tome/data/zones/maze/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..61e5f0daf639c9f18947c9f2431c5ccdc17720fc --- /dev/null +++ b/game/modules/tome/data/zones/maze/traps.lua @@ -0,0 +1 @@ +load("/data/general/traps/elemental.lua") diff --git a/game/modules/tome/data/zones/maze/zone.lua b/game/modules/tome/data/zones/maze/zone.lua index 295e6ebdf500881e59d794c86fb175a7f7d683e2..67fc0357e98c2f606a5a69b26c4e74a7d841fc7f 100644 --- a/game/modules/tome/data/zones/maze/zone.lua +++ b/game/modules/tome/data/zones/maze/zone.lua @@ -26,6 +26,10 @@ return { nb_object = {4, 6}, filters = { {type="potion" }, {type="potion" }, {type="potion" }, {type="scroll" }, {}, {} } }, + trap = { + class = "engine.generator.trap.Random", + nb_trap = {9, 15}, + }, }, levels = { diff --git a/game/modules/tome/data/zones/old-forest/traps.lua b/game/modules/tome/data/zones/old-forest/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..45fe257b4ace57348c1d12859e55de78bd74ac90 --- /dev/null +++ b/game/modules/tome/data/zones/old-forest/traps.lua @@ -0,0 +1 @@ +load("/data/general/traps/natural_forest.lua") diff --git a/game/modules/tome/data/zones/old-forest/zone.lua b/game/modules/tome/data/zones/old-forest/zone.lua index 6cd1d9357c6edf00ac1b6d351d2bd4e24b5050b5..6ad7532b61016b6e66d1ab81ce4efa345cf67358 100644 --- a/game/modules/tome/data/zones/old-forest/zone.lua +++ b/game/modules/tome/data/zones/old-forest/zone.lua @@ -31,6 +31,10 @@ return { nb_object = {6, 9}, filters = { {} } }, + trap = { + class = "engine.generator.trap.Random", + nb_trap = {9, 15}, + }, }, levels = { diff --git a/game/modules/tome/data/zones/tower-amon-sul/zone.lua b/game/modules/tome/data/zones/tower-amon-sul/zone.lua index 2ca9c1006d6e188b65039d9fe7390f635d44434b..7388eb787156a153176a282853a524924097edb5 100644 --- a/game/modules/tome/data/zones/tower-amon-sul/zone.lua +++ b/game/modules/tome/data/zones/tower-amon-sul/zone.lua @@ -32,7 +32,7 @@ return { }, trap = { class = "engine.generator.trap.Random", - nb_trap = {60, 90}, + nb_trap = {6, 9}, }, }, levels = diff --git a/game/modules/tome/data/zones/trollshaws/traps.lua b/game/modules/tome/data/zones/trollshaws/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..45fe257b4ace57348c1d12859e55de78bd74ac90 --- /dev/null +++ b/game/modules/tome/data/zones/trollshaws/traps.lua @@ -0,0 +1 @@ +load("/data/general/traps/natural_forest.lua") diff --git a/game/modules/tome/data/zones/trollshaws/zone.lua b/game/modules/tome/data/zones/trollshaws/zone.lua index 2490774f2482b7666a46fd9657612c196c71960a..4ea22538e661f6464f748552462f6f7cea5a3122 100644 --- a/game/modules/tome/data/zones/trollshaws/zone.lua +++ b/game/modules/tome/data/zones/trollshaws/zone.lua @@ -30,6 +30,10 @@ return { nb_object = {6, 9}, filters = { {type="potion" }, {type="potion" }, {type="potion" }, {type="scroll" }, {}, {} } }, + trap = { + class = "engine.generator.trap.Random", + nb_trap = {6, 9}, + }, }, levels = {