Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Deathmatch Modifiers Tweaks and Additions #2502

Merged
merged 1 commit into from
Mar 24, 2024
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
3 changes: 3 additions & 0 deletions code/game/objects/effects/forcefields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@

/obj/effect/forcefield/cosmic_field/fast
initial_duration = 5 SECONDS

/obj/effect/forcefield/cosmic_field/extrafast
initial_duration = 2.5 SECONDS
6 changes: 1 addition & 5 deletions code/modules/cargo/supplypod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@
/obj/structure/closet/supplypod/deadmatch_missile
name = "cruise missile"
desc = "A big ass missile, likely launched from some far-off deep space missile silo."
icon_state = "smissile"
decal = null
door = null
fin_mask = null
style = STYLE_RED_MISSILE
explosionSize = list(0,1,2,2)
effectShrapnel = TRUE
rubble_type = RUBBLE_THIN
specialised = TRUE
delays = list(POD_TRANSIT = 2.6 SECONDS, POD_FALLING = 0.4 SECONDS)
effectMissile = TRUE
Expand Down
107 changes: 87 additions & 20 deletions code/modules/deathmatch/deathmatch_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,92 @@
/datum/deathmatch_modifier/no_knockdown/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.add_traits(list(TRAIT_STUNIMMUNE, TRAIT_SLEEPIMMUNE), DEATHMATCH_TRAIT)

/datum/deathmatch_modifier/no_slowdown
name = "No Slowdowns"
description = "You're too slow!"

/datum/deathmatch_modifier/no_slowdown/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
ADD_TRAIT(player, TRAIT_IGNORESLOWDOWN, DEATHMATCH_TRAIT)

/datum/deathmatch_modifier/teleport
name = "Random Teleports"
description = "One moment I'm here, the next I'm there"
///A lazylist of lobbies that have this modifier enabled
var/list/signed_lobbies
///The cooldown to the teleportation effect.
COOLDOWN_DECLARE(teleport_cd)

/datum/deathmatch_modifier/teleport/on_select(datum/deathmatch_lobby/lobby)
if(isnull(signed_lobbies))
START_PROCESSING(SSprocessing, src)
LAZYADD(signed_lobbies, lobby)
RegisterSignal(lobby, COMSIG_QDELETING, PROC_REF(remove_lobby))

/datum/deathmatch_modifier/teleport/unselect(datum/deathmatch_lobby/lobby)
remove_lobby(lobby)

/datum/deathmatch_modifier/teleport/proc/remove_lobby(datum/deathmatch_lobby/lobby)
SIGNAL_HANDLER
LAZYREMOVE(signed_lobbies, lobby)
UnregisterSignal(lobby, COMSIG_QDELETING)
if(isnull(signed_lobbies))
STOP_PROCESSING(SSprocessing, src)

/datum/deathmatch_modifier/teleport/process(seconds_per_tick)
if(!COOLDOWN_FINISHED(src, teleport_cd))
return

for(var/datum/deathmatch_lobby/lobby as anything in signed_lobbies)
if(lobby.playing != DEATHMATCH_PLAYING || isnull(lobby.location))
continue
for(var/ckey in lobby.players)
var/mob/living/player = lobby.players[ckey]["mob"]
if(istype(player))
continue
var/turf/destination
for(var/attempt in 1 to 5)
var/turf/possible_destination = pick(lobby.location.reserved_turfs)
if(isopenturf(destination) && !isgroundlessturf(destination))
destination = possible_destination
break
if(isnull(destination))
continue
//I want this modifier to be compatible with 'Mounts' and 'Paraplegic' wheelchairs.
var/atom/movable/currently_buckled = player.buckled
do_teleport(player, destination, 0, asoundin = 'sound/effects/phasein.ogg', forced = TRUE)
if(currently_buckled && !currently_buckled.anchored)
do_teleport(currently_buckled, destination, 0, asoundin = 'sound/effects/phasein.ogg', forced = TRUE)
currently_buckled.buckle_mob(player)

COOLDOWN_START(src, teleport_cd, rand(12 SECONDS, 24 SECONDS))

/datum/deathmatch_modifier/snail_crawl
name = "Snail Crawl"
description = "Lube the floor as you slather it with your body"
blacklisted_modifiers = list(/datum/deathmatch_modifier/no_gravity)

/datum/deathmatch_modifier/snail_crawl/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.AddElement(/datum/element/snailcrawl)

/datum/deathmatch_modifier/blinking_and_breathing
name = "Manual Blinking/Breathing"
description = "Ruin everyone's fun by forcing them to breathe and blink manually"

/datum/deathmatch_modifier/blinking_and_breathing/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.AddComponent(/datum/component/manual_blinking)
player.AddComponent(/datum/component/manual_breathing)

/datum/deathmatch_modifier/forcefield_trail
name = "Forcefield Trail"
description = "You leave short-living unpassable forcefields in your wake"

/datum/deathmatch_modifier/forcefield_trail/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.AddElement(/datum/element/effect_trail, /obj/effect/forcefield/cosmic_field/extrafast)

/datum/deathmatch_modifier/xray
name = "X-Ray Vision"
description = "See through the cordons of the deathmatch arena!"
blacklisted_modifiers = list(/datum/deathmatch_modifier/thermal, /datum/deathmatch_modifier/echolocation)
blacklisted_modifiers = list(/datum/deathmatch_modifier/thermal)

/datum/deathmatch_modifier/xray/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
ADD_TRAIT(player, TRAIT_XRAY_VISION, DEATHMATCH_TRAIT)
Expand All @@ -96,7 +178,7 @@
/datum/deathmatch_modifier/thermal
name = "Thermal Vision"
description = "See mobs through walls"
blacklisted_modifiers = list(/datum/deathmatch_modifier/xray, /datum/deathmatch_modifier/echolocation)
blacklisted_modifiers = list(/datum/deathmatch_modifier/xray)

/datum/deathmatch_modifier/thermal/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
ADD_TRAIT(player, TRAIT_THERMAL_VISION, DEATHMATCH_TRAIT)
Expand All @@ -112,19 +194,10 @@
/datum/deathmatch_modifier/nearsightness
name = "Nearsightness"
description = "Oops, I forgot my glasses at home"
blacklisted_modifiers = list(/datum/deathmatch_modifier/echolocation)

/datum/deathmatch_modifier/nearsightness/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.become_nearsighted(DEATHMATCH_TRAIT)

/datum/deathmatch_modifier/echolocation
name = "Echolocation"
description = "On one hand, you're blind, but on the other..."
blacklisted_modifiers = list(/datum/deathmatch_modifier/nearsightness, /datum/deathmatch_modifier/xray, /datum/deathmatch_modifier/thermal)

/datum/deathmatch_modifier/echolocation/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.AddComponent(/datum/component/echolocation)

/datum/deathmatch_modifier/ocelot
name = "Ocelot"
description = "Shoot faster, with extra ricochet and less spread. You're pretty good!"
Expand Down Expand Up @@ -170,18 +243,19 @@
/datum/deathmatch_modifier/paraplegic
name = "Paraplegic"
description = "Wheelchairs. For. Everyone."
blacklisted_modifiers = list(/datum/deathmatch_modifier/mounts)

/datum/deathmatch_modifier/paraplegic/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.gain_trauma(/datum/brain_trauma/severe/paralysis/paraplegic, TRAUMA_RESILIENCE_ABSOLUTE)
///Mounts are being used. Do not spawn wheelchairs.
if(/datum/deathmatch_modifier/mounts in lobby.modifiers)
return
var/obj/vehicle/ridden/wheelchair/motorized/improved/wheels = new (player.loc)
wheels.setDir(player.dir)
wheels.buckle_mob(player)

/datum/deathmatch_modifier/mounts
name = "Mounts"
description = "A horse! A horse! My kingdom for a horse!"
blacklisted_modifiers = list(/datum/deathmatch_modifier/paraplegic)

/datum/deathmatch_modifier/mounts/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
///We do a bit of fun over balance here, some mounts may be better than others.
Expand Down Expand Up @@ -399,13 +473,6 @@
var/mine_path = pick(mines)
new mine_path (target_turf)

/datum/deathmatch_modifier/flipping
name = "Perma-Flipping"
description = "You're constantly flipping, however it's purely cosmetic"

/datum/deathmatch_modifier/flipping/apply(mob/living/carbon/player, datum/deathmatch_lobby/lobby)
player.SpinAnimation(speed = 0.9 SECONDS, loops = -1)

/datum/deathmatch_modifier/random
name = "Random Modifiers"
description = "Picks 3 to 5 random modifiers as the game is about to start"
Expand Down
Loading