Skip to content

Commit

Permalink
attack_self refactor (#6754)
Browse files Browse the repository at this point in the history
Changes proc header
  • Loading branch information
silicons authored Sep 16, 2024
1 parent 12b1f0b commit ac3e0a7
Show file tree
Hide file tree
Showing 297 changed files with 441 additions and 430 deletions.
2 changes: 1 addition & 1 deletion code/game/click/telekinesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var/const/tk_maxrange = 15
if(slot != SLOT_ID_HANDS)
qdel(src)

/obj/item/tk_grab/attack_self(mob/user)
/obj/item/tk_grab/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/content/enigmas/unsorted/deadringer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
reveal()
watchowner = null

/obj/item/deadringer/attack_self(mob/user)
/obj/item/deadringer/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/changeling/powers/armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
encumbrance = ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS
encumbrance_on = ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS_PULSE

/obj/item/clothing/shoes/magboots/changeling/attack_self(mob/user)
/obj/item/clothing/shoes/magboots/changeling/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/cult/ritual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
O.show_message("<span class='warning'>\The [user] beats \the [L] with \the [src]!</span>", 1)
to_chat(target, "<span class='danger'>You feel searing heat inside!</span>")

/obj/item/book/tome/attack_self(mob/user)
/obj/item/book/tome/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -426,7 +426,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
w_class = WEIGHT_CLASS_SMALL
var/cultistsonly = 1

/obj/item/book/tome/imbued/attack_self(mob/user)
/obj/item/book/tome/imbued/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/soulstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

///////////////////Options for using captured souls///////////////////////////////////////

/obj/item/soulstone/attack_self(mob/user)
/obj/item/soulstone/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/talisman.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var/uses = 0
info = "<center><img src='talisman.png'></center><br/><br/>"

/obj/item/paper/talisman/attack_self(mob/user)
/obj/item/paper/talisman/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/nuclear/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/active = 0


/obj/item/pinpointer/attack_self(mob/user)
/obj/item/pinpointer/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -64,7 +64,7 @@
var/turf/location = null
var/obj/target = null

/obj/item/pinpointer/advpinpointer/attack_self(mob/user)
/obj/item/pinpointer/advpinpointer/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -189,7 +189,7 @@
var/mode = 0 //Mode 0 locates disk, mode 1 locates the shuttle
var/obj/machinery/computer/shuttle_control/multi/syndicate/home = null

/obj/item/pinpointer/nukeop/attack_self(mob/user)
/obj/item/pinpointer/nukeop/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -278,7 +278,7 @@
var/shuttle_comp_id = null
var/obj/machinery/computer/shuttle_control/our_shuttle = null

/obj/item/pinpointer/shuttle/attack_self(mob/user)
/obj/item/pinpointer/shuttle/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/catalog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
// Proc: attack_self()
// Parameters: 1 (user - the mob clicking on the catalog)
// Description: Shows an HTML window, to buy equipment and spells, if the user is the legitimate owner. Otherwise it cannot be used.
/obj/item/technomancer_catalog/attack_self(mob/user)
/obj/item/technomancer_catalog/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
. = ..()
. += "<span class = 'notice'>There are [uses] uses remaining.</span>"

/obj/item/disposable_teleporter/attack_self(mob/user)
/obj/item/disposable_teleporter/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/devices/shield_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
spark_system.start()
playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1)

/obj/item/clothing/suit/armor/shield/attack_self(mob/user)
/obj/item/clothing/suit/armor/shield/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/devices/tesla_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
return 1
return 0

/obj/item/clothing/suit/armor/tesla/attack_self(mob/user)
/obj/item/clothing/suit/armor/tesla/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
slot_flags = SLOT_BELT
attack_verb = list("beaten", "smashed", "struck", "whacked")

/obj/item/scepter/attack_self(mob/user)
/obj/item/scepter/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/spell_objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
// Proc: attack_self()
// Parameters: 1 (user - the Technomancer that invoked this proc)
// Description: Tries to call on_use_cast() if it is allowed to do so. Don't override this, override on_use_cast() instead.
/obj/item/spell/attack_self(mob/user)
/obj/item/spell/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
w_class = WEIGHT_CLASS_NORMAL
materials_base = list(MAT_STEEL = 4000, MAT_GLASS = 1000)

/obj/item/cell_charger_kit/attack_self(mob/user)
/obj/item/cell_charger_kit/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@
var/diskcolor = pick(0,1,2)
icon_state = "datadisk[diskcolor]"

/obj/item/disk/data/attack_self(mob/user)
/obj/item/disk/data/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/arcade/orion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events())
else
. += SPAN_NOTICE("There's a little switch on the bottom. It's flipped up.")

/obj/item/orion_ship/attack_self(mob/user)
/obj/item/orion_ship/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/newscaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'

/obj/item/newspaper/attack_self(mob/user)
/obj/item/newspaper/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/pipe/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Buildable meters
if(dir in GLOB.cornerdirs)
setDir(turn(dir, 45))

/obj/item/pipe/attack_self(mob/user)
/obj/item/pipe/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/supplybeacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name = "inactive supermatter supply beacon"
deploy_path = /obj/machinery/power/supply_beacon/supermatter

/obj/item/supply_beacon/attack_self(mob/user)
/obj/item/supply_beacon/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/wall_frames.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return
..()

/obj/item/frame/attack_self(mob/user)
/obj/item/frame/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/mines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
var/countdown = 10
var/minetype = /obj/effect/mine //This MUST be an /obj/effect/mine type, or it'll runtime.

/obj/item/mine/attack_self(mob/user)
/obj/item/mine/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return // You do not want to move or throw a land mine while priming it... Explosives + Sudden Movement = Bad Times
Expand Down
17 changes: 14 additions & 3 deletions code/game/objects/items-interaction.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

//* ----- Click Triggers ----- */

//* Attack Hand *//

/obj/item/on_attack_hand(datum/event_args/actor/clickchain/e_args)
Expand Down Expand Up @@ -160,7 +162,9 @@
/mob/observer/dead/CanSlideItem(obj/item/I, turf/over)
return is_spooky

//* Inhand Triggers *//
//* ------ Inhand Triggers ------ *//

//* Attack Self *//

/**
* 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 All @@ -170,14 +174,15 @@
* todo: please stop overriding this, use on_attack_self.
* todo: nuke mob/user.
* todo: rename this to like /activate_inhand, /on_activate_inhand
* todo: actor is not currently always given.
*
* @params
* * actor - the event_args that spawned this call
* * user - The person using us in hand; stop using this, this is deprecated
* * actor - the event_args that spawned this call
*
* @return TRUE to signal to overrides to stop the chain and do nothing.
*/
/obj/item/proc/attack_self(mob/user, datum/event_args/actor/actor = new /datum/event_args/actor(user))
/obj/item/proc/attack_self(mob/user, datum/event_args/actor/actor)
// todo: this should realistically be SHOULD_NOT_OVERRIDE but there's a massive number of overrides (some unnecessary), so this is for a later date
// SHOULD_NOT_OVERRIDE(TRUE) // may be re-evaluated later
SEND_SIGNAL(src, COMSIG_ITEM_ACTIVATE_INHAND, actor)
Expand Down Expand Up @@ -213,6 +218,8 @@
return TRUE
return FALSE

//* Unique Action *//

/**
* Called when a mob uses our unique aciton.
*
Expand All @@ -237,6 +244,8 @@
/obj/item/proc/on_unique_action(datum/event_args/actor/e_args)
return FALSE

//* Defensive Toggle *//

/**
* Called when a mob uses our defensive toggle action.
*
Expand All @@ -261,6 +270,8 @@
/obj/item/proc/on_defensive_toggle(datum/event_args/actor/e_args)
return FALSE

//* Defensive Trigger *//

/**
* Called when a mob uses our defensive trigger action.
*
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/antag_spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
icon_state = "oldshieldoff"
ghost_query_type = /datum/ghost_query/apprentice

/obj/item/antag_spawner/technomancer_apprentice/attack_self(mob/user)
/obj/item/antag_spawner/technomancer_apprentice/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -97,7 +97,7 @@
ghost_query_type = /datum/ghost_query/syndicate_drone
var/drone_type = null

/obj/item/antag_spawner/syndicate_drone/attack_self(mob/user)
/obj/item/antag_spawner/syndicate_drone/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/balls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'sound/items/toysqueak3.ogg'
)

/obj/item/toy/tennis/rainbow/attack_self(mob/user)
/obj/item/toy/tennis/rainbow/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/blueprints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
var/can_expand_areas_into = AREA_SPACE // Can expand station areas only into space.
var/can_rename_areas_in = AREA_STATION // Only station areas can be reanamed

/obj/item/blueprints/attack_self(mob/user)
/obj/item/blueprints/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/bodybag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

var/bag_type = /obj/structure/closet/body_bag

/obj/item/bodybag/attack_self(mob/user)
/obj/item/bodybag/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/contraband.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
worth_intrinsic = 200
w_class = WEIGHT_CLASS_HUGE

/obj/item/stolenpackage/attack_self(mob/user)
/obj/item/stolenpackage/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -179,7 +179,7 @@
worth_intrinsic = 350
w_class = WEIGHT_CLASS_HUGE

/obj/item/stolenpackageplus/attack_self(mob/user)
/obj/item/stolenpackageplus/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -245,7 +245,7 @@
w_class = WEIGHT_CLASS_HUGE
worth_intrinsic = 400

/obj/item/mechasalvage/attack_self(mob/user)
/obj/item/mechasalvage/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/PDA/PDA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ GLOBAL_LIST_EMPTY(PDAs)
return 1


/obj/item/pda/ai/attack_self(mob/user)
/obj/item/pda/ai/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down Expand Up @@ -674,7 +674,7 @@ GLOBAL_LIST_EMPTY(PDAs)
ui.set_auto_update(auto_update)

//NOTE: graphic resources are loaded on client login
/obj/item/pda/attack_self(mob/user)
/obj/item/pda/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/aicard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
to_chat(user, "<b>ERROR ERROR ERROR</b>")
return CLICKCHAIN_DO_NOT_PROPAGATE

/obj/item/aicard/attack_self(mob/user)
/obj/item/aicard/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/binoculars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//materials_base = list("metal" = 50, MAT_GLASS = 50)


/obj/item/binoculars/attack_self(mob/user)
/obj/item/binoculars/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
return
Expand Down
Loading

0 comments on commit ac3e0a7

Please sign in to comment.