diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index e930c77c36..d8bfbd0353 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -259,9 +259,9 @@ status_type = STATUS_EFFECT_REPLACE alert_type = null var/mutable_appearance/marked_underlay - var/obj/item/twohanded/required/kinetic_crusher/hammer_synced + var/obj/item/twohanded/kinetic_crusher/hammer_synced -/datum/status_effect/crusher_mark/on_creation(mob/living/new_owner, obj/item/twohanded/required/kinetic_crusher/new_hammer_synced) +/datum/status_effect/crusher_mark/on_creation(mob/living/new_owner, obj/item/twohanded/kinetic_crusher/new_hammer_synced) . = ..() if(.) hammer_synced = new_hammer_synced diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 82bf2c6b5f..96b7f7bd31 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -35,7 +35,7 @@ if(!wielded || !user) return wielded = 0 - if(force_unwielded) + if(!isnull(force_unwielded)) force = force_unwielded var/sf = findtext(name," (Wielded)") if(sf) diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index b4afaac17f..e055eff631 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -1,42 +1,43 @@ /*********************Mining Hammer****************/ -/obj/item/twohanded/required/kinetic_crusher +/obj/item/twohanded/kinetic_crusher icon = 'icons/obj/mining.dmi' - icon_state = "mining_hammer1" - item_state = "mining_hammer1" + icon_state = "crusher" + item_state = "crusher0" lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi' name = "proto-kinetic crusher" desc = "An early design of the proto-kinetic accelerator, it is little more than an combination of various mining tools cobbled together, forming a high-tech club. \ While it is an effective mining tool, it did little to aid any but the most skilled and/or suicidal miners against local fauna." - force = 20 //As much as a bone spear, but this is significantly more annoying to carry around due to requiring the use of both hands at all times + force = 0 //You can't hit stuff unless wielded w_class = WEIGHT_CLASS_BULKY slot_flags = ITEM_SLOT_BACK - force_unwielded = 20 //It's never not wielded so these are the same + force_unwielded = 0 force_wielded = 20 throwforce = 5 throw_speed = 4 - light_range = 7 - light_power = 2 armour_penetration = 10 materials = list(MAT_METAL=1150, MAT_GLASS=2075) hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("smashed", "crushed", "cleaved", "chopped", "pulped") sharpness = IS_SHARP + actions_types = list(/datum/action/item_action/toggle_light) var/list/trophies = list() var/charged = TRUE var/charge_time = 15 var/detonation_damage = 50 var/backstab_bonus = 30 + var/light_on = FALSE + var/brightness_on = 7 -/obj/item/twohanded/required/kinetic_crusher/Initialize() +/obj/item/twohanded/kinetic_crusher/Initialize() . = ..() AddComponent(/datum/component/butchering, 60, 110) //technically it's huge and bulky, but this provides an incentive to use it -/obj/item/twohanded/required/kinetic_crusher/Destroy() +/obj/item/twohanded/kinetic_crusher/Destroy() QDEL_LIST(trophies) return ..() -/obj/item/twohanded/required/kinetic_crusher/examine(mob/living/user) +/obj/item/twohanded/kinetic_crusher/examine(mob/living/user) ..() to_chat(user, "Mark a large creature with the destabilizing force, then hit them in melee to do [force + detonation_damage] damage.") to_chat(user, "Does [force + detonation_damage + backstab_bonus] damage if the target is backstabbed, instead of [force + detonation_damage].") @@ -44,7 +45,7 @@ var/obj/item/crusher_trophy/T = t to_chat(user, "It has \a [T] attached, which causes [T.effect_desc()].") -/obj/item/twohanded/required/kinetic_crusher/attackby(obj/item/I, mob/living/user) +/obj/item/twohanded/kinetic_crusher/attackby(obj/item/I, mob/living/user) if(istype(I, /obj/item/crowbar)) if(LAZYLEN(trophies)) to_chat(user, "You remove [src]'s trophies.") @@ -60,7 +61,11 @@ else return ..() -/obj/item/twohanded/required/kinetic_crusher/attack(mob/living/target, mob/living/carbon/user) +/obj/item/twohanded/kinetic_crusher/attack(mob/living/target, mob/living/carbon/user) + if(!wielded) + to_chat(user, "[src] is too heavy to use with one hand. You fumble and drop everything.") + user.drop_all_held_items() + return var/datum/status_effect/crusher_damage/C = target.has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING) var/target_health = target.health ..() @@ -71,11 +76,13 @@ 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/twohanded/required/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams) +/obj/item/twohanded/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams) . = ..() if(istype(target, /obj/item/crusher_trophy)) var/obj/item/crusher_trophy/T = target T.add_to(src, user) + if(!wielded) + return if(!proximity_flag && charged)//Mark a target, or mine a tile. var/turf/proj_turf = user.loc if(!isturf(proj_turf)) @@ -122,12 +129,37 @@ if(user && lavaland_equipment_pressure_check(get_turf(user))) //CIT CHANGE - makes sure below only happens in low pressure environments user.adjustStaminaLoss(-30)//CIT CHANGE - makes crushers heal stamina -/obj/item/twohanded/required/kinetic_crusher/proc/Recharge() +/obj/item/twohanded/kinetic_crusher/proc/Recharge() if(!charged) charged = TRUE icon_state = "mining_hammer1" playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1) +/obj/item/twohanded/kinetic_crusher/ui_action_click(mob/user, actiontype) + light_on = !light_on + playsound(user, 'sound/weapons/empty.ogg', 100, TRUE) + update_brightness(user) + update_icon() + +/obj/item/twohanded/kinetic_crusher/proc/update_brightness(mob/user = null) + if(light_on) + set_light(brightness_on) + else + set_light(0) + +/obj/item/twohanded/kinetic_crusher/update_icon() + ..() + cut_overlays() + if(!charged) + add_overlay("[icon_state]_uncharged") + if(light_on) + add_overlay("[icon_state]_lit") + spawn(1) + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + item_state = "crusher[wielded]" + //destablizing force /obj/item/projectile/destabilizer name = "destabilizing force" @@ -138,7 +170,7 @@ flag = "bomb" range = 6 log_override = TRUE - var/obj/item/twohanded/required/kinetic_crusher/hammer_synced + var/obj/item/twohanded/kinetic_crusher/hammer_synced /obj/item/projectile/destabilizer/Destroy() hammer_synced = null @@ -177,12 +209,12 @@ return "errors" /obj/item/crusher_trophy/attackby(obj/item/A, mob/living/user) - if(istype(A, /obj/item/twohanded/required/kinetic_crusher)) + if(istype(A, /obj/item/twohanded/kinetic_crusher)) add_to(A, user) else ..() -/obj/item/crusher_trophy/proc/add_to(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/proc/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user) for(var/t in H.trophies) var/obj/item/crusher_trophy/T = t if(istype(T, denied_type) || istype(src, T.denied_type)) @@ -194,7 +226,7 @@ to_chat(user, "You attach [src] to [H].") return TRUE -/obj/item/crusher_trophy/proc/remove_from(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/proc/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user) forceMove(get_turf(H)) H.trophies -= src return TRUE @@ -281,12 +313,12 @@ /obj/item/crusher_trophy/legion_skull/effect_desc() return "a kinetic crusher to recharge [bonus_value*0.1] second\s faster" -/obj/item/crusher_trophy/legion_skull/add_to(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/legion_skull/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user) . = ..() if(.) H.charge_time -= bonus_value -/obj/item/crusher_trophy/legion_skull/remove_from(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/legion_skull/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user) . = ..() if(.) H.charge_time += bonus_value @@ -339,7 +371,7 @@ /obj/item/crusher_trophy/demon_claws/effect_desc() return "melee hits to do [bonus_value * 0.2] more damage and heal you for [bonus_value * 0.1], with 5X effect on mark detonation" -/obj/item/crusher_trophy/demon_claws/add_to(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/demon_claws/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user) . = ..() if(.) H.force += bonus_value * 0.2 @@ -347,7 +379,7 @@ H.force_wielded += bonus_value * 0.2 H.detonation_damage += bonus_value * 0.8 -/obj/item/crusher_trophy/demon_claws/remove_from(obj/item/twohanded/required/kinetic_crusher/H, mob/living/user) +/obj/item/crusher_trophy/demon_claws/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user) . = ..() if(.) H.force -= bonus_value * 0.2 diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 38d2e3e100..5a48538161 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -30,7 +30,7 @@ new /datum/data/mining_equipment("500 Point Transfer Card", /obj/item/card/mining_point_card/mp500, 500), new /datum/data/mining_equipment("Tracking Implant Kit", /obj/item/storage/box/minertracker, 600), new /datum/data/mining_equipment("Jaunter", /obj/item/wormhole_jaunter, 750), - new /datum/data/mining_equipment("Kinetic Crusher", /obj/item/twohanded/required/kinetic_crusher, 750), + new /datum/data/mining_equipment("Kinetic Crusher", /obj/item/twohanded/kinetic_crusher, 750), new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/gun/energy/kinetic_accelerator, 750), new /datum/data/mining_equipment("Survival Medipen", /obj/item/reagent_containers/hypospray/medipen/survival, 750), new /datum/data/mining_equipment("Brute First-Aid Kit", /obj/item/storage/firstaid/brute, 800), @@ -172,7 +172,7 @@ new /obj/item/stack/marker_beacon/thirty(drop_location) if("Crusher Kit") new /obj/item/extinguisher/mini(drop_location) - new /obj/item/twohanded/required/kinetic_crusher(drop_location) + new /obj/item/twohanded/kinetic_crusher(drop_location) if("Mining Conscription Kit") new /obj/item/storage/backpack/duffelbag/mining_conscript(drop_location) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 301b270e36..d62f59cdd7 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -127,7 +127,7 @@ var/client/C = L.client SSmedals.UnlockMedal("Boss [BOSS_KILL_MEDAL]", C) SSmedals.UnlockMedal("[medaltype] [BOSS_KILL_MEDAL]", C) - if(crusher_kill && istype(L.get_active_held_item(), /obj/item/twohanded/required/kinetic_crusher)) + if(crusher_kill && istype(L.get_active_held_item(), /obj/item/twohanded/kinetic_crusher)) SSmedals.UnlockMedal("[medaltype] [BOSS_KILL_MEDAL_CRUSHER]", C) SSmedals.SetScore(BOSS_SCORE, C, 1) SSmedals.SetScore(score_type, C, 1) diff --git a/icons/mob/inhands/weapons/hammers_lefthand.dmi b/icons/mob/inhands/weapons/hammers_lefthand.dmi index 0ea340f1f3..306fd0db8a 100644 Binary files a/icons/mob/inhands/weapons/hammers_lefthand.dmi and b/icons/mob/inhands/weapons/hammers_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/hammers_righthand.dmi b/icons/mob/inhands/weapons/hammers_righthand.dmi index dbe34513ea..674e4d510b 100644 Binary files a/icons/mob/inhands/weapons/hammers_righthand.dmi and b/icons/mob/inhands/weapons/hammers_righthand.dmi differ