From a7f125c9508a5ccee5336b2d201c7017083a08cf Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Fri, 4 Jan 2013 14:12:24 +0000 Subject: [PATCH] Fixed Gestures description Added a lore popup when wielding an antimagic item as an arcane user git-svn-id: http://svn.net-core.org/repos/t-engine4@6319 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engines/default/engine/init.lua | 5 +++-- game/modules/tome/class/Actor.lua | 11 ++++++++++- game/modules/tome/class/Player.lua | 3 +++ game/modules/tome/data/lore/misc.lua | 10 ++++++++++ game/modules/tome/data/talents/cursed/gestures.lua | 6 +++--- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/game/engines/default/engine/init.lua b/game/engines/default/engine/init.lua index 15874258ef..9116580f5a 100644 --- a/game/engines/default/engine/init.lua +++ b/game/engines/default/engine/init.lua @@ -87,8 +87,9 @@ if not config.settings.window or not config.settings.window.size then local r = list[1] or {w=800, h=600} print("[RESOLUTION] no configured resolution, defaulting to biggest possible: ", r.w, r.h) config.settings.window = config.settings.window or {} - local x, y = math.max(800, math.floor(r.w * 0.75)), math.max(600, math.floor(r.h*0.75)) - config.settings.window.size = x.."x"..y + --local x, y = math.max(800, math.floor(r.w * 0.75)), math.max(600, math.floor(r.h*0.75)) + local x, y = r.w, r.h + config.settings.window.size = x.."x"..y.." Fullscreen" end -- Move around diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index b7dd4f620d..1dd90ae968 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -3562,6 +3562,10 @@ function _M:preUseTalent(ab, silent, fake) end end + if self:triggerHook{"Actor:preUseTalent", t=ab, silent=silent, fale=fake} then + return false + end + -- Confused ? lose a turn! if self:attr("confused") and (ab.mode ~= "sustained" or not self:isTalentActive(ab.id)) and ab.no_energy ~= true and not fake and not self:attr("force_talent_ignore_ressources") then if rng.percent(self:attr("confused")) then @@ -3785,7 +3789,10 @@ function _M:postUseTalent(ab, ret) end end - self:triggerHook{"Actor:postUseTalent", t=ab, ret=ret, trigger=trigger} + local hd = {"Actor:postUseTalent", t=ab, ret=ret, trigger=trigger} + if self:triggerHook(hd) then + trigger = hd.trigger + end if trigger and self:hasEffect(self.EFF_BURNING_HEX) then local p = self:hasEffect(self.EFF_BURNING_HEX) @@ -3956,6 +3963,8 @@ function _M:getTalentFullDescription(t, addlevel, config, fake_mastery) if t.sustain_paradox then d:add({"color",0x6f,0xff,0x83}, "Sustain paradox cost: ", {"color", 176, 196, 222}, ("%0.2f"):format(t.sustain_paradox), true) end if t.sustain_psi then d:add({"color",0x6f,0xff,0x83}, "Sustain psi cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.sustain_psi), true) end if t.sustain_feedback then d:add({"color",0x6f,0xff,0x83}, "Sustain feedback cost: ", {"color",0xFF, 0xFF, 0x00}, ""..(t.sustain_feedback), true) end + + self:triggerHook{"Actor:getTalentFullDescription:ressources", str=d, t=t, addlevel=addlevel, config=config, fake_mastery=fake_mastery} end if t.mode ~= "passive" then if self:getTalentRange(t) > 1 then d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, ("%0.2f"):format(self:getTalentRange(t)), true) diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 2cb2612c99..6a54a8e43c 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -1289,6 +1289,9 @@ function _M:onWear(o, bypass_set) end end + if o.power_source and o.power_source.antimagic and not game.party:knownLore("nature-vs-magic") and self:attr("has_arcane_knowledge") then + game.party:learnLore("nature-vs-magic") + end end --- Call when an object is added diff --git a/game/modules/tome/data/lore/misc.lua b/game/modules/tome/data/lore/misc.lua index 8eef016d6e..3772634642 100644 --- a/game/modules/tome/data/lore/misc.lua +++ b/game/modules/tome/data/lore/misc.lua @@ -583,6 +583,16 @@ Try to be a little faster next time. Love, #{italic}#Eden#{normal}#]] } +newLore{ + id = "nature-vs-magic", + category = "magic", + name = "Nature vs Magic", + always_pop = true, + lore = [[Your arcane abilities have been interfered with! + +Eyal is a torn world, and the forces of nature can react strongly to the arcane energies that seek to manipulate them. Some items and areas are imbued with anti-magic, a natural energy that disrupts magical abilities and effects. There are even those who have learned to harness anti-magic into their own wild abilities, and who use them to hunt down and destroy those who practise magic. So beware, caster! It is a hostile world ye wander in.]], +} + -------------------------------------------------------------- -- Misc bosses -------------------------------------------------------------- diff --git a/game/modules/tome/data/talents/cursed/gestures.lua b/game/modules/tome/data/talents/cursed/gestures.lua index 63dbf17eeb..11f959914a 100644 --- a/game/modules/tome/data/talents/cursed/gestures.lua +++ b/game/modules/tome/data/talents/cursed/gestures.lua @@ -127,7 +127,7 @@ newTalent{ local bonusCritical = t.getBonusCritical(self, t) return ([[Use a gesture of pain in place of an normal attack to strike into the minds of your enemies, inflicting between %0.1f and %0.1f mind damage. If you strike your target, there is a %d%% chance to stun your opponent for 3 turns. This strike replaces your melee physical and checks Mindpower versus Mental Save, and is thus not affected by your Accuracy or the enemy's Defense. It also does not trigger any physical on-hit effects. However, the base damage and the critical chance of Mindstars equipped is added in when this attack is performed. - 25%% chance of cross tier effects. Requires at least one free or mindstar-equipped hand. Can cause critical hits with cross tier effects. The damage will increase with your Mindpower. Mindstars bonuses from damage and physical criticals: (+%d damage, +%d critical chance)]]):format(damDesc(self, DamageType.MIND, baseDamage * 0.5), damDesc(self, DamageType.MIND, baseDamage), stunChance, bonusDamage, bonusCritical) + 25%% chance of cross tier effects. Requires two free or mindstar-equipped hands. Can cause critical hits with cross tier effects. The damage will increase with your Mindpower. Mindstars bonuses from damage and physical criticals: (+%d damage, +%d critical chance)]]):format(damDesc(self, DamageType.MIND, baseDamage * 0.5), damDesc(self, DamageType.MIND, baseDamage), stunChance, bonusDamage, bonusCritical) end, } @@ -171,7 +171,7 @@ newTalent{ local mindpowerChange = t.getMindpowerChange(self, t, 2) local mindCritChange = t.getMindCritChange(self, t) return ([[Enhance your mental attacks with a single gesture. You gain +%d mindpower and +%d%% chance to inflict critical damage with mind-based attacks (current chance is %d%%). - Requires at least one free or mindstar-equipped hand; does not require Gesture of Pain to be sustained.]]):format(mindpowerChange, mindCritChange, self:combatMindCrit()) + Requires two free or mindstar-equipped hands; does not require Gesture of Pain to be sustained.]]):format(mindpowerChange, mindCritChange, self:combatMindCrit()) end, } @@ -202,6 +202,6 @@ newTalent{ local damageChange = t.getDamageChange(self, t) local counterAttackChance = t.getCounterAttackChance(self, t) return ([[You guard against melee damage with a sweep of you hand. All damage from melee attacks is reduced by %d%%. There is also a %d%% chance of counterattacking while Gesture of Pain is active. - Requires at least one free or mindstar-equipped hand; does not require Gesture of Pain to be sustained.]]):format(-damageChange, counterAttackChance) + Requires two free or mindstar-equipped hands; does not require Gesture of Pain to be sustained.]]):format(-damageChange, counterAttackChance) end, } -- GitLab