Skip to content

Commit

Permalink
[MIRROR] Fixes C4 and runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelbassil authored and SierraHelper committed Dec 15, 2023
1 parent be8b9be commit 1663c22
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
17 changes: 11 additions & 6 deletions code/game/objects/items/weapons/explosives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,27 @@

/obj/item/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(user.get_active_hand() == src)
if (newtime < 10)
to_chat(user, SPAN_WARNING("You cannot set the timer to be less than 10 seconds."))
return

if (user.get_active_hand() == src)
newtime = clamp(newtime, 10, 60000)
timer = newtime
to_chat(user, "Timer set for [timer] seconds.")

/obj/item/plastique/use_after(atom/target, mob/living/user, click_parameters)
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/storage) || istype(target, /obj/item/clothing/accessory/storage) || istype(target, /obj/item/clothing/under))
/obj/item/plastique/use_after(atom/clicked, mob/living/user, click_parameters)
if (ismob(clicked) || istype(clicked, /turf/unsimulated) || istype(clicked, /turf/simulated/shuttle) || istype(clicked, /obj/item/clothing/accessory/storage) || istype(clicked, /obj/item/clothing/under))
return FALSE

to_chat(user, "Planting explosives...")
user.do_attack_animation(target)
user.do_attack_animation(clicked)

if(do_after(user, 5 SECONDS, target, DO_DEFAULT | DO_USER_UNIQUE_ACT) && in_range(user, target))
if(do_after(user, 5 SECONDS, clicked, DO_DEFAULT | DO_USER_UNIQUE_ACT) && in_range(user, clicked))
if(!user.unequip_item())
FEEDBACK_UNEQUIP_FAILURE(user, src)
return TRUE
target = target
target = clicked
forceMove(null)

if (ismob(target))
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/weapons/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@
/obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/TT)
if(istype(hit_atom,/mob/living))
apply_hit_effect(hit_atom, hit_zone = ran_zone(TT.target_zone, 30))//more likely to hit the zone you target!
else
..()
..()

/obj/item/melee/baton/proc/set_status(newstatus, mob/user)
if(bcell && bcell.charge >= hitcost)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/living_health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
if (DAMAGE_BRAIN)
adjustBrainLoss(damage)
else
apply_damage(damage, damage_type, def_zone, damage_flags, used_weapon, used_weapon.armor_penetration, TRUE)
if (used_weapon)
apply_damage(damage, damage_type, def_zone, damage_flags, used_weapon, used_weapon.armor_penetration, TRUE)
else
apply_damage(damage, damage_type, def_zone, damage_flags, silent = TRUE)
return prior_death_state != health_dead()


Expand Down

0 comments on commit 1663c22

Please sign in to comment.