SS13 construct (#593)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

This PR, will add to the game a new test map SS13 construct, a port of
the famous map from Garys Mod, by ocean_fish. Also, a number of tools
from the same game - namely:

Physgun, tools to manipulate the gravity of objects.
Phystool, or toolgun with five modes of operation.
Fly, Noclip. 


![ss13_construct_full](https://github.com/Bubberstation/Bubberstation/assets/126053988/c5a99d33-8ffc-4203-9ef2-3217ade3ca04)
https://youtu.be/lGXmsiecvfo
## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
New, user-friendly test tools.

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: Added new map SS13 Construct
add: Added new new debug tool: physgun, phystool
add: Added new abilites: noclip, fly
sound: added phystools sounds
config: added SS13 constuct to avaible maps
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Resomi Enjoer <fenyshaarmagedon.gmai.com>
Co-authored-by: OceanFish1 <65843722+OceanFish1@users.noreply.github.com>
Co-authored-by: nevimer <77420409+nevimer@users.noreply.github.com>
This commit is contained in:
Fenysha
2023-11-06 21:32:36 -05:00
committed by GitHub
co-authored by Resomi Enjoer <fenyshaarmagedon.gmai.com> OceanFish1 nevimer
parent 6a35918b1f
commit 8a31efc1ff
29 changed files with 66071 additions and 1 deletions
@@ -0,0 +1,14 @@
/datum/phystool_mode
var/name = "Defualt mode"
var/desc = "Coder button."
var/obj/item/phystool/our_tool
/datum/phystool_mode/proc/on_selected(mob/user)
to_chat(user, span_notice(desc))
/datum/phystool_mode/proc/main_act(atom/target, mob/user)
/datum/phystool_mode/proc/secondnary_act(atom/target, mob/user)
/datum/phystool_mode/proc/use_act(mob/user)
@@ -0,0 +1,59 @@
/datum/phystool_mode/build_mode
name = "Build mode"
desc = "Use LMB for build mode, RMB for remover and in hands to choose between structures."
var/atom/selected_atom
/datum/phystool_mode/build_mode/use_act(mob/user)
. = ..()
var/list/choise = list(
"Wall mode" = image(icon = 'icons/turf/walls.dmi', icon_state = "wall3"),
"Turf mode" = image(icon = 'icons/turf/walls.dmi', icon_state = "floor"),
"Structure mode" = image(icon = 'icons/obj/doors/airlocks/external/external.dmi', icon_state = "closed")
)
var/choised_mode = show_radial_menu(user, user, choise, require_near = TRUE)
if(!choised_mode)
user.balloon_alert(user, "Select one!")
return FALSE
var/list/pick = list()
if(choised_mode == "Wall mode")
pick = init_paths(/turf/closed/wall)
if(choised_mode == "Turf mode")
pick = init_paths(/turf/open)
for(var/turf/open/space/T in pick)
pick -= T
if(choised_mode == "Structure mode")
pick = init_paths(/obj/machinery/door)
selected_atom = tgui_input_list(user, "Selected object:", "Toolgun work", pick)
return TRUE
/datum/phystool_mode/build_mode/secondnary_act(atom/target, mob/user)
. = ..()
if(iswallturf(target))
var/turf/T = target
T.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
return TRUE
else if(istype(target, /obj/machinery/door))
qdel(target)
return TRUE
/datum/phystool_mode/build_mode/main_act(atom/target, mob/user)
. = ..()
if(!selected_atom)
user.balloon_alert(user, "Select atom first!")
return FALSE
if(!isopenturf(target))
user.balloon_alert(user, "Blocked!")
return FALSE
var/turf/T = target
if(T.is_blocked_turf())
user.balloon_alert(user, "Blocked!")
return FALSE
if(!isturf(selected_atom))
T.PlaceOnTop(selected_atom)
return TRUE
T.TerraformTurf(selected_atom, selected_atom, flags = CHANGETURF_INHERIT_AIR)
return TRUE
@@ -0,0 +1,26 @@
/datum/phystool_mode/color_mode
name = "Color mode"
desc = "Use LMB to color an object. Use RMB to set default color. Use in hands to choose color."
var/selected_color
/datum/phystool_mode/color_mode/use_act(mob/user)
. = ..()
selected_color = input(user, "Pick new effects color", "Physgun color") as color|null
/datum/phystool_mode/color_mode/main_act(atom/target, mob/user)
. = ..()
if(isliving(target))
var/mob/living/L = target
if(L.client)
user.balloon_alert(user, "Can't color!")
return FALSE
if(!selected_color)
selected_color = COLOR_WHITE
target.color = selected_color
return TRUE
/datum/phystool_mode/color_mode/secondnary_act(atom/target, mob/user)
. = ..()
target.color = initial(target.color)
return TRUE
@@ -0,0 +1,19 @@
/datum/phystool_mode/remove_mode
name = "Remove tool"
desc = "Use LMB to delete object from world."
/datum/phystool_mode/remove_mode/main_act(atom/target, mob/user)
. = ..()
if(isliving(target))
var/mob/living/living_target = target
if(living_target.client)
user.balloon_alert(user, "Client inside!")
return FALSE
//Is there is somthing inside target.
if(target.contents.len)
for(var/atom/movable/important_thing in target.contents)
if(!istype(important_thing))
continue
important_thing.forceMove(get_turf(target))
qdel(target)
return TRUE
@@ -0,0 +1,33 @@
/datum/phystool_mode/size_mode
name = "Size tool"
desc = "Use LMB to increase the size of an object. Use RMB to decrease the size of an object."
/datum/phystool_mode/size_mode/main_act(atom/target, mob/user)
. = ..()
if(isturf(target))
return FALSE
change_size(target, 2)
return TRUE
/datum/phystool_mode/size_mode/secondnary_act(atom/target, mob/user)
. = ..()
if(isturf(target))
return FALSE
change_size(target, 0.5)
return TRUE
/datum/phystool_mode/size_mode/proc/change_size(atom/target, value)
if(isliving(target))
var/mob/living/living_target = target
if(living_target.client)
return
var/translate_x = value * ( target.transform.b / value )
var/translate_y = value * ( target.transform.e / value )
if(((translate_x || translate_y) >= 8) || ((translate_x || translate_y) <= 0.125))
translate_x = target.transform.b
translate_y = target.transform.e
target.transform = target.transform.Translate(translate_x, translate_y)
target.pixel_x *= value
target.pixel_y *= value
target.transform = target.transform.Scale(value)
target.maptext_height = 32 * value
@@ -0,0 +1,59 @@
#define SPAWN_MODE_MOB_COOLDOWN 5 SECONDS
#define SPAWN_MODE_MEGAFAUNA_COOLDOWN 30 SECONDS
/datum/phystool_mode/spawn_mode
name = "Spawn mode"
desc = "Use LMB to spawn, use in hands to choose spawn type."
var/atom/selected_object
var/list/atom/black_list = list(
/obj/narsie,
/obj/cascade_portal,
/obj/singularity,
/obj/effect,
/mob/living/basic/supermatter_spider,
/area,
/turf
)
COOLDOWN_DECLARE(spawn_cooldown)
/datum/phystool_mode/spawn_mode/use_act(mob/user)
. = ..()
var/text_path = tgui_input_text(user, "Enter object path:", "Spawn tool", "none", 256, FALSE)
if(!text_path)
user.balloon_alert(user, "Enter path!")
return FALSE
selected_object = text2path(text_path)
if(!ispath(selected_object))
selected_object = pick_closest_path(text_path)
for(var/black_list_item in black_list)
if(ispath(selected_object, black_list_item))
selected_object = null
user.balloon_alert(user, "Spawn blocked!")
return FALSE
user.balloon_alert(user, "Selected!")
to_chat(user, span_notice("Current spawn type [selected_object]."))
/datum/phystool_mode/spawn_mode/main_act(atom/target, mob/user)
. = ..()
if(!selected_object)
user.balloon_alert(user, "Select type first!")
return FALSE
if(!COOLDOWN_FINISHED(src, spawn_cooldown))
user.balloon_alert(user, "Wait!")
return FALSE
var/target_cooldown
if(ispath(selected_object, /mob/living/simple_animal/hostile/megafauna))
target_cooldown = SPAWN_MODE_MEGAFAUNA_COOLDOWN
if(ispath(selected_object, /mob/living))
target_cooldown = SPAWN_MODE_MOB_COOLDOWN
if(target_cooldown)
COOLDOWN_START(src, spawn_cooldown, target_cooldown)
new selected_object(get_turf(target))
return TRUE
#undef SPAWN_MODE_MOB_COOLDOWN
#undef SPAWN_MODE_MEGAFAUNA_COOLDOWN