diff --git a/game/engine/Map.lua b/game/engine/Map.lua index 5be7363fce35ccf517b716f93c30f2b03da8e7a2..9f8f9ac86cfe3b55ba8e563d9b1815c54992bb35 100644 --- a/game/engine/Map.lua +++ b/game/engine/Map.lua @@ -133,6 +133,7 @@ end --- Create the tile repositories function _M:resetTiles() self.tiles = Tiles.new(self.tile_w, self.tile_h, self.fontname, self.fontsize, true, self.allow_backcolor) + self.tilesTactic = Tiles.new(self.tile_w, self.tile_h, self.fontname, self.fontsize, true, false) self.tilesSurface = Tiles.new(self.tile_w, self.tile_h, self.fontname, self.fontsize, false, true) end @@ -418,11 +419,11 @@ function _M:display() if e.faction then friend = Faction:factionReaction(self.view_faction, e.faction) if friend > 0 then - self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_friend):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) + self.tilesTactic:get(nil, 0,0,0, 0,0,0, self.faction_friend):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) elseif friend < 0 then - self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_enemy):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) + self.tilesTactic:get(nil, 0,0,0, 0,0,0, self.faction_enemy):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) else - self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_neutral):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) + self.tilesTactic:get(nil, 0,0,0, 0,0,0, self.faction_neutral):toScreen(self.display_x + (i - self.mx) * self.tile_w, self.display_y + (j - self.my) * self.tile_h, self.tile_w, self.tile_h) end end end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index cadaec7025d38c019f6b9970f813e27cfd0b70f2..6e6163f393a7a8a106531b5d1e32c5abe99e5296 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -810,7 +810,7 @@ function _M:canSee(actor, def, def_pct) -- Full ESP if esp.all and esp.all > 0 then if game.level then - game.level.map.seens(actor.x, actor.y, true) + game.level.map.seens(actor.x, actor.y, 1) end return true, 100 end diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 00cb5d1dd8b4ac44af1441af6bcb9f365931dc37..507293e1dc362a093a7303c5cb0a8cf5480a5847 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -484,8 +484,8 @@ function _M:setupCommands() self.key:addCommands{ [{"_d","ctrl"}] = function() --- if config.settings.tome.cheat then self:changeLevel(3, "moria") end - if config.settings.tome.cheat then self:changeLevel(1, "wilderness-arda-fareast") end + if config.settings.tome.cheat then self:changeLevel(3, "moria") end +-- if config.settings.tome.cheat then self:changeLevel(1, "wilderness-arda-fareast") end end, } self.key:addBinds diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index a46ff133c597f28c09bea36c489376d3312f59f5..d3a297babcd1100c54e75ef208a94719a0c4ead0 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -173,7 +173,7 @@ function _M:playerFOV() end if ok then - game.level.map.seens(x, y, true) + game.level.map.seens(x, y, 1) end end, true, true, true) end diff --git a/game/modules/tome/data/general/traps/alarm.lua b/game/modules/tome/data/general/traps/alarm.lua new file mode 100644 index 0000000000000000000000000000000000000000..6d671bb0852494ef9c707977da73c7bc838cf6d1 --- /dev/null +++ b/game/modules/tome/data/general/traps/alarm.lua @@ -0,0 +1,73 @@ +-- ToME - Tales of Middle-Earth +-- Copyright (C) 2009, 2010 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 + +newEntity{ define_as = "TRAP_ALARM", + type = "annoy", subtype="alarm", id_by_type=true, unided_name = "trap", + display = '^', +} + +newEntity{ base = "TRAP_ALARM", + name = "intruder alarm", auto_id = true, + detect_power = 20, disarm_power = 36, + rarity = 3, level_range = {1, 50}, + color=colors.UMBER, + message = "@Target@ triggers an alarm!", + triggered = function(self, x, y, who) + for i = x - 20, x + 20 do for j = y - 20, y + 20 do if game.level.map:isBound(i, j) then + local actor = game.level.map(i, j, game.level.map.ACTOR) + if actor and not actor.player then + if who:reactionToward(actor) >= 0 then + local tx, ty, a = who:getTarget() + if a then + actor:setTarget(a) + end + else + actor:setTarget(who) + end + end + end end end + return true, true + end +} + +newEntity{ base = "TRAP_ALARM", + name = "summoning alarm", auto_id = true, + detect_power = 8, disarm_power = 2, + rarity = 3, level_range = {10, 50}, + color=colors.DARK_UMBER, + nb_summon = resolvers.mbonus(3, 2), + message = "A alarm rings!", + triggered = function(self, sx, sy, who) + for i = 1, self.nb_summon do + -- Find space + local x, y = util.findFreeGrid(sx, sy, 10, true, {[game.level.map.ACTOR]=true}) + if not x then + break + end + + -- Find an actor with that filter + local m = game.zone:makeEntity(game.level, "actor") + if m then + game.zone:addEntity(game.level, m, "actor", x, y) + game.logSeen(self, "%s appears out of the thin air!", m.name:capitalize()) + end + end + return true, true + end +} diff --git a/game/modules/tome/data/zones/moria/npcs.lua b/game/modules/tome/data/zones/moria/npcs.lua index f0db6908fb43b986255579ee0cc46e7d334af319..66f585828f4fa1d3c0f48ffcdacc530ef0ff4f46 100644 --- a/game/modules/tome/data/zones/moria/npcs.lua +++ b/game/modules/tome/data/zones/moria/npcs.lua @@ -18,7 +18,7 @@ -- darkgod@te4.org load("/data/general/npcs/orc.lua") -load("/data/general/npcs/toll.lua") +load("/data/general/npcs/troll.lua") local Talents = require("engine.interface.ActorTalents") @@ -45,19 +45,12 @@ newEntity{ define_as = "GOLBUG", resolvers.drops{chance=100, nb=5, {ego_chance=100} }, resolvers.drops{chance=100, nb=1, {type="jewelry", subtype="orb", defined="ORB_MANY_WAYS"} }, - summon = { - {type="humanoid", subtype="orc", number=2, hasxp=true}, - {type="humanoid", subtype="troll", number=1, hasxp=true}, - }, - stun_immune = 1, see_invisible = 5, resolvers.talents{ - [Talents.T_SUMMON]=1, - [Talents.T_HEAVY_ARMOUR_TRAINING]=1, - [Talents.T_MASSIVE_ARMOUR_TRAINING]=1, + [Talents.T_MASSIVE_ARMOUR_TRAINING]=3, [Talents.T_WEAPON_COMBAT]=6, [Talents.T_MACE_MASTERY]=6, [Talents.T_SHIELD_PUMMEL]=4, diff --git a/game/modules/tome/data/zones/moria/objects.lua b/game/modules/tome/data/zones/moria/objects.lua index ee26d382c423b343a00bc0c6ad2b0742738ccba2..b5facd63f5b34e95c1aab209db0f312a8aef3e91 100644 --- a/game/modules/tome/data/zones/moria/objects.lua +++ b/game/modules/tome/data/zones/moria/objects.lua @@ -18,70 +18,3 @@ -- darkgod@te4.org load("/data/general/objects/objects.lua") - -newEntity{ base = "BASE_AMULET", - define_as = "AMULET_DREAD", rarity=false, - name = "Choker of Dread", unique=true, - unided_name = "dark amulet", color=colors.LIGHT_DARK, - desc = [[The evilness of undeath radiates from this amulet.]], - cost = 5000, - wielder = { - see_invisible = 10, - blind_immune = 1, - combat_spellpower = 5, - combat_dam = 5, - }, - max_power = 60, power_regen = 1, - use_power = { name = "summon an elder vampire to your side", power = 60, use = function(self, who) - -- Find space - local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true}) - if not x then - game.logPlayer(who, "Not enough space to invoke the vampire!") - return - end - print("Invoking gardian on", x, y) - - local NPC = require "mod.class.NPC" - local vampire = NPC.new{ - type = "undead", subtype = "vampires", - display = "V", - name = "elder vampire", color=colors.RED, - desc=[[A terrible robed undead figure, this creature has existed in its unlife for many centuries by stealing the life of others. It can - summon the very shades of its victims from beyond the grave to come enslaved to its aid.]], - - combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINLIFE, dammod={str=1.9} }, - - body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, - - autolevel = "warriormage", - ai = "summoned", ai_real = "dumb_talented_simple", ai_state = { talent_in=3, }, - energy = { mod=1 }, - stats = { str=12, dex=12, mag=12, con=12 }, - life_regen = 3, - size_category = 3, - rank = 3, - - resolvers.tmasteries{ ["technique/other"]=0.5, ["spell/phantasm"]=0.8, }, - - resists = { [DamageType.COLD] = 80, [DamageType.NATURE] = 80, [DamageType.LIGHT] = -50, }, - blind_immune = 1, - confusion_immune = 1, - see_invisible = 5, - undead = 1, - - level_range = {who.level, who.level}, exp_worth = 0, - max_life = resolvers.rngavg(90,100), - combat_armor = 12, combat_def = 10, - resolvers.talents{ [who.T_STUN]=2, [who.T_BLUR_SIGHT]=3, [who.T_PHANTASMAL_SHIELD]=2, [who.T_ROTTING_DISEASE]=3, }, - - faction = who.faction, - summoner = who, - summon_time = 10, - } - - vampire:resolve() - game.zone:addEntity(game.level, vampire, "actor", x, y) - - game:playSoundNear(who, "talents/spell_generic") - end }, -} diff --git a/game/modules/tome/data/zones/moria/traps.lua b/game/modules/tome/data/zones/moria/traps.lua index 3cd3173e45699446c9ad0526d8ce04b7690a2b32..e5201481de6fe45b57f3ad3c6dab9523fa929074 100644 --- a/game/modules/tome/data/zones/moria/traps.lua +++ b/game/modules/tome/data/zones/moria/traps.lua @@ -18,3 +18,4 @@ -- darkgod@te4.org load("/data/general/traps/elemental.lua") +load("/data/general/traps/alarm.lua") diff --git a/game/modules/tome/data/zones/moria/zone.lua b/game/modules/tome/data/zones/moria/zone.lua index a0bcd57d93649a6b4c5e00fa6bbf80e56c674469..0dc01b02bb6da30350a017f86a42309ec295c389 100644 --- a/game/modules/tome/data/zones/moria/zone.lua +++ b/game/modules/tome/data/zones/moria/zone.lua @@ -68,7 +68,7 @@ return { }, actor = { nb_npc = {3, 3}, }, object = { nb_object = {8, 10}, }, - trap = { nb_trap = {1, 1}, }, + trap = { nb_trap = {3, 3}, }, }, }, },