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

Stores refill after killing a boss

git-svn-id: http://svn.net-core.org/repos/t-engine4@2832 51575b47-30f0-44d4-a5cc-537603b46e54
parent 497207b2
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ function _M:loadup(level, zone)
self:sortInven(inven)
self.last_filled = game.turn
return true
end
--- Actor interacts with the store
......
......@@ -1074,6 +1074,11 @@ function _M:die(src)
killer:gainExp(self:worthExp(killer))
end
-- Register bosses deaths
if self.rank > 3 then
game.state:bossKilled(self.rank)
end
-- Do we get a blooooooody death ?
if rng.percent(33) then self:bloodyDeath() end
......@@ -1675,13 +1680,13 @@ function _M:preUseTalent(ab, silent, fake)
-- Check failure first
if not self:attr("no_paradox_fail") and self:paradoxFailChance(ab.paradox or ab.sustain_paradox) then
if not silent then game.logPlayer(self, "You fail to use %s due to your paradox!", ab.name) end
self:incParadox(ab.paradox or ab.paradox_sustain / 10)
self:incParadox(ab.paradox or ab.sustain_paradox / 10)
self:useEnergy()
return false
-- Now Check Anomalies
elseif not game.zone.no_anomalies and not self:attr("no_paradox_fail") and rng.percent(math.pow((self:getParadox()/400), 4)) then
-- Random anomaly
self:incParadox(ab.paradox or ab.paradox_sustain / 2)
self:incParadox(ab.paradox or ab.sustain_paradox / 2)
local ts = {}
for id, t in pairs(self.talents_def) do
if t.type[1] == "chronomancy/anomalies" then ts[#ts+1] = id end
......
......@@ -31,6 +31,16 @@ function _M:init(t, no_default)
self.allow_backup_guardians = {}
self.world_artifacts_pool = {}
self.boss_killed = 0
end
-- Number of bosses killed
function _M:bossKilled(rank)
if rank == 3.5 then
self.boss_killed = self.boss_killed + 0.5
else
self.boss_killed = self.boss_killed + 1
end
end
--- Allow dropping the rod of recall
......
......@@ -52,14 +52,23 @@ end
--- Restock based on player level
function _M:canRestock()
local s = self.store
local p = game.party:findMember{main=true}
if self.last_filled and p and self.last_filled >= p.level - s.restock_every then
print("[STORE] not restocking yet [player level]", p.level, s.restock_every, self.last_filled)
if self.last_filled and self.last_filled >= game.state.boss_killed - s.restock_every then
print("[STORE] not restocking yet [bosses killed]", game.state.boss_killed, s.restock_every, self.last_filled)
return false
end
return true
end
--- Fill the store with goods
-- @param level the level to generate for (instance of type engine.Level)
-- @param zone the zone to generate for
function _M:loadup(level, zone)
if Store.loadup(self, level, zone) then
self.last_filled = game.state.boss_killed
end
end
--- Called on object purchase try
-- @param who the actor buying
-- @param o the object trying to be purchased
......
-- ToME - Tales of Maj'Eyal
-- 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_CORRUPTED_HORROR",
type = "horror", subtype = "corrupted",
display = "h", color=colors.WHITE,
blood_color = colors.BLUE,
body = { INVEN = 10 },
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { ai_move="move_dmap", talent_in=3, },
combat_armor = 0, combat_def = 0,
combat = { atk=2, dammod={str=0.6} },
-- max_life = resolvers.rngavg(30, 50),
stats = { str=16, con=16 },
energy = { mod=1 },
infravision = 20,
rank = 2,
size_category = 3,
blind_immune = 1,
no_breath = 1,
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
dredge = 1,
name = "dremling", color=colors.SLATE,
desc = "A small disfigured humanoid with vaguely dwarven features. It's waraxe and shield look battered, rusted, and generally in ill repair.",
level_range = {1, nil}, exp_worth = 1,
combat = { atk=6, dammod={str=0.6} },
max_life = resolvers.rngavg(30, 50),
rarity = 1,
rank = 2,
size_category = 2,
autolevel = "warrior",
open_door = true,
resists = { [DamageType.BLIGHT] = 20, [DamageType.DARKNESS] = 20, [DamageType.LIGHT] = - 20 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
resolvers.drops{chance=60, nb=1, {type="money"} },
resolvers.equip{
{type="weapon", subtype="waraxe", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
},
resolvers.talents{
[Talents.T_DWARF_RESILIENCE]=1,
},
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
dredge = 1,
name = "drem", color=colors.DARK_SLATE_GRAY,
desc = "A giant black-skinned humanoid covered in spikey scabrous deposits.",
level_range = {3, nil}, exp_worth = 1,
combat_armor = 4, combat_def = 0,
combat = { dam=resolvers.mbonus(45, 10), atk=2, apr=6, physspeed=2, dammod={str=0.8} },
max_life = resolvers.rngavg(120,140),
life_rating = 15,
life_regen = 2,
max_stamina = 90,
open_door = true,
rarity = 1,
rank = 2,
size_category = 4,
autolevel = "warrior",
resists = { [DamageType.FIRE] = -50 },
fear_immune = 1,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
resolvers.drops{chance=60, nb=1, {type="money"} },
resolvers.talents{
[Talents.T_CARBON_SPIKES]=3,
[Talents.T_STAMINA_POOL]=1,
[Talents.T_STUN]=1,
},
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
dredge = 1,
name = "drem master", color=colors.LIGHT_GREY,
desc = "A disfigured humanoid with vaguely dwarven features dressed in patched together and rusted mail armor. It seems to be in command of the others.",
level_range = {3, nil}, exp_worth = 1,
combat = { atk=10, dammod={str=0.6} },
max_life = resolvers.rngavg(80, 120),
rarity = 3,
rank = 2,
size_category = 3,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { ai_move="move_dmap", talent_in=1, },
hate_regen = 0.2,
open_door = true,
resists = { [DamageType.BLIGHT] = 20, [DamageType.DARKNESS] = 20, [DamageType.LIGHT] = - 20 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
resolvers.drops{chance=60, nb=1, {type="money"} },
resolvers.equip{
{type="weapon", subtype="waraxe", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
{type="armor", subtype="heavy", autoreq=true},
},
make_escort = {
{type="horror", subtype="corrupted", name="drem", number=1, no_subescort=true},
{type="horror", subtype="corrupted", name="dremling", number=2, no_subescort=true},
},
resolvers.talents{
[Talents.T_DWARF_RESILIENCE]=1,
[Talents.T_DREDGE_FRENZY]=3,
[Talents.T_DOMINATE]=1,
},
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
name = "brecklorn", color=colors.PINK, -- gloom bat
desc = "A giant hairless bat. Pestulant sores cover it's malformed body and your heart weakens as it nears.",
level_range = {1, nil}, exp_worth = 1,
energy = { mod=0.7 },
combat = { atk=10, dammod={dex=0.6} },
combat_armor = 0, combat_def = 6,
max_life = resolvers.rngavg(10, 20),
rarity = 2,
rank = 2,
size_category = 3,
autolevel = "rogue",
ai = "tactical", ai_state = { talent_in=2, ai_move="move_astar", },
ai_tactic = resolvers.tactic "ranged",
energy = { mod=1.2 },
resists = { [DamageType.BLIGHT] = 50, [DamageType.DARKNESS] = 20, [DamageType.LIGHT] = - 20 },
resolvers.talents{
[Talents.T_SPIT_BLIGHT]=1,
[Talents.T_SHRIEK]=1,
[Talents.T_GLOOM]=1,
},
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
name = "grannor'vor", color=colors.GREEN, -- acid slug
desc = "A large sluglike creature that moves slowly, leaving a trail of acid in its wake.",
level_range = {2, nil}, exp_worth = 1,
combat = { dam=5, atk=15, apr=5, damtype=DamageType.ACID },
combat_armor = 6, combat_def = 0,
max_life = resolvers.rngavg(40, 60),
rarity = 2,
rank = 2,
size_category = 3,
autolevel = "warrior",
energy = { mod=0.8 },
resists = { [DamageType.ACID] = 50, [DamageType.DARKNESS] = 20, [DamageType.LIGHT] = - 20 },
resolvers.talents{
[Talents.T_CRAWL_ACID]=2,
[Talents.T_ACID_BLOOD]=1,
},
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CORRUPTED_HORROR",
name = "grannor'vin", color=colors.BLACK, -- shadow slug
desc = "A large sluglike creature that moves slowly. Shadows seem to be drawn to it's massive form and your light dims as it approaches.",
level_range = {2, nil}, exp_worth = 1,
combat = { dam=5, atk=15, apr=5, damtype=DamageType.DARKNESS },
combat_armor = 6, combat_def = 0,
max_life = resolvers.rngavg(40, 60),
hate_regen = 0.2,
rarity = 4,
rank = 2,
size_category = 3,
autolevel = "caster",
energy = { mod=0.8 },
resists = { [DamageType.DARKNESS] = 50, [DamageType.LIGHT] = - 20 },
resolvers.talents{
[Talents.T_CALL_SHADOWS]=2,
[Talents.T_CREEPING_DARKNESS]=2,
},
resolvers.sustains_at_birth(),
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ newEntity{
display = '2', color=colors.UMBER,
store = {
purse = 25,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 10,
max_fill = 20,
......@@ -39,7 +39,7 @@ newEntity{
display = '3', color=colors.UMBER,
store = {
purse = 25,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 10,
max_fill = 20,
......@@ -55,7 +55,7 @@ newEntity{
display = '4', color=colors.LIGHT_BLUE,
store = {
purse = 10,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 4,
max_fill = 7,
......@@ -71,7 +71,7 @@ newEntity{
display = '5', color=colors.WHITE,
store = {
purse = 10,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 4,
max_fill = 7,
......@@ -87,7 +87,7 @@ newEntity{
display = '9', color=colors.BLUE,
store = {
purse = 30,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 20,
max_fill = 30,
......@@ -107,7 +107,7 @@ newEntity{
display = '6', color=colors.RED,
store = {
purse = 25,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 15,
max_fill = 25,
......@@ -128,7 +128,7 @@ newEntity{
display = '2', color=colors.BLUE,
store = {
purse = 20,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 15,
max_fill = 25,
......@@ -152,7 +152,7 @@ newEntity{
display = '5', color=colors.WHITE,
store = {
purse = 10,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 5,
max_fill = 9,
......@@ -174,7 +174,7 @@ newEntity{
display = '7', color=colors.BLUE,
store = {
purse = 35,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
sell_percent = 240,
min_fill = 10,
......@@ -191,7 +191,7 @@ newEntity{
display = '*', color=colors.LIGHT_RED,
store = {
purse = 5,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 40,
max_fill = 40,
......@@ -215,7 +215,7 @@ newEntity{
display = '*', color=colors.LIGHT_RED,
store = {
purse = 5,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 40,
max_fill = 40,
......@@ -231,7 +231,7 @@ newEntity{
display = '2', color=colors.UMBER,
store = {
purse = 25,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 20,
max_fill = 30,
......@@ -251,7 +251,7 @@ newEntity{
display = '3', color=colors.UMBER,
store = {
purse = 25,
restock_every = 5,
restock_every = 1,
empty_before_restock = true,
min_fill = 20,
max_fill = 30,
......
-- ToME - Tales of Maj'Eyal
-- 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/underground.lua")
newEntity{ base = "DOWN", define_as = "IRON_COUNCIL", name="The Iron Council (Dwarven empire main city)", change_zone="town-iron-council" }
-- ToME - Tales of Maj'Eyal
-- 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/rodent.lua", rarity(5))
load("/data/general/npcs/horror-corrupted.lua", rarity(0))
load("/data/general/npcs/all.lua", rarity(4, 35))
local Talents = require("engine.interface.ActorTalents")
newEntity{ base="BASE_NPC_CORRUPTED_HORROR", define_as = "THE_MOUTH",
unique = true,
name = "The Mouth", tint=colors.PURPLE, image = "npc/the_mouth.png",
color=colors.VIOLET,
desc = [["From bellow, it devours."]],
level_range = {7, nil}, exp_worth = 2,
max_life = 150, life_rating = 12, fixed_rating = true,
stats = { str=10, dex=10, cun=12, mag=20, con=10 },
rank = 4,
size_category = 4,
infravision = 20,
instakill_immune = 1,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
resolvers.drops{chance=100, nb=1, {defined="CRYSTAL_FOCUS", random_art_replace={chance=75}} },
resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
[Talents.T_FLAME]=1,
[Talents.T_ICE_SHARDS]=1,
[Talents.T_SOUL_ROT]=1,
[Talents.T_ELEMENTAL_BOLT]=1,
},
resolvers.inscriptions(1, {"manasurge rune"}),
inc_damage = { all = -35 },
autolevel = "caster",
ai = "tactical", ai_state = { talent_in=1, ai_move="move_astar", },
ai_tactic = resolvers.tactic"ranged",
on_die = function(self, who)
game.player:resolveSource():grantQuest("start-shaloren")
game.player:resolveSource():setQuestStatus("start-shaloren", engine.Quest.COMPLETED, "spellblaze")
end,
}
-- ToME - Tales of Maj'Eyal
-- 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")
for i = 1, 5 do
newEntity{ base = "BASE_LORE",
define_as = "NOTE"..i,
name = "research log", lore="scintillating-caves-note-"..i,
desc = [[A paper scrap, left by an adventurer.]],
rarity = false,
is_magic_device = false,
encumberance = 0,
}
end
-- ToME - Tales of Maj'Eyal
-- 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/traps/natural_forest.lua")
-- ToME - Tales of Maj'Eyal
-- 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 = "The Deep Bellow",
level_range = {1, 5},
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,
-- all_remembered = true,
all_lited = true,
persistent = "zone",
ambient_music = "Straight Into Ambush.ogg",
generator = {
map = {
class = "engine.generator.map.Cavern",
zoom = 14,
min_floor = 700,
floor = "UNDERGROUND_FLOOR",
wall = {"UNDERGROUND_TREE","UNDERGROUND_TREE2","UNDERGROUND_TREE3","UNDERGROUND_TREE4","UNDERGROUND_TREE5","UNDERGROUND_TREE6","UNDERGROUND_TREE7","UNDERGROUND_TREE8","UNDERGROUND_TREE9","UNDERGROUND_TREE10","UNDERGROUND_TREE11","UNDERGROUND_TREE12","UNDERGROUND_TREE13","UNDERGROUND_TREE14","UNDERGROUND_TREE15","UNDERGROUND_TREE16","UNDERGROUND_TREE17","UNDERGROUND_TREE18","UNDERGROUND_TREE19","UNDERGROUND_TREE20",},
up = "UNDERGROUND_LADDER_UP",
down = "UNDERGROUND_LADDER_DOWN",
door = "UNDERGROUND_FLOOR",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
filters = { {max_ood=2}, },
},
object = {
class = "engine.generator.object.Random",
nb_object = {6, 9},
},
trap = {
class = "engine.generator.trap.Random",
nb_trap = {6, 9},
},
},
levels =
{
[1] = {
generator = { map = {
up = "IRON_COUNCIL",
}, },
},
},
}
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