diff --git a/game/engine/ActorsSeenDisplay.lua b/game/engine/ActorsSeenDisplay.lua index 675f4aa67b64d3ac04968d0fbdfdedff61d5a2a8..b8a7698055d957bde54680a0d4a71b77b5bf3314 100644 --- a/game/engine/ActorsSeenDisplay.lua +++ b/game/engine/ActorsSeenDisplay.lua @@ -51,15 +51,17 @@ function _M:display() -- initialize the array for i, act in ipairs(a.fov.actors_dist) do - local n = act.name:capitalize() - list[n] = list[n] or { name=n, nb=0, dist={} } - list[n].nb = list[n].nb + 1 - list[n].dist[#list[n].dist+1] = math.floor(math.sqrt(a.fov.actors[act].sqdist)) + if a:canSee(act) then + local n = act.name:capitalize() + list[n] = list[n] or { name=n, nb=0, dist={} } + list[n].nb = list[n].nb + 1 + list[n].dist[#list[n].dist+1] = math.floor(math.sqrt(a.fov.actors[act].sqdist)) - local r = a:reactionToward(act) - if r > 0 then list[n].color={0,255,0} - elseif r == 0 then list[n].color={176,196,222} - elseif r < 0 then list[n].color={255,0,0} end + local r = a:reactionToward(act) + if r > 0 then list[n].color={0,255,0} + elseif r == 0 then list[n].color={176,196,222} + elseif r < 0 then list[n].color={255,0,0} end + end end local l = {} for _, a in pairs(list) do l[#l+1] = a end diff --git a/game/engine/interface/ActorProject.lua b/game/engine/interface/ActorProject.lua index c41c3fb31d12cc6473b7374f634c9184588a2789..2b0f48a901f8cee743e58d9c56dc2452c3439d94 100644 --- a/game/engine/interface/ActorProject.lua +++ b/game/engine/interface/ActorProject.lua @@ -199,6 +199,9 @@ function _M:projectDoMove(typ, tgtx, tgty, x, y, srcx, srcy) if typ.range and math.sqrt((srcx-lx)^2 + (srcy-ly)^2) > typ.range then return lx, ly, false, true end end + -- End of the map + if lx < 0 or lx >= game.level.map.w or ly < 0 or ly >= game.level.map.h then return lx, ly, false, true end + -- Deam damage: beam if typ.line then return lx, ly, true, false end end diff --git a/game/engine/interface/PlayerMouse.lua b/game/engine/interface/PlayerMouse.lua index 11b9bda6ae3f223e4319d119f1a1066a9abd9c3a..13c2fdde512564e338eb132d07a553b3412039ed 100644 --- a/game/engine/interface/PlayerMouse.lua +++ b/game/engine/interface/PlayerMouse.lua @@ -33,6 +33,9 @@ module(..., package.seeall, class.make) -- @param tmy the coords clicked -- @param spotHostiles a function taking only the player as a parameter that must return true if hostiles are in sight function _M:mouseMove(tmx, tmy, spotHostiles) + tmx = util.bound(tmx, 0, game.level.map.w - 1) + tmy = util.bound(tmy, 0, game.level.map.h - 1) + if config.settings.tome.cheat and core.key.modState("ctrl") then game.log("[CHEAT] teleport to %dx%d", tmx, tmy) self:move(tmx, tmy, true) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 7f50d4e3c604abd4f8e91aa8954bd9c8cf405851..fdec9a77eb77b0470c9fb6d6a960294ddd24a5ac 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -468,10 +468,10 @@ function _M:setupCommands() self.player.esp.all = 1 self.player.esp.range = 50 self.player.inc_damage.all = 100000 --- self:changeLevel(2, "flooded-cave") - self:changeLevel(1, "wilderness-arda-fareast") - game.memory_levels["wilderness-arda-fareast-1"] = game.level - self.player:grantQuest("orc-pride") + self:changeLevel(2, "caverns-osse") +-- self:changeLevel(1, "wilderness-arda-fareast") +-- game.memory_levels["wilderness-arda-fareast-1"] = game.level +-- self.player:grantQuest("orc-pride") -- self.player:grantQuest("escort-duty") end end, diff --git a/game/modules/tome/data/general/npcs/aquatic_critter.lua b/game/modules/tome/data/general/npcs/aquatic_critter.lua index 6999fa25e385786d962d872486b933dfc5ac4d4b..a7cfaa6f2a20e60243fd9994e8d6d7399d7e347f 100644 --- a/game/modules/tome/data/general/npcs/aquatic_critter.lua +++ b/game/modules/tome/data/general/npcs/aquatic_critter.lua @@ -31,7 +31,7 @@ newEntity{ stats = { str=12, dex=10, mag=3, con=13 }, energy = { mod=1 }, combat_armor = 1, combat_def = 1, - combat = { dam=5, atk=15, apr=7, dammod={str=0.6} }, + combat = { dam=resolvers.mbonus(36, 10), atk=15, apr=7, dammod={str=0.6} }, max_life = resolvers.rngavg(10,20), life_rating = 6, infravision = 20, rank = 1, diff --git a/game/modules/tome/data/general/npcs/aquatic_demon.lua b/game/modules/tome/data/general/npcs/aquatic_demon.lua index 8906986ea2a26e5242524be6669bd5a4c004700b..5c224d2864540b89c5532c46f60c1e58324cc653 100644 --- a/game/modules/tome/data/general/npcs/aquatic_demon.lua +++ b/game/modules/tome/data/general/npcs/aquatic_demon.lua @@ -31,7 +31,7 @@ newEntity{ stats = { str=12, dex=10, mag=3, con=13 }, energy = { mod=1 }, combat_armor = 1, combat_def = 1, - combat = { dam=5, atk=15, apr=7, dammod={str=0.6} }, + combat = { dam=resolvers.mbonus(46, 20), atk=15, apr=7, dammod={str=0.7} }, max_life = resolvers.rngavg(100,120), infravision = 20, open_door = true, diff --git a/game/modules/tome/data/general/npcs/bone-giant.lua b/game/modules/tome/data/general/npcs/bone-giant.lua index 6fa4cca011ad34c4e9e64d443008009f27be16b1..e4e6fce35479dba1283e9515ce8036b1dea5b3ed 100644 --- a/game/modules/tome/data/general/npcs/bone-giant.lua +++ b/game/modules/tome/data/general/npcs/bone-giant.lua @@ -24,7 +24,7 @@ newEntity{ type = "undead", subtype = "giant", display = "K", color=colors.WHITE, - combat = { dam=resolvers.rngavg(35,40), atk=15, apr=10, dammod={str=0.8} }, + combat = { dam=resolvers.mbonus(45, 20), atk=15, apr=10, dammod={str=0.8} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, diff --git a/game/modules/tome/data/general/npcs/faeros.lua b/game/modules/tome/data/general/npcs/faeros.lua index 200a24c55373a5c35d02e6702bb2f283b6996b6e..28ab67dcb55eac224126da5b78862c82f4566c3a 100644 --- a/game/modules/tome/data/general/npcs/faeros.lua +++ b/game/modules/tome/data/general/npcs/faeros.lua @@ -24,7 +24,7 @@ newEntity{ type = "elemental", subtype = "fire", display = "E", color=colors.ORANGE, - combat = { dam=resolvers.rngavg(15,20), atk=15, apr=15, dammod={mag=0.8}, damtype=DamageType.FIRE }, + combat = { dam=resolvers.mbonus(40, 15), atk=15, apr=15, dammod={mag=0.8}, damtype=DamageType.FIRE }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, diff --git a/game/modules/tome/data/general/npcs/ghoul.lua b/game/modules/tome/data/general/npcs/ghoul.lua index d6f14a0b65e19f8870c8af003bcc1085b49e1906..9db948673774e5217eb75d915d28dd53b4e88504 100644 --- a/game/modules/tome/data/general/npcs/ghoul.lua +++ b/game/modules/tome/data/general/npcs/ghoul.lua @@ -55,7 +55,7 @@ newEntity{ base = "BASE_NPC_GHOUL", resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=1, [Talents.T_BITE_POISON]=1, [Talents.T_ROTTING_DISEASE]=1, }, ai_state = { talent_in=4, }, - combat = { dam=5, atk=5, apr=3, dammod={str=0.6} }, + combat = { dam=10, atk=5, apr=3, dammod={str=0.6} }, } newEntity{ base = "BASE_NPC_GHOUL", @@ -67,7 +67,7 @@ newEntity{ base = "BASE_NPC_GHOUL", combat_armor = 2, combat_def = 8, ai_state = { talent_in=3, }, - combat = { dam=7, atk=6, apr=3, dammod={str=0.6} }, + combat = { dam=17, atk=6, apr=3, dammod={str=0.6} }, summon = {{type="undead", subtype="ghoul", name="ghoul", number=1, hasxp=false}, }, resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2, [Talents.T_BITE_POISON]=2, [Talents.T_SUMMON]=1, [Talents.T_ROTTING_DISEASE]=2, [Talents.T_DECREPITUDE_DISEASE]=2, }, @@ -84,7 +84,7 @@ newEntity{ base = "BASE_NPC_GHOUL", rank = 3, - combat = { dam=10, atk=8, apr=4, dammod={str=0.6} }, + combat = { dam=30, atk=8, apr=4, dammod={str=0.6} }, summon = { {type="undead", subtype="ghoul", name="ghoul", number=1, hasxp=false}, diff --git a/game/modules/tome/data/general/npcs/naga.lua b/game/modules/tome/data/general/npcs/naga.lua new file mode 100644 index 0000000000000000000000000000000000000000..941f7dfbedb013c8d46ad402e69419ad30398248 --- /dev/null +++ b/game/modules/tome/data/general/npcs/naga.lua @@ -0,0 +1,116 @@ +-- 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 + +local Talents = require("engine.interface.ActorTalents") + +newEntity{ + define_as = "BASE_NPC_NAGA", + type = "humanoid", subtype = "naga", + display = "n", color=colors.AQUAMARINE, + + combat = { dam=resolvers.rngavg(5,12), atk=2, apr=6, physspeed=2 }, + + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 }, + resolvers.drops{chance=20, nb=1, {} }, + resolvers.drops{chance=10, nb=1, {type="money"} }, + infravision = 20, + can_breath={water=1}, + + life_rating = 11, + rank = 2, + size_category = 3, + + open_door = true, + + autolevel = "warrior", + ai = "dumb_talented_simple", ai_state = { talent_in=3, }, + energy = { mod=1.2 }, + stats = { str=15, dex=15, mag=15, con=10 }, +} + +newEntity{ base = "BASE_NPC_NAGA", + name = "naga myrmidon", color=colors.DARK_UMBER, + desc = [[A naga warrior, wielding a menacing trident. Myrmidons are the most devoted warriors, following the orders of Maglor whatever they may be.]], + level_range = {30, nil}, exp_worth = 1, + rarity = 1, + max_life = resolvers.rngavg(120,150), life_rating = 14, + resolvers.equip{ + {type="weapon", subtype="battleaxe", autoreq=true}, + }, + combat_armor = 20, combat_def = 10, + resolvers.talents{ + [Talents.T_SUNDER_ARMOUR]=4, + [Talents.T_STUNNING_BLOW]=3, + }, +} + +newEntity{ base = "BASE_NPC_NAGA", + name = "naga vemon spitter", color=colors.DARK_UMBER, + desc = [[A naga warrior, wielding a menacing trident. Myrmidons are the most devoted warriors, following the orders of Maglor whatever they may be.]], + level_range = {30, nil}, exp_worth = 1, + rarity = 1, + max_life = resolvers.rngavg(120,150), life_rating = 14, + resolvers.equip{ + {type="weapon", subtype="battleaxe", autoreq=true}, + }, + combat_armor = 20, combat_def = 10, + resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, }, +} + +newEntity{ base = "BASE_NPC_NAGA", + name = "naga tide hunter", color=colors.DARK_UMBER, + desc = [[A naga warrior, wielding a menacing trident. Myrmidons are the most devoted warriors, following the orders of Maglor whatever they may be.]], + level_range = {30, nil}, exp_worth = 1, + rarity = 1, + female = true, + max_life = resolvers.rngavg(120,150), life_rating = 14, + resolvers.equip{ + {type="weapon", subtype="battleaxe", autoreq=true}, + }, + combat_armor = 20, combat_def = 10, + resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, }, +} + +newEntity{ base = "BASE_NPC_NAGA", + name = "naga psyren", color=colors.DARK_UMBER, + desc = [[A naga warrior, wielding a menacing trident. Myrmidons are the most devoted warriors, following the orders of Maglor whatever they may be.]], + level_range = {30, nil}, exp_worth = 1, + rarity = 1, + female = true, + max_life = resolvers.rngavg(120,150), life_rating = 14, + resolvers.equip{ + {type="weapon", subtype="battleaxe", autoreq=true}, + }, + combat_armor = 20, combat_def = 10, + resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, }, +} + +newEntity{ base = "BASE_NPC_NAGA", + name = "naga shield-maiden", color=colors.DARK_UMBER, + desc = [[A female naga, tasked to protect the sanctuary at all costs.]], + level_range = {30, nil}, exp_worth = 1, + rarity = 1, + female = true, + max_life = resolvers.rngavg(120,150), life_rating = 14, + resolvers.equip{ + {type="weapon", subtype="battleaxe", autoreq=true}, + }, + combat_armor = 20, combat_def = 10, + resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, }, +} diff --git a/game/modules/tome/data/general/npcs/sandworm.lua b/game/modules/tome/data/general/npcs/sandworm.lua index 372262144ec97ff366b98883d7e626cfcfd60d62..dbac0e53b175dba6617d0bb10e2d98e6673705ed 100644 --- a/game/modules/tome/data/general/npcs/sandworm.lua +++ b/game/modules/tome/data/general/npcs/sandworm.lua @@ -26,6 +26,8 @@ newEntity{ level_range = {7, nil}, body = { INVEN = 10 }, + combat = { dam=resolvers.mbonus(25, 15), atk=15, apr=0, dammod={str=0.7} }, + infravision = 20, max_life = 40, life_rating = 5, max_stamina = 85, diff --git a/game/modules/tome/data/general/npcs/snow-giant.lua b/game/modules/tome/data/general/npcs/snow-giant.lua index e3e162e513157ea68565c690a5091436c17685ed..52c5941a3b2ae2b5aa7207e38e5abf89329e6504 100644 --- a/game/modules/tome/data/general/npcs/snow-giant.lua +++ b/game/modules/tome/data/general/npcs/snow-giant.lua @@ -24,7 +24,7 @@ newEntity{ type = "giant", subtype = "ice", display = "P", color=colors.WHITE, - combat = { dam=resolvers.rngavg(15,20), atk=15, apr=15, dammod={str=0.8} }, + combat = { dam=resolvers.mbonus(50, 10), atk=15, apr=15, dammod={str=0.8} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, resolvers.drops{chance=100, nb=1, {type="money"} }, diff --git a/game/modules/tome/data/general/npcs/spider.lua b/game/modules/tome/data/general/npcs/spider.lua index f2500e0a5ab51c8e9b6589ae209dff899ee9aaed..787411a50c902e8a276a26320b3bc42f7bc23d72 100644 --- a/game/modules/tome/data/general/npcs/spider.lua +++ b/game/modules/tome/data/general/npcs/spider.lua @@ -25,7 +25,7 @@ newEntity{ display = "S", color=colors.WHITE, desc = [[Arachnophobia...]], - combat = { dam=resolvers.rngavg(20,25), atk=16, apr=9, damtype=DamageType.NATURE, dammod={dex=1.2} }, + combat = { dam=resolvers.mbonus(40, 10), atk=16, apr=9, damtype=DamageType.NATURE, dammod={dex=1.2} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, diff --git a/game/modules/tome/data/general/npcs/troll.lua b/game/modules/tome/data/general/npcs/troll.lua index 9d7a20b80f0902df5b785a2e640f8c7d583e79ef..9fb60fe58ee834ac02cdb4fe4e0b03e82a14bcb4 100644 --- a/game/modules/tome/data/general/npcs/troll.lua +++ b/game/modules/tome/data/general/npcs/troll.lua @@ -24,7 +24,7 @@ newEntity{ type = "giant", subtype = "troll", display = "T", color=colors.UMBER, - combat = { dam=resolvers.rngavg(15,20), atk=2, apr=6, physspeed=2, dammod={str=0.8} }, + combat = { dam=resolvers.mbonus(45, 10), atk=2, apr=6, physspeed=2, dammod={str=0.8} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, resolvers.drops{chance=20, nb=1, {} }, diff --git a/game/modules/tome/data/general/npcs/vampire.lua b/game/modules/tome/data/general/npcs/vampire.lua index 952272e128e92a5bf1911eea043f58d8a168c99b..c88e4d0c34058631a80d89a29253abaff0439bfd 100644 --- a/game/modules/tome/data/general/npcs/vampire.lua +++ b/game/modules/tome/data/general/npcs/vampire.lua @@ -42,7 +42,7 @@ newEntity{ display = "V", color=colors.WHITE, desc = [[These ancient cursed beings often take upon the form of a bat and attack its prey.]], - combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINLIFE, dammod={str=1.9} }, + combat = { dam=resolvers.mbonus(30, 10), atk=10, apr=9, damtype=DamageType.DRAINLIFE, dammod={str=1.9} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, drops = resolvers.drops{chance=20, nb=1, {} }, diff --git a/game/modules/tome/data/general/npcs/wight.lua b/game/modules/tome/data/general/npcs/wight.lua index 208a341aad154442f62a558aa7c58245537a17a5..597566749a3d62ed31652d749caf461d9baa2fa0 100644 --- a/game/modules/tome/data/general/npcs/wight.lua +++ b/game/modules/tome/data/general/npcs/wight.lua @@ -33,7 +33,7 @@ newEntity{ display = "W", color=colors.WHITE, desc = [[These be white wights.]], - combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINEXP }, + combat = { dam=resolvers.mbonus(30, 10), atk=10, apr=9, damtype=DamageType.DRAINEXP }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, resolvers.drops{chance=20, nb=1, {ego_chance=20} }, diff --git a/game/modules/tome/data/general/npcs/xorn.lua b/game/modules/tome/data/general/npcs/xorn.lua index e6e694e83b0559a62873515230817ce05f56ddad..b13045bcd98e3636e7cf5a4130aeeb4f13998b12 100644 --- a/game/modules/tome/data/general/npcs/xorn.lua +++ b/game/modules/tome/data/general/npcs/xorn.lua @@ -24,7 +24,7 @@ newEntity{ type = "giant", subtype = "xorn", display = "X", color=colors.UMBER, - combat = { dam=resolvers.rngavg(15,20), atk=15, apr=15, dammod={str=0.8} }, + combat = { dam=resolvers.mbonus(46, 15), atk=15, apr=15, dammod={str=0.8} }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, resolvers.drops{chance=100, nb=1, {type="money"} }, diff --git a/game/modules/tome/data/zones/caverns-osse/npcs.lua b/game/modules/tome/data/zones/caverns-osse/npcs.lua index 8d737c1164a8b6eeb8c1e64ba314e67bb1b89d9b..cf44127c7ec3f54cd182ba92650934855d2fc8dc 100644 --- a/game/modules/tome/data/zones/caverns-osse/npcs.lua +++ b/game/modules/tome/data/zones/caverns-osse/npcs.lua @@ -17,8 +17,9 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -load("/data/general/npcs/aquatic_critter.lua", rarity(0)) -load("/data/general/npcs/aquatic_demon.lua", rarity(0)) +load("/data/general/npcs/aquatic_critter.lua", rarity(5)) +load("/data/general/npcs/aquatic_demon.lua", rarity(7)) +load("/data/general/npcs/naga.lua", rarity(0)) local Talents = require("engine.interface.ActorTalents") diff --git a/ideas/DLCs.ods b/ideas/DLCs.ods index 70c27ab77934f567264bb7a644fded28b7d46cf1..94fe5c7ee3959e66ccf6975670b4d7de3db26f63 100644 Binary files a/ideas/DLCs.ods and b/ideas/DLCs.ods differ diff --git a/ideas/actor-types.ods b/ideas/actor-types.ods index 9b44a45bbfad34fdcf320f2bc0ade22a05270734..7b2520eaed9d75f69ba157ffb6cd05ad895b675d 100644 Binary files a/ideas/actor-types.ods and b/ideas/actor-types.ods differ