Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into proc-define-shit
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/stack/ore/bluespace_crystal/get_part_rating()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user)
|
||||
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
|
||||
|
||||
@@ -216,7 +216,8 @@
|
||||
|
||||
/obj/item/stack/medical/gauze/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/medical
|
||||
cost = 250
|
||||
|
||||
/obj/item/stack/medical/suture
|
||||
@@ -440,7 +441,8 @@
|
||||
|
||||
/obj/item/stack/medical/bone_gel/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/medical
|
||||
cost = 250
|
||||
|
||||
/obj/item/stack/medical/aloe
|
||||
|
||||
@@ -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"
|
||||
@@ -76,12 +76,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
|
||||
/obj/item/stack/rods/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
cost = 250
|
||||
|
||||
/obj/item/stack/rods/cyborg/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/medical
|
||||
cost = MINERAL_MATERIAL_AMOUNT * 0.125
|
||||
|
||||
/obj/item/stack/rods/ten
|
||||
amount = 10
|
||||
|
||||
@@ -51,8 +51,9 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
|
||||
|
||||
/obj/item/stack/sheet/glass/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
cost = 500
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/glass
|
||||
cost = MINERAL_MATERIAL_AMOUNT * 0.25
|
||||
|
||||
/obj/item/stack/sheet/glass/fifty
|
||||
amount = 50
|
||||
@@ -178,9 +179,16 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
|
||||
|
||||
/obj/item/stack/sheet/rglass/cyborg
|
||||
custom_materials = null
|
||||
var/datum/robot_energy_storage/glasource
|
||||
var/metcost = 250
|
||||
var/glacost = 500
|
||||
is_cyborg = TRUE
|
||||
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))
|
||||
@@ -188,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()
|
||||
. = ..()
|
||||
|
||||
@@ -163,8 +163,9 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
|
||||
/obj/item/stack/sheet/metal/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
cost = 500
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/metal
|
||||
cost = MINERAL_MATERIAL_AMOUNT * 0.25
|
||||
|
||||
/obj/item/stack/sheet/metal/get_main_recipes()
|
||||
. = ..()
|
||||
@@ -178,7 +179,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
* Plasteel
|
||||
*/
|
||||
GLOBAL_LIST_INIT(plasteel_recipes, list ( \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = TRUE), \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/ai_core, 4, time = 50, one_per_turf = TRUE), \
|
||||
new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \
|
||||
new/datum/stack_recipe("plasteel keg", /obj/structure/custom_keg, 10, time = 50), \
|
||||
new/datum/stack_recipe("micro powered fan assembly", /obj/machinery/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \
|
||||
|
||||
@@ -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)
|
||||
@@ -132,6 +138,19 @@
|
||||
else
|
||||
icon_state = "[initial(icon_state)]_3"
|
||||
|
||||
/obj/item/stack/update_overlays()
|
||||
. = ..()
|
||||
if(isturf(loc))
|
||||
return
|
||||
var/atom/movable/screen/storage/item_holder/holder = locate(/atom/movable/screen/storage/item_holder) in vis_locs
|
||||
if(holder?.master && istype(holder.master, /datum/component/storage/concrete))
|
||||
var/datum/component/storage/concrete/storage = holder.master
|
||||
if(storage.display_numerical_stacking)
|
||||
return // It's being handled by the storage we're in, forget about it.
|
||||
var/mutable_appearance/number = mutable_appearance(appearance_flags = APPEARANCE_UI_IGNORE_ALPHA)
|
||||
number.maptext = MAPTEXT(get_amount())
|
||||
. += number
|
||||
|
||||
/obj/item/stack/examine(mob/user)
|
||||
. = ..()
|
||||
if (is_cyborg)
|
||||
@@ -151,6 +170,14 @@
|
||||
. += "There is [get_amount()] in the stack."
|
||||
. += "<span class='notice'>Alt-click to take a custom amount.</span>"
|
||||
|
||||
/obj/item/stack/equipped(mob/user, slot)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/dropped(mob/user, slot)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/proc/get_amount()
|
||||
if(is_cyborg)
|
||||
. = round(source?.energy / cost)
|
||||
@@ -358,11 +385,13 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return 0 = borked; return 1 = had enough
|
||||
/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return FALSE = borked; return TRUE = had enough
|
||||
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
|
||||
@@ -465,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)
|
||||
@@ -491,7 +564,11 @@
|
||||
F.forceMove(user.drop_location())
|
||||
add_fingerprint(user)
|
||||
F.add_fingerprint(user)
|
||||
zero_amount()
|
||||
if(!zero_amount())
|
||||
var/atom/movable/screen/storage/item_holder/holder = locate(/atom/movable/screen/storage/item_holder) in vis_locs
|
||||
if(holder?.master && istype(holder.master, /datum/component/storage/concrete))
|
||||
var/datum/component/storage/concrete/storage = holder.master
|
||||
storage.refresh_mob_views()
|
||||
|
||||
/obj/item/stack/attackby(obj/item/W, mob/user, params)
|
||||
if(can_merge(W))
|
||||
@@ -514,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()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/arcadeticket/update_icon()
|
||||
/obj/item/stack/arcadeticket/update_icon_state()
|
||||
var/amount = get_amount()
|
||||
if((amount >= 12) && (amount > 0))
|
||||
icon_state = "arcade-ticket_4"
|
||||
|
||||
@@ -535,8 +535,9 @@
|
||||
|
||||
/obj/item/stack/tile/plasteel/cyborg
|
||||
custom_materials = null // All other Borg versions of items have no Metal or Glass - RR
|
||||
is_cyborg = 1
|
||||
cost = 125
|
||||
is_cyborg = TRUE
|
||||
source = /datum/robot_energy_storage/metal
|
||||
cost = MINERAL_MATERIAL_AMOUNT * 0.0625
|
||||
|
||||
/obj/item/stack/tile/material
|
||||
name = "floor tile"
|
||||
|
||||
@@ -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))
|
||||
@@ -53,16 +59,16 @@
|
||||
return SHAME
|
||||
|
||||
/obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/can_be_package_wrapped()
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/item/storage/box/can_be_package_wrapped()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/smallDelivery/can_be_package_wrapped()
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/item/stack/packageWrap/afterattack(obj/target, mob/user, proximity)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user