diff --git a/code/game/machinery/_machines_base/machinery.dm b/code/game/machinery/_machines_base/machinery.dm index 5254230c680e4..aa91ce7c940f4 100644 --- a/code/game/machinery/_machines_base/machinery.dm +++ b/code/game/machinery/_machines_base/machinery.dm @@ -225,7 +225,7 @@ // If you don't call parent in this proc, you must make all appropriate checks yourself. // If you do, you must respect the return value. /obj/machinery/attack_hand(mob/user) - if((. = ..())) // Buckling, climbers; unlikely to return true. + if((. = ..())) // Buckling, climbers, punching on harm; unlikely to return true. return if(MUTATION_FERAL in user.mutations) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2) diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 5b29b7e5de572..da3dc9c416885 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -7,11 +7,13 @@ var/global/list/floor_light_cache = list() desc = "A backlit floor panel." layer = ABOVE_TILE_LAYER anchored = FALSE - use_power = POWER_USE_ACTIVE + use_power = POWER_USE_OFF idle_power_usage = 2 active_power_usage = 20 power_channel = LIGHT matter = list(MATERIAL_STEEL = 250, MATERIAL_GLASS = 250) + health_max = 5 + damage_hitsound = 'sound/effects/Glasshit.ogg' var/damaged var/default_light_power = 0.75 @@ -42,7 +44,7 @@ var/global/list/floor_light_cache = list() update_use_power(POWER_USE_OFF) queue_icon_update() visible_message(SPAN_NOTICE("\The [user] has [anchored ? "attached" : "detached"] \the [src].")) - else if(isWelder(W) && (damaged || MACHINE_IS_BROKEN(src))) + else if(isWelder(W) && (health_damaged() || MACHINE_IS_BROKEN(src))) var/obj/item/weldingtool/WT = W if(!WT.can_use(1, user)) return @@ -53,28 +55,19 @@ var/global/list/floor_light_cache = list() return visible_message(SPAN_NOTICE("\The [user] has repaired \the [src].")) set_broken(FALSE) - damaged = null + revive_health() else if(isWrench(W)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) to_chat(user, SPAN_NOTICE("You dismantle the floor light.")) new /obj/item/stack/material/steel(src.loc, 1) new /obj/item/stack/material/glass(src.loc, 1) qdel(src) - else if(W.force && user.a_intent == "hurt") - attack_hand(user) return -/obj/machinery/floor_light/physical_attack_hand(mob/user) - if(user.a_intent == I_HURT && !issmall(user)) - if(!isnull(damaged) && !MACHINE_IS_BROKEN(src)) - visible_message(SPAN_DANGER("\The [user] smashes \the [src]!")) - playsound(src, "shatter", 70, 1) - set_broken(TRUE) - else - visible_message(SPAN_DANGER("\The [user] attacks \the [src]!")) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) - if(isnull(damaged)) damaged = 0 - return TRUE +/obj/machinery/floor_light/on_death() + ..() + playsound(src, "shatter", 70, 1) + visible_message(SPAN_DANGER("\The [src] is smashed into many pieces!")) /obj/machinery/floor_light/interface_interact(mob/user) if(!CanInteract(user, DefaultTopicState())) @@ -113,7 +106,7 @@ var/global/list/floor_light_cache = list() /obj/machinery/floor_light/on_update_icon() ClearOverlays() if((use_power == POWER_USE_ACTIVE) && operable()) - if(isnull(damaged)) + if (!health_damaged()) var/cache_key = "floorlight-[default_light_colour]" if(!floor_light_cache[cache_key]) var/image/I = image("on") @@ -123,8 +116,7 @@ var/global/list/floor_light_cache = list() floor_light_cache[cache_key] = I AddOverlays(floor_light_cache[cache_key]) else - if(damaged == 0) //Needs init. - damaged = rand(1,4) + damaged = rand(1,4) var/cache_key = "floorlight-broken[damaged]-[default_light_colour]" if(!floor_light_cache[cache_key]) var/image/I = image("flicker[damaged]") @@ -133,23 +125,7 @@ var/global/list/floor_light_cache = list() I.layer = layer+0.001 floor_light_cache[cache_key] = I AddOverlays(floor_light_cache[cache_key]) - update_brightness() + if (MACHINE_IS_BROKEN(src)) + AddOverlays("broken") -/obj/machinery/floor_light/ex_act(severity) - switch(severity) - if(EX_ACT_DEVASTATING) - qdel(src) - if(EX_ACT_HEAVY) - if (prob(50)) - qdel(src) - else if(prob(20)) - set_broken(TRUE) - else - if(isnull(damaged)) - damaged = 0 - if(EX_ACT_LIGHT) - if (prob(5)) - qdel(src) - else if(isnull(damaged)) - damaged = 0 - return + update_brightness() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index d66ca6c18a56c..000d95e82aa55 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -256,7 +256,7 @@ var/attack_verb = "[pick(attack.attack_verb)]" if (!can_damage_health(damage, attack.get_damage_type())) - playsound(loc, attack.attack_sound, 25, TRUE, -1) + playsound(loc, use_weapon_hitsound? attack.attack_sound : damage_hitsound, 25, TRUE, -1) user.visible_message( SPAN_WARNING("\The [user] hits \the [src], but doesn't even leave a dent!"), SPAN_WARNING("You hit \the [src], but cause no visible damage and hurt yourself!") @@ -264,13 +264,13 @@ user.apply_damage(3, DAMAGE_BRUTE, user.hand ? BP_L_HAND : BP_R_HAND) return TRUE - playsound(loc, attack.attack_sound, 25, TRUE, -1) + playsound(loc, use_weapon_hitsound? attack.attack_sound : damage_hitsound, 25, TRUE, -1) assailant.visible_message( SPAN_WARNING("\The [assailant] [attack_verb] \the [src]!"), SPAN_WARNING("You [attack_verb] \the [src]!") ) damage_health(damage, attack.get_damage_type(), attack.damage_flags()) - return + return TRUE ..() /obj/is_fluid_pushable(amt) diff --git a/icons/obj/machines/floor_light.dmi b/icons/obj/machines/floor_light.dmi index 3b435c5300191..8c7b0ee93b76c 100644 Binary files a/icons/obj/machines/floor_light.dmi and b/icons/obj/machines/floor_light.dmi differ