Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into update-to-action-buttons

This commit is contained in:
SandPoot
2024-01-07 02:09:58 -03:00
45 changed files with 291 additions and 124 deletions
-15
View File
@@ -1,18 +1,3 @@
/obj/effect/temp_visual/point
name = "pointer"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "arrow"
layer = POINT_LAYER
duration = 25
/obj/effect/temp_visual/point/Initialize(mapload, set_invis = 0)
. = ..()
var/atom/old_loc = loc
loc = get_turf(src) // We don't want to actualy trigger anything when it moves
pixel_x = old_loc.pixel_x
pixel_y = old_loc.pixel_y
invisibility = set_invis
//Used by spraybottles.
/obj/effect/decal/chempuff
name = "chemicals"
+7 -3
View File
@@ -922,13 +922,13 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
/obj/item/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
. = ..()
remove_filter("hover_outline") //get rid of the hover effect in case the mouse exit isn't called if someone drags and drops an item and somthing goes wrong
remove_filter(HOVER_OUTLINE_FILTER) //get rid of the hover effect in case the mouse exit isn't called if someone drags and drops an item and somthing goes wrong
/obj/item/MouseExited(location, control, params)
SEND_SIGNAL(src, COMSIG_ITEM_MOUSE_EXIT, location, control, params)
deltimer(usr.client.tip_timer) //delete any in-progress timer if the mouse is moved off the item before it finishes
closeToolTip(usr)
remove_filter("hover_outline")
remove_filter(HOVER_OUTLINE_FILTER)
/obj/item/proc/apply_outline(outline_color = null)
if(get(src, /mob) != usr || QDELETED(src) || isobserver(usr)) //cancel if the item isn't in an inventory, is being deleted, or if the person hovering is a ghost (so that people spectating you don't randomly make your items glow)
@@ -950,12 +950,16 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
outline_color = COLOR_THEME_CLOCKWORK //if you want free gbp go fix the fact that clockwork's tooltip css is glass'
if("glass")
outline_color = COLOR_THEME_GLASS
if("trasen-knox")
outline_color = COLOR_THEME_TRASENKNOX
if("detective")
outline_color = COLOR_THEME_DETECTIVE
else //this should never happen, hopefully
outline_color = COLOR_WHITE
if(color)
outline_color = COLOR_WHITE //if the item is recolored then the outline will be too, let's make the outline white so it becomes the same color instead of some ugly mix of the theme and the tint
add_filter("hover_outline", 1, list("type" = "outline", "size" = 1, "color" = outline_color))
add_filter(HOVER_OUTLINE_FILTER, 1, list("type" = "outline", "size" = 1, "color" = outline_color))
// Called when a mob tries to use the item as a tool.
// Handles most checks.
@@ -217,6 +217,7 @@
/obj/item/stack/medical/gauze/cyborg
custom_materials = null
is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250
/obj/item/stack/medical/suture
@@ -441,6 +442,7 @@
/obj/item/stack/medical/bone_gel/cyborg
custom_materials = null
is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250
/obj/item/stack/medical/aloe
+3 -6
View File
@@ -39,7 +39,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/update_icon_state()
var/amount = get_amount()
if(amount <= 5)
if(amount <= 5 && amount >= 1)
icon_state = "rods-[amount]"
else
icon_state = "rods"
@@ -77,11 +77,8 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/cyborg
custom_materials = null
is_cyborg = TRUE
cost = 250
/obj/item/stack/rods/cyborg/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
source = /datum/robot_energy_storage/medical
cost = MINERAL_MATERIAL_AMOUNT * 0.125
/obj/item/stack/rods/ten
amount = 10
+13 -4
View File
@@ -52,7 +52,8 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
/obj/item/stack/sheet/glass/cyborg
custom_materials = null
is_cyborg = TRUE
cost = 500
source = /datum/robot_energy_storage/glass
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/glass/fifty
amount = 50
@@ -179,9 +180,15 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg
custom_materials = null
is_cyborg = TRUE
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500
source = /datum/robot_energy_storage/metal
var/datum/robot_energy_storage/glasource = /datum/robot_energy_storage/glass
var/metcost = MINERAL_MATERIAL_AMOUNT * 0.125
var/glacost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/rglass/cyborg/prepare_estorage(obj/item/robot_module/module)
. = ..()
if(glasource)
glasource = module.get_or_create_estorage(glasource)
/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))
@@ -189,10 +196,12 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages
source.use_charge(used * metcost)
glasource.use_charge(used * glacost)
update_icon()
/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)
update_icon()
/obj/item/stack/sheet/rglass/get_main_recipes()
. = ..()
@@ -164,7 +164,8 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
/obj/item/stack/sheet/metal/cyborg
custom_materials = null
is_cyborg = TRUE
cost = 500
source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/metal/get_main_recipes()
. = ..()
+65 -4
View File
@@ -42,6 +42,12 @@
var/matter_amount = 0
/obj/item/stack/Initialize(mapload, new_amount, merge = TRUE)
if(is_cyborg)
if(!istype(loc, /obj/item/robot_module))
stack_trace("Cyborg stack created outside of a robot module, deleting.")
return INITIALIZE_HINT_QDEL
prepare_estorage(loc)
if(new_amount != null)
amount = new_amount
while(amount > max_amount)
@@ -383,7 +389,9 @@
if(check && zero_amount())
return FALSE
if (is_cyborg)
return source.use_charge(used * cost)
. = source.use_charge(used * cost)
update_icon()
return
if (amount < used)
return FALSE
amount -= used
@@ -486,9 +494,53 @@
return
//get amount from user
var/max = get_amount()
var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as null|num)
max = get_amount()
stackmaterial = min(max, stackmaterial)
var/list/quick_split
for(var/option in list(2, 3, 4, 5, 6, 7, "One", "Five", "Ten", "Custom"))
var/mutable_appearance/option_display = new(src)
option_display.filters = null
option_display.cut_overlays()
option_display.pixel_x = 0
option_display.pixel_y = 0
switch(option)
if("Custom")
var/list/sort_numbers = quick_split
sort_numbers = sort_list(sort_numbers, /proc/cmp_numeric_text_desc)
option_display.maptext = MAPTEXT("?")
quick_split = list("Custom" = option_display)
quick_split += sort_numbers
if("One")
option = 1
option_display.maptext = MAPTEXT("1")
if("Five")
if(max > 5)
option = 5
option_display.maptext = MAPTEXT("5")
else
continue
if("Ten")
if(max > 10)
option = 10
option_display.maptext = MAPTEXT("10")
else
continue
else
if(max % option == 0)
option_display.maptext = MAPTEXT(max / option)
option = max / option
else
continue
if(option != "Custom")
LAZYSET(quick_split, "[option]", option_display)
var/stackmaterial
if(length(quick_split) <= 2)
stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack?\nMax: [max]") as null|num)
else
stackmaterial = show_radial_menu(user, get_atom_on_turf(src), quick_split, require_near = TRUE, tooltips = TRUE)
if(stackmaterial == "Custom")
stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack?\nMax: [max]") as null|num)
stackmaterial = isnum(stackmaterial) ? stackmaterial : text2num(stackmaterial)
stackmaterial = min(get_amount(), stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, TRUE, FALSE)) //, !iscyborg(user)
return
split_stack(user, stackmaterial)
@@ -539,3 +591,12 @@
/obj/item/stack/microwave_act(obj/machinery/microwave/M)
if(istype(M) && M.dirty < 100)
M.dirty += amount
/obj/item/stack/proc/prepare_estorage(obj/item/robot_module/module)
if(source)
source = module.get_or_create_estorage(source)
/obj/item/stack/Moved(old_loc, dir)
. = ..()
if(isturf(loc))
update_icon()
@@ -536,7 +536,8 @@
/obj/item/stack/tile/plasteel/cyborg
custom_materials = null // All other Borg versions of items have no Metal or Glass - RR
is_cyborg = TRUE
cost = 125
source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.0625
/obj/item/stack/tile/material
name = "floor tile"
+6
View File
@@ -40,6 +40,12 @@
resistance_flags = FLAMMABLE
grind_results = list(/datum/reagent/cellulose = 5)
/obj/item/stack/packageWrap/cyborg
custom_materials = null
is_cyborg = TRUE
source = /datum/robot_energy_storage/wrapping_paper
cost = 1
/obj/item/stack/packageWrap/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use(3))