Skip to content

Commit

Permalink
[MIRROR] deathmatch (#2057)
Browse files Browse the repository at this point in the history
* deathmatch (#81444)

## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/70376633/44f1d1af-2cd6-4e69-a13e-6d2a663d668d)

adds a deathmatch minigame, a port and slightly redone version of the
aetherstation deathmatch (by TheChosenEvilOne)
the goal is to kill everyone else with loadouts

## Why It's Good For The Game

CTF sucks and this is probably better to filter out the bloodthirsty
terry players anyway

## Changelog
:cl:
add: deathmatch minigame
/:cl:

---------




* deathmatch

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: jimmyl <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Ghom <[email protected]>
  • Loading branch information
5 people authored Feb 19, 2024
1 parent 7d10929 commit 0ba43e8
Show file tree
Hide file tree
Showing 33 changed files with 22,927 additions and 3 deletions.
1,499 changes: 1,499 additions & 0 deletions _maps/map_files/Deathmatch/Maint_Mania.dmm

Large diffs are not rendered by default.

2,168 changes: 2,168 additions & 0 deletions _maps/map_files/Deathmatch/OSHA_Violator.dmm

Large diffs are not rendered by default.

567 changes: 567 additions & 0 deletions _maps/map_files/Deathmatch/SecuRing.dmm

Large diffs are not rendered by default.

802 changes: 802 additions & 0 deletions _maps/map_files/Deathmatch/Sniper_elite.dmm

Large diffs are not rendered by default.

4,779 changes: 4,779 additions & 0 deletions _maps/map_files/Deathmatch/The_Brig.dmm

Large diffs are not rendered by default.

1,978 changes: 1,978 additions & 0 deletions _maps/map_files/Deathmatch/arena.dmm

Large diffs are not rendered by default.

1,417 changes: 1,417 additions & 0 deletions _maps/map_files/Deathmatch/chinatown.dmm

Large diffs are not rendered by default.

808 changes: 808 additions & 0 deletions _maps/map_files/Deathmatch/instagib.dmm

Large diffs are not rendered by default.

1,105 changes: 1,105 additions & 0 deletions _maps/map_files/Deathmatch/meatower.dmm

Large diffs are not rendered by default.

1,649 changes: 1,649 additions & 0 deletions _maps/map_files/Deathmatch/mech_madness.dmm

Large diffs are not rendered by default.

575 changes: 575 additions & 0 deletions _maps/map_files/Deathmatch/ragecage.dmm

Large diffs are not rendered by default.

1,250 changes: 1,250 additions & 0 deletions _maps/map_files/Deathmatch/raidthebase.dmm

Large diffs are not rendered by default.

750 changes: 750 additions & 0 deletions _maps/map_files/Deathmatch/shooting_range.dmm

Large diffs are not rendered by default.

2,040 changes: 2,040 additions & 0 deletions _maps/map_files/Deathmatch/starwars.dmm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#define COLOR_VERY_SOFT_YELLOW "#FAE48E"
#define COLOR_GOLD "#FFD700"
#define COLOR_ETHIOPIA_YELLOW "#FCDD09"
#define COLOR_LIGHT_YELLOW "#FFFEE0"

#define COLOR_OLIVE "#808000"
#define COLOR_ASSISTANT_OLIVE "#828163"
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/game_modes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report

/// We want reality_smash_tracker to exist only once and be accessible from anywhere.
GLOBAL_DATUM_INIT(reality_smash_track, /datum/reality_smash_tracker, new)

GLOBAL_DATUM(deathmatch_game, /datum/deathmatch_controller) // Deathmatch Minigame controller
31 changes: 31 additions & 0 deletions code/datums/martial/sleeping_carp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,37 @@
return ..()
return FALSE

/obj/item/clothing/gloves/the_sleeping_carp
name = "carp gloves"
desc = "This gloves are capable of making people use The Sleeping Carp."
icon_state = "black"
greyscale_colors = "#000000"
cold_protection = HANDS
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
heat_protection = HANDS
max_heat_protection_temperature = GLOVES_MAX_TEMP_PROTECT
resistance_flags = NONE
var/datum/martial_art/the_sleeping_carp/style

/obj/item/clothing/gloves/the_sleeping_carp/Initialize(mapload)
. = ..()
style = new()
style.allow_temp_override = FALSE

/obj/item/clothing/gloves/the_sleeping_carp/Destroy()
QDEL_NULL(style)
return ..()

/obj/item/clothing/gloves/the_sleeping_carp/equipped(mob/user, slot)
. = ..()
if(slot & ITEM_SLOT_GLOVES)
style.teach(user, TRUE)

/obj/item/clothing/gloves/the_sleeping_carp/dropped(mob/user)
. = ..()
if(!isnull(style))
style.fully_remove(user)

#undef STRONG_PUNCH_COMBO
#undef LAUNCH_KICK_COMBO
#undef DROP_KICK_COMBO
9 changes: 9 additions & 0 deletions code/datums/minigames_menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
ui.close()
basketball()
return TRUE
if("deathmatch")
ui.close()
deathmatch()
return TRUE

/datum/minigames_menu/proc/mafia()
var/datum/mafia_controller/game = GLOB.mafia_game //this needs to change if you want multiple mafia games up at once.
Expand All @@ -55,3 +59,8 @@
if(!game)
game = create_basketball_game()
game.ui_interact(usr)

/datum/minigames_menu/proc/deathmatch()
if(isnull(GLOB.deathmatch_game))
GLOB.deathmatch_game = new
GLOB.deathmatch_game.ui_interact(usr)
31 changes: 31 additions & 0 deletions code/game/turfs/open/_open.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,28 @@
/turf/open/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE)
return


/turf/open/indestructible/large
icon_state = "floor_large"

/turf/open/indestructible/white
icon_state = "white"

/turf/open/indestructible/white/smooth_large
icon_state = "white_large"

/turf/open/indestructible/white/textured
icon_state = "textured_white"

/turf/open/indestructible/dark
icon_state = "darkfull"

/turf/open/indestructible/dark/textured
icon_state = "textured_dark"

/turf/open/indestructible/dark/smooth_large
icon_state = "dark_large"

/turf/open/indestructible/light
icon_state = "light_on-1"

Expand Down Expand Up @@ -232,6 +248,9 @@
/turf/open/indestructible/meat/airless
initial_gas_mix = AIRLESS_ATMOS

/turf/open/indestructible/vault
icon_state = "rockvault"

/turf/open/indestructible/plating
name = "plating"
icon_state = "plating"
Expand All @@ -243,6 +262,18 @@
/turf/open/indestructible/plating/airless
initial_gas_mix = AIRLESS_ATMOS

/turf/open/indestructible/kitchen
icon_state = /turf/open/floor/iron/kitchen::icon_state

/turf/open/indestructible/rockyground
icon_state = /turf/open/misc/ashplanet/rocky::icon_state
icon = /turf/open/misc/ashplanet/rocky::icon
name = /turf/open/misc/ashplanet/rocky::name

/turf/open/indestructible/stone
icon_state = /turf/open/floor/stone::icon_state
name = /turf/open/floor/stone::name

/turf/open/Initalize_Atmos(time)
excited = FALSE
update_visuals()
Expand Down
135 changes: 135 additions & 0 deletions code/modules/deathmatch/deathmatch_controller.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/datum/deathmatch_controller
/// Assoc list of all lobbies (ckey = lobby)
var/list/datum/deathmatch_lobby/lobbies = list()
/// All deathmatch map templates
var/list/datum/lazy_template/deathmatch/maps = list()
/// All loadouts
var/list/datum/outfit/loadouts

/// All currently present spawnpoints, to be processed by a loading map
var/list/spawnpoint_processing = list()

/datum/deathmatch_controller/New()
. = ..()
if (GLOB.deathmatch_game)
qdel(src)
CRASH("A deathmatch controller already exists.")
GLOB.deathmatch_game = src

for (var/datum/lazy_template/deathmatch/template as anything in subtypesof(/datum/lazy_template/deathmatch))
var/map_name = initial(template.name)
maps[map_name] = new template
loadouts = subtypesof(/datum/outfit/deathmatch_loadout)

/datum/deathmatch_controller/proc/create_new_lobby(mob/host)
lobbies[host.ckey] = new /datum/deathmatch_lobby(host)
deadchat_broadcast(" has opened a new deathmatch lobby. <a href=?src=[REF(lobbies[host.ckey])];join=1>(Join)</a>", "<B>[host]</B>")

/datum/deathmatch_controller/proc/remove_lobby(ckey)
var/lobby = lobbies[ckey]
lobbies[ckey] = null
lobbies.Remove(ckey)
qdel(lobby)

/datum/deathmatch_controller/proc/passoff_lobby(host, new_host)
lobbies[new_host] = lobbies[host]
lobbies[host] = null
lobbies.Remove(host)

/datum/deathmatch_controller/proc/load_lazyarena(map_key)
if(!isnull(map_key) && !isnull(maps[map_key]))
var/datum/lazy_template/deathmatch/temp = maps[map_key]
return temp.lazy_load() //returns rezervation

return FALSE

/datum/deathmatch_controller/ui_state(mob/user)
return GLOB.observer_state

/datum/deathmatch_controller/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, null)
if(!ui)
ui = new(user, src, "DeathmatchPanel")
ui.open()

/datum/deathmatch_controller/ui_data(mob/user)
. = ..()
.["lobbies"] = list()
.["hosting"] = FALSE
.["admin"] = check_rights_for(user.client, R_ADMIN)
for (var/ckey in lobbies)
var/datum/deathmatch_lobby/lobby = lobbies[ckey]
if (user.ckey == ckey)
.["hosting"] = TRUE
if (user.ckey in lobby.observers+lobby.players)
.["playing"] = ckey
.["lobbies"] += list(list(
name = ckey,
players = lobby.players.len,
max_players = initial(lobby.map.max_players),
map = initial(lobby.map.name),
playing = lobby.playing
))

/datum/deathmatch_controller/proc/find_lobby_by_user(ckey)
for(var/lobbykey in lobbies)
var/datum/deathmatch_lobby/lobby = lobbies[lobbykey]
if(ckey in lobby.players+lobby.observers)
return lobby

/datum/deathmatch_controller/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(. || !isobserver(usr))
return
switch (action)
if ("host")
if (lobbies[usr.ckey])
return
if(!SSticker.HasRoundStarted())
tgui_alert(usr, "The round hasn't started yet!")
return
ui.close()
create_new_lobby(usr)
if ("join")
if (!lobbies[params["id"]])
return
var/datum/deathmatch_lobby/playing_lobby = find_lobby_by_user(usr.ckey)
var/datum/deathmatch_lobby/chosen_lobby = lobbies[params["id"]]
if (!isnull(playing_lobby) && playing_lobby != chosen_lobby)
playing_lobby.leave(usr.ckey)

if(isnull(playing_lobby))
log_game("[usr.ckey] joined deathmatch lobby [params["id"]] as a player.")
chosen_lobby.join(usr)

chosen_lobby.ui_interact(usr)
if ("spectate")
var/datum/deathmatch_lobby/playing_lobby = find_lobby_by_user(usr.ckey)
if (!lobbies[params["id"]])
return
var/datum/deathmatch_lobby/chosen_lobby = lobbies[params["id"]]
// if the player is in this lobby
if(!isnull(playing_lobby) && playing_lobby != chosen_lobby)
playing_lobby.leave(usr.ckey)
else if(playing_lobby == chosen_lobby)
chosen_lobby.ui_interact(usr)
return
// they werent in the lobby, lets add them
if (!chosen_lobby.playing)
chosen_lobby.add_observer(usr)
chosen_lobby.ui_interact(usr)
else
chosen_lobby.spectate(usr)
log_game("[usr.ckey] joined deathmatch lobby [params["id"]] as an observer.")
if ("admin")
if (!check_rights(R_ADMIN))
message_admins("[usr.key] has attempted to use admin functions in the deathmatch panel!")
log_admin("[key_name(usr)] tried to use the deathmatch panel admin functions without authorization.")
return
var/lobby = params["id"]
switch (params["func"])
if ("Close")
remove_lobby(lobby)
log_admin("[key_name(usr)] removed deathmatch lobby [lobby].")
if ("View")
lobbies[lobby].ui_interact(usr)
Loading

0 comments on commit 0ba43e8

Please sign in to comment.