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

all weapon&shield but shield expertise

git-svn-id: http://svn.net-core.org/repos/t-engine4@291 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7f7f5031
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,12 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
DamageType:get(typ).projector(target, self.x, self.y, typ, dam)
end end
-- Riposte!
if not hitted and target:knowTalent(target.T_RIPOSTE) and rng.percent(util.bound(target:getTalentLevel(target.T_RIPOSTE) * target:getDex(50), 10, 80)) then
game.logSeen(self, "%s ripostes!", target.name:capitalize())
target:attackTarget(self, nil, nil, true)
end
return self:combatSpeed(weapon), hitted
end
......@@ -298,7 +304,7 @@ function _M:combatMentalResist()
end
--- Check if the user has a two handed weapon
--- Check if the actor has a two handed weapon
function _M:hasTwoHandedWeapon()
local weapon = self:getInven("MAINHAND")[1]
if not weapon or not weapon.twohanded then
......@@ -306,3 +312,12 @@ function _M:hasTwoHandedWeapon()
end
return weapon
end
--- Check if the actor has a shield
function _M:hasShield()
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
return nil
end
return shield
end
\ No newline at end of file
......@@ -9,7 +9,8 @@ newBirthDescriptor{
subclass =
{
__ALL__ = "never",
Warrior = "allow",
Fighter = "allow",
Berserker = "allow",
},
},
talents = { [ActorTalents.T_STAMINA_POOL]=1, },
......@@ -21,17 +22,47 @@ newBirthDescriptor{
newBirthDescriptor{
type = "subclass",
name = "Warrior",
name = "Fighter",
desc = {
"Simple fighters, they hack away with their trusty weapon.",
"A warrior specializing in weapon and shield combat.",
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["technique/shield-offense"]={true, 0.3},
["technique/shield-defense"]={true, 0.3},
["technique/2hweapon-offense"]={true, 0},
["technique/2hweapon-cripple"]={true, 0},
["technique/combat-training"]={true, 0.2},
["technique/weapon-training"]={true, 0.2},
},
talents = {
[ActorTalents.T_SHIELD_PUMMEL] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 1,
},
copy = {
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="longsword", name="iron longsword"},
{type="armor", subtype="shield", name="iron shield"},
{type="armor", subtype="heavy", name="iron mail armour"}
},
},
}
newBirthDescriptor{
type = "subclass",
name = "Berserker",
desc = {
"A warrior specializing in two handed weapon combat",
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["technique/shield"]={true, 0.3},
["technique/shield-offense"]={true, 0},
["technique/shield-defense"]={true, 0},
["technique/2hweapon-offense"]={true, 0.3},
["technique/2hweapon-cripple"]={true, 0.3},
["technique/combat-training"]={true, 0.3},
["technique/weapon-training"]={true, 0.3},
["technique/combat-training"]={true, 0.2},
["technique/weapon-training"]={true, 0.2},
},
talents = {
[ActorTalents.T_BERSERKER] = 1,
......
-- Physical combat
newTalentType{ type="technique/2hweapon-offense", name = "two handed weapons", description = "Specialized two handed techniques." }
newTalentType{ type="technique/2hweapon-cripple", name = "two handed weapons", description = "Specialized two handed techniques." }
newTalentType{ type="technique/dualweapon", name = "dual wielding", description = "Allows the user to be more proficient with dual wielding weapons." }
newTalentType{ type="technique/shield", name = "weapon and shields", description = "Allows the user to be more proficient with shields and one handed weapons." }
newTalentType{ type="technique/shield-offense", name = "weapon and shields", description = "Specialized weapon and shield techniques." }
newTalentType{ type="technique/shield-defense", name = "weapon and shields", description = "Specialized weapon and shield techniques." }
newTalentType{ type="technique/dualweapon", name = "dual wielding", description = "Specialized dual wielding techniques." }
newTalentType{ type="technique/weapon-training", name = "weapon-training", description = "Grants bonuses to the different weapon types." }
newTalentType{ type="technique/combat-training", name = "combat-training", description = "Teaches to use various armors and improves health." }
......
----------------------------------------------------------------------
-- Offense
----------------------------------------------------------------------
newTalent{
name = "Shield Bash",
type = {"technique/shield", 1},
name = "Shield Pummel",
type = {"technique/shield-offense", 1},
require = techs_req1,
points = 5,
cooldown = 6,
stamina = 8,
require = { stat = { str=12 }, },
action = function(self, t)
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Shield Bash without a shield!")
return nil
end
......@@ -16,7 +20,8 @@ newTalent{
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 2 + self:getTalentLevel(t) / 5)
self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 5)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.3 + self:getTalentLevel(t) / 5)
-- Try to stun !
if hit then
......@@ -30,21 +35,32 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target with a shield strike, stunning it and doing %d%% shield damage.
The damage multiplier increases with your strength.]]):format(100 * (2 + self:getTalentLevel(t) / 5))
return ([[Hits the target with two shield strikes, stunning it and doing %d%% shield damage.
The damage multiplier increases with your strength.]]):format(100 * (1.3 + self:getTalentLevel(t) / 5))
end,
}
newTalent{
name = "Riposte",
type = {"technique/shield-offense", 2},
require = techs_req2,
mode = "passive",
points = 5,
info = function(self, t)
return ([[When you block/avoid a melee blow you have %d%% chances to get a free, automatic, melee attack against your foe.]]):format(util.bound(self:getTalentLevel(t) * self:getDex(50), 10, 80))
end,
}
newTalent{
name = "Overpower",
type = {"technique/shield", 2},
type = {"technique/shield-offense", 3},
require = techs_req3,
points = 5,
cooldown = 6,
stamina = 16,
require = { stat = { str=16 }, },
cooldown = 8,
stamina = 22,
action = function(self, t)
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Overpower without a shield!")
return nil
end
......@@ -55,11 +71,11 @@ newTalent{
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
-- First attack with weapon
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.5 + self:getTalentLevel(t) / 10, true)
-- Second attack with shield
self:attackTargetWith(target, shield.special_combat, nil, 1.8 + self:getTalentLevel(t) / 10)
self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 10)
-- Third attack with shield
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.8 + self:getTalentLevel(t) / 10)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 10)
-- Try to stun !
if hit then
......@@ -74,54 +90,63 @@ newTalent{
end,
info = function(self, t)
return ([[Hits the target with your weapon and two shield strikes doing %d%% damage, trying to overpower your target.
If the last attack hits, the target is knocked back.]]):format(100 * (1.8 + self:getTalentLevel(t) / 10))
If the last attack hits, the target is knocked back.]]):format(100 * (1.5 + self:getTalentLevel(t) / 10))
end,
}
newTalent{
name = "Repulsion",
type = {"technique/shield", 2},
name = "Assault",
type = {"technique/shield-offense", 4},
require = techs_req4,
points = 5,
cooldown = 10,
stamina = 30,
require = { stat = { str=22 }, },
cooldown = 6,
stamina = 16,
action = function(self, t)
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
game.logPlayer(self, "You cannot use Repulsion without a shield!")
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Assault 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, 1 + self:getTalentLevel(t))
else
game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
end
end
end end
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
-- First attack with shield
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.8 + self:getTalentLevel(t) / 10)
-- Second & third attack with weapon
if hit then
self.combat_physcrit = self.combat_physcrit + 1000
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self.combat_physcrit = self.combat_physcrit - 1000
end
return true
end,
info = function(self, t)
return ([[Let all your foes pile up on your shield then put all your strengh in one mighty thurst and repel them all away.]])
return ([[Hits the target with shield doing %d%% damage. If it hits you follow up with 2 weapon strikes which are automatic crits.]]):
format(100 * (1.8 + self:getTalentLevel(t) / 10))
end,
}
----------------------------------------------------------------------
-- Defense
----------------------------------------------------------------------
newTalent{
name = "Shield Wall",
type = {"technique/shield", 3},
type = {"technique/shield-defense", 1},
require = techs_req1,
mode = "sustained",
points = 5,
cooldown = 30,
sustain_stamina = 100,
require = { stat = { str=28 }, },
sustain_stamina = 50,
activate = function(self, t)
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Shield Wall without a shield!")
return nil
end
......@@ -154,3 +179,82 @@ newTalent{
At level 5 it also makes you immnue to stuns and knockbacks.]]):format(5 + self:getDex(4) * self:getTalentLevel(t), 5 + self:getCun(4) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Repulsion",
type = {"technique/shield-defense", 2},
require = techs_req2,
points = 5,
cooldown = 10,
stamina = 30,
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, 1 + self:getTalentLevel(t))
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 strengh in one mighty thurst and repel them all away.]])
end,
}
newTalent{
name = "Shield Expertise",
type = {"technique/shield-defense", 3},
require = techs_req3,
mode = "passive",
points = 5,
info = function(self, t)
return ([[.]]):format()
end,
}
newTalent{
name = "Last Stand",
type = {"technique/shield-defense", 4},
require = techs_req4,
mode = "sustained",
points = 5,
cooldown = 60,
sustain_stamina = 90,
activate = function(self, t)
local shield = self:hasShield()
if not shield then
game.logPlayer(self, "You cannot use Last Stand without a shield!")
return nil
end
return {
max_life = self:addTemporaryValue("max_life", 10 * self:getTalentLevel(t)),
def = self:addTemporaryValue("combat_def", 5 + self:getDex(4) * self:getTalentLevel(t)),
nomove = self:addTemporaryValue("never_move", 1),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_def", p.def)
self:removeTemporaryValue("max_life", p.max_life)
self:removeTemporaryValue("never_move", p.nomove)
if p.stun then self:removeTemporaryValue("stun_immune", p.stun) end
if p.knock then self:removeTemporaryValue("knockback_immune", p.knock) end
return true
end,
info = function(self, t)
return ([[Brace yourself for the final stand, increasing defense by %d and maximun life by %d but makes you unable to move.]]):
format(5 + self:getDex(4) * self:getTalentLevel(t), 10 * self:getTalentLevel(t))
end,
}
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