mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
hammer fix (#17863)
This commit is contained in:
@@ -996,7 +996,7 @@
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
actions_types = list(/datum/action/item_action/charge_hammer)
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_color = LIGHT_COLOR_LIGHT_CYAN
|
||||
light_color = LIGHT_COLOR_HALOGEN
|
||||
light_range = 2
|
||||
light_power = 2
|
||||
var/datum/effect_system/spark_spread/spark_system //It's a surprise tool that'll help us later
|
||||
@@ -1008,6 +1008,7 @@
|
||||
spark_system = new
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
set_light_on(FALSE)
|
||||
|
||||
/obj/item/twohanded/vxtvulhammer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
if(attack_type == PROJECTILE_ATTACK || !wielded) //Doesn't work against ranged or if it's not wielded
|
||||
@@ -1054,7 +1055,7 @@
|
||||
force = initial(force) + (wielded ? force_wielded : 0) + 12 //12 additional damage for a total of 40 has to be a massively irritating check because of how force_wielded works
|
||||
armour_penetration = 100
|
||||
else
|
||||
set_light_on(TRUE)
|
||||
set_light_on(FALSE)
|
||||
force = initial(force) + (wielded ? force_wielded : 0)
|
||||
armour_penetration = initial(armour_penetration)
|
||||
update_icon()
|
||||
@@ -1091,11 +1092,13 @@
|
||||
return
|
||||
if(isfloorturf(target)) //So you don't just lose your supercharge if you miss and wack the floor. No I will NOT let people space with this thing
|
||||
return
|
||||
|
||||
if(charging) //Needs a special snowflake check if you hit something that isn't a mob
|
||||
if(ismachinery(target) || isstructure(target) || ismecha(target))
|
||||
to_chat(user, span_notice("You flip the switch off after your blow."))
|
||||
user.visible_message(span_warning("[user] flicks the hammer off after striking [target]!"))
|
||||
charging = FALSE
|
||||
|
||||
if(supercharged)
|
||||
var/turf/target_turf = get_turf(target) //Does the nice effects first so whatever happens to what's about to get clapped doesn't affect it
|
||||
var/obj/effect/temp_visual/kinetic_blast/K = new /obj/effect/temp_visual/kinetic_blast(target_turf)
|
||||
@@ -1103,6 +1106,7 @@
|
||||
playsound(loc, 'sound/effects/gravhit.ogg', 80, TRUE) //Mainly this sound
|
||||
playsound(loc, 'sound/effects/explosion3.ogg', 20, TRUE) //Bit of a reverb
|
||||
supercharge() //At start so it doesn't give an unintentional message if you hit yourself
|
||||
|
||||
if(ismachinery(target))
|
||||
var/obj/machinery/machine = target
|
||||
machine.take_damage(machine.max_integrity * 2) //Should destroy machines in one hit
|
||||
@@ -1115,23 +1119,27 @@
|
||||
for(var/obj/structure/light_construct/light in target_turf) //Also light frames because why not
|
||||
light.take_damage(light.max_integrity * 2)
|
||||
user.visible_message(span_danger("The hammer thunders against the [target.name], demolishing it!"))
|
||||
if(isstructure(target))
|
||||
|
||||
else if(isstructure(target))
|
||||
var/obj/structure/struct = target
|
||||
struct.take_damage(struct.max_integrity * 2) //Destroy structures in one hit too
|
||||
if(istype(target, /obj/structure/table))
|
||||
for(var/obj/structure/table_frame/platform in target_turf)
|
||||
platform.take_damage(platform.max_integrity * 2) //Destroys table frames left behind
|
||||
user.visible_message(span_danger("The hammer thunders against the [target.name], destroying it!"))
|
||||
if(iswallturf(target))
|
||||
|
||||
else if(iswallturf(target))
|
||||
var/turf/closed/wall/fort = target
|
||||
fort.dismantle_wall(1) //Deletes the wall but drop the materials, just like destroying a machine above
|
||||
user.visible_message(span_danger("The hammer thunders against the [target.name], shattering it!"))
|
||||
playsound(loc, 'sound/effects/meteorimpact.ogg', 50, TRUE) //Otherwise there's no sound for hitting the wall, since it's just dismantled
|
||||
if(ismecha(target))
|
||||
|
||||
else if(ismecha(target))
|
||||
var/obj/mecha/mech = target
|
||||
mech.take_damage(mech.max_integrity/3) //A third of its max health is dealt as an untyped damage, in addition to the normal damage of the weapon (which has high AP)
|
||||
user.visible_message(span_danger("The hammer thunders as it massively dents the plating of the [target.name]!"))
|
||||
if(isliving(target))
|
||||
|
||||
else if(isliving(target))
|
||||
var/atom/throw_target = get_edge_target_turf(target, user.dir)
|
||||
var/mob/living/victim = target
|
||||
victim.throw_at(throw_target, 15, 5) //Same distance as maxed out power fist with three extra force
|
||||
|
||||
Reference in New Issue
Block a user