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

Fixes some arena bugs and tweak the unlock a bit

git-svn-id: http://svn.net-core.org/repos/t-engine4@3711 51575b47-30f0-44d4-a5cc-537603b46e54
parent bc1a947f
No related branches found
No related tags found
No related merge requests found
......@@ -331,6 +331,7 @@ function _M:calculateWave()
{ entity = { name = "white ooze" },
wave = 1, power = 3, delay = 3, bonus = 0.1, score = 15, entry = 2,
special = function (self) if game.level.arena.currentWave > 10 then self.wave = 2 end if game.level.arena.currentWave > 15 then self.entity = { name = "green ooze" } end return self end },
{ entity = { name = "cutpurse" }, --Wave ~5
wave = 1, power = 8, delay = 3, bonus = 0.1, score = 40, entry = 1 },
{ entity = { name = "white crystal" },
......@@ -436,6 +437,7 @@ function _M:calculateWave()
wave = 1, power = 10, delay = 2, bonus = 0.3, score = 300, entry = 2 },
{ entity = { name = "ritch hunter" },
wave = 4, power = 6, delay = 5, bonus = 0.4, score = 250, entry = 2 },
{ entity = { type = "undead", subtype = "wight" },
wave = 1, power = 11, delay = 2, bonus = 0.5, score = 400, entry = 1 },
{ entity = { name = "sun paladin" },
......@@ -455,9 +457,74 @@ function _M:calculateWave()
return foe[val]
end
function _M:setArenaTriggers(e, entry)
if e.on_added then e.on_added_orig = e.on_added end
if e.on_die then e.on_die_orig = e.on_die end
if e.on_takehit then e.on_takehit_orig = e.on_takehit end
if entry == 3 then
e.on_added = function (self)
if self.on_added_orig then self.on_added_orig(self) end
game.level.arena.danger = game.level.arena.danger + self.arenaPower
game:playSoundNear(game.player, "talents/teleport")
game.level.map:particleEmitter(self.x, self.y, 0.5, "teleport")
end
else
e.on_added = function (self)
if self.on_added_orig then self.on_added_orig(self) end
game.level.arena.danger = game.level.arena.danger + self.arenaPower
end
end
e.on_takehit = function(self, value, src)
if self.on_takehit_orig then self.on_takehit_orig(self) end
if src.player then self.arenaLastHit = value end
return value
end
e.on_die = function (self)
if self.on_die_orig then self.on_die_orig(self) end
if self.arenaLastHit >= self.max_life then
if self.arenaLastHit >= self.max_life * 2 then
local x, y = game.level.map:getTileToScreen(self.x, self.y)
game.flyers:add(x, y, 90, 0, -0.5, "OVERKILL", { 231, 0, 0 }, false)
game.log("#LIGHT_GREEN#Your powerful attack completely obliterates #WHITE#"..self.name.."#LIGHT_GREEN#!")
local val = (self.level * 0.015)
if val > 0.5 then game.log("#LIGHT_GREEN#The audience cheers!") end
game.level.arena.raiseRank(val)
else
game.log("#LIGHT_GREEN#You destroy #WHITE#"..self.name.."#LIGHT_GREEN# in a single blow!")
local val = (self.level * 0.01)
if val > 0.5 then game.log("#LIGHT_GREEN#The audience cheers!") end
game.level.arena.raiseRank(val)
end
end
game.level.arena.danger = game.level.arena.danger - self.arenaPower
if game.level.arena.pinch == false then
game.log("#LIGHT_GREEN#Your score multiplier increases by #WHITE#"..self.arenaBonusMult.."#LIGHT_GREEN#!")
game.level.arena.bonusMultiplier = game.level.arena.bonusMultiplier + self.arenaBonusMult
else
game.level.arena.bonus = game.level.arena.bonus + self.arenaScore
end
game.level.arena.kills = game.level.arena.kills + 1
if game.level.arena.kills > 5 then
game.level.arena.bonusMultiplier = game.level.arena.bonusMultiplier + 0.1
game.log("#LIGHT_GREEN#Your score multiplier increases by #WHITE#0.1#LIGHT_GREEN#!")
end
if self.level > game.player.level + 3 then
game.log("#YELLOW#You defeat an experienced enemy!")
local raise = (self.level - game.player.level) * 0.01
if raise > 0.5 then
game.log("#LIGHT_GREEN#The audience cheers!")
raise = 0.5
end
game.level.arena.raiseRank(raise)
end
end
end
function _M:generateOne(e)
local m = self.zone:makeEntity(self.level, "actor", e.entity, nil, true)
if m then
self:setArenaTriggers(m)
local escort = m.make_escort
m.make_escort = nil
m.faction = "enemies"
......@@ -467,61 +534,6 @@ function _M:generateOne(e)
m.arenaScore = e.score
m.arenaLastHit = 0
m:setTarget(game.player)
m.on_takehit = function(self, value, src) if src.player then self.arenaLastHit = value end return value end
if m.on_added then m.on_added_orig = m.on_added end
if e.entry == 3 then
m.on_added = function (self)
if self.on_added_orig then self.on_added_orig(self) end
game.level.arena.danger = game.level.arena.danger + self.arenaPower
game:playSoundNear(game.player, "talents/teleport")
game.level.map:particleEmitter(self.x, self.y, 0.5, "teleport")
end
else
m.on_added = function (self)
if self.on_added_orig then self.on_added_orig(self) end
game.level.arena.danger = game.level.arena.danger + self.arenaPower
end
end
if m.on_die then m.on_die_orig = m.on_die end
m.on_die = function (self)
if self.on_die_orig then self.on_die_orig(self) end
if self.arenaLastHit >= self.max_life then
if self.arenaLastHit >= self.max_life * 2 then
local x, y = game.level.map:getTileToScreen(self.x, self.y)
game.flyers:add(x, y, 90, 0, -0.5, "OVERKILL", { 231, 0, 0 }, false)
game.log("#LIGHT_GREEN#Your powerful attack completely obliterates #WHITE#"..self.name.."#LIGHT_GREEN#!")
local val = (self.level * 0.015)
if val > 0.5 then game.log("#LIGHT_GREEN#The audience cheers!") end
game.level.arena.raiseRank(val)
else
game.log("#LIGHT_GREEN#You destroy #WHITE#"..self.name.."#LIGHT_GREEN# in a single blow!")
local val = (self.level * 0.01)
if val > 0.5 then game.log("#LIGHT_GREEN#The audience cheers!") end
game.level.arena.raiseRank(val)
end
end
game.level.arena.danger = game.level.arena.danger - self.arenaPower
if game.level.arena.pinch == false then
game.log("#LIGHT_GREEN#Your score multiplier increases by #WHITE#"..self.arenaBonusMult.."#LIGHT_GREEN#!")
game.level.arena.bonusMultiplier = game.level.arena.bonusMultiplier + self.arenaBonusMult
else
game.level.arena.bonus = game.level.arena.bonus + self.arenaScore
end
game.level.arena.kills = game.level.arena.kills + 1
if game.level.arena.kills > 5 then
game.level.arena.bonusMultiplier = game.level.arena.bonusMultiplier + 0.1
game.log("#LIGHT_GREEN#Your score multiplier increases by #WHITE#0.1#LIGHT_GREEN#!")
end
if self.level > game.player.level + 3 then
game.log("#YELLOW#You defeat an experienced enemy!")
local raise = (self.level - game.player.level) * 0.01
if raise > 0.5 then
game.log("#LIGHT_GREEN#The audience cheers!")
raise = 0.5
end
game.level.arena.raiseRank(raise)
end
end
self:place(m, entry, false)
end
end
......@@ -140,11 +140,6 @@ newBirthDescriptor{
descriptor_choices = default_eyal_descriptors{ difficulty = { Tutorial = "never", Easy = "never", Normal = "never" } },
copy = {
death_dialog = "ArenaFinish",
-- Give the orb of knowledge
resolvers.inventory{ id=true, {defined="ORB_KNOWLEDGE"}},
resolvers.generic(function(e) e.hotkey[12] = {"inventory", "Orb of Knowledge"} end),
-- Override normal stuff
before_starting_zone = function(self)
self.starting_level = 1
......
......@@ -19,53 +19,91 @@
newChat{ id="welcome",
text = [[#LIGHT_GREEN#*A tall, hooded man stares at you*#WHITE#
I am waiting for a great fighter. Go away.
#LIGHT_GREEN#*The man ignores you for a few uncomfortable seconds, then asks:*#WHITE#
What is it? Are you the fighter I am waiting for?
Yes...yes...you look like a promising warrior indeed...
I have an offer, @playerdescriptor.race@.
You see...I am an agent for the Arena. I look for promising warriors that
can provide a good show for our audience. Perhaps you are strong enough to join.
All you need to do is beat three of my men in battle, and you shall be rewarded.
#LIGHT_GREEN#*You consider the offer of the mysterious hooded man for a moment*
]],
answers = {
{"No", jump="no"},
{"Yes", jump="yes"},
{"Interesting, tell me more about that Arena.", jump="more_ex",
action = function (self, player) self.talked_to = 1 end,
cond=function(npc, player) return not profile.mod.allow_build.campaign_arena end},
{"I am strong! What do you have to offer?", jump="more",
action = function (self, player) self.talked_to = 1 end,
cond=function(npc, player) return profile.mod.allow_build.campaign_arena end},
{"I don't accept deals from shady hooded men.", jump="refuse",
action = function (self, player) self.talked_to = 1 end},
}
}
newChat{ id="no",
text = [[#LIGHT_GREEN#*The man stares back at you*#WHITE#
That's unfortunate. You look like a fighter.
#LIGHT_GREEN#*The hooded man draws a smile in his face. You can't tell if it's an arrogant
#LIGHT_GREEN#smirk, or a sign of satisfaction. Concerned, you draw your hand closer to your
#LIGHT_GREEN#weapon*#WHITE#
Heheheh... indeed, you are.
I am looking for strong fighters for battling in the arena. A tiny entertainment for the
masses... but also a good source of good gold, and experience.
Listen, here is the deal. If you can prove your worth as fighter, I will give you
an invitation to the arena.
Fight three combatants. If you win, you get a pass. If you can survive, that is...
newChat{ id="more",
text = [[#LIGHT_GREEN#*You can feel the man smiling from inside his hood*#WHITE#
I have wealth and glory to offer, and some very useful
#YELLOW#combat experience#WHITE# from fighting our men...
So, what do you think? Are you up to it?
#LIGHT_GREEN#*The promises of fortune look so convincing coming from such a
suspiciously-dressed man. Something tells you this is not a trap, so you
consider his offer one last time...*
]],
answers = {
{"Interesting. I am up to the challenge.", jump="yes"},
{"I am not interested.", jump="ok"},
{"I am ready for battle, let's go now!", jump="accept", action = function (self, player) self.talked_to = 2 end },
{"I don't have time for games, Cornac.", jump="refuse"},
}
}
newChat{ id="yes",
text = [[#LIGHT_GREEN#*The man shows a devious smile*#WHITE#
Ah, excellent. A great fighter is always willing to head into battle.
Heheh... very well then, follow me, @playerdescriptor.race@.
#LIGHT_GREEN#*The man starts walking away, but suddenly turns to you*#WHITE#
Just remember, you might lose your life if you are weak.
But that is not the case, is it? Heheh...
newChat{ id="more_ex",
text = [[#LIGHT_GREEN#*You can feel the man smiling from inside his hood*#WHITE#
The Arena is where the brave come to fight against all odds.
We are still growing up, and we lack challengers...
It's like a gamble, but you use your fighting instead of money to play, you see?
We in the Arena work hard to make a good show, and in return...you can get enough
wealth and glory to last for centuries!
If you can pass my little test...I will #LIGHT_RED#allow you to join the Arena when
you are done with your adventures.#WHITE#
You also shall gather some much needed #LIGHT_RED#combat experience#WHITE# from fighting
our men...so, what do you think? Are you up to it?
#LIGHT_GREEN#*The promises of fortune look so convincing coming from such a
suspiciously-dressed man. Something tells you this is not a trap, so you
consider his offer one last time...*
]],
answers = {
{"Let's go", jump="go"},
{"Wait, I am not ready yet.", jump="ok"},
{"I am ready for battle, let's go now!", jump="accept", action = function (self, player) self.talked_to = 2 end },
{"I don't have time for games, Cornac.", jump="refuse"},
}
}
newChat{ id="refuse",
text = [[#LIGHT_GREEN#*The man lets out a disappointed sigh*#WHITE#
That's unfortunate. We could have used someone like you.
You are just the type the audience likes. You could have been a champion.
Alas, if you stand by your choice, we shall never meet again.
However, if you change your mind...I will #YELLOW#stay on Derth just a little
longer.#WHITE#
If I am still around, we can have a deal. Think about it, @playerdescriptor.race@.
]],
answers = {
{"We'll see. [Leave]"},
}
}
newChat{ id="accept",
text = [[#LIGHT_GREEN#*The man smiles in approval*#WHITE#
Excellent! A great fighter is always willing to head into battle.
You certainly won't regret meeting us, indeed...
So, are you ready to fight?
]],
answers = {
{"Sounds like fun, let's make haste!", jump="go"},
{"Wait. I am not ready yet.", jump="ok"},
}
}
newChat{ id="go",
text = "#LIGHT_GREEN#*The man quietly walks away, after making you a gesture to follow him*",
answers = {
{"#LIGHT_GREEN#*You follow the man*",
{"[Follow him]",
action = function (self, player)
self:die()
player:grantQuest("arena-unlock")
......@@ -79,20 +117,18 @@ newChat{ id="go",
newChat{ id="win",
text = [[#LIGHT_GREEN#*The Cornac rogue comes back from the shadows*#WHITE#
Hehehe, well done, @playerdescriptor.race@! I knew you had potential.
Heheheh, well done, @playerdescriptor.race@! I knew you had potential.
#LIGHT_GREEN#*The rogue takes out his hood, showing a fairly young, but unmistakingly
#LIGHT_GREEN#battle-hardened man. He is smiling widely, but this time you can clearly
#LIGHT_GREEN#recognize satisfaction in his smile.#WHITE#
The name's Rej. I work for the arena to recruit great fighters who can give a good
show... and not die in two blows.
A promise is a promise. This envelope contains an invitation to the arena, and a map
with its location.
When you are done adventuring, I'd like to see you there.
#LIGHT_GREEN#*As you travel back to Derth in company of the rogue, you both talk about past
#LIGHT_GREEN#battles and techniques. His experience in combat inspires you greatly. (#WHITE#+2 generic talent points#LIGHT_GREEN#)
#WHITE#Very well, @playername@. I must go now. I need to meet with some fighters at
Zigur, not too far from here.
Come to the arena when you are done with your adventures, will you?.
#LIGHT_GREEN#battle-hardened man.#WHITE#
The name's Rej. I work for the arena to recruit great fighters who can give a
good show... and not die in two blows. You are one of those, indeed!
I won't keep you away from your adventures, I was there too, long ago.
But we can make you a true champion, beloved by many and bathing in diamonds.
#LIGHT_GREEN#*As you travel back to Derth in company of the rogue, you discuss your
#LIGHT_GREEN#battles in the forest. He provides you with great insight on your combat technique(#WHITE#+2 generic talent points#LIGHT_GREEN#)*
#WHITE#Very well, @playername@. I must go now.
Good luck in your adventures, and come visit us when you are done!
]],
answers = {
{ "I will. Farewell for now.", action = function (self, player)
......@@ -112,10 +148,34 @@ Come to the arena when you are done with your adventures, will you?.
}
newChat{ id="ok",
text = "#WHITE#I see... come back if you change your mind...",
text = "#WHITE#I see... I will be waiting...#YELLOW#But not for long.",
answers = {
{ "See you."},
}
}
return "welcome"
newChat{ id="back",
text = [[#LIGHT_GREEN#*The Cornac rogue displays a welcoming smile*#WHITE#
Welcome back, @playerdescriptor.race@. Have you reconsidered my generous offer?
]],
answers = {
{ "Yes, tell me more.", jump = "accept", action = function (self, player) self.talked_to = 2 end },
{ "No, see you."},
}
}
newChat{ id="back2",
text = [[
Welcome back, @playerdescriptor.race@. Are you ready to go?
]],
answers = {
{ "Let's go, Cornac.", jump = "go" },
{ "Just a minute, I have to prepare my equipment."},
}
}
if npc.talked_to then
if npc.talked_to == 1 then return "back"
elseif npc.talked_to >= 2 then return "back2"
end
else return "welcome" end
......@@ -17,6 +17,7 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local Talents = require("engine.interface.ActorTalents")
newEntity{ name = "gladiator",
......@@ -51,13 +52,13 @@ newEntity{ name = "gladiator",
},
resolvers.talents{
[Talents.T_SHIELD_PUMMEL]=2,
[Talents.T_RUSH]=4,
[Talents.T_RUSH]=3,
[Talents.T_REPULSION]=2,
[Talents.T_ARMOUR_TRAINING] = 3,
[Talents.T_WEAPON_COMBAT] = 1,
},
on_die = function (self)
local m = game.zone:makeEntityByName(game.level, "actor", "SLINGER")
local m = game.zone:makeEntityByName(game.level, "actor", "ARCANEBLADE")
if m then
local y = 2
if game.player.y < 3 then y = 11 end
......@@ -109,7 +110,7 @@ newEntity{ name = "halfling slinger",
game:playSoundNear(game.player, "talents/teleport")
end,
on_die = function (self)
local m = game.zone:makeEntityByName(game.level, "actor", "ARCANEBLADE")
local m = game.zone:makeEntityByName(game.level, "actor", "GLADIATOR")
if m then
local y = 2
if game.player.y < 3 then y = 11 end
......@@ -160,7 +161,8 @@ newEntity{ name = "arcane blade",
end,
on_die = function (self)
local Chat = require "engine.Chat"
local chat = Chat.new("arena-unlock", {name="Cornac rogue"}, game.player)
local npc = {name="Cornac rogue"}
local chat = Chat.new("arena-unlock", npc, game.player, {npc=npc})
chat:invoke("win")
end
}
......@@ -37,7 +37,7 @@ return {
},
},
post_process = function(level)
local m = game.zone:makeEntityByName(game.level, "actor", "GLADIATOR")
local m = game.zone:makeEntityByName(game.level, "actor", "SLINGER")
if m then
game.zone:addEntity(game.level, m, "actor", 8, 2)
end
......
......@@ -17,6 +17,13 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
--TODO: Ritch blade champion (!) Miniboss?
--TODO: Blood tree, uses flying skulls. TODO: Flying skulls.
--TODO: Golden ooze(item), mana ooze (inscriptions)
--TODO: Armor ooze (armor), blade ooze (weapons)
--TODO: Vitas ooze (health+), Muscle ooze (sta+)
-- Load all others
load("/data/general/npcs/all.lua")
load("/data/general/npcs/crystal.lua")
......@@ -27,6 +34,42 @@ load("/data/general/npcs/horror-corrupted.lua")
local Talents = require("engine.interface.ActorTalents")
--Fodder
newEntity{ name = "flying skull",
type = "elemental", subtype = "dark",
display = "*", color=colors.BLACK, tint=colors.BLACK,
desc = [[A floating disembodied skull with an aura of darkness.]],
combat = { dam=10, atk=5, apr=10, physspeed=1 },
blood_color = colors.YELLOW,
level_range = {1, nil},
exp_worth = 1,
max_life = 10,
body = { INVEN = 1, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
no_drops = true, open_door = false,
infravision = 10,
rarity = false,
lite = 4,
life_rating = 1, rank = 1, size_category = 1,
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { ai_move = "move_astar", talent_in = 1 },
global_speed = 1,
stats = { str = 9, dex = 20, mag = 20 },
resolvers.talents{
[Talents.T_EXPLODE] = 3,
},
no_breath = 1,
blind_immune = 1,
fear_immune = 1,
rank = 2,
size_category = 1,
poison_immune = 1,
disease_immune = 1,
poison_immune = 1,
stun_immune = 1,
resolvers.sustains_at_birth(),
}
--Base arena human
newEntity{ define_as = "BASE_NPC_ARENA1",
type = "humanoid", subtype = "human",
......@@ -60,7 +103,6 @@ newEntity{ define_as = "BASE_NPC_ARENA1",
newEntity{ name = "skeletal rat",
base = "BASE_NPC_RODENT",
define_as = "SKELERAT",
type = "undead",
desc = [[The diminutive skeleton of a giant rat, charged with evil energies. Nobody understands the usefulness of undead rodents until several of them come after you]],
color = colors.GOLD,
level_range = {3, 4},
......@@ -312,7 +354,7 @@ newEntity{ name = "headless horror",
--Bosses
--TODO:Bosses must have a super mode for the royal crown mode.
newEntity{ name = "Ryal",
base = "BASE_NPC_BONE_GIANT",
color=colors.VIOLET,
......@@ -953,6 +995,7 @@ newEntity{ name = "martyr",
{type="weapon", subtype="longsword", ego_chance=10, autoreq=true},
{type="armor", subtype="shield", ego_chance=30, autoreq=true},
},
resists = { [DamageType.LIGHT] = 90 },
autolevel = "caster",
combat_def = 4,
resolvers.talents{
......@@ -1047,7 +1090,8 @@ newEntity{ name = "star crusader",
{type="armor", subtype="massive", autoreq=true},
{type="armor", subtype="shield", ego_chance=50, autoreq=true},
},
resolvers.drops{chance=50, nb=1, {type="weapon", subtype="staff", force_drop=true, tome_drops="boss"}},
resists = { [DamageType.LIGHT] = 95 ,[DamageType.DARKNESS] = 95 },
resolvers.drops{ chance=50, nb=1, {type="weapon", subtype="staff", force_drop=true, tome_drops="boss"} },
combat_def = 4,
autolevel = "warriormage", ai_tactic = resolvers.tactic("melee"),
resolvers.talents{
......
......@@ -29,45 +29,6 @@ newEntity{ base = "BASE_LORE",
encumberance = 0,
}
-- Id stuff
newEntity{ define_as = "ORB_KNOWLEDGE",
power_source = {unknown=true},
unique = true, quest=true,
type = "jewelry", subtype="orb",
unided_name = "orb", no_unique_lore = true,
name = "Orb of Knowledge", identified = true,
display = "*", color=colors.VIOLET, image = "object/ruby.png",
encumber = 1,
desc = [[This orb was given to you by Elisa the halfling scryer, it will automatically identify normal and rare items for you and can be activated to identify all others.]],
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
max_power = 1, power_regen = 1,
use_power = { name = "use the orb", power = 1,
use = function(self, who)
for inven_id, inven in pairs(who.inven) do
for item, o in ipairs(inven) do
if not o:isIdentified() then
o:identify(true)
game.logPlayer(who, "You have: %s", o:getName{do_colour=true})
end
end
end
return true
end
},
carrier = {
auto_id = 2,
},
}
newEntity{ define_as = "ARENA_BOOTS_DISE", name = "a pair of leather boots of disengagement",
slot = "FEET",
type = "armor", subtype="feet",
......
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