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

continue tutorial

git-svn-id: http://svn.net-core.org/repos/t-engine4@881 51575b47-30f0-44d4-a5cc-537603b46e54
parent f9c39a2d
No related branches found
No related tags found
No related merge requests found
Showing
with 454 additions and 10 deletions
......@@ -175,6 +175,7 @@ function _M:next()
self.changed = true
if self.list then
table.insert(self.descriptors, self.list[self.sel])
if self.list[self.sel].on_select then self.list[self.sel]:on_select() end
self.cur_order = self.cur_order + 1
if not self.order[self.cur_order] then
......
......@@ -50,8 +50,9 @@ end
-- @param id the achivement to gain
-- @param src who did it
function _M:gainAchievement(id, src, ...)
local a = self.achiev_defs[id]
-- Do not unlock things in easy mode
if game.difficulty == game.DIFFICULTY_EASY then return end
if not a or (game.difficulty == game.DIFFICULTY_EASY and not a.tutorial) then return end
engine.interface.WorldAchievements.gainAchievement(self, id, src, ...)
end
......@@ -467,7 +467,7 @@ function _M:combatDamage(weapon)
end
local talented_mod = math.sqrt(self:combatCheckTraining(weapon) / 10) + 1
local power = math.min(self.combat_dam + (weapon.dam or 1) + add, 1)
local power = math.max(self.combat_dam + (weapon.dam or 1) + add, 1)
power = (math.sqrt(power / 10) - 1) * 0.8 + 1
print(("[COMBAT DAMAGE] power(%f) totstat(%f) talent_mod(%f)"):format(power, totstat, talented_mod))
return totstat / 1.5 * power * talented_mod
......
......@@ -17,6 +17,13 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
--------------- Tutorial objectives
newAchievement{
name = "Baby steps",
desc = [[Completed ToME4 tutorial mode.]],
tutorial = true,
}
--------------- Main objectives
newAchievement{
name = "Vampire crusher",
......
-- 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
newBirthDescriptor{
type = "class",
name = "Tutorial Adventurer",
desc = {
"Adventurers have a generic talents-set to teach to young ones.",
},
descriptor_choices =
{
subclass =
{
__ALL__ = "disallow",
["Tutorial Adventurer"] = "allow",
},
},
copy = {
max_life = 120,
life_rating = 12,
mana_regen = 0.2,
life_regen = 1,
mana_rating = 7,
resolvers.generic(function(e)
e.hotkey[10] = {"inventory", "potion of lesser mana"}
end),
},
}
newBirthDescriptor{
type = "subclass",
name = "Tutorial Adventurer",
desc = {
"Adventurers have a generic talents-set to teach to young ones.",
},
stats = { str=10, con=5, dex=5, mag=10, wil=5, cun=5 },
talents_types = {
["technique/shield-offense"]={true, 0.3},
["technique/shield-defense"]={true, 0.3},
["technique/combat-training"]={true, 0.3},
["cunning/survival"]={true, 0.3},
["spell/fire"]={true, 0.3},
["spell/air"]={true, 0.3},
["spell/arcane"]={true, 0.3},
},
talents = {
[ActorTalents.T_SHIELD_PUMMEL] = 2,
[ActorTalents.T_SHIELD_WALL] = 2,
[ActorTalents.T_WEAPON_COMBAT] = 2,
[ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 2,
[ActorTalents.T_FLAME] = 2,
[ActorTalents.T_LIGHTNING] = 2,
[ActorTalents.T_ARCANE_POWER] = 2,
},
copy = {
resolvers.equip{ id=true,
{type="weapon", subtype="longsword", name="iron longsword", autoreq=true},
{type="armor", subtype="shield", name="iron shield", autoreq=true},
{type="armor", subtype="heavy", name="iron mail armour", autoreq=true}
},
resolvers.inventory{ id=true,
{type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000},
{type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000},
},
},
}
......@@ -17,9 +17,6 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
setAuto("subclass", false)
setAuto("subrace", false)
newBirthDescriptor{
type = "base",
name = "base",
......@@ -128,6 +125,7 @@ newBirthDescriptor{
load("/data/birth/worlds.lua")
-- Races
load("/data/birth/races/tutorial.lua")
load("/data/birth/races/human.lua")
load("/data/birth/races/elf.lua")
load("/data/birth/races/hobbit.lua")
......@@ -141,6 +139,7 @@ load("/data/birth/races/undead.lua")
load("/data/birth/sexes.lua")
-- Classes
load("/data/birth/classes/tutorial.lua")
load("/data/birth/classes/warrior.lua")
load("/data/birth/classes/archer.lua")
load("/data/birth/classes/rogue.lua")
......
-- 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
---------------------------------------------------------
-- Humans --
---------------------------------------------------------
newBirthDescriptor{
type = "race",
name = "Tutorial Human",
desc = {
"A special tutorial race.",
},
descriptor_choices =
{
subrace =
{
["Tutorial Human"] = "allow",
__ALL__ = "disallow",
},
},
talents = {},
experience = 1.0,
copy = {
faction = "reunited-kingdom",
type = "humanoid", subtype="human",
},
}
newBirthDescriptor
{
type = "subrace",
name = "Tutorial Human",
desc = {
"Humans hailing from the northen town of Bree. A common kind of man, unremarkable in all respects.",
},
copy = {
default_wilderness = {1, 1, "wilderness-tutorial"},
starting_zone = "tutorial",
starting_quest = "tutorial",
starting_intro = "tutorial",
},
}
......@@ -64,7 +64,7 @@ newBirthDescriptor{
{
"The tutorial will explain the basics of the game to get you started.",
},
on_select = function()
on_select = function(what)
setAuto("subclass", false)
setAuto("subrace", false)
end,
......@@ -73,22 +73,22 @@ newBirthDescriptor{
race =
{
__ALL__ = "forbid",
Human = "allow",
["Tutorial Human"] = "allow",
},
subrace =
{
__ALL__ = "forbid",
["Dúnadan"] = "allow",
["Tutorial Human"] = "allow",
},
class =
{
__ALL__ = "forbid",
Warrior = "allow",
["Tutorial Adventurer"] = "allow",
},
subclass =
{
__ALL__ = "forbid",
Fighter = "allow",
["Tutorial Adventurer"] = "allow",
},
},
}
......
-- 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
name = "Tutorial"
desc = function(self, who)
local desc = {}
desc[#desc+1] = "You must venture in the heart of the forest and kill the Lone Wolf, who randomly attacks villagers."
return table.concat(desc, "\n")
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
return [[Welcome #LIGHT_GREEN#]]..name..[[#WHITE#.
#LIGHT_GREEN#Welcome to ToME 4!#LAST#
This tutorial will present you with a short quest to familiarise yourself with the game.
You are a human adventurer, able in both melee combat and spell casting, sent into the forest by the local village to dispose of the "Lone Wolf".
The basic form of attack is a melee blow, to do it simply move toward your target, if it is hostile you will attack it.
You also posses special talents that allow you to perform more powerful attacks, buffs, escapes, ...
Talents are classified into three kinds:
- Active: those are activable actions, like throwing a fireball or stunning a monster with your shield
- Sustained: those are toggled on/off, ususaly reducing your corresponding ressource as long as they are active
- Passive: those are always 'on' and always provide their benefit
** Your starting active talents:
- Shield Pummel: You bash your foe with a powerful shield bash, damaging and stunning it
- Flame: Throw a bolt of flames at your target, burning it for a few turns
- Lightning: A jolt of electricity fires from your fingers in straigth line to your target
** Your starting sustained talents:
- Shield Wall: You take cover behind your shield, improving your defence and armour but reducing your melee offensive power
- Arcane Power: You summon a nexus of magic around you, improving your spell power
** Your starting passive talents:
- Weapon Combat: Improves your chance to hit with your melee weapon
- Heavy Armour Training: Allows you to wear heavy armour and improves your armour rating with them
]]
-- 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
load("/data/general/grids/basic.lua")
load("/data/general/grids/forest.lua")
-- 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
load("/data/general/npcs/bear.lua")
load("/data/general/npcs/vermin.lua")
load("/data/general/npcs/canine.lua")
load("/data/general/npcs/snake.lua")
load("/data/general/npcs/swarm.lua")
load("/data/general/npcs/plant.lua")
load("/data/general/npcs/ant.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of trollshaws, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "OLD_MAN_WILLOW",
type = "giant", subtype = "huorn", unique = true,
name = "Old Man Willow",
display = "#", color=colors.OLIVE_DRAB,
desc = [[The ancient grey willow tree, ruler of the Old Forest. He despises
trespassers in his territory. "...a huge willow-tree, old and hoary
Enormous it looked, its sprawling branches going up like racing arms
with may long-fingered hands, its knotted and twisted trunk gaping in
wide fissures that creaked faintly as the boughs moved."]],
level_range = {12, 35}, exp_worth = 2,
max_life = 200, life_rating = 17, fixed_rating = true,
max_stamina = 85,
max_mana = 200,
stats = { str=25, dex=10, cun=8, mag=20, wil=20, con=20 },
rank = 4,
size_category = 5,
infravision = 20,
move_others=true,
resists = { [DamageType.FIRE] = -50 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="armor", subtype="shield", defined="OLD_MAN_WILLOW_SHIELD", autoreq=true}, },
drops = resolvers.drops{chance=100, nb=5, {ego_chance=100} },
resolvers.talents{
[Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2,
[Talents.T_MANA_POOL]=1,
[Talents.T_ICE_STORM]=1,
[Talents.T_TIDAL_WAVE]=1,
[Talents.T_FREEZE]=2,
},
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=3, ai_move="move_astar", },
on_die = function(self, who)
game.player:resolveSource():grantQuest("starter-zones")
game.player:resolveSource():setQuestStatus("starter-zones", engine.Quest.COMPLETED, "old-forest")
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
load("/data/general/objects/objects.lua")
-- Artifact, droped (and used!) by Bill the Stone Troll
newEntity{ base = "BASE_SHIELD",
define_as = "OLD_MAN_WILLOW_SHIELD",
name = "Old Man's Willow Barkwood", unique=true,
desc = [[The barkwood of the Old Man's Willow, made into roughtly the shape of a shield.]],
require = { stat = { str=25 }, },
cost = 20,
special_combat = {
dam = resolvers.rngavg(20,30),
physcrit = 2,
dammod = {str=1.5},
},
wielder = {
combat_armor = 5,
combat_def = 9,
fatigue = 14,
resists = {
[DamageType.FIRE] = -20,
[DamageType.COLD] = 20,
[DamageType.NATURE] = 20,
},
},
}
-- 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
load("/data/general/traps/natural_forest.lua")
-- 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
return {
name = "Tutorial",
level_range = {1, 1},
level_scheme = "player",
max_level = 6,
decay = {300, 800},
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() end,
width = 50, height = 50,
-- all_remembered = true,
all_lited = true,
persistant = "zone",
ambiant_music = "Woods of Eremae.ogg",
generator = {
map = {
class = "engine.generator.map.Roomer",
nb_rooms = 10,
edge_entrances = {6,4},
rooms = {"forest_clearing"},
['.'] = "GRASS",
['#'] = {"TREE","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",},
up = "UP",
down = "DOWN",
door = "GRASS1",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
guardian = "LONE_WOLF",
},
object = {
class = "engine.generator.object.Random",
nb_object = {6, 9},
},
trap = {
class = "engine.generator.trap.Random",
nb_trap = {5, 8},
},
},
levels =
{
[1] = {
generator = { map = {
up = "UP_WILDERNESS",
}, },
},
},
}
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