Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Sep 9, 2023
1 parent 2cd878e commit 8503d8a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
#include "code\__DEFINES\materials\helpers.dm"
#include "code\__DEFINES\materials\misc.dm"
#include "code\__DEFINES\materials\parts.dm"
#include "code\__DEFINES\materials\stats.dm"
#include "code\__DEFINES\mining\legacy.dm"
#include "code\__DEFINES\misc\message_ranges.dm"
#include "code\__DEFINES\mobs\actions.dm"
Expand Down
7 changes: 7 additions & 0 deletions code/__DEFINES/materials/stats.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#define MATERIAL_MELEE_STATS_DAMAGE 1
#define MATERIAL_MELEE_STATS_FLAG 2
#define MATERIAL_MELEE_STATS_TIER 3
#define MATERIAL_MELEE_STATS_MODE 4

#define MATERIAL_MELEE_STATS_LISTLEN 4
22 changes: 7 additions & 15 deletions code/game/objects/items/weapons/material/material.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_material.dmi',
)
material_parts = /datum/material/steel
material_costs = 4000
material_costs = SHEET_MATERIAL_AMOUNT * 2

/// applies material color
var/material_color = TRUE
/// material significance
Expand Down Expand Up @@ -46,24 +47,19 @@

/obj/item/material/update_material_single(datum/material/material)
. = ..()
#warn ticking stuff
var/needs_ticking = MATERIAL_NEEDS_PROCESSING(material)
var/is_ticking = atom_flags & ATOM_MATERIALS_TICKING
if(needs_ticking && !is_ticking)
START_TICKING_MATERIALS(src)
else if(!needs_ticking && is_ticking)
STOP_TICKING_MATERIALS(src)

if(material_color)
color = material.icon_colour
else
color = null
siemens_coefficient = material.relative_conductivity
atom_flags = (atom_flags & ~(NOCONDUCT)) | (material.relative_conductivity == 0? NOCONDUCT : NONE)
name = "[material.display_name] [initial(name)]"
var/list/returned = material.melee_stats(initial(damage_mode))

#warn impl
var/list/returned = material.melee_stats(initial(damage_mode))
damage_force = returned[MATERIAL_MELEE_STATS_DAMAGE]
damage_mode = returned[MATERIAL_MELEE_STATS_MODE]
damage_flag = returned[MATERIAL_MELEE_STATS_FLAG]
damage_tier = returned[MATERIAL_MELEE_STATS_TIER]

/obj/item/material/proc/update_force()
if(no_force_calculations)
Expand All @@ -77,10 +73,6 @@
damage_force = round(damage_force*dulled_divisor)
throw_force = round(material.get_blunt_damage()*thrown_force_divisor)

/obj/item/material/proc/set_material(datum/material/new_material)
health = round(material.integrity/10)
update_force()

/obj/item/material/melee_mob_hit(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent)
. = ..()
MATERIAL_INVOKE(src, MATERIAL_TRAIT_ATTACK, target, target_zone, src, ATTACK_TYPE_MELEE)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/materials/dynamics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
* autodetect with initial damage modes of item
* alternatively forced modes can be specified via the param
*
* @return list(damage, armorflag, tier, mode, throwforce, throwspeed)
* @return list(damage, armorflag, tier, mode)
*/
/datum/material/proc/melee_stats(initial_modes, multiplier = 1)
. = new /list(MATERIAL_MELEE_STATS_LISTLEN)
#warn impl - this requires caching

2 changes: 1 addition & 1 deletion code/modules/xenoarcheaology/finds/find_spawning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
))
var/obj/item/material/MW = new_item
MW.material_color = TRUE
MW.set_material(new_item_mat)
MW.set_material_part(MATERIAL_PART_DEFAULT, new_item_mat)
if(istype(MW, /obj/item/material/twohanded))
var/obj/item/material/twohanded/TH = MW
TH.force_unwielded *= 0.7
Expand Down

0 comments on commit 8503d8a

Please sign in to comment.