Commit 41cf90845fe6fbe233012acf78080edaa8cb3072
Merge branch 'fix_brawler_attack_speed' into 'master'
Fix Brawler Attack Speed Currently, Empty Hand sets actor.combat.physspeed to 0.8 on learn, while gauntlets directly add to actor.combat.physspeed, which may not work as intended. For example: If you start with brawler class and unlearn all unarmed talent, then you'll start the game with 1.0 combat.physspeed instead of 1.2(default speed for gauntlets). Afterwards, if you learn your first talent that grants Empty Hand while wearing heavy gauntlets, your combat.physspeed will be set to 0.8, and then you can switch to gloves to reduce combat.physspeed to 0.6(166% attack speed). See merge request !734
Showing
1 changed file
with
6 additions
and
2 deletions
... | ... | @@ -31,7 +31,9 @@ newTalent{ |
31 | 31 | local fct = function() |
32 | 32 | self.before_empty_hands_combat = self.combat |
33 | 33 | self.combat = table.clone(self.combat, true) |
34 | - self.combat.physspeed = math.min(0.8, self.combat.physspeed or 1000) | |
34 | + local lastspeed = self.combat.physspeed or 1 | |
35 | + self.combat.physspeed = math.max(0.2, lastspeed - 0.2) | |
36 | + self.empty_hands_bonus = self.combat.physspeed - lastspeed | |
35 | 37 | if not self.combat.sound then self.combat.sound = {"actions/punch%d", 1, 4} end |
36 | 38 | if not self.combat.sound_miss then self.combat.sound_miss = "actions/melee_miss" end |
37 | 39 | end |
... | ... | @@ -42,7 +44,9 @@ newTalent{ |
42 | 44 | end |
43 | 45 | end, |
44 | 46 | on_unlearn = function(self, t) |
45 | - self.combat = self.before_empty_hands_combat | |
47 | + self.combat.physspeed = (self.combat.physspeed or 0.8) - self.empty_hands_bonus | |
48 | + self.combat.sound = self.before_empty_hands_combat.sound | |
49 | + self.combat.sound_miss = self.before_empty_hands_combat.sound_miss | |
46 | 50 | end, |
47 | 51 | getDamage = function(self, t) return self.level * 0.5 end, |
48 | 52 | info = function(self, t) | ... | ... |
-
Please register or login to post a comment