Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 59 additions & 28 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
icon_state = "m20"
force = 5
w_class = SIZE_SMALL
//layer = MOB_LAYER - 0.1 //You can't just randomly hide claymores under boxes. Booby-trapping bodies is fine though
layer = ABOVE_LYING_MOB_LAYER //You can't just randomly hide claymores under boxes. Booby-trapping bodies is fine though
throwforce = 5
throw_range = 6
throw_speed = SPEED_VERY_FAST
Expand All @@ -23,10 +23,15 @@
)
shrapnel_spread = 60
use_dir = TRUE

var/iff_signal = FACTION_MARINE
var/triggered = FALSE
var/hard_iff_lock = FALSE
var/obj/effect/mine_tripwire/tripwire
/// Whether this mine will ignore MOB_SIZE_XENO_VERY_SMALL or smaller xenos - only configureable if customizeable
var/ignore_small_xeno = FALSE
/// How many times a xeno projectile has hit this mine
var/spit_hit_count = 0

var/map_deployed = FALSE

Expand Down Expand Up @@ -61,6 +66,10 @@
to_chat(user, SPAN_WARNING("It's too cramped in here to deploy \a [src]."))
return TRUE

/obj/item/explosive/mine/get_examine_text(mob/user)
. = ..()
if(customizable && !isxeno(user))
. += " The sensitivity dial is turned [ignore_small_xeno ? "down" : "up"]"


//Arming
Expand Down Expand Up @@ -111,17 +120,16 @@
update_icon()


//Disarming
/obj/item/explosive/mine/attackby(obj/item/W, mob/user)
if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL))
/obj/item/explosive/mine/attackby(obj/item/tool, mob/user)
if(HAS_TRAIT(tool, TRAIT_TOOL_MULTITOOL))
if(active)
if(user.action_busy)
return
if(user.faction == iff_signal)
user.visible_message(SPAN_NOTICE("[user] starts disarming [src]."),
SPAN_NOTICE("You start disarming [src]."))
else
user.visible_message(SPAN_NOTICE("[user] starts fiddling with \the [src], trying to disarm it."),
user.visible_message(SPAN_NOTICE("[user] starts fiddling with [src], trying to disarm it."),
SPAN_NOTICE("You start disarming [src], but you don't know its IFF data. This might end badly..."))
if(!do_after(user, 30, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY))
user.visible_message(SPAN_WARNING("[user] stops disarming [src]."),
Expand All @@ -131,7 +139,7 @@
if(prob(75))
triggered = TRUE
if(tripwire)
var/direction = GLOB.reverse_dir[src.dir]
var/direction = GLOB.reverse_dir[dir]
var/step_direction = get_step(src, direction)
tripwire.forceMove(step_direction)
prime()
Expand All @@ -140,6 +148,16 @@
user.visible_message(SPAN_NOTICE("[user] finishes disarming [src]."),
SPAN_NOTICE("You finish disarming [src]."))
disarm()
else if(HAS_TRAIT(tool, TRAIT_TOOL_WIRECUTTERS))
if(customizable)
if(ignore_small_xeno)
to_chat(user, SPAN_NOTICE("You have reverted [src] to its original sensitivity."))
else
to_chat(user, SPAN_NOTICE("You have adjusted [src] to be less sensitive."))
ignore_small_xeno = !ignore_small_xeno
return
to_chat(user, SPAN_NOTICE("[src] has no sensitivity dial to adjust."))
return

else
return ..()
Expand Down Expand Up @@ -186,32 +204,32 @@


//Mine can also be triggered if you "cross right in front of it" (same tile)
/obj/item/explosive/mine/Crossed(atom/A)
/obj/item/explosive/mine/Crossed(atom/movable/target)
..()
if(isliving(A))
var/mob/living/L = A
if(!L.stat == DEAD)//so dragged corpses don't trigger mines.
return
else
try_to_prime(A)
try_to_prime(target)

/obj/item/explosive/mine/Collided(atom/movable/AM)
try_to_prime(AM)
/obj/item/explosive/mine/Collided(atom/movable/target)
try_to_prime(target)


/obj/item/explosive/mine/proc/try_to_prime(mob/living/L)
/obj/item/explosive/mine/proc/try_to_prime(mob/living/enemy)
if(!active || triggered || (customizable && !detonator))
return
if(!istype(L))
if(!istype(enemy))
return
if(L.stat == DEAD)
if(enemy.stat == DEAD)
return
if(L.get_target_lock(iff_signal))
if(ignore_small_xeno && isxeno(enemy))
var/mob/living/carbon/xenomorph/xeno = enemy
if(xeno.mob_size <= MOB_SIZE_XENO_VERY_SMALL)
return
if(enemy.get_target_lock(iff_signal))
return
if(HAS_TRAIT(L, TRAIT_ABILITY_BURROWED))
if(HAS_TRAIT(enemy, TRAIT_ABILITY_BURROWED))
return
L.visible_message(SPAN_DANGER("[icon2html(src, viewers(src))] The [name] clicks as [L] moves in front of it."),
SPAN_DANGER("[icon2html(src, L)] The [name] clicks as you move in front of it."),

enemy.visible_message(SPAN_DANGER("[icon2html(src, viewers(src))] The [name] clicks as [enemy] moves in front of it."),
SPAN_DANGER("[icon2html(src, enemy)] The [name] clicks as you move in front of it."),
SPAN_DANGER("You hear a click."))

triggered = TRUE
Expand All @@ -233,17 +251,21 @@
if(!QDELETED(src))
disarm()


/obj/item/explosive/mine/attack_alien(mob/living/carbon/xenomorph/M)
/obj/item/explosive/mine/attack_alien(mob/living/carbon/xenomorph/xeno)
if(triggered) //Mine is already set to go off
return XENO_NO_DELAY_ACTION

if(M.a_intent == INTENT_HELP)
to_chat(M, SPAN_XENONOTICE("If you hit this hard enough, it would probably explode."))
if(xeno.a_intent == INTENT_HELP)
to_chat(xeno, SPAN_XENONOTICE("If you hit this hard enough, it would probably explode."))
return XENO_NO_DELAY_ACTION

M.animation_attack_on(src)
M.visible_message(SPAN_DANGER("[M] has slashed [src]!"),
if(tripwire)
if(xeno.mob_size <= MOB_SIZE_XENO_VERY_SMALL)
to_chat(xeno, SPAN_XENONOTICE("Slashing that would be suicide!"))
return XENO_NO_DELAY_ACTION

xeno.animation_attack_on(src)
xeno.visible_message(SPAN_DANGER("[xeno] has slashed [src]!"),
SPAN_DANGER("You slash [src]!"))
playsound(loc, 'sound/weapons/slice.ogg', 25, 1)

Expand All @@ -264,6 +286,15 @@
if(!QDELETED(src))
disarm()

/obj/item/explosive/mine/bullet_act(obj/projectile/xeno_projectile)
if(!triggered && istype(xeno_projectile.ammo, /datum/ammo/xeno)) //xeno projectile
spit_hit_count++
if(spit_hit_count >= 2) // Check if hit two times
visible_message(SPAN_DANGER("[src] is hit by [xeno_projectile] and violently detonates!")) // Acid is hot for claymore
triggered = TRUE
prime()
if(!QDELETED(src))
disarm()

/obj/effect/mine_tripwire
name = "claymore tripwire"
Expand Down
19 changes: 11 additions & 8 deletions code/game/turfs/auto_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
/turf/open/auto_turf/insert_self_into_baseturfs()
baseturfs += type

/turf/open/auto_turf/is_weedable()//for da xenos
return FULLY_WEEDABLE

/turf/open/auto_turf/get_dirt_type()
return DIRT_TYPE_GROUND //automatically diggable I guess

Expand Down Expand Up @@ -166,6 +163,15 @@
icon_prefix = "snow"
layer_name = list("icy dirt", "shallow snow", "deep snow", "very deep snow", "rock filled snow")

/turf/open/auto_turf/snow/Initialize(mapload, ...)
. = ..()
is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE

/turf/open/auto_turf/snow/changing_layer(new_layer)
. = ..()
is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE


/turf/open/auto_turf/snow/insert_self_into_baseturfs()
baseturfs += /turf/open/auto_turf/snow/layer0

Expand All @@ -175,9 +181,6 @@
else
return DIRT_TYPE_GROUND

/turf/open/auto_turf/snow/is_weedable()
return bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE

/turf/open/auto_turf/snow/attackby(obj/item/I, mob/user)
//Light Stick
if(istype(I, /obj/item/lightstick))
Expand Down Expand Up @@ -351,9 +354,9 @@
/turf/open/auto_turf/shale/layer1
icon_state = "shale_1"
bleed_layer = 1
weedable = SEMI_WEEDABLE
is_weedable = SEMI_WEEDABLE

/turf/open/auto_turf/shale/layer2
icon_state = "shale_2"
bleed_layer = 2
weedable = SEMI_WEEDABLE
is_weedable = SEMI_WEEDABLE
5 changes: 3 additions & 2 deletions code/game/turfs/closed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@
icon = 'icons/turf/shuttle.dmi'
layer = ABOVE_TURF_LAYER

/turf/closed/shuttle/is_weedable()
return FULLY_WEEDABLE
/turf/closed/shuttle/Initialize(mapload)
. = ..()
is_weedable = FULLY_WEEDABLE

/turf/closed/shuttle/dropship
icon = 'icons/turf/walls/walls.dmi'
Expand Down
6 changes: 3 additions & 3 deletions code/game/turfs/floor_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@

/turf/open/floor/plating/almayer/no_build
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/plating/airless
icon_state = "plating"
Expand Down Expand Up @@ -1884,7 +1884,7 @@
desc = "There seems to be an awful lot of machinery down below..."
icon = 'icons/turf/floors/floors.dmi'
icon_state = "black"
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/almayer/empty/ex_act(severity) //Should make it indestructible
return
Expand Down Expand Up @@ -2148,7 +2148,7 @@
name = "hull"
turf_flags = TURF_HULL
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/almayer_hull/outerhull_dir
icon_state = "outerhull_dir"
Expand Down
14 changes: 4 additions & 10 deletions code/game/turfs/floors/desert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
/turf/open/desert/dirt
name = "desert"
icon_state = "desert1"

/turf/open/desert/dirt/is_weedable()
return FULLY_WEEDABLE
is_weedable = FULLY_WEEDABLE

/turf/open/desert/dirt/desert_transition_edge1
icon_state = "desert_transition_edge1"
Expand Down Expand Up @@ -86,9 +84,7 @@
/turf/open/desert/rock
name = "rock"
icon_state = "rock1"

/turf/open/desert/rock/is_weedable()
return FULLY_WEEDABLE
is_weedable = FULLY_WEEDABLE

/turf/open/desert/rock/edge1
name = "desert"
Expand Down Expand Up @@ -168,6 +164,7 @@
icon_state = "shore1"
var/toxic = 0
supports_surgery = FALSE
is_weedable = NOT_WEEDABLE

/turf/open/desert/desert_shore/update_icon()
..()
Expand All @@ -182,9 +179,6 @@
set_light(1)
icon = 'icons/turf/floors/desert_water_transition.dmi'

/turf/open/desert/desert_shore/is_weedable()
return NOT_WEEDABLE

/turf/open/desert/desert_shore/desert_shore1
name = "shore"
icon_state = "shore1"
Expand Down Expand Up @@ -324,7 +318,7 @@
icon_overlay = "_shallow"
var/toxic = 0
default_name = "water"
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/gm/river/desert/update_icon()
..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/hunter_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
icon = 'icons/turf/floors/hunter_floors.dmi'
icon_state = "outerhull"
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/predship/hull/non_weedable_hull
icon_state = "outerhull_dir"
Expand Down
6 changes: 3 additions & 3 deletions code/game/turfs/hybrisa.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
icon = 'icons/turf/floors/floors.dmi'
icon_state = "bcircuit"
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

// Engineer Ship Hull

Expand All @@ -187,7 +187,7 @@
icon = 'icons/turf/floors/engineership.dmi'
icon_state = "engineerwallfloor1"
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/hybrisa/engineership/ship_hull/non_weedable_hull
icon_state = "outerhull_dir"
Expand Down Expand Up @@ -1029,7 +1029,7 @@
desc = "A strange metal pillar, unlike any metal you've seen before."
icon_state = "eng_pillar1"
allow_construction = FALSE
weedable = NOT_WEEDABLE
is_weedable = NOT_WEEDABLE

/turf/open/floor/hybrisa/engineership/pillars/north/pillar1
icon_state = "eng_pillar1"
Expand Down
Loading
Loading