mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 07:46:20 +00:00
* deathmatch (#81444) ## About The Pull Request  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 🆑 add: deathmatch minigame /🆑 --------- Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> * deathmatch --------- Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>
67 lines
1.4 KiB
Plaintext
67 lines
1.4 KiB
Plaintext
/datum/minigames_menu
|
|
var/mob/dead/observer/owner
|
|
|
|
/datum/minigames_menu/New(mob/dead/observer/new_owner)
|
|
if(!istype(new_owner))
|
|
qdel(src)
|
|
owner = new_owner
|
|
|
|
/datum/minigames_menu/Destroy()
|
|
owner = null
|
|
return ..()
|
|
|
|
/datum/minigames_menu/ui_state(mob/user)
|
|
return GLOB.observer_state
|
|
|
|
/datum/minigames_menu/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "MinigamesMenu")
|
|
ui.open()
|
|
|
|
/datum/minigames_menu/ui_act(action, params, datum/tgui/ui)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
switch(action)
|
|
if("mafia")
|
|
ui.close()
|
|
mafia()
|
|
return TRUE
|
|
if("ctf")
|
|
ui.close()
|
|
ctf()
|
|
return TRUE
|
|
if("basketball")
|
|
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.
|
|
if(!game)
|
|
game = create_mafia_game()
|
|
game.ui_interact(usr)
|
|
|
|
/datum/minigames_menu/proc/ctf()
|
|
var/datum/ctf_panel/ctf_panel
|
|
if(!ctf_panel)
|
|
ctf_panel = new(src)
|
|
ctf_panel.ui_interact(usr)
|
|
|
|
/datum/minigames_menu/proc/basketball()
|
|
var/datum/basketball_controller/game = GLOB.basketball_game
|
|
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)
|