Skip to content

Commit

Permalink
notworking status
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuuhuuuu committed Feb 10, 2024
1 parent 9aa33b9 commit 091a285
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
57 changes: 35 additions & 22 deletions code/game/cas_manager/datums/cas_fire_envelope.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
var/list/datum/cas_fire_mission/missions
var/fire_length
var/grace_period //how much time you have after initiating fire mission and before you can't change firemissions
var/flyto_period //how much time it takes from sound alarm start to first hit. CAS is vulnerable here
var/chat_warning
var/execution_start
var/flyoff_period //how much time it takes after shots fired to get off the map. CAS is vulnerable here
var/cooldown_period //how much time you have to wait before new Fire Mission run
var/soundeffect //what sound effect to play
Expand Down Expand Up @@ -38,7 +39,7 @@


/datum/cas_fire_envelope/proc/get_total_duration()
return grace_period+flyto_period+flyoff_period
return cooldown_period

/datum/cas_fire_envelope/proc/update_weapons(list/obj/structure/dropship_equipment/weapon/weapons)
for(var/datum/cas_fire_mission/mission in missions)
Expand Down Expand Up @@ -245,22 +246,12 @@
/**
* Execute firemission.
*/
/datum/cas_fire_envelope/proc/execute_firemission_unsafe(datum/cas_signal/signal, turf/target_turf, dir, datum/cas_fire_mission/mission)
stat = FIRE_MISSION_STATE_IN_TRANSIT
to_chat(usr, SPAN_ALERT("Firemission underway!"))
sleep(grace_period)
/datum/cas_fire_envelope/proc/play_sound(atom/target_turf)
stat = FIRE_MISSION_STATE_ON_TARGET
if(!target_turf)
stat = FIRE_MISSION_STATE_IDLE
mission_error = "Target Lost."
return
if(!target_turf || !check_firemission_loc(signal))
stat = FIRE_MISSION_STATE_IDLE
mission_error = "Target is off bounds or obstructed."
return
change_current_loc(target_turf)
playsound(source = target_turf, soundin = soundeffect, vol = 70, vary = TRUE, sound_range = 50, falloff = 8)
playsound(target_turf, 'sound/weapons/dropship_sonic_boom.ogg', vol = 70, vary = TRUE, sound_range = 50, falloff = 8)

/datum/cas_fire_envelope/proc/warning(atom/target_turf)
for(var/mob/mob in range(15, target_turf))
var/ds_identifier = "LARGE BIRD"
var/fm_identifier = "SPIT FIRE"
Expand All @@ -273,15 +264,36 @@
SPAN_HIGHDANGER("YOU HEAR SOMETHING FLYING CLOSER TO YOU!") , SHOW_MESSAGE_AUDIBLE \
)

sleep(flyto_period)
/datum/cas_fire_envelope/proc/open_fire(atom/target_turf,datum/cas_fire_mission/mission,dir)
stat = FIRE_MISSION_STATE_FIRING
mission.execute_firemission(linked_console, target_turf, dir, fire_length, step_delay, src)
stat = FIRE_MISSION_STATE_OFF_TARGET
sleep(flyoff_period)

/datum/cas_fire_envelope/proc/flyoff()
stat = FIRE_MISSION_STATE_COOLDOWN
sleep(cooldown_period)

/datum/cas_fire_envelope/proc/end_cooldown()
stat = FIRE_MISSION_STATE_IDLE


/datum/cas_fire_envelope/proc/execute_firemission_unsafe(datum/cas_signal/signal, turf/target_turf, dir, datum/cas_fire_mission/mission)
stat = FIRE_MISSION_STATE_IN_TRANSIT
to_chat(usr, SPAN_ALERT("Firemission underway!"))
if(!target_turf)
stat = FIRE_MISSION_STATE_IDLE
mission_error = "Target Lost."
return
if(!target_turf || !check_firemission_loc(signal))
stat = FIRE_MISSION_STATE_IDLE
mission_error = "Target is off bounds or obstructed."
return

addtimer(CALLBACK( TYPE_PROC_REF(/datum/cas_fire_envelope, play_sound), target_turf), grace_period)
addtimer(CALLBACK( TYPE_PROC_REF(/datum/cas_fire_envelope, warning), target_turf), chat_warning)
addtimer(CALLBACK( TYPE_PROC_REF(/datum/cas_fire_envelope, open_fire), target_turf, mission,dir), execution_start)
addtimer(CALLBACK( TYPE_PROC_REF(/datum/cas_fire_envelope, flyoff)), flyoff_period)
addtimer(CALLBACK( TYPE_PROC_REF(/datum/cas_fire_envelope, end_cooldown)), cooldown_period)

/**
* Change attack vector for firemission
*/
Expand Down Expand Up @@ -324,10 +336,11 @@

/datum/cas_fire_envelope/uscm_dropship
fire_length = 12
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
grace_period = 5 SECONDS
chat_warning = 6.5 SECONDS
execution_start = 8.5 SECONDS
flyoff_period = 15 SECONDS
cooldown_period = 25 SECONDS
soundeffect = 'sound/weapons/dropship_sonic_boom.ogg' //BOOM~WOOOOOSH~HSOOOOOW~BOOM
step_delay = 3
max_offset = 12
Expand Down
1 change: 1 addition & 0 deletions code/game/cas_manager/datums/cas_fire_mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
return "Weapon [weapon_string] has not enough ammunition to complete this Fire Mission"
return "Unknown Error"


/datum/cas_fire_mission/proc/execute_firemission(obj/structure/machinery/computer/dropship_weapons/linked_console, turf/initial_turf, direction = NORTH, steps = 12, step_delay = 3, datum/cas_fire_envelope/envelope = null)
if(initial_turf == null || check(linked_console) != FIRE_MISSION_ALL_GOOD)
return FIRE_MISSION_NOT_EXECUTABLE
Expand Down

0 comments on commit 091a285

Please sign in to comment.