Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] dev from Baystation12:dev #24

Merged
merged 23 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8e6030c
Automatic changelog generation [ci skip]
Bay12Bot Dec 26, 2023
2b4874f
attackby /machinery/a to use_tool
emmanuelbassil Nov 4, 2023
898666f
attackby /machinery/b-c to use_tool
emmanuelbassil Nov 4, 2023
969779d
attackby /machinery/d-f to use_tool
emmanuelbassil Nov 4, 2023
53acde6
attackby /machinery/g-o
emmanuelbassil Nov 5, 2023
3c0f293
attackby /machinery/p
emmanuelbassil Nov 5, 2023
52badbf
attackby /machinery q-z
emmanuelbassil Nov 5, 2023
c59fa8b
Check-paths
emmanuelbassil Dec 20, 2023
b79bfab
Merge pull request #34305 from emmanuelbassil/Attackby
SierraKomodo Dec 26, 2023
06abeee
Automatic changelog generation for PR #34305 [ci skip]
Bay12Bot Dec 26, 2023
1ff8913
Automatic changelog generation [ci skip]
Bay12Bot Dec 26, 2023
da20b8f
Generalize chameleon extension setup
PsiOmegaDelta Dec 27, 2023
6be3a3f
Refactor poster code
PsiOmegaDelta Dec 27, 2023
5f1d6bd
fix organ printer not taking steel
MuckerMayhem Dec 29, 2023
90a1f59
Merge pull request #34416 from PsiOmegaDelta/231227-HiddenPurpose
MuckerMayhem Dec 29, 2023
63b9204
disallow summoning nar-sie on shuttles or offship
MuckerMayhem Dec 29, 2023
77d67aa
Merge pull request #34419 from MuckerMayhem/cult-summon-nerf
Spookerton Dec 29, 2023
e852f99
Automatic changelog generation for PR #34419 [ci skip]
Bay12Bot Dec 29, 2023
44c69ef
Merge pull request #34418 from MuckerMayhem/organ-printer-fix
Spookerton Dec 29, 2023
cf633f7
Automatic changelog generation for PR #34418 [ci skip]
Bay12Bot Dec 29, 2023
38a2bbc
Merge pull request #34415 from PsiOmegaDelta/231129-OpenClosed
MuckerMayhem Dec 29, 2023
2a9ca65
Automatic changelog generation [ci skip]
Bay12Bot Dec 30, 2023
c78554d
Automatic changelog generation [ci skip]
Bay12Bot Dec 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@
#include "code\game\objects\effects\decals\Cleanable\misc.dm"
#include "code\game\objects\effects\decals\Cleanable\robots.dm"
#include "code\game\objects\effects\decals\Cleanable\tracks.dm"
#include "code\game\objects\effects\decals\posters\_defines.dm"
#include "code\game\objects\effects\decals\posters\bs12.dm"
#include "code\game\objects\effects\decals\posters\posters.dm"
#include "code\game\objects\effects\fire\fire.dm"
#include "code\game\objects\effects\particles\particles.dm"
#include "code\game\objects\effects\spawners\bombspawner.dm"
Expand Down
1 change: 1 addition & 0 deletions code/__defines/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define ITEM_FLAG_NOCUFFS FLAG(13) // Gloves that have this flag prevent cuffs being applied
#define ITEM_FLAG_CAN_HIDE_IN_SHOES FLAG(14) // Items that can be hidden in shoes that permit it
#define ITEM_FLAG_WASHER_ALLOWED FLAG(15) // Items that can be washed in washing machines
#define ITEM_FLAG_IS_CHAMELEON_ITEM FLAG(16) // Setups the chameleon extension on init. Throws an exception if there is no compatible extension subtype.

// Flags for pass_flags.
#define PASS_FLAG_TABLE FLAG(0)
Expand Down
4 changes: 4 additions & 0 deletions code/_helpers/game.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31

#define IS_SUBTYPE(child_type, parent_type) (child_type != parent_type && istype(child_type, parent_type))

#define IS_SUBPATH(child_path, parent_path) (child_path != parent_path && ispath(child_path, parent_path))

/proc/is_on_same_plane_or_station(z1, z2)
if(z1 == z2)
return 1
Expand Down
22 changes: 22 additions & 0 deletions code/datums/extensions/chameleon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,25 @@
return outfit.l_ear
if (ispath(outfit.r_ear, expected_type))
return outfit.r_ear

/***************
* Setup Helper *
****************/
/obj/proc/SetupChameleonExtension(throw_runtime)
var/best_found_expected_type
var/best_found_extension
for (var/datum/extension/chameleon/chameleon_extension_type as anything in typesof(/datum/extension/chameleon))
var/expected_type = initial(chameleon_extension_type.expected_type)

if (istype(src, expected_type)) // If the type of src is a type expected by the extension then..
// Check if the expected type is a better match than the previously found best expected type (if any)
if (!best_found_expected_type || IS_SUBPATH(expected_type, best_found_expected_type))
best_found_expected_type = expected_type
best_found_extension = chameleon_extension_type

if (best_found_extension)
set_extension(src, best_found_extension)
return

if (throw_runtime)
CRASH("The type [type] does not have a compatible chameleon extension.")
2 changes: 2 additions & 0 deletions code/game/antagonist/station/cultist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ GLOBAL_DATUM_INIT(cult, /datum/antagonist/cultist, new)
var/list/cult_rating_bounds = list(CULT_RUNES_1, CULT_RUNES_2, CULT_RUNES_3, CULT_GHOSTS_1, CULT_GHOSTS_2, CULT_GHOSTS_3)
var/max_cult_rating = 0
var/conversion_blurb = "You catch a glimpse of the Realm of Nar-Sie, the Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of That Which Waits. Assist your new compatriots in their dark dealings. Their goals are yours, and yours are theirs. You serve the Dark One above all else. Bring It back."
var/station_summon_only = TRUE
var/no_shuttle_summon = TRUE

faction = "cult"

Expand Down
6 changes: 6 additions & 0 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,12 @@
/obj/rune/tearreality/cast(mob/living/user)
if(!GLOB.cult.allow_narsie)
return
if (GLOB.cult.station_summon_only && !(get_z(user) in GLOB.using_map.station_levels))
to_chat(user, SPAN_OCCULT("Nar-Sie cannot be summoned here."))
return
if (GLOB.cult.no_shuttle_summon && istype(get_area(user), /area/shuttle))
to_chat(user, SPAN_OCCULT("Nar-Sie cannot be summoned on a shuttle."))
return
if(the_end_comes)
to_chat(user, SPAN_OCCULT("You are already summoning! Be patient!"))
return
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/CableLayer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
user.visible_message("\The [user] [!on?"dea":"a"]ctivates \the [src].", "You switch [src] [on? "on" : "off"]")
return TRUE

/obj/machinery/cablelayer/attackby(obj/item/O as obj, mob/user as mob)
/obj/machinery/cablelayer/use_tool(obj/item/O, mob/living/user, list/click_params)
if(istype(O, /obj/item/stack/cable_coil))

var/result = load_cable(O)
if(!result)
to_chat(user, SPAN_WARNING("\The [src]'s cable reel is full."))
else
to_chat(user, "You load [result] lengths of cable into [src].")
return
return TRUE

if(isWirecutter(O))
if(cable && cable.amount)
Expand All @@ -48,6 +47,8 @@
CC.amount = m
else
to_chat(usr, SPAN_WARNING("There's no more cable on the reel."))
return TRUE
return ..()

/obj/machinery/cablelayer/examine(mob/user)
. = ..()
Expand Down
18 changes: 9 additions & 9 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@
updateUsrDialog()
go_out()

/obj/machinery/sleeper/attackby(obj/item/I, mob/user)
/obj/machinery/sleeper/use_tool(obj/item/I, mob/living/user, list/click_params)
if(istype(I, /obj/item/reagent_containers/glass))
add_fingerprint(user)
if(!beaker)
if(!user.unEquip(I, src))
return
beaker = I
user.visible_message(SPAN_NOTICE("\The [user] adds \a [I] to \the [src]."), SPAN_NOTICE("You add \a [I] to \the [src]."))
else
to_chat(user, SPAN_WARNING("\The [src] has a beaker already."))
if(beaker)
to_chat(user, SPAN_WARNING("There is already a beaker loaded in \the [src]."))
return TRUE
if(!user.unEquip(I, src))
return TRUE
beaker = I
user.visible_message(SPAN_NOTICE("\The [user] adds \a [I] to \the [src]."), SPAN_NOTICE("You add \a [I] to \the [src]."))
return TRUE

return ..()

/obj/machinery/sleeper/user_can_move_target_inside(mob/target, mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@
machine.attack_hand(user)
return TRUE

/*
This returning FALSE means if component_attackby under use_tool called this it will also return FALSE; which means the use_tool call will proceed.
In that same vein, the attackby() children of this proc will also continue the rest of its code if this crashes; since this check is called at the beginning.
*/
/singleton/machine_construction/proc/attackby(obj/item/I, mob/user, obj/machinery/machine)
if(!validate_state(machine))
crash_with("Machine [log_info_line(machine)] violated the state assumptions of the construction state [type]!")
machine.attackby(I, user)
return TRUE
return FALSE

/singleton/machine_construction/proc/mechanics_info()

Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@


/obj/machinery/post_anchor_change()
..()
update_use_power(anchored)
power_change()
..()

/**
* Called by machines that can hold a mob (sleeper, suit cycler, etc.), checking if mob can be moved before doing so.
Expand Down
15 changes: 12 additions & 3 deletions code/game/machinery/_machines_base/machinery_components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,23 @@ GLOBAL_LIST_INIT(machine_path_to_circuit_type, cache_circuits_by_build_path())
/// Called whenever an attached component updates it's status. Override to handle updates to the machine.
/obj/machinery/proc/component_stat_change(obj/item/stock_parts/part, old_stat, flag)

/obj/machinery/attackby(obj/item/I, mob/user)
if(component_attackby(I, user))
/obj/machinery/use_tool(obj/item/tool, mob/living/user, list/click_params)
if (component_attackby(tool, user))
return TRUE
return ..()

/obj/machinery/can_anchor(obj/item/tool, mob/user, silent)
if (use_power == POWER_USE_ACTIVE)
if (!silent)
to_chat(user, SPAN_WARNING("Turn \the [src] off first!"))
return FALSE
return ..()


/obj/machinery/post_anchor_change()
update_use_power(anchored)
power_change()
return ..()
..()

/// Passes `attackby()` calls through to components within the machine, if they are accessible.
/obj/machinery/proc/component_attackby(obj/item/I, mob/user)
Expand Down
118 changes: 68 additions & 50 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -808,71 +808,74 @@
apply_mode()
return TOPIC_REFRESH

/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob)
/obj/machinery/alarm/use_tool(obj/item/W, mob/living/user, list/click_params)
switch(buildstage)
if(2)
if(isScrewdriver(W)) // Opening that Air Alarm up.
// to_chat(user, "You pop the Air Alarm's maintence panel open.")
if (isScrewdriver(W))
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
update_icon()
return
return TRUE

if (wiresexposed && isWirecutter(W))
user.visible_message(SPAN_WARNING("[user] has cut the wires inside \the [src]!"), "You have cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
buildstage = 1
update_icon()
return
return TRUE

if (istype(W, /obj/item/card/id) || istype(W, /obj/item/modular_computer))// trying to unlock the interface with an ID card
if (isid(W) || istype(W, /obj/item/modular_computer))
if(inoperable())
to_chat(user, "It does nothing")
return
return TRUE
if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
locked = !locked
to_chat(user, SPAN_NOTICE("You [ locked ? "lock" : "unlock"] the Air Alarm interface."))
else
if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
locked = !locked
to_chat(user, SPAN_NOTICE("You [ locked ? "lock" : "unlock"] the Air Alarm interface."))
else
to_chat(user, SPAN_WARNING("Access denied."))
return
to_chat(user, SPAN_WARNING("Access denied."))
return TRUE

if(1)
if(isCoil(W))
if (isCoil(W))
var/obj/item/stack/cable_coil/C = W
if (C.use(5))
to_chat(user, SPAN_NOTICE("You wire \the [src]."))
buildstage = 2
update_icon()
return
return TRUE
else
to_chat(user, SPAN_WARNING("You need 5 pieces of cable to do wire \the [src]."))
return
return TRUE

else if(isCrowbar(W))
if (isCrowbar(W))
to_chat(user, "You start prying out the circuit.")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
if(do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT) && buildstage == 1)
to_chat(user, "You pry out the circuit!")
var/obj/item/airalarm_electronics/circuit = new /obj/item/airalarm_electronics()
circuit.dropInto(user.loc)
buildstage = 0
update_icon()
return
if (!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT))
return TRUE

to_chat(user, "You pry out the circuit!")
var/obj/item/airalarm_electronics/circuit = new /obj/item/airalarm_electronics()
circuit.dropInto(user.loc)
buildstage = 0
update_icon()
return TRUE

if(0)
if(istype(W, /obj/item/airalarm_electronics))
if (istype(W, /obj/item/airalarm_electronics))
to_chat(user, "You insert the circuit!")
qdel(W)
buildstage = 1
update_icon()
return
return TRUE

else if(isWrench(W))
if (isWrench(W))
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/air_alarm(get_turf(user))
var/obj/item/frame/air_alarm/frame = new /obj/item/frame/air_alarm(get_turf(user))
transfer_fingerprints_to(frame)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
qdel(src)
return TRUE

return ..()

Expand Down Expand Up @@ -988,63 +991,78 @@ FIRE ALARM
alarm(rand(30/severity, 60/severity))
..()

/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
/obj/machinery/firealarm/use_tool(obj/item/W, mob/living/user, list/click_params)
if ((. = ..()))
return

if(isScrewdriver(W) && buildstage == 2)
wiresexposed = !wiresexposed
update_icon()
return
return TRUE

if(wiresexposed)
switch(buildstage)
if(2)
if(isMultitool(W))
src.detecting = !( src.detecting )
if (src.detecting)
user.visible_message(SPAN_NOTICE("\The [user] has reconnected [src]'s detecting unit!"), SPAN_NOTICE("You have reconnected [src]'s detecting unit."))
else
user.visible_message(SPAN_NOTICE("\The [user] has disconnected [src]'s detecting unit!"), SPAN_NOTICE("You have disconnected [src]'s detecting unit."))
else if(isWirecutter(W))
user.visible_message(SPAN_NOTICE("\The [user] has cut the wires inside \the [src]!"), SPAN_NOTICE("You have cut the wires inside \the [src]."))
detecting = !detecting
user.visible_message(
SPAN_NOTICE("\The [user] has [detecting? "re" : "dis"]connected \the [src]'s detecting unit!"),
SPAN_NOTICE("You have [detecting? "re" : "dis"]connected \the [src]'s detecting unit.")
)
return TRUE

if (isWirecutter(W))
user.visible_message(
SPAN_NOTICE("\The [user] has cut the wires inside \the [src]!"),
SPAN_NOTICE("You have cut the wires inside \the [src].")
)
new/obj/item/stack/cable_coil(get_turf(src), 5)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
buildstage = 1
update_icon()
return TRUE

if(1)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if (C.use(5))
to_chat(user, SPAN_NOTICE("You wire \the [src]."))
buildstage = 2
update_icon()
return
return TRUE
else
to_chat(user, SPAN_WARNING("You need 5 pieces of cable to wire \the [src]."))
return
else if(isCrowbar(W))
return TRUE
if(isCrowbar(W))
to_chat(user, "You start prying out the circuit.")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, "You pry out the circuit!")
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
circuit.dropInto(user.loc)
buildstage = 0
update_icon()
if (!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT))
return TRUE

to_chat(user, "You pry out the circuit!")
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
circuit.dropInto(user.loc)
buildstage = 0
update_icon()
return TRUE
if(0)
if(istype(W, /obj/item/firealarm_electronics))
to_chat(user, "You insert the circuit!")
qdel(W)
buildstage = 1
update_icon()
return TRUE

else if(isWrench(W))
if (isWrench(W))
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/fire_alarm(get_turf(user))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
qdel(src)
return
return TRUE

src.alarm()
return
to_chat(user, SPAN_WARNING("You fumble with \the [W] and trigger the alarm!"))
alarm()
return TRUE

/obj/machinery/firealarm/Process()//Note: this processing was mostly phased out due to other code, and only runs when needed
if(inoperable())
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
return GM.return_pressure()
return 0

/obj/machinery/portable_atmospherics/canister/attackby(obj/item/W as obj, mob/user as mob)
/obj/machinery/portable_atmospherics/canister/use_tool(obj/item/W, mob/living/user, list/click_params)
if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
var/datum/gas_mixture/thejetpack = W:air_contents
var/env_pressure = thejetpack.return_pressure()
Expand Down
Loading