Small container transfer rate change improvements (#18780)

* Avoid extraneous warning on `set_APTFT()` cancel

* Add `set_APTFT()` success feedback message

* Standardize `possible_transfer_amounts`

* Cryptic var names begone

* Unhardcode "It will transfer X units" examine note

* Fix grammar
This commit is contained in:
Nathan Winters
2022-09-01 13:31:18 +01:00
committed by GitHub
parent 7e3dda4556
commit 417ad89267
10 changed files with 24 additions and 17 deletions
@@ -16,7 +16,7 @@
icon = 'icons/obj/toy.dmi'
icon_state = "rag"
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(5)
possible_transfer_amounts = null
volume = 5
flags = NOBLUDGEON
container_type = OPENCONTAINER
@@ -9,6 +9,7 @@
container_type = OPENCONTAINER
consume_sound = 'sound/items/drink.ogg'
possible_transfer_amounts = list(5,10,15,20,25,30,50)
visible_transfer_rate = TRUE
volume = 50
resistance_flags = NONE
antable = FALSE
@@ -125,7 +126,7 @@
throwforce = 1
amount_per_transfer_from_this = 5
materials = list(MAT_METAL=100)
possible_transfer_amounts = list()
possible_transfer_amounts = null
volume = 5
flags = CONDUCT
container_type = OPENCONTAINER
@@ -249,7 +250,7 @@
desc = "A paper water cup."
icon_state = "water_cup_e"
item_state = "coffee"
possible_transfer_amounts = list()
possible_transfer_amounts = null
volume = 10
/obj/item/reagent_containers/food/drinks/sillycup/on_reagent_change()
+1
View File
@@ -3,6 +3,7 @@
////////////////////////////////////////////////////////////////////////////////
/obj/item/reagent_containers/food
possible_transfer_amounts = null
visible_transfer_rate = FALSE
volume = 50 //Sets the default container amount for all food items.
var/filling_color = "#FFFFFF" //Used by sandwiches.
var/junkiness = 0 //for junk food. used to lower human satiety.
@@ -12,6 +12,7 @@
icon_state = "emptycondiment"
container_type = OPENCONTAINER
possible_transfer_amounts = list(1, 5, 10, 15, 20, 25, 30, 50)
visible_transfer_rate = TRUE
volume = 50
//Possible_states has the reagent id as key and a list of, in order, the icon_state, the name and the desc as values. Used in the on_reagent_change() to change names, descs and sprites.
var/list/possible_states = list(
@@ -204,7 +205,7 @@
icon_state = "condi_empty"
volume = 10
amount_per_transfer_from_this = 10
possible_transfer_amounts = list()
possible_transfer_amounts = null
possible_states = list("ketchup" = list("condi_ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "soysauce" = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("condi_sugar", "Sugar", "Tasty spacey sugar!"))
/obj/item/reagent_containers/food/condiment/pack/attack(mob/M, mob/user, def_zone) //Can't feed these to people directly.
@@ -4,10 +4,11 @@
desc = "A hexagonal mesh of honeycomb."
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "honeycomb"
possible_transfer_amounts = list()
possible_transfer_amounts = null
disease_amount = 0
volume = 10
amount_per_transfer_from_this = 0
visible_transfer_rate = FALSE
list_reagents = list("honey" = 5)
var/honey_color = ""
+10 -6
View File
@@ -5,6 +5,7 @@
icon_state = null
w_class = WEIGHT_CLASS_TINY
var/amount_per_transfer_from_this = 5
var/visible_transfer_rate = TRUE
var/possible_transfer_amounts = list(5,10,15,25,30)
var/volume = 30
var/list/list_reagents = null
@@ -25,7 +26,9 @@
var/default = null
if(amount_per_transfer_from_this in possible_transfer_amounts)
default = amount_per_transfer_from_this
var/N = input("Amount per transfer from this:", "[src]", default) as null|anything in possible_transfer_amounts
var/new_transfer_rate = input("Amount per transfer from this:", "[src]", default) as null|anything in possible_transfer_amounts
if(!new_transfer_rate)
return
if(!usr.Adjacent(src))
to_chat(usr, "<span class='warning'>You have moved too far away!</span>")
@@ -34,8 +37,8 @@
to_chat(usr, "<span class='warning'>You can't use your hands!</span>")
return
if(N)
amount_per_transfer_from_this = N
amount_per_transfer_from_this = new_transfer_rate
to_chat(usr, "<span class='notice'>[src] will now transfer [amount_per_transfer_from_this] units at a time.</span>")
/obj/item/reagent_containers/AltClick()
set_APTFT()
@@ -100,8 +103,9 @@
/obj/item/reagent_containers/examine(mob/user)
. = ..()
// Food has no valid possible_transfer_amounts, and we don't want to show
// this message on examining food.
if(visible_transfer_rate)
. += "<span class='notice'>It will transfer [amount_per_transfer_from_this] unit[amount_per_transfer_from_this != 1 ? "s" : ""] at a time.</span>"
// Items that have no valid possible_transfer_amounts shouldn't say their transfer rate is variable
if(possible_transfer_amounts)
. += "<span class='notice'>It will transfer [amount_per_transfer_from_this] unit[amount_per_transfer_from_this > 1 ? "s" : ""] at a time.</span>"
. += "<span class='notice'>Alt-click to change the transfer amount.</span>"
@@ -6,6 +6,7 @@
item_state = "mender"
volume = 200
possible_transfer_amounts = null
visible_transfer_rate = FALSE
resistance_flags = ACID_PROOF
container_type = REFILLABLE | AMOUNT_VISIBLE
temperature_min = 270
@@ -240,7 +240,7 @@
desc = "A baggie. Can hold up to 10 units."
icon_state = "baggie"
amount_per_transfer_from_this = 2
possible_transfer_amounts = 2
possible_transfer_amounts = null
volume = 10
container_type = OPENCONTAINER
can_assembly = 0
@@ -86,7 +86,7 @@
name = "combat stimulant injector"
desc = "A modified air-needle autoinjector, used by support operatives to quickly heal injuries in combat."
amount_per_transfer_from_this = 15
possible_transfer_amounts = list(15)
possible_transfer_amounts = null
icon_state = "combat_hypo"
volume = 90
ignore_flags = 1 // So they can heal their comrades.
@@ -104,7 +104,7 @@
item_state = "autoinjector"
belt_icon = "autoinjector"
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(10)
possible_transfer_amounts = null
volume = 10
ignore_flags = TRUE //so you can medipen through hardsuits
container_type = DRAWABLE
@@ -151,7 +151,6 @@
desc = "Rapidly stimulates and regenerates the body's organ system."
icon_state = "stimpen"
amount_per_transfer_from_this = 50
possible_transfer_amounts = list(50)
volume = 50
list_reagents = list("stimulants" = 50)
@@ -168,7 +167,6 @@
desc = "After a short period of time the nanites will slow the body's systems and assist with bone repair. Nanomachines son."
icon_state = "bonepen"
amount_per_transfer_from_this = 30
possible_transfer_amounts = list(30)
volume = 30
list_reagents = list("nanocalcium" = 30)
@@ -10,7 +10,7 @@
icon_state = "0"
belt_icon = "syringe"
amount_per_transfer_from_this = 5
possible_transfer_amounts = list()
possible_transfer_amounts = null
volume = 15
sharp = TRUE
var/busy = FALSE