mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Fixes autolathe, material and smartfridge issues
This commit is contained in:
committed by
CHOMPStation2
parent
a2dabe62a1
commit
165d947e91
@@ -140,12 +140,7 @@
|
||||
return
|
||||
|
||||
// Cache this since S may go away after use()
|
||||
var/list/sheet_matter
|
||||
if(istype(S, /obj/item/stack/material))
|
||||
var/obj/item/stack/material/MS = S
|
||||
sheet_matter = list(MS.material.name = 2000)
|
||||
else
|
||||
sheet_matter = S.matter
|
||||
var/list/sheet_matter = S.matter
|
||||
|
||||
// Calculate total amount of material for one sheet
|
||||
var/matter_per_sheet = 0
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
if(shocked)
|
||||
shock(user, 50)
|
||||
|
||||
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
@@ -135,7 +135,7 @@
|
||||
if(istype(O,/obj/item/ammo_magazine/clip) || istype(O,/obj/item/ammo_magazine/s357) || istype(O,/obj/item/ammo_magazine/s38) || istype (O,/obj/item/ammo_magazine/s44)/* VOREstation Edit*/) // Prevents ammo recycling exploit with speedloaders.
|
||||
to_chat(user, "\The [O] is too hazardous to recycle with the autolathe!")
|
||||
return
|
||||
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autolathe/attack_hand(mob/user as mob)
|
||||
@@ -177,12 +177,12 @@
|
||||
max_sheets = 0
|
||||
//Build list of multipliers for sheets.
|
||||
multiplier = tgui_input_number(usr, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0)
|
||||
if(!multiplier || multiplier <= 0 || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
if(!multiplier || multiplier <= 0 || (multiplier != round(multiplier)) || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
|
||||
//Check if we still have the materials.
|
||||
var/coeff = (making.no_scale ? 1 : mat_efficiency) //stacks are unaffected by production coefficient
|
||||
|
||||
|
||||
for(var/datum/material/used_material as anything in making.resources)
|
||||
var/amount_needed = making.resources[used_material] * coeff * multiplier
|
||||
materials_used[used_material] = amount_needed
|
||||
@@ -190,7 +190,7 @@
|
||||
if(LAZYLEN(materials_used))
|
||||
if(!materials.has_materials(materials_used))
|
||||
return
|
||||
|
||||
|
||||
materials.use_materials(materials_used)
|
||||
|
||||
busy = making.name
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
//Return 1 if an immediate subsequent call to use() would succeed.
|
||||
//Ensures that code dealing with stacks uses the same logic
|
||||
/obj/item/stack/proc/can_use(var/used)
|
||||
if(used < 0 || used % 1)
|
||||
if(used < 0 || (used != round(used)))
|
||||
stack_trace("Tried to use a bad stack amount: [used]")
|
||||
return 0
|
||||
if(get_amount() < used)
|
||||
@@ -265,7 +265,7 @@
|
||||
return 1
|
||||
|
||||
/obj/item/stack/proc/add(var/extra)
|
||||
if(extra < 0 || extra % 1)
|
||||
if(extra < 0 || (extra != round(extra)))
|
||||
stack_trace("Tried to add a bad stack amount: [extra]")
|
||||
return 0
|
||||
if(!uses_charge)
|
||||
@@ -283,7 +283,7 @@
|
||||
S.add_charge(charge_costs[i] * extra)
|
||||
|
||||
/obj/item/stack/proc/set_amount(var/new_amount, var/no_limits = FALSE)
|
||||
if(new_amount < 0 || new_amount % 1)
|
||||
if(new_amount < 0 || (new_amount != round(new_amount)))
|
||||
stack_trace("Tried to set a bad stack amount: [new_amount]")
|
||||
return 0
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
if (isnull(tamount))
|
||||
tamount = src.get_amount()
|
||||
|
||||
if(tamount < 0 || tamount % 1)
|
||||
if(tamount < 0 || (tamount != round(tamount)))
|
||||
stack_trace("Tried to transfer a bad stack amount: [tamount]")
|
||||
return 0
|
||||
|
||||
@@ -347,7 +347,7 @@
|
||||
if(uses_charge)
|
||||
return null
|
||||
|
||||
if(tamount < 0 || tamount % 1)
|
||||
if(tamount < 0 || (tamount != round(tamount)))
|
||||
stack_trace("Tried to split a bad stack amount: [tamount]")
|
||||
return null
|
||||
|
||||
@@ -403,6 +403,9 @@
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/N = tgui_input_number(usr, "How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1, amount, 1)
|
||||
if(N != round(N))
|
||||
to_chat(user, "<span class='warning'>You cannot separate a non-whole number of stacks!</span>")
|
||||
return
|
||||
if(N)
|
||||
var/obj/item/stack/F = src.split(N)
|
||||
if (F)
|
||||
|
||||
@@ -217,14 +217,14 @@
|
||||
amount = params["amount"]
|
||||
else
|
||||
amount = tgui_input_number(usr, "How many items?", "How many items would you like to take out?", 1)
|
||||
|
||||
|
||||
if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src))
|
||||
return FALSE
|
||||
|
||||
|
||||
var/index = text2num(params["index"])
|
||||
if(index < 1 || index > LAZYLEN(item_records))
|
||||
return TRUE
|
||||
|
||||
|
||||
vend(item_records[index], amount)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -257,7 +257,7 @@
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return TRUE
|
||||
if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
|
||||
if(!allowed(usr) && !emagged && locked != -1 && action == "Release")
|
||||
if((!allowed(usr) && scan_id) && !emagged && locked != -1 && action == "Release")
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
@@ -132,13 +132,12 @@
|
||||
display_name = "reinforced borosilicate glass"
|
||||
stack_type = /obj/item/stack/material/glass/phoronrglass
|
||||
stack_origin_tech = list(TECH_MATERIAL = 5)
|
||||
composite_material = list() //todo
|
||||
window_options = list("One Direction" = 1, "Full Window" = 4)
|
||||
created_window = /obj/structure/window/phoronreinforced
|
||||
created_fulltile_window = /obj/structure/window/phoronreinforced/full
|
||||
hardness = 40
|
||||
weight = 30
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
composite_material = list(MAT_STEEL = SHEET_MATERIAL_AMOUNT / 2, "borosilicate glass" = SHEET_MATERIAL_AMOUNT)
|
||||
composite_material = list(MAT_STEEL = SHEET_MATERIAL_AMOUNT / 2, MAT_PGLASS = SHEET_MATERIAL_AMOUNT)
|
||||
rod_product = null
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
created_fulltile_window = /obj/structure/window/titanium/full
|
||||
wire_product = null
|
||||
rod_product = /obj/item/stack/material/glass/titanium
|
||||
composite_material = list(MAT_TITANIUM = SHEET_MATERIAL_AMOUNT, MAT_GLASS = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/glass/plastaniumglass
|
||||
name = MAT_PLASTITANIUMGLASS
|
||||
@@ -30,4 +29,3 @@
|
||||
created_fulltile_window = /obj/structure/window/plastitanium/full
|
||||
wire_product = null
|
||||
rod_product = /obj/item/stack/material/glass/plastitanium
|
||||
composite_material = list(MAT_PLASTITANIUM = SHEET_MATERIAL_AMOUNT, MAT_GLASS = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
icon_reinf = "reinf_mesh"
|
||||
icon_colour = "#666677"
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
composite_material = list(MAT_STEEL = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/steel/hull/place_sheet(var/turf/target) //Deconstructed into normal steel sheets.
|
||||
new /obj/item/stack/material/steel(target)
|
||||
@@ -20,6 +21,7 @@
|
||||
icon_colour = "#777788"
|
||||
explosion_resistance = 40
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
composite_material = list(MAT_PLASTEEL = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/plasteel/hull/place_sheet(var/turf/target) //Deconstructed into normal plasteel sheets.
|
||||
new /obj/item/stack/material/plasteel(target)
|
||||
@@ -33,6 +35,7 @@
|
||||
explosion_resistance = 90
|
||||
reflectivity = 0.9
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
composite_material = list(MAT_DURASTEEL = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/durasteel/hull/place_sheet(var/turf/target) //Deconstructed into normal durasteel sheets.
|
||||
new /obj/item/stack/material/durasteel(target)
|
||||
@@ -43,6 +46,7 @@
|
||||
icon_base = "hull"
|
||||
icon_reinf = "reinf_mesh"
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
composite_material = list(MAT_TITANIUM = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/titanium/hull/place_sheet(var/turf/target) //Deconstructed into normal titanium sheets.
|
||||
new /obj/item/stack/material/titanium(target)
|
||||
@@ -53,6 +57,7 @@
|
||||
icon_base = "hull"
|
||||
icon_reinf = "reinf_mesh"
|
||||
flags = MATERIAL_UNMELTABLE
|
||||
composite_material = list(MAT_MORPHIUM = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/morphium/hull/place_sheet(var/turf/target)
|
||||
new /obj/item/stack/material/morphium(target)
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_reinf = "reinf_mesh"
|
||||
icon_colour = "#585658"
|
||||
explosion_resistance = 50
|
||||
composite_material = list(MAT_PLASTITANIUM = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/plastitanium/hull/place_sheet(var/turf/target) //Deconstructed into normal plasteel sheets.
|
||||
new /obj/item/stack/material/plastitanium(target)
|
||||
@@ -15,6 +16,7 @@
|
||||
icon_base = "hull"
|
||||
icon_reinf = "reinf_mesh"
|
||||
explosion_resistance = 50
|
||||
composite_material = list(MAT_GOLD = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
/datum/material/gold/hull/place_sheet(var/turf/target) //Deconstructed into normal gold sheets.
|
||||
new /obj/item/stack/material/gold(target)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
protectiveness = 60 // 75%
|
||||
reflectivity = 0.7 // Not a perfect mirror, but close.
|
||||
stack_origin_tech = list(TECH_MATERIAL = 8)
|
||||
composite_material = list("plasteel" = SHEET_MATERIAL_AMOUNT, "diamond" = SHEET_MATERIAL_AMOUNT) //shrug
|
||||
supply_conversion_value = 9
|
||||
|
||||
/datum/material/titanium
|
||||
@@ -28,7 +27,6 @@
|
||||
door_icon_base = "metal"
|
||||
icon_colour = "#D1E6E3"
|
||||
icon_reinf = "reinf_metal"
|
||||
composite_material = null
|
||||
|
||||
/datum/material/iron
|
||||
name = "iron"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
protectiveness = 20 // 50%
|
||||
conductivity = 13 // For the purposes of balance.
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
composite_material = list(MAT_STEEL = SHEET_MATERIAL_AMOUNT, "platinum" = SHEET_MATERIAL_AMOUNT) //todo
|
||||
supply_conversion_value = 6
|
||||
|
||||
/datum/material/plasteel/generate_recipes()
|
||||
@@ -38,3 +37,4 @@
|
||||
stack_type = /obj/item/stack/material/plasteel/rebar
|
||||
sheet_singular_name = "rod"
|
||||
sheet_plural_name = "rods"
|
||||
composite_material = list(MAT_PLASTEEL = SHEET_MATERIAL_AMOUNT)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
protectiveness = 30
|
||||
conductivity = 7
|
||||
stack_origin_tech = list(TECH_MATERIAL = 5)
|
||||
composite_material = list(MAT_TITANIUM = SHEET_MATERIAL_AMOUNT, MAT_PLASTEEL = SHEET_MATERIAL_AMOUNT)
|
||||
supply_conversion_value = 8
|
||||
|
||||
/datum/material/plastitanium/generate_recipes()
|
||||
|
||||
@@ -23060,6 +23060,7 @@
|
||||
},
|
||||
/turf/simulated/floor/tiled/techmaint,
|
||||
/area/tether/surfacebase/shuttle_pad)
|
||||
<<<<<<< HEAD
|
||||
"aLb" = (
|
||||
/obj/structure/closet/crate,
|
||||
/obj/machinery/firealarm{
|
||||
@@ -23068,6 +23069,8 @@
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/tether/surfacebase/servicebackroom)
|
||||
=======
|
||||
>>>>>>> a4f86e73f3... Merge pull request #14260 from Heroman3003/more-fixes
|
||||
"aLc" = (
|
||||
/obj/effect/floor_decal/corner/grey/diagonal,
|
||||
/obj/structure/disposalpipe/segment{
|
||||
@@ -316999,11 +317002,20 @@ aru
|
||||
bge
|
||||
bfm
|
||||
bgA
|
||||
<<<<<<< HEAD
|
||||
aJt
|
||||
aJt
|
||||
aJt
|
||||
aJt
|
||||
aJt
|
||||
=======
|
||||
bgA
|
||||
aru
|
||||
bfX
|
||||
bgz
|
||||
bgz
|
||||
baX
|
||||
>>>>>>> a4f86e73f3... Merge pull request #14260 from Heroman3003/more-fixes
|
||||
bgQ
|
||||
aJt
|
||||
aJt
|
||||
|
||||
Reference in New Issue
Block a user