Skip to content

Commit

Permalink
adds warning messages when CAS sonic boom happens and makes the boom …
Browse files Browse the repository at this point in the history
…fallof slower (#5410)

# About the pull request

adds more warnings to aproaching cas

# Explain why it's good for the game

gives xenos even more clues about incoming firemission, should prevent
silent cas unless you are runner who runs in straight form the other
sife of map directly into FM

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: added messages when the CAS sonic boom is played
soundadd: reduced volume falloff of CAS sonic boom
/:cl:

---------

Co-authored-by: vincibrv <[email protected]>
Co-authored-by: Doubleumc <[email protected]>
Co-authored-by: SabreML <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
5 people committed Jan 25, 2024
1 parent 60ea7fc commit 9cb7ac7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 27 deletions.
23 changes: 18 additions & 5 deletions code/game/cas_manager/datums/cas_fire_envelope.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,20 @@
mission_error = "Target is off bounds or obstructed."
return
change_current_loc(target_turf)
playsound(target_turf, soundeffect, 70, TRUE, 50)
playsound(source = target_turf, soundin = soundeffect, vol = 70, vary = TRUE, sound_range = 50, falloff = 8)

for(var/mob/mob in range(15, target_turf))
var/ds_identifier = "LARGE BIRD"
var/fm_identifier = "SPIT FIRE"
if (mob.mob_flags & KNOWS_TECHNOLOGY)
ds_identifier = "DROPSHIP"
fm_identifier = "FIRE"

mob.show_message( \
SPAN_HIGHDANGER("YOU HEAR THE [ds_identifier] ROAR AS IT PREPARES TO [fm_identifier] NEAR YOU!"),SHOW_MESSAGE_VISIBLE, \
SPAN_HIGHDANGER("YOU HEAR SOMETHING FLYING CLOSER TO YOU!") , SHOW_MESSAGE_AUDIBLE \
)

sleep(flyto_period)
stat = FIRE_MISSION_STATE_FIRING
mission.execute_firemission(linked_console, target_turf, dir, fire_length, step_delay, src)
Expand Down Expand Up @@ -311,10 +324,10 @@

/datum/cas_fire_envelope/uscm_dropship
fire_length = 12
grace_period = 50 //5 seconds
flyto_period = 50 //five seconds
flyoff_period = 50 //FIVE seconds
cooldown_period = 100 //f~ I mean, 10 seconds
grace_period = 5 SECONDS
flyto_period = 4 SECONDS //sleep in the FM itself has been increased by one more second
flyoff_period = 5 SECONDS
cooldown_period = 10 SECONDS
soundeffect = 'sound/weapons/dropship_sonic_boom.ogg' //BOOM~WOOOOOSH~HSOOOOOW~BOOM
step_delay = 3
max_offset = 12
Expand Down
44 changes: 22 additions & 22 deletions code/game/cas_manager/datums/cas_fire_mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
for(var/datum/cas_fire_mission_record/record as anything in records)
.["records"] += list(record.ui_data(user))

/datum/cas_fire_mission/proc/build_new_record(obj/structure/dropship_equipment/weapon/weap, fire_length)
/datum/cas_fire_mission/proc/build_new_record(obj/structure/dropship_equipment/weapon/weapon, fire_length)
var/datum/cas_fire_mission_record/record = new()
record.weapon = weap
record.weapon = weapon
record.offsets = new /list(fire_length)
for(var/idx = 1; idx<=fire_length; idx++)
record.offsets[idx] = "-"
Expand All @@ -53,24 +53,24 @@
// if weapon appears in weapons list but not in record
// > add empty record for new weapon
var/found = FALSE
for(var/obj/structure/dropship_equipment/weapon/weap in weapons)
if(record.weapon == weap)
for(var/obj/structure/dropship_equipment/weapon/weapon in weapons)
if(record.weapon == weapon)
found=TRUE
break
if(!found)
bad_records.Add(record)
for(var/obj/structure/dropship_equipment/weapon/weap in weapons)
for(var/obj/structure/dropship_equipment/weapon/weapon in weapons)
var/found = FALSE
for(var/datum/cas_fire_mission_record/record in records)
if(record.weapon == weap)
if(record.weapon == weapon)
found=TRUE
break
if(!found)
missing_weapons.Add(weap)
missing_weapons.Add(weapon)
for(var/datum/cas_fire_mission_record/record in bad_records)
records -= record
for(var/obj/structure/dropship_equipment/weapon/weap in missing_weapons)
build_new_record(weap, fire_length)
for(var/obj/structure/dropship_equipment/weapon/weapon in missing_weapons)
build_new_record(weapon, fire_length)

/datum/cas_fire_mission/proc/record_for_weapon(weapon_id)
for(var/datum/cas_fire_mission_record/record as anything in records)
Expand Down Expand Up @@ -176,35 +176,35 @@
msg_admin_niche("[usr ? key_name(usr) : "Someone"] is launching Fire Mission '[name]' at ([initial_turf.x],[initial_turf.y],[initial_turf.z]) [ADMIN_JMP(initial_turf)]")

var/relative_dir
for(var/mob/M in range(15, initial_turf))
if(get_turf(M) == initial_turf)
for(var/mob/mob in range(15, initial_turf))
if(get_turf(mob) == initial_turf)
relative_dir = 0
else
relative_dir = Get_Compass_Dir(M, initial_turf)
relative_dir = Get_Compass_Dir(mob, initial_turf)

var/ds_identifier = "LARGE BIRD"
if (M.mob_flags & KNOWS_TECHNOLOGY)
if (mob.mob_flags & KNOWS_TECHNOLOGY)
ds_identifier = "DROPSHIP"

M.show_message( \
mob.show_message( \
SPAN_HIGHDANGER("A [ds_identifier] FLIES [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_VISIBLE, \
SPAN_HIGHDANGER("YOU HEAR SOMETHING GO [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_AUDIBLE \
)

// Xenos have time to react to the first message
sleep(0.5 SECONDS)
sleep(1.5 SECONDS)

for(var/mob/M in range(10, initial_turf))
if(get_turf(M) == initial_turf)
for(var/mob/mob in range(10, initial_turf))
if(get_turf(mob) == initial_turf)
relative_dir = 0
else
relative_dir = Get_Compass_Dir(M, initial_turf)
relative_dir = Get_Compass_Dir(mob, initial_turf)

var/ds_identifier = "LARGE BIRD"
if (M.mob_flags & KNOWS_TECHNOLOGY)
if (mob.mob_flags & KNOWS_TECHNOLOGY)
ds_identifier = "DROPSHIP"

M.show_message( \
mob.show_message( \
SPAN_HIGHDANGER("A [ds_identifier] FIRES [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), 1, \
SPAN_HIGHDANGER("YOU HEAR SOMETHING FIRE [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), 2 \
)
Expand Down Expand Up @@ -243,8 +243,8 @@
if (current_turf == null)
return -1
var/turf/shootloc = locate(current_turf.x + sx*offset, current_turf.y + sy*offset, current_turf.z)
var/area/A = get_area(shootloc)
if(shootloc && !CEILING_IS_PROTECTED(A?.ceiling, CEILING_PROTECTION_TIER_3) && !protected_by_pylon(TURF_PROTECTION_CAS, shootloc))
var/area/area = get_area(shootloc)
if(shootloc && !CEILING_IS_PROTECTED(area?.ceiling, CEILING_PROTECTION_TIER_3) && !protected_by_pylon(TURF_PROTECTION_CAS, shootloc))
item.weapon.open_fire_firemission(shootloc)
sleep(step_delay)
if(envelope)
Expand Down

0 comments on commit 9cb7ac7

Please sign in to comment.