[MIRROR] Stops ranged stack splitting (#2785)

* Merge pull request #30695 from KorPhaeron/magicstacks

Stops ranged stack splitting

* Stops ranged stack splitting
This commit is contained in:
CitadelStationBot
2017-09-15 02:51:53 -05:00
committed by Poojawa
parent 8a2ec7d39a
commit af0080b00b
+21 -21
View File
@@ -62,20 +62,20 @@
/obj/item/stack/examine(mob/user)
..()
if (is_cyborg)
if(src.singular_name)
to_chat(user, "There is enough energy for [src.get_amount()] [src.singular_name]\s.")
if(singular_name)
to_chat(user, "There is enough energy for [get_amount()] [singular_name]\s.")
else
to_chat(user, "There is enough energy for [src.get_amount()].")
to_chat(user, "There is enough energy for [get_amount()].")
return
if(src.singular_name)
if(src.get_amount()>1)
to_chat(user, "There are [src.get_amount()] [src.singular_name]\s in the stack.")
if(singular_name)
if(get_amount()>1)
to_chat(user, "There are [get_amount()] [singular_name]\s in the stack.")
else
to_chat(user, "There is [src.get_amount()] [src.singular_name] in the stack.")
else if(src.get_amount()>1)
to_chat(user, "There are [src.get_amount()] in the stack.")
to_chat(user, "There is [get_amount()] [singular_name] in the stack.")
else if(get_amount()>1)
to_chat(user, "There are [get_amount()] in the stack.")
else
to_chat(user, "There is [src.get_amount()] in the stack.")
to_chat(user, "There is [get_amount()] in the stack.")
/obj/item/stack/proc/get_amount()
if(is_cyborg)
@@ -93,7 +93,7 @@
user << browse(null, "window=stack")
return
user.set_machine(src) //for correct work of onclose
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.get_amount())
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, get_amount())
for(var/i=1;i<=recipes.len,i++)
var/datum/stack_recipe/R = recipes[i]
if (isnull(R))
@@ -101,7 +101,7 @@
continue
if (i>1 && !isnull(recipes[i-1]))
t1+="<br>"
var/max_multiplier = round(src.get_amount() / R.req_amount)
var/max_multiplier = round(get_amount() / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
@@ -109,7 +109,7 @@
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
title+= " ([R.req_amount] [singular_name]\s)"
if (can_build)
t1 += text("<A href='?src=\ref[];make=[];multiplier=1'>[]</A> ", src, i, title)
else
@@ -134,7 +134,7 @@
if (usr.restrained() || usr.stat || usr.get_active_held_item() != src)
return
if (href_list["make"])
if (src.get_amount() < 1) qdel(src) //Never should happen
if (get_amount() < 1) qdel(src) //Never should happen
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
var/multiplier = text2num(href_list["multiplier"])
@@ -185,7 +185,7 @@
addtimer(CALLBACK(src, /atom/.proc/interact, usr), 0)
/obj/item/stack/proc/building_checks(datum/stack_recipe/R, multiplier)
if (src.get_amount() < R.req_amount*multiplier)
if (get_amount() < R.req_amount*multiplier)
if (R.req_amount*multiplier>1)
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!</span>")
else
@@ -276,9 +276,9 @@
return
//get amount from user
var/min = 0
var/max = src.get_amount()
var/max = get_amount()
var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as num)
if(stackmaterial == null || stackmaterial <= min || stackmaterial >= src.get_amount())
if(stackmaterial == null || stackmaterial <= min || stackmaterial >= get_amount() || !user.canUseTopic(src))
return
else
change_stack(user,stackmaterial)
@@ -304,10 +304,10 @@
. = ..()
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
src.blood_DNA = from.blood_DNA
src.fingerprints = from.fingerprints
src.fingerprintshidden = from.fingerprintshidden
src.fingerprintslast = from.fingerprintslast
blood_DNA = from.blood_DNA
fingerprints = from.fingerprints
fingerprintshidden = from.fingerprintshidden
fingerprintslast = from.fingerprintslast
//TODO bloody overlay
/obj/item/stack/microwave_act(obj/machinery/microwave/M)