Skip to content

Commit

Permalink
Merge branch 'SEV-Intrepid!' of https://github.com/Doctor-Derp/tegust…
Browse files Browse the repository at this point in the history
…ation-bay12 into SEV-Intrepid!
  • Loading branch information
Doctor-Derp committed May 27, 2022
2 parents 0849f44 + c141d91 commit ce90424
Show file tree
Hide file tree
Showing 123 changed files with 2,190 additions and 570 deletions.
10 changes: 9 additions & 1 deletion baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "code\__datastructures\globals.dm"
#include "code\__datastructures\priority_queue.dm"
#include "code\__datastructures\stack.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\__compile_options.dm"
#include "code\__defines\_planes+layers.dm"
#include "code\__defines\_tick.dm"
#include "code\__defines\admin.dm"
Expand All @@ -45,6 +45,7 @@
#include "code\__defines\gamemode.dm"
#include "code\__defines\guns.dm"
#include "code\__defines\health.dm"
#include "code\__defines\holomap.dm"
#include "code\__defines\hydroponics.dm"
#include "code\__defines\integrated_circuits.dm"
#include "code\__defines\inventory_sizes.dm"
Expand Down Expand Up @@ -206,6 +207,7 @@
#include "code\controllers\subsystems\ghost_images.dm"
#include "code\controllers\subsystems\goals.dm"
#include "code\controllers\subsystems\graphs.dm"
#include "code\controllers\subsystems\holomap.dm"
#include "code\controllers\subsystems\inactivity.dm"
#include "code\controllers\subsystems\input.dm"
#include "code\controllers\subsystems\jobs.dm"
Expand Down Expand Up @@ -696,6 +698,7 @@
#include "code\game\machinery\requests_console.dm"
#include "code\game\machinery\robot_fabricator.dm"
#include "code\game\machinery\robotics_fabricator.dm"
#include "code\game\machinery\rotating_alarm.dm"
#include "code\game\machinery\seed_extractor.dm"
#include "code\game\machinery\self_destruct.dm"
#include "code\game\machinery\Sleeper.dm"
Expand Down Expand Up @@ -810,6 +813,7 @@
#include "code\game\machinery\pipe\pipe_datums\disposal_pipe_datums.dm"
#include "code\game\machinery\pipe\pipe_datums\pipe_datum_base.dm"
#include "code\game\machinery\pipe\pipe_datums\pipe_datums.dm"
#include "code\game\machinery\rotating_alarm\staiton_alerts.dm"
#include "code\game\machinery\telecomms\broadcaster.dm"
#include "code\game\machinery\telecomms\logbrowser.dm"
#include "code\game\machinery\telecomms\machine_interactions.dm"
Expand Down Expand Up @@ -1281,6 +1285,7 @@
#include "code\modules\admin\buildmode\edit.dm"
#include "code\modules\admin\buildmode\ladders.dm"
#include "code\modules\admin\buildmode\light_maker.dm"
#include "code\modules\admin\buildmode\meteor.dm"
#include "code\modules\admin\buildmode\mob_spawning.dm"
#include "code\modules\admin\buildmode\move_into.dm"
#include "code\modules\admin\buildmode\portals.dm"
Expand Down Expand Up @@ -1854,6 +1859,8 @@
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
#include "code\modules\holodeck\HolodeckPrograms.dm"
#include "code\modules\holomap\holomap_areas.dm"
#include "code\modules\holomap\ship_holomap.dm"
#include "code\modules\hydroponics\grown.dm"
#include "code\modules\hydroponics\grown_inedible.dm"
#include "code\modules\hydroponics\grown_predefined.dm"
Expand Down Expand Up @@ -2351,6 +2358,7 @@
#include "code\modules\mob\living\simple_animal\hostile\retaliate\king_of_goats.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\parrot.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\snake.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\space_whale.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\tegu.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\giant_parrot\giant_parrot.dm"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions code/__defines/_planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ What is the naming convention for planes or layers?
#define SIDE_WINDOW_LAYER 3.04
#define FULL_WINDOW_LAYER 3.05
#define ABOVE_WINDOW_LAYER 3.06
#define HOLOMAP_OVERLAY_LAYER 3.061
//LYING MOB AND HUMAN
#define LYING_MOB_LAYER 3.07
#define LYING_HUMAN_LAYER 3.08
Expand Down
36 changes: 36 additions & 0 deletions code/__defines/holomap.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Constants and standard colors for the holomap
//

#define HOLOMAP_ICON 'icons/480x480.dmi' // Icon file to start with when drawing holomaps (to get a 480x480 canvas).
#define HOLOMAP_ICON_SIZE 480 // Pixel width & height of the holomap icon. Used for auto-centering etc.
#define HOLOMAP_MARGIN 100 // minimum marging on sides when combining maps
#define UI_HOLOMAP "CENTER-7, CENTER-7" // Screen location of the holomap "hud"

// Holomap colors
#define HOLOMAP_OBSTACLE "#ffffffdd" // Color of walls and barriers
#define HOLOMAP_PATH "#66666699" // Color of floors
#define HOLOMAP_HOLOFIER "#79ff79" // Whole map is multiplied by this to give it a green holoish look

#define HOLOMAP_AREACOLOR_BASE "#ffffffff"
#define HOLOMAP_AREACOLOR_COMMAND "#386d8099"
#define HOLOMAP_AREACOLOR_SECURITY "#ae121299"
#define HOLOMAP_AREACOLOR_MEDICAL "#ffffffa5"
#define HOLOMAP_AREACOLOR_SCIENCE "#f45dff99"
#define HOLOMAP_AREACOLOR_EXPLORATION "#a154a699"
#define HOLOMAP_AREACOLOR_ENGINEERING "#f1c23199"
#define HOLOMAP_AREACOLOR_CARGO "#e06f0099"
#define HOLOMAP_AREACOLOR_HALLWAYS "#ffffff66"
#define HOLOMAP_AREACOLOR_AIRLOCK "#0000ffcc"
#define HOLOMAP_AREACOLOR_ESCAPE "#ff0000cc"
#define HOLOMAP_AREACOLOR_CREW "#5bc1c199"
// If someone can come up with a non-conflicting color for the lifts, please update this.
#define HOLOMAP_AREACOLOR_LIFTS null

// Handy defines to lookup the pixel offsets for holomap
// Currently set to 0, left here in case of need for per map offsets
#define HOLOMAP_PIXEL_OFFSET_X (0)
#define HOLOMAP_PIXEL_OFFSET_Y (0)

#define HOLOMAP_LEGEND_X 96
#define HOLOMAP_LEGEND_Y 156
1 change: 1 addition & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define AREA_FLAG_ION_SHIELDED 4 // shielded from ionospheric anomalies as an FBP / IPC
#define AREA_FLAG_IS_NOT_PERSISTENT 8 // SSpersistence will not track values from this area.
#define AREA_FLAG_NO_MODIFY 16 // turf in this area cannot be dismantled.
#define AREA_FLAG_HIDE_FROM_HOLOMAP 32 // if we shouldn't be drawn on station holomaps

//Map template flags
#define TEMPLATE_FLAG_ALLOW_DUPLICATES 1 // Lets multiple copies of the template to be spawned
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@
#define BP_GROIN "groin"
#define BP_ALL_LIMBS list(BP_CHEST, BP_GROIN, BP_HEAD, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND, BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)
#define BP_BY_DEPTH list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_CHEST)
#define BP_LEGS_FEET list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)
#define BP_ARMS_HANDS list(BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)

// Prosthetic helpers.
#define BP_IS_ROBOTIC(org) ((org) && ((org).status & ORGAN_ROBOTIC))
Expand Down
1 change: 1 addition & 0 deletions code/__defines/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ return;\
#define SS_INIT_GOALS -5
#define SS_INIT_LIGHTING -6
#define SS_INIT_ZCOPY -7
#define SS_INIT_HOLOMAP -8
#define SS_INIT_XENOARCH -10
#define SS_INIT_BAY_LEGACY -12
#define SS_INIT_TICKER -20
Expand Down
5 changes: 5 additions & 0 deletions code/_helpers/global_access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
return global.SSmapping;
if("SSmaterials")
return global.SSmaterials;
if("SSminimap")
return global.SSminimap;
if("SSmisc")
return global.SSmisc;
if("SSmisc_late")
Expand Down Expand Up @@ -988,6 +990,8 @@
global.SSmapping=newval;
if("SSmaterials")
global.SSmaterials=newval;
if("SSminimap")
global.SSminimap=newval;
if("SSmisc")
global.SSmisc=newval;
if("SSmisc_late")
Expand Down Expand Up @@ -1815,6 +1819,7 @@
"SSmachines",
"SSmapping",
"SSmaterials",
"SSminimap",
"SSmisc",
"SSmisc_late",
"SSmobs",
Expand Down
43 changes: 43 additions & 0 deletions code/_helpers/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
#define ceil(x) (-round(-(x)))
#define CEILING(x, y) ( -round(-(x) / (y)) * (y) )
#define MULT_BY_RANDOM_COEF(VAR,LO,HI) VAR = round((VAR * rand(LO * 100, HI * 100))/100, 0.1)

/// The percentage of value in max, rounded to places: 1 = nearest 0.1 , 0 = nearest 1 , -1 = nearest 10, etc
#define PERCENT(value, max, places) round((value) / (max) * 100, !(places) || 10 ** -(places))

/// Value or the nearest integer in either direction
#define Round(value) round((value), 1)

/// Value or the nearest multiple of divisor in either direction
#define Roundm(value, divisor) round((value), (divisor))

// min is inclusive, max is exclusive
/proc/Wrap(val, min, max)
var/d = max - min
Expand Down Expand Up @@ -137,6 +144,42 @@
/matrix/proc/get_angle()
return Atan2(b,a)

/proc/CircularRandomCoordinate(radius = 1, round)
var/angle = rand(0, 359)
var/x = cos(angle) * radius
var/y = sin(angle) * radius
if (round)
x = Round(x)
y = Round(y)
return list(x, y)

/proc/BoundedCircularRandomCoordinate(radius, center_x, center_y, low_x, low_y, high_x, high_y, round)
var/list/xy = CircularRandomCoordinate(radius, round)
var/dx = xy[1]
var/dy = xy[2]
var/x = center_x + dx
var/y = center_y + dy
if (x < low_x || x > high_x)
x = center_x - dx
if (y < low_y || y > high_y)
y = center_y - dy
return list(
clamp(x, low_x, high_x),
clamp(y, low_y, high_y)
)


/// Pick a random turf using BoundedCircularRandomCoordinate about x,y on level z
/proc/CircularRandomTurf(radius, z, center_x, center_y, low_x = 1, low_y = 1, high_x = world.maxx, high_y = world.maxy)
var/list/xy = BoundedCircularRandomCoordinate(radius, center_x, center_y, low_x, low_y, high_x, high_y, TRUE)
return locate(xy[1], xy[2], z)


/// Pick a random turf using BoundedCircularRandomCoordinate around the turf of target
/proc/CircularRandomTurfAround(atom/target, radius, low_x = 1, low_y = 1, high_x = world.maxx, high_y = world.maxy)
var/turf/turf = get_turf(target)
return CircularRandomTurf(radius, turf.z, turf.x, turf.y, low_x, low_y, high_x, high_y)

#define MODULUS_FLOAT(X, Y) ( (X) - (Y) * round((X) / (Y)) )

// Will filter out extra rotations and negative rotations
Expand Down
3 changes: 0 additions & 3 deletions code/_helpers/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1232,9 +1232,6 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
/proc/crash_at(msg, file, line)
CRASH("%% [file],[line] %% [msg]")

/proc/pass()
return

//clicking to move pulled objects onto assignee's turf/loc
/proc/do_pull_click(mob/user, atom/A)
if(ismob(user.pulling))
Expand Down
2 changes: 2 additions & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ var/const/NEGATIVE_INFINITY = -1#INF // win: -1.#INF, lin: -inf

#define isspaceturf(A) istype(A, /turf/space)

#define isopenturf(A) istype(A, /turf/simulated/open)

#define ispAI(A) istype(A, /mob/living/silicon/pai)

#define isrobot(A) istype(A, /mob/living/silicon/robot)
Expand Down
13 changes: 12 additions & 1 deletion code/_onclick/hud/global_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GLOBAL_DATUM_INIT(global_hud, /datum/global_hud, new())
var/obj/screen/thermal
var/obj/screen/meson
var/obj/screen/science
var/obj/screen/holomap

/datum/global_hud/proc/setup_overlay(var/icon_state)
var/obj/screen/screen = new /obj/screen()
Expand All @@ -24,4 +25,14 @@ GLOBAL_DATUM_INIT(global_hud, /datum/global_hud, new())
nvg = setup_overlay("nvg_hud")
thermal = setup_overlay("thermal_hud")
meson = setup_overlay("meson_hud")
science = setup_overlay("science_hud")
science = setup_overlay("science_hud")

//Holomap screen object is invisible and work
//By setting it as n images location, without icon changes
//Make it part of global hud since it's inmutable
holomap = new /obj/screen()
holomap.name = "holomap"
holomap.icon = null
holomap.layer = HUD_BASE_LAYER
holomap.screen_loc = UI_HOLOMAP
holomap.mouse_opacity = 0
Loading

0 comments on commit ce90424

Please sign in to comment.