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
This commit is contained in:
Cameron Lennox
2025-12-29 13:21:10 -05:00
committed by GitHub
parent b770d9fa54
commit d5849910e5
350 changed files with 2603 additions and 969 deletions
+3
View File
@@ -173,6 +173,9 @@
// This dumps all the bullets right on the floor
/obj/item/ammo_magazine/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(can_remove_ammo)
if(!stored_ammo.len)
to_chat(user, span_notice("[src] is already empty!"))
+8 -1
View File
@@ -97,7 +97,6 @@
var/recoil_mode = 0 //If the gun will hurt micros if shot or not. Disabled on Virgo, used downstream.
var/mounted_gun = 0 //If the gun is mounted within a rigsuit or elsewhere. This makes it so the gun can be shot even if it's loc != a mob
//VOREStation Add - /tg/ icon system
var/charge_sections = 4
var/shaded_charge = FALSE
var/ammo_x_offset = 2
@@ -109,6 +108,9 @@
var/flight_x_offset = 0
var/flight_y_offset = 0
///Var for attack_self chain
var/special_handling = FALSE
/obj/item/gun/item_ctrl_click(mob/user)
if(can_flashlight && ishuman(user) && loc == user && !user.incapacitated(INCAPACITATION_ALL))
toggle_flashlight()
@@ -785,6 +787,11 @@
return new_mode
/obj/item/gun/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(special_handling)
return FALSE
switch_firemodes(user)
/* TGMC Ammo HUD Port Begin */
@@ -200,10 +200,13 @@
to_chat(M, span_vnotice("You materialize around [living_user] as they end up in your [belly_dest]!"))
/obj/item/bluespace_harpoon/attack_self(mob/living/user as mob)
return chande_fire_mode(user)
/obj/item/bluespace_harpoon/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
return change_fire_mode(user)
/obj/item/bluespace_harpoon/verb/chande_fire_mode(mob/user as mob)
/obj/item/bluespace_harpoon/verb/change_fire_mode(mob/user)
set name = "Change Fire Mode"
set category = "Object"
set src in range(0)
@@ -26,6 +26,9 @@
var/max_charge = 0
charge_sections = 5
special_handling = TRUE
special_weapon_handling = TRUE
/obj/item/gun/projectile/cell_loaded/consume_next_projectile()
if(chambered && ammo_magazine)
var/obj/item/ammo_casing/microbattery/batt = chambered
@@ -69,6 +72,9 @@
M?.hud_used.update_ammo_hud(M, src)
/obj/item/gun/projectile/cell_loaded/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(!chambered)
return
@@ -174,6 +174,9 @@
attack_verb = list("nibbled", "bit", "gnawed", "chomped", "nommed")
var/emagged = 0
/obj/item/melee/robotic/jaws/small/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
var/mob/living/silicon/robot/R = user
if(R.emagged || R.emag_items)
emagged = !emagged
@@ -301,6 +304,9 @@
var/lcolor = "#38e541"
/obj/item/melee/robotic/blade/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(active) //turning off
playsound(src, 'sound/weapons/saberoff.ogg', 50, 1)
force = 0
@@ -440,6 +446,9 @@
return
/obj/item/melee/robotic/baton/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
status = !status
to_chat(user, span_notice("[src] is now [status ? "on" : "off"]."))
playsound(src, "sparks", 75, 1, -1)
@@ -95,7 +95,10 @@
attack_verb = null
/obj/item/cell/device/weapon/gunsword/attack_self(mob/living/user as mob)
/obj/item/cell/device/weapon/gunsword/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
if (active)
if ((CLUMSY in user.mutations) && prob(50))
user.visible_message(span_danger("\The [user] accidentally cuts [user.p_themselves()] with \the [src]."),\
@@ -733,6 +733,9 @@
desc = "Causes kinetic accelerator bolts to have an adjustable-colored tracer trail and explosion. Use in-hand to change color."
/obj/item/borg/upgrade/modkit/tracer/adjustable/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
bolt_color = tgui_color_picker(user,"","Choose Color",bolt_color)
#undef KA_ENVIRO_TYPE_COLD
@@ -34,8 +34,12 @@
projectile_type=/obj/item/projectile/beam/pulse
charge_cost = 120
fire_delay = 12
special_handling = TRUE
/obj/item/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob)
/obj/item/gun/energy/pulse_rifle/destroyer/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
to_chat(user, span_warning("[src.name] has three settings, and they are all DESTROY."))
/*
+13 -1
View File
@@ -46,6 +46,10 @@
release_force = 20
release_speed = 15
var/drawn = FALSE
is_bow = TRUE
///Var for attack_self chain
var/hardlight = FALSE
/obj/item/gun/launcher/crossbow/bow/update_release_force(obj/item/projectile)
return 0
@@ -78,6 +82,11 @@
return ..()
/obj/item/gun/launcher/crossbow/bow/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
if(hardlight)
return FALSE
if(drawn)
user.visible_message(span_infoplain(span_bold("[user]") + " relaxes the tension on [src]'s string."),span_infoplain("You relax the tension on [src]'s string."))
drawn = FALSE
@@ -127,7 +136,10 @@
QDEL_NULL(bolt)
update_icon()
/obj/item/gun/launcher/crossbow/bow/hardlight/attack_self(mob/living/user)
/obj/item/gun/launcher/crossbow/bow/hardlight/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(drawn)
user.visible_message(span_infoplain(span_bold("[user]") + " relaxes the tension on [src]'s string."),span_infoplain("You relax the tension on [src]'s string."))
drawn = FALSE
@@ -13,6 +13,7 @@
var/confetti_charge = 0
var/max_confetti = 20
special_handling = TRUE
/obj/item/gun/launcher/confetti_cannon/examine(mob/user)
. = ..()
@@ -42,6 +43,9 @@
to_chat(user, span_red("The [src] is already loaded!"))
/obj/item/gun/launcher/confetti_cannon/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
pump(user)
/obj/item/gun/launcher/confetti_cannon/consume_next_projectile()
@@ -67,6 +67,10 @@
var/obj/item/cell/cell = null // Used for firing superheated rods.
var/current_user // Used to check if the crossbow has changed hands since being drawn.
///Var for attack_self chain
var/is_bow = FALSE
special_handling = TRUE
/obj/item/gun/launcher/crossbow/update_release_force()
release_force = tension*release_speed
@@ -82,7 +86,12 @@
update_icon()
..()
/obj/item/gun/launcher/crossbow/attack_self(mob/living/user as mob)
/obj/item/gun/launcher/crossbow/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
if(is_bow)
return TRUE
if(tension)
if(bolt)
user.visible_message("[user] relaxes the tension on [src]'s string and removes [bolt].","You relax the tension on [src]'s string and remove [bolt].")
@@ -16,6 +16,8 @@
var/list/grenades = new/list()
var/max_grenades = 5 //holds this + one in the chamber
matter = list(MAT_STEEL = 2000)
special_handling = TRUE
var/underslung = FALSE
//revolves the magazine, allowing players to choose between multiple grenade types
/obj/item/gun/launcher/grenade/proc/pump(mob/user)
@@ -66,6 +68,11 @@
to_chat(user, span_warning("[src] is empty."))
/obj/item/gun/launcher/grenade/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(underslung)
return FALSE
pump(user)
/obj/item/gun/launcher/grenade/attackby(obj/item/I, mob/user)
@@ -98,9 +105,7 @@
w_class = ITEMSIZE_NORMAL
force = 5
max_grenades = 0
/obj/item/gun/launcher/grenade/underslung/attack_self()
return
underslung = TRUE
//load and unload directly into chambered
/obj/item/gun/launcher/grenade/underslung/load(obj/item/grenade/G, mob/user)
@@ -20,6 +20,8 @@
var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit.
// For reference, a fully pressurized oxy tank at 50% gas release firing a health
// analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+.
special_handling = TRUE
/obj/item/gun/launcher/pneumatic/Initialize(mapload)
. = ..()
item_storage = new(src)
@@ -72,7 +74,10 @@
else if(istype(W) && item_storage.can_be_inserted(W))
item_storage.handle_item_insertion(W)
/obj/item/gun/launcher/pneumatic/attack_self(mob/user as mob)
/obj/item/gun/launcher/pneumatic/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
eject_tank(user)
/obj/item/gun/launcher/pneumatic/consume_next_projectile(mob/user=null)
@@ -28,6 +28,9 @@
update_icon()
/obj/item/syringe_cartridge/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(syringe)
to_chat(user, span_notice("You remove [syringe] from [src]."))
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
@@ -81,6 +84,8 @@
var/max_darts = 1
var/obj/item/syringe_cartridge/next
special_handling = TRUE
/obj/item/gun/launcher/syringe/consume_next_projectile()
if(next)
next.prime()
@@ -92,7 +97,10 @@
darts -= next
next = null
/obj/item/gun/launcher/syringe/attack_self(mob/living/user as mob)
/obj/item/gun/launcher/syringe/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(next)
user.visible_message("[user] unlatches and carefully relaxes the bolt on [src].", span_warning("You unlatch and carefully relax the bolt on [src], unloading the spring."))
next = null
+11 -1
View File
@@ -33,6 +33,11 @@
var/random_start_ammo = FALSE //randomize amount of starting ammo
special_handling = TRUE
///Var for attack_self chain
var/special_weapon_handling = FALSE
/obj/item/gun/projectile/Initialize(mapload, var/starts_loaded = 1)
. = ..()
if(starts_loaded)
@@ -227,7 +232,12 @@
..()
load_ammo(A, user)
/obj/item/gun/projectile/attack_self(mob/user as mob)
/obj/item/gun/projectile/attack_self(mob/user, callback)
. = ..(user)
if(.)
return TRUE
if(special_weapon_handling && !callback)
return FALSE
if(firemodes.len > 1)
switch_firemodes(user)
else
@@ -289,6 +289,8 @@
list(mode_name="short bursts", burst=5, move_delay=6, burst_accuracy = list(0,-15,-15,-30,-30), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2))
)
special_weapon_handling = TRUE
/obj/item/gun/projectile/automatic/l6_saw/special_check(mob/user)
if(cover_open)
to_chat(user, span_warning("[src]'s cover is open! Close it before firing!"))
@@ -301,11 +303,14 @@
update_icon()
update_held_icon()
/obj/item/gun/projectile/automatic/l6_saw/attack_self(mob/user as mob)
/obj/item/gun/projectile/automatic/l6_saw/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(cover_open)
toggle_cover(user) //close the cover
else
return ..() //once closed, behave like normal
return ..(user, TRUE) //once closed, behave like normal
/obj/item/gun/projectile/automatic/l6_saw/attack_hand(mob/user as mob)
if(!cover_open && user.get_inactive_hand() == src)
@@ -21,8 +21,12 @@
projectile_type = /obj/item/projectile/bullet/pistol/strong
var/retracted_bolt = 0
load_method = SINGLE_CASING
special_handling = TRUE
/obj/item/gun/projectile/contender/attack_self(mob/user as mob)
/obj/item/gun/projectile/contender/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(chambered)
chambered.loc = get_turf(src)
chambered = null
@@ -69,6 +69,7 @@
var/dart_reagent_amount = 15
var/container_type = /obj/item/reagent_containers/glass/beaker
var/list/starting_chems = null
special_weapon_handling = TRUE
/obj/item/gun/projectile/dartgun/Initialize(mapload)
. = ..()
@@ -134,6 +135,9 @@
B.reagents.trans_to_obj(dart, mix_amount)
/obj/item/gun/projectile/dartgun/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
user.set_machine(src)
var/dat = span_bold("[src] mixing control:") + "<br><br>"
@@ -24,13 +24,18 @@
var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up.
var/pump_animation = "shotgun-pump" //You put the reference to the animation in question here. Frees up namming. Ex: "shotgun_old_pump" or "sniper_cycle"
special_weapon_handling = TRUE
/obj/item/gun/projectile/shotgun/pump/consume_next_projectile()
if(chambered)
return chambered.BB
return null
/obj/item/gun/projectile/shotgun/pump/attack_self(mob/living/user as mob)
if(world.time >= recentpump + 10)
/obj/item/gun/projectile/shotgun/pump/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(world.time >= recentpump + 1 SECOND)
pump(user)
recentpump = world.time
@@ -22,6 +22,7 @@
scoped_accuracy = 75
one_handed_penalty = 90
var/bolt_open = 0
special_weapon_handling = TRUE
/obj/item/gun/projectile/heavysniper/update_icon()
if(bolt_open)
@@ -29,7 +30,10 @@
else
icon_state = "heavysniper"
/obj/item/gun/projectile/heavysniper/attack_self(mob/user as mob)
/obj/item/gun/projectile/heavysniper/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
playsound(src, 'sound/weapons/flipblade.ogg', 50, 1)
bolt_open = !bolt_open
if(bolt_open)
@@ -70,6 +70,9 @@
trigger_group = src
/obj/item/sniper_rifle_part/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(part_count == 1)
to_chat(user, span_warning("You can't disassemble this further!"))
return
+5 -1
View File
@@ -228,8 +228,12 @@
projectile_type = /obj/item/projectile/bullet/foam_dart
recoil = null
handle_casings = null
special_weapon_handling = TRUE
/obj/item/gun/projectile/cyborgtoy/attack_self(var/mob/user)
/obj/item/gun/projectile/cyborgtoy/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
cleanup = !cleanup
to_chat(user, "The [src] is now on [cleanup ? "cleanup" : "battle"] mode.")