diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 0ef043446c2..8ecbddf8641 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -455,6 +455,54 @@ last_piece = NC return TRUE +/obj/item/mecha_parts/mecha_equipment/mech_crusher + name = "exosuit crusher" + desc = "A mech mounted crusher. For crushing bigger things." + icon_state = "mecha_crusher" + equip_cooldown = 15 + energy_drain = 3000 + harmful = TRUE + range = MECHA_MELEE | MECHA_RANGED + var/obj/item/kinetic_crusher/mecha/internal_crusher + +/obj/item/kinetic_crusher/mecha + force = 15 + force_wielded = 30 + armour_penetration_flat = 15 + detonation_damage = 90 + backstab_bonus = 50 + +/obj/item/kinetic_crusher/mecha/get_turf_for_projectile(atom/user) + if(ismecha(user.loc) && isturf(user.loc?.loc)) + return user.loc.loc + return null + +/obj/item/kinetic_crusher/mecha/Initialize(mapload) + . = ..() + var/datum/component/unwanted = GetComponent(/datum/component/parry) + unwanted?.RemoveComponent() + unwanted = GetComponent(/datum/component/two_handed) + unwanted?.RemoveComponent() + ADD_TRAIT(src, TRAIT_WIELDED, "mech[UID()]") + +/obj/item/mecha_parts/mecha_equipment/mech_crusher/Initialize(mapload) + . = ..() + internal_crusher = new(src) + +/obj/item/mecha_parts/mecha_equipment/mech_crusher/Destroy() + QDEL_NULL(internal_crusher) + . = ..() + +/obj/item/mecha_parts/mecha_equipment/mech_crusher/action(atom/target) + if(!action_checks(target)) + return + if(!chassis.occupant) + return + var/proximate = chassis.Adjacent(target) + if(ismob(target)) + internal_crusher.attack(target, chassis.occupant) + internal_crusher.afterattack(target, chassis.occupant, proximate, null) + #undef MECH_RCD_MODE_DECONSTRUCT #undef MECH_RCD_MODE_WALL_OR_FLOOR #undef MECH_RCD_MODE_AIRLOCK diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index 0ea3a5eb913..3442e7e9853 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -99,6 +99,10 @@ if(!QDELETED(C) && !QDELETED(target)) C.total_damage += target_health - target.health //we did some damage, but let's not assume how much we did +/obj/item/kinetic_crusher/proc/get_turf_for_projectile(atom/user) + if(ismob(user) && isturf(user.loc)) + return user.loc + /obj/item/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams) . = ..() if(!HAS_TRAIT(src, TRAIT_WIELDED)) @@ -112,7 +116,7 @@ user.remove_status_effect(STATUS_EFFECT_DASH) return if(!proximity_flag && charged)//Mark a target, or mine a tile. - var/turf/proj_turf = user.loc + var/turf/proj_turf = get_turf_for_projectile(user) if(!isturf(proj_turf)) return var/obj/item/projectile/destabilizer/D = new /obj/item/projectile/destabilizer(proj_turf) diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm index 3173b650dba..92b1f19de11 100644 --- a/code/modules/research/designs/mechfabricator_designs.dm +++ b/code/modules/research/designs/mechfabricator_designs.dm @@ -615,6 +615,15 @@ construction_time = 10 SECONDS category = list("Exosuit Equipment") +/datum/design/mech_crusher + name = "Exosuit Mining Equipment (Mounted crusher)" + id = "mech_crusher" + build_type = MECHFAB + build_path = /obj/item/mecha_parts/mecha_equipment/mech_crusher + materials = list(MAT_METAL= 23000, MAT_TITANIUM = 8000) + construction_time = 25 SECONDS + category = list("Exosuit Equipment") + /datum/design/mech_extinguisher name = "Exosuit Engineering Equipment (Extinguisher)" id = "mech_extinguisher" diff --git a/icons/mecha/mecha_equipment.dmi b/icons/mecha/mecha_equipment.dmi index d512a3424d4..50c0338d831 100644 Binary files a/icons/mecha/mecha_equipment.dmi and b/icons/mecha/mecha_equipment.dmi differ