Skip to content
Snippets Groups Projects
Commit e2ee83f0 authored by dg's avatar dg
Browse files

populate mount doom

git-svn-id: http://svn.net-core.org/repos/t-engine4@816 51575b47-30f0-44d4-a5cc-537603b46e54
parent 45ecc487
No related branches found
No related tags found
No related merge requests found
......@@ -30,32 +30,41 @@ function _M:init(text, dur, color)
w = w + 10
h = h + 15
self.dur = dur or 30
color = color or {r=0, g=0, b=0}
self.color = color or {r=0, g=0, b=0}
self.text = text
self.w = w
self.h = h
self:loaded()
end
--- Serialization
function _M:save()
return class.save(self, {
surface = true,
})
end
local s = core.display.newSurface(w, h)
function _M:loaded()
local s = core.display.newSurface(self.w, self.h)
if not s then return end
s:erase(0, 0, 0, 255)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/7.png"), 0, 0)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/9.png"), w - 6, 0)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/1.png"), 0, h - 10)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/3.png"), w - 6, h - 10)
for i = 6, w - 6 do
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/9.png"), self.w - 6, 0)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/1.png"), 0, self.h - 10)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/3.png"), self.w - 6, self.h - 10)
for i = 6, self.w - 6 do
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/8.png"), i, 0)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/2.png"), i, h - 10)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/2.png"), i, self.h - 10)
end
for i = 6, h - 10 do
for i = 6, self.h - 10 do
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/4.png"), 0, i)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/6.png"), w - 6, i)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "emote/6.png"), self.w - 6, i)
end
s:erase(255, 255, 255, 255, 6, 6, w - 6 - 6, h - 10 - 6)
s:erase(0, 0, 0, 0, 6, h - 4, w - 6, 4)
s:drawStringBlended(font, text, 5, 5, color.r, color.g, color.b)
s:erase(255, 255, 255, 255, 6, 6, self.w - 6 - 6, self.h - 10 - 6)
s:erase(0, 0, 0, 0, 6, self.h - 4, self.w - 6, 4)
self.text = text
self.w = w
self.h = h
s:drawStringBlended(font, self.text, 5, 5, self.color.r, self.color.g, self.color.b)
self.surface = s
end
......
......@@ -533,7 +533,7 @@ function _M:setupCommands()
self.key:addCommands{
[{"_d","ctrl"}] = function()
if config.settings.tome.cheat then
self.player:setEmote(require("engine.Emote").new("Hello World!", 100))
self.player:forceLevelup(50)
-- self:changeLevel(1, "wilderness-arda-fareast")
end
end,
......
......@@ -20,6 +20,7 @@
require "engine.class"
local ActorAI = require "engine.interface.ActorAI"
local Faction = require "engine.Faction"
local Emote = require("engine.Emote")
require "mod.class.Actor"
module(..., package.seeall, class.inherit(mod.class.Actor, engine.interface.ActorAI))
......@@ -43,6 +44,11 @@ function _M:act()
-- Let the AI think .... beware of Shub !
-- If AI did nothing, use energy anyway
self:doAI()
if self.emote_random and rng.percent(self.emote_random.chance) then
self:doEmote(rng.table(self.emote_random))
end
if not self.energy.used then self:useEnergy() end
end
......@@ -120,3 +126,14 @@ UID: %d]]):format(
self.ai_target.actor and self.ai_target.actor.name or "none",
self.uid)
end
--- Make emotes appear in the log too
function _M:setEmote(e)
game.logSeen(self, "%s says: '%s'", self.name:capitalize(), e.text)
mod.class.Actor.setEmote(self, e)
end
--- Simple emote
function _M:doEmote(text, dur, color)
self:setEmote(Emote.new(text, dur, color))
end
......@@ -57,6 +57,11 @@ function _M:display()
h = h + self.font_h
if game.level and game.level.turn_counter then
self.surface:drawColorString(self.font, ("Turns remaining: %d"):format(game.level.turn_counter / 10), 0, h, 255, 0, 0) h = h + self.font_h
h = h + self.font_h
end
if game.player:getAir() < game.player.max_air then
self.surface:drawColorString(self.font, ("Air level: %d/%d"):format(game.player:getAir(), game.player.max_air), 0, h, 255, 0, 0) h = h + self.font_h
h = h + self.font_h
......
......@@ -33,6 +33,8 @@ function _M:init(zone, map, level, spots)
end
function _M:tick()
if self.level.nb_attackers >= self.data.max_attackers then return end
local val = rng.float(0,1)
for i = 1,self.max_rate - 1 do
if val < rng.poissonProcess(i, self.turn_scale, self.rate) then
......
......@@ -63,6 +63,10 @@ Autolevel:registerScheme{ name = "warriormage", levelup = function(self)
learnStats(self, { self.STAT_MAG, self.STAT_MAG, self.STAT_WIL, self.STAT_STR, self.STAT_STR, self.STAT_DEX })
end}
Autolevel:registerScheme{ name = "dexmage", levelup = function(self)
learnStats(self, { self.STAT_MAG, self.STAT_MAG, self.STAT_DEX, self.STAT_DEX })
end}
Autolevel:registerScheme{ name = "snake", levelup = function(self)
learnStats(self, { self.STAT_CUN, self.STAT_DEX, self.STAT_CON, self.STAT_CUN, self.STAT_DEX, self.STAT_STR })
end}
......
-- 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_FAEROS",
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 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
infravision = 20,
life_rating = 8,
rank = 2,
size_category = 3,
autolevel = "dexmage",
ai = "dumb_talented_simple", ai_state = { talent_in=2, },
energy = { mod=1 },
stats = { str=10, dex=8, mag=6, con=16 },
resists = { [DamageType.PHYSICAL] = 10, [DamageType.FIRE] = 100, },
no_breath = 1,
poison_immune = 1,
desease_immune = 1,
}
newEntity{ base = "BASE_NPC_FAEROS",
name = "faeros", color=colors.ORANGE,
desc = [[Faeros are highly intelligent fire elementals, rarely seen outside volcanos they are probably not native to this world.]],
level_range = {20, nil}, exp_worth = 1,
rarity = 7,
max_life = resolvers.rngavg(70,80),
combat_armor = 0, combat_def = 20,
on_melee_hit = { [DamageType.FIRE] = resolvers.mbonus(20, 10), },
resolvers.talents{
[Talents.T_FLAME]=3,
},
}
newEntity{ base = "BASE_NPC_FAEROS",
name = "greater faeros", color=colors.ORANGE,
desc = [[Faeros are highly intelligent fire elementals, rarely seen outside volcanos they are probably not native to this world.]],
level_range = {25, nil}, exp_worth = 1,
rarity = 9,
max_life = resolvers.rngavg(70,80), life_rating = 10,
combat_armor = 0, combat_def = 20,
on_melee_hit = { [DamageType.FIRE] = resolvers.mbonus(20, 10), },
resolvers.talents{
[Talents.T_FLAME]=4,
[Talents.T_FIERY_HANDS]=3,
},
}
newEntity{ base = "BASE_NPC_FAEROS",
name = "ultimate faeros", color=colors.ORANGE,
desc = [[Faeros are highly intelligent fire elementals, rarely seen outside volcanos they are probably not native to this world.]],
level_range = {35, nil}, exp_worth = 1,
rarity = 12,
rank = 3,
max_life = resolvers.rngavg(70,80),
combat_armor = 0, combat_def = 20,
on_melee_hit = { [DamageType.FIRE] = resolvers.mbonus(20, 10), },
resolvers.talents{
[Talents.T_FLAME]=4,
[Talents.T_FIERY_HANDS]=3,
[Talents.T_FLAMESHOCK]=3,
[Talents.T_INFERNO]=3,
},
}
-- 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_FIRE_DRAKE",
type = "dragon", subtype = "fire",
display = "D", color=colors.WHITE,
combat = { dam=resolvers.rngavg(25,30), atk=15, apr=25, dammod={str=1} },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
resolvers.drops{chance=100, nb=1, {type="money"} },
infravision = 20,
life_rating = 15,
rank = 2,
size_category = 5,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=2, },
energy = { mod=1 },
stats = { str=20, dex=20, mag=30, con=16 },
resists = { [DamageType.FIRE] = 100, },
knockback_immune = 1,
stun_immune = 1,
}
newEntity{ base = "BASE_NPC_FIRE_DRAKE",
name = "fire drake hatchling", color=colors.RED, display="d",
desc = [[A drake hatchling, not too powerful in itself, but it usually comes with its brothers and sisters.]],
level_range = {8, nil}, exp_worth = 1,
rarity = 7,
rank = 1, size_category = 2,
max_life = resolvers.rngavg(40,60),
combat_armor = 5, combat_def = 0,
on_melee_hit = {[DamageType.FIRE]=resolvers.mbonus(7, 2)},
combat = { dam=resolvers.rngavg(10,15), atk=15, apr=5, dammod={str=0.6} },
make_escort = {
{type="dragon", subtype="fire", name="fire drake hatchling", number=3, no_subescort=true},
},
}
newEntity{ base = "BASE_NPC_FIRE_DRAKE",
name = "fire drake", color=colors.RED, display="D",
desc = [[A mature fire drake, armed with a deadly breath weapon and nasty claws.]],
level_range = {14, nil}, exp_worth = 1,
rarity = 8,
max_life = resolvers.rngavg(100,110),
combat_armor = 12, combat_def = 0,
on_melee_hit = {[DamageType.FIRE]=resolvers.mbonus(15, 10)},
resolvers.talents{
[Talents.T_WING_BUFFET]=2,
[Talents.T_FIRE_BREATH]=3,
},
}
newEntity{ base = "BASE_NPC_FIRE_DRAKE",
name = "fire wyrm", color=colors.LIGHT_RED, display="D",
desc = [[An old and powerful fire drake, armed with a deadly breath weapon and nasty claws.]],
level_range = {25, nil}, exp_worth = 1,
rarity = 12,
rank = 3,
max_life = resolvers.rngavg(170,190),
combat_armor = 30, combat_def = 0,
on_melee_hit = {[DamageType.FIRE]=resolvers.mbonus(25, 10)},
combat = { dam=resolvers.rngavg(25,40), atk=25, apr=25, dammod={str=1.1} },
resolvers.talents{
[Talents.T_WING_BUFFET]=5,
[Talents.T_FLAME]=5,
[Talents.T_FIRE_BREATH]=5,
[Talents.T_DEVOURING_FLAME]=3,
},
}
......@@ -21,7 +21,8 @@ defineTile("'", "LAVA_FLOOR")
defineTile('~', "LAVA")
defineTile('#', "LAVA_WALL")
defineTile(' ', "FLOOR")
defineTile('@', "FLOOR", nil, "SUN_PALADIN_DEFENDER")
defineTile('p', "FLOOR", nil, "SUN_PALADIN_DEFENDER")
defineTile('@', "FLOOR", nil, "SUN_PALADIN_DEFENDER_RODMOUR")
defineTile('o', "FLOOR", nil, "URUK-HAI_ATTACK")
subGenerator{
......@@ -49,18 +50,18 @@ return [[
# #
## #
### ##
###@@@@@# ##
###pp@pp# ##
## ####
### ####
## ####
### ###
### ####
#### #####
#####'######
####'#'#####
#####'######
####'''#####
####'''#####
####'''#####
####'''#####
####'''#####
####'#######
####'''#####
#####'''####
............
......
......@@ -17,11 +17,10 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
load("/data/general/npcs/rodent.lua")
load("/data/general/npcs/vermin.lua")
load("/data/general/npcs/molds.lua")
load("/data/general/npcs/skeleton.lua")
load("/data/general/npcs/snake.lua")
load("/data/general/npcs/faeros.lua")
load("/data/general/npcs/fire_elemental.lua")
load("/data/general/npcs/molten_golem.lua")
load("/data/general/npcs/fire-drake.lua")
local Talents = require("engine.interface.ActorTalents")
......@@ -77,6 +76,36 @@ newEntity{ base = "BASE_NPC_SUNWALL_DEFENDER", define_as = "SUN_PALADIN_DEFENDER
end,
}
newEntity{ base = "BASE_NPC_SUNWALL_DEFENDER", define_as = "SUN_PALADIN_DEFENDER_RODMOUR",
name = "High Sun-Paladin Rodmour", color=colors.VIOLET,
desc = [[A human in a shiny plate armour.]],
level_range = {70, nil}, exp_worth = 1,
rank = 3,
positive_regen = 10,
life_regen = 5,
max_life = resolvers.rngavg(240,270),
resolvers.equip{
{type="weapon", subtype="mace", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
{type="armor", subtype="massive", autoreq=true},
},
resolvers.talents{
[Talents.T_MASSIVE_ARMOUR_TRAINING]=5,
[Talents.T_CHANT_OF_FORTRESS]=5,
[Talents.T_SEARING_LIGHT]=5,
[Talents.T_MARTYRDOM]=5,
[Talents.T_WEAPON_OF_LIGHT]=5,
[Talents.T_FIREBEAM]=5,
[Talents.T_WEAPON_COMBAT]=10,
[Talents.T_HEALING_LIGHT]=5,
},
on_added = function(self)
self.energy.value = game.energy_to_act self:useTalent(self.T_WEAPON_OF_LIGHT)
self.energy.value = game.energy_to_act self:useTalent(self.T_CHANT_OF_FORTRESS)
self:doEmote("Go "..game.player.name.."! We will hold the line!", 150)
end,
}
newEntity{
define_as = "BASE_NPC_ORC_ATTACKER",
type = "humanoid", subtype = "orc",
......@@ -105,7 +134,6 @@ newEntity{ base = "BASE_NPC_ORC_ATTACKER", define_as = "URUK-HAI_ATTACK",
name = "uruk-hai", color=colors.DARK_RED,
desc = [[A fierce soldier-orc.]],
level_range = {42, nil}, exp_worth = 1,
rarity = 6,
max_life = resolvers.rngavg(120,140),
life_rating = 8,
resolvers.equip{
......@@ -118,4 +146,10 @@ newEntity{ base = "BASE_NPC_ORC_ATTACKER", define_as = "URUK-HAI_ATTACK",
[Talents.T_RUSH]=4,
[Talents.T_WEAPON_COMBAT]=4,
},
on_added = function(self)
game.level.nb_attackers = (game.level.nb_attackers or 0) + 1
end,
on_die = function(self)
game.level.nb_attackers = game.level.nb_attackers - 1
end,
}
......@@ -21,15 +21,15 @@ return {
name = "Mount Doom",
level_range = {30, 35},
level_scheme = "player",
max_level = 3,
max_level = 1,
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 = 12, height = 500,
all_remembered = true,
-- all_remembered = true,
all_lited = true,
-- persistant = "zone",
no_level_connectivity = true,
ambiant_music = "a_lomos_del_dragon_blanco.ogg",
ambiant_music = "Hold the Line.ogg",
generator = {
map = {
class = "engine.generator.map.Static",
......@@ -37,12 +37,10 @@ return {
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {0, 0},
area = {x1=0, x2=11, y1=30, y2=410},
nb_npc = {30, 30},
rate = 0.25,
},
object = {
class = "engine.generator.object.Random",
nb_object = {6, 9},
max_attackers = 12,
},
trap = {
class = "engine.generator.trap.Random",
......@@ -50,7 +48,11 @@ return {
},
},
post_process = function(level)
level.turn_counter = 700 * 10
end,
on_turn = function(self)
require("mod.class.generator.actor.MountDoom").new(self, game.level.map, game.level, {}):tick()
game.level.turn_counter = game.level.turn_counter - 1
end,
}
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment