mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-04-18 02:04:33 +01:00
## About The Pull Request Fixes #68825 Fixes #72249 Fixes #70184 Converts maintenance drones to use the basic mob framework. As drones don't use AI, this was mostly a perfunctory conversion, but I took the opportunity to clean up drone code a bit and fixed a few bugs. Noteworthy changes: - Drones now have a `can_unhack` field. This is set to FALSE on syndrones, because unhacking them doesn't make them stop being evil but does cause some weirdness. Syndrones are unused right now, but you never know. - Drones use the Dextrous component for hand-having. - Drones no longer have an internal ID card, instead being given all-access with the `simple_access` component. - Picking up drones now works the same as for other mobs, instead of pointlessly copying the code into `attack_hand`. As a consequence, it is now possible to punch drones if you want to for some reason. - Drones can now reboot/cannibalize dead drones without being in combat mode. - Cannibalizing a drone that contains a client no longer runtimes - the client is ghosted ahead of time. - Drones now have TRAIT_ADVANCEDTOOLUSER, allowing them to properly interact with machines. - Trying to screwdriver a dead drone now gives a balloon alert about why you can't do that. In addition to these changes, I cleaned up the code quite a bit, organizing things better and placing more useful comments throughout. And removing a hell of a lot of single-letter variable names. I will note that this PR does _not_ address #72129. The issue there is that sprites for drones-as-hats are entirely nonexistent, and I'm not a spriter. It shouldn't be too hard to fix if someone makes dronehat sprites, though! ## Why It's Good For The Game Kills 8 more simple animals. In addition to that, drones were clearly a bit neglected, so this fixes them up a bit and makes the code a little bit clearer. Maybe not that much clearer, but it's something. It certainly leaves them in a better place for further work if anyone wants to do that. Plus, a bunch of bugs and other jankiness are fixed now, which is nice. ## Changelog 🆑 refactor: Maintenance Drones now use the basic mob framework. This shouldn't come with any noticeable gameplay changes, but please report any bugs. fix: Drones can now interact normally with electrified doors. fix: Drones' built-in tools can no longer be placed in storage objects and/or thrown on the floor. fix: Drones can now perform right-click interactions correctly, such as deconstructing reinforced windows. fix: Drones can now reboot or cannibalize other drones without being in combat mode. /🆑
84 lines
2.1 KiB
Plaintext
84 lines
2.1 KiB
Plaintext
// Drone inventory procs
|
|
|
|
/mob/living/basic/drone/doUnEquip(obj/item/item, force, newloc, no_move, invdrop = TRUE, silent = FALSE)
|
|
if(..())
|
|
update_held_items()
|
|
if(item == head)
|
|
head = null
|
|
update_worn_head()
|
|
if(item == internal_storage)
|
|
internal_storage = null
|
|
update_inv_internal_storage()
|
|
return TRUE
|
|
return FALSE
|
|
|
|
|
|
/mob/living/basic/drone/can_equip(obj/item/item, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE, ignore_equipped = FALSE, indirect_action = FALSE)
|
|
switch(slot)
|
|
if(ITEM_SLOT_HEAD)
|
|
if(head)
|
|
return FALSE
|
|
if(!((item.slot_flags & ITEM_SLOT_HEAD) || (item.slot_flags & ITEM_SLOT_MASK)))
|
|
return FALSE
|
|
return TRUE
|
|
if(ITEM_SLOT_DEX_STORAGE)
|
|
if(internal_storage)
|
|
return FALSE
|
|
return TRUE
|
|
..()
|
|
|
|
|
|
/mob/living/basic/drone/get_item_by_slot(slot_id)
|
|
switch(slot_id)
|
|
if(ITEM_SLOT_HEAD)
|
|
return head
|
|
if(ITEM_SLOT_DEX_STORAGE)
|
|
return internal_storage
|
|
|
|
return ..()
|
|
|
|
/mob/living/basic/drone/get_slot_by_item(obj/item/looking_for)
|
|
if(internal_storage == looking_for)
|
|
return ITEM_SLOT_DEX_STORAGE
|
|
if(head == looking_for)
|
|
return ITEM_SLOT_HEAD
|
|
return ..()
|
|
|
|
/mob/living/basic/drone/equip_to_slot(obj/item/equipping, slot, initial = FALSE, redraw_mob = FALSE, indirect_action = FALSE)
|
|
if(!slot)
|
|
return
|
|
if(!istype(equipping))
|
|
return
|
|
|
|
var/index = get_held_index_of_item(equipping)
|
|
if(index)
|
|
held_items[index] = null
|
|
update_held_items()
|
|
|
|
if(equipping.pulledby)
|
|
equipping.pulledby.stop_pulling()
|
|
|
|
equipping.screen_loc = null // will get moved if inventory is visible
|
|
equipping.forceMove(src)
|
|
SET_PLANE_EXPLICIT(equipping, ABOVE_HUD_PLANE, src)
|
|
|
|
switch(slot)
|
|
if(ITEM_SLOT_HEAD)
|
|
head = equipping
|
|
update_worn_head()
|
|
if(ITEM_SLOT_DEX_STORAGE)
|
|
internal_storage = equipping
|
|
update_inv_internal_storage()
|
|
else
|
|
to_chat(src, span_danger("You are trying to equip this item to an unsupported inventory slot. Report this to a coder!"))
|
|
return
|
|
|
|
//Call back for item being equipped to drone
|
|
equipping.on_equipped(src, slot)
|
|
|
|
/mob/living/basic/drone/getBackSlot()
|
|
return ITEM_SLOT_DEX_STORAGE
|
|
|
|
/mob/living/basic/drone/getBeltSlot()
|
|
return ITEM_SLOT_DEX_STORAGE
|