mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Gripper Fixes and Updates
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
if(!istype(id_card))
|
||||
return ..()
|
||||
|
||||
if(!scan && (access_change_ids in id_card.access) && user.unEquip(id_card))
|
||||
if(!scan && (access_change_ids in id_card.access) && (user.unEquip(id_card) || (id_card.loc == user && istype(user,/mob/living/silicon/robot)))) //Grippers. Again. ~Mechoid
|
||||
user.drop_item()
|
||||
id_card.forceMove(src)
|
||||
scan = id_card
|
||||
|
||||
@@ -99,5 +99,14 @@
|
||||
if(computer_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
else
|
||||
if(istype(I,/obj/item/weapon/gripper)) //Behold, Grippers and their horribleness. If ..() is called by any computers' attackby() now or in the future, this should let grippers work with them appropriately.
|
||||
var/obj/item/weapon/gripper/B = I //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
user << "\The [B] is not holding anything."
|
||||
return
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
user << "You use \the [B] to use \the [B_held] with \the [src]."
|
||||
return
|
||||
attack_hand(user)
|
||||
return
|
||||
@@ -76,10 +76,21 @@
|
||||
else if(istype(check, /obj/item/weapon/disk/nuclear))
|
||||
user << "Central Command would kill you if you [cook_type] that."
|
||||
return 0
|
||||
else if(!istype(check) && !istype(check, /obj/item/weapon/holder) && !istype(check, /obj/item/organ))
|
||||
user << "<span class='warning'>That's not edible.</span>"
|
||||
return 0
|
||||
|
||||
else if(!istype(check) && !istype(check, /obj/item/weapon/holder) && !istype(check, /obj/item/organ)) //Gripper check has to go here, else it still just cuts it off. ~Mechoid
|
||||
// Is it a borg using a gripper?
|
||||
if(istype(check, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/weapon/gripper/B = check //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
user << "\The [B] is not holding anything."
|
||||
return 0
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
user << "You use \the [B] to put \the [B_held] into \the [src]."
|
||||
return 0
|
||||
else
|
||||
user << "<span class='warning'>That's not edible.</span>"
|
||||
return 0
|
||||
|
||||
if(istype(I, /obj/item/organ))
|
||||
var/obj/item/organ/O = I
|
||||
if(O.robotic)
|
||||
@@ -91,8 +102,8 @@
|
||||
for(var/mob/living/M in cooking_obj.contents)
|
||||
M.apply_damage(rand(30,40), BURN, "chest")
|
||||
|
||||
// Not sure why a food item that passed the previous checks would fail to drop, but safety first.
|
||||
if(!user.unEquip(I))
|
||||
// Not sure why a food item that passed the previous checks would fail to drop, but safety first. (Hint: Borg grippers. That is why. ~Mechoid.)
|
||||
if(!user.unEquip(I) && !istype(user,/mob/living/silicon/robot))
|
||||
return
|
||||
|
||||
// We can actually start cooking now.
|
||||
@@ -134,7 +145,7 @@
|
||||
// Copy reagents over. trans_to_obj must be used, as trans_to fails for snacks due to is_open_container() failing.
|
||||
if(cooking_obj.reagents && cooking_obj.reagents.total_volume)
|
||||
cooking_obj.reagents.trans_to_obj(result, cooking_obj.reagents.total_volume)
|
||||
|
||||
|
||||
// Set cooked data.
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/food_item = cooking_obj
|
||||
if(istype(food_item) && islist(food_item.cooked))
|
||||
@@ -183,7 +194,7 @@
|
||||
|
||||
/obj/machinery/cooker/attack_hand(var/mob/user)
|
||||
|
||||
if(cooking_obj)
|
||||
if(cooking_obj && user.Adjacent(src)) //Fixes borgs being able to teleport food in these machines to themselves.
|
||||
user << "<span class='notice'>You grab \the [cooking_obj] from \the [src].</span>"
|
||||
user.put_in_hands(cooking_obj)
|
||||
cooking = 0
|
||||
|
||||
@@ -252,6 +252,16 @@
|
||||
if(P.contents.len > 0)
|
||||
user << "<span class='notice'>Some items are refused.</span>"
|
||||
|
||||
else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/weapon/gripper/B = O //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
user << "\The [B] is not holding anything."
|
||||
return
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
user << "You use \the [B] to put \the [B_held] into \the [src]."
|
||||
return
|
||||
|
||||
else
|
||||
user << "<span class='notice'>\The [src] smartly refuses [O].</span>"
|
||||
return 1
|
||||
|
||||
@@ -362,6 +362,17 @@
|
||||
src.updateUsrDialog()
|
||||
return 0
|
||||
|
||||
if(istype(O,/obj/item/weapon/gripper))
|
||||
var/obj/item/weapon/gripper/B = O //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
user << "\The [B] is not holding anything."
|
||||
return 0
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
user << "You use \the [B] to load \the [src] with \the [B_held]."
|
||||
|
||||
return 0
|
||||
|
||||
if(!sheet_reagents[O.type] && (!O.reagents || !O.reagents.total_volume))
|
||||
user << "\The [O] is not suitable for blending."
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user