mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 04:37:45 +01:00
[MIRROR] Alt click reagent containers to set transfer volume (#11511)
Co-authored-by: SatinIsle <98125273+SatinIsle@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
SatinIsle
Cameron Lennox
parent
575ff91c05
commit
3bf3fa4351
@@ -5,7 +5,8 @@
|
||||
icon_state = null
|
||||
w_class = ITEMSIZE_SMALL
|
||||
var/amount_per_transfer_from_this = 5
|
||||
var/possible_transfer_amounts = list(5,10,15,25,30)
|
||||
var/max_transfer_amount = 30
|
||||
var/min_transfer_amount = 5
|
||||
var/volume = 30
|
||||
var/list/starts_with
|
||||
|
||||
@@ -13,13 +14,13 @@
|
||||
set name = "Set transfer amount"
|
||||
set category = "Object"
|
||||
set src in range(0)
|
||||
var/N = tgui_input_list(usr, "Amount per transfer from this:","[src]", possible_transfer_amounts)
|
||||
var/N = tgui_input_number(usr, "Amount per transfer from this: ([min_transfer_amount]-[max_transfer_amount])","[src]",amount_per_transfer_from_this,max_transfer_amount,min_transfer_amount)
|
||||
if(N)
|
||||
amount_per_transfer_from_this = N
|
||||
|
||||
/obj/item/reagent_containers/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!possible_transfer_amounts)
|
||||
if(!max_transfer_amount)
|
||||
src.verbs -= /obj/item/reagent_containers/verb/set_APTFT
|
||||
create_reagents(volume)
|
||||
|
||||
@@ -171,3 +172,13 @@
|
||||
if(B)
|
||||
balloon_alert(user, "\The [W] burns the blood in \the [src].")
|
||||
B.changling_blood_test(reagents)
|
||||
|
||||
/obj/item/reagent_containers/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
if(!max_transfer_amount)
|
||||
return
|
||||
var/N = tgui_input_number(user, "Amount per transfer from this: ([min_transfer_amount]-[max_transfer_amount])","[src]",amount_per_transfer_from_this,max_transfer_amount,min_transfer_amount)
|
||||
if(N)
|
||||
amount_per_transfer_from_this = N
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
center_of_mass_x = 15
|
||||
center_of_mass_y = 10
|
||||
volume = 50
|
||||
max_transfer_amount = 50
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bluespace_coffee/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "borghypo"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
|
||||
var/mode = 1
|
||||
var/charge_cost = 325
|
||||
@@ -134,7 +134,7 @@
|
||||
charge_cost = 20
|
||||
recharge_time = 3
|
||||
volume = 60
|
||||
possible_transfer_amounts = list(5, 10, 20, 30)
|
||||
max_transfer_amount = 30
|
||||
reagent_ids = list(REAGENT_ID_ALE,
|
||||
REAGENT_ID_APPLEJUICE, //CHOMPADD it has literally every other type of juice..
|
||||
REAGENT_ID_BEER,
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dropper0"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1,2,3,4,5)
|
||||
max_transfer_amount = 5
|
||||
min_transfer_amount = 1
|
||||
w_class = ITEMSIZE_TINY
|
||||
slot_flags = SLOT_EARS
|
||||
volume = 5
|
||||
@@ -106,7 +107,8 @@
|
||||
name = "Industrial Dropper"
|
||||
desc = "A larger dropper. Transfers up to 10 units at a time."
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(1,2,3,4,5,6,7,8,9,10)
|
||||
max_transfer_amount = 10
|
||||
min_transfer_amount = 1
|
||||
volume = 10
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
icon_state = "null"
|
||||
item_state = "null"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60)
|
||||
max_transfer_amount = 60
|
||||
volume = 60
|
||||
w_class = ITEMSIZE_SMALL
|
||||
flags = OPENCONTAINER | NOCONDUCT
|
||||
@@ -249,7 +249,7 @@
|
||||
matter = list(MAT_GLASS = 5000)
|
||||
volume = 120
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60,120)
|
||||
max_transfer_amount = 120
|
||||
flags = OPENCONTAINER
|
||||
rating = 3
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
matter = list(MAT_GLASS = 5000)
|
||||
volume = 300
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60,120,300)
|
||||
max_transfer_amount = 300
|
||||
flags = OPENCONTAINER
|
||||
rating = 5
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
volume = 30
|
||||
w_class = ITEMSIZE_TINY
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,30)
|
||||
max_transfer_amount = 30
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/cryoxadone
|
||||
@@ -305,7 +305,7 @@
|
||||
center_of_mass_y = 13
|
||||
volume = 120
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60,120)
|
||||
max_transfer_amount = 120
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket
|
||||
@@ -319,7 +319,7 @@
|
||||
matter = list(MAT_STEEL = 200)
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,60,120)
|
||||
max_transfer_amount = 120
|
||||
volume = 120
|
||||
flags = OPENCONTAINER
|
||||
unacidable = FALSE
|
||||
@@ -378,7 +378,7 @@
|
||||
matter = list(MAT_WOOD = 50)
|
||||
w_class = ITEMSIZE_LARGE
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,60,120)
|
||||
max_transfer_amount = 120
|
||||
volume = 120
|
||||
flags = OPENCONTAINER
|
||||
unacidable = FALSE
|
||||
@@ -414,7 +414,7 @@
|
||||
matter = list(MAT_PLASTIC = 2000)
|
||||
w_class = ITEMSIZE_NO_CONTAINER
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,60,120)
|
||||
max_transfer_amount = 120
|
||||
volume = 2000
|
||||
slowdown = 2
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
amount_per_transfer_from_this = 5
|
||||
unacidable = TRUE
|
||||
volume = 30
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
drop_sound = 'sound/items/drop/gun.ogg'
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
base_state = "patch"
|
||||
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
w_class = ITEMSIZE_TINY
|
||||
slot_flags = SLOT_EARS
|
||||
volume = 60
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
var/base_state = "pill"
|
||||
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
w_class = ITEMSIZE_TINY
|
||||
slot_flags = SLOT_EARS
|
||||
volume = 60
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
throw_range = 10
|
||||
amount_per_transfer_from_this = 10
|
||||
unacidable = TRUE //plastic
|
||||
possible_transfer_amounts = list(5,10) //Set to null instead of list, if there is only one.
|
||||
max_transfer_amount = 10 //Set to null instead of list, if there is only one.
|
||||
var/spray_size = 3
|
||||
var/list/spray_sizes = list(1,3)
|
||||
volume = 250
|
||||
@@ -71,12 +71,14 @@
|
||||
D.set_up(my_target, spray_size, 10)
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/spray/attack_self(var/mob/user)
|
||||
if(!possible_transfer_amounts)
|
||||
/*
|
||||
/obj/item/reagent_containers/spray/attack_self(var/mob/user) //Now done via alt-click instead
|
||||
if(!max_transfer_amount)
|
||||
return
|
||||
amount_per_transfer_from_this = next_in_list(amount_per_transfer_from_this, possible_transfer_amounts)
|
||||
spray_size = next_in_list(spray_size, spray_sizes)
|
||||
balloon_alert(user, "pressure nozzle adjusted to [amount_per_transfer_from_this] units per spray.")
|
||||
*/
|
||||
|
||||
/obj/item/reagent_containers/spray/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -125,7 +127,7 @@
|
||||
item_state = "pepperspray"
|
||||
center_of_mass_x = 16
|
||||
center_of_mass_y = 16
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
volume = 40
|
||||
var/safety = TRUE
|
||||
|
||||
@@ -155,7 +157,7 @@
|
||||
icon_state = "sunflower"
|
||||
item_state = "sunflower"
|
||||
amount_per_transfer_from_this = 1
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
volume = 10
|
||||
drop_sound = 'sound/items/drop/herb.ogg'
|
||||
pickup_sound = 'sound/items/pickup/herb.ogg'
|
||||
@@ -175,7 +177,7 @@
|
||||
center_of_mass_y = 16
|
||||
throwforce = 3
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
volume = 600
|
||||
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3, TECH_ENGINEERING = 3)
|
||||
|
||||
@@ -221,7 +223,7 @@
|
||||
center_of_mass_x = 16
|
||||
center_of_mass_y = 10
|
||||
|
||||
possible_transfer_amounts = list(5,10,20)
|
||||
max_transfer_amount = 20
|
||||
|
||||
var/heavy_spray = FALSE
|
||||
var/spray_particles = 3
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "windowsealant"
|
||||
item_state = "spraycan"
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
volume = 80
|
||||
|
||||
/obj/item/reagent_containers/spray/windowsealant/Initialize(mapload)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
center_of_mass_y = 14
|
||||
matter = list(MAT_GLASS = 150)
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = null
|
||||
max_transfer_amount = null
|
||||
volume = 15
|
||||
w_class = ITEMSIZE_TINY
|
||||
slot_flags = SLOT_EARS
|
||||
|
||||
Reference in New Issue
Block a user