Fix negotiaton between attack chains causing issues with borgs (#27571)

* Attack chain: borg interactions and janicart migration

* redundant check
This commit is contained in:
warriorstar-orion
2024-12-07 16:43:33 -05:00
committed by GitHub
parent ae7f74a5b6
commit 9941066689
4 changed files with 117 additions and 74 deletions
+20 -20
View File
@@ -90,36 +90,36 @@
if(buffer_installed)
. += "It has been upgraded with a floor buffer."
/obj/vehicle/janicart/attack_by(obj/item/attacking, mob/user, params)
if(..())
return FINISH_ATTACK
/obj/vehicle/janicart/item_interaction(mob/living/user, obj/item/used, list/modifiers)
var/fail_msg = "<span class='notice'>There is already one of those in [src].</span>"
if(istype(attacking, /obj/item/storage/bag/trash))
if(istype(used, /obj/item/storage/bag/trash))
if(mybag)
to_chat(user, fail_msg)
return FINISH_ATTACK
return ITEM_INTERACT_BLOCKING
if(!user.drop_item())
return FINISH_ATTACK
to_chat(user, "<span class='notice'>You hook [attacking] onto [src].</span>")
attacking.forceMove(src)
mybag = attacking
return ITEM_INTERACT_BLOCKING
to_chat(user, "<span class='notice'>You hook [used] onto [src].</span>")
used.forceMove(src)
mybag = used
update_icon(UPDATE_OVERLAYS)
return FINISH_ATTACK
if(istype(attacking, /obj/item/borg/upgrade/floorbuffer))
return ITEM_INTERACT_SUCCESS
if(istype(used, /obj/item/borg/upgrade/floorbuffer))
if(buffer_installed)
to_chat(user, fail_msg)
return FINISH_ATTACK
return ITEM_INTERACT_BLOCKING
buffer_installed = TRUE
qdel(attacking)
to_chat(user,"<span class='notice'>You upgrade [src] with [attacking].</span>")
qdel(used)
to_chat(user,"<span class='notice'>You upgrade [src] with [used].</span>")
update_icon(UPDATE_OVERLAYS)
return FINISH_ATTACK
if(mybag && user.a_intent == INTENT_HELP && !is_key(attacking))
mybag.attackby__legacy__attackchain(attacking, user)
else
return FINISH_ATTACK
return ITEM_INTERACT_SUCCESS
if(mybag && user.a_intent == INTENT_HELP && !is_key(used))
mybag.attackby__legacy__attackchain(used, user)
return ITEM_INTERACT_ANY_BLOCKER
return ..()
/obj/vehicle/janicart/install_vtec(obj/item/borg/upgrade/vtec/vtec, mob/user)
if(..() && floorbuffer)
+10 -12
View File
@@ -68,22 +68,20 @@
return TRUE
/obj/vehicle/attack_by(obj/item/attacking, mob/user, params)
if(..())
return FINISH_ATTACK
if(key_type && !is_key(inserted_key) && is_key(attacking))
/obj/vehicle/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(key_type && !is_key(inserted_key) && is_key(used))
if(user.drop_item())
attacking.forceMove(src)
to_chat(user, "<span class='notice'>You insert [attacking] into [src].</span>")
used.forceMove(src)
to_chat(user, "<span class='notice'>You insert [used] into [src].</span>")
if(inserted_key) //just in case there's an invalid key
inserted_key.forceMove(drop_location())
inserted_key = attacking
inserted_key = used
else
to_chat(user, "<span class='warning'>[attacking] seems to be stuck to your hand!</span>")
return FINISH_ATTACK
if(istype(attacking, /obj/item/borg/upgrade/vtec) && install_vtec(attacking, user))
return FINISH_ATTACK
to_chat(user, "<span class='warning'>[used] seems to be stuck to your hand!</span>")
return ITEM_INTERACT_ANY_BLOCKER
if(istype(used, /obj/item/borg/upgrade/vtec) && install_vtec(used, user))
return ITEM_INTERACT_ANY_BLOCKER
/obj/vehicle/AltClick(mob/user)
if(inserted_key && user.Adjacent(user))