Files
VOREStation/code/modules/xenobio/items/weapons_vr.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

164 lines
5.5 KiB
Plaintext

/obj/item/xenobio
name = "xenobio gun"
desc = "You shouldn't see this!"
icon = 'icons/obj/gun.dmi'
icon_state = "harpoon-2"
var/loadable_item = null
var/loaded_item = null
var/loadable_name = null
var/firable = TRUE
/obj/item/xenobio/examine(var/mob/user)
. = ..()
if(loaded_item)
.+= "A [loaded_item] is slotted into the side."
else
.+= "There appears to be an empty slot for attaching a [loadable_name]."
/obj/item/xenobio/attack_hand(mob/user as mob)
if(user.get_inactive_hand() == src && loaded_item)
user.put_in_hands(loaded_item)
user.visible_message(span_notice("[user] removes [loaded_item] from [src]."), span_notice("You remove [loaded_item] from [src]."))
loaded_item = null
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
else
return ..()
/obj/item/xenobio/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, loadable_item))
if(loaded_item)
to_chat(user, span_warning("[I] doesn't seem to fit into [src]."))
return
//var/obj/item/reagent_containers/glass/beaker/B = I
user.drop_item()
I.loc = src
loaded_item = I
user.visible_message(span_notice("[user] inserts [I] into [src]."), span_notice("You slot [I] into [src]."))
return 1
..()
/obj/item/xenobio/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(loaded_item)
user.put_in_hands(loaded_item)
user.visible_message(span_notice("[user] removes [loaded_item] from [src]."), span_notice("You remove [loaded_item] from [src]."))
loaded_item = null
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
/obj/item/xenobio/afterattack(atom/A, mob/user as mob)
if(!loaded_item)
to_chat(user,span_warning("\The [src] shot fizzles, it appears you need to load something!"))
//playsound(src, 'sound/weapons/wave.ogg', 60, 1)
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
return
if(!firable)
return
playsound(src, 'sound/weapons/wave.ogg', 60, 1)
user.visible_message(span_warning("[user] fires \the [src]!"),span_warning("You fire \the [src]!"))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(4, 1, A)
s.start()
s = new /datum/effect/effect/system/spark_spread
s.set_up(4, 1, user)
s.start()
/obj/item/xenobio/monkey_gun
name = "Bluespace Cube Rehydrator"
desc = "Based on the technology of the 'Bluespace Harpoon' this device can teleport a loaded cube to a given target and rehydrate it."
loadable_item = /obj/item/reagent_containers/food/snacks/monkeycube
loadable_name = "Monkey Cube"
origin_tech = list(TECH_BLUESPACE = 5, TECH_BIO = 6)
//projectile_type = /obj/item/projectile/beam/xenobio/monkey
/obj/item/xenobio/monkey_gun/afterattack(atom/A, mob/user as mob)
..()
if(!firable)
return
var/turf/T = get_turf(A)
if(!T || (T.check_density(ignore_mobs = TRUE)))
to_chat(user,span_warning("Your rehydrator flashes an error as it attempts to process your target."))
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
return
if(isliving(A))
to_chat(user,span_warning("The rehydrator's saftey systems prevent firing into living creatures!"))
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
return
if(loaded_item)
var/obj/item/reagent_containers/food/snacks/monkeycube/cube = loaded_item
cube.loc = A
cube.Expand()
loaded_item = null
firable = FALSE
VARSET_IN(src, firable, TRUE, 2 SECONDS)
// Instead of bringing the slime to the grinder, lets bring the grinder to the slime! This will process slimes and monkies one at a time.
/obj/item/slime_grinder
name = "portable slime processor"
desc = "An industrial grinder used to automate the process of slime core extraction. It can also recycle biomatter. This one appears miniturized"
//icon = 'icons/obj/weapons_vr.dmi'
icon_state = "chainsaw0"
var/processing = FALSE // So I heard you like processing.
var/list/to_be_processed = list()
var/monkeys_recycled = 0
description_info = "Click a monkey or slime to begin processing."
/obj/item/slime_grinder/proc/extract(var/atom/movable/AM, var/mob/living/user)
processing = TRUE
if(istype(AM, /mob/living/simple_mob/slime))
var/mob/living/simple_mob/slime/S = AM
while(S.cores)
playsound(src, 'sound/machines/juicer.ogg', 25, 1)
if(do_after(user, 15, target = src))
var/atom/new_core = new S.coretype(get_turf(AM))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new_core)
playsound(src, 'sound/effects/splat.ogg', 50, 1)
S.cores--
qdel(S)
if(istype(AM, /mob/living/carbon/human/monkey))
playsound(src, 'sound/machines/juicer.ogg', 25, 1)
if(do_after(user, 15, target = src))
var/mob/living/carbon/human/M = AM
playsound(src, 'sound/effects/splat.ogg', 50, 1)
qdel(M)
monkeys_recycled++
sleep(1 SECOND)
while(monkeys_recycled >= 4)
new /obj/item/reagent_containers/food/snacks/monkeycube(get_turf(src))
playsound(src, 'sound/effects/splat.ogg', 50, 1)
monkeys_recycled -= 4
sleep(1 SECOND)
processing = FALSE
/obj/item/slime_grinder/proc/can_insert(var/atom/movable/AM)
if(istype(AM, /mob/living/simple_mob/slime))
var/mob/living/simple_mob/slime/S = AM
if(S.stat != DEAD)
return FALSE
return TRUE
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
if(!istype(H.species, /datum/species/monkey))
return FALSE
if(H.stat != DEAD)
return FALSE
return TRUE
return FALSE
/obj/item/slime_grinder/attack(mob/M as mob, mob/living/user as mob)
if(processing)
return
if(!can_insert(M))
to_chat(user, span_warning("\The [src] cannot process \the [M] at this time."))
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1)
return
extract(M, user)
return ..()