Skip to content

Commit

Permalink
MHEDP buff, SAC disarm, bullet & acid explosion
Browse files Browse the repository at this point in the history
  • Loading branch information
Nomoresolvalou committed Sep 14, 2024
1 parent d9df7cc commit ba26a86
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
4 changes: 4 additions & 0 deletions code/game/objects/effects/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
W.acid_spray_act()
continue

if(istype(atm, /obj/item/explosive/mine/sharp))
var/obj/item/explosive/mine/sharp/sharp_mine = atm
sharp_mine.prime()

// Humans?
if(isliving(atm)) //For extinguishing mobs on fire
var/mob/living/M = atm
Expand Down
47 changes: 40 additions & 7 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,39 @@
desc = "An experimental P9 SHARP proximity triggered explosive dart designed by Armat Systems for use by the United States Colonial Marines. This one has full 360 detection range."
icon_state = "sharp_explosive_mine"
angle = 360
health = 50
var/disarmed = FALSE
var/explosion_size = 100
var/explosion_falloff = 50
var/mine_level = 1
var/deploy_time = 0
var/mine_state = ""
var/timer_id

/obj/item/explosive/mine/sharp/proc/upgrade_mine()
mine_level++
icon_state = mine_state + "_[mine_level]"
if(mine_level < 4)
timer_id = addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/explosive/mine/sharp, upgrade_mine)), 30 SECONDS, TIMER_DELETE_ME | TIMER_STOPPABLE)

/obj/item/explosive/mine/sharp/check_for_obstacles(mob/living/user)
return FALSE

/obj/item/explosive/mine/sharp/attackby(obj/item/W, mob/user)
if(user.action_busy)
return
else if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL))
user.visible_message(SPAN_NOTICE("[user] starts disarming [src]."), \
SPAN_NOTICE("You start disarming [src]."))
if(!do_after(user, 30, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY))
user.visible_message(SPAN_WARNING("[user] stops disarming [src]."), \
SPAN_WARNING("You stop disarming [src]."))
return
if(!active)//someone beat us to it
return
user.visible_message(SPAN_NOTICE("[user] finishes disarming [src]."), \
SPAN_NOTICE("You finish disarming [src]."))
disarm()
return

/obj/item/explosive/mine/sharp/set_tripwire()
Expand All @@ -377,11 +395,14 @@
if(mine_level == 1)
explosion_size = 100
else if(mine_level == 2)
explosion_size = 115
explosion_size = 100
explosion_falloff = 25
else if(mine_level == 3)
explosion_size = 130
explosion_size = 125
explosion_falloff = 30
else
explosion_size = 145
explosion_size = 125
explosion_falloff = 25
cell_explosion(loc, explosion_size, explosion_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, CARDINAL_ALL_DIRS, cause_data)
playsound(loc, 'sound/weapons/gun_sharp_explode.ogg', 100)
qdel(src)
Expand All @@ -391,10 +412,13 @@
active = FALSE
triggered = FALSE
icon_state = "sharp_mine_disarmed"
desc = "A disarmed P9 SHARP rifle dart, useless now."
QDEL_NULL(tripwire)
disarmed = TRUE
deltimer(timer_id)
add_to_garbage(src)


/obj/item/explosive/mine/sharp/attack_self(mob/living/user)
if(disarmed)
return
Expand All @@ -406,7 +430,6 @@
if(!hard_iff_lock && user)
iff_signal = user.faction


cause_data = create_cause_data(initial(name), user)
if(user)
user.drop_inv_item_on_ground(src)
Expand All @@ -415,9 +438,7 @@
update_icon()
deploy_time = world.time
mine_state = icon_state
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/explosive/mine/sharp, upgrade_mine)), 30 SECONDS, TIMER_DELETE_ME)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/explosive/mine/sharp, upgrade_mine)), 60 SECONDS, TIMER_DELETE_ME)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/explosive/mine/sharp, upgrade_mine)), 90 SECONDS, TIMER_DELETE_ME)
timer_id = addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/explosive/mine/sharp, upgrade_mine)), 30 SECONDS, TIMER_DELETE_ME | TIMER_STOPPABLE)
for(var/mob/living/carbon/mob in range(1, src))
try_to_prime(mob)

Expand All @@ -427,6 +448,18 @@
else
return

//basically copy pasted from welding kit code
/obj/item/explosive/mine/sharp/bullet_act(obj/projectile/bullet)
var/damage = bullet.damage
health -= damage
..()
healthcheck()
return 1

/obj/item/explosive/mine/sharp/proc/healthcheck()
if(health <= 0)
src.prime()

/obj/item/explosive/mine/sharp/incendiary
name = "\improper P9 SHARP incendiary dart"
desc = "An experimental P9 SHARP proximity triggered explosive dart designed by Armat Systems for use by the United States Colonial Marines. This one has full 360 detection range."
Expand Down

0 comments on commit ba26a86

Please sign in to comment.