Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into React_Porting_Polish
Browse files Browse the repository at this point in the history
# Conflicts:
#	tgui/package.json
#	tgui/packages/tgui/components/Button.jsx
#	tgui/packages/tgui/components/Chart.jsx
#	tgui/packages/tgui/components/ColorBox.jsx
#	tgui/packages/tgui/components/Grid.jsx
#	tgui/packages/tgui/components/Icon.jsx
#	tgui/packages/tgui/components/NoticeBox.jsx
#	tgui/packages/tgui/components/Table.jsx
#	tgui/public/tgui-panel.bundle.css
#	tgui/webpack.config.js
#	tgui/yarn.lock
  • Loading branch information
Drulikar committed May 1, 2024
2 parents e22584e + 36e390d commit ea947cf
Show file tree
Hide file tree
Showing 33 changed files with 752 additions and 320 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
/// From /proc/biohazard_lockdown()
#define COMSIG_GLOB_RESEARCH_LOCKDOWN "!research_lockdown_closed"
#define COMSIG_GLOB_RESEARCH_LIFT "!research_lockdown_opened"
/// From /proc/aicore_lockdown()
#define COMSIG_GLOB_AICORE_LOCKDOWN "!aicore_lockdown_closed"
#define COMSIG_GLOB_AICORE_LIFT "!aicore_lockdown_opened"

/// From /obj/structure/machinery/power/reactor/proc/set_overloading() : (set_overloading)
#define COMSIG_GLOB_GENERATOR_SET_OVERLOADING "!generator_set_overloading"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#define CANDAZE (1<<18)
#define CANSLOW (1<<19)
#define NO_PERMANENT_DAMAGE (1<<20)
#define CORRUPTED_ALLY (1<<21)

// =============================
// hive types
Expand Down
4 changes: 4 additions & 0 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
if(hive && hive.color)
holder3.color = hive.color

if(status_flags & CORRUPTED_ALLY)
holder4.color = "#80ff80"
holder4.icon_state = "hudalien_ally"

if(stat == DEAD || status_flags & FAKEDEATH)
if(revive_enabled)
if(!client)
Expand Down
5 changes: 5 additions & 0 deletions code/defines/procs/announcement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
continue
if(is_mainship_level(H.z)) // People on ship see everything
continue

// If they have iff AND a marine headset they will recieve announcements
if ((FACTION_MARINE in H.wear_id?.faction_group) && (istype(H.wear_l_ear, /obj/item/device/radio/headset/almayer) || istype(H.wear_r_ear, /obj/item/device/radio/headset/almayer)))
continue

if((H.faction != faction_to_display && !add_PMCs) || (H.faction != faction_to_display && add_PMCs && !(H.faction in FACTION_LIST_WY)) && !(faction_to_display in H.faction_group)) //faction checks
targets.Remove(H)

Expand Down
114 changes: 80 additions & 34 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,10 @@
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/first_warning
var/second_warning
var/third_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 @@ -36,10 +39,6 @@
for(var/datum/cas_fire_mission/mission in missions)
.["missions"] += list(mission.ui_data(user))


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

/datum/cas_fire_envelope/proc/update_weapons(list/obj/structure/dropship_equipment/weapon/weapons)
for(var/datum/cas_fire_mission/mission in missions)
mission.update_weapons(weapons, fire_length)
Expand Down Expand Up @@ -242,14 +241,60 @@
/datum/cas_fire_envelope/proc/check_firemission_loc(datum/cas_signal/target_turf)
return TRUE //redefined in child class

/**
* Execute firemission.
*/
/// Step 1: Sets the stat to FIRE_MISSION_STATE_ON_TARGET and starts the sound effect for the fire mission.
/datum/cas_fire_envelope/proc/play_sound(atom/target_turf)
stat = FIRE_MISSION_STATE_ON_TARGET
change_current_loc(target_turf)
playsound(target_turf, soundeffect, vol = 70, vary = TRUE, sound_range = 50, falloff = 8)

/// Step 2, 3, 4: Warns nearby mobs of the incoming fire mission. Warning as 1 is non-precise, whereas 2 and 3 are precise.
/datum/cas_fire_envelope/proc/chat_warning(atom/target_turf, range = 10, warning_number = 1)
var/ds_identifier = "LARGE BIRD"
var/fm_identifier = "SPIT FIRE"
var/relative_dir
for(var/mob/mob in range(15, target_turf))
if (mob.mob_flags & KNOWS_TECHNOLOGY)
ds_identifier = "DROPSHIP"
fm_identifier = "FIRE"
if(get_turf(mob) == target_turf)
relative_dir = 0
else
relative_dir = Get_Compass_Dir(mob, target_turf)
switch(warning_number)
if(1)
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 \
)
if(2)
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 \
)
if(3)
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 \
)

/// Step 5: Actually executes the fire mission updating stat to FIRE_MISSION_STATE_FIRING and then FIRE_MISSION_STATE_OFF_TARGET
/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

/// Step 6: Sets the fire mission stat to FIRE_MISSION_STATE_COOLDOWN
/datum/cas_fire_envelope/proc/flyoff()
stat = FIRE_MISSION_STATE_COOLDOWN

/// Step 7: Sets the fire mission stat to FIRE_MISSION_STATE_IDLE
/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!"))
sleep(grace_period)
stat = FIRE_MISSION_STATE_ON_TARGET
if(!target_turf)
stat = FIRE_MISSION_STATE_IDLE
mission_error = "Target Lost."
Expand All @@ -258,29 +303,27 @@
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)

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"
var/obj/effect/firemission_effect = new(target_turf)

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 \
)
firemission_effect.icon = 'icons/obj/items/weapons/projectiles.dmi'
firemission_effect.icon_state = "laser_target2"
firemission_effect.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
firemission_effect.invisibility = INVISIBILITY_MAXIMUM
QDEL_IN(firemission_effect, 12 SECONDS)

sleep(flyto_period)
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)
stat = FIRE_MISSION_STATE_COOLDOWN
sleep(cooldown_period)
stat = FIRE_MISSION_STATE_IDLE

notify_ghosts(header = "CAS Fire Mission", message = "[usr ? usr : "Someone"] is launching Fire Mission '[mission.name]' at [get_area(target_turf)].", source = firemission_effect)
msg_admin_niche("[usr ? key_name(usr) : "Someone"] is launching Fire Mission '[mission.name]' at ([target_turf.x],[target_turf.y],[target_turf.z]) [ADMIN_JMP(target_turf)]")


addtimer(CALLBACK(src, PROC_REF(play_sound), target_turf), grace_period)
addtimer(CALLBACK(src, PROC_REF(chat_warning), target_turf, 15, 1), first_warning)
addtimer(CALLBACK(src, PROC_REF(chat_warning), target_turf, 15, 2), second_warning)
addtimer(CALLBACK(src, PROC_REF(chat_warning), target_turf, 10, 3), third_warning)
addtimer(CALLBACK(src, PROC_REF(open_fire), target_turf, mission,dir), execution_start)
addtimer(CALLBACK(src, PROC_REF(flyoff)), flyoff_period)
addtimer(CALLBACK(src, PROC_REF(end_cooldown)), cooldown_period)

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

/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
first_warning = 6 SECONDS
second_warning = 8 SECONDS
third_warning = 9 SECONDS
execution_start = 10 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
45 changes: 0 additions & 45 deletions code/game/cas_manager/datums/cas_fire_mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,51 +164,6 @@
if(initial_turf == null || check(linked_console) != FIRE_MISSION_ALL_GOOD)
return FIRE_MISSION_NOT_EXECUTABLE

var/obj/effect/firemission_effect = new(initial_turf)

firemission_effect.icon = 'icons/obj/items/weapons/projectiles.dmi'
firemission_effect.icon_state = "laser_target2"
firemission_effect.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
firemission_effect.invisibility = INVISIBILITY_MAXIMUM
QDEL_IN(firemission_effect, 5 SECONDS)

notify_ghosts(header = "CAS Fire Mission", message = "[usr ? usr : "Someone"] is launching Fire Mission '[name]' at [get_area(initial_turf)].", source = firemission_effect)
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/mob in range(15, initial_turf))
if(get_turf(mob) == initial_turf)
relative_dir = 0
else
relative_dir = Get_Compass_Dir(mob, initial_turf)

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

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(1.5 SECONDS)

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

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

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 \
)

var/turf/current_turf = initial_turf
var/tally_step = steps / mission_length //how much shots we need before moving to next turf
var/next_step = tally_step //when we move to next turf
Expand Down
7 changes: 7 additions & 0 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -522,5 +522,12 @@
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if("security_lockdown")
if(!COOLDOWN_FINISHED(datacore, aicore_lockdown))
to_chat(user, SPAN_BOLDWARNING("AI Core Lockdown procedures are on cooldown! They will be ready in [COOLDOWN_SECONDSLEFT(datacore, aicore_lockdown)] seconds!"))
return FALSE
aicore_lockdown(user)
return TRUE

if(playsound)
playsound(src, "keyboard_alt", 15, 1)
Loading

0 comments on commit ea947cf

Please sign in to comment.