Skip to content

Commit

Permalink
Fixes runtimes with explosion sounds, lobby join button and warrior j…
Browse files Browse the repository at this point in the history
…ab punch. (#815)

* Update menu_text_objects.dm

* Update explosion.dm

* Update abilities_warrior.dm

* Update explosion.dm

Signed-off-by: Helg2 <[email protected]>

---------

Signed-off-by: Helg2 <[email protected]>
  • Loading branch information
Helg2 authored Dec 13, 2024
1 parent 580fe38 commit 1697b14
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion code/_onclick/hud/screen_objects/menu_text_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
maptext = "<span class='maptext' style=font-size:8px>ПРИСОЕДИНИТЬСЯ</span>"
icon_state = "join"
return
if(!hud.mymob)
if(!hud?.mymob)
return
var/mob/new_player/player = hud.mymob
maptext = "<span class='maptext' style=font-size:8px>ВЫ: [player.ready ? "" : "НЕ "]ГОТОВЫ</span>"
Expand Down
28 changes: 14 additions & 14 deletions code/datums/autocells/explosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ as having entered the turf.
var/frequency = GET_RAND_FREQUENCY
var/sound/explosion_sound = SFX_EXPLOSION_LARGE
var/sound/far_explosion_sound = SFX_EXPLOSION_LARGE_DISTANT
var/sound/creak_sound = SFX_EXPLOSION_CREAK

//no need to loop this for every mob
switch(power)
Expand All @@ -282,19 +281,20 @@ as having entered the turf.
var/mob/our_mob = MN
// Double check for client
var/turf/mob_turf = get_turf(our_mob)
if(mob_turf?.z == epicenter.z)
var/dist = get_dist(mob_turf, epicenter)
if(dist <= max(round(power, 1)))
our_mob.playsound_local(epicenter, null, 75, 1, frequency, falloff = 5, sound_to_use = explosion_sound)
if(is_mainship_level(epicenter.z))
our_mob.playsound_local(epicenter, null, 40, 1, frequency, falloff = 5, sound_to_use = creak_sound)//ship groaning under explosion effect
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = clamp(far_dist, 30, 60) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
our_mob.playsound_local(epicenter, null, far_volume, 1, frequency, falloff = 5, sound_to_use = far_explosion_sound)
if(is_mainship_level(epicenter.z))
our_mob.playsound_local(epicenter, null, far_volume * 3, 1, frequency, falloff = 5, sound_to_use = creak_sound)//ship groaning under explosion effect
if(mob_turf?.z != epicenter.z)
continue
var/dist = get_dist(mob_turf, epicenter)
if(dist <= max(round(power, 1)))
our_mob.playsound_local(epicenter, explosion_sound, 75, 1, frequency, falloff = 5)
if(is_mainship_level(epicenter.z))
our_mob.playsound_local(epicenter, SFX_EXPLOSION_CREAK, 40, 1, frequency, falloff = 5)//ship groaning under explosion effect
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = clamp(far_dist, 30, 60) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
our_mob.playsound_local(epicenter, far_explosion_sound, far_volume, 1, frequency, falloff = 5)
if(is_mainship_level(epicenter.z))
our_mob.playsound_local(epicenter, SFX_EXPLOSION_CREAK, far_volume * 3, 1, frequency, falloff = 5)//ship groaning under explosion effect
if(!orig_range)
orig_range = round(power / falloff)
new /obj/effect/temp_visual/explosion(epicenter, orig_range, color, power)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,16 +638,17 @@

/datum/action/ability/activable/xeno/warrior/punch/jab/use_ability(atom/A)
var/mob/living/carbon/xenomorph/xeno_owner = owner
var/mob/living/carbon/human/target = A
var/jab_damage = xeno_owner.xeno_caste.melee_damage * xeno_owner.xeno_melee_damage_modifier
var/datum/action/ability/xeno_action/empower/empower_action = xeno_owner.actions_by_path[/datum/action/ability/xeno_action/empower]
if(!A.punch_act(xeno_owner, jab_damage))
return fail_activate()
if(empower_action?.check_empower(A))
jab_damage *= WARRIOR_PUNCH_EMPOWER_MULTIPLIER
to_chat(target, span_highdanger("The concussion from the [xeno_owner]'s blow blinds us!"))
target.apply_status_effect(STATUS_EFFECT_CONFUSED, 3 SECONDS)
target.Paralyze(0.5 SECONDS)
if(ishuman(A))
var/mob/living/carbon/human/target = A
to_chat(target, span_highdanger("The concussion from the [xeno_owner]'s blow blinds us!"))
target.apply_status_effect(STATUS_EFFECT_CONFUSED, 3 SECONDS)
target.Paralyze(0.5 SECONDS)
GLOB.round_statistics.warrior_punches++
SSblackbox.record_feedback(FEEDBACK_TALLY, "round_statistics", 1, "warrior_punches")
succeed_activate()
Expand Down

0 comments on commit 1697b14

Please sign in to comment.