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

New achievements for many events

New events


git-svn-id: http://svn.net-core.org/repos/t-engine4@5319 51575b47-30f0-44d4-a5cc-537603b46e54
parent f09b0cca
No related branches found
No related tags found
No related merge requests found
Showing
with 88 additions and 15 deletions
......@@ -88,7 +88,7 @@ function _M:get(char, fr, fg, fb, br, bg, bb, image, alpha, do_outline, allow_ti
else
local s, sw, sh
local is_image = false
if (self.use_images or not dochar) and image then
if (self.use_images or not dochar) and image and #image > 4 then
if allow_tileset and self.texture then
local ts, fx, fy, tsx, tsy = self:checkTileset(self.prefix..image)
if ts then
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
newAchievement{
name = "The sky is falling!", id = "EVENT_METEOR",
show = "name",
desc = [[See a huge meteor falling down the sky.]],
}
newAchievement{
name = "Demonic Invasion", id = "EVENT_FEARSCAPE",
show = "name",
desc = [[Stop a demonic invasion by closing their portal.]],
}
newAchievement{
name = "Invasion from the Depths", id = "EVENT_NAGA",
show = "name",
desc = [[Stop a naga invasion by closing their portal.]],
}
newAchievement{
name = "The Restless Dead", id = "EVENT_OLDBATTLEFIELD",
show = "name",
desc = [[Disturb an old battle field and survive the consequences.]],
}
newAchievement{
name = "The Rat Lich", id = "EVENT_RATLICH",
show = "name",
desc = [[Killed the terrible Rat Lich]],
}
newAchievement{
name = "Shasshhiy'Kaish", id = "EVENT_CULTISTS",
show = "name",
desc = [[Killed Shasshhiy'Kaish after letting her grow as powerful as possible.]],
}
newAchievement{
name = "Bringer of Doom", id = "EVENT_PEDESTALS",
show = "name",
desc = [[Killed a Bringer of Doom.]],
}
......@@ -111,8 +111,8 @@ for i, p in ipairs(list) do
if not game.level.turn_counter then
game.level.event_cultists.queen_x = self.monolith_x
game.level.event_cultists.queen_y = self.monolith_y
game.level.turn_counter = 10 * 150
game.level.max_turn_counter = 10 * 150
game.level.turn_counter = 10 * 210
game.level.max_turn_counter = 10 * 210
require("engine.ui.Dialog"):simplePopup("Cultist", "The cultist soul seems to be absorbed by the strange stone he was guarding. You feel like something is about to happen...")
end
end,
......@@ -135,6 +135,8 @@ game.zone.on_turn = function()
if game.level.turn_counter < 0 then
game.level.turn_counter = nil
local scale = (7 - game.level.event_cultists.kill) / 6
local m = mod.class.NPC.new{
type = "demon", subtype = "major",
display = 'U',
......@@ -168,7 +170,7 @@ game.zone.on_turn = function()
combat = { dam=resolvers.levelup(resolvers.mbonus(86, 20), 1, 1.4), atk=50, apr=30, dammod={str=1.1} },
resolvers.drops{chance=100, nb=5, {tome_drops="boss"} },
resolvers.drops{chance=100, nb=math.ceil(5 * scale), {tome_drops="boss"} },
resolvers.talents{
[Talents.T_METEOR_RAIN]={base=4, every=5, max=7},
......@@ -183,9 +185,11 @@ game.zone.on_turn = function()
inc_damage = {all=90},
}
if game.level.event_cultists.kill == 1 then
m.on_die = function(self) world:gainAchievement("EVENT_CULTISTS", game:getPlayer(true)) end
end
m:resolve() m:resolve(nil, true)
local scale = (7 - game.level.event_cultists.kill) / 6
local o = mod.class.Object.new{
define_as = "METEORIC_CROWN",
slot = "HEAD",
......@@ -225,14 +229,14 @@ game.zone.on_turn = function()
game.zone:addEntity(game.level, o, "object")
m:addObject(m:getInven("INVEN"), o)
game.zone:addEntity(game.level, m, "actor", x, y)
require("engine.ui.Dialog"):simplePopup("Cultist", "A terrible shout thunders across the level: 'Come my darling, come, I will be ssssooo *nice* to you!'")
game.zone:addEntity(game.level, m, "actor", x, y)
require("engine.ui.Dialog"):simpleLongPopup("Cultist", "A terrible shout thunders across the level: 'Come my darling, come, I will be ssssooo *nice* to you!'\nYou should flee from this level!", 400)
end
elseif game.level.turn_counter == 10 * 130 or
game.level.turn_counter == 10 * 110 or
elseif game.level.turn_counter == 10 * 180 or
game.level.turn_counter == 10 * 150 or
game.level.turn_counter == 10 * 120 or
game.level.turn_counter == 10 * 90 or
game.level.turn_counter == 10 * 70 or
game.level.turn_counter == 10 * 50 or
game.level.turn_counter == 10 * 60 or
game.level.turn_counter == 10 * 30 then
local cultists = {}
for uid, e in pairs(game.level.entities) do if e.is_cultist_event then cultists[#cultists+1] = e end end
......
......@@ -68,7 +68,7 @@ local changer = function(id)
actor = {
class = "mod.class.generator.actor.Random",
nb_npc = {12, 12},
guardian = {random_elite={life_rating=function(v) return v * 1.5 + 4 end, nb_rares=4, name_scheme="#rng# the Invader"}},
guardian = {random_elite={life_rating=function(v) return v * 1.5 + 4 end, nb_rares=4, name_scheme="#rng# the Invader", on_die=function(self) world:gainAchievement("EVENT_FEARSCAPE", game:getPlayer(true)) end}},
},
object = {
class = "engine.generator.object.Random",
......
......@@ -84,6 +84,7 @@ game.zone.on_turn = function()
game.nicer_tiles:updateAround(game.level, i, j)
end end
world:gainAchievement("EVENT_METEOR", game:getPlayer(true))
require("engine.ui.Dialog"):simplePopup("Meteor!", "As you walk you notice a huge rock falling from the sky, it crashes right near you!")
end
end
......
......@@ -75,7 +75,7 @@ local changer = function(id)
actor = {
class = "mod.class.generator.actor.Random",
nb_npc = {12, 12},
guardian = {random_elite={life_rating=function(v) return v * 1.5 + 4 end, nb_rares=4, name_scheme="#rng# the Tidebender"}},
guardian = {random_elite={life_rating=function(v) return v * 1.5 + 4 end, nb_rares=4, name_scheme="#rng# the Tidebender", on_die=function(self) world:gainAchievement("EVENT_NAGA", game:getPlayer(true)) end}},
},
object = {
class = "engine.generator.object.Random",
......
......@@ -90,6 +90,7 @@ if tries < 100 then
nb = nb - 1
end
world:gainAchievement("EVENT_OLDBATTLEFIELD", game:getPlayer(true))
require("engine.ui.Dialog"):simpleLongPopup("Onslaught", "You have survived the onslaught of undeads, you notice a way to climb up you had not seen before in a wall nearby.", 400)
elseif game.level.turn_counter % 50 == 0 then
for i = 1, math.floor(game.level.nb_pop) do
......
......@@ -99,6 +99,7 @@ for i = 1, 3 do
loot_quantity = 0,
no_loot_randart = true,
name_scheme = "#rng# the Bringer of Doom",
on_die = function(self) world:gainAchievement("EVENT_PEDESTALS", game:getPlayer(true)) end,
}}, nil, true)
local i, j = util.findFreeGrid(x, y, 5, true, {[engine.Map.ACTOR]=true})
if i then
......
......@@ -204,7 +204,7 @@ newEntity{ base = "BASE_NPC_UNDEAD_RAT", define_as="RATLICH",
combat_spellpower = resolvers.mbonus(20, 10),
combat_spellcrit = resolvers.mbonus(5, 5),
combat_mindpower = resolvers.mbonus(20, 10),
combat_mindcrit = resolvers.mbonus(5, 5),
......@@ -260,11 +260,13 @@ newEntity{ base = "BASE_NPC_UNDEAD_RAT", define_as="RATLICH",
[Talents.T_FEAR_THE_NIGHT]={base=2, every=7, max=5},
--Anorithil
[Talents.T_MOONLIGHT_RAY]={base=2, every=6, max=7},
[Talents.T_SHADOW_BLAST]={base=1, every=7, max=5},
[Talents.T_SHADOW_BLAST]={base=1, every=7, max=5},
},
resolvers.sustains_at_birth(),
resolvers.drops{chance=100, nb=3, {tome_drops="boss"} },
resolvers.drops{chance=100, nb=1, {defined="RATLICH_SKULL"} },
emote_random = {chance=1, "*squeak*", "Squeak!", "Squeak??", "SQUEAK!!!!!", '"Squeak" I say, yes .. "Squeak!"'},
on_die = function(self) world:gainAchievement("EVENT_RATLICH", game:getPlayer(true)) end,
}
......@@ -19,4 +19,5 @@
return { one_per_level=true,
{group="majeyal-generic"},
{name="cultists", percent=10},
}
......@@ -21,4 +21,5 @@ return { one_per_level=true,
{group="outdoor-majeyal-gloomy"},
{group="outdoor-majeyal-generic"},
{group="majeyal-generic"},
{name="cultists", percent=10},
}
......@@ -21,4 +21,5 @@ return { one_per_level=true,
{group="outdoor-majeyal-gloomy"},
{group="outdoor-majeyal-generic"},
{group="majeyal-generic"},
{name="cultists", percent=10},
}
......@@ -20,4 +20,5 @@
return { one_per_level=true,
{group="fareast-generic", percent_factor=1.5},
{group="majeyal-generic", percent_factor=1.5},
{name="cultists", percent=10},
}
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