bunch of runtimes (#19383)

* bunch of runtimes

* fix that nif ref properly

* .

* Makes this more clear it's overriding

* Update geiger.dm

* Update geiger.dm

* Implement TG attack_ui

Makes get_item_by_slot actually work. It's the TG naming for our proc get_equipped_item(slot)

* Fixes geiger and ore signals

* These

* Update inventory.dm

* Unneeded

* These

* Leave this for another PR

* Update bags.dm

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Kashargul
2026-04-11 15:31:02 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 7c1e344235
commit 087ae7f9e8
12 changed files with 68 additions and 54 deletions
@@ -27,7 +27,8 @@
else
QDEL_NULL(inserted_id)
for(var/key, value in prize_list)
QDEL_NULL_LIST(value)
var/list/item_list = value
QDEL_LIST_ASSOC_VAL(item_list)
. = ..()
/datum/data/mining_equipment
+49 -30
View File
@@ -21,18 +21,31 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list(
/mob
var/obj/item/storage/s_active = null // Even ghosts can/should be able to peek into boxes on the ground
//This proc is called whenever someone clicks an inventory ui slot.
/mob/proc/attack_ui(var/slot)
var/obj/item/W = get_active_hand()
///Returns the thing we're currently holding
/mob/proc/get_active_held_item() //Currently just a proc for when we do change to /tg/'s item handling.
return get_active_hand()
var/obj/item/E = get_equipped_item(slot)
if (istype(E))
if(istype(W))
E.attackby(W,src)
else
E.attack_hand(src)
else
equip_to_slot_if_possible(W, slot)
/**
* This proc is called whenever someone clicks an inventory ui slot.
*
* Mostly tries to put the item into the slot if possible, or call attack hand
* on the item in the slot if the users active hand is empty
*/
/mob/proc/attack_ui(slot, params)
var/obj/item/W = get_active_held_item()
if(istype(W))
if(equip_to_slot_if_possible(W, slot,0,0,0))
return TRUE
if(!W)
// Activate the item
var/obj/item/I = get_item_by_slot(slot)
if(istype(I))
var/list/modifiers = params2list(params)
I.attack_hand(src, modifiers)
return FALSE
/* Inventory manipulation */
@@ -143,12 +156,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list(
//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
//If both fail it drops it on the floor and returns 0.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(var/obj/item/W)
if(!W)
/mob/proc/put_in_hands(var/obj/item/I)
if(!I)
return 0
W.forceMove(drop_location())
W.reset_plane_and_layer()
W.dropped(src)
I.forceMove(drop_location())
I.reset_plane_and_layer()
has_unequipped(I)
return 0
// Removes an item from inventory and places it in the target atom.
@@ -161,6 +174,13 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list(
return remove_from_mob(W, src.loc)
return remove_from_mob(W, target)
/// This proc is called after an item has been removed from a mob but before it has been officially deslotted.
/mob/proc/has_unequipped(obj/item/item) //, silent = FALSE) //TODO: Add silent some other time.
SHOULD_CALL_PARENT(TRUE)
item.dropped(src) //, silent)
//update_equipment_speed_mods()
return TRUE
//Drops the item in our left hand
/mob/proc/drop_l_hand(var/atom/Target)
return 0
@@ -219,29 +239,28 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list(
///Get the item on the mob in the storage slot identified by the id passed in
/mob/proc/get_item_by_slot(slot_id)
return null
return get_equipped_item(slot_id)
/mob/proc/getBackSlot()
return SLOT_BACK
//Attemps to remove an object on a mob.
/mob/proc/remove_from_mob(var/obj/O, var/atom/target)
if(!O) // Nothing to remove, so we succeed.
/mob/proc/remove_from_mob(var/obj/item_dropping, var/atom/target)
if(!item_dropping) // Nothing to remove, so we succeed.
return 1
src.u_equip(O)
src.u_equip(item_dropping)
if (src.client)
src.client.screen -= O
O.reset_plane_and_layer()
O.screen_loc = null
if(istype(O, /obj/item))
var/obj/item/I = O
src.client.screen -= item_dropping
item_dropping.reset_plane_and_layer()
item_dropping.screen_loc = null
if(isitem(item_dropping))
if(target)
I.forceMove(target)
item_dropping.forceMove(target)
else
I.dropInto(drop_location())
I.dropped(src)
//SEND_SIGNAL(item_dropping, COMSIG_ITEM_POST_UNEQUIP, O, target)
SEND_SIGNAL(src, COMSIG_MOB_UNEQUIPPED_ITEM, O, target)
item_dropping.dropInto(drop_location())
has_unequipped(item_dropping)
//SEND_SIGNAL(item_dropping, COMSIG_ITEM_POST_UNEQUIP, item_dropping, target)
SEND_SIGNAL(src, COMSIG_MOB_UNEQUIPPED_ITEM, item_dropping, target)
return TRUE
//Returns the item equipped to the specified slot, if any.
@@ -239,6 +239,7 @@ This saves us from having to call add_fingerprint() any time something is put in
return
W.loc = src
has_unequipped(W) //TG calls attempt_insert -> transferItemToLoc -> doUnEquip -> has_unequipped. This is where we do it instead since we don't have storage datums.
switch(slot)
if(slot_back)
src.back = W
@@ -457,7 +457,7 @@
else
H.equip_to_slot_or_del(box, slot_in_backpack)
/datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs.
/datum/species/proc/create_organs(mob/living/carbon/human/H) //Handles creation of mob organs.
H.mob_size = mob_size
for(var/obj/item/organ/organ in H.contents)
@@ -794,19 +794,6 @@
for(var/u_type in unarmed_types)
unarmed_attacks += new u_type()
/datum/species/create_organs(var/mob/living/carbon/human/H)
if(H.nif)
/*var/type = H.nif.type
var/durability = H.nif.durability
var/list/nifsofts = H.nif.nifsofts
var/list/nif_savedata = H.nif.save_data.Copy()*/
..()
H.nif = null //A previous call during the rejuvenation path deleted it, so we no longer should have it here
/*var/obj/item/nif/nif = new type(H,durability,nif_savedata)
nif.nifsofts = nifsofts*/
else
..()
/datum/species/proc/apply_components(var/mob/living/carbon/human/H)
if(LAZYLEN(species_component))
for(var/component in species_component)
+1
View File
@@ -104,6 +104,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
/obj/item/nif/proc/unregister_human()
UnregisterSignal(human, COMSIG_MOB_DEATH)
human.nif = null
//Destructor cleans up references
/obj/item/nif/Destroy()
+5
View File
@@ -29,6 +29,11 @@
return COMPONENT_INCOMPATIBLE
. = ..()
/datum/component/nif_menu/Destroy(force)
if(screen_icon)
QDEL_NULL(screen_icon)
. = ..()
/datum/component/nif_menu/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_MOB_CLIENT_LOGIN, PROC_REF(create_mob_button))