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

Merge upstream [11.07.2024] #338

Merged
merged 70 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
28b8748
Living flesh now has a 30/70% chance to touch the targeted thing inst…
SmArtKar Jul 9, 2024
9e900c5
Automatic changelog for PR #84752 [ci skip]
comfyorange Jul 9, 2024
6d85d32
Cake baking autotest (#84795)
MTandi Jul 9, 2024
69aacab
[NO GBP] Fixing fishing bait-related calculations (#84784)
Ghommie Jul 9, 2024
431ee81
Automatic changelog for PR #84784 [ci skip]
comfyorange Jul 9, 2024
efd5adf
Fixed paralyzed characters being able to walk post-amputation. (#84805)
lizardqueenlexi Jul 9, 2024
d1799dc
Fixed lights stopping emitting light in some situations (#84299)
Kocma-san Jul 9, 2024
4ab3ac0
Automatic changelog for PR #84805 [ci skip]
comfyorange Jul 9, 2024
cb5a5c1
Automatic changelog for PR #84299 [ci skip]
comfyorange Jul 9, 2024
e4015a6
Remote materials don't block multitool on failure (#84797)
SyncIt21 Jul 9, 2024
9f7d165
Makes docked shuttle departure timer reset when a hostile environment…
GoblinBackwards Jul 9, 2024
fc768e5
Automatic changelog for PR #84797 [ci skip]
comfyorange Jul 9, 2024
7d7a6da
Automatic changelog for PR #84771 [ci skip]
comfyorange Jul 9, 2024
c3562f8
Automatic changelog compile [ci skip]
actions-user Jul 10, 2024
aba588a
Buffs the Matrix Flip skillchip (#84658)
Ghommie Jul 10, 2024
a3b9c92
[no gbp] fixes sleeping mobs getting the surgery (#84732)
ShizCalev Jul 10, 2024
a39c0a8
Automatic changelog for PR #84658 [ci skip]
comfyorange Jul 10, 2024
dcca367
Random language trait tweak (#84816)
MrMelbert Jul 10, 2024
bd289b1
Automatic changelog for PR #84816 [ci skip]
comfyorange Jul 10, 2024
4166e25
Blackbox tally for successful emags (#84837)
MrMelbert Jul 10, 2024
5f2c598
refactor: move `status_display_bottom_text` and `fire_alarm_light_col…
Gaxeer Jul 10, 2024
6b74548
Automatic changelog for PR #84830 [ci skip]
comfyorange Jul 10, 2024
56aaef7
Vapes use correct fill level overlays (#84821)
SmArtKar Jul 10, 2024
910f4eb
Automatic changelog for PR #84821 [ci skip]
comfyorange Jul 10, 2024
9046e3c
You can emag grapple gun to use it on station. (#84829)
Xackii Jul 11, 2024
f55dd25
Automatic changelog for PR #84829 [ci skip]
comfyorange Jul 11, 2024
6268b8d
Fix newly created cardhands not inheriting singlecard offsets (#84838)
00-Steven Jul 11, 2024
3771f2a
Automatic changelog for PR #84838 [ci skip]
comfyorange Jul 11, 2024
b40cc6d
You no longer try to pull out someones eyes in combat mode if they ha…
SmArtKar Jul 11, 2024
f1f13c5
Automatic changelog for PR #84822 [ci skip]
comfyorange Jul 11, 2024
0b843b0
Fixed vomit category knockdown stunning (#84852)
carlarctg Jul 11, 2024
c447936
Automatic changelog for PR #84852 [ci skip]
comfyorange Jul 11, 2024
a3e65cd
Fixes meat producing copious amounts of blood (#84820)
SmArtKar Jul 11, 2024
d64c5eb
Automatic changelog for PR #84820 [ci skip]
comfyorange Jul 11, 2024
d71595f
Automatic changelog compile [ci skip]
actions-user Jul 11, 2024
b7fb912
Adds in airlock helpers for inaccessible doors (#84792)
Ical92 Jul 11, 2024
6ab5274
Makes gigabeacon easier to research (#84823)
zoomachina Jul 11, 2024
9583806
Fixes grounding rods (#84839)
GPeckman Jul 11, 2024
736d977
Automatic changelog for PR #84823 [ci skip]
comfyorange Jul 11, 2024
a327f4f
Automatic changelog for PR #84839 [ci skip]
comfyorange Jul 11, 2024
ddef344
Resprites Catwalk Tiles to match TG's floortiles (#84819)
OrionTheFox Jul 11, 2024
7fe5964
fixes wawa cryo cell (but good) (#84682)
mc-oofert Jul 11, 2024
3d4e404
Automatic changelog for PR #84819 [ci skip]
comfyorange Jul 11, 2024
a42d6e7
Automatic changelog for PR #84682 [ci skip]
comfyorange Jul 11, 2024
34d5c83
You can now see whether or not a piece of clothing is pressure-proof …
GPeckman Jul 11, 2024
e9b9b82
Fixes improvised cauterization of wounds (#84803)
GoblinBackwards Jul 11, 2024
c902051
Automatic changelog for PR #84807 [ci skip]
comfyorange Jul 11, 2024
699e58b
Automatic changelog for PR #84803 [ci skip]
comfyorange Jul 11, 2024
e693034
Adds a crash report to the imprint_gps proc and removes an unnecessar…
imedial Jul 11, 2024
fc5d641
Automatic changelog for PR #84818 [ci skip]
comfyorange Jul 11, 2024
c4c4179
TV helmet no longer has fov or makes you flash sensitive (#84815)
carlarctg Jul 11, 2024
8e42f92
Redesigns Tram's Tool Storage + Fixes disposals (#84802)
Ical92 Jul 11, 2024
6e5350a
Automatic changelog for PR #84815 [ci skip]
comfyorange Jul 11, 2024
852e027
[Birdshot] Small mapping fixes (#84808)
Jolly-66 Jul 11, 2024
4d3c9b3
Automatic changelog for PR #84802 [ci skip]
comfyorange Jul 11, 2024
d070883
Automatic changelog for PR #84808 [ci skip]
comfyorange Jul 11, 2024
43e6216
Adds a Contraband trait, and implements contraband as a mechanic to s…
ArcaneMusic Jul 11, 2024
128d4de
Automatic changelog for PR #84003 [ci skip]
comfyorange Jul 11, 2024
63b94cd
Adds six new strange object powers! (#84775)
carlarctg Jul 11, 2024
13de865
Automatic changelog for PR #84775 [ci skip]
comfyorange Jul 11, 2024
0bccade
Adds three stacks of iron sheets to Wawastation at roundstart (#84785)
r3dj4ck0424 Jul 11, 2024
3ea410f
Automatic changelog for PR #84785 [ci skip]
comfyorange Jul 11, 2024
3e4721b
Incident displays: wallening edition (#84812)
lessthnthree Jul 11, 2024
e215181
Automatic changelog for PR #84812 [ci skip]
comfyorange Jul 11, 2024
9032f8c
[NO GBP] the random spawner loot weight config is not an integer (#84…
Ghommie Jul 11, 2024
b30faed
The techweb no longer erroneously refers to MODsuits as exosuits (#84…
GPeckman Jul 11, 2024
a167298
Automatic changelog for PR #84800 [ci skip]
comfyorange Jul 11, 2024
409dbc8
Adds new hairstyle - Short Bangs 2 (#84804)
Hardly3D Jul 11, 2024
d3f6c15
Automatic changelog for PR #84804 [ci skip]
comfyorange Jul 11, 2024
2bc8837
Merge remote-tracking branch 'off/master' into merge-upstream
Gaxeer Jul 11, 2024
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
Prev Previous commit
Next Next commit
Adds a Contraband trait, and implements contraband as a mechanic to s…
…ecurity bounties. (tgstation#84003)

## About The Pull Request

This PR does a few things but centrally it's all centered around
mechanically enforcing what items are and are-not considered contraband
in-game.

### What does something being contraband MEAN?

Contraband items are visually indistinguishable from non-contraband. If
an item is Contraband, it can only be detected in two ways:
* After being scanned by an N-Spect scanner, which is a standard item
security item, assuming it still has a charge to do so.
* Via a scanner gate, which can now be upgraded with an N-spect scanner
to allow for it to scan a person and all their contents for contraband.

### What items ARE contraband?

Contraband items are intended to be determined both logically and
through other relevant examine text. However, here's the short list of
items that are considered contraband, reserving the right to expand the
list.

<details>
  <summary>In hindsight it's kind of a long list.</summary>
  
* Items that have "contraband" or "illegal" in the name or description.
* Items that allow for the player to obtain other illegal items, that
are NOT particularly stealthy.
* This means that a syndicate uplink is NOT considered contraband, as
they're typically hidden on your person as something else.
* Stealth items under the syndicate uplink, the revolutionary flash, and
some mapped in dangerous items that can come from both syndicate and
company-aligned resources are not considered dangerous.
* Items that are purchased from cargo after emagging or switching to
extended cargo range.
* Items purchased FROM syndicate uplinks, the wizard knowledge scroll,
or other antagonist shops.
* Cursed artifacts/tools magically produced by cultists or heretics.
* Items purchased from the blackmarket.
* Items purchased from the contraband section of vending machines.
* Some drugs and overtly dangerous or criminal byproducts.
  
</details>

### How does this interact with the round?
Well, primarily, this is an aid for in-game enforcement of space law.
Based on the length of the above list, we have a LONG, LONG list of
items in-game that are technically considered, in one way or another,
illegal to have on the station, and yet without either metaknowledge of
what those items are, or how they're used, security officers lack some
of the certainty of how to deal with these kinds of encounters.

Additionally to the knowledge aspect of this trait, security officers
may now receive a new civilian bounty to collect items that are
considered contraband, also giving them an incentive to look for and
confiscate contraband that's been found across the station while
upholding space law.

### Other minor changes that I rolled into this

Security has a bounty for 3 different rechargers, and considering access
limitations, most security players aren't going to make this exchange,
so I've lowered the required amount down to 1.

Adjusted the N-spect scanner's description to match it's new
functionality.

The Civilian bounty TGUI now has an additional 1 point of padding to
make it feel less cramped.



https://github.com/tgstation/tgstation/assets/41715314/c3cd4752-b03a-4e0b-959e-1252fcc2369d

**Updated as of 6/19/2024:**
Additionally, some storage items will block the presence of contraband
when going through a contraband aligned scanning gate. These items
include the infiltrator modsuit core, storage implant, void cloak, the
aptly named smuggler's satchel, and the chameleon kit's backpack.

**Updated as of 6/23/2024:**
N-spect scanner now has contextual screentips.

**Updated as of 6/29/2024:**
Scanner gates are now available in all lathes that have a feature
specific to how scanner gates function. So, includes cargo (contraband),
security (weapons), and medbay (diseases).

## Why It's Good For The Game

Originally, this started out as a way to be able to provide more
in-character and in-flavor bounties for security officers, because they
suck! Most security bounties as they exist right now do the worst
possible things from all respective bounties:
* They detract away from a job's actual responsibilities as opposed to
working with them.
* They're best completed while sitting next to your lathe and running
items back to the bounty pad.
* They exist with such esoteric rarity of high quantity of items that
it's miserable to fulfil.

As a result, I started work on this as a framework to allow security
officers to be further incentivized to collect contraband across the
station, either as a result of the gamemode or just through routine
patrols across the station.

Implementing it as a learning tool for security as well just happened to
work out as an additional bonus, and having a function in-game allowing
newer or less experienced players to know if an item is considered
dangerous or conspicuous also works as a particularly good way to
provide information where a player may not know what they're up against.

If nothing else, this might be interesting to try, and if not, I'll just
snip out the QOL changes from it and we'll see how it goes.

Going forward, I am a bit hesitant about the contraband scanner gate
mode, and as such, will try working with the admin team to determine if
that's a good feature to keep around for game health, while hoping to
give it a chance in the fullness of time.

## Changelog

:cl:
add: Items spawned via traitor uplinks or are known illegal contraband
on the station can now be scanned and identified as such by the N-spect
scanners in security. These only applies to overt traitor or antagonist
items, and "stealth" items will not be seen as such.
add: Scanner gates can now be upgraded by using an N-spect scanner on it
to unlock "contraband scanning" mode.
add: Security officers can now be offered a bounty to turn in pieces of
contraband.
add: Some stealthy storage items like storage implants, smuggler's
satchels, void cloaks, the infiltrator modsuit, and the chameleon
backpack will block the presence of contraband on your person when
placed inside.
qol: N-spect scanner contextual screentips.
balance: Recharger security bounties ask for a quantity of 1, down from
3.
qol: security, cargo, and medbay have access to scanner gate boards.
/:cl:

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
ArcaneMusic and MrMelbert authored Jul 11, 2024
commit 43e62163febea15d41c7279843ecb568935b89ed
5 changes: 5 additions & 0 deletions code/__DEFINES/antagonists.dm
Original file line number Diff line number Diff line change
@@ -314,6 +314,11 @@ GLOBAL_LIST_INIT(human_invader_antagonists, list(
#define UPLINK_SHARED_STOCK_KITS "uplink_shared_stock_kits"
#define UPLINK_SHARED_STOCK_SURPLUS "uplink_shared_stock_surplus"

/// Does this item provide illegal tech?
#define SYNDIE_ILLEGAL_TECH (1 << 0)
/// Does this item go off when scanned by a contraband scanner?
#define SYNDIE_TRIPS_CONTRABAND (1 << 1)

// Used for traitor objectives
/// If the objective hasn't been taken yet
#define OBJECTIVE_STATE_INACTIVE 1
1 change: 1 addition & 0 deletions code/__DEFINES/blackmarket.dm
Original file line number Diff line number Diff line change
@@ -9,3 +9,4 @@
#define SHIPPING_METHOD_LAUNCH "Launch"
// Sends a supply pod to the buyer's location, showy.
#define SHIPPING_METHOD_SUPPLYPOD "Supply Pod"

1 change: 1 addition & 0 deletions code/__DEFINES/devices.dm
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
#define CLOWN_INSPECTOR_PRINT_SOUND_MODE_LAST 4
#define INSPECTOR_ENERGY_USAGE_HONK (0.015 * STANDARD_CELL_CHARGE)
#define INSPECTOR_ENERGY_USAGE_NORMAL (0.005 * STANDARD_CELL_CHARGE)
#define INSPECTOR_ENERGY_USAGE_LOW (0.001 * STANDARD_CELL_CHARGE)
#define INSPECTOR_TIME_MODE_SLOW 1
#define INSPECTOR_TIME_MODE_FAST 2
#define INSPECTOR_TIME_MODE_HONK 3
7 changes: 6 additions & 1 deletion code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
@@ -767,6 +767,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_DANGEROUS_OBJECT "dangerous_object"
/// determines whether or not objects are haunted and teleport/attack randomly
#define TRAIT_HAUNTED "haunted"
/// An item that, if it has contents, will ignore it's contents when scanning for contraband.
#define TRAIT_CONTRABAND_BLOCKER "contraband_blocker"

//quirk traits
#define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance"
@@ -1160,7 +1162,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// Trait which means whatever has this is dancing by a dance machine
#define TRAIT_DISCO_DANCER "disco_dancer"

/// That which allows mobs to instantly break down boulders.
/// Trait which allows mobs to instantly break down boulders.
#define TRAIT_INSTANTLY_PROCESSES_BOULDERS "instantly_processes_boulders"

/// Trait applied to objects and mobs that can attack a boulder and break it down. (See /obj/item/boulder/manual_process())
@@ -1174,6 +1176,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// Does this item bypass ranged armor checks?
#define TRAIT_BYPASS_RANGED_ARMOR "bypass_ranged_armor"

/// Trait which means that this item is considered illegal contraband, and valid for the contraband bounty or when scanned by an nspect scanner.
#define TRAIT_CONTRABAND "illegal_contraband"

/// Traits given by settler, each with their own specific effects for cases where someone would have that trait, but not the other settler effects

#define TRAIT_EXPERT_FISHER "expert_fisher" // fishing is easier
12 changes: 12 additions & 0 deletions code/__HELPERS/atoms.dm
Original file line number Diff line number Diff line change
@@ -33,6 +33,18 @@
processing += checked_atom.contents
. += checked_atom

///Returns the src and all recursive contents, but skipping going any deeper if an atom has a specific trait.
/atom/proc/get_all_contents_skipping_traits(skipped_trait)
. = list(src)
if(!skipped_trait)
CRASH("get_all_contents_skipping_traits called without a skipped_trait")
var/i = 0
while(i < length(.))
var/atom/checked_atom = .[++i]
if(HAS_TRAIT(checked_atom, skipped_trait))
continue
. += checked_atom.contents

///Returns a list of all locations (except the area) the movable is within.
/proc/get_nested_locs(atom/movable/atom_on_location, include_turf = FALSE)
. = list()
6 changes: 4 additions & 2 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
@@ -112,6 +112,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
/obj = list(
"TRAIT_WALLMOUNTED" = TRAIT_WALLMOUNTED,
"TRAIT_CONTRABAND" = TRAIT_CONTRABAND,
),
/mob = list(
"TRAIT_ABDUCTOR_SCIENTIST_TRAINING" = TRAIT_ABDUCTOR_SCIENTIST_TRAINING,
@@ -525,9 +526,11 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
/obj/item = list(
"TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING,
"TRAIT_BAKEABLE" = TRAIT_BAKEABLE,
"TRAIT_BASIC_QUALITY_BAIT" = TRAIT_BASIC_QUALITY_BAIT,
"TRAIT_BLIND_TOOL" = TRAIT_BLIND_TOOL,
"TRAIT_BYPASS_RANGED_ARMOR" = TRAIT_BYPASS_RANGED_ARMOR,
"TRAIT_CONTRABAND_BLOCKER" = TRAIT_CONTRABAND_BLOCKER,
"TRAIT_CUSTOM_TAP_SOUND" = TRAIT_CUSTOM_TAP_SOUND,
"TRAIT_DANGEROUS_OBJECT" = TRAIT_DANGEROUS_OBJECT,
"TRAIT_FISHING_BAIT" = TRAIT_FISHING_BAIT,
@@ -537,6 +540,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_HAUNTED" = TRAIT_HAUNTED,
"TRAIT_HONKSPAMMING" = TRAIT_HONKSPAMMING,
"TRAIT_INNATELY_FANTASTICAL_ITEM" = TRAIT_INNATELY_FANTASTICAL_ITEM,
"TRAIT_INSTANTLY_PROCESSES_BOULDERS" = TRAIT_INSTANTLY_PROCESSES_BOULDERS,
"TRAIT_ITEM_OBJECTIVE_BLOCKED" = TRAIT_ITEM_OBJECTIVE_BLOCKED,
"TRAIT_NEEDS_TWO_HANDS" = TRAIT_NEEDS_TWO_HANDS,
"TRAIT_NO_BARCODES" = TRAIT_NO_BARCODES,
@@ -550,8 +554,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_TRANSFORM_ACTIVE" = TRAIT_TRANSFORM_ACTIVE,
"TRAIT_UNCATCHABLE" = TRAIT_UNCATCHABLE,
"TRAIT_WIELDED" = TRAIT_WIELDED,
"TRAIT_BAKEABLE" = TRAIT_BAKEABLE,
"TRAIT_INSTANTLY_PROCESSES_BOULDERS" = TRAIT_INSTANTLY_PROCESSES_BOULDERS,
),
/obj/item/ammo_casing = list(
"TRAIT_DART_HAS_INSERT" = TRAIT_DART_HAS_INSERT,
4 changes: 3 additions & 1 deletion code/controllers/subsystem/blackmarket.dm
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ SUBSYSTEM_DEF(blackmarket)
to_chat(buyer, span_notice("[purchase.uplink] flashes a message noting that the order is being teleported to [get_area(targetturf)] in 60 seconds."))

// do_teleport does not want to teleport items from nullspace, so it just forceMoves and does sparks.
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/controller/subsystem/blackmarket,fake_teleport), purchase, targetturf), 60 SECONDS)
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/controller/subsystem/blackmarket, fake_teleport), purchase, targetturf), 60 SECONDS)

// Get the current location of the uplink if it exists, then throws the item from space at the station from a random direction.
if(SHIPPING_METHOD_LAUNCH)
@@ -88,6 +88,7 @@ SUBSYSTEM_DEF(blackmarket)
var/pickedloc = spaceDebrisStartLoc(startSide, T.z)

var/atom/movable/item = purchase.entry.spawn_item(pickedloc, purchase)
purchase.post_purchase_effects(item)
item.throw_at(purchase.uplink, 3, 3, spin = FALSE)

to_chat(buyer, span_notice("[purchase.uplink] flashes a message noting the order is being launched at the station from [dir2text(startSide)]."))
@@ -110,6 +111,7 @@ SUBSYSTEM_DEF(blackmarket)
if(QDELETED(purchase))
return
var/atom/movable/thing = purchase.entry.spawn_item(target, purchase)
purchase.post_purchase_effects(thing)
var/datum/effect_system/spark_spread/sparks = new
sparks.set_up(5, 1, target)
sparks.attach(thing)
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
#define SCANGATE_WANTED "Wanted"
#define SCANGATE_SPECIES "Species"
#define SCANGATE_NUTRITION "Nutrition"
#define SCANGATE_CONTRABAND "Contraband"

#define SCANGATE_HUMAN "human"
#define SCANGATE_LIZARD "lizard"
@@ -29,7 +30,7 @@
var/next_beep = 0
///Bool to check if the scanner's controls are locked by an ID.
var/locked = FALSE
///Which setting is the scanner checking for? See defines in scan_gate.dm for the list.
///Which setting is the scanner checking for? See defines in scanner_gate.dm for the list.
var/scangate_mode = SCANGATE_NONE
///Is searching for a disease, what severity is enough to trigger the gate?
var/disease_threshold = DISEASE_SEVERITY_MINOR
@@ -45,6 +46,8 @@
var/light_fail = FALSE
///Does the scanner ignore light_pass and light_fail for sending signals?
var/ignore_signals = FALSE
///Is an n-spect scanner attached to the gate? Enables contraband scanning.
var/obj/item/inspector/n_spect = null


/obj/machinery/scanner_gate/Initialize(mapload)
@@ -55,18 +58,37 @@
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)
register_context()

/obj/machinery/scanner_gate/Destroy()
qdel(wires)
set_wires(null)
. = ..()

/obj/machinery/scanner_gate/atom_deconstruct(disassembled)
. = ..()
if(n_spect)
n_spect.forceMove(drop_location())
n_spect = null

/obj/machinery/scanner_gate/examine(mob/user)
. = ..()
if(locked)
. += span_notice("The control panel is ID-locked. Swipe a valid ID to unlock it.")
else
. += span_notice("The control panel is unlocked. Swipe an ID to lock it.")
if(n_spect)
. += span_notice("The scanner is equipped with an N-Spect scanner. Use a [span_boldnotice("crowbar")] to uninstall.")

/obj/machinery/scanner_gate/add_context(atom/source, list/context, obj/item/held_item, mob/user)
. = ..()
if(n_spect && held_item?.tool_behaviour == TOOL_CROWBAR)
context[SCREENTIP_CONTEXT_LMB] = "Remove N-Spect scanner"
return CONTEXTUAL_SCREENTIP_SET
if(!n_spect && istype(held_item, /obj/item/inspector))
context[SCREENTIP_CONTEXT_LMB] = "Install N-Spect scanner"
return CONTEXTUAL_SCREENTIP_SET


/obj/machinery/scanner_gate/proc/on_entered(datum/source, atom/movable/AM)
SIGNAL_HANDLER
@@ -83,6 +105,19 @@
if(duration)
scanline_timer = addtimer(CALLBACK(src, PROC_REF(set_scanline), "passive"), duration, TIMER_STOPPABLE)

/obj/machinery/scanner_gate/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(istype(tool, /obj/item/inspector))
if(n_spect)
to_chat(user, span_warning("The scanner is already equipped with an N-Spect scanner."))
return ITEM_INTERACT_BLOCKING
else
to_chat(user, span_notice("You install an N-Spect scanner on [src]."))
n_spect = tool
if(!user.transferItemToLoc(tool, src))
return ITEM_INTERACT_BLOCKING
return ITEM_INTERACT_SUCCESS
return NONE

/obj/machinery/scanner_gate/attackby(obj/item/W, mob/user, params)
var/obj/item/card/id/card = W.GetID()
if(card)
@@ -105,6 +140,20 @@
wires.interact(user)
return ..()

/obj/machinery/scanner_gate/crowbar_act(mob/living/user, obj/item/tool)
. = ..()
if(n_spect)
to_chat(user, span_notice("You uninstall [n_spect] from [src]."))
n_spect.forceMove(drop_location())
return ITEM_INTERACT_SUCCESS

/obj/machinery/scanner_gate/Exited(atom/gone)
. = ..()
if(gone == n_spect)
n_spect = null
if(scangate_mode == SCANGATE_CONTRABAND)
scangate_mode = SCANGATE_NONE

/obj/machinery/scanner_gate/emag_act(mob/user, obj/item/card/emag/emag_card)
if(obj_flags & EMAGGED)
return FALSE
@@ -175,6 +224,13 @@
beep = TRUE
if(H.nutrition >= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_FAT)
beep = TRUE
if(SCANGATE_CONTRABAND)
for(var/obj/item/content in M.get_all_contents_skipping_traits(TRAIT_CONTRABAND_BLOCKER))
if(content.is_contraband())
beep = TRUE
break
if(!n_spect.scans_correctly)
beep = !beep //We do a little trolling

if(reverse)
beep = !beep
@@ -222,6 +278,7 @@
data["disease_threshold"] = disease_threshold
data["target_species"] = detect_species
data["target_nutrition"] = detect_nutrition
data["contraband_enabled"] = !!n_spect
return data

/obj/machinery/scanner_gate/ui_act(action, params)
@@ -271,6 +328,7 @@
#undef SCANGATE_WANTED
#undef SCANGATE_SPECIES
#undef SCANGATE_NUTRITION
#undef SCANGATE_CONTRABAND

#undef SCANGATE_HUMAN
#undef SCANGATE_LIZARD
4 changes: 4 additions & 0 deletions code/game/objects/effects/posters/contraband.dm
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@
poster_type = /obj/structure/sign/poster/contraband/random
icon_state = "rolled_poster"

/obj/item/poster/random_contraband/Initialize(mapload, obj/structure/sign/poster/new_poster_structure)
. = ..()
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)

/obj/structure/sign/poster/contraband
poster_item_name = "contraband poster"
poster_item_desc = "This poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface. Its vulgar themes have marked it as contraband aboard Nanotrasen space facilities."
6 changes: 6 additions & 0 deletions code/game/objects/effects/spawners/random/contraband.dm
Original file line number Diff line number Diff line change
@@ -25,6 +25,12 @@
/obj/item/reagent_containers/pill/maintenance = 5,
)


/obj/effect/spawner/random/contraband/make_item(spawn_loc, type_path_to_make)
var/obj/item/made = ..()
ADD_TRAIT(made, TRAIT_CONTRABAND, INNATE_TRAIT)
return made

/obj/effect/spawner/random/contraband/plus
name = "contraband loot spawner plus"
desc = "Where'd ya find this?"
14 changes: 14 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
@@ -1716,6 +1716,20 @@
SEND_SIGNAL(loc, COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED, src, old_w_class, new_w_class)
return TRUE

/**
* Used to determine if an item should be considered contraband by N-spect scanners or scanner gates.
* Returns true when an item has the contraband trait, or is included in the traitor uplink.
*/
/obj/item/proc/is_contraband()
if(HAS_TRAIT(src, TRAIT_CONTRABAND))
return TRUE
for(var/datum/uplink_item/traitor_item as anything in SStraitor.uplink_items)
if(istype(src, traitor_item.item))
if(!(traitor_item.uplink_item_flags & SYNDIE_TRIPS_CONTRABAND))
return FALSE
return TRUE
return FALSE

/// Fetches embedding data
/obj/item/proc/get_embed()
RETURN_TYPE(/datum/embed_data)
9 changes: 9 additions & 0 deletions code/game/objects/items/drug_items.dm
Original file line number Diff line number Diff line change
@@ -18,6 +18,10 @@
icon_state = "saturnx_glob" //tell kryson to sprite two more variants in the future.
food_reagents = list(/datum/reagent/drug/saturnx = 10)

/obj/item/food/drug/saturnx/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)

/obj/item/food/drug/moon_rock
name = "moon rock"
desc = "A small hard lump of kronkaine freebase.\nIt is said the average kronkaine addict causes as much criminal damage as four cat burglars, two arsonists and one rabid pit bull terrier combined."
@@ -28,6 +32,7 @@
. = ..()
icon_state = pick("moon_rock1", "moon_rock2", "moon_rock3")
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOONICORN, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 5)
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)

/obj/item/reagent_containers/cup/blastoff_ampoule
name = "bLaSToFF ampoule" //stylized name
@@ -70,3 +75,7 @@
SplashReagents(hit_atom, TRUE)
qdel(src)
hit_atom.Bumped(ampoule_shard)

/obj/item/reagent_containers/cup/blastoff_ampoule/Initialize(mapload, vol)
. = ..()
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)
2 changes: 1 addition & 1 deletion code/game/objects/items/implants/implant_storage.dm
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
return TRUE
return FALSE
create_storage(storage_type = /datum/storage/implant)

ADD_TRAIT(src, TRAIT_CONTRABAND_BLOCKER, INNATE_TRAIT)
return ..()

/obj/item/implanter/storage
Loading