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

Added a backup guardian to the sandworm lair

git-svn-id: http://svn.net-core.org/repos/t-engine4@1557 51575b47-30f0-44d4-a5cc-537603b46e54
parent 35bd89da
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ function _M:goneEast()
self.gone_east = true
end
function _M:activateBackupGuardian(guardian, on_level, zonelevel, rumor)
function _M:activateBackupGuardian(guardian, on_level, zonelevel, rumor, action)
if self.gone_east then return end
print("Zone guardian dead, setting up backup guardian", guardian, zonelevel)
self.allow_backup_guardians[game.zone.short_name] =
......@@ -42,6 +42,7 @@ function _M:activateBackupGuardian(guardian, on_level, zonelevel, rumor)
on_level = on_level,
new_level = zonelevel,
rumor = rumor,
action = action,
}
end
......@@ -52,6 +53,7 @@ function _M:zoneCheckBackupGuardian()
if self.allow_backup_guardians[game.zone.short_name] then
local data = self.allow_backup_guardians[game.zone.short_name]
game.zone.base_level = data.new_level
if data.action then data.action(false) end
end
-- Spawn the new guardian
......@@ -75,6 +77,7 @@ function _M:zoneCheckBackupGuardian()
print("WARNING: Backup Guardian not found: ", data.guardian)
end
if data.action then data.action(true) end
self.allow_backup_guardians[game.zone.short_name] = nil
end
end
......@@ -40,7 +40,7 @@ return {
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
guardian = "NIMISIL",
guardian = "MINOTAUR_MAZE",
},
object = {
class = "engine.generator.object.Random",
......
......@@ -93,7 +93,60 @@ newEntity{ define_as = "SANDWORM_QUEEN",
ai = "dumb_talented_simple", ai_state = { talent_in=2, ai_move="move_astar", },
on_die = function(self, who)
game.state:activateBackupGuardian("CORRUPTED_SAND_WYRM", 1, 45, "Did you hear? Something seems to have devoured all the last sandworms!", function(gen)
if gen then return end
for i = #game.level.e_array, 1, -1 do
local e = game.level.e_array[i]
if not e.unique and not e.player then game.level:removeEntity(e) end
end
end)
game.player:resolveSource():grantQuest("starter-zones")
game.player:resolveSource():setQuestStatus("starter-zones", engine.Quest.COMPLETED, "sandworm-lair")
end,
}
-- The boss of the sandworm lair, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "CORRUPTED_SAND_WYRM",
type = "dragon", subtype = "sand", unique = true,
name = "Corrupted Sand Wyrm",
display = "D", color=colors.VIOLET,
desc = [[The sandworms are gone, devoured by this shrieking, warped horror.]],
level_range = {47, nil}, exp_worth = 3,
max_life = 850, life_rating = 24, fixed_rating = true,
infravision = 20,
stats = { str=25, dex=10, cun=8, mag=20, wil=20, con=20 },
move_others=true,
instakill_immune = 1,
blind_immune = 1,
no_breath = 1,
rank = 4,
size_category = 5,
combat = { dam=140, atk=130, apr=25, dammod={str=1.2} },
resists = { [DamageType.BLIGHT] = 25, [DamageType.NATURE] = 50 },
body = { INVEN = 10, BODY=1 },
can_pass = {pass_wall=20},
move_project = {[DamageType.DIG]=1},
resolvers.drops{chance=100, nb=1, {defined="PUTRESCENT_POTION"}, },
resolvers.drops{chance=100, nb=5, {type="gem"} },
resolvers.talents{
[Talents.T_BLOOD_GRASP]=5,
[Talents.T_BLIGHTZONE]=5,
[Talents.T_SOUL_ROT]=5,
[Talents.T_RUSH]=5,
[Talents.T_SWALLOW]=3,
[Talents.T_SAND_BREATH]=9,
[Talents.T_STUN]=5,
[Talents.T_KNOCKBACK]=5,
},
resolvers.sustains_at_birth(),
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { ai_target="target_player_radius", sense_radius=400, talent_in=1, },
}
......@@ -46,3 +46,29 @@ newEntity{
return "destroy", true
end}
}
newEntity{
define_as = "PUTRESCENT_POTION",
type = "corpse", subtype = "blood",
name = "Wyrm Bile", unique=true, unided_name="putrescent potion",
display = "*", color=colors.VIOLET,
desc = [[A vial of thick, lumpy fluid. Who knows what this will do to you if you drink it?]],
cost = 3000,
use_simple = { name="drink the vile blood", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the wyrm bile and feel forever transformed!")
who.unused_talents_types = who.unused_talents_types + 1
game.log("You have %d category point(s) to spend. Press G to use them.", who.unused_talents_types)
local str, dex, con, mag, wil, cun = rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6)
who:incStat("str", str) if str >= 0 then str="+"..str end
who:incStat("dex", dex) if dex >= 0 then dex="+"..dex end
who:incStat("mag", mag) if mag >= 0 then mag="+"..mag end
who:incStat("wil", wil) if wil >= 0 then wil="+"..wil end
who:incStat("cun", cun) if cun >= 0 then cun="+"..cun end
who:incStat("con", con) if con >= 0 then con="+"..con end
game.logPlayer(who, "#00FF00#Your stats have changed! (Str %s, Dex %s, Mag %s, Wil %s, Cun %s, Con %s)", str, dex, mag, wil, cun, con)
return "destroy", true
end}
}
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