Skip to content
Snippets Groups Projects
Commit d88d40ac authored by dg's avatar dg
Browse files

Switched Shield Wall and Repulsion

Shield Wall now reduces damage done by 20% instead of reducing attack/damage by flat values, making it more usefull at lower levels
Armour values are no more flat reductions of damage, instead armor deducts a % of the incomming damage, this means that super high armour values can not cheese out some npcs but no npc can cheese out the player either
APR follows the same idea as armour


git-svn-id: http://svn.net-core.org/repos/t-engine4@2790 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8d8c73cb
No related branches found
No related tags found
No related merge requests found
......@@ -192,7 +192,7 @@ function _M:receiveKey(sym, ctrl, shift, alt, meta, unicode, isup, ismouse)
local ks, us
if not ismouse then ks, us = self:makeKeyString(sym, ctrl, shift, alt, meta, unicode)
else ks = self:makeMouseString(sym, ctrl, shift, alt, meta) end
print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
-- print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
if self.binds[ks] and self.virtuals[self.binds[ks]] then
if isup and not _M.binds_def[self.binds[ks]].updown then return end
self.virtuals[self.binds[ks]](sym, ctrl, shift, alt, meta, unicode, isup)
......
......@@ -97,7 +97,7 @@ end
function _M:talk(msg)
if not profile.auth then return end
if not msg then return end
if not msg or msg == "" then return end
msg = msg:removeColorCodes()
core.profile.pushOrder(string.format("o='ChatTalk' channel=%q msg=%q", self.cur_channel, msg))
end
......
......@@ -132,7 +132,13 @@ local function archery_projectile(tx, ty, tg, self)
apr = apr + (tg.archery.apr or 0)
print("[ATTACK ARCHERY] raw dam", dam, "versus", armor, "with APR", apr)
local dam = math.max(0, dam - math.max(0, armor - apr))
apr = 1-math.pow(0.99, apr)
armor = 1-math.pow(0.99, armor)
print("[ATTACK] raw dam", dam, "versus", armor, "with APR", apr)
armor = math.max(0, armor - apr)
dam = dam * (1 - armor)
print("[ATTACK] after armor", dam)
local damrange = self:combatDamageRange(ammo)
dam = rng.range(dam, dam * damrange)
print("[ATTACK ARCHERY] after range", dam)
......
......@@ -228,8 +228,12 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
evaded = true
game.logSeen(target, "%s evades %s.", target.name:capitalize(), self.name)
elseif self:checkHit(atk, def) then
apr = 1-math.pow(0.99, apr)
armor = 1-math.pow(0.99, armor)
print("[ATTACK] raw dam", dam, "versus", armor, "with APR", apr)
dam = math.max(0, dam - math.max(0, armor - apr))
armor = math.max(0, armor - apr)
dam = dam * (1 - armor)
print("[ATTACK] after armor", dam)
local damrange = self:combatDamageRange(weapon)
dam = rng.range(dam, dam * damrange)
print("[ATTACK] after range", dam)
......
......@@ -67,7 +67,7 @@ newBirthDescriptor{
},
talents = {
[ActorTalents.T_SHIELD_PUMMEL] = 1,
[ActorTalents.T_REPULSION] = 1,
[ActorTalents.T_SHIELD_WALL] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 1,
},
......
......@@ -26,15 +26,3 @@ return {
[[!.......!]],
[[#!!!!!!!#]],
}
infinity
return {
[[#!!!!!!!!!!!!!!!#]],
[[!...............!]],
[[!..#####.#####..!]],
[[!.##....#....##.!]],
[[!...............!]],
[[!.##....#....##.!]],
[[!..#####.#####..!]],
[[!...............!]],
[[#!!!!!!!!!!!!!!!#]],
}
......@@ -172,52 +172,13 @@ newTalent{
-- Defense
----------------------------------------------------------------------
newTalent{
name = "Repulsion",
name = "Shield Wall",
type = {"technique/shield-defense", 1},
require = techs_req1,
points = 5,
random_ego = "attack",
cooldown = 10,
stamina = 30,
tactical = { ESCAPE = 2, DEFEND = 0.5 },
on_pre_use = function(self, t, silent) if not self:hasShield() then if not silent then game.logPlayer(self, "You require a weapon and a shield to use this talent.") end return false end return true end,
action = function(self, t)
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Repulsion without a shield!")
return nil
end
for i = -1, 1 do for j = -1, 1 do
local x, y = self.x + i, self.y + j
if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
local target = game.level.map(x, y, Map.ACTOR)
if target:checkHit(self:combatAttack(shield.special_combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
target:knockback(self.x, self.y, 2 + self:getTalentLevel(t))
if target:canBe("stun") then target:setEffect(target.EFF_DAZED, 3 + self:getStr(8), {}) end
else
game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
end
end
end end
return true
end,
info = function(self, t)
return ([[Let all your foes pile up on your shield, then put all your strength in one mighty thrust and repel them all away %d grids.
In addition all creature knocked back will also be dazed for %d turns.
The distance increases with talent level and the daze with Strength.]]):format(math.floor(2 + self:getTalentLevel(t)), 3 + self:getStr(8))
end,
}
newTalent{
name = "Shield Wall",
type = {"technique/shield-defense", 2},
require = techs_req2,
mode = "sustained",
points = 5,
cooldown = 30,
sustain_stamina = 50,
sustain_stamina = 30,
tactical = { DEFEND = 2 },
on_pre_use = function(self, t, silent) if not self:hasShield() then if not silent then game.logPlayer(self, "You require a weapon and a shield to use this talent.") end return false end return true end,
activate = function(self, t)
......@@ -230,8 +191,7 @@ newTalent{
return {
stun = self:addTemporaryValue("stun_immune", 0.1 * self:getTalentLevel(t)),
knock = self:addTemporaryValue("knockback_immune", 0.1 * self:getTalentLevel(t)),
atk = self:addTemporaryValue("combat_atk", -10),
dam = self:addTemporaryValue("combat_dam", -10),
dam = self:addTemporaryValue("inc_damage", {[DamageType.PHYSICAL]=-20}),
def = self:addTemporaryValue("combat_def", 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) * 2),
armor = self:addTemporaryValue("combat_armor", 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)),
}
......@@ -239,14 +199,13 @@ newTalent{
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_def", p.def)
self:removeTemporaryValue("combat_armor", p.armor)
self:removeTemporaryValue("combat_atk", p.atk)
self:removeTemporaryValue("combat_dam", p.dam)
self:removeTemporaryValue("inc_damage", p.dam)
self:removeTemporaryValue("stun_immune", p.stun)
self:removeTemporaryValue("knockback_immune", p.knock)
return true
end,
info = function(self, t)
return ([[Enter a protective battle stance, increasing defense by %d and armor by %d at the cost of 10 attack and 10 damage. The defense and armor increase is based on dexterity.
return ([[Enter a protective battle stance, increasing defense by %d and armor by %d at the cost of -20%% physical damage. The defense and armor increase is based on dexterity.
It also grants resistance to stunning and knockback (%d%%).]]):format(
5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)* 2,
5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE),
......@@ -255,6 +214,45 @@ newTalent{
end,
}
newTalent{
name = "Repulsion",
type = {"technique/shield-defense", 2},
require = techs_req2,
points = 5,
random_ego = "attack",
cooldown = 10,
stamina = 30,
tactical = { ESCAPE = 2, DEFEND = 0.5 },
on_pre_use = function(self, t, silent) if not self:hasShield() then if not silent then game.logPlayer(self, "You require a weapon and a shield to use this talent.") end return false end return true end,
action = function(self, t)
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Repulsion without a shield!")
return nil
end
for i = -1, 1 do for j = -1, 1 do
local x, y = self.x + i, self.y + j
if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
local target = game.level.map(x, y, Map.ACTOR)
if target:checkHit(self:combatAttack(shield.special_combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
target:knockback(self.x, self.y, 2 + self:getTalentLevel(t))
if target:canBe("stun") then target:setEffect(target.EFF_DAZED, 3 + self:getStr(8), {}) end
else
game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
end
end
end end
return true
end,
info = function(self, t)
return ([[Let all your foes pile up on your shield, then put all your strength in one mighty thrust and repel them all away %d grids.
In addition all creature knocked back will also be dazed for %d turns.
The distance increases with talent level and the daze with Strength.]]):format(math.floor(2 + self:getTalentLevel(t)), 3 + self:getStr(8))
end,
}
newTalent{
name = "Shield Expertise",
type = {"technique/shield-defense", 3},
......
No preview for this file type
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