diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index a2e361bc8184379a9f212046cfdb2c7ace6f50e0..ea2a2f3390fefee04e5cf2d67353fc9f993b742b 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -41,6 +41,9 @@ _M.projectile_class = "mod.class.Projectile" _M.logCombat = Combat.logCombat +-- ego fields that are appended as a list when the ego is applied (by Zone:applyEgo) +_M._special_ego_rules = {special_on_hit=true, special_on_crit=true, special_on_kill=true, charm_on_use=true} + function _M:getRequirementDesc(who) local base_getRequirementDesc = engine.Object.getRequirementDesc if self.subtype == "shield" and type(self.require) == "table" and who:knowTalent(who.T_SKIRMISHER_BUCKLER_EXPERTISE) then diff --git a/game/modules/tome/class/Zone.lua b/game/modules/tome/class/Zone.lua index 7a78aa8fcbee44cbb4b1fc16d5a646b712d35c64..aaf08bf5c24ce1e1a410d276b27f9cf6c388c847 100644 --- a/game/modules/tome/class/Zone.lua +++ b/game/modules/tome/class/Zone.lua @@ -28,10 +28,15 @@ _M:enableLastPersistZones(3) -- retain the room map after level generation (for runPostGeneration callbacks) _M._retain_level_room_map = true +-- object ego fields that are appended as a list when the ego is applied +-- overridden by mod.class.Object._special_ego_rules (defined here for backwards compatibility) +_M._object_special_ego_rules = {special_on_hit=true, special_on_crit=true, special_on_kill=true} + -- Merge special_on_crit values. _M:addEgoRule("object", function(dvalue, svalue, key, dst, src, rules, state) - -- Only work on the special_on_* keys. - if key ~= 'special_on_hit' and key ~= 'special_on_crit' and key ~= 'special_on_kill' then return end + -- Only apply to some special fields + local special_rule_egos = mod.class.Object._special_ego_rules or _M._object_special_ego_rules + if not special_rule_egos[key] then return end -- If the special isn't a table, make it an empty one. if type(dvalue) ~= 'table' then dvalue = {} end if type(svalue) ~= 'table' then svalue = {} end diff --git a/game/modules/tome/data/general/objects/egos/charms.lua b/game/modules/tome/data/general/objects/egos/charms.lua index a5ae6f4f55b47fe4ef29c222ab8762a0ed09356e..e69ce495711f8c69c6dfd7498eec594a957dc22c 100644 --- a/game/modules/tome/data/general/objects/egos/charms.lua +++ b/game/modules/tome/data/general/objects/egos/charms.lua @@ -17,16 +17,35 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +-- modify the power and cooldown of charm powers +-- This makes adjustments after zone:finishEntity is finished, which handles any egos added via e.addons +local function modify_charm(e, e, zone, level) + for i, c_mod in ipairs(e.charm_power_mods) do + c_mod(e, e, zone, level) + end + if e._old_finish and e._old_finish ~= e._modify_charm then return e._old_finish(e, e, zone, level) end +end + newEntity{ name = "quick ", prefix=true, keywords = {quick=true}, level_range = {1, 50}, rarity = 15, cost = 5, + _modify_charm = modify_charm, resolvers.genericlast(function(e) - if not e.use_power or not e.charm_power then return end - e.use_power.power = math.ceil(e.use_power.power * rng.float(0.6, 0.8)) - e.charm_power = math.ceil(e.charm_power * rng.float(0.4, 0.7)) + if e.finish ~= e._modify_charm then e._old_finish = e.finish end + e.finish = e._modify_charm + e.charm_power_mods = e.charm_power_mods or {} + table.insert(e.charm_power_mods, function(e, e, zone, level) + if e.charm_power and e.use_power and e.use_power.power then + print("\t Applying quick ego changes.") + e.use_power.power = math.ceil(e.use_power.power * rng.float(0.6, 0.8)) + e.charm_power = math.ceil(e.charm_power * rng.float(0.6, 0.9)) + else + print("\tquick ego changes aborted.") + end + end) end), } @@ -36,10 +55,20 @@ newEntity{ level_range = {1, 50}, rarity = 15, cost = 5, + _modify_charm = modify_charm, resolvers.genericlast(function(e) - if not e.use_power or not e.charm_power then return end - e.use_power.power = math.ceil(e.use_power.power * rng.float(1.2, 1.5)) - e.charm_power = math.ceil(e.charm_power * rng.float(1.3, 1.5)) + if e.finish ~= e._modify_charm then e._old_finish = e.finish end + e.finish = e._modify_charm + e.charm_power_mods = e.charm_power_mods or {} + table.insert(e.charm_power_mods, function(e, e, zone, level) + if e.charm_power and e.use_power and e.use_power.power then + print("\t Applying supercharged ego changes.") + e.use_power.power = math.ceil(e.use_power.power * rng.float(1.1, 1.3)) + e.charm_power = math.ceil(e.charm_power * rng.float(1.3, 1.5)) + else + print("\tsupercharged ego changes aborted.") + end + end) end), } @@ -50,9 +79,19 @@ newEntity{ greater_ego = 1, rarity = 16, cost = 5, + _modify_charm = modify_charm, resolvers.genericlast(function(e) - if not e.use_power or not e.charm_power then return end - e.use_power.power = math.ceil(e.use_power.power * rng.float(1.4, 1.7)) - e.charm_power = math.ceil(e.charm_power * rng.float(1.6, 1.9)) + if e.finish ~= e._modify_charm then e._old_finish = e.finish end + e.finish = e._modify_charm + e.charm_power_mods = e.charm_power_mods or {} + table.insert(e.charm_power_mods, function(e, e, zone, level) + if e.charm_power and e.use_power and e.use_power.power then + print("\t Applying overpowered ego changes.") + e.use_power.power = math.ceil(e.use_power.power * rng.float(1.2, 1.5)) + e.charm_power = math.ceil(e.charm_power * rng.float(1.6, 1.9)) + else + print("\toverpowered ego changes aborted.") + end + end) end), } diff --git a/game/modules/tome/data/general/objects/egos/torques.lua b/game/modules/tome/data/general/objects/egos/torques.lua index 7b582276cfc3ef582545fa6e79eb02010ad4c3ef..37aa4fad657fc96f3e405710086db431f0f937cb 100644 --- a/game/modules/tome/data/general/objects/egos/torques.lua +++ b/game/modules/tome/data/general/objects/egos/torques.lua @@ -34,7 +34,7 @@ newEntity{ who:incPsi(self:getCharmPower(who, true) / 7) end}, }, - use_power = {tactical = {PSI = 1}} + use_power = {tactical = {PSI = 0.5}} } newEntity{ @@ -49,7 +49,7 @@ newEntity{ who:incHate(self:getCharmPower(who, true) / 7) end}, }, - use_power = {tactical = {HATE = 1}} + use_power = {tactical = {HATE = 0.5}} } newEntity{ @@ -79,7 +79,7 @@ newEntity{ cost = 5, wielder = { - talent_cd_reduction={[Talents.T_SILENCE]=-5}, + talent_cd_reduction={[Talents.T_SILENCE]=1}, learn_talent = {[Talents.T_SILENCE] = resolvers.mbonus_material(4, 1)}, }, } @@ -93,7 +93,7 @@ newEntity{ cost = 5, wielder = { - talent_cd_reduction={[Talents.T_TELEKINETIC_BLAST]=-5}, +-- talent_cd_reduction={[Talents.T_TELEKINETIC_BLAST]=-5}, learn_talent = {[Talents.T_TELEKINETIC_BLAST] = resolvers.mbonus_material(4, 1)}, }, } diff --git a/game/modules/tome/data/general/objects/egos/totems-powers.lua b/game/modules/tome/data/general/objects/egos/totems-powers.lua index a514f1eaa006c2205184c17be4864aff3c6545b4..36d256746bde3430a54c4b2a35f63d1c036158ca 100644 --- a/game/modules/tome/data/general/objects/egos/totems-powers.lua +++ b/game/modules/tome/data/general/objects/egos/totems-powers.lua @@ -21,7 +21,6 @@ Totems *healing *cure illness -*cure poisons *thorny skin ]] @@ -79,7 +78,8 @@ newEntity{ end end return nb - end}, + end, + }, }), } @@ -122,7 +122,7 @@ newEntity{ who:project(tg, x, y, engine.DamageType.HEAL, dam) game:playSoundNear(who, "talents/heal") return {id=true, used=true} - end, + end, "T_GLOBAL_CD", {range = function(self, who) return math.floor(who:combatStatScale("wil", 6, 10)) end, damage = function(self, who) return self:getCharmPower(who) end, diff --git a/game/modules/tome/data/general/objects/egos/totems.lua b/game/modules/tome/data/general/objects/egos/totems.lua index ab9e767f67679074b79d595a1ffc66e9266c9c16..eb206cf367523bb18fe4135a7effdbd439e6a493 100644 --- a/game/modules/tome/data/general/objects/egos/totems.lua +++ b/game/modules/tome/data/general/objects/egos/totems.lua @@ -34,7 +34,7 @@ newEntity{ who:incEquilibrium(-self:getCharmPower(who, true) / 5) end}, }, - use_power = {tactical = {EQUILIBRIUM = 1}} + use_power = {tactical = {EQUILIBRIUM = 0.5}} } newEntity{ @@ -49,7 +49,7 @@ newEntity{ who:incStamina(self:getCharmPower(who, true) / 6) end}, }, - use_power = {tactical = {STAMINA = 1}} + use_power = {tactical = {STAMINA = 0.5}} } newEntity{ @@ -79,6 +79,7 @@ newEntity{ cost = 5, wielder = { + talent_cd_reduction={[Talents.T_RUSHING_CLAWS]=1}, learn_talent = {[Talents.T_RUSHING_CLAWS] = resolvers.mbonus_material(4, 1)}, }, } @@ -92,6 +93,7 @@ newEntity{ cost = 5, wielder = { + talent_cd_reduction={[Talents.T_LAY_WEB]=1}, learn_talent = {[Talents.T_LAY_WEB] = resolvers.mbonus_material(4, 1)}, }, } @@ -105,7 +107,7 @@ newEntity{ cost = 15, wielder = { - talent_cd_reduction={[Talents.T_INVOKE_TENTACLE]=-5}, +-- talent_cd_reduction={[Talents.T_INVOKE_TENTACLE]=-5}, learn_talent = {[Talents.T_INVOKE_TENTACLE] = 1}, }, } diff --git a/game/modules/tome/data/general/objects/egos/wands.lua b/game/modules/tome/data/general/objects/egos/wands.lua index 3b8a8c671dea22e4671884727936625608c8d28a..a0f919d7ce526c6f73a4ebaaf82647854c353bb8 100644 --- a/game/modules/tome/data/general/objects/egos/wands.lua +++ b/game/modules/tome/data/general/objects/egos/wands.lua @@ -108,7 +108,7 @@ newEntity{ cost = 5, wielder = { - talent_cd_reduction={[Talents.T_VOID_BLAST]=-6}, +-- talent_cd_reduction={[Talents.T_VOID_BLAST]=-6}, learn_talent = {[Talents.T_VOID_BLAST] = resolvers.mbonus_material(4, 1)}, }, } @@ -122,6 +122,7 @@ newEntity{ cost = 5, wielder = { + talent_cd_reduction={[Talents.T_VOLCANO]=2}, learn_talent = {[Talents.T_VOLCANO] = resolvers.mbonus_material(4, 1)}, }, } @@ -135,6 +136,7 @@ newEntity{ cost = 5, wielder = { + talent_cd_reduction={[Talents.T_STRIKE]=1}, learn_talent = {[Talents.T_STRIKE] = resolvers.mbonus_material(4, 1)}, }, } diff --git a/game/modules/tome/resolvers.lua b/game/modules/tome/resolvers.lua index 0eaa3d85d7ca9314472760ee5760d260f2e27c9c..afbf9c5744d7ddd6518d73c9912adf8f5d91c8a9 100644 --- a/game/modules/tome/resolvers.lua +++ b/game/modules/tome/resolvers.lua @@ -497,7 +497,7 @@ function resolvers.calc.charm(tt, e) local cd = tt[2] e.max_power = cd e.power = e.max_power - e.use_power = {name=tt[1], power=cd, use=tt[3], __no_merge_add=true} + e.use_power = table.merge(e.use_power or {}, {name=tt[1], power=cd, use=tt[3], __no_merge_add=true}) if e.talent_cooldown == nil then e.talent_cooldown = tt[4] or "T_GLOBAL_CD" end if tt[5] then table.merge(e.use_power, tt[5], true) end return