mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Cable Coils can partial transfer, stripped depereciated code, changed cable coil message
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
var/list/recipes = list() // /datum/stack_recipe
|
||||
var/singular_name
|
||||
var/amount = 1
|
||||
var/to_transfer = 0
|
||||
var/max_amount //also see stack recipes initialisation, param "max_res_amount" must be equal to this max_amount
|
||||
var/merge_type = null // This path and its children should merge with this stack, defaults to src.type
|
||||
|
||||
@@ -231,6 +232,9 @@
|
||||
/obj/item/stack/proc/get_max_amount()
|
||||
return max_amount
|
||||
|
||||
/obj/item/stack/proc/get_amount_transferred()
|
||||
return to_transfer
|
||||
|
||||
/obj/item/stack/proc/split(mob/user, amt)
|
||||
var/obj/item/stack/F = new type(loc, amt)
|
||||
F.copy_evidences(src)
|
||||
@@ -257,7 +261,6 @@
|
||||
if(S.amount >= max_amount)
|
||||
return 1
|
||||
|
||||
var/to_transfer
|
||||
if(user.is_in_inactive_hand(src))
|
||||
var/desired = input("How much would you like to transfer from this stack?", "How much?", 1) as null|num
|
||||
if(!desired)
|
||||
|
||||
@@ -589,30 +589,15 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.amount >= MAXCOIL)
|
||||
to_chat(user, "The coil is too long, you cannot add any more cable to it.")
|
||||
to_chat(user, "The coil is as long as it will get.")
|
||||
return
|
||||
|
||||
if( (C.amount + src.amount <= MAXCOIL) )
|
||||
to_chat(user, "You join the cable coils together.")
|
||||
C.give(src.amount) // give it cable
|
||||
src.use(src.amount) // make sure this one cleans up right
|
||||
return
|
||||
|
||||
else
|
||||
var/amt = MAXCOIL - C.amount
|
||||
to_chat(user, "You transfer [amt] length\s of cable from one coil to the other.")
|
||||
C.give(amt)
|
||||
src.use(amt)
|
||||
to_chat(user, "You transfer [get_amount_transferred()] length\s of cable from one coil to the other.")
|
||||
return
|
||||
|
||||
//add cables to the stack
|
||||
/obj/item/stack/cable_coil/proc/give(var/extra)
|
||||
if(amount + extra > MAXCOIL)
|
||||
amount = MAXCOIL
|
||||
else
|
||||
amount += extra
|
||||
update_icon()
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Cable laying procedures
|
||||
//////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user