mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 08:29:57 +01:00
Materials Repath (#22388)
Soft-ish port of https://github.com/NebulaSS13/Nebula/pull/540. Except we call them singletons. Repaths all materials as singletons instead of datums, and replaces material defines from strings to paths so that we can just run GET_SINGLETON instead of needing to use SSMaterials. This is Step One. This PR has no player-facing changes. changes: - refactor: "Repaths /material to /singleton/material." - refactor: "Replaces all material string defines to path defines, replacing SSmaterials procs w/ GET_SINGLETON instead." - refactor: "Removes all material var edited objects from all maps, adding new presets where necessary." - refactor: "Updates recipes unit test to run all recipes against all material singletons." --------- Signed-off-by: Batrachophreno <Batrochophreno@gmail.com> Co-authored-by: kano-dot <bhutanlikanoxy@gmail.com>
This commit is contained in:
co-authored by
kano-dot
parent
2e61d8fd15
commit
eebb8b971c
@@ -10,7 +10,7 @@
|
||||
/obj/item/material/butterflyconstruction/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
to_chat(user, "You finish the concealed blade weapon.")
|
||||
new /obj/item/material/knife/butterfly(user.loc, material.name)
|
||||
new /obj/item/material/knife/butterfly(user.loc, material.type)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(istype(attacking_item, /obj/item/material/butterflyblade))
|
||||
var/obj/item/material/butterflyblade/B = attacking_item
|
||||
to_chat(user, "You attach the two concealed blade parts.")
|
||||
var/finished = new /obj/item/material/butterflyconstruction(user.loc, B.material.name)
|
||||
var/finished = new /obj/item/material/butterflyconstruction(user.loc, B.material.type)
|
||||
qdel(attacking_item)
|
||||
qdel(src)
|
||||
user.put_in_hands(finished)
|
||||
@@ -72,7 +72,7 @@
|
||||
var/obj/item/finished
|
||||
if(istype(attacking_item, /obj/item/material/shard) || istype(attacking_item, /obj/item/material/spearhead))
|
||||
var/obj/item/material/tmp_shard = attacking_item
|
||||
finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.name)
|
||||
finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.type)
|
||||
to_chat(user, SPAN_NOTICE("You fasten \the [attacking_item] to the top of the rod with the cable."))
|
||||
else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
|
||||
finished = new /obj/item/melee/baton/cattleprod(get_turf(user), forward_cable_color)
|
||||
@@ -101,14 +101,14 @@
|
||||
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")
|
||||
force_divisor = 0.1
|
||||
thrown_force_divisor = 0.1
|
||||
default_material = "wood"
|
||||
default_material = MATERIAL_WOOD
|
||||
|
||||
/obj/item/material/shaft/attackby(obj/item/attacking_item, mob/user)
|
||||
..()
|
||||
var/obj/item/finished
|
||||
if(istype(attacking_item, /obj/item/material/spearhead))
|
||||
var/obj/item/material/spearhead/tip = attacking_item
|
||||
finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.name)
|
||||
finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.type)
|
||||
to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to the top of \the [src]."))
|
||||
if(finished)
|
||||
user.drop_from_inventory(src,finished)
|
||||
@@ -130,8 +130,7 @@
|
||||
attack_verb = list("attacked", "poked")
|
||||
force_divisor = 0.1
|
||||
thrown_force_divisor = 0.1
|
||||
default_material = "steel"
|
||||
|
||||
default_material = MATERIAL_STEEL
|
||||
|
||||
/obj/item/material/woodenshield
|
||||
name = "shield donut"
|
||||
@@ -140,14 +139,14 @@
|
||||
icon_state = "shield_fitting_inner"
|
||||
force_divisor = 0.1
|
||||
thrown_force_divisor = 0.1
|
||||
default_material = "wood"
|
||||
default_material = MATERIAL_WOOD
|
||||
|
||||
/obj/item/material/woodenshield/attackby(obj/item/attacking_item, mob/user)
|
||||
..()
|
||||
var/obj/item/finished
|
||||
if(istype(attacking_item, /obj/item/material/shieldbits))
|
||||
var/obj/item/material/woodenshield/donut = attacking_item
|
||||
finished = new /obj/item/shield/buckler(get_turf(user), donut.material.name)
|
||||
finished = new /obj/item/shield/buckler(get_turf(user), donut.material.type)
|
||||
to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src]."))
|
||||
if(finished)
|
||||
user.drop_from_inventory(src)
|
||||
@@ -164,7 +163,7 @@
|
||||
icon_state = "shield_fitting_outer"
|
||||
force_divisor = 0.1
|
||||
thrown_force_divisor = 0.1
|
||||
default_material = "steel"
|
||||
default_material = MATERIAL_STEEL
|
||||
|
||||
/obj/item/woodcirclet
|
||||
name = "wood circlet"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/obj/item/material/ashtray/persistent_objects_get_content()
|
||||
var/list/content = list()
|
||||
content["fill_count"] = length(contents)
|
||||
content["material"] = material.name
|
||||
content["material"] = material.type
|
||||
return content
|
||||
|
||||
/obj/item/material/ashtray/persistent_objects_apply_content(content, x, y, z)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
item_state = "metalbat"
|
||||
throwforce = 7
|
||||
attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked")
|
||||
default_material = "wood"
|
||||
default_material = MATERIAL_WOOD
|
||||
force_divisor = 1.1 // 22 when wielded with weight 20 (steel)
|
||||
unwielded_force_divisor = 0.7 // 15 when unwielded based on above.
|
||||
slot_flags = SLOT_BACK
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
icon_state = "rolling_pin"
|
||||
item_state = "rolling_pin"
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
|
||||
default_material = "wood"
|
||||
default_material = MATERIAL_WOOD
|
||||
force_divisor = 0.7 // 10 when wielded with weight 15 (wood)
|
||||
thrown_force_divisor = 1 // as above
|
||||
use_material_name = TRUE
|
||||
|
||||
@@ -22,7 +22,7 @@ Protectiveness | Armor %
|
||||
|
||||
/obj/item/clothing/suit/armor/material
|
||||
name = "armor"
|
||||
default_material = DEFAULT_WALL_MATERIAL
|
||||
default_material = MATERIAL_STEEL
|
||||
|
||||
/obj/item/clothing/suit/armor/material/makeshift
|
||||
name = "sheet armor"
|
||||
@@ -37,10 +37,10 @@ Protectiveness | Armor %
|
||||
pocket_slots = 1
|
||||
|
||||
/obj/item/clothing/suit/armor/material/makeshift/plasteel
|
||||
default_material = "plasteel"
|
||||
default_material = MATERIAL_PLASTEEL
|
||||
|
||||
/obj/item/clothing/suit/armor/material/makeshift/glass
|
||||
default_material = "glass"
|
||||
default_material = MATERIAL_GLASS
|
||||
|
||||
/obj/item/material/armor_plating
|
||||
name = "armor plating"
|
||||
@@ -75,7 +75,7 @@ Protectiveness | Armor %
|
||||
to_chat(user, SPAN_WARNING("Both plates need to be the same type of material."))
|
||||
return
|
||||
//TODO: Possible better animations
|
||||
var/obj/item/clothing/suit/armor/material/makeshift/new_armor = new(src.loc, src.material.name)
|
||||
var/obj/item/clothing/suit/armor/material/makeshift/new_armor = new(src.loc, src.material)
|
||||
user.drop_from_inventory(src,new_armor)
|
||||
user.drop_from_inventory(second_plate,new_armor)
|
||||
user.put_in_hands(new_armor)
|
||||
@@ -116,7 +116,7 @@ Protectiveness | Armor %
|
||||
var/obj/item/stack/material/S = attacking_item
|
||||
if(S.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You apply some [S.material.use_name] to \the [src]. "))
|
||||
var/obj/item/clothing/head/helmet/material/makeshift/helmet = new(null, S.material.name)
|
||||
var/obj/item/clothing/head/helmet/material/makeshift/helmet = new(null, S.material.type)
|
||||
user.put_in_hands(helmet)
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
@@ -129,7 +129,7 @@ Protectiveness | Armor %
|
||||
/obj/item/clothing/head/helmet/material
|
||||
name = "helmet"
|
||||
flags_inv = HIDEEARS|HIDEEYES|BLOCKHAIR
|
||||
default_material = DEFAULT_WALL_MATERIAL
|
||||
default_material = MATERIAL_STEEL
|
||||
has_storage = FALSE
|
||||
|
||||
/obj/item/clothing/head/helmet/material/makeshift
|
||||
@@ -141,7 +141,7 @@ Protectiveness | Armor %
|
||||
contained_sprite = 1
|
||||
|
||||
/obj/item/clothing/head/helmet/material/makeshift/plasteel
|
||||
default_material = "plasteel"
|
||||
default_material = MATERIAL_PLASTEEL
|
||||
|
||||
/obj/item/clothing/suit/armor/material/makeshift/trenchcoat
|
||||
name = "armored trenchcoat"
|
||||
@@ -156,7 +156,7 @@ Protectiveness | Armor %
|
||||
var/obj/item/clothing/suit/storage/toggle/trench/kelly = attacking_item
|
||||
user.drop_from_inventory(src)
|
||||
user.drop_from_inventory(kelly)
|
||||
var/obj/item/clothing/suit/armor/material/makeshift/trenchcoat/new_armor = new(null, src.material.name)
|
||||
var/obj/item/clothing/suit/armor/material/makeshift/trenchcoat/new_armor = new(null, src.material.type)
|
||||
user.put_in_hands(new_armor)
|
||||
qdel(src)
|
||||
qdel(kelly)
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
var/max_force = 40 //any damage above this is added to armor penetration value
|
||||
var/max_pen = 100 //any penetration above this value is ignored
|
||||
var/thrown_force_divisor = 0.5
|
||||
var/default_material = DEFAULT_WALL_MATERIAL
|
||||
var/material/material
|
||||
var/default_material = MATERIAL_STEEL
|
||||
var/singleton/material/material
|
||||
var/drops_debris = TRUE
|
||||
|
||||
/// Multiplies the amount this item is worth with the following calculation: material.value * worth_multiplier
|
||||
@@ -59,7 +59,7 @@
|
||||
throwforce = round(material.get_blunt_damage()*thrown_force_divisor)
|
||||
|
||||
/obj/item/material/proc/set_material(var/new_material)
|
||||
material = SSmaterials.get_material_by_name(new_material)
|
||||
material = GET_SINGLETON(new_material)
|
||||
if(!material)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
thrown_force_divisor = 0.4 // 4 with weight 15 (glass)
|
||||
item_state = "shard-glass"
|
||||
attack_verb = list("stabbed", "slashed", "sliced", "cut")
|
||||
default_material = "glass"
|
||||
default_material = MATERIAL_GLASS
|
||||
unbreakable = 1 //It's already broken.
|
||||
drops_debris = FALSE
|
||||
drop_sound = 'sound/effects/glass_step.ogg'
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
/obj/item/material/sword_hilt/attackby(obj/item/attacking_item, mob/user)
|
||||
if(istype(attacking_item, /obj/item/material/sword_blade))
|
||||
var/obj/item/material/sword_blade/blade = attacking_item
|
||||
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.name)
|
||||
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.type)
|
||||
new_sword.hilt = src
|
||||
user.drop_from_inventory(src,new_sword)
|
||||
user.drop_from_inventory(blade,new_sword)
|
||||
@@ -219,7 +219,7 @@
|
||||
/obj/item/material/sword_blade/attackby(obj/item/attacking_item, mob/user)
|
||||
if(istype(attacking_item, /obj/item/material/sword_hilt))
|
||||
var/obj/item/material/sword_hilt/hilt = attacking_item
|
||||
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, src.material.name)
|
||||
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, src.material.type)
|
||||
new_sword.hilt = hilt.material
|
||||
new_sword.assignDescription()
|
||||
user.drop_from_inventory(src,new_sword)
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
icon_state = "offhand"
|
||||
name = "offhand"
|
||||
default_material = "placeholder"
|
||||
default_material = MATERIAL_STEEL
|
||||
drop_sound = null
|
||||
pickup_sound = null
|
||||
equip_sound = null
|
||||
@@ -258,7 +258,7 @@
|
||||
sharp = 0
|
||||
mob_throw_hit_sound = 'sound/weapons/pierce.ogg'
|
||||
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
|
||||
default_material = "glass"
|
||||
default_material = MATERIAL_GLASS
|
||||
var/obj/item/grenade/explosive = null
|
||||
use_material_sound = FALSE
|
||||
worth_multiplier = 7 //blade + stuff
|
||||
@@ -290,7 +290,7 @@
|
||||
MA.layer = FLOAT_LAYER
|
||||
HS.AddOverlays(MA)
|
||||
HS.name = "[attacking_item.name] on a spear"
|
||||
HS.material = material.name
|
||||
HS.material = material.type
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -374,7 +374,7 @@
|
||||
attack_verb = list("chopped", "sliced", "shredded", "slashed", "cut", "ripped")
|
||||
can_embed = FALSE
|
||||
applies_material_colour = FALSE
|
||||
default_material = "steel"
|
||||
default_material = MATERIAL_STEEL
|
||||
parry_chance = 5
|
||||
var/fuel_type = /singleton/reagent/fuel
|
||||
var/opendelay = 30 // How long it takes to perform a door opening action with this chainsaw, in seconds.
|
||||
@@ -418,7 +418,7 @@
|
||||
fuel_cost = 0.5
|
||||
unbreakable = TRUE
|
||||
parry_chance = 100 //Gotta punish those validhunters
|
||||
default_material = "plasteel"
|
||||
default_material = MATERIAL_PLASTEEL
|
||||
|
||||
/obj/item/material/twohanded/chainsaw/op/Initialize()
|
||||
. = ..()
|
||||
@@ -560,7 +560,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
slot_flags = SLOT_BACK
|
||||
attack_verb = list("attacked", "poked", "jabbed", "gored", "stabbed")
|
||||
default_material = "steel"
|
||||
default_material = MATERIAL_STEEL
|
||||
reach = 2
|
||||
applies_material_colour = 0
|
||||
can_embed = 0
|
||||
@@ -599,7 +599,7 @@
|
||||
desc = "For the republic!"
|
||||
icon_state = "flag_biesel0"
|
||||
base_icon = "flag_biesel"
|
||||
default_material = "bronze"
|
||||
default_material = MATERIAL_STEEL
|
||||
can_embed = 1
|
||||
use_material_name = FALSE
|
||||
unbreakable = TRUE
|
||||
@@ -665,7 +665,7 @@
|
||||
edge = TRUE
|
||||
sharp = 1
|
||||
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
|
||||
default_material = "steel"
|
||||
default_material = MATERIAL_STEEL
|
||||
parry_chance = 60
|
||||
can_embed = 0
|
||||
worth_multiplier = 35
|
||||
|
||||
Reference in New Issue
Block a user