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

rename abilities to talents

git-svn-id: http://svn.net-core.org/repos/t-engine4@67 51575b47-30f0-44d4-a5cc-537603b46e54
parent f29759a7
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ require "engine.Actor" ...@@ -3,7 +3,7 @@ require "engine.Actor"
require "engine.interface.ActorLife" require "engine.interface.ActorLife"
require "engine.interface.ActorLevel" require "engine.interface.ActorLevel"
require "engine.interface.ActorStats" require "engine.interface.ActorStats"
require "engine.interface.ActorAbilities" require "engine.interface.ActorTalents"
require "engine.interface.BloodyDeath" require "engine.interface.BloodyDeath"
require "mod.class.interface.Combat" require "mod.class.interface.Combat"
...@@ -13,7 +13,7 @@ module(..., package.seeall, class.inherit( ...@@ -13,7 +13,7 @@ module(..., package.seeall, class.inherit(
engine.interface.ActorLife, engine.interface.ActorLife,
engine.interface.ActorLevel, engine.interface.ActorLevel,
engine.interface.ActorStats, engine.interface.ActorStats,
engine.interface.ActorAbilities, engine.interface.ActorTalents,
engine.interface.BloodyDeath, engine.interface.BloodyDeath,
mod.class.interface.Combat mod.class.interface.Combat
)) ))
...@@ -23,10 +23,10 @@ function _M:init(t) ...@@ -23,10 +23,10 @@ function _M:init(t)
engine.interface.ActorLife.init(self, t) engine.interface.ActorLife.init(self, t)
engine.interface.ActorLevel.init(self, t) engine.interface.ActorLevel.init(self, t)
engine.interface.ActorStats.init(self, t) engine.interface.ActorStats.init(self, t)
engine.interface.ActorAbilities.init(self, t) engine.interface.ActorTalents.init(self, t)
self.unused_stats = 0 self.unused_stats = 0
self.unused_abilities = 0 self.unused_talents = 0
end end
function _M:move(x, y, force) function _M:move(x, y, force)
...@@ -71,7 +71,7 @@ end ...@@ -71,7 +71,7 @@ end
function _M:levelup() function _M:levelup()
self.unused_stats = self.unused_stats + 3 self.unused_stats = self.unused_stats + 3
self.unused_abilities = self.unused_abilities + 1 self.unused_talents = self.unused_talents + 1
end end
--- Notifies a change of stat value --- Notifies a change of stat value
...@@ -92,20 +92,20 @@ function _M:getTarget() ...@@ -92,20 +92,20 @@ function _M:getTarget()
return self.target.x, self.target.y return self.target.x, self.target.y
end end
--- Called before an ability is used --- Called before a talent is used
-- Check the actor can cast it -- Check the actor can cast it
-- @param ab the ability (not the id, the table) -- @param ab the talent (not the id, the table)
-- @return true to continue, false to stop -- @return true to continue, false to stop
function _M:preUseAbility(ab) function _M:preUseTalent(ab)
return self:enoughEnergy() return self:enoughEnergy()
end end
--- Called before an ability is used --- Called before a talent is used
-- Check if it must use a turn, mana, stamina, ... -- Check if it must use a turn, mana, stamina, ...
-- @param ab the ability (not the id, the table) -- @param ab the talent (not the id, the table)
-- @param ret the return of the ability action -- @param ret the return of the talent action
-- @return true to continue, false to stop -- @return true to continue, false to stop
function _M:postUseAbility(ab, ret) function _M:postUseTalent(ab, ret)
if ret == nil then return end if ret == nil then return end
self:useEnergy() self:useEnergy()
return true return true
......
...@@ -11,7 +11,7 @@ local Level = require "engine.Level" ...@@ -11,7 +11,7 @@ local Level = require "engine.Level"
local Grid = require "engine.Grid" local Grid = require "engine.Grid"
local Actor = require "mod.class.Actor" local Actor = require "mod.class.Actor"
local ActorStats = require "engine.interface.ActorStats" local ActorStats = require "engine.interface.ActorStats"
local ActorAbilities = require "engine.interface.ActorAbilities" local ActorTalents = require "engine.interface.ActorTalents"
local Player = require "mod.class.Player" local Player = require "mod.class.Player"
local NPC = require "mod.class.NPC" local NPC = require "mod.class.NPC"
...@@ -45,8 +45,8 @@ function _M:run() ...@@ -45,8 +45,8 @@ function _M:run()
ActorStats:defineStat("Willpower", "wil", 10, 1, 100, "Willpower defines your character's ability to concentrate. It increases your mana and stamina capacity, and your chance to resist mental attacks.") ActorStats:defineStat("Willpower", "wil", 10, 1, 100, "Willpower defines your character's ability to concentrate. It increases your mana and stamina capacity, and your chance to resist mental attacks.")
ActorStats:defineStat("Cunning", "cun", 10, 1, 100, "Cunning defines your character's ability to learn and think. It allows you to learn many wordly abilities, increases your mental resistance and armor penetration.") ActorStats:defineStat("Cunning", "cun", 10, 1, 100, "Cunning defines your character's ability to learn and think. It allows you to learn many wordly abilities, increases your mental resistance and armor penetration.")
ActorStats:defineStat("Constitution", "con", 10, 1, 100, "Constitution defines your character's ability to withstand and resist damage. It increases your maximun life and physical resistance.") ActorStats:defineStat("Constitution", "con", 10, 1, 100, "Constitution defines your character's ability to withstand and resist damage. It increases your maximun life and physical resistance.")
-- Abilities -- Talents
ActorAbilities:loadDefinition("/data/abilities.lua") ActorTalents:loadDefinition("/data/talents.lua")
self.log = LogDisplay.new(0, self.h * 0.80, self.w * 0.5, self.h * 0.20, nil, nil, nil, {255,255,255}, {30,30,30}) self.log = LogDisplay.new(0, self.h * 0.80, self.w * 0.5, self.h * 0.20, nil, nil, nil, {255,255,255}, {30,30,30})
self.player_display = PlayerDisplay.new(0, 0, self.w * 0.2, self.h * 0.8, {30,30,0}) self.player_display = PlayerDisplay.new(0, 0, self.w * 0.2, self.h * 0.8, {30,30,0})
...@@ -179,7 +179,7 @@ function _M:targetMode(v, msg, co, typ) ...@@ -179,7 +179,7 @@ function _M:targetMode(v, msg, co, typ)
self.target:setActive(true, typ) self.target:setActive(true, typ)
-- Exclusive mode means we disable the current key handler and use a specific one -- Exclusive mode means we disable the current key handler and use a specific one
-- that only allows targetting and resumes ability coroutine when done -- that only allows targetting and resumes talent coroutine when done
if tostring(v) == "exclusive" then if tostring(v) == "exclusive" then
self.target_co = co self.target_co = co
self.key = self.targetmode_key self.key = self.targetmode_key
...@@ -239,12 +239,15 @@ function _M:setupCommands() ...@@ -239,12 +239,15 @@ function _M:setupCommands()
self.normal_key = self.key self.normal_key = self.key
self.key:addCommands self.key:addCommands
{ {
-- ability test -- talent test
_f = function()
self.player:useTalent(ActorTalents.T_MANATHRUST)
end,
_a = function() _a = function()
self.player:useAbility(ActorAbilities.AB_FIREFLASH) self.player:useTalent(ActorTalents.T_FIREFLASH)
end, end,
_z = function() _z = function()
self.player:useAbility(ActorAbilities.AB_PHASE_DOOR) self.player:useTalent(ActorTalents.T_PHASE_DOOR)
end, end,
[{"_g","shift"}] = function() [{"_g","shift"}] = function()
......
...@@ -8,7 +8,6 @@ function _M:init(actor) ...@@ -8,7 +8,6 @@ function _M:init(actor)
self.actor_dup = actor:clone() self.actor_dup = actor:clone()
engine.Dialog.init(self, "Stats Levelup: "..actor.name, 500, 300) engine.Dialog.init(self, "Stats Levelup: "..actor.name, 500, 300)
-- self.statstpl = self:loadDisplayTemplate()
self.statsel = 1 self.statsel = 1
self:keyCommands{ self:keyCommands{
......
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