Skip to content

Commit

Permalink
Merge pull request #470 from wraith-54321/cc-things
Browse files Browse the repository at this point in the history
Adds teleporters and a firing range for centcom
  • Loading branch information
dwasint authored Nov 22, 2023
2 parents 4e87b22 + c112e23 commit deb5ccf
Show file tree
Hide file tree
Showing 8 changed files with 1,215 additions and 739 deletions.
1,720 changes: 981 additions & 739 deletions _maps/map_files/generic/CentCom.dmm

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions monkestation/code/modules/ghost_players/area_changes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
/area/centcom/central_command_areas/admin
area_flags = NOTELEPORT | GHOST_AREA | NO_EXPLOSIONS_DURING | NO_GHOSTS_DURING_ROUND

/area/centcom/central_command_areas/firing_range
name = "Centcom Firing Range"
area_flags = UNIQUE_AREA | NOTELEPORT | GHOST_AREA | NO_EXPLOSIONS_DURING

/area/centcom/central_command_areas/firing_range_checkpoint_control
area_flags = UNIQUE_AREA | NOTELEPORT | NO_EXPLOSIONS_DURING

/area/Entered(mob/M)
. = ..()
if(!(area_flags & GHOST_AREA) && istype(M, /mob/living/carbon/human/ghost))
Expand Down
5 changes: 5 additions & 0 deletions monkestation/code/modules/ghost_players/arena/arena_items.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//variant that grants CQC as soon as it is used
/obj/item/book/granter/martial/cqc/fast_read/attack_self(mob/living/user)
uses--
on_reading_finished(user)
. = ..()
17 changes: 17 additions & 0 deletions monkestation/code/modules/ghost_players/arena/fight_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@
var/obj/item/weapon_of_choice = /obj/item/storage/toolbox
///the wager in monkecoins thats paid out to the winner
var/payout = 0
///list of weakrefs to spawned weapons for deletion on duel end
var/list/spawned_weapons = list()

///what weapons can players choose to duel with
var/list/weapon_choices = list(
/obj/item/storage/toolbox,
/obj/item/knife/shiv,
/obj/item/grenade/clusterbuster,
/obj/item/spear/bamboospear,
/obj/item/reagent_containers/spray/chemsprayer/magical, //unsure if this would cause issues but they do already have access to a full chem lab so it should be fine
/obj/item/gun/energy/laser/instakill, //first to hit the other wins, very fast matches
/obj/item/melee/baton/security/loaded,
/obj/item/chainsaw,
/obj/item/melee/energy/sword/saber,
/obj/item/book/granter/martial/cqc/fast_read,
/obj/item/gun/ballistic/revolver,
/obj/item/melee/energy/axe,
)

/obj/structure/fight_button/Initialize(mapload)
Expand Down Expand Up @@ -138,13 +149,15 @@
player_two.fully_heal()

var/obj/item/one_weapon = new weapon_of_choice(src)
spawned_weapons += WEAKREF(one_weapon)
var/turf/one_spot = locate(148, 34, SSmapping.levels_by_trait(ZTRAIT_CENTCOM)[1])
player_one.forceMove(one_spot)
player_one.equipOutfit(/datum/outfit/job/assistant)
player_one.put_in_active_hand(one_weapon, TRUE)
player_one.dueling = TRUE

var/obj/item/two_weapon = new weapon_of_choice(src)
spawned_weapons += WEAKREF(two_weapon)
var/turf/two_spot = locate(164, 34, SSmapping.levels_by_trait(ZTRAIT_CENTCOM)[1])
player_two.forceMove(two_spot)
player_two.equipOutfit(/datum/outfit/job/assistant)
Expand All @@ -168,3 +181,7 @@

payout = 0
update_maptext()
for(var/datum/weakref/weapon in spawned_weapons)
var/obj/item/spawned_weapon = weapon?.resolve()
if(spawned_weapon)
qdel(spawned_weapon)
63 changes: 63 additions & 0 deletions monkestation/code/modules/ghost_players/centcom_teleporter.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#define RIGHTS_NONE "none"
//can be used to teleport to any other centcom_teleporter(admin teleporters can only be used by people with R_ADMIN)
/obj/structure/centcom_teleporter
name = "centcom teleporter"
desc = "Can teleport you to any other centcom teleporter you have access to."

resistance_flags = INDESTRUCTIBLE
anchored = TRUE

icon = 'icons/obj/money_machine.dmi'
icon_state = "bogdanoff"
///static assoc list of lists of centcom teleporters, keyed to strings of what rights they require to use
var/static/list/all_teleporters = list()
///what rights do we need to be used
var/needed_rights = RIGHTS_NONE

/obj/structure/centcom_teleporter/Initialize(mapload)
. = ..()
if(!all_teleporters["[needed_rights]"])
all_teleporters["[needed_rights]"] = list(src)
else
all_teleporters["[needed_rights]"] += src

/obj/structure/centcom_teleporter/Destroy()
all_teleporters["[needed_rights]"] -= src
return ..()

/obj/structure/centcom_teleporter/attack_hand(mob/living/user, list/modifiers)
. = ..()
if(!user.client || (needed_rights != RIGHTS_NONE && !check_rights_for(user.client, needed_rights)))
return

var/list/choice_list = list()
for(var/teleporter_list in all_teleporters)
if((teleporter_list == RIGHTS_NONE) || check_rights_for(user.client, text2num(teleporter_list)))
choice_list += all_teleporters[teleporter_list]

var/obj/structure/centcom_teleporter/choice = tgui_input_list(user, "Where do you want to teleport to?", "Teleporter", choice_list)
if(!istype(choice))
return

if((choice.needed_rights != RIGHTS_NONE) && !check_rights_for(user.client, choice.needed_rights))
to_chat(user, span_warning("You dont have the admin rights to teleport here."))
message_admins("[user][ADMIN_LOOKUPFLW(user)] is trying to use a centcom teleporter they dont have access to.") //these should not be visible to them so tell admins
return

do_teleport(user, get_turf(choice), no_effects = TRUE, forced = TRUE)

/obj/structure/centcom_teleporter/spawn_area
name = "spawn area teleporter"

/obj/structure/centcom_teleporter/arena
name = "arena teleporter"

/obj/structure/centcom_teleporter/cargo
name = "centcom cargo teleporter"
needed_rights = R_ADMIN

/obj/structure/centcom_teleporter/admin_offices
name = "admin offices teleporter"
needed_rights = R_ADMIN

#undef RIGHTS_NONE
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/obj/structure/centcom_item_spawner
name = "centcom item spawner"
desc = "This is the abstract type of an object, you should not see this."
resistance_flags = INDESTRUCTIBLE
anchored = TRUE
icon = 'icons/obj/money_machine.dmi'
icon_state = "bogdanoff"
///what do we say() when we fabricate something
var/fabrication_phrase = "fabrication complete"
///list of exact types this spawner will not be able to spawn
var/list/blacklisted_items = list()
///typesof() these types will not be able to be spawned
var/list/blacklisted_types = list()
/**
* assoc list of category name stings as keys with lists of what types they can spawn as values.
* category is always required, even if you only have 1. however, if there is only 1 category then it will be removed and category selection for the player will be skipped
**/
var/list/items_to_spawn = list()

/obj/structure/centcom_item_spawner/Initialize(mapload)
. = ..()
build_items_to_spawn()

/obj/structure/centcom_item_spawner/attack_hand(mob/living/user, list/modifiers)
. = ..()
var/choice
if(length(items_to_spawn == 1))
choice = 1 //this will act as an access key
else
choice = tgui_input_list(user, "What do you wish to fabricate?", "[src.name]", items_to_spawn)

if(!choice)
return

var/atom/second_choice = tgui_input_list(user, "Choose what to fabricate", "[choice]", items_to_spawn[choice])
if(type in blacklisted_items) //should not be visible but just be extra sure we cant print these
return

new second_choice(get_turf(src))
say("[fabrication_phrase]")
playsound(src, 'sound/machines/ding.ogg', 50, TRUE)

///build our items to spawn, override this to generate items_to_spawn, call parent at the END of your override
/obj/structure/centcom_item_spawner/proc/build_items_to_spawn()
for(var/type as anything in blacklisted_types)
blacklisted_items += typesof(type)

for(var/category in items_to_spawn)
if(length(items_to_spawn) == 1) //if our length is 1 then turn us into a normal list that just contains our single category list
items_to_spawn = list(items_to_spawn[category])
break
for(var/type in items_to_spawn[category])
if(type in blacklisted_items)
items_to_spawn[category] -= type
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/obj/structure/centcom_item_spawner/gun_and_ammo_creator
name = "firing range fabrication device"
desc = "Able to print most guns and ammo your heart could ever desire.(not liable for any damages)"
resistance_flags = INDESTRUCTIBLE
anchored = TRUE
icon = 'icons/obj/money_machine.dmi'
icon_state = "bogdanoff"
blacklisted_items = list(
/obj/item/gun/ballistic,
/obj/item/gun/ballistic/automatic,
/obj/item/gun/blastcannon,
/obj/item/gun/energy,
/obj/item/gun/energy/minigun, //might runtime
/obj/item/gun/energy/pulse/prize, //dont spam ghosts
/obj/item/gun/energy/shrink_ray,
/obj/item/gun/energy/mindflayer,
/obj/item/gun/energy/recharge,
/obj/item/gun/energy/wiremod_gun,
/obj/item/gun/energy/xray,
/obj/item/gun/magic,
/obj/item/gun/magic/bloodchill,
/obj/item/gun/magic/staff,
/obj/item/gun/magic/staff/animate,
/obj/item/gun/magic/staff/change,
/obj/item/gun/magic/staff/chaos,
/obj/item/gun/magic/staff/door,
/obj/item/gun/magic/staff/flying,
/obj/item/gun/magic/staff/honk,
/obj/item/gun/magic/staff/necropotence,
/obj/item/gun/magic/staff/wipe,
/obj/item/gun/magic/tentacle,
/obj/item/gun/magic/wand,
/obj/item/gun/magic/wand/door,
/obj/item/gun/magic/wand/polymorph,
/obj/item/gun/magic/wand/teleport,
/obj/item/ammo_box/c38/trac,
/obj/item/ammo_box/magazine/m556/phasic,
/obj/item/ammo_box/magazine/sniper_rounds/penetrator,
/obj/item/ammo_box/magazine,
/obj/item/ammo_box/magazine/toy,
)
blacklisted_types = list(
/obj/item/ammo_box/magazine/internal,
/obj/item/gun/energy/e_gun/dragnet,
/obj/item/gun/energy/ionrifle,
/obj/item/gun/energy/laser/instakill,
/obj/item/gun/energy/meteorgun,
/obj/item/gun/energy/wormhole_projector,
/obj/item/gun/magic/staff/chaos,
/obj/item/gun/magic/wand/death,
/obj/item/gun/magic/wand/safety,
/obj/item/gun/medbeam,
)

/obj/structure/centcom_item_spawner/gun_and_ammo_creator/build_items_to_spawn()
items_to_spawn["Ballistic"] = subtypesof(/obj/item/gun/ballistic)
items_to_spawn["Energy"] = subtypesof(/obj/item/gun/energy)
items_to_spawn["Magic"] = subtypesof(/obj/item/gun/magic)
items_to_spawn["Ammo"] = subtypesof(/obj/item/ammo_box)
items_to_spawn["Other"] = list(
/obj/item/gun/chem,
/obj/item/gun/grenadelauncher,
/obj/structure/training_machine,
/mob/living/carbon/human) + typesof(/obj/item/gun/syringe, /obj/item/target)
. = ..()

//blocks passage if you have a gun
/obj/effect/gun_check_blocker
name = "anti gun barrier"
desc = "\"No guns outside the designated area\" is printed below it."
icon = 'goon/icons/obj/meteor_shield.dmi'
icon_state = "shieldw"
color = COLOR_RED
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
anchored = TRUE

/obj/effect/gun_check_blocker/CanPass(atom/movable/mover, border_dir)
if(istype(mover, /obj/item/gun))
return FALSE
for(var/object in mover.get_all_contents())
if(istype(object, /obj/item/gun))
return FALSE
return ..()

4 changes: 4 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6026,8 +6026,10 @@
#include "monkestation\code\modules\events\wizard\summon_gifts.dm"
#include "monkestation\code\modules\food_and_drinks\recipes\boiling.dm"
#include "monkestation\code\modules\ghost_players\area_changes.dm"
#include "monkestation\code\modules\ghost_players\centcom_teleporter.dm"
#include "monkestation\code\modules\ghost_players\ghost_player.dm"
#include "monkestation\code\modules\ghost_players\arena\arena_cleanser.dm"
#include "monkestation\code\modules\ghost_players\arena\arena_items.dm"
#include "monkestation\code\modules\ghost_players\arena\fight_button.dm"
#include "monkestation\code\modules\ghost_players\arena\map_templates.dm"
#include "monkestation\code\modules\ghost_players\arena\arena_assets\alien.dm"
Expand All @@ -6037,6 +6039,8 @@
#include "monkestation\code\modules\ghost_players\arena\arena_assets\fish.dm"
#include "monkestation\code\modules\ghost_players\arena\arena_assets\statues.dm"
#include "monkestation\code\modules\ghost_players\arena\arena_assets\water.dm"
#include "monkestation\code\modules\ghost_players\job_helpers\_centcom_item_spawner.dm"
#include "monkestation\code\modules\ghost_players\job_helpers\firing_range_helper.dm"
#include "monkestation\code\modules\ghost_players\job_helpers\food_machine.dm"
#include "monkestation\code\modules\ghost_players\job_helpers\hydroponics_helper.dm"
#include "monkestation\code\modules\ghost_players\job_helpers\injured_spawner.dm"
Expand Down

0 comments on commit deb5ccf

Please sign in to comment.