mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 16:13:19 +01:00
Attack Chain Migration: /obj/item/card (#27556)
* the work so far * She returns on my TRUE till I ITEM_INTERACT_SUCCESS * do this too (rip good commit name) * Did you know? You can stamp ID cards!
This commit is contained in:
@@ -89,18 +89,19 @@
|
||||
|
||||
/obj/item/megaphone/cmag_act(mob/user)
|
||||
if(HAS_TRAIT(src, TRAIT_CMAGGED))
|
||||
return
|
||||
return FALSE
|
||||
if(user)
|
||||
to_chat(user, "<span class='warning'>You drip some yellow ooze into [src]'s voice synthesizer, gunking it up.</span>")
|
||||
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
ADD_TRAIT(src, TRAIT_CMAGGED, CLOWN_EMAG)
|
||||
return TRUE
|
||||
|
||||
/obj/item/megaphone/emag_act(mob/user)
|
||||
if(emagged)
|
||||
return
|
||||
return FALSE
|
||||
if(HAS_TRAIT(src, TRAIT_CMAGGED)) // one at a time
|
||||
to_chat(user, "<span class='warning'>You go to short out [src], but it's covered in yellow ooze! You don't want to gunk up your emag!</span>")
|
||||
return
|
||||
return FALSE
|
||||
to_chat(user, "<span class='danger'>You short out [src]'s dampener circuits.</span>")
|
||||
emagged = TRUE
|
||||
span = "reallybig userdanger" // really obvious, but also really loud
|
||||
|
||||
@@ -302,6 +302,7 @@ AI MODULES
|
||||
to_chat(user, "<span class='warning'>Yellow ooze seeps into [src]'s circuits...</span>")
|
||||
new /obj/item/ai_module/pranksimov(user.loc)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/******************* Quarantine ********************/
|
||||
/obj/item/ai_module/quarantine
|
||||
|
||||
@@ -50,16 +50,16 @@
|
||||
icon_state = "syndie"
|
||||
assignment = "Syndicate Overlord"
|
||||
untrackable = TRUE
|
||||
can_id_flash = FALSE //This can ID flash, this just prevents it from always flashing.
|
||||
access = list(ACCESS_SYNDICATE, ACCESS_SYNDICATE_LEADER, ACCESS_SYNDICATE_COMMAND, ACCESS_EXTERNAL_AIRLOCKS)
|
||||
|
||||
/obj/item/card/id/syndicate/afterattack__legacy__attackchain(atom/target, mob/user, proximity_flag, params)
|
||||
if(!proximity_flag)
|
||||
return
|
||||
/obj/item/card/id/syndicate/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(istype(target, /obj/item/card/id))
|
||||
var/obj/item/card/id/I = target
|
||||
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
|
||||
|
||||
/obj/item/card/id/syndicate/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
@@ -127,8 +127,8 @@
|
||||
ui = new(user, src, "AgentCard", name)
|
||||
ui.open()
|
||||
|
||||
/obj/item/card/id/syndicate/attack_self__legacy__attackchain(mob/user)
|
||||
if(!ishuman(user))
|
||||
/obj/item/card/id/syndicate/activate_self(mob/user)
|
||||
if(..() || !ishuman(user))
|
||||
return
|
||||
if(!registered_human)
|
||||
registered_human = user
|
||||
@@ -289,12 +289,11 @@
|
||||
if(isAntag(user))
|
||||
. += "<span class='notice'>Similar to an agent ID, this ID card can be used to copy accesses, but it lacks the customization and anti-tracking capabilities of an agent ID.</span>"
|
||||
|
||||
/obj/item/card/id/syndi_scan_only/afterattack__legacy__attackchain(atom/O, mob/user, proximity_flag, params)
|
||||
if(!proximity_flag)
|
||||
return
|
||||
if(istype(O, /obj/item/card/id))
|
||||
var/obj/item/card/id/I = O
|
||||
/obj/item/card/id/syndi_scan_only/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(istype(target, /obj/item/card/id))
|
||||
var/obj/item/card/id/I = target
|
||||
if(isliving(user) && user.mind)
|
||||
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
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
desc = "A card."
|
||||
icon = 'icons/obj/card.dmi'
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
new_attack_chain = TRUE
|
||||
var/associated_account_number = 0
|
||||
|
||||
var/list/files = list()
|
||||
@@ -38,14 +39,13 @@
|
||||
flags = NOBLUDGEON
|
||||
flags_2 = NO_MAT_REDEMPTION_2
|
||||
|
||||
/obj/item/card/emag/attack__legacy__attackchain()
|
||||
return
|
||||
/obj/item/card/emag/pre_attack(atom/target, mob/living/user, params)
|
||||
if(..() || ismob(target))
|
||||
return FINISH_ATTACK
|
||||
|
||||
/obj/item/card/emag/afterattack__legacy__attackchain(atom/target, mob/user, proximity)
|
||||
var/atom/A = target
|
||||
if(!proximity)
|
||||
return
|
||||
A.emag_act(user)
|
||||
/obj/item/card/emag/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(target.emag_act(user))
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/card/emag/magic_key
|
||||
name = "magic key"
|
||||
@@ -53,14 +53,15 @@
|
||||
icon_state = "magic_key"
|
||||
origin_tech = "magnets=2"
|
||||
|
||||
/obj/item/card/emag/magic_key/afterattack__legacy__attackchain(atom/target, mob/user, proximity)
|
||||
/obj/item/card/emag/magic_key/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(!isairlock(target))
|
||||
return
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
var/obj/machinery/door/D = target
|
||||
D.locked = FALSE
|
||||
update_icon()
|
||||
. = ..()
|
||||
D.update_icon()
|
||||
D.emag_act(user)
|
||||
qdel(src)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/card/cmag
|
||||
desc = "It's a card coated in a slurry of electromagnetic bananium."
|
||||
@@ -75,13 +76,13 @@
|
||||
. = ..()
|
||||
AddComponent(/datum/component/slippery, src, 16 SECONDS, 100)
|
||||
|
||||
/obj/item/card/cmag/attack__legacy__attackchain()
|
||||
return
|
||||
/obj/item/card/cmag/pre_attack(atom/target, mob/living/user, params)
|
||||
if(..() || ismob(target))
|
||||
return FINISH_ATTACK
|
||||
|
||||
/obj/item/card/cmag/afterattack__legacy__attackchain(atom/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
target.cmag_act(user)
|
||||
/obj/item/card/cmag/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(target.cmag_act(user))
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/card/id
|
||||
name = "identification card"
|
||||
@@ -117,6 +118,9 @@
|
||||
var/dat
|
||||
var/stamped = 0
|
||||
|
||||
/// Can we flash the ID?
|
||||
var/can_id_flash = TRUE
|
||||
|
||||
var/obj/item/card/id/guest/guest_pass = null // Guest pass attached to the ID
|
||||
|
||||
/obj/item/card/id/New()
|
||||
@@ -151,13 +155,11 @@
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/item/card/id/attack_self__legacy__attackchain(mob/user as mob)
|
||||
user.visible_message("[user] shows you: [bicon(src)] [name]. The assignment on the card: [assignment]",\
|
||||
"You flash your ID card: [bicon(src)] [name]. The assignment on the card: [assignment]")
|
||||
if(mining_points)
|
||||
to_chat(user, "There's <b>[mining_points] Mining Points</b> loaded onto this card. This card has earned <b>[total_mining_points] Mining Points</b> this Shift!")
|
||||
add_fingerprint(user)
|
||||
return
|
||||
/obj/item/card/id/activate_self(mob/user)
|
||||
if(..())
|
||||
return
|
||||
if(can_id_flash)
|
||||
flash_card(user)
|
||||
|
||||
/obj/item/card/id/proc/UpdateName()
|
||||
name = "[registered_name]'s ID Card ([assignment])"
|
||||
@@ -251,11 +253,9 @@
|
||||
/obj/item/card/id/proc/get_departments()
|
||||
return get_departments_from_job(rank)
|
||||
|
||||
/obj/item/card/id/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/id_decal/))
|
||||
var/obj/item/id_decal/decal = W
|
||||
/obj/item/card/id/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(istype(used, /obj/item/id_decal/))
|
||||
var/obj/item/id_decal/decal = used
|
||||
to_chat(user, "You apply [decal] to [src].")
|
||||
if(decal.override_name)
|
||||
name = decal.decal_name
|
||||
@@ -263,25 +263,28 @@
|
||||
icon_state = decal.decal_icon_state
|
||||
item_state = decal.decal_item_state
|
||||
qdel(decal)
|
||||
qdel(W)
|
||||
return
|
||||
qdel(used)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
else if(istype(W, /obj/item/barcodescanner))
|
||||
var/obj/item/barcodescanner/B = W
|
||||
else if(istype(used, /obj/item/barcodescanner))
|
||||
var/obj/item/barcodescanner/B = used
|
||||
B.scanID(src, user)
|
||||
return
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
else if(istype (W,/obj/item/stamp))
|
||||
else if(istype(used, /obj/item/stamp))
|
||||
if(!stamped)
|
||||
dat+="<img src=large_[W.icon_state].png>"
|
||||
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)
|
||||
else
|
||||
to_chat(user, "This ID has already been stamped!")
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
to_chat(user, "This ID has already been stamped!")
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
|
||||
else if(istype(W, /obj/item/card/id/guest))
|
||||
attach_guest_pass(W, user)
|
||||
|
||||
else if(istype(used, /obj/item/card/id/guest))
|
||||
attach_guest_pass(used, user)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/card/id/AltClick(mob/user)
|
||||
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
|
||||
@@ -749,9 +752,12 @@
|
||||
desc = "A card used to claim mining points and buy gear. Use it to mark it as yours."
|
||||
icon_state = "research"
|
||||
access = list(ACCESS_FREE_GOLEMS, ACCESS_ROBOTICS, ACCESS_CLOWN, ACCESS_MIME, ACCESS_XENOBIOLOGY) //access to robots/mechs
|
||||
can_id_flash = FALSE //So you do not flash it the first time you use it.
|
||||
var/registered = FALSE
|
||||
|
||||
/obj/item/card/id/golem/attack_self__legacy__attackchain(mob/user as mob)
|
||||
/obj/item/card/id/golem/activate_self(mob/user)
|
||||
if(..())
|
||||
return
|
||||
if(!registered && ishuman(user))
|
||||
registered_name = user.real_name
|
||||
SetOwnerInfo(user)
|
||||
@@ -760,9 +766,8 @@
|
||||
UpdateName()
|
||||
desc = "A card used to claim mining points and buy gear."
|
||||
registered = TRUE
|
||||
can_id_flash = TRUE
|
||||
to_chat(user, "<span class='notice'>The ID is now registered as yours.</span>")
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/card/id/data
|
||||
icon_state = "data"
|
||||
|
||||
@@ -95,6 +95,8 @@
|
||||
if(!HAS_TRAIT(src, TRAIT_CMAGGED))
|
||||
to_chat(user, "<span class='notice'>Winding back speed has been improved by the bananium ooze!</span>")
|
||||
ADD_TRAIT(src, TRAIT_CMAGGED, CLOWN_EMAG)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
#undef LAUGH_COOLDOWN
|
||||
#undef LAUGH_COOLDOWN_CMAG
|
||||
|
||||
@@ -117,10 +117,11 @@
|
||||
|
||||
/obj/item/grenade/cmag_act(mob/user)
|
||||
if(HAS_TRAIT(src, TRAIT_CMAGGED))
|
||||
return
|
||||
return FALSE
|
||||
ADD_TRAIT(src, TRAIT_CMAGGED, "cmagged grenade")
|
||||
to_chat(user, "<span class='warning'>You drip some yellow ooze into [src]. [src] suddenly doesn't want to leave you...</span>")
|
||||
AddComponent(/datum/component/boomerang, throw_range, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/item/grenade/uncmag()
|
||||
if(!HAS_TRAIT(src, TRAIT_CMAGGED))
|
||||
|
||||
Reference in New Issue
Block a user