Skip to content

Commit

Permalink
Merge pull request #104 from NebulaSS13/dev
Browse files Browse the repository at this point in the history
Updating from Neb dev
  • Loading branch information
MistakeNot4892 authored Nov 20, 2024
2 parents 36cc073 + 1b632c9 commit a70904a
Show file tree
Hide file tree
Showing 505 changed files with 6,495 additions and 7,376 deletions.
1 change: 1 addition & 0 deletions code/__defines/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#define COLOR_VERDANT_GREEN "#287d00"
#define COLOR_SCIENCE_PURPLE "#6633cc"
#define COLOR_DAYLIGHT "#f3e6ca"
#define COLOR_CHERRY_RED "#902630"

#define PIPE_COLOR_GREY "#808080"
#define PIPE_COLOR_RED "#ff0000"
Expand Down
19 changes: 10 additions & 9 deletions code/__defines/inventory_sizes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
20 - things that take up an entire turf, like wall girders or door assemblies
*/

#define ITEM_SIZE_TINY 1
#define ITEM_SIZE_SMALL 2
#define ITEM_SIZE_NORMAL 3
#define ITEM_SIZE_LARGE 4
#define ITEM_SIZE_HUGE 5
#define ITEM_SIZE_GARGANTUAN 6
#define ITEM_SIZE_STRUCTURE 20
#define ITEM_SIZE_TINY 1
#define ITEM_SIZE_SMALL 2
#define ITEM_SIZE_NORMAL 3
#define ITEM_SIZE_LARGE 4
#define ITEM_SIZE_HUGE 5
#define ITEM_SIZE_GARGANTUAN 6
#define ITEM_SIZE_STRUCTURE 20
#define ITEM_SIZE_LARGE_STRUCTURE 30

#define ITEM_SIZE_MIN ITEM_SIZE_TINY
#define ITEM_SIZE_MAX ITEM_SIZE_STRUCTURE
#define ITEM_SIZE_MIN ITEM_SIZE_TINY
#define ITEM_SIZE_MAX ITEM_SIZE_LARGE_STRUCTURE

#define BASE_STORAGE_COST(w_class) (2**(w_class-1)) //1,2,4,8,16,...

Expand Down
1 change: 1 addition & 0 deletions code/__defines/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#define TOOL_PROP_COLOR_NAME "color_name" //Property containing a color name for some tools. Namely the pen tool.
#define TOOL_PROP_COLOR "color" //Property for specifying a color, for something like a pen.
#define TOOL_PROP_USES "uses_left" //Property for things that have a fixed amount of uses. -1 is unlimited.
#define TOOL_PROP_EMPTY_MESSAGE "empty_msg" //The message given on depletion when a tool runs out of charges.

//Pen specific stuff
#define TOOL_PROP_PEN_FLAG "pen_flag" //Property for pens to specify additional properties about themselves
Expand Down
10 changes: 4 additions & 6 deletions code/__defines/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
#define TURF_REMOVE_SCREWDRIVER BITFLAG(1)
#define TURF_REMOVE_SHOVEL BITFLAG(2)
#define TURF_REMOVE_WRENCH BITFLAG(3)
#define TURF_CAN_BREAK BITFLAG(4)
#define TURF_CAN_BURN BITFLAG(5)
#define TURF_IS_FRAGILE BITFLAG(6)
#define TURF_ACID_IMMUNE BITFLAG(7)
#define TURF_IS_WET BITFLAG(8)
#define TURF_HAS_RANDOM_BORDER BITFLAG(9)
#define TURF_IS_FRAGILE BITFLAG(4)
#define TURF_ACID_IMMUNE BITFLAG(5)
#define TURF_IS_WET BITFLAG(6)
#define TURF_HAS_RANDOM_BORDER BITFLAG(7)

//Used for floor/wall smoothing
#define SMOOTH_NONE 0 //Smooth only with itself
Expand Down
8 changes: 4 additions & 4 deletions code/__defines/zmimic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var/global/list/mimic_defines = list(
)

// Movable flags.
#define ZMM_IGNORE 1 //! Do not copy this movable.
#define ZMM_MANGLE_PLANES 2 //! Check this movable's overlays/underlays for explicit plane use and mangle for compatibility with Z-Mimic. If you're using emissive overlays, you probably should be using this flag. Expensive, only use if necessary.
#define ZMM_LOOKAHEAD 3 //! Look one turf ahead and one turf back when considering z-turfs that might be seeing this atom. Cheap, but not free.
#define ZMM_LOOKBESIDE 4 //! Look one turf beside (left/right) when considering z-turfs that might be seeing this atom. Cheap, but not free.
#define ZMM_IGNORE BITFLAG(0) //! Do not copy this movable.
#define ZMM_MANGLE_PLANES BITFLAG(1) //! Check this movable's overlays/underlays for explicit plane use and mangle for compatibility with Z-Mimic. If you're using emissive overlays, you probably should be using this flag. Expensive, only use if necessary.
#define ZMM_LOOKAHEAD BITFLAG(2) //! Look one turf ahead and one turf back when considering z-turfs that might be seeing this atom. Cheap, but not free.
#define ZMM_LOOKBESIDE BITFLAG(3) //! Look one turf beside (left/right) when considering z-turfs that might be seeing this atom. Cheap, but not free.
4 changes: 2 additions & 2 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Quick adjacency (to turf):
return TRUE
if(istype(loc, /obj/item) || istype(loc, /obj/structure))
if(recurse > 0)
return loc.Adjacent(neighbor,recurse - 1)
return loc.Adjacent(neighbor, recurse - 1)
return FALSE
return ..()

Expand All @@ -112,7 +112,7 @@ Quick adjacency (to turf):
return TRUE
if(istype(loc, /obj/item) || istype(loc, /obj/structure))
if(recurse > 0)
return loc.Adjacent(neighbor,recurse - 1)
return loc.Adjacent(neighbor, recurse - 1)
return FALSE
return ..()

Expand Down
6 changes: 5 additions & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ avoid code duplication. This includes items that may sometimes act as a standard
var/datum/extension/tool/tool = get_extension(src, /datum/extension/tool)
return (tool?.handle_physical_manipulation(user)) || FALSE

// If TRUE, prevent afterattack from running.
/obj/item/proc/resolve_attackby(atom/A, mob/user, var/click_params)
if(!(item_flags & ITEM_FLAG_NO_PRINT))
add_fingerprint(user)
return A.attackby(src, user, click_params)

// If TRUE, prevent afterattack from running.
/atom/proc/attackby(obj/item/used_item, mob/user, var/click_params)
if(storage)
if(isrobot(user) && (used_item == user.get_active_held_item()))
return FALSE //Robots can't store their modules.
if(!storage.can_be_inserted(used_item, user))
if(!storage.can_be_inserted(used_item, user, click_params = click_params))
return FALSE
used_item.add_fingerprint(user)
return storage.handle_item_insertion(user, used_item, click_params = click_params)
Expand All @@ -44,6 +46,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
if(!.)
return bash(W,user)

// Return TRUE if further actions (afterattack, etc) should be prevented, FALSE if they can proceed.
/atom/movable/proc/bash(obj/item/weapon, mob/user)
if(isliving(user) && user.a_intent == I_HELP)
return FALSE
Expand Down Expand Up @@ -105,6 +108,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
var/mob/living/attackee = null

//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
// If this returns TRUE, the interaction has been handled and other interactions like afterattack should be skipped.
/obj/item/proc/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)

// TODO: revisit if this should be a silent failure/parent call instead, for mob-level storage interactions?
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(mapping)
/// Z-levels available to various consoles, such as the crew monitor. Defaults to station_levels if unset.
var/list/map_levels
/// The turf type used when generating floors between Z-levels at startup.
var/base_floor_type = /turf/floor/airless
var/base_floor_type = /turf/floor/plating/airless
/// Replacement area, if a base_floor_type is generated. Leave blank to skip.
var/base_floor_area
/// A list of connected z-levels to avoid repeatedly rebuilding connections
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystems/zcopy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,10 @@ SUBSYSTEM_DEF(zcopy)
ASSERT(!QDELETED(object))

var/turf/Tloc = object.loc
if (!isturf(Tloc) || !Tloc.above)
if (!isturf(Tloc) || !MOVABLE_SHALL_MIMIC(object))
return TRUE

var/turf/T = Tloc.above
var/turf/T = GetAbove(Tloc)

ZM_RECORD_START

Expand Down
14 changes: 14 additions & 0 deletions code/datums/ai/_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
/// What directions can we wander in? Uses global.cardinal if unset.
var/list/wander_directions

/// Should we retaliate/startle when grabbed or buckled?
var/spooked_by_grab = TRUE
/// Can we automatically escape from buckling?
var/can_escape_buckles = FALSE

Expand Down Expand Up @@ -314,3 +316,15 @@
if(body)
return body.set_target_zone(ran_zone())
return FALSE

/datum/mob_controller/proc/on_buckled(mob/scary_grabber)
if(!scary_grabber || body.buckled_mob != scary_grabber) // the buckle got cancelled somehow?
return
if(spooked_by_grab && !is_friend(scary_grabber))
retaliate(scary_grabber)

/datum/mob_controller/proc/on_grabbed(mob/scary_grabber)
if(!scary_grabber)
return
if(spooked_by_grab && !is_friend(scary_grabber))
retaliate(scary_grabber)
3 changes: 2 additions & 1 deletion code/datums/extensions/assembly/assembly_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@
return TRUE

if(istype(W, /obj/item/stock_parts))
return try_install_component(user, W)
return try_install_component(user, W)
return FALSE
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/_storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var/global/list/_test_storage_items = list()

//This proc return 1 if the item can be picked up and 0 if it can't.
//Set the stop_messages to stop it from printing messages
/datum/storage/proc/can_be_inserted(obj/item/W, mob/user, stop_messages = 0)
/datum/storage/proc/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
if(!istype(W)) return //Not an item

if(user && !user.canUnEquip(W))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
max_w_class = ITEM_SIZE_NORMAL
max_storage_space = 56

/datum/storage/backpack/holding/can_be_inserted(obj/item/W, stop_messages = 0)
/datum/storage/backpack/holding/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params)
if(istype(W, /obj/item/backpack/holding))
return 1
return ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_bag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var/obj/item/bag/bag = holder
bag.update_w_class()

/datum/storage/bag/can_be_inserted(obj/item/W, mob/user, stop_messages = 0)
/datum/storage/bag/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
var/mob/living/human/H = ishuman(user) ? user : null // if we're human, then we need to check if bag in a pocket
if(holder.loc?.storage || H?.is_in_pocket(holder))
if(!stop_messages)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/extensions/storage/subtypes_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
can_hold = list(/obj/item)
expected_type = /obj/structure/reagent_dispensers/compost_bin

/datum/storage/hopper/industrial/compost/can_be_inserted(obj/item/W, mob/user, stop_messages = 0)
/datum/storage/hopper/industrial/compost/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
. = ..()
if(!.)
return
Expand All @@ -120,7 +120,7 @@
/datum/storage/hopper/mortar
max_w_class = ITEM_SIZE_NORMAL * 2

/datum/storage/hopper/mortar/can_be_inserted(obj/item/inserting_item, mob/user, stop_messages)
/datum/storage/hopper/mortar/can_be_inserted(obj/item/inserting_item, mob/user, stop_messages, click_params = null)
. = ..()
if(!.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_pills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if(pop.pop_sound)
playsound(get_turf(pop), pop.pop_sound, 50)

/datum/storage/pillbottle/foil/can_be_inserted(obj/item/W, mob/user, stop_messages = 0)
/datum/storage/pillbottle/foil/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
return FALSE

/datum/storage/pillbottle/foil/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_secure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
. = ..()

//Must be overriden to prevent gathering from tile and using on items when locked!
/datum/storage/secure/can_be_inserted(obj/item/W, mob/user, stop_messages)
/datum/storage/secure/can_be_inserted(obj/item/W, mob/user, stop_messages, click_params = null)
if(is_locked())
if(!stop_messages)
to_chat(user, SPAN_WARNING("\The [holder] is locked, you cannot put anything inside."))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_sheets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/datum/storage/sheets/robot
capacity = 500 //Borgs get more because >specialization

/datum/storage/sheets/can_be_inserted(obj/item/W, mob/user, stop_messages = 0)
/datum/storage/sheets/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
if(!istype(W,/obj/item/stack/material))
if(!stop_messages)
to_chat(user, "\The [holder] does not accept [W].")
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_wallet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
wallet.front_stick = null

/datum/storage/wallet/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
. = ..(W, prevent_warning)
. = ..()
if(. && istype(holder, /obj/item/wallet))
var/obj/item/wallet/wallet = holder
if(!wallet.front_id && istype(W, /obj/item/card/id))
Expand Down
1 change: 1 addition & 0 deletions code/datums/inventory_slots/_inventory_slot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
prop.forceMove(user)
prop.hud_layerise()
prop.equipped(user, slot_id)
prop.compile_overlays() // avoid world overlays on inventory state and vice versa

// Clean up the preexisting item.
if(held)
Expand Down
31 changes: 17 additions & 14 deletions code/datums/outfits/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,26 @@
post_equip(H)

if(outfit_flags & OUTFIT_HAS_VITALS_SENSOR)
var/obj/item/clothing/sensor/vitals/sensor
for(var/check_slot in global.vitals_sensor_equip_slots)
if(!H.get_inventory_slot_datum(check_slot))
continue
if(!sensor) // only create the sensor if we have at least one eligible slot
sensor = new(get_turf(H))
var/obj/item/clothing/equipped = H.get_equipped_item(check_slot)
if(istype(equipped) && !(locate(/obj/item/clothing/sensor/vitals) in equipped.accessories) && equipped.can_attach_accessory(sensor))
equipped.attach_accessory(null, sensor)
break
if(isturf(sensor?.loc))
H.put_in_hands(sensor)
else
qdel(sensor)
try_equip_vitals_sensor(H)

return 1

/decl/outfit/proc/try_equip_vitals_sensor(mob/living/human/H)
var/obj/item/clothing/sensor/vitals/sensor
for(var/check_slot in global.vitals_sensor_equip_slots)
if(!H.get_inventory_slot_datum(check_slot))
continue
if(!sensor) // only create the sensor if we have at least one eligible slot
sensor = new(get_turf(H))
var/obj/item/clothing/equipped = H.get_equipped_item(check_slot)
if(istype(equipped) && !(locate(/obj/item/clothing/sensor/vitals) in equipped.accessories) && equipped.can_attach_accessory(sensor))
equipped.attach_accessory(null, sensor)
break
if(isturf(sensor?.loc))
H.put_in_hands(sensor)
else
qdel(sensor)

/decl/outfit/proc/equip_base(mob/living/human/H, var/equip_adjustments)
set waitfor = FALSE
pre_equip(H)
Expand Down
5 changes: 4 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,10 @@
LAZYREMOVE(climbers,user)
return FALSE

var/target_turf = get_turf(src)
// handle multitile objects
// this should also be fine for non-multitile objects
// and ensures we don't ever move more than 1 tile
var/target_turf = get_step(user, get_dir(user, src))

//climbing over border objects like railings
if((atom_flags & ATOM_FLAG_CHECKS_BORDER) && get_turf(user) == target_turf)
Expand Down
2 changes: 2 additions & 0 deletions code/game/atoms_init.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
// Changing this behavior will almost certainly break power; update accordingly.
if (!ml && loc)
loc.Entered(src, null)
if(loc && (z_flags & ZMM_WIDE_LOAD))
SSzcopy.discover_movable(src)

/atom/movable/EarlyDestroy(force = FALSE)
loc = null // should NOT use forceMove, in order to avoid events
Expand Down
1 change: 1 addition & 0 deletions code/game/atoms_movable_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
/atom/movable/overlay/attackby(obj/item/I, mob/user)
if (master)
return master.attackby(I, user)
return TRUE

/atom/movable/overlay/attack_hand(mob/user)
SHOULD_CALL_PARENT(FALSE)
Expand Down
4 changes: 3 additions & 1 deletion code/game/machinery/CableLayer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
to_chat(user, "<span class='warning'>\The [src]'s cable reel is full.</span>")
else
to_chat(user, "You load [result] lengths of cable into [src].")
return
return TRUE

if(IS_WIRECUTTER(O))
if(cable && cable.amount)
Expand All @@ -48,6 +48,8 @@
CC.amount = m
else
to_chat(usr, "<span class='warning'>There's no more cable on the reel.</span>")
return TRUE
return ..()

/obj/machinery/cablelayer/examine(mob/user)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>You try to switch on the suppressor, yet nothing happens.</span>")
return
return TRUE

if(user != victim && !suppressing) // Skip checks if you're doing it to yourself or turning it off, this is an anti-griefing mechanic more than anything.
user.visible_message("<span class='warning'>\The [user] begins switching on \the [src]'s neural suppressor.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
add_fingerprint(user)
if(!beaker)
if(!user.try_unequip(I, src))
return
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]."))
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
if(I && check_access(I))
locked = !locked
visible_message(SPAN_NOTICE("\The [src] beeps and flashes green twice: it is now [locked ? "" : "un"]locked."))
return TRUE
return
return TRUE
return ..()

/obj/item/stock_parts/access_lock/attack_self(mob/user)
Expand Down
Loading

0 comments on commit a70904a

Please sign in to comment.