Commit d88d40ace6763004ff6e7465033cb8afe1911276

Authored by dg
1 parent 8d8c73cb

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
... ... @@ -192,7 +192,7 @@ function _M:receiveKey(sym, ctrl, shift, alt, meta, unicode, isup, ismouse)
192 192 local ks, us
193 193 if not ismouse then ks, us = self:makeKeyString(sym, ctrl, shift, alt, meta, unicode)
194 194 else ks = self:makeMouseString(sym, ctrl, shift, alt, meta) end
195   - print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
  195 +-- print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
196 196 if self.binds[ks] and self.virtuals[self.binds[ks]] then
197 197 if isup and not _M.binds_def[self.binds[ks]].updown then return end
198 198 self.virtuals[self.binds[ks]](sym, ctrl, shift, alt, meta, unicode, isup)
... ...
... ... @@ -97,7 +97,7 @@ end
97 97
98 98 function _M:talk(msg)
99 99 if not profile.auth then return end
100   - if not msg then return end
  100 + if not msg or msg == "" then return end
101 101 msg = msg:removeColorCodes()
102 102 core.profile.pushOrder(string.format("o='ChatTalk' channel=%q msg=%q", self.cur_channel, msg))
103 103 end
... ...
... ... @@ -132,7 +132,13 @@ local function archery_projectile(tx, ty, tg, self)
132 132 apr = apr + (tg.archery.apr or 0)
133 133 print("[ATTACK ARCHERY] raw dam", dam, "versus", armor, "with APR", apr)
134 134
135   - local dam = math.max(0, dam - math.max(0, armor - apr))
  135 + apr = 1-math.pow(0.99, apr)
  136 + armor = 1-math.pow(0.99, armor)
  137 + print("[ATTACK] raw dam", dam, "versus", armor, "with APR", apr)
  138 + armor = math.max(0, armor - apr)
  139 + dam = dam * (1 - armor)
  140 + print("[ATTACK] after armor", dam)
  141 +
136 142 local damrange = self:combatDamageRange(ammo)
137 143 dam = rng.range(dam, dam * damrange)
138 144 print("[ATTACK ARCHERY] after range", dam)
... ...
... ... @@ -228,8 +228,12 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
228 228 evaded = true
229 229 game.logSeen(target, "%s evades %s.", target.name:capitalize(), self.name)
230 230 elseif self:checkHit(atk, def) then
  231 + apr = 1-math.pow(0.99, apr)
  232 + armor = 1-math.pow(0.99, armor)
231 233 print("[ATTACK] raw dam", dam, "versus", armor, "with APR", apr)
232   - dam = math.max(0, dam - math.max(0, armor - apr))
  234 + armor = math.max(0, armor - apr)
  235 + dam = dam * (1 - armor)
  236 + print("[ATTACK] after armor", dam)
233 237 local damrange = self:combatDamageRange(weapon)
234 238 dam = rng.range(dam, dam * damrange)
235 239 print("[ATTACK] after range", dam)
... ...
... ... @@ -67,7 +67,7 @@ newBirthDescriptor{
67 67 },
68 68 talents = {
69 69 [ActorTalents.T_SHIELD_PUMMEL] = 1,
70   - [ActorTalents.T_REPULSION] = 1,
  70 + [ActorTalents.T_SHIELD_WALL] = 1,
71 71 [ActorTalents.T_WEAPON_COMBAT] = 1,
72 72 [ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 1,
73 73 },
... ...
... ... @@ -26,15 +26,3 @@ return {
26 26 [[!.......!]],
27 27 [[#!!!!!!!#]],
28 28 }
29   -infinity
30   -return {
31   -[[#!!!!!!!!!!!!!!!#]],
32   -[[!...............!]],
33   -[[!..#####.#####..!]],
34   -[[!.##....#....##.!]],
35   -[[!...............!]],
36   -[[!.##....#....##.!]],
37   -[[!..#####.#####..!]],
38   -[[!...............!]],
39   -[[#!!!!!!!!!!!!!!!#]],
40   -}
... ...
... ... @@ -172,52 +172,13 @@ newTalent{
172 172 -- Defense
173 173 ----------------------------------------------------------------------
174 174 newTalent{
175   - name = "Repulsion",
  175 + name = "Shield Wall",
176 176 type = {"technique/shield-defense", 1},
177 177 require = techs_req1,
178   - points = 5,
179   - random_ego = "attack",
180   - cooldown = 10,
181   - stamina = 30,
182   - tactical = { ESCAPE = 2, DEFEND = 0.5 },
183   - 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,
184   - action = function(self, t)
185   - local shield = self:hasShield()
186   - if not shield then
187   - game.logPlayer(self, "You cannot use Repulsion without a shield!")
188   - return nil
189   - end
190   -
191   - for i = -1, 1 do for j = -1, 1 do
192   - local x, y = self.x + i, self.y + j
193   - if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
194   - local target = game.level.map(x, y, Map.ACTOR)
195   - if target:checkHit(self:combatAttack(shield.special_combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
196   - target:knockback(self.x, self.y, 2 + self:getTalentLevel(t))
197   - if target:canBe("stun") then target:setEffect(target.EFF_DAZED, 3 + self:getStr(8), {}) end
198   - else
199   - game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
200   - end
201   - end
202   - end end
203   -
204   - return true
205   - end,
206   - info = function(self, t)
207   - 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.
208   - In addition all creature knocked back will also be dazed for %d turns.
209   - The distance increases with talent level and the daze with Strength.]]):format(math.floor(2 + self:getTalentLevel(t)), 3 + self:getStr(8))
210   - end,
211   -}
212   -
213   -newTalent{
214   - name = "Shield Wall",
215   - type = {"technique/shield-defense", 2},
216   - require = techs_req2,
217 178 mode = "sustained",
218 179 points = 5,
219 180 cooldown = 30,
220   - sustain_stamina = 50,
  181 + sustain_stamina = 30,
221 182 tactical = { DEFEND = 2 },
222 183 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,
223 184 activate = function(self, t)
... ... @@ -230,8 +191,7 @@ newTalent{
230 191 return {
231 192 stun = self:addTemporaryValue("stun_immune", 0.1 * self:getTalentLevel(t)),
232 193 knock = self:addTemporaryValue("knockback_immune", 0.1 * self:getTalentLevel(t)),
233   - atk = self:addTemporaryValue("combat_atk", -10),
234   - dam = self:addTemporaryValue("combat_dam", -10),
  194 + dam = self:addTemporaryValue("inc_damage", {[DamageType.PHYSICAL]=-20}),
235 195 def = self:addTemporaryValue("combat_def", 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) * 2),
236 196 armor = self:addTemporaryValue("combat_armor", 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)),
237 197 }
... ... @@ -239,14 +199,13 @@ newTalent{
239 199 deactivate = function(self, t, p)
240 200 self:removeTemporaryValue("combat_def", p.def)
241 201 self:removeTemporaryValue("combat_armor", p.armor)
242   - self:removeTemporaryValue("combat_atk", p.atk)
243   - self:removeTemporaryValue("combat_dam", p.dam)
  202 + self:removeTemporaryValue("inc_damage", p.dam)
244 203 self:removeTemporaryValue("stun_immune", p.stun)
245 204 self:removeTemporaryValue("knockback_immune", p.knock)
246 205 return true
247 206 end,
248 207 info = function(self, t)
249   - 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.
  208 + 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.
250 209 It also grants resistance to stunning and knockback (%d%%).]]):format(
251 210 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)* 2,
252 211 5 + (1 + self:getDex(4)) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE),
... ... @@ -256,6 +215,45 @@ newTalent{
256 215 }
257 216
258 217 newTalent{
  218 + name = "Repulsion",
  219 + type = {"technique/shield-defense", 2},
  220 + require = techs_req2,
  221 + points = 5,
  222 + random_ego = "attack",
  223 + cooldown = 10,
  224 + stamina = 30,
  225 + tactical = { ESCAPE = 2, DEFEND = 0.5 },
  226 + 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,
  227 + action = function(self, t)
  228 + local shield = self:hasShield()
  229 + if not shield then
  230 + game.logPlayer(self, "You cannot use Repulsion without a shield!")
  231 + return nil
  232 + end
  233 +
  234 + for i = -1, 1 do for j = -1, 1 do
  235 + local x, y = self.x + i, self.y + j
  236 + if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
  237 + local target = game.level.map(x, y, Map.ACTOR)
  238 + if target:checkHit(self:combatAttack(shield.special_combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
  239 + target:knockback(self.x, self.y, 2 + self:getTalentLevel(t))
  240 + if target:canBe("stun") then target:setEffect(target.EFF_DAZED, 3 + self:getStr(8), {}) end
  241 + else
  242 + game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
  243 + end
  244 + end
  245 + end end
  246 +
  247 + return true
  248 + end,
  249 + info = function(self, t)
  250 + 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.
  251 + In addition all creature knocked back will also be dazed for %d turns.
  252 + The distance increases with talent level and the daze with Strength.]]):format(math.floor(2 + self:getTalentLevel(t)), 3 + self:getStr(8))
  253 + end,
  254 +}
  255 +
  256 +newTalent{
259 257 name = "Shield Expertise",
260 258 type = {"technique/shield-defense", 3},
261 259 require = techs_req3,
... ...
No preview for this file type