Skip to content

Commit

Permalink
Merge remote-tracking branch 'CMSS13/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 28, 2023
2 parents 4c7174f + 2588df1 commit 5e24aef
Show file tree
Hide file tree
Showing 60 changed files with 1,177 additions and 1,030 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "6.6.0"
#define TGS_DMAPI_VERSION "6.6.1"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/cryo_marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/leaders = 0
spawn_max_amount = TRUE

/datum/emergency_call/cryo_squad/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message)
/datum/emergency_call/cryo_squad/spawn_candidates(quiet_launch, announce_incoming, override_spawn_loc)
var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
leaders = cryo_squad.num_leaders
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/cryo_marines_heavy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

var/leaders = 0

/datum/emergency_call/cryo_squad_equipped/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message)
/datum/emergency_call/cryo_squad_equipped/spawn_candidates(quiet_launch, announce_incoming, override_spawn_loc)
var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
leaders = cryo_squad.num_leaders
. = ..()
Expand Down
14 changes: 7 additions & 7 deletions code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@
else
return chosen_call

/datum/game_mode/proc/get_specific_call(call_name, quiet_launch = FALSE, announce = TRUE, is_emergency = TRUE, info = "", announce_dispatch_message = TRUE)
/datum/game_mode/proc/get_specific_call(call_name, quiet_launch = FALSE, announce_incoming = TRUE, info = "")
for(var/datum/emergency_call/E in all_calls) //Loop through all potential candidates
if(E.name == call_name)
var/datum/emergency_call/em_call = new E.type()
em_call.objective_info = info
em_call.activate(quiet_launch, announce, is_emergency, announce_dispatch_message)
em_call.activate(quiet_launch, announce_incoming)
return
error("get_specific_call could not find emergency call '[call_name]'")
return
Expand Down Expand Up @@ -192,7 +192,7 @@
else
to_chat(src, SPAN_WARNING("You did not get enlisted in the response team. Better luck next time!"))

/datum/emergency_call/proc/activate(quiet_launch = FALSE, announce = TRUE, turf/override_spawn_loc, announce_dispatch_message = TRUE)
/datum/emergency_call/proc/activate(quiet_launch = FALSE, announce_incoming = TRUE, turf/override_spawn_loc)
set waitfor = 0
if(!SSticker.mode) //Something horribly wrong with the gamemode ticker
return
Expand All @@ -205,9 +205,9 @@
if(!quiet_launch)
marine_announcement("A distress beacon has been launched from the [MAIN_SHIP_NAME].", "Priority Alert", 'sound/AI/distressbeacon.ogg', logging = ARES_LOG_SECURITY)

addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/emergency_call, spawn_candidates), quiet_launch, announce, override_spawn_loc, announce_dispatch_message), 30 SECONDS)
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/emergency_call, spawn_candidates), quiet_launch, announce_incoming, override_spawn_loc), 30 SECONDS)

/datum/emergency_call/proc/spawn_candidates(quiet_launch = FALSE, announce = TRUE, override_spawn_loc, announce_dispatch_message = TRUE)
/datum/emergency_call/proc/spawn_candidates(quiet_launch = FALSE, announce_incoming = TRUE, override_spawn_loc)
if(SSticker.mode)
SSticker.mode.picked_calls -= src

Expand Down Expand Up @@ -248,7 +248,7 @@
if(I.current)
to_chat(I.current, SPAN_WARNING("You didn't get selected to join the distress team. Better luck next time!"))

if(announce)
if(announce_incoming)
marine_announcement(dispatch_message, "Distress Beacon", 'sound/AI/distressreceived.ogg', logging = ARES_LOG_SECURITY) //Announcement that the Distress Beacon has been answered, does not hint towards the chosen ERT

message_admins("Distress beacon: [src.name] finalized, setting up candidates.")
Expand Down Expand Up @@ -304,7 +304,7 @@
create_member(null, override_spawn_loc)

candidates = list()
if(arrival_message && announce)
if(arrival_message && announce_incoming)
marine_announcement(arrival_message, "Intercepted Tranmission:")

/datum/emergency_call/proc/add_candidate(mob/M)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
continue

if(groundside_humans > (groundside_xenos * GROUNDSIDE_XENO_MULTIPLIER))
SSticker.mode.get_specific_call("Xenomorphs Groundside (Forsaken)", TRUE, FALSE, FALSE, announce_dispatch_message = FALSE)
SSticker.mode.get_specific_call("Xenomorphs Groundside (Forsaken)", TRUE, FALSE)

TIMER_COOLDOWN_START(src, COOLDOWN_HIJACK_GROUND_CHECK, 1 MINUTES)

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/colonialmarines/whiskey_outpost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
announce_xeno_wave(wave)
if(xeno_wave == 7)
//Wave when Marines get reinforcements!
get_specific_call("Marine Reinforcements (Squad)", FALSE, TRUE, FALSE)
get_specific_call("Marine Reinforcements (Squad)", FALSE, TRUE)
xeno_wave = min(xeno_wave + 1, WO_MAX_WAVE)


Expand Down
11 changes: 9 additions & 2 deletions code/game/machinery/computer/dropship_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,21 @@
return

var/targ_id = text2num(href_list["cas_camera"])

var/datum/cas_signal/new_signal
for(var/datum/cas_signal/LT as anything in cas_group.cas_signals)
if(LT.target_id == targ_id && LT.valid_signal())
selected_cas_signal = LT
new_signal = LT
break

if(!selected_cas_signal)
if(!new_signal)
to_chat(usr, SPAN_WARNING("Target lost or obstructed."))
return

if(usr in selected_cas_signal?.linked_cam?.viewing_users) // Reset previous cam
remove_from_view(usr)

selected_cas_signal = new_signal
if(selected_cas_signal && selected_cas_signal.linked_cam)
selected_cas_signal.linked_cam.view_directly(usr)
else
Expand Down
20 changes: 19 additions & 1 deletion code/game/machinery/kitchen/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/icon_on = "smartfridge"
var/icon_off = "smartfridge-off"
var/icon_panel = "smartfridge-panel"
var/item_quants = list()
var/list/item_quants = list() //! Assoc list of names -> list(items)
var/ispowered = TRUE //starts powered
var/is_secure_fridge = FALSE
var/shoot_inventory = FALSE
Expand All @@ -40,6 +40,24 @@
GLOB.vending_products[/obj/item/reagent_container/glass/bottle] = 1
GLOB.vending_products[/obj/item/storage/pill_bottle] = 1

/obj/structure/machinery/smartfridge/Destroy(force)
if(is_in_network()) // Delete all contents from networked storage index
for(var/atom/movable/item as anything in contents)
delete_contents(item)
item_quants.Cut()
return ..() // parent will delete contents if we're not networked

/// Deletes given object in contents of the smartfridge
/obj/structure/machinery/smartfridge/proc/delete_contents(obj/item/item)
if(item.loc != src)
return
contents -= item
if(item_quants[item.name])
item_quants[item.name] -= item
if(is_in_network() && chemical_data.shared_item_storage[item.name])
chemical_data.shared_item_storage[item.name] -= item
qdel(item)

/obj/structure/machinery/smartfridge/proc/accept_check(obj/item/O as obj)
if(istype(O,/obj/item/reagent_container/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return 1
Expand Down
149 changes: 85 additions & 64 deletions code/game/objects/effects/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,44 +287,56 @@
opacity = FALSE
anchored = TRUE
unacidable = TRUE
/// Target the acid is melting
var/atom/acid_t
var/ticks = 0
var/acid_strength = 1 //100% speed, normal
var/barricade_damage = 40
/// Duration left to next acid stage
var/remaining = 0
/// Acid stages left to complete melting
var/ticks_left = 3
/// Factor of duration between acid progression
var/acid_delay = 1
/// How much fuel the acid drains from the flare every acid tick
var/flare_damage = 500
var/barricade_damage_ticks = 10 // tick is once per 5 seconds. This tells us how many times it will try damaging barricades
var/barricade_damage = 40
var/in_weather = FALSE

//Sentinel weakest acid
/obj/effect/xenomorph/acid/weak
name = "weak acid"
acid_strength = 2.5 //250% normal speed
acid_delay = 2.5 //250% delay (40% speed)
barricade_damage = 20
flare_damage = 150
icon_state = "acid_weak"

//Superacid
/obj/effect/xenomorph/acid/strong
name = "strong acid"
acid_strength = 0.4 //40% normal speed
acid_delay = 0.4 //40% delay (250% speed)
barricade_damage = 100
flare_damage = 1875
icon_state = "acid_strong"

/obj/effect/xenomorph/acid/New(loc, target)
..(loc)
/obj/effect/xenomorph/acid/Initialize(mapload, atom/target)
. = ..()
acid_t = target
var/strength_t = isturf(acid_t) ? 8:4 // Turf take twice as long to take down.
if(isturf(acid_t))
ticks_left = 7 // Turf take twice as long to take down.
else if(istype(acid_t, /obj/structure/barricade))
ticks_left = 9
handle_weather()
tick(strength_t)

RegisterSignal(SSdcs, COMSIG_GLOB_WEATHER_CHANGE, PROC_REF(handle_weather))
RegisterSignal(acid_t, COMSIG_PARENT_QDELETING, PROC_REF(cleanup))
START_PROCESSING(SSeffects, src)

/obj/effect/xenomorph/acid/Destroy()
acid_t = null
STOP_PROCESSING(SSeffects, src)
. = ..()

/obj/effect/xenomorph/acid/proc/cleanup()
SIGNAL_HANDLER
qdel(src)

/obj/effect/xenomorph/acid/proc/handle_weather()
SIGNAL_HANDLER

Expand All @@ -333,76 +345,85 @@
return

if(SSweather.is_weather_event && locate(acids_area) in SSweather.weather_areas)
acid_strength = acid_strength + (SSweather.weather_event_instance.fire_smothering_strength * 0.33) //smothering_strength is 1-10, acid strength is a multiplier
acid_delay = acid_delay + (SSweather.weather_event_instance.fire_smothering_strength * 0.33) //smothering_strength is 1-10, acid strength is a multiplier
in_weather = SSweather.weather_event_instance.fire_smothering_strength
else
acid_strength = initial(acid_strength)
acid_delay = initial(acid_delay)
in_weather = FALSE

/obj/effect/xenomorph/acid/proc/handle_barricade()
if(prob(in_weather))
visible_message(SPAN_XENOWARNING("Acid on \The [acid_t] subsides!"))
return NONE
var/obj/structure/barricade/cade = acid_t
if(istype(cade))
cade.take_acid_damage(barricade_damage)

/obj/effect/xenomorph/acid/proc/tick(strength_t)
set waitfor = 0
if(!acid_t || !acid_t.loc)
qdel(src)
cade.take_acid_damage(barricade_damage)
return (5 SECONDS)

/obj/effect/xenomorph/acid/proc/handle_flashlight()
var/obj/item/device/flashlight/flare/flare = acid_t
if(flare.fuel <= 0)
return NONE
flare.fuel -= flare_damage
return (rand(15, 25) SECONDS) * acid_delay

/obj/effect/xenomorph/acid/process(delta_time)
remaining -= delta_time * (1 SECONDS)
if(remaining > 0)
return
ticks_left -= 1

if(istype(acid_t,/obj/structure/barricade))
if(++ticks >= barricade_damage_ticks || prob(in_weather))
visible_message(SPAN_XENOWARNING("Acid on \The [acid_t] subsides!"))
qdel(src)
return
handle_barricade()
sleep(50)
.()
return
if(istype(acid_t, /obj/item/device/flashlight/flare))
var/obj/item/device/flashlight/flare/flare = acid_t
if(flare.fuel > 0) //Flares that have fuel in them lose fuel instead of melting
flare.fuel -= flare_damage
sleep(rand(150,250) * (acid_strength))
return .()

if(++ticks >= strength_t)
visible_message(SPAN_XENODANGER("[acid_t] collapses under its own weight into a puddle of goop and undigested debris!"))
playsound(src, "acid_hit", 25, TRUE)

if(istype(acid_t, /turf))
if(istype(acid_t, /turf/closed/wall))
var/turf/closed/wall/W = acid_t
new /obj/effect/acid_hole (W)
else
var/turf/T = acid_t
T.ScrapeAway()
else if (istype(acid_t, /obj/structure/girder))
var/obj/structure/girder/G = acid_t
G.dismantle()
else if(istype(acid_t, /obj/structure/window/framed))
var/obj/structure/window/framed/WF = acid_t
WF.deconstruct(disassembled = FALSE)
else if(istype(acid_t,/obj/item/explosive/plastic))
qdel(acid_t)
var/return_delay = NONE
if(istype(acid_t, /obj/structure/barricade))
return_delay = handle_barricade()
else if(istype(acid_t, /obj/item/device/flashlight/flare))
return_delay = handle_flashlight()
else
return_delay = (rand(20, 30) SECONDS) * acid_delay

else
if(acid_t.contents.len) //Hopefully won't auto-delete things inside melted stuff..
for(var/mob/M in acid_t.contents)
if(acid_t.loc) M.forceMove(acid_t.loc)
QDEL_NULL(acid_t)
if(!ticks_left)
finish_melting()
return PROCESS_KILL

if(!return_delay)
qdel(src)
return
return PROCESS_KILL

switch(strength_t - ticks)
remaining = return_delay

switch(ticks_left)
if(6) visible_message(SPAN_XENOWARNING("\The [acid_t] is barely holding up against the acid!"))
if(4) visible_message(SPAN_XENOWARNING("\The [acid_t]\s structure is being melted by the acid!"))
if(2) visible_message(SPAN_XENOWARNING("\The [acid_t] is struggling to withstand the acid!"))
if(0 to 1) visible_message(SPAN_XENOWARNING("\The [acid_t] begins to crumble under the acid!"))

sleep(rand(200,300) * (acid_strength))
.()
/obj/effect/xenomorph/acid/proc/finish_melting()
visible_message(SPAN_XENODANGER("[acid_t] collapses under its own weight into a puddle of goop and undigested debris!"))
playsound(src, "acid_hit", 25, TRUE)

if(istype(acid_t, /turf))
if(istype(acid_t, /turf/closed/wall))
var/turf/closed/wall/wall = acid_t
new /obj/effect/acid_hole(wall)
else
var/turf/turf = acid_t
turf.ScrapeAway()

else if (istype(acid_t, /obj/structure/girder))
var/obj/structure/girder/girder = acid_t
girder.dismantle()

else if(istype(acid_t, /obj/structure/window/framed))
var/obj/structure/window/framed/window = acid_t
window.deconstruct(disassembled = FALSE)

else if(istype(acid_t, /obj/structure/barricade))
pass() // Don't delete it, just damaj

else
for(var/mob/mob in acid_t)
mob.forceMove(loc)
qdel(acid_t)
qdel(src)

/obj/effect/xenomorph/boiler_bombard
name = "???"
Expand Down
Loading

0 comments on commit 5e24aef

Please sign in to comment.