Skip to content

Commit

Permalink
[MIRROR] Deathmatch Modifiers Tweaks and Additions (#1561)
Browse files Browse the repository at this point in the history
* Deathmatch Modifiers Tweaks and Additions (#82113)

## About The Pull Request
After playing more than a few matches, I came to notice a couple
lingering issues with deathmatch modifiers, and also I came up with more
ideas.

For starters, the echolocation modifier doesn't work, and even if it
worked, I believe it'd be ass, so I'm removing it. The perma-flipping
also doesn't work quite well and gets interrupted by stuff like
knockdowns and the such, plus it's just fluff, so I'm removing it too.
Second, I've forgot to set the style of the deadmatch missiles, so they
look like normal pods right now.

About what's being added rather than removed: There're now a "No
Slowdown" modifier, a "Random Teleports" one that randomly teleports
everyone (and whatever they're buckled too) every 12 to 24 seconds,
"Snail Crawl" which works much like snailpeople's, "Forcefield Trail"
which also works pretty much like the cosmic heretic trail, albeit
lasting way shorter, and finally a "Manual Blinking/Breathing", if you
truly hate players to a misanthropistic level.

So yeah, 2 removed modifiers, and 5 new ones.

## Why It's Good For The Game
Fixing a couple of issues, and lading the feature with a few more
options.

## Changelog

:cl:
del: Removed the (non-working) "Perma-Flipping" and "Echolocation"
deathmatch modifiers.
add: Added "No Slowdown", "Random Teleports", "Snail Crawl", "Forcefield
Trail" and "Manual Blinking/Breathing" modifiers.
fix: Fixed deathmatch cruise missiles looking like standard pods.
/:cl:

* Deathmatch Modifiers Tweaks and Additions

---------

Co-authored-by: Ghom <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Mar 22, 2024
1 parent 9aba8d1 commit 058cad6
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 25 deletions.
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

0 comments on commit 058cad6

Please sign in to comment.