diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 193c9b1d72d1aa82c16128f6d1ed777d86090d47..0a2ac1766a042b2687396073c33b35abb1cf2ddc 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -475,7 +475,7 @@ function _M:setupCommands() self.player.esp.all = 1 self.player.esp.range = 50 self.player.inc_damage.all = 100000 - self:changeLevel(2, "rak-shor-pride") + self:changeLevel(2, "caverns-osse") -- self:changeLevel(1, "town-gates-of-morning") -- self:changeLevel(1, "wilderness-arda-fareast") -- game.memory_levels["wilderness-arda-fareast-1"] = game.level diff --git a/game/modules/tome/class/Grid.lua b/game/modules/tome/class/Grid.lua index a9a2091e5ce2bcf3b15b8a8502275d5933894d57..26b354956627c1bffc93da3b05f84b616edce550 100644 --- a/game/modules/tome/class/Grid.lua +++ b/game/modules/tome/class/Grid.lua @@ -76,7 +76,6 @@ function _M:tooltip() end end - --- Generate sub entities to make nice trees function _M:makeTrees(base, max) local function makeTree(nb, z) @@ -105,6 +104,34 @@ function _M:makeTrees(base, max) return tbl end +--- Generate sub entities to make nice shells +function _M:makeShells(base, max) + local function makeShell(nb, z) + local inb = 4 - nb + return engine.Entity.new{ + z = z, + display_scale = rng.float(0.1 + inb / 6, 0.2), + display_x = rng.range(-engine.Map.tile_w / 3 * nb / 3, engine.Map.tile_w / 3 * nb / 3), + display_y = rng.range(-engine.Map.tile_h / 3 * nb / 3, engine.Map.tile_h / 3 * nb / 3), + display_on_seen = true, + display_on_remember = true, + image = (base or "terrain/tree_alpha")..rng.range(1,max or 5)..".png", + } + end + + local v = rng.range(0, 100) + local tbl + if v < 33 then + return nil + elseif v < 66 then + tbl = { makeShell(2, 2), makeShell(2, 3), } + else + tbl = { makeShell(1, 2), } + end + table.sort(tbl, function(a,b) return a.display_y < b.display_y end) + return tbl +end + --- Generate sub entities to make translucent water function _M:makeWater(z) return { engine.Entity.new{ @@ -115,3 +142,14 @@ function _M:makeWater(z) display_on_remember = true, } } end + +--- Merge sub entities +function _M:mergeSubEntities(...) + local tbl = {} + for i, t in ipairs{...} do if t then + for j, e in ipairs(t) do + tbl[#tbl+1] = e + end + end end + return tbl +end diff --git a/game/modules/tome/data/general/grids/water.lua b/game/modules/tome/data/general/grids/water.lua index 5f6aa529887136e8bb204d7e3b80ff9db92d158c..025327d297f670c766a9e3fae9bf5ce21aa163b8 100644 --- a/game/modules/tome/data/general/grids/water.lua +++ b/game/modules/tome/data/general/grids/water.lua @@ -28,6 +28,15 @@ newEntity{ add_displays = class:makeWater(true), air_level = -5, air_condition="water", } +for i = 2, 20 do +newEntity{ + define_as = "WATER_FLOOR"..i, + name = "underwater", image = "terrain/water_floor.png", + display = '.', color=colors.LIGHT_BLUE, back_color=colors.DARK_BLUE, + add_displays = class:mergeSubEntities(class:makeWater(true), class:makeShells("terrain/shell")), + air_level = -5, air_condition="water", +} +end newEntity{ define_as = "WATER_WALL", diff --git a/game/modules/tome/data/gfx/object/trident_orihalcum.png b/game/modules/tome/data/gfx/object/trident_orichalcum.png similarity index 100% rename from game/modules/tome/data/gfx/object/trident_orihalcum.png rename to game/modules/tome/data/gfx/object/trident_orichalcum.png diff --git a/game/modules/tome/data/gfx/terrain/shell1.png b/game/modules/tome/data/gfx/terrain/shell1.png new file mode 100644 index 0000000000000000000000000000000000000000..2cba11422766d324540fef91dbc43509bacd22cc Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell1.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell2.png b/game/modules/tome/data/gfx/terrain/shell2.png new file mode 100644 index 0000000000000000000000000000000000000000..194dbaa382cc9f0717f30b374852419e728803a4 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell2.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell3.png b/game/modules/tome/data/gfx/terrain/shell3.png new file mode 100644 index 0000000000000000000000000000000000000000..3e92573e0a31cefd5ed1187106dbd11842c84628 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell3.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell4.png b/game/modules/tome/data/gfx/terrain/shell4.png new file mode 100644 index 0000000000000000000000000000000000000000..4295400d7777d9242ff1abd3bf8e38e5c0d35bb9 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell4.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell5.png b/game/modules/tome/data/gfx/terrain/shell5.png new file mode 100644 index 0000000000000000000000000000000000000000..4295400d7777d9242ff1abd3bf8e38e5c0d35bb9 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell5.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell6.png b/game/modules/tome/data/gfx/terrain/shell6.png new file mode 100644 index 0000000000000000000000000000000000000000..c1788877f819fe9af00e07a165885facc58a0485 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell6.png differ diff --git a/game/modules/tome/data/gfx/terrain/shell6e.png b/game/modules/tome/data/gfx/terrain/shell6e.png new file mode 100644 index 0000000000000000000000000000000000000000..0bcaf47ebcf7117a61fa3124d1a079e1d1febcbd Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/shell6e.png differ diff --git a/game/modules/tome/data/gfx/terrain/water_wall1.png b/game/modules/tome/data/gfx/terrain/water_wall1.png new file mode 100644 index 0000000000000000000000000000000000000000..834863e133ea39daeadef228da2eae0a05db084c Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/water_wall1.png differ diff --git a/game/modules/tome/data/zones/caverns-osse/zone.lua b/game/modules/tome/data/zones/caverns-osse/zone.lua index b965befde37b01b7927bdacfa8d49f9e0b502966..8d096d90e1fc01164133207820a24c47fa0d25ab 100644 --- a/game/modules/tome/data/zones/caverns-osse/zone.lua +++ b/game/modules/tome/data/zones/caverns-osse/zone.lua @@ -37,7 +37,7 @@ return { class = "engine.generator.map.Cavern", zoom = 16, min_floor = 1200, - floor = "WATER_FLOOR", + floor = {"WATER_FLOOR","WATER_FLOOR2","WATER_FLOOR3","WATER_FLOOR4","WATER_FLOOR5","WATER_FLOOR6","WATER_FLOOR7","WATER_FLOOR8","WATER_FLOOR9","WATER_FLOOR10","WATER_FLOOR11","WATER_FLOOR12","WATER_FLOOR13","WATER_FLOOR14","WATER_FLOOR15","WATER_FLOOR16","WATER_FLOOR17","WATER_FLOOR18","WATER_FLOOR19","WATER_FLOOR20",}, wall = "WATER_WALL", up = "UP", down = "DOWN", diff --git a/game/modules/tome/data/zones/gorbat-pride/grids.lua b/game/modules/tome/data/zones/gorbat-pride/grids.lua new file mode 100644 index 0000000000000000000000000000000000000000..17d13d0604094de870b55cca229193a50d5ac0a8 --- /dev/null +++ b/game/modules/tome/data/zones/gorbat-pride/grids.lua @@ -0,0 +1,22 @@ +-- 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 + +load("/data/general/grids/basic.lua") +load("/data/general/grids/forest.lua") +load("/data/general/grids/water.lua") diff --git a/game/modules/tome/data/zones/gorbat-pride/npcs.lua b/game/modules/tome/data/zones/gorbat-pride/npcs.lua new file mode 100644 index 0000000000000000000000000000000000000000..a1b24baa295bca602a8cc18d05a26234d3b4eb2c --- /dev/null +++ b/game/modules/tome/data/zones/gorbat-pride/npcs.lua @@ -0,0 +1,83 @@ +-- 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 + +load("/data/general/npcs/orc.lua", rarity(3)) +load("/data/general/npcs/orc-vor.lua", rarity(0)) + +load("/data/general/npcs/all.lua", rarity(4, 35)) + +local Talents = require("engine.interface.ActorTalents") + +newEntity{ base="BASE_NPC_ORC_VOR", define_as = "VOR", + name = "Vor, Grand Geomancer of the Pride", color=colors.VIOLET, unique = true, + desc = [[An old orc, wearing multi-colored robes. Ice shards fly around him, leaving a trail of fire and lightning bursts.]], + level_range = {40, 50}, exp_worth = 2, + rank = 5, + max_life = 250, life_rating = 19, fixed_rating = true, + infravision = 20, + stats = { str=12, dex=10, cun=12, mag=21, con=14 }, + move_others=true, + + combat_armor = 10, combat_def = 10, + + open_door = true, + + autolevel = "caster", + ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar", }, + + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, HEAD=1 }, + + resolvers.equip{ + {type="weapon", subtype="staff", ego_change=100, autoreq=true}, + {type="armor", subtype="cloth", ego_change=100, autoreq=true}, + {type="armor", subtype="head", defined="CROWN_ELEMENTS", autoreq=true}, + }, + resolvers.drops{chance=100, nb=1, {defined="ORB_ELEMENTS"} }, + resolvers.drops{chance=100, nb=5, {ego_chance=100} }, + + resolvers.talents{ + [Talents.T_FLAME]=5, + [Talents.T_FLAMESHOCK]=5, + [Talents.T_FIREFLASH]=5, + [Talents.T_INFERNO]=5, + [Talents.T_BLASTWAVE]=5, + [Talents.T_DANCING_FIRES]=5, + [Talents.T_COMBUST]=5, + + [Talents.T_FREEZE]=5, + [Talents.T_ICE_STORM]=5, + [Talents.T_TIDAL_WAVE]=5, + [Talents.T_ICE_SHARDS]=5, + [Talents.T_FROZEN_GROUND]=5, + + [Talents.T_LIGHTNING]=5, + [Talents.T_CHAIN_LIGHTNING]=5, + + [Talents.T_SPELL_SHAPING]=5, + [Talents.T_ESSENCE_OF_SPEED]=1, + }, + resolvers.sustains_at_birth(), + + on_die = function(self, who) + game.player:resolveSource():setQuestStatus("orc-pride", engine.Quest.COMPLETED, "vor") + if not game.player:hasQuest("pre-mount-doom") then + game.player:grantQuest("pre-mount-doom") + end + end, +} diff --git a/game/modules/tome/data/zones/gorbat-pride/objects.lua b/game/modules/tome/data/zones/gorbat-pride/objects.lua new file mode 100644 index 0000000000000000000000000000000000000000..329ad261d6774f1c36d77b2715fb724d4ea7de81 --- /dev/null +++ b/game/modules/tome/data/zones/gorbat-pride/objects.lua @@ -0,0 +1,98 @@ +-- 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 + +load("/data/general/objects/objects.lua") + +local Stats = require"engine.interface.ActorStats" + + +newEntity{ base = "BASE_LEATHER_CAP", + define_as = "CROWN_ELEMENTS", rarity=false, + name = "Crown of the Elements", unique=true, + unided_name = "jeweled crown", color=colors.DARK_GREY, + desc = [[Jeweled crown]], + cost = 500, + material_level = 5, + wielder = { + inc_stats = { [Stats.STAT_CON] = 5, [Stats.STAT_WIL] = 3, }, + resists={ + [DamageType.FIRE] = 15, + [DamageType.COLD] = 15, + [DamageType.ACID] = 15, + [DamageType.LIGHTNING] = 15, + }, + melee_project={ + [DamageType.FIRE] = 10, + [DamageType.COLD] = 10, + [DamageType.ACID] = 10, + [DamageType.LIGHTNING] = 10, + }, + see_invisible = 15, + combat_armor = 5, + fatigue = 5, + }, +} + +-- Artifact, randomly dropped in Vor Pride, and only there +newEntity{ base = "BASE_SCROLL", subtype="tome", + name = "Tome of Wildfire", unided_name = "burning book", unique=true, + color = colors.VIOLET, + level_range = {35, 45}, + rarity = 200, + cost = 100, + + use_simple = { name="learn the ancient secrets", use = function(self, who) + if not who:knowTalent(who.T_FLAME) then + who:learnTalent(who.T_FLAME, true, 3) + game.logPlayer(who, "#00FFFF#You read the tome and learn about ancient forgotten fire magic!") + else + who.talents_types_mastery["spell/fire"] = (who.talents_types_mastery["spell/fire"] or 1) + 0.1 + who.talents_types_mastery["spell/wildfire"] = (who.talents_types_mastery["spell/wildfire"] or 1) + 0.1 + game.logPlayer(who, "#00FFFF#You read the tome and perfect your mastery of fire magic!") + end + + game:setAllowedBuild("mage_pyromancer", true) + + return "destroy", true + end} +} + +-- Artifact, randomly dropped in Vor Pride, and only there +newEntity{ base = "BASE_SCROLL", subtype="tome", + name = "Tome of Uttercold", unided_name = "frozen book", unique=true, + color = colors.VIOLET, + level_range = {35, 45}, + rarity = 200, + cost = 100, + + use_simple = { name="learn the ancient secrets", use = function(self, who) + if not who:knowTalent(who.T_ICE_STORM) then + who:learnTalent(who.T_ICE_STORM, true, 3) + game.logPlayer(who, "#00FFFF#You read the tome and learn about ancient forgotten ice magic!") + else + who.talents_types_mastery["spell/water"] = (who.talents_types_mastery["spell/water"] or 1) + 0.1 + who.talents_types_mastery["spell/ice"] = (who.talents_types_mastery["spell/ice"] or 1) + 0.1 + game.logPlayer(who, "#00FFFF#You read the tome and perfect your mastery of ice magic!") + end + + game:setAllowedBuild("mage_cryomancer", true) + + return "destroy", true + end} +} diff --git a/game/modules/tome/data/zones/gorbat-pride/zone.lua b/game/modules/tome/data/zones/gorbat-pride/zone.lua new file mode 100644 index 0000000000000000000000000000000000000000..fc9c9eca2d3c9f0d6a83d7bd703dc5ba50465182 --- /dev/null +++ b/game/modules/tome/data/zones/gorbat-pride/zone.lua @@ -0,0 +1,66 @@ +-- 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 + +return { + name = "Gorbat Pride", + level_range = {35, 40}, + level_scheme = "player", + max_level = 5, + decay = {300, 800}, + actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end, + width = 50, height = 50, + persistent = "zone", +-- all_remembered = true, + all_lited = true, + ambiant_music = "Breaking the siege.ogg", + generator = { + map = { + class = "engine.generator.map.Town", + building_chance = 70, + max_building_w = 8, max_building_h = 8, + edge_entrances = {6,4}, + floor = "FLOOR", + external_floor = "FLOOR", + wall = "WALL", + up = "UP", + down = "DOWN", + door = "DOOR", + }, + actor = { + class = "engine.generator.actor.Random", + nb_npc = {20, 30}, + guardian = "GORBAT", + }, + object = { + class = "engine.generator.object.Random", + nb_object = {3, 6}, + }, + }, + post_process = function(level) + for uid, e in pairs(level.entities) do e.faction="orc-pride" end + end, + levels = + { + [1] = { + generator = { map = { + up = "UP_WILDERNESS_FAR_EAST", + }, }, + }, + }, +}