Skip to content

Commit a70904a

Browse files
Merge pull request #104 from NebulaSS13/dev
Updating from Neb dev
2 parents 36cc073 + 1b632c9 commit a70904a

File tree

505 files changed

+6495
-7376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

505 files changed

+6495
-7376
lines changed

code/__defines/colors.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
#define COLOR_VERDANT_GREEN "#287d00"
100100
#define COLOR_SCIENCE_PURPLE "#6633cc"
101101
#define COLOR_DAYLIGHT "#f3e6ca"
102+
#define COLOR_CHERRY_RED "#902630"
102103

103104
#define PIPE_COLOR_GREY "#808080"
104105
#define PIPE_COLOR_RED "#ff0000"

code/__defines/inventory_sizes.dm

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
20 - things that take up an entire turf, like wall girders or door assemblies
1717
*/
1818

19-
#define ITEM_SIZE_TINY 1
20-
#define ITEM_SIZE_SMALL 2
21-
#define ITEM_SIZE_NORMAL 3
22-
#define ITEM_SIZE_LARGE 4
23-
#define ITEM_SIZE_HUGE 5
24-
#define ITEM_SIZE_GARGANTUAN 6
25-
#define ITEM_SIZE_STRUCTURE 20
19+
#define ITEM_SIZE_TINY 1
20+
#define ITEM_SIZE_SMALL 2
21+
#define ITEM_SIZE_NORMAL 3
22+
#define ITEM_SIZE_LARGE 4
23+
#define ITEM_SIZE_HUGE 5
24+
#define ITEM_SIZE_GARGANTUAN 6
25+
#define ITEM_SIZE_STRUCTURE 20
26+
#define ITEM_SIZE_LARGE_STRUCTURE 30
2627

27-
#define ITEM_SIZE_MIN ITEM_SIZE_TINY
28-
#define ITEM_SIZE_MAX ITEM_SIZE_STRUCTURE
28+
#define ITEM_SIZE_MIN ITEM_SIZE_TINY
29+
#define ITEM_SIZE_MAX ITEM_SIZE_LARGE_STRUCTURE
2930

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

code/__defines/tools.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
#define TOOL_PROP_COLOR_NAME "color_name" //Property containing a color name for some tools. Namely the pen tool.
8888
#define TOOL_PROP_COLOR "color" //Property for specifying a color, for something like a pen.
8989
#define TOOL_PROP_USES "uses_left" //Property for things that have a fixed amount of uses. -1 is unlimited.
90+
#define TOOL_PROP_EMPTY_MESSAGE "empty_msg" //The message given on depletion when a tool runs out of charges.
9091

9192
//Pen specific stuff
9293
#define TOOL_PROP_PEN_FLAG "pen_flag" //Property for pens to specify additional properties about themselves

code/__defines/turfs.dm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
#define TURF_REMOVE_SCREWDRIVER BITFLAG(1)
33
#define TURF_REMOVE_SHOVEL BITFLAG(2)
44
#define TURF_REMOVE_WRENCH BITFLAG(3)
5-
#define TURF_CAN_BREAK BITFLAG(4)
6-
#define TURF_CAN_BURN BITFLAG(5)
7-
#define TURF_IS_FRAGILE BITFLAG(6)
8-
#define TURF_ACID_IMMUNE BITFLAG(7)
9-
#define TURF_IS_WET BITFLAG(8)
10-
#define TURF_HAS_RANDOM_BORDER BITFLAG(9)
5+
#define TURF_IS_FRAGILE BITFLAG(4)
6+
#define TURF_ACID_IMMUNE BITFLAG(5)
7+
#define TURF_IS_WET BITFLAG(6)
8+
#define TURF_HAS_RANDOM_BORDER BITFLAG(7)
119

1210
//Used for floor/wall smoothing
1311
#define SMOOTH_NONE 0 //Smooth only with itself

code/__defines/zmimic.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var/global/list/mimic_defines = list(
5252
)
5353

5454
// Movable flags.
55-
#define ZMM_IGNORE 1 //! Do not copy this movable.
56-
#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.
57-
#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.
58-
#define ZMM_LOOKBESIDE 4 //! Look one turf beside (left/right) when considering z-turfs that might be seeing this atom. Cheap, but not free.
55+
#define ZMM_IGNORE BITFLAG(0) //! Do not copy this movable.
56+
#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.
57+
#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.
58+
#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.

code/_onclick/adjacent.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Quick adjacency (to turf):
103103
return TRUE
104104
if(istype(loc, /obj/item) || istype(loc, /obj/structure))
105105
if(recurse > 0)
106-
return loc.Adjacent(neighbor,recurse - 1)
106+
return loc.Adjacent(neighbor, recurse - 1)
107107
return FALSE
108108
return ..()
109109

@@ -112,7 +112,7 @@ Quick adjacency (to turf):
112112
return TRUE
113113
if(istype(loc, /obj/item) || istype(loc, /obj/structure))
114114
if(recurse > 0)
115-
return loc.Adjacent(neighbor,recurse - 1)
115+
return loc.Adjacent(neighbor, recurse - 1)
116116
return FALSE
117117
return ..()
118118

code/_onclick/item_attack.dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ avoid code duplication. This includes items that may sometimes act as a standard
2424
var/datum/extension/tool/tool = get_extension(src, /datum/extension/tool)
2525
return (tool?.handle_physical_manipulation(user)) || FALSE
2626

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

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

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

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

110114
// TODO: revisit if this should be a silent failure/parent call instead, for mob-level storage interactions?

code/controllers/subsystems/mapping.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(mapping)
4242
/// Z-levels available to various consoles, such as the crew monitor. Defaults to station_levels if unset.
4343
var/list/map_levels
4444
/// The turf type used when generating floors between Z-levels at startup.
45-
var/base_floor_type = /turf/floor/airless
45+
var/base_floor_type = /turf/floor/plating/airless
4646
/// Replacement area, if a base_floor_type is generated. Leave blank to skip.
4747
var/base_floor_area
4848
/// A list of connected z-levels to avoid repeatedly rebuilding connections

code/controllers/subsystems/zcopy.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,10 @@ SUBSYSTEM_DEF(zcopy)
496496
ASSERT(!QDELETED(object))
497497

498498
var/turf/Tloc = object.loc
499-
if (!isturf(Tloc) || !Tloc.above)
499+
if (!isturf(Tloc) || !MOVABLE_SHALL_MIMIC(object))
500500
return TRUE
501501

502-
var/turf/T = Tloc.above
502+
var/turf/T = GetAbove(Tloc)
503503

504504
ZM_RECORD_START
505505

code/datums/ai/_ai.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
/// What directions can we wander in? Uses global.cardinal if unset.
4545
var/list/wander_directions
4646

47+
/// Should we retaliate/startle when grabbed or buckled?
48+
var/spooked_by_grab = TRUE
4749
/// Can we automatically escape from buckling?
4850
var/can_escape_buckles = FALSE
4951

@@ -314,3 +316,15 @@
314316
if(body)
315317
return body.set_target_zone(ran_zone())
316318
return FALSE
319+
320+
/datum/mob_controller/proc/on_buckled(mob/scary_grabber)
321+
if(!scary_grabber || body.buckled_mob != scary_grabber) // the buckle got cancelled somehow?
322+
return
323+
if(spooked_by_grab && !is_friend(scary_grabber))
324+
retaliate(scary_grabber)
325+
326+
/datum/mob_controller/proc/on_grabbed(mob/scary_grabber)
327+
if(!scary_grabber)
328+
return
329+
if(spooked_by_grab && !is_friend(scary_grabber))
330+
retaliate(scary_grabber)

0 commit comments

Comments
 (0)