Files
VOREStation/code/game/objects/items/weapons/implants/implanter.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

168 lines
4.1 KiB
Plaintext

/obj/item/implanter
name = "implanter"
icon = 'icons/obj/items.dmi'
icon_state = "implanter0_1"
item_state = "syringe_0"
throw_speed = 1
throw_range = 5
w_class = ITEMSIZE_SMALL
matter = list(MAT_STEEL = 1000, MAT_GLASS = 1000)
var/obj/item/implant/imp = null
var/active = 1
///Var for attack_self chain
var/special_handling = FALSE
/obj/item/implanter/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(special_handling)
return FALSE
active = !active
to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src]."))
update()
/obj/item/implanter/verb/remove_implant()
set category = "Object"
set name = "Remove Implant"
set src in usr
if(!imp)
return
if(istype(usr, /mob))
var/mob/M = usr
imp.loc = get_turf(src)
if(M.get_active_hand() == null)
M.put_in_hands(imp)
to_chat(M, span_notice("You remove \the [imp] from \the [src]."))
name = "implanter"
imp = null
update()
return
/obj/item/implanter/proc/update()
if (src.imp)
src.icon_state = "implanter1"
else
src.icon_state = "implanter0"
src.icon_state += "_[active]"
return
/obj/item/implanter/attack(mob/M as mob, mob/user as mob)
if (!istype(M, /mob/living/carbon))
return
if(active)
if (imp)
M.visible_message(span_warning("[user] is attempting to implant [M]."))
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
var/turf/T1 = get_turf(M)
if (T1 && ((M == user) || do_after(user, 5 SECONDS, target = M)))
if(user && M && (get_turf(M) == T1) && src && src.imp)
M.visible_message(span_warning("[M] has been implanted by [user]."))
add_attack_logs(user,M,"Implanted with [imp.name] using [name]")
if(imp.handle_implant(M))
imp.post_implant(M)
if(ishuman(M))
var/mob/living/carbon/human/H = M
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, BACKUP_HUD) //VOREStation Add - Backup HUD updates
src.imp = null
update()
else
to_chat(user, span_warning("You need to activate \the [src.name] first."))
return
/obj/item/implanter/loyalty
name = "implanter-loyalty"
/obj/item/implanter/loyalty/Initialize(mapload)
. = ..()
imp = new /obj/item/implant/loyalty(src)
update()
/obj/item/implanter/explosive
name = "implanter (E)"
/obj/item/implanter/explosive/Initialize(mapload)
. = ..()
imp = new /obj/item/implant/explosive(src)
update()
/obj/item/implanter/adrenalin
name = "implanter-adrenalin"
/obj/item/implanter/adrenalin/Initialize(mapload)
. = ..()
imp = new /obj/item/implant/adrenalin(src)
update()
/obj/item/implanter/compressed
name = "implanter (C)"
icon_state = "cimplanter1"
/obj/item/implanter/compressed/Initialize(mapload)
. = ..()
imp = new /obj/item/implant/compressed(src)
update()
/obj/item/implanter/compressed/update()
if (imp)
var/obj/item/implant/compressed/c = imp
if(!c.scanned)
icon_state = "cimplanter1"
else
icon_state = "cimplanter2"
else
icon_state = "cimplanter0"
return
/obj/item/implanter/compressed/attack(mob/M as mob, mob/user as mob)
var/obj/item/implant/compressed/c = imp
if (!c) return
if (c.scanned == null)
to_chat(user, "Please scan an object with the implanter first.")
return
..()
/obj/item/implanter/compressed/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity)
return
if(!active)
to_chat(user, span_warning("Activate \the [src.name] first."))
return
if(istype(A,/obj/item) && imp)
var/obj/item/implant/compressed/c = imp
if (c.scanned)
to_chat(user, span_warning("Something is already scanned inside the implant!"))
return
c.scanned = A
if(istype(A, /obj/item/storage))
to_chat(user, span_warning("You can't store \the [A.name] in this!"))
c.scanned = null
return
if(ishuman(A.loc))
var/mob/living/carbon/human/H = A.loc
H.remove_from_mob(A)
else if(istype(A.loc,/obj/item/storage))
var/obj/item/storage/S = A.loc
S.remove_from_storage(A)
A.loc.contents.Remove(A)
update()
/obj/item/implanter/restrainingbolt
name = "implanter (bolt)"
/obj/item/implanter/restrainingbolt/Initialize(mapload)
. = ..()
imp = new /obj/item/implant/restrainingbolt(src)
update()