From 06c3c61ea8c4f1320f108d690996ee432afd46c0 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Fri, 15 Jan 2010 16:32:38 +0000 Subject: [PATCH] hobbit's luck git-svn-id: http://svn.net-core.org/repos/t-engine4@249 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/modules/tome/class/interface/Combat.lua | 2 +- game/modules/tome/data/birth/races/dwarf.lua | 2 +- game/modules/tome/data/birth/races/hobbit.lua | 6 +++--- game/modules/tome/data/talents/misc/misc.lua | 19 ++++++++++++++++++ game/modules/tome/data/timed_effects.lua | 20 ++++++++++++++++++- game/modules/tome/load.lua | 4 ++-- 6 files changed, 45 insertions(+), 8 deletions(-) diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index c8be16d7f1..16ab6797cc 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -233,7 +233,7 @@ end --- Gets spellcrit function _M:combatSpellCrit() - return self.combat_spellcrit + 1 + return self.combat_spellcrit + (self:getCun() - 10) * 0.3 + 1 end --- Gets spellspeed diff --git a/game/modules/tome/data/birth/races/dwarf.lua b/game/modules/tome/data/birth/races/dwarf.lua index c864592865..aeb98a51c6 100644 --- a/game/modules/tome/data/birth/races/dwarf.lua +++ b/game/modules/tome/data/birth/races/dwarf.lua @@ -28,8 +28,8 @@ newBirthDescriptor{ }, copy = { default_wilderness = {"wilderness/main", 41, 18}, + life_rating=12, }, - life_rating=12, experience = 1.1, } diff --git a/game/modules/tome/data/birth/races/hobbit.lua b/game/modules/tome/data/birth/races/hobbit.lua index 3b86f3d91b..7ad3bab1d5 100644 --- a/game/modules/tome/data/birth/races/hobbit.lua +++ b/game/modules/tome/data/birth/races/hobbit.lua @@ -30,13 +30,13 @@ newBirthDescriptor{ Fallohide = "allow", }, }, - stats = { str=-3, dex=3, con=2, lck=5, }, + stats = { str=-3, dex=3, con=1, cun=3, lck=5, }, experience = 1.1, talents = { - ActorTalents.T_IMPROVED_HEALTH_I, - ActorTalents.T_IMPROVED_HEALTH_II, + [ActorTalents.T_HOBBIT_LUCK]=1, }, copy = { + life_rating = 12, default_wilderness = {"wilderness/main", 41, 18}, }, } diff --git a/game/modules/tome/data/talents/misc/misc.lua b/game/modules/tome/data/talents/misc/misc.lua index 6e700370c7..d19e4afa6c 100644 --- a/game/modules/tome/data/talents/misc/misc.lua +++ b/game/modules/tome/data/talents/misc/misc.lua @@ -115,3 +115,22 @@ newTalent{ The bonus will increase with the Constitution stat]]):format(5 + self:getCon() / 5, 10 + self:getCon() / 5, 10 + self:getCon() / 5) end, } + +-- Hobbit's power, temporary crit bonus +newTalent{ + short_name = "HOBBIT_LUCK", + name = "Luck of the Little Folk", + type = {"base/class", 1}, + cooldown = 50, + action = function(self, t) + self:setEffect(self.EFF_HOBBIT_LUCK, 5, { + physical=20 + self:getCun() / 2, + spell=20 + self:getCun() / 2, + }) + return true + end, + info = function(self) + return ([[Call upon the luck and cunning of the Little Folk to increase your physical and spell critical strike change by %d%% for 5 turns. + The bonus will increase with the Constitution stat]]):format(10 + self:getCon() / 5, 10 + self:getCon() / 5) + end, +} diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua index 44c93c6eb6..76c98be2f4 100644 --- a/game/modules/tome/data/timed_effects.lua +++ b/game/modules/tome/data/timed_effects.lua @@ -190,7 +190,7 @@ newEffect{ desc = "Dwarven Resilience", type = "physical", status = "beneficial", - parameters = { armor=10, mental=10, physical=10 }, + parameters = { armor=10, spell=10, physical=10 }, on_gain = function(self, err) return "#Target#'s skin turns to stone." end, on_lose = function(self, err) return "#Target# returns to normal." end, activate = function(self, eff) @@ -204,3 +204,21 @@ newEffect{ self:removeTemporaryValue("combat_spellresist", eff.sid) end, } + +newEffect{ + name = "HOBBIT_LUCK", + desc = "Hobbit's Luck", + type = "physical", + status = "beneficial", + parameters = { spell=10, physical=10 }, + on_gain = function(self, err) return "#Target# seems more aware." end, + on_lose = function(self, err) return "#Target# awareness returns to normal." end, + activate = function(self, eff) + eff.pid = self:addTemporaryValue("combat_physcrit", eff.physical) + eff.sid = self:addTemporaryValue("combat_spellcrit", eff.spell) + end, + deactivate = function(self, eff) + self:removeTemporaryValue("combat_physcrit", eff.pid) + self:removeTemporaryValue("combat_spellcrit", eff.sid) + end, +} diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index aba5ed693d..ea00118e45 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -32,10 +32,10 @@ ActorStats:defineStat("Strength", "str", 10, 1, 100, "Strength defines your char ActorStats:defineStat("Dexterity", "dex", 10, 1, 100, "Dexterity defines your character's ability to be agile and alert. It increases your chance to hit, your ability to avoid attacks and your damage with light weapons.") ActorStats:defineStat("Magic", "mag", 10, 1, 100, "Magic defines your character's ability to manipulate the magic of the world. It increases your spell power, the effect of spells and other magic items.") 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, think and react. It allows you to learn many wordly abilities, increases your mental resistance, armor penetration and critical chance.") 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.") -- Luck is hidden and start at half max value (50) which is considered the standard -ActorStats:defineStat("Luck", "lck", 50, 1, 100, "Luck defines your character's chance when dealing with unknown events. It increases yoru critical strike chances, your chance for random encounters, ...") +ActorStats:defineStat("Luck", "lck", 50, 1, 100, "Luck defines your character's chance when dealing with unknown events. It increases your critical strike chances, your chance for random encounters, ...") -- Actor autolevel schemes dofile("/data/autolevel_schemes.lua") -- Actor AIs -- GitLab