diff --git a/game/engine/interface/ActorAbilities.lua b/game/engine/interface/ActorTalents.lua similarity index 100% rename from game/engine/interface/ActorAbilities.lua rename to game/engine/interface/ActorTalents.lua diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index e357a31962aff2b907ac5c753482d14f7ffe6d0e..a84dae374cdf61ef533a3b38c5a6020d06cb6659 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -3,7 +3,7 @@ require "engine.Actor" require "engine.interface.ActorLife" require "engine.interface.ActorLevel" require "engine.interface.ActorStats" -require "engine.interface.ActorAbilities" +require "engine.interface.ActorTalents" require "engine.interface.BloodyDeath" require "mod.class.interface.Combat" @@ -13,7 +13,7 @@ module(..., package.seeall, class.inherit( engine.interface.ActorLife, engine.interface.ActorLevel, engine.interface.ActorStats, - engine.interface.ActorAbilities, + engine.interface.ActorTalents, engine.interface.BloodyDeath, mod.class.interface.Combat )) @@ -23,10 +23,10 @@ function _M:init(t) engine.interface.ActorLife.init(self, t) engine.interface.ActorLevel.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_abilities = 0 + self.unused_talents = 0 end function _M:move(x, y, force) @@ -71,7 +71,7 @@ end function _M:levelup() self.unused_stats = self.unused_stats + 3 - self.unused_abilities = self.unused_abilities + 1 + self.unused_talents = self.unused_talents + 1 end --- Notifies a change of stat value @@ -92,20 +92,20 @@ function _M:getTarget() return self.target.x, self.target.y end ---- Called before an ability is used +--- Called before a talent is used -- 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 -function _M:preUseAbility(ab) +function _M:preUseTalent(ab) return self:enoughEnergy() end ---- Called before an ability is used +--- Called before a talent is used -- Check if it must use a turn, mana, stamina, ... --- @param ab the ability (not the id, the table) --- @param ret the return of the ability action +-- @param ab the talent (not the id, the table) +-- @param ret the return of the talent action -- @return true to continue, false to stop -function _M:postUseAbility(ab, ret) +function _M:postUseTalent(ab, ret) if ret == nil then return end self:useEnergy() return true diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 89c63a621bc08743531204d1a48da21397664164..1985ff9c5c87ae403b759724659e9aa13d6cf765 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -11,7 +11,7 @@ local Level = require "engine.Level" local Grid = require "engine.Grid" local Actor = require "mod.class.Actor" 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 NPC = require "mod.class.NPC" @@ -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("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.") - -- Abilities - ActorAbilities:loadDefinition("/data/abilities.lua") + -- Talents + 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.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) self.target:setActive(true, typ) -- 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 self.target_co = co self.key = self.targetmode_key @@ -239,12 +239,15 @@ function _M:setupCommands() self.normal_key = self.key self.key:addCommands { - -- ability test + -- talent test + _f = function() + self.player:useTalent(ActorTalents.T_MANATHRUST) + end, _a = function() - self.player:useAbility(ActorAbilities.AB_FIREFLASH) + self.player:useTalent(ActorTalents.T_FIREFLASH) end, _z = function() - self.player:useAbility(ActorAbilities.AB_PHASE_DOOR) + self.player:useTalent(ActorTalents.T_PHASE_DOOR) end, [{"_g","shift"}] = function() diff --git a/game/modules/tome/data/abilities.lua b/game/modules/tome/data/talents.lua similarity index 100% rename from game/modules/tome/data/abilities.lua rename to game/modules/tome/data/talents.lua diff --git a/game/modules/tome/dialogs/LevelupStatsDialog.lua b/game/modules/tome/dialogs/LevelupStatsDialog.lua index f6ea0d4e4f5ca13fd2893af4f0ab835a1ada6cfe..938ebbd8b01159d55a2c035668d4f9e70da269b1 100644 --- a/game/modules/tome/dialogs/LevelupStatsDialog.lua +++ b/game/modules/tome/dialogs/LevelupStatsDialog.lua @@ -8,7 +8,6 @@ function _M:init(actor) self.actor_dup = actor:clone() engine.Dialog.init(self, "Stats Levelup: "..actor.name, 500, 300) --- self.statstpl = self:loadDisplayTemplate() self.statsel = 1 self:keyCommands{