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

Added Tutorial mode

git-svn-id: http://svn.net-core.org/repos/t-engine4@1327 51575b47-30f0-44d4-a5cc-537603b46e54
parent 81d704e2
No related branches found
No related tags found
No related merge requests found
......@@ -31,13 +31,15 @@ function _M:newAchievement(t)
WA.newAchievement(self, t)
local t2 = table.clone(t)
t2.id = "NIGHTMARE_"..t2.id
t2.name = t2.name.." (Nightmare difficulty)"
WA.newAchievement(self, t2)
if not t.no_difficulty_duplicate then
local t2 = table.clone(t)
t2.id = "NIGHTMARE_"..t2.id
t2.name = t2.name.." (Nightmare difficulty)"
WA.newAchievement(self, t2)
local t2 = table.clone(t)
t2.id = "INSANE_"..t2.id
t2.name = t2.name.." (Insane difficulty)"
WA.newAchievement(self, t2)
local t2 = table.clone(t)
t2.id = "INSANE_"..t2.id
t2.name = t2.name.." (Insane difficulty)"
WA.newAchievement(self, t2)
end
end
......@@ -19,9 +19,13 @@
--------------- Tutorial objectives
newAchievement{
name = "Baby steps",
name = "Baby steps", id = "TUTORIAL_DONE",
desc = [[Completed ToME4 tutorial mode.]],
tutorial = true,
no_difficulty_duplicate = true,
on_gain = function(_, src, personal)
game:setAllowedBuild("tutorial_done")
end,
}
--------------- Main objectives
......
......@@ -25,7 +25,8 @@ defineTile(")", "GRASS", {random_filter={name="ash longbow"}}, nil, nil)
defineTile("s", "GRASS", nil, "TUTORIAL_NPC_MAGE", nil)
defineTile(",", "GRASS", nil, nil, nil)
defineTile("S", "GRASS", nil, {random_filter={type="animal", subtype="snake", max_ood=2}}, nil)
defineTile("T", "GRASS", nil, {random_filter={type="giant", subtype="troll", max_ood=2}}, nil)
defineTile("T", "GRASS", nil, "TUTORIAL_NPC_TROLL", nil)
defineTile("L", "GRASS", nil, "TUTORIAL_NPC_LONE_WOLF", nil)
defineTile("1", "GRASS", nil, nil, "TUTORIAL_MELEE")
defineTile("|", "GRASS", {random_filter={name="elm arrow"}}, nil, nil)
defineTile("2", "GRASS", {random_filter={name="potion of lesser healing"}}, nil, "TUTORIAL_OBJECTS")
......@@ -36,6 +37,7 @@ defineTile("5", "DEEP_WATER", nil, nil, "TUTORIAL_TERRAIN")
defineTile("6", "GRASS", nil, nil, "TUTORIAL_TACTICS1")
defineTile("7", "GRASS", nil, nil, "TUTORIAL_TACTICS2")
defineTile("8", "GRASS", nil, nil, "TUTORIAL_RANGED")
defineTile("9", "GRASS", nil, nil, "TUTORIAL_QUESTS")
defineTile("?", nil, nil, nil, nil)
defineTile("j", "GRASS", nil, {random_filter={type="immovable", subtype="jelly", max_ood=2}}, nil)
defineTile(" ", "DEEP_WATER", nil, {random_filter={type="immovable", subtype="jelly", max_ood=2}}, nil)
......@@ -61,26 +63,26 @@ return [[
&&&&&&&&,,,,,,,,,,,,,,,&&&&&&&&&&&&&&&&&,,,,,&&&&&
&&&&&&&&&,,,,,,,,,,,,,&&&&&&&&&&,,,,,,,,7,,,&&&&&&
&&&&&&&&&&&&&&,,,,,&&&&&&&&&&&&,,&&&&&&&,,,,&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,&&&&&&&&,,,&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&,&&&&&&&&,,,,,,,&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&!&&&&&&&,,j,,,,,,&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&,&&&&&&,,,2,,,,,,1,,,,
&&&&&&&&&&&&&&&&&&&&&&&&&&&&,&&&,,,,,,j,,,,,&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&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&&,&&&,,,,,,,,&&&&&&
&&&&&&&&,,,,,&,,,&&&&&&&&&&&,&&&,&&&&,,,,,,&&&&&&&
&&&&&&&,,&,,,,,,,,&&&&&&&&&&,&&&,&&&&&&&&&&&&&&&&&
&&&&&,,,,,,,,,&&,&,,&&&&&&&,,&&&,,&&&&&&&&&&&&&&&&
&&&&&&,,&,,,,,,,,,&,,&&&&&&,&&&&&,,&&&&&&&&&&&&&&&
&&&&&,,,,,,&&,,,,&,,&&&&&SSS&&&&&&,,,&&&&&&&&&&&&&
&&&&&&,,,,,,,,,,&,&&&&&&SSSSSS&&&&&&,,,&&&&&&&&&&&
&&&&&&,,&,&,,&&,,,&&&&&&SSSSSSS&&&&&&&,,j,j3,,&&&&
&&&&&&&,,,,,,&&&,&&&&&&SSSSSSSS&&&&&&&&&&&&&&j,&&&
&&&&&&&&,L,,,,,,,,&&&&&SSSSSS,,&&&&&&&&&&&&&&&,&&&
&&&&&&&,,,,,,&&&&&&&&&&&SSS,,,,&&&&&&&&&&&&&&&,,&&
&&&&&&&&&&&&&&&&&&&&&&&SS,,,!,&&&&&&&&&&&&&&&&&4&&
&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,&&&&&&&&&~~~&&&&&,,&
&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,&&&&&&&&&~~~~~&&&&j&
......
......@@ -23,3 +23,10 @@ desc = function(self, who)
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
on_status_change = function(self, who, status, sub)
if self:isCompleted() then
who:setQuestStatus(self.id, engine.Quest.DONE)
world:gainAchievement("TUTORIAL_DONE", game.player)
end
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 [[#GOLD#Congratulations !#WHITE#
You have completed this small tutorial, you should now know the basics of ToME4. You are ready to step forward into the world to find glory, treaures and be mercilessly slaughtered by hordes of creatures you thought you could handle!
During this tutorial you met some creatures that where adjusted to the need of the teachings, beware, in the real world trolls are not usualy this nice!
If you need a reminder of which key does what you can always access the game menu by pressing #GOLD#Escape#WHITE# and checking the key binds (you can also adjust them to your needs).
As this is probably your first time with the game you will find there is a limited number of races and classes available to play, many many more do exist but you will unlock them while playing.
Now go boldly and remember: #GOLD#Have fun!#WHITE#
Press Escape, save & exit and create a new character!
]]
-- 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 [[During your adventures in the world you will find quests.
A quest can come either automatically from an action, from finding an item, from speaking to somebody, ...
You can view your current quests either by pressing Control+Q or right-clicking on yourself.
Once a quest is finished or failed it will disappear from the quest log. A lot of quests in ToME are optional, if you do not think you can survive one, do not do it.
When this tutorial started you where tasked to kill the Lone Wolf, you are nearing its position.
#GOLD#Beware and fight with honour!#WHITE#
]]
......@@ -21,7 +21,7 @@ load("/data/general/npcs/all.lua", rarity(0))
local Talents = require("engine.interface.ActorTalents")
newEntity{ base = "BASE_NPC_SKELETON", define_as="TUTORIAL_NPC_MAGE",
newEntity{ base = "BASE_NPC_SKELETON", define_as = "TUTORIAL_NPC_MAGE",
name = "skeleton mage", color=colors.LIGHT_RED,
level_range = {1, nil}, exp_worth = 1,
max_life = resolvers.rngavg(50,60),
......@@ -35,3 +35,40 @@ newEntity{ base = "BASE_NPC_SKELETON", define_as="TUTORIAL_NPC_MAGE",
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=1, },
}
newEntity{ base = "BASE_NPC_TROLL", defined_as = "TUTORIAL_NPC_TROLL",
name = "half-dead forest troll", color=colors.YELLOW_GREEN, image="npc/troll_f.png",
desc = [[Green-skinned and ugly, this massive humanoid glares at you, clenching wart-covered green fists.
He looks hurt.]],
level_range = {1, nil}, exp_worth = 1,
max_life = resolvers.rngavg(10,20),
combat_armor = 3, combat_def = 0,
}
newEntity{ base = "BASE_NPC_CANINE", defined_as = "TUTORIAL_NPC_LONE_WOLF",
name = "Lone Wolf", color=colors.VIOLET, unique=true, image="npc/canine_rungof.png",
desc = [[It is a large wolf with eyes full of cunning, only 3 times bigger than a normal wolf. It looks hungry. You look tasty!]],
level_range = {3, nil}, exp_worth = 2,
rank = 4,
size_category = 4,
max_life = 220,
combat_armor = 8, combat_def = 0,
combat = { dam=20, atk=15, apr=4 },
stats = { str=25, dex=20, cun=15, mag=10, con=15 },
resolvers.talents{
[Talents.T_GLOOM]=1,
[Talents.T_RUSH]=1,
[Talents.T_CRIPPLE]=1,
},
resolvers.sustains_at_birth(),
ai = "dumb_talented_simple", ai_state = { talent_in=4, ai_move="move_astar", },
on_die = function(self, who)
game.player:resolveSource():setQuestStatus("tutorial", engine.Quest.COMPLETED)
local d = require("engine.dialogs.ShowText").new("Tutorial: "..self.name, "tutorial/"..self.text)
game:registerDialog(d)
end,
}
......@@ -79,3 +79,8 @@ newEntity{ base = "TRAP_TUTORIAL", define_as = "TUTORIAL_RANGED",
name = "Ranged Combat",
text = "ranged",
}
newEntity{ base = "TRAP_TUTORIAL", define_as = "TUTORIAL_QUESTS",
name = "Quests",
text = "quests",
}
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