-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from wraith-54321/cc-things
Adds teleporters and a firing range for centcom
- Loading branch information
Showing
8 changed files
with
1,215 additions
and
739 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
. = ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
monkestation/code/modules/ghost_players/centcom_teleporter.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
54 changes: 54 additions & 0 deletions
54
monkestation/code/modules/ghost_players/job_helpers/_centcom_item_spawner.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
84 changes: 84 additions & 0 deletions
84
monkestation/code/modules/ghost_players/job_helpers/firing_range_helper.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ..() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters