mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-07 08:03:30 +08:00
Merge pull request #484 from Ralfreengz/patch-2
Weak punch sound to reuse (spaz.py)
This commit is contained in:
commit
13c92fc083
@ -966,7 +966,7 @@ class Spaz(ba.Actor):
|
|||||||
self.on_punched(damage)
|
self.on_punched(damage)
|
||||||
|
|
||||||
# If damage was significant, lets show it.
|
# If damage was significant, lets show it.
|
||||||
if damage > 350:
|
if damage >= 350:
|
||||||
assert msg.force_direction is not None
|
assert msg.force_direction is not None
|
||||||
ba.show_damage_count('-' + str(int(damage / 10)) + '%',
|
ba.show_damage_count('-' + str(int(damage / 10)) + '%',
|
||||||
msg.pos, msg.force_direction)
|
msg.pos, msg.force_direction)
|
||||||
@ -977,11 +977,13 @@ class Spaz(ba.Actor):
|
|||||||
ba.playsound(SpazFactory.get().punch_sound_stronger,
|
ba.playsound(SpazFactory.get().punch_sound_stronger,
|
||||||
1.0,
|
1.0,
|
||||||
position=self.node.position)
|
position=self.node.position)
|
||||||
if damage > 500:
|
if damage >= 500:
|
||||||
sounds = SpazFactory.get().punch_sound_strong
|
sounds = SpazFactory.get().punch_sound_strong
|
||||||
sound = sounds[random.randrange(len(sounds))]
|
sound = sounds[random.randrange(len(sounds))]
|
||||||
else:
|
elif damage >= 300:
|
||||||
sound = SpazFactory.get().punch_sound
|
sound = SpazFactory.get().punch_sound
|
||||||
|
else:
|
||||||
|
sound = SpazFactory.get().punch_sound_weak
|
||||||
ba.playsound(sound, 1.0, position=self.node.position)
|
ba.playsound(sound, 1.0, position=self.node.position)
|
||||||
|
|
||||||
# Throw up some chunks.
|
# Throw up some chunks.
|
||||||
@ -1075,7 +1077,7 @@ class Spaz(ba.Actor):
|
|||||||
# us if its grown high enough.
|
# us if its grown high enough.
|
||||||
if self.hitpoints <= 0:
|
if self.hitpoints <= 0:
|
||||||
damage_avg = self.node.damage_smoothed * damage_scale
|
damage_avg = self.node.damage_smoothed * damage_scale
|
||||||
if damage_avg > 1000:
|
if damage_avg >= 1000:
|
||||||
self.shatter()
|
self.shatter()
|
||||||
|
|
||||||
elif isinstance(msg, BombDiedMessage):
|
elif isinstance(msg, BombDiedMessage):
|
||||||
@ -1341,9 +1343,9 @@ class Spaz(ba.Actor):
|
|||||||
hit_type='impact'))
|
hit_type='impact'))
|
||||||
self.node.handlemessage('knockout', max(0.0, 50.0 * intensity))
|
self.node.handlemessage('knockout', max(0.0, 50.0 * intensity))
|
||||||
sounds: Sequence[ba.Sound]
|
sounds: Sequence[ba.Sound]
|
||||||
if intensity > 5.0:
|
if intensity >= 5.0:
|
||||||
sounds = SpazFactory.get().impact_sounds_harder
|
sounds = SpazFactory.get().impact_sounds_harder
|
||||||
elif intensity > 3.0:
|
elif intensity >= 3.0:
|
||||||
sounds = SpazFactory.get().impact_sounds_hard
|
sounds = SpazFactory.get().impact_sounds_hard
|
||||||
else:
|
else:
|
||||||
sounds = SpazFactory.get().impact_sounds_medium
|
sounds = SpazFactory.get().impact_sounds_medium
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user