diff --git a/game/engine/Actor.lua b/game/engine/Actor.lua index 25e5d25fa13a7c61d0709c98bba41c5ac806451e..7c0a570cd0755504c54b79c0156210d9ca098443 100644 --- a/game/engine/Actor.lua +++ b/game/engine/Actor.lua @@ -130,6 +130,7 @@ end function _M:useEnergy(val) val = val or game.energy_to_act self.energy.value = self.energy.value - val + self.energy.used = true if self.player and self.energy.value < game.energy_to_act then game.paused = false end end diff --git a/game/engine/GameEnergyBased.lua b/game/engine/GameEnergyBased.lua index 2a7a3034ec0ca65387a23ddadf5b793cb4f3db5c..a4889d05db0e35d1159fcfa9a0c68d055a318db3 100644 --- a/game/engine/GameEnergyBased.lua +++ b/game/engine/GameEnergyBased.lua @@ -35,11 +35,12 @@ function _M:tick() local arr = self.level.e_array for i = 1, #arr do e = arr[i] - if e and e.act then - if e.energy and e.energy.value < self.energy_to_act then + if e and e.act and e.energy then + if e.energy.value < self.energy_to_act then e.energy.value = (e.energy.value or 0) + self.energy_per_tick * (e.energy.mod or 1) end if e.energy.value >= self.energy_to_act then + e.energy.used = false e:act(self) end end @@ -49,11 +50,12 @@ function _M:tick() local arr = self.entities for i, e in pairs(arr) do e = arr[i] - if e and e.act then - if e.energy and e.energy.value < self.energy_to_act then + if e and e.act and e.energy then + if e.energy.value < self.energy_to_act then e.energy.value = (e.energy.value or 0) + self.energy_per_tick * (e.energy.mod or 1) end if e.energy.value >= self.energy_to_act then + e.energy.used = false e:act(self) end end diff --git a/game/engine/ai/talented.lua b/game/engine/ai/talented.lua index cc3d4a1c3d2ad78f45b439a81df3e24e983e8231..ea355aeab7b839bc5a49b3b1be8256fa56aa6f4c 100644 --- a/game/engine/ai/talented.lua +++ b/game/engine/ai/talented.lua @@ -23,7 +23,10 @@ end) newAI("dumb_talented_simple", function(self) if self:runAI("target_simple") then -- One in "talent_in" chance of using a talent - if rng.chance(self.ai_state.talent_in or 6) and not self:runAI("dumb_talented") then + if rng.chance(self.ai_state.talent_in or 6) then + self:runAI("dumb_talented") + end + if not self.energy.used then self:runAI("move_simple") end return true diff --git a/game/engine/resolvers.lua b/game/engine/resolvers.lua index ce34bf7c62130364c6be98d42d2d9f825fd324d0..33bb6aa5caa9f98027019967ca8f08ad6e2f80b7 100644 --- a/game/engine/resolvers.lua +++ b/game/engine/resolvers.lua @@ -32,6 +32,6 @@ function resolvers.talents(list) end function resolvers.calc.talents(t, e) local ts = {} - for i, tid in ipairs(t[1]) do ts[tid] = true end + for tid, level in pairs(t[1]) do ts[tid] = level end return ts end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 1a0cb61bd5d0476e7fb356beca8dee35069797f8..bb75b60f4e395e766636979e339a42f5608b9c58 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -145,8 +145,8 @@ end function _M:levelup() self.unused_stats = self.unused_stats + 3 - self.unused_talents = self.unused_talents + 1 - if self.level % 5 == 0 then + self.unused_talents = self.unused_talents + 2 + if self.level % 10 == 0 then self.unused_talents_types = self.unused_talents_types + 1 end diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua index 8bed2d3cdadea54fec636fc65f73dba80288fc92..cf750d2e53da5374995e7608b99cb599532ad502 100644 --- a/game/modules/tome/class/NPC.lua +++ b/game/modules/tome/class/NPC.lua @@ -15,9 +15,8 @@ function _M:act() -- Let the AI think .... beware of Shub ! -- If AI did nothing, use energy anyway - local old = self.energy.value self:doAI() - if old == self.energy.value then self:useEnergy() end + if not self.energy.used then self:useEnergy() end end --- Called by ActorLife interface diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 64050f83c662e65f6ada3750ded5a89a92dd8b1b..99e524f737f4c895527ec58906a94bb67b552df4 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -127,7 +127,7 @@ function _M:attackTargetWith(target, weapon, damtype, mult) local crit dam = dam * mult dam, crit = self:physicalCrit(dam, weapon) - game.logSeen(self, "%s performs a critical stike!", self.name:capitalize()) + if crit then game.logSeen(self, "%s performs a critical stike!", self.name:capitalize()) end DamageType:get(damtype).projector(self, target.x, target.y, damtype, math.max(0, dam)) hitted = true else diff --git a/game/modules/tome/data/general/npcs/skeleton.lua b/game/modules/tome/data/general/npcs/skeleton.lua index fbfbb171c0a5f2139212aff18cc52040697cc68d..8fef7cbb183d90263dc1af391cd242c87e2a9e30 100644 --- a/game/modules/tome/data/general/npcs/skeleton.lua +++ b/game/modules/tome/data/general/npcs/skeleton.lua @@ -8,11 +8,11 @@ newEntity{ combat = { dam=1, atk=1, apr=1 }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, - equipment = resolvers.equip{ {type="weapon", subtype="longsword"} }, + equipment = resolvers.equip{ {type="weapon", subtype="greatsword"} }, drops = resolvers.drops{chance=20, nb=1, {} }, autolevel = "warrior", - ai = "dumb_talented_simple", ai_state = { talent_in=3, }, + ai = "dumb_talented_simple", ai_state = { talent_in=4, }, energy = { mod=1 }, stats = { str=14, dex=12, mag=10, con=12 }, @@ -24,7 +24,7 @@ newEntity{ base = "BASE_NPC_SKELETON", name = "degenerated skeleton warrior", color=colors.WHITE, level_range = {1, 50}, exp_worth = 1, rarity = 4, - max_life = resolvers.rngavg(30,40), + max_life = resolvers.rngavg(40,50), combat_armor = 5, combat_def = 1, } @@ -32,16 +32,17 @@ newEntity{ base = "BASE_NPC_SKELETON", name = "skeleton warrior", color=colors.SLATE, level_range = {2, 50}, exp_worth = 1, rarity = 3, - max_life = resolvers.rngavg(40,50), + max_life = resolvers.rngavg(90,100), combat_armor = 5, combat_def = 1, + talents = resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUNNING_BLOW]=1, [Talents.T_DEATH_BLOW]=1 }, } newEntity{ base = "BASE_NPC_SKELETON", name = "skeleton mage", color=colors.LIGHT_RED, level_range = {4, 50}, exp_worth = 1, rarity = 6, - max_life = resolvers.rngavg(20,25), - max_mana = resolvers.rngavg(40,50), + max_life = resolvers.rngavg(50,60), + max_mana = resolvers.rngavg(70,80), combat_armor = 3, combat_def = 1, stats = { str=10, dex=12, cun=14, mag=14, con=10 }, talents = resolvers.talents{ [Talents.T_MANA_POOL]=1, [Talents.T_FLAME]=2, [Talents.T_MANATHRUST]=3 }, diff --git a/game/modules/tome/data/talents/cunning/stealth.lua b/game/modules/tome/data/talents/cunning/stealth.lua index f224812b7656eb045107dded524765728b775081..21c84df0e613e255422a8552f986ae15fdc430de 100644 --- a/game/modules/tome/data/talents/cunning/stealth.lua +++ b/game/modules/tome/data/talents/cunning/stealth.lua @@ -24,16 +24,17 @@ newTalent{ return { stealth = self:addTemporaryValue("stealth", self:getCun(10) * self:getTalentLevel(t)), - lite = self:addTemporaryValue("lite", -100), +-- lite = self:addTemporaryValue("lite", -100), } end, deactivate = function(self, t, p) self:removeTemporaryValue("stealth", p.stealth) - self:removeTemporaryValue("lite", p.lite) +-- self:removeTemporaryValue("lite", p.lite) return true end, info = function(self, t) return ([[Enters stealth mode, making you harder to detect. + Stealth cannot work with heavy or massive armours. While in stealth mode, light radius is reduced to 0. There needs to be no foes in sight in a radius of %d around you to enter stealth.]]):format(math.floor(10 - self:getTalentLevel(t) * 1.3)) end, @@ -47,6 +48,6 @@ newTalent{ require = { stat = { cun=18 }, }, info = function(self, t) return ([[When striking from stealth, hits are automatically criticals if the target does not notice you. - Shadowstrikes do %.02f%% more damage than a normal hit.]]):format(math.floor(2 + self:getTalentLevel(t) / 5)) + Shadowstrikes do %.02f%% damage than a normal hit.]]):format((2 + self:getTalentLevel(t) / 5) * 100) end, } diff --git a/game/modules/tome/data/talents/physical/dualweapon.lua b/game/modules/tome/data/talents/physical/dualweapon.lua index eb5f6fab4cf747fb43af22baaba594311d262e39..b2c20a88881952baef6844c105d416738e85d79d 100644 --- a/game/modules/tome/data/talents/physical/dualweapon.lua +++ b/game/modules/tome/data/talents/physical/dualweapon.lua @@ -99,3 +99,35 @@ newTalent{ return ([[Greatly increases attack speed, but drains stamina quickly.]]) end, } + + +newTalent{ + name = "Momentum", + type = {"physical/dualweapon", 3}, + mode = "sustained", + points = 5, + cooldown = 30, + sustain_stamina = 50, + require = { stat = { dex=20 }, }, + activate = function(self, t) + local weapon = self:getInven("MAINHAND")[1] + local offweapon = self:getInven("OFFHAND")[1] + if not weapon or not offweapon or not weapon.combat or not offweapon.combat then + game.logPlayer(self, "You cannot use Flurry without dual wielding!") + return nil + end + + return { + combat_physspeed = self:addTemporaryValue("combat_physspeed", -0.1 - self:getTalentLevel(t) / 10), + stamina_regen = self:addTemporaryValue("stamina_regen", -5), + } + end, + deactivate = function(self, t, p) + self:removeTemporaryValue("combat_physspeed", p.combat_physspeed) + self:removeTemporaryValue("stamina_regen", p.stamina_regen) + return true + end, + info = function(self) + return ([[Greatly increases attack speed, but drains stamina quickly.]]) + end, +} diff --git a/game/modules/tome/data/talents/spells/conveyance.lua b/game/modules/tome/data/talents/spells/conveyance.lua index e797a24d5a4d91debcb9a4b75ba5623d1c7e2571..bd8b431125e414d76d94b1a10ec969ad8088ffc0 100644 --- a/game/modules/tome/data/talents/spells/conveyance.lua +++ b/game/modules/tome/data/talents/spells/conveyance.lua @@ -12,10 +12,10 @@ newTalent{ local target = self if self:getTalentLevel(t) >= 5 then - local tx, ty = self:getTarget{default_target=self, type="hit", range=10} - if tx and ty then - target = game.level.map(tx, ty, Map.ACTOR) or self - end +-- local tx, ty = self:getTarget{type="hit", range=10} +-- if tx and ty then +-- target = game.level.map(tx, ty, Map.ACTOR) or self +-- end end local x, y = self.x, self.y @@ -25,7 +25,7 @@ newTalent{ -- Target code doesnot restrict the target coordinates to the range, it lets the poject function do it -- but we cant ... x, y = game.target:pointAtRange(self.x, self.y, x, y, 10 + self:combatSpellpower(0.1)) - target:teleportRandom(x, y, 20 - self:getTalentLevel(t)) + target:teleportRandom(x, y, 7 - self:getTalentLevel(t)) else target:teleportRandom(x, y, 10 + self:combatSpellpower(0.1)) end diff --git a/game/modules/tome/data/zones/tower-amon-sul/zone.lua b/game/modules/tome/data/zones/tower-amon-sul/zone.lua index a73f3476d6d76d32dac05aa08ea883b0b164cbfc..b182ee1f151435c59434effcf6cef8bd1752fd93 100644 --- a/game/modules/tome/data/zones/tower-amon-sul/zone.lua +++ b/game/modules/tome/data/zones/tower-amon-sul/zone.lua @@ -4,7 +4,7 @@ return { level_scheme = "player", max_level = 5, width = 50, height = 50, --- all_remembered = true, + all_remembered = true, -- all_lited = true, -- persistant = true, generator = { diff --git a/ideas/cunning.ods b/ideas/cunning.ods index 17e62e4d39e9247231f30fbe7eae99750d3cbf6b..e3dcb946915a369c773e1a270998970b3c24a754 100644 Binary files a/ideas/cunning.ods and b/ideas/cunning.ods differ diff --git a/ideas/spells.ods b/ideas/spells.ods index ad35ee00bac2a532847ba5034f8948e3a57f0f25..b30c48a9f9801fa0c380e749817b7105fd02245f 100644 Binary files a/ideas/spells.ods and b/ideas/spells.ods differ diff --git a/ideas/technics.ods b/ideas/technics.ods index 6ff3174ec760c72d3bc54466e83fa4916f7b8b40..d19df187f02ff17e5e140264285b883dd395e422 100644 Binary files a/ideas/technics.ods and b/ideas/technics.ods differ