Skip to content
Snippets Groups Projects
Commit 787ccbe9 authored by DarkGod's avatar DarkGod
Browse files

alchemist stuff

parent 9ad1c4ed
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ newTalent{
mode = "passive",
points = 5,
getDuration = function(self, t) return math.floor(self:combatScale(self:combatSpellpower(0.03) * self:getTalentLevel(t), 2, 0, 10, 8)) end,
getChance = function(self, t) return math.floor(self:combatScale(self:combatSpellpower(0.03) * self:getTalentLevel(t), 20, 0, 55, 8)) end,
getChance = function(self, t) return self:combatLimit(self:combatSpellpower(0.03) * self:getTalentLevel(t), 100, 20, 0, 55, 8) end,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 5, 120) end,
applyEffect = function(self, t, golem)
local duration = t.getDuration(self, t)
......@@ -64,10 +64,10 @@ newTalent{
info = function(self, t)
local duration = t.getDuration(self, t)
local chance = t.getChance(self, t)
local dam = t.getDamage(self, t)
return ([[While you have Acid Infusion active, when your bombs hit your golem they coat it in acid for %d turns.
While coated any melee hits has %d%% chance to trigger a small cone of acid doing %0.2f damage to all caught inside (this can only happen once per turn).
Effects will increase with your Spellpower.]]):
local dam = self.alchemy_golem and self.alchemy_golem:damDesc(engine.DamageType.ACID, t.getDamage(self, t)) or 0
return ([[While Acid Infusion is active, your bombs coat your golem in acid for %d turns when they hit it.
While coated, any melee hit agaist your golem has a %d%% chance to trigger a radius 4 cone of acid towards the attacker that does %0.1f Acid damage to all caught inside. (This can only happen once per turn.)
The effects increase with your talent level and with the Spellpower and damage modifiers of your golem.]]):
format(duration, chance, dam)
end,
}
......@@ -95,7 +95,7 @@ newTalent{
end,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 7, 60) end,
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 6, 10)) end,
getSlow = function(self, t) return math.floor(self:combatTalentScale(t, 10, 40)) end,
getSlow = function(self, t) return self:combatTalentLimit(t, 100, 10, 40) end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
......@@ -119,7 +119,7 @@ newTalent{
local slow = t.getSlow(self, t)
local duration = t.getDuration(self, t)
local radius = self:getTalentRadius(t)
return ([[A pool of acid spawns at the target location in radius %d, doing %0.2f acid damage each turn for %d turns.
return ([[A radius %d pool of acid spawns at the target location, doing %0.1f Acid damage each turn for %d turns.
All creatures caught in the mire will also suffer a %d%% slowness effect.
The damage will increase with your Spellpower.]]):
format(radius, damDesc(self, DamageType.ACID, damage), duration, slow)
......@@ -152,7 +152,7 @@ newTalent{
local effs = {}
-- Go through all spell effects
-- Go through all mental and physical effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if (e.type == "mental" or e.type == "physical") and e.status == "beneficial" then
......@@ -160,7 +160,7 @@ newTalent{
end
end
-- Go through all sustained spells
-- Go through all mental sustains
for tid, act in pairs(target.sustain_talents) do
local t = self:getTalentFromId(tid)
if act and t.is_mind then
......@@ -188,8 +188,8 @@ newTalent{
end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Acid errupts all around your target, dealing %0.2f acid damage.
The acid attack is extremely distracting, giving a chance to remove up to %d physical or mental temporary effects or mental sustains.
The damage and chance will increase with your Spellpower.]]):format(damDesc(self, DamageType.ACID, damage), t.getRemoveCount(self, t))
return ([[Acid errupts all around your target, dealing %0.1f acid damage.
The acid attack is extremely distracting, and may remove up to %d physical or mental temporary effects or mental sustains (depending on the Spell Save of the target).
The damage and chance to remove effects will increase with your Spellpower.]]):format(damDesc(self, DamageType.ACID, damage), t.getRemoveCount(self, t))
end,
}
......@@ -31,13 +31,7 @@ newTalent{
target = function(self, t)
local ammo = self:hasAlchemistWeapon()
if not ammo then return end
-- Using friendlyfire, although this could affect escorts etc.
local friendlyfire = true
local prot = self:getTalentLevelRaw(self.T_ALCHEMIST_PROTECTION) * 20
if prot > 0 then
friendlyfire = 100 - prot
end
return {type="ball", range=self:getTalentRange(t)+(ammo and ammo.alchemist_bomb and ammo.alchemist_bomb.range or 0), radius=self:getTalentRadius(t), friendlyfire=friendlyfire, talent=t}
return {type="ball", range=self:getTalentRange(t)+(ammo and ammo.alchemist_bomb and ammo.alchemist_bomb.range or 0), radius=self:getTalentRadius(t), talent=t}
end,
tactical = { ATTACKAREA = function(self, t, target)
if self:isTalentActive(self.T_ACID_INFUSION) then return { ACID = 2 }
......@@ -97,20 +91,24 @@ newTalent{
local tmp = {}
local grids = self:project(tg, x, y, function(tx, ty)
local d = dam
local target = game.level.map(tx, ty, Map.ACTOR)
-- Protect yourself
if tx == self.x and ty == self.y then d = dam * (1 - prot) end
if tx == self.x and ty == self.y then
d = dam * (1 - prot)
-- Protect the golem
if golem and tx == golem.x and ty == golem.y then
elseif golem and tx == golem.x and ty == golem.y then
d = dam * (1 - prot)
if self:isTalentActive(self.T_FROST_INFUSION) and self:knowTalent(self.T_ICE_ARMOUR) then
self:callTalent(self.T_ICE_ARMOUR, "applyEffect", golem)
elseif self:isTalentActive(self.T_ACID_INFUSION) and self:knowTalent(self.T_CAUSTIC_GOLEM) then
self:callTalent(self.T_CAUSTIC_GOLEM, "applyEffect", golem)
end
else -- reduced damage to friendly npcs (could make random chance like friendlyfire instead)
if target and self:reactionToward(target) > 0 then d = dam * (1 - prot) end
end
if d == 0 then return end
if d <= 0 then return end
local target = game.level.map(tx, ty, Map.ACTOR)
-- local target = game.level.map(tx, ty, Map.ACTOR)
dam_done = dam_done + DamageType:get(damtype).projector(self, tx, ty, damtype, d, tmp)
if ammo.alchemist_bomb and ammo.alchemist_bomb.splash then
DamageType:get(DamageType[ammo.alchemist_bomb.splash.type]).projector(self, tx, ty, DamageType[ammo.alchemist_bomb.splash.type], ammo.alchemist_bomb.splash.dam)
......@@ -140,7 +138,7 @@ newTalent{
if ammo then dam, damtype = t.computeDamage(self, t, ammo) end
dam = damDesc(self, damtype, dam)
return ([[Imbue an alchemist gem with an explosive charge of mana and throw it.
The gem will explode for %0.2f %s damage.
The gem will explode for %0.1f %s damage.
Each kind of gem will also provide a specific effect.
The damage will improve with better gems and with your Spellpower.]]):format(dam, DamageType:get(damtype).name)
end,
......@@ -165,9 +163,9 @@ newTalent{
self.resists[DamageType.ACID] = self.resists[DamageType.ACID] - 3
end,
info = function(self, t)
return ([[Improves your resistance (and your golem's) against the elemental damage of your own bombs by %d%%, and against external elemental damage (fire, cold, lightning and acid) by %d%%.
At talent level 5 it also protects you against all side effects of your bombs.]]):
format(self:getTalentLevelRaw(t) * 20, self:getTalentLevelRaw(t) * 3)
return ([[Grants %d%% protection to you, your golem and other friendly creatures against the elemental damage of your own bombs, and against external elemental damage (fire, cold, lightning and acid) by %d%%.
At talent level 5 it also protects against all side effects of your bombs.]]):
format(math.min(100, self:getTalentLevelRaw(t) * 20), self:getTalentLevelRaw(t) * 3)
end,
}
......
......@@ -63,11 +63,11 @@ newTalent{
end,
info = function(self, t)
local duration = t.getDuration(self, t)
local dam = t.getDamage(self, t)
local dam = self.alchemy_golem and self.alchemy_golem:damDesc(engine.DamageType.COLD, t.getDamage(self, t)) or 0
local armor = t.getArmor(self, t)
return ([[While you have Frost Infusion active, when your bombs hit your golem they grant it an ice armour for %d turns.
The ice armour provides it with %d armour, %0.2f cold damage when it gets hit and 50%% of its damage is done as cold.
Effects will increase with your Spellpower.]]):
return ([[While Frost Infusion is active, your bombs deposit a layer of ice on your golem for %d turns when they hit it.
This ice provides your golem with %d additional armour, melee attacks against it deal %0.1f Cold damage to the attacker, and 50%% of its damage is converted to Cold.
The effects increase with your talent level and with the Spellpower and damage modifiers of your golem.]]):
format(duration, armor, dam)
end,
}
......@@ -85,21 +85,22 @@ newTalent{
range = 0,
getDuration = function(self, t) return math.floor(self:combatScale(self:combatSpellpower(0.03) * self:getTalentLevel(t), 2, 0, 10, 8)) end,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2, 6)) end,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 250) end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), friendlyfire=false, talent=t}
end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local grids = self:project(tg, self.x, self.y, DamageType.COLDNEVERMOVE, {dur=t.getDuration(self, t), dam=1})
local grids = self:project(tg, self.x, self.y, DamageType.COLDNEVERMOVE, {dur=t.getDuration(self, t), dam=t.getDamage(self, t)})
game.level.map:particleEmitter(self.x, self.y, tg.radius, "ball_ice", {radius=tg.radius})
game:playSoundNear(self, "talents/ice")
return true
end,
info = function(self, t)
local radius = self:getTalentRadius(t)
return ([[Blast a wave of cold all around you with a radius of %d, doing %0.2f cold damage and freezing creatures to the ground for %d turns.
return ([[Invoke a blast of cold all around you with a radius of %d, doing %0.1f Cold damage and freezing creatures to the ground for %d turns.
Affected creatures can still act, but cannot move.
The duration will increase with your Spellpower.]]):format(radius, damDesc(self, DamageType.COLD, 1), t.getDuration(self, t))
The duration will increase with your Spellpower.]]):format(radius, damDesc(self, DamageType.COLD, t.getDamage(self, t)), t.getDuration(self, t))
end,
}
......@@ -115,11 +116,12 @@ newTalent{
tactical = { BUFF=1 },
critResist = function(self, t) return self:combatTalentScale(t, 10, 50) end,
getResistance = function(self, t) return self:combatTalentSpellDamage(t, 5, 45) end,
getAffinity = function(self, t) return self:combatTalentLimit(t, 50, 5, 20) end, -- Limit <50%
activate = function(self, t)
game:playSoundNear(self, "talents/ice")
local ret = {}
self:talentTemporaryValue(ret, "resists", {[DamageType.PHYSICAL] = t.getResistance(self, t) * 0.6})
self:talentTemporaryValue(ret, "damage_affinity", {[DamageType.COLD] = t.getResistance(self, t)})
self:talentTemporaryValue(ret, "damage_affinity", {[DamageType.COLD] = t.getAffinity(self, t)})
self:talentTemporaryValue(ret, "ignore_direct_crits", t.critResist(self, t))
return ret
end,
......@@ -129,9 +131,9 @@ newTalent{
info = function(self, t)
local resist = t.getResistance(self, t)
local crit = t.critResist(self, t)
return ([[Turn your body into pure ice, increasing your cold damage affinity by %d%% and your physical resistance by %d%%.
return ([[Turn your body into pure ice, increasing your Cold damage affinity by %d%% and your physical resistance by %d%%.
All direct critical hits (physical, mental, spells) against you have a %d%% lower Critical multiplier (but always do at least normal damage).
The effects will increase with your Spellpower.]]):
format(resist, resist * 0.6, crit)
The effects increase with your Spellpower.]]):
format(t.getAffinity(self, t), resist, resist * 0.6, crit)
end,
}
......@@ -2402,13 +2402,13 @@ newEffect{
newEffect{
name = "ICE_ARMOUR", image = "talents/ice_armour.png",
desc = "Ice Armour",
long_desc = function(self, eff) return ("The target is covered in a layer of ice. Armour increased by %d, damage when hit %0.2f cold, converts 50%% of all damage to cold."):format(eff.armor, eff.dam) end,
long_desc = function(self, eff) return ("The target is covered in a layer of ice. Its armour is increased by %d, it deals %0.1f Cold damage to attackers that hit in melee, and 50%% of it's damage is converted to cold."):format(eff.armor, self:damDesc(DamageType.COLD, eff.dam)) end,
type = "magical",
subtype = { cold=true, armour=true, },
status = "beneficial",
parameters = {armor=10, dam=10},
on_gain = function(self, err) return "#Target# is covered in ice!" end,
on_lose = function(self, err) return "#Target# is free from the ice." end,
on_gain = function(self, err) return "#Target# is covered in icy armor!" end,
on_lose = function(self, err) return "#Target#'s ice coating crumbles away." end,
activate = function(self, eff)
self:effectTemporaryValue(eff, "combat_armor", eff.armor)
self:effectTemporaryValue(eff, "on_melee_hit", {[DamageType.COLD]=eff.dam})
......@@ -2422,13 +2422,13 @@ newEffect{
newEffect{
name = "CAUSTIC_GOLEM", image = "talents/caustic_golem.png",
desc = "Caustic Golem",
long_desc = function(self, eff) return ("The target is coated with acid. %d%% chances to spray a cone of acid doing %0.2f damage."):format(eff.chance, eff.dam) end,
long_desc = function(self, eff) return ("The target is coated with acid. When struck in melee, it has a %d%% chance to spray a cone of acid towards the attacker doing %0.1f damage."):format(eff.chance, self:damDesc(DamageType.ACID, eff.dam)) end,
type = "magical",
subtype = { acid=true, coating=true, },
status = "beneficial",
parameters = {chance=10, dam=10},
on_gain = function(self, err) return "#Target# is coated in acid!" end,
on_lose = function(self, err) return "#Target# is free from the acid." end,
on_lose = function(self, err) return "#Target#'s acid coating is diluted." end,
callbackOnMeleeHit = function(self, eff, src)
if self.turn_procs.caustic_golem then return end
if not rng.percent(eff.chance) then return end
......
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