Skip to content

Commit

Permalink
Makes grenades peak (#16666)
Browse files Browse the repository at this point in the history
Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
Lumipharon and TiviPlus authored Oct 15, 2024
1 parent f2e57ed commit fd0d71f
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions code/game/objects/items/explosives/grenades/grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@
if(user.throw_item(target))
user.changeNext_move(CLICK_CD_THROWING)

/obj/item/explosive/grenade/update_overlays()
. = ..()
if(active && dangerous)
. += new /obj/effect/overlay/danger

/obj/item/explosive/grenade/fire_act(burn_level)
activate()

///Activates the grenade
/obj/item/explosive/grenade/proc/activate(mob/user)
if(active)
return
Expand All @@ -86,19 +95,20 @@
addtimer(CALLBACK(src, PROC_REF(prime)), det_time)
return TRUE

/obj/item/explosive/grenade/update_overlays()
. = ..()
if(active && dangerous)
. += new /obj/effect/overlay/danger


///Detonation effects
/obj/item/explosive/grenade/proc/prime()
if(ishuman(loc))
var/mob/living/carbon/human/idiot = loc
if(idiot.l_hand == src)
idiot.amputate_limb(BODY_ZONE_PRECISE_L_HAND)
else if(idiot.r_hand == src)
idiot.amputate_limb(BODY_ZONE_PRECISE_R_HAND)
idiot.visible_message(span_danger("[idiot]'s hand is blown into tiny pieces by [src]!"),
span_userdanger("You feel incredible pain and stupidity as [src] blows your hand up."))
idiot.emote("scream")
explosion(loc, light_impact_range = src.light_impact_range, weak_impact_range = src.weak_impact_range)
qdel(src)

/obj/item/explosive/grenade/fire_act(burn_level)
activate()

///Adjusts det time, used for grenade launchers
/obj/item/explosive/grenade/proc/launched_det_time()
det_time = min(10, det_time)
det_time = min(1 SECONDS, det_time)

0 comments on commit fd0d71f

Please sign in to comment.