mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 13:33:29 +00:00
Merge remote-tracking branch 'upstream/dev-freeze' into dev
Conflicts: code/game/machinery/computer3/buildandrepair.dm code/game/objects/items/devices/lightreplacer.dm code/modules/research/circuitprinter.dm code/modules/research/protolathe.dm
This commit is contained in:
@@ -136,8 +136,8 @@
|
||||
// Make it a wood-reinforced wooden table.
|
||||
// There are cult materials available, but it'd make the table non-deconstructable with how holotables work.
|
||||
// Could possibly use a new material var for holographic-ness?
|
||||
material = name_to_material["wood"]
|
||||
reinforced = name_to_material["wood"]
|
||||
material = get_material_by_name("wood")
|
||||
reinforced = get_material_by_name("wood")
|
||||
update_desc()
|
||||
update_connections(1)
|
||||
update_icon()
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
/obj/machinery/autolathe/dismantle()
|
||||
|
||||
for(var/mat in stored_material)
|
||||
var/material/M = name_to_material[mat]
|
||||
var/material/M = get_material_by_name(mat)
|
||||
if(!istype(M))
|
||||
continue
|
||||
var/obj/item/stack/material/S = new M.stack_type(get_turf(src))
|
||||
|
||||
@@ -66,19 +66,19 @@
|
||||
user << "<span class='info'>You inject the blood sample into the bioprinter.</span>"
|
||||
return
|
||||
// Meat for biomass.
|
||||
else if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
|
||||
if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
|
||||
stored_matter += 50
|
||||
user.drop_item()
|
||||
user << "<span class='info'>\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]</span>"
|
||||
qdel(W)
|
||||
return
|
||||
// Steel for matter.
|
||||
else if(prints_prosthetics && istype(W, /obj/item/stack/material/steel))
|
||||
var/obj/item/stack/material/steel/M = W
|
||||
stored_matter += M.amount * 10
|
||||
if(prints_prosthetics && istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/S = W
|
||||
stored_matter += S.amount * 10
|
||||
user.drop_item()
|
||||
user << "<span class='info'>\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]</span>"
|
||||
qdel(W)
|
||||
return
|
||||
else
|
||||
return..()
|
||||
|
||||
return..()
|
||||
@@ -88,8 +88,8 @@
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
|
||||
A.amount = 5
|
||||
|
||||
if(istype(P, /obj/item/stack/material/glass/reinforced))
|
||||
var/obj/item/stack/material/glass/reinforced/RG = P
|
||||
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "rglass")
|
||||
var/obj/item/stack/RG = P
|
||||
if (RG.get_amount() < 2)
|
||||
user << "<span class='warning'>You need two sheets of glass to put in the glass panel.</span>"
|
||||
return
|
||||
|
||||
@@ -87,8 +87,8 @@
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||
A.amount = 5
|
||||
|
||||
if(istype(P, /obj/item/stack/material/glass))
|
||||
var/obj/item/stack/material/glass/G = P
|
||||
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
|
||||
var/obj/item/stack/G = P
|
||||
if (G.get_amount() < 2)
|
||||
user << "<span class='warning'>You need two sheets of glass to put in the glass panel.</span>"
|
||||
return
|
||||
|
||||
@@ -178,12 +178,13 @@
|
||||
if(istype(P, /obj/item/weapon/crowbar)) // complicated check
|
||||
remove_peripheral()
|
||||
|
||||
if(istype(P, /obj/item/stack/material/glass))
|
||||
if(P:amount >= 2)
|
||||
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
|
||||
var/obj/item/stack/S = P
|
||||
if(S.amount >= 2)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if(P)
|
||||
P:use(2)
|
||||
if(S)
|
||||
S.use(2)
|
||||
user << "<span class='notice'>You put in the glass panel.</span>"
|
||||
src.state = 4
|
||||
src.icon_state = "4"
|
||||
|
||||
@@ -79,12 +79,14 @@ for reference:
|
||||
maxhealth = material.integrity
|
||||
health = maxhealth
|
||||
|
||||
/obj/structure/barricade/get_material()
|
||||
return material
|
||||
|
||||
/obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/stack/material))
|
||||
var/obj/item/stack/material/D = W
|
||||
if(D.material.name != material.name)
|
||||
user << "<span class='warning'>That is the wrong material needed to repair \the [src].</span>"
|
||||
return
|
||||
if (istype(W, /obj/item/stack))
|
||||
var/obj/item/stack/D = W
|
||||
if(D.get_material_name() != material.name)
|
||||
return //hitting things with the wrong type of stack usually doesn't produce messages, and probably doesn't need to.
|
||||
if (health < maxhealth)
|
||||
if (D.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one sheet of [material.display_name] to repair \the [src].</span>"
|
||||
|
||||
@@ -48,6 +48,11 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/get_material()
|
||||
if(mineral)
|
||||
return get_material_by_name(mineral)
|
||||
return get_material_by_name(DEFAULT_WALL_MATERIAL)
|
||||
|
||||
/obj/machinery/door/airlock/command
|
||||
name = "Airlock"
|
||||
icon = 'icons/obj/doors/Doorcom.dmi'
|
||||
|
||||
@@ -96,12 +96,12 @@
|
||||
else
|
||||
usr << "<span class='notice'>[src]'s motors resist your effort.</span>"
|
||||
return
|
||||
if(istype(C, /obj/item/stack/material/plasteel))
|
||||
var/amt = repair_price()
|
||||
if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel")
|
||||
var/amt = Ceiling((maxhealth - health)/150)
|
||||
if(!amt)
|
||||
usr << "<span class='notice'>\The [src] is already fully repaired.</span>"
|
||||
return
|
||||
var/obj/item/stack/material/plasteel/P = C
|
||||
var/obj/item/stack/P = C
|
||||
if(P.amount < amt)
|
||||
usr << "<span class='warning'>You don't have enough sheets to repair this! You need at least [amt] sheets.</span>"
|
||||
return
|
||||
@@ -135,16 +135,6 @@
|
||||
return
|
||||
force_close()
|
||||
|
||||
// Proc: repair_price()
|
||||
// Parameters: None
|
||||
// Description: Determines amount of sheets needed for full repair. (max)150HP per sheet, (max)10 emitter hits per sheet.
|
||||
/obj/machinery/door/blast/proc/repair_price()
|
||||
var/sheets_needed = 0
|
||||
var/dam = maxhealth - health
|
||||
while(dam > 0)
|
||||
dam -= 150
|
||||
sheets_needed++
|
||||
return sheets_needed
|
||||
|
||||
// Proc: repair()
|
||||
// Parameters: None
|
||||
@@ -154,7 +144,7 @@
|
||||
if(stat & BROKEN)
|
||||
stat &= ~BROKEN
|
||||
|
||||
|
||||
|
||||
/obj/machinery/door/blast/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group) return 1
|
||||
return ..()
|
||||
|
||||
@@ -199,10 +199,9 @@
|
||||
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/device/detective_scanner))
|
||||
return
|
||||
if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(istype(I, /obj/item/stack/material/steel))
|
||||
if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
|
||||
if(stat & BROKEN)
|
||||
user << "<span class='notice'>It looks like \the [src] is pretty busted. It's going to need more than just patching up now.</span>"
|
||||
return
|
||||
@@ -217,20 +216,20 @@
|
||||
var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
|
||||
amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc?
|
||||
|
||||
var/obj/item/stack/material/steel/metalstack = I
|
||||
var/obj/item/stack/stack = I
|
||||
var/transfer
|
||||
if (repairing)
|
||||
transfer = metalstack.transfer_to(repairing, amount_needed - repairing.amount)
|
||||
transfer = stack.transfer_to(repairing, amount_needed - repairing.amount)
|
||||
if (!transfer)
|
||||
user << "<span class='warning'>You must weld or remove \the [repairing] from \the [src] before you can add anything else.</span>"
|
||||
else
|
||||
repairing = metalstack.split(amount_needed)
|
||||
repairing = stack.split(amount_needed)
|
||||
if (repairing)
|
||||
repairing.loc = src
|
||||
transfer = repairing.amount
|
||||
|
||||
if (transfer)
|
||||
user << "<span class='notice'>You fit [transfer] [metalstack.singular_name]\s to damaged and broken parts on \the [src].</span>"
|
||||
user << "<span class='notice'>You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src].</span>"
|
||||
|
||||
return
|
||||
|
||||
@@ -270,6 +269,8 @@
|
||||
take_damage(W.force)
|
||||
return
|
||||
|
||||
if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
|
||||
|
||||
if(src.operating) return
|
||||
|
||||
if(src.allowed(user) && operable())
|
||||
|
||||
@@ -75,6 +75,8 @@
|
||||
A.all_doors.Remove(src)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/door/firedoor/get_material()
|
||||
return get_material_by_name(DEFAULT_WALL_MATERIAL)
|
||||
|
||||
/obj/machinery/door/firedoor/examine(mob/user)
|
||||
. = ..(user, 1)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
user.visible_message("<span class='notice'>[user] has [!a_dis?"de":""]activated auto-dismantling.</span>", "<span class='notice'>You [!a_dis?"de":""]activate auto-dismantling.</span>")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/material/steel))
|
||||
if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
|
||||
var/result = load_metal(W)
|
||||
if(isnull(result))
|
||||
@@ -86,7 +86,7 @@
|
||||
on=0
|
||||
return
|
||||
|
||||
/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/material/steel/MM)
|
||||
/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/MM)
|
||||
if(istype(MM) && MM.get_amount())
|
||||
var/cur_amount = metal
|
||||
var/to_load = max(max_metal - round(cur_amount),0)
|
||||
|
||||
@@ -704,8 +704,8 @@ var/list/turret_icons
|
||||
return
|
||||
|
||||
if(1)
|
||||
if(istype(I, /obj/item/stack/material/steel))
|
||||
var/obj/item/stack/material/steel/M = I
|
||||
if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = I
|
||||
if(M.use(2))
|
||||
user << "<span class='notice'>You add some metal armor to the interior frame.</span>"
|
||||
build_step = 2
|
||||
@@ -796,8 +796,8 @@ var/list/turret_icons
|
||||
//attack_hand() removes the prox sensor
|
||||
|
||||
if(6)
|
||||
if(istype(I, /obj/item/stack/material/steel))
|
||||
var/obj/item/stack/material/steel/M = I
|
||||
if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = I
|
||||
if(M.use(2))
|
||||
user << "<span class='notice'>You add some metal armor to the exterior frame.</span>"
|
||||
build_step = 7
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
active_power_usage = 10000
|
||||
|
||||
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (istype(O, /obj/item/stack/material/steel))
|
||||
var/obj/item/stack/material/steel/M = O
|
||||
if (istype(O, /obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = O
|
||||
if (src.metal_amount < 150000.0)
|
||||
var/count = 0
|
||||
src.overlays += "fab-load-metal"
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
user << "It has [uses] lights remaining."
|
||||
|
||||
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/stack/material/glass))
|
||||
var/obj/item/stack/material/glass/G = W
|
||||
if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass")
|
||||
var/obj/item/stack/G = W
|
||||
if(uses >= max_uses)
|
||||
user << "<span class='warning'>[src.name] is full.</span>"
|
||||
return
|
||||
|
||||
@@ -127,8 +127,8 @@
|
||||
|
||||
/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/stack/material/steel) && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
|
||||
var/obj/item/stack/material/steel/M = W
|
||||
if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
|
||||
var/obj/item/stack/material/M = W
|
||||
if (M.use(1))
|
||||
var/obj/item/weapon/secbot_assembly/ed209_assembly/B = new /obj/item/weapon/secbot_assembly/ed209_assembly
|
||||
B.loc = get_turf(src)
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
|
||||
if(istype(O,/obj/item/stack/material/steel))
|
||||
var/obj/item/stack/material/steel/M = O
|
||||
if(istype(O,/obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = O
|
||||
if (M.use(1))
|
||||
use(1)
|
||||
new/obj/item/stack/tile/light(get_turf(user))
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
if(!isnull(matter[material_type]))
|
||||
matter[material_type] *= force_divisor // May require a new var instead.
|
||||
|
||||
/obj/item/weapon/material/get_material()
|
||||
return material
|
||||
|
||||
/obj/item/weapon/material/proc/update_force()
|
||||
if(edge || sharp)
|
||||
force = material.get_edge_damage()
|
||||
|
||||
@@ -89,4 +89,4 @@
|
||||
..(loc, "steel")
|
||||
|
||||
/obj/item/weapon/material/shard/phoron/New(loc)
|
||||
..(loc, "phoron glass")
|
||||
..(loc, "phglass")
|
||||
|
||||
@@ -119,10 +119,10 @@
|
||||
//verbs += /obj/item/weapon/storage/bag/sheetsnatcher/quick_empty
|
||||
|
||||
can_be_inserted(obj/item/W as obj, stop_messages = 0)
|
||||
if(!istype(W,/obj/item/stack/material) || istype(W,/obj/item/stack/material/sandstone) || istype(W,/obj/item/stack/material/wood))
|
||||
if(!istype(W,/obj/item/stack/material))
|
||||
if(!stop_messages)
|
||||
usr << "The snatcher does not accept [W]."
|
||||
return 0 //I don't care, but the existing code rejects them for not being "sheets" *shrug* -Sayu
|
||||
return 0
|
||||
var/current = 0
|
||||
for(var/obj/item/stack/material/S in contents)
|
||||
current += S.amount
|
||||
|
||||
@@ -236,20 +236,20 @@
|
||||
electronics = null
|
||||
|
||||
else if(istype(W, /obj/item/stack/material) && !glass)
|
||||
var/obj/item/stack/material/S = W
|
||||
var/obj/item/stack/S = W
|
||||
var/material_name = S.get_material_name()
|
||||
if (S)
|
||||
if (S.get_amount() >= 1)
|
||||
if(istype(S, /obj/item/stack/material/glass/reinforced))
|
||||
if(material_name == "rglass")
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if (S.use(1))
|
||||
user << "<span class='notice'>You installed reinforced glass windows into the airlock assembly.</span>"
|
||||
glass = 1
|
||||
else if(istype(S, /obj/item/stack/material) && S.default_type)
|
||||
var/M = S.default_type
|
||||
else if(material_name)
|
||||
// Ugly hack, will suffice for now. Need to fix it upstream as well, may rewrite mineral walls. ~Z
|
||||
if(M in list("mhydrogen","osmium","tritium","platinum","iron"))
|
||||
if(!(material_name in list("gold", "silver", "diamond", "uranium", "phoron", "sandstone")))
|
||||
user << "You cannot make an airlock out of that material."
|
||||
return
|
||||
if(S.get_amount() >= 2)
|
||||
@@ -257,8 +257,8 @@
|
||||
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if (S.use(2))
|
||||
user << "<span class='notice'>You installed [M] plating into the airlock assembly.</span>"
|
||||
glass = "[M]"
|
||||
user << "<span class='notice'>You installed [material_display_name(material_name)] plating into the airlock assembly.</span>"
|
||||
glass = material_name
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
|
||||
@@ -108,11 +108,11 @@
|
||||
|
||||
else if(istype(W, /obj/item/stack/material))
|
||||
|
||||
var/obj/item/stack/material/S = W
|
||||
var/obj/item/stack/S = W
|
||||
if(S.get_amount() < 2)
|
||||
return ..()
|
||||
|
||||
var/material/M = name_to_material[S.default_type]
|
||||
var/material/M = S.get_material()
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
user << "There is not enough material here to reinforce the girder."
|
||||
return
|
||||
|
||||
var/material/M = name_to_material[S.default_type]
|
||||
var/material/M = S.get_material()
|
||||
if(!istype(M) || M.integrity < 50)
|
||||
user << "You cannot reinforce \the [src] with that; it is too soft."
|
||||
return
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
update_nearby_tiles()
|
||||
..()
|
||||
|
||||
/obj/structure/simple_door/get_material()
|
||||
return material
|
||||
|
||||
/obj/structure/simple_door/Bumped(atom/user)
|
||||
..()
|
||||
if(!state)
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
padding_material = get_material_by_name(new_padding_material)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bed/get_material()
|
||||
return material
|
||||
|
||||
// Reuse the cache/code from stools, todo maybe unify.
|
||||
/obj/structure/bed/update_icon()
|
||||
// Prep icon.
|
||||
|
||||
@@ -195,16 +195,12 @@ var/list/mechtoys = list(
|
||||
find_slip = 0
|
||||
continue
|
||||
|
||||
// Sell phoron
|
||||
if(istype(A, /obj/item/stack/material/phoron))
|
||||
var/obj/item/stack/material/phoron/P = A
|
||||
phoron_count += P.get_amount()
|
||||
|
||||
// Sell platinum
|
||||
if(istype(A, /obj/item/stack/material/platinum))
|
||||
var/obj/item/stack/material/platinum/P = A
|
||||
plat_count += P.get_amount()
|
||||
|
||||
// Sell phoron and platinum
|
||||
if(istype(A, /obj/item/stack))
|
||||
var/obj/item/stack/P
|
||||
switch(P.get_material_name())
|
||||
if("phoron") phoron_count += P.get_amount()
|
||||
if("platinum") plat_count += P.get_amount()
|
||||
qdel(MA)
|
||||
|
||||
if(phoron_count)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
else
|
||||
construction_stage = null
|
||||
if(!material)
|
||||
material = name_to_material[DEFAULT_WALL_MATERIAL]
|
||||
material = get_material_by_name(DEFAULT_WALL_MATERIAL)
|
||||
if(material)
|
||||
explosion_resistance = material.explosion_resistance
|
||||
if(reinf_material && reinf_material.explosion_resistance > explosion_resistance)
|
||||
|
||||
@@ -28,7 +28,7 @@ var/list/global/wall_cache = list()
|
||||
materialtype = DEFAULT_WALL_MATERIAL
|
||||
material = get_material_by_name(materialtype)
|
||||
if(!isnull(rmaterialtype))
|
||||
reinf_material = name_to_material[rmaterialtype]
|
||||
reinf_material = get_material_by_name(rmaterialtype)
|
||||
update_material()
|
||||
|
||||
processing_turfs |= src
|
||||
@@ -38,7 +38,6 @@ var/list/global/wall_cache = list()
|
||||
dismantle_wall(null,null,1)
|
||||
..()
|
||||
|
||||
|
||||
/turf/simulated/wall/process()
|
||||
// Calling parent will kill processing
|
||||
if(!radiate())
|
||||
@@ -170,7 +169,7 @@ var/list/global/wall_cache = list()
|
||||
O.loc = src
|
||||
|
||||
clear_plants()
|
||||
material = name_to_material["placeholder"]
|
||||
material = get_material_by_name("placeholder")
|
||||
reinf_material = null
|
||||
check_relatives()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user