Skip to content
Snippets Groups Projects
Commit 1e2b1c66 authored by Eric Wykoff's avatar Eric Wykoff
Browse files

consistency is good

parent 44348de1
No related branches found
No related tags found
No related merge requests found
......@@ -144,4 +144,209 @@ load("/data/talents/chronomancy/timetravel.lua")
load("/data/talents/chronomancy/other.lua")
-- Anomalies, not learnable talents that may be cast instead of the intended spell when paradox gets to high
load("/data/talents/chronomancy/anomalies.lua")
\ No newline at end of file
load("/data/talents/chronomancy/anomalies.lua")
-- Paradox Functions
-- Paradox modifier. This dictates paradox cost and spellpower scaling
-- Note that 300 is the optimal balance
-- Caps at -50% and +50%
getParadoxModifier = function (self)
local paradox = self:getParadox()
local pm = util.bound(math.sqrt(paradox / 300), 0.5, 1.5)
return pm
end
-- Paradox cost (regulates the cost of paradox talents)
getParadoxCost = function (self, t, value)
local pm = getParadoxModifier(self)
local multi = 1
if self:attr("paradox_cost_multiplier") then
multi = 1 - self:attr("paradox_cost_multiplier")
end
return (value * pm) * multi
end
-- Paradox Spellpower (regulates spellpower for chronomancy)
getParadoxSpellpower = function(self, t, mod, add)
local pm = getParadoxModifier(self)
local mod = mod or 1
-- Empower?
local p = self:isTalentActive(self.T_EMPOWER)
if p and p.talent == t.id then
pm = pm + self:callTalent(self.T_EMPOWER, "getPower")
end
local spellpower = self:combatSpellpower(mod * pm, add)
return spellpower
end
-- Extension Spellbinding
getExtensionModifier = function(self, t, value)
local mod = 1
local p = self:isTalentActive(self.T_EXTENSION)
if p and p.talent == t.id then
mod = mod + self:callTalent(self.T_EXTENSION, "getPower")
end
value = math.ceil(value * mod)
return value
end
-- Tunes paradox
tuneParadox = function(self, t, value)
local dox = self:getParadox() - (self.preferred_paradox or 300)
local fix = math.min( math.abs(dox), value )
if dox > 0 then
self:incParadox( -fix )
elseif dox < 0 then
self:incParadox( fix )
end
end
--- Warden weapon functions
-- Checks for weapons in main and quickslot
doWardenPreUse = function(self, weapon, silent)
if weapon == "bow" then
if not self:hasArcheryWeapon("bow") and not self:hasArcheryWeaponQS("bow") then
return false
end
end
if weapon == "dual" then
if not self:hasDualWeapon() and not self:hasDualWeaponQS() then
return false
end
end
return true
end
-- Swaps weapons if needed
doWardenWeaponSwap = function(self, t, type, silent)
local swap = false
local warden_weapon
if type == "blade" then
local mainhand, offhand = self:hasDualWeapon()
if not mainhand then
swap = true
warden_weapon = "blade"
end
end
if type == "bow" then
if not self:hasArcheryWeapon("bow") then
swap = true
warden_weapon = "bow"
end
end
if swap == true then
local old_inv_access = self.no_inventory_access -- Make sure clones can swap
self.no_inventory_access = nil
self:attr("no_sound", 1)
self:quickSwitchWeapons(true, "warden", silent)
self:attr("no_sound", -1)
self.no_inventory_access = old_inv_access
end
return swap, dam
end
-- Target helper function for focus fire
checkWardenFocus = function(self)
local target
local eff = self:hasEffect(self.EFF_WARDEN_S_FOCUS)
if eff then
target = eff.target
end
return target
end
-- Spell functions
makeParadoxClone = function(self, target, duration)
local m = target:cloneFull{
shader = "shadow_simulacrum",
shader_args = { color = {0.6, 0.6, 0.2}, base = 0.8, time_factor = 1500 },
no_drops = true,
faction = target.faction,
summoner = target, summoner_gain_exp=true,
summon_time = duration,
ai_target = {actor=nil},
ai = "summoned", ai_real = "tactical",
name = ""..target.name.."'s temporal clone",
desc = [[A creature from another timeline.]],
}
m:removeAllMOs()
m.make_escort = nil
m.on_added_to_level = nil
m.on_added = nil
mod.class.NPC.castAs(m)
engine.interface.ActorAI.init(m, m)
m.exp_worth = 0
m.energy.value = 0
m.player = nil
m.max_life = m.max_life
m.life = util.bound(m.life, 0, m.max_life)
m.forceLevelup = function() end
m.on_die = nil
m.die = nil
m.puuid = nil
m.on_acquire_target = nil
m.no_inventory_access = true
m.no_levelup_access = true
m.on_takehit = nil
m.seen_by = nil
m.can_talk = nil
m.clone_on_hit = nil
m.self_resurrect = nil
m.escort_quest = nil
m.unused_talents = 0
m.unused_generics = 0
if m.talents.T_SUMMON then m.talents.T_SUMMON = nil end
if m.talents.T_MULTIPLY then m.talents.T_MULTIPLY = nil end
-- We use this function... a lot!!
-- So don't duplicate the inventory
if m.inven then m.inven[m.INVEN_INVEN] = nil end
-- Clones never flee because they're awesome
m.ai_tactic = m.ai_tactic or {}
m.ai_tactic.escape = 0
-- Remove some talents
local tids = {}
for tid, _ in pairs(m.talents) do
local t = m:getTalentFromId(tid)
if (t.no_npc_use and not t.allow_temporal_clones) or t.remove_on_clone then tids[#tids+1] = t end
end
for i, t in ipairs(tids) do
if t.mode == "sustained" and m:isTalentActive(t.id) then m:forceUseTalent(t.id, {ignore_energy=true, silent=true}) end
m:unlearnTalentFull(t.id)
end
-- remove timed effects
m:removeTimedEffectsOnClone()
-- reset folds for our Warden clones
for tid, cd in pairs(m.talents_cd) do
local t = m:getTalentFromId(tid)
if t.type[1]:find("^chronomancy/manifold") and m:knowTalent(tid) then
m:alterTalentCoolingdown(t, -cd)
end
end
-- And finally, a bit of sanity in case anyone decides they should blow up the world..
if m.preferred_paradox and m.preferred_paradox > 600 then m.preferred_paradox = 600 end
return m
end
-- Make sure we don't run concurrent chronoworlds; to prevent lag and possible game breaking bugs or exploits
checkTimeline = function(self)
if game._chronoworlds == nil then
return false
else
return true
end
end
\ No newline at end of file
......@@ -18,211 +18,6 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
-- Paradox Functions
-- Paradox modifier. This dictates paradox cost and spellpower scaling
-- Note that 300 is the optimal balance
-- Caps at -50% and +50%
getParadoxModifier = function (self)
local paradox = self:getParadox()
local pm = util.bound(math.sqrt(paradox / 300), 0.5, 1.5)
return pm
end
-- Paradox cost (regulates the cost of paradox talents)
getParadoxCost = function (self, t, value)
local pm = getParadoxModifier(self)
local multi = 1
if self:attr("paradox_cost_multiplier") then
multi = 1 - self:attr("paradox_cost_multiplier")
end
return (value * pm) * multi
end
-- Paradox Spellpower (regulates spellpower for chronomancy)
getParadoxSpellpower = function(self, t, mod, add)
local pm = getParadoxModifier(self)
local mod = mod or 1
-- Empower?
local p = self:isTalentActive(self.T_EMPOWER)
if p and p.talent == t.id then
pm = pm + self:callTalent(self.T_EMPOWER, "getPower")
end
local spellpower = self:combatSpellpower(mod * pm, add)
return spellpower
end
-- Extension Spellbinding
getExtensionModifier = function(self, t, value)
local mod = 1
local p = self:isTalentActive(self.T_EXTENSION)
if p and p.talent == t.id then
mod = mod + self:callTalent(self.T_EXTENSION, "getPower")
end
value = math.ceil(value * mod)
return value
end
-- Tunes paradox
tuneParadox = function(self, t, value)
local dox = self:getParadox() - (self.preferred_paradox or 300)
local fix = math.min( math.abs(dox), value )
if dox > 0 then
self:incParadox( -fix )
elseif dox < 0 then
self:incParadox( fix )
end
end
--- Warden weapon functions
-- Checks for weapons in main and quickslot
doWardenPreUse = function(self, weapon, silent)
if weapon == "bow" then
if not self:hasArcheryWeapon("bow") and not self:hasArcheryWeaponQS("bow") then
return false
end
end
if weapon == "dual" then
if not self:hasDualWeapon() and not self:hasDualWeaponQS() then
return false
end
end
return true
end
-- Swaps weapons if needed
doWardenWeaponSwap = function(self, t, type, silent)
local swap = false
local warden_weapon
if type == "blade" then
local mainhand, offhand = self:hasDualWeapon()
if not mainhand then
swap = true
warden_weapon = "blade"
end
end
if type == "bow" then
if not self:hasArcheryWeapon("bow") then
swap = true
warden_weapon = "bow"
end
end
if swap == true then
local old_inv_access = self.no_inventory_access -- Make sure clones can swap
self.no_inventory_access = nil
self:attr("no_sound", 1)
self:quickSwitchWeapons(true, "warden", silent)
self:attr("no_sound", -1)
self.no_inventory_access = old_inv_access
end
return swap, dam
end
-- Target helper function for focus fire
checkWardenFocus = function(self)
local target
local eff = self:hasEffect(self.EFF_WARDEN_S_FOCUS)
if eff then
target = eff.target
end
return target
end
-- Spell functions
makeParadoxClone = function(self, target, duration)
local m = target:cloneFull{
shader = "shadow_simulacrum",
shader_args = { color = {0.6, 0.6, 0.2}, base = 0.8, time_factor = 1500 },
no_drops = true,
faction = target.faction,
summoner = target, summoner_gain_exp=true,
summon_time = duration,
ai_target = {actor=nil},
ai = "summoned", ai_real = "tactical",
name = ""..target.name.."'s temporal clone",
desc = [[A creature from another timeline.]],
}
m:removeAllMOs()
m.make_escort = nil
m.on_added_to_level = nil
m.on_added = nil
mod.class.NPC.castAs(m)
engine.interface.ActorAI.init(m, m)
m.exp_worth = 0
m.energy.value = 0
m.player = nil
m.max_life = m.max_life
m.life = util.bound(m.life, 0, m.max_life)
m.forceLevelup = function() end
m.on_die = nil
m.die = nil
m.puuid = nil
m.on_acquire_target = nil
m.no_inventory_access = true
m.no_levelup_access = true
m.on_takehit = nil
m.seen_by = nil
m.can_talk = nil
m.clone_on_hit = nil
m.self_resurrect = nil
m.escort_quest = nil
m.unused_talents = 0
m.unused_generics = 0
if m.talents.T_SUMMON then m.talents.T_SUMMON = nil end
if m.talents.T_MULTIPLY then m.talents.T_MULTIPLY = nil end
-- We use this function... a lot!!
-- So don't duplicate the inventory
if m.inven then m.inven[m.INVEN_INVEN] = nil end
-- Clones never flee because they're awesome
m.ai_tactic = m.ai_tactic or {}
m.ai_tactic.escape = 0
-- Remove some talents
local tids = {}
for tid, _ in pairs(m.talents) do
local t = m:getTalentFromId(tid)
if (t.no_npc_use and not t.allow_temporal_clones) or t.remove_on_clone then tids[#tids+1] = t end
end
for i, t in ipairs(tids) do
if t.mode == "sustained" and m:isTalentActive(t.id) then m:forceUseTalent(t.id, {ignore_energy=true, silent=true}) end
m:unlearnTalentFull(t.id)
end
-- remove timed effects
m:removeTimedEffectsOnClone()
-- reset folds for our Warden clones
for tid, cd in pairs(m.talents_cd) do
local t = m:getTalentFromId(tid)
if t.type[1]:find("^chronomancy/manifold") and m:knowTalent(tid) then
m:alterTalentCoolingdown(t, -cd)
end
end
-- And finally, a bit of sanity in case anyone decides they should blow up the world..
if m.preferred_paradox and m.preferred_paradox > 600 then m.preferred_paradox = 600 end
return m
end
-- Make sure we don't run concurrent chronoworlds; to prevent lag and possible game breaking bugs or exploits
checkTimeline = function(self)
if game._chronoworlds == nil then
return false
else
return true
end
end
-- Misc. Paradox Talents
newTalent{
name = "Spacetime Tuning",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment