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 19.12.2024 #1706

Merged
merged 14 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 2 additions & 6 deletions code/__DEFINES/dcs/attack_chain_signals.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// MARK: Item Interactions

// Return values for non-attack interactions.
#define ITEM_INTERACT_SUCCESS (1<<0) //! Cancel the rest of the attack chain, indicating success.
#define ITEM_INTERACT_BLOCKING (1<<1) //! Cancel the rest of the attack chain, without indicating success.
#define ITEM_INTERACT_SKIP_TO_ATTACK (1<<2) //! Skip the rest of the interaction chain, going straight to the attack phase.

/// Combination return value for any item interaction that cancels the rest of the attack chain.
#define ITEM_INTERACT_ANY_BLOCKER (ITEM_INTERACT_SUCCESS | ITEM_INTERACT_BLOCKING)
#define ITEM_INTERACT_COMPLETE 1 //! Cancel the rest of the attack chain, indicating success.
#define ITEM_INTERACT_SKIP_TO_AFTER_ATTACK 2 //! Skip pre-attack and attack/attack_by, going straight to after_attack.

/// Sent when this atom is clicked on by a mob with an item.
///
Expand Down
6 changes: 4 additions & 2 deletions code/_globalvars/lists/maint_loot_tables.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
GLOBAL_LIST_INIT(maintenance_loot_tier_0, list(
list(
// Tools
/obj/effect/spawner/random/engineering/tools,
/obj/effect/spawner/random/engineering/tools = 4,

// Materials
/obj/effect/spawner/random/engineering/materials,
/obj/effect/spawner/random/engineering/materials = 4,
// Plushies
/obj/effect/spawner/random/plushies = 1,
) = 6,

list(
Expand Down
33 changes: 20 additions & 13 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* This is the proc that handles the order of an item_attack.
*
* The order of procs called is:
* * [/atom/proc/base_item_interaction] on the target. If it returns ITEM_INTERACT_SUCCESS or ITEM_INTERACT_BLOCKING, the chain will be stopped.
* * [/atom/proc/base_item_interaction] on the target. If it returns ITEM_INTERACT_COMPLETE, the chain will be stopped.
* If it returns ITEM_INTERACT_SKIP_TO_AFTER_ATTACK, all attack chain steps except after-attack will be skipped.
* * [/obj/item/proc/pre_attack] on `src`. If this returns FINISH_ATTACK, the chain will be stopped.
* * [/atom/proc/attack_by] on the target. If it returns FINISH_ATTACK, the chain will be stopped.
* * [/obj/item/proc/after_attack]. The return value does not matter.
Expand All @@ -14,13 +15,14 @@
var/list/modifiers = params2list(params)

var/item_interact_result = target.base_item_interaction(user, src, modifiers)
if(item_interact_result & ITEM_INTERACT_SUCCESS)
return
if(item_interact_result & ITEM_INTERACT_BLOCKING)
return
switch(item_interact_result)
if(ITEM_INTERACT_COMPLETE)
return
if(ITEM_INTERACT_SKIP_TO_AFTER_ATTACK)
__after_attack_core(user, target, params, proximity_flag)
return

// Attack phase

if(pre_attack(target, user, params))
return

Expand All @@ -35,14 +37,8 @@
// At this point it means the attack was "successful", or at least
// handled, in some way. This can mean nothing happened, this can mean the
// target took damage, etc.
__after_attack_core(user, target, params, proximity_flag)

// TODO: `target` here should probably be another `!QDELETED` check.
// Preserved for backwards compatibility, may be fixed post-migration.
if(target && !QDELETED(src))
if(new_attack_chain)
after_attack(target, user, proximity_flag, params)
else
afterattack__legacy__attackchain(target, user, proximity_flag, params)

/// Called when the item is in the active hand, and clicked; alternately, there
/// is an 'activate held object' verb or you can hit pagedown.
Expand Down Expand Up @@ -137,6 +133,17 @@
if(!target.new_attack_chain)
return target.attacked_by__legacy__attackchain(src, user, /* def_zone */ null)

/obj/item/proc/__after_attack_core(mob/user, atom/target, params, proximity_flag = 1)
PRIVATE_PROC(TRUE)

// TODO: `target` here should probably be another `!QDELETED` check.
// Preserved for backwards compatibility, may be fixed post-migration.
if(target && !QDELETED(src))
if(new_attack_chain)
after_attack(target, user, proximity_flag, params)
else
afterattack__legacy__attackchain(target, user, proximity_flag, params)

/obj/item/proc/__attack_core(mob/living/target, mob/living/user)
PRIVATE_PROC(TRUE)

Expand Down
85 changes: 85 additions & 0 deletions code/game/objects/effects/spawners/random/plushie_spawners.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/obj/effect/spawner/random/plushies
name = "plushie spawner"
icon = 'icons/effects/random_spawners.dmi'
icon_state = "plushie"
loot = list(
list(
/obj/item/toy/plushie/carpplushie/ice,
/obj/item/toy/plushie/carpplushie/silent,
/obj/item/toy/plushie/carpplushie/silent,
/obj/item/toy/plushie/carpplushie/electric,
/obj/item/toy/plushie/carpplushie/gold,
/obj/item/toy/plushie/carpplushie/toxin,
/obj/item/toy/plushie/carpplushie/dragon,
/obj/item/toy/plushie/carpplushie/pink,
/obj/item/toy/plushie/carpplushie/candy,
/obj/item/toy/plushie/carpplushie/nebula,
/obj/item/toy/plushie/carpplushie/void
),

list(
/obj/item/toy/plushie/red_fox,
/obj/item/toy/plushie/black_fox,
/obj/item/toy/plushie/marble_fox,
/obj/item/toy/plushie/blue_fox,
/obj/item/toy/plushie/orange_fox,
/obj/item/toy/plushie/coffee_fox,
/obj/item/toy/plushie/pink_fox,
/obj/item/toy/plushie/purple_fox,
/obj/item/toy/plushie/crimson_fox
),

list(
/obj/item/toy/plushie/corgi,
/obj/item/toy/plushie/girly_corgi,
/obj/item/toy/plushie/robo_corgi,
/obj/item/toy/plushie/octopus,
/obj/item/toy/plushie/face_hugger,
/obj/item/toy/plushie/deer,
/obj/item/toy/plushie/snakeplushie,
/obj/item/toy/plushie/lizardplushie,
/obj/item/toy/plushie/slimeplushie,
/obj/item/toy/plushie/nukeplushie,
/obj/item/toy/plushie/shark
),

list(
/obj/item/toy/plushie/black_cat,
/obj/item/toy/plushie/grey_cat,
/obj/item/toy/plushie/white_cat,
/obj/item/toy/plushie/orange_cat,
/obj/item/toy/plushie/siamese_cat,
/obj/item/toy/plushie/tabby_cat,
/obj/item/toy/plushie/tuxedo_cat
),

list(// species plushie minus nian
/obj/item/toy/plushie/voxplushie,
/obj/item/toy/plushie/ipcplushie,
/obj/item/toy/plushie/greyplushie,
/obj/item/toy/plushie/nianplushie,
/obj/item/toy/plushie/abductor,
/obj/item/toy/plushie/abductor/agent
),

list (
/obj/item/toy/plushie/nianplushie = 3,
/obj/item/toy/plushie/nianplushie/monarch = 2,
/obj/item/toy/plushie/nianplushie/luna = 2,
/obj/item/toy/plushie/nianplushie/atlas = 2,
/obj/item/toy/plushie/nianplushie/reddish = 2,
/obj/item/toy/plushie/nianplushie/royal = 2,
/obj/item/toy/plushie/nianplushie/gothic = 2,
/obj/item/toy/plushie/nianplushie/lovers = 2,
/obj/item/toy/plushie/nianplushie/whitefly = 2,
/obj/item/toy/plushie/nianplushie/punished = 2,
/obj/item/toy/plushie/nianplushie/firewatch = 2,
/obj/item/toy/plushie/nianplushie/deadhead = 2,
/obj/item/toy/plushie/nianplushie/poison = 2,
/obj/item/toy/plushie/nianplushie/ragged = 2,
/obj/item/toy/plushie/nianplushie/snow = 2,
/obj/item/toy/plushie/nianplushie/clockwork = 2,
/obj/item/toy/plushie/nianplushie/moonfly = 2,
/obj/item/toy/plushie/nianplushie/rainbow = 1
),
)
104 changes: 103 additions & 1 deletion code/game/objects/items/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,109 @@
visible_message("<span class='danger'>Buzzzz!</span>")
cooldown = TRUE
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 3 SECONDS)


/obj/item/toy/plushie/nianplushie/monarch
name = "monarch nian plushie"
desc = "A monarch nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_monarch"
item_state = "plushie_nian_monarch"

/obj/item/toy/plushie/nianplushie/luna
name = "luna nian plushie"
desc = "A luna nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_luna"
item_state = "plushie_nian_luna"

/obj/item/toy/plushie/nianplushie/atlas
name = "atlas nian plushie"
desc = "An atlas nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_atlas"
item_state = "plushie_nian_atlas"

/obj/item/toy/plushie/nianplushie/reddish
name = "reddish nian plushie"
desc = "A reddish nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_reddish"
item_state = "plushie_nian_reddish"

/obj/item/toy/plushie/nianplushie/royal
name = "royal nian plushie"
desc = "A royal nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_royal"
item_state = "plushie_nian_royal"

/obj/item/toy/plushie/nianplushie/gothic
name = "gothic nian plushie"
desc = "A gothic nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_gothic"
item_state = "plushie_nian_gothic"

/obj/item/toy/plushie/nianplushie/lovers
name = "lovers nian plushie"
desc = "A lovers nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_lovers"
item_state = "plushie_nian_lovers"

/obj/item/toy/plushie/nianplushie/whitefly
name = "whitefly nian plushie"
desc = "A whitefly nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_whitefly"
item_state = "plushie_nian_whitefly"

/obj/item/toy/plushie/nianplushie/punished
name = "punished nian plushie"
desc = "A punnished nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_punished"
item_state = "plushie_nian_punished"

/obj/item/toy/plushie/nianplushie/firewatch
name = "firewatch nian plushie"
desc = "A firewtach nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_firewatch"
item_state = "plushie_nian_firewatch"

/obj/item/toy/plushie/nianplushie/deadhead
name = "deathshead nian plushie"
desc = "A deathshead nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_deadhead"
item_state = "plushie_nian_deadhead"

/obj/item/toy/plushie/nianplushie/poison
name = "poison nian plushie"
desc = "A poison nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_poison"
item_state = "plushie_nian_poison"

/obj/item/toy/plushie/nianplushie/ragged
name = "ragged nian plushie"
desc = "A ragged nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_ragged"
item_state = "plushie_nian_ragged"

/obj/item/toy/plushie/nianplushie/snow
name = "snow nian plushie"
desc = "A snow nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_snow"
item_state = "plushie_nian_snow"

/obj/item/toy/plushie/nianplushie/clockwork
name = "clockwork nian plushie"
desc = "A clockwork nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_clockwork"
item_state = "plushie_nian_clockwork"

/obj/item/toy/plushie/nianplushie/moonfly
name = "moonfly nian plushie"
desc = "A moonfly nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_moonfly"
item_state = "plushie_nian_moonfly"

/obj/item/toy/plushie/nianplushie/rainbow
name = "rainbow nian plushie"
desc = "A rainbow nian plushie, straight from the nebula. Pull its antenna to hear it buzz!"
icon_state = "plushie_nian_rainbow"
item_state = "plushie_nian_rainbow"

/obj/item/toy/plushie/shark
name = "shark plushie"
desc = "A plushie depicting a somewhat cartoonish shark. The tag calls it a 'hákarl', noting that it was made by an obscure furniture manufacturer in old Scandinavia."
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/agent_id.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
if(isliving(user) && user?.mind?.special_role)
to_chat(usr, "<span class='notice'>The card's microscanners activate as you pass it over [I], copying its access.</span>")
access |= I.access //Don't copy access if user isn't an antag -- to prevent metagaming
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/item/card/id/syndicate/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
if(..())
Expand Down Expand Up @@ -296,4 +296,4 @@
if(user.mind.special_role)
to_chat(user, "<span class='notice'>The card's microscanners activate as you pass it over [I], copying its access.</span>")
access |= I.access // Don't copy access if user isn't an antag -- to prevent metagaming
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE
20 changes: 10 additions & 10 deletions code/game/objects/items/weapons/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

/obj/item/card/emag/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(target.emag_act(user))
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/item/card/emag/magic_key
name = "magic key"
Expand All @@ -55,13 +55,13 @@

/obj/item/card/emag/magic_key/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!isairlock(target))
return ITEM_INTERACT_BLOCKING
return ITEM_INTERACT_COMPLETE
var/obj/machinery/door/D = target
D.locked = FALSE
D.update_icon()
D.emag_act(user)
qdel(src)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/item/card/cmag
desc = "It's a card coated in a slurry of electromagnetic bananium."
Expand All @@ -82,7 +82,7 @@

/obj/item/card/cmag/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(target.cmag_act(user))
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/item/card/id
name = "identification card"
Expand Down Expand Up @@ -264,31 +264,31 @@
item_state = decal.decal_item_state
qdel(decal)
qdel(used)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

else if(istype(used, /obj/item/barcodescanner))
var/obj/item/barcodescanner/B = used
B.scanID(src, user)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

else if(istype(used, /obj/item/stamp))
if(!stamped)
dat+="<img src=large_[used.icon_state].png>"
stamped = 1
to_chat(user, "You stamp the ID card!")
playsound(user, 'sound/items/handling/standard_stamp.ogg', 50, vary = TRUE)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE
to_chat(user, "This ID has already been stamped!")
return ITEM_INTERACT_BLOCKING
return ITEM_INTERACT_COMPLETE


else if(istype(used, /obj/item/card/id/guest))
attach_guest_pass(used, user)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

else if(istype(used, /obj/item/storage/wallet))
used.attackby__legacy__attackchain(src, user)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/item/card/id/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/curtains.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
/obj/structure/curtain/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/toy/crayon))
color = tgui_input_color(user,"Please choose a color.", "Curtain Color")
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_COMPLETE

/obj/structure/curtain/screwdriver_act(mob/user, obj/item/I)
. = TRUE
Expand Down
Loading
Loading