Skip to content

Commit

Permalink
Merge branch 'TauCetiStation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BasiaBelov authored Jan 12, 2024
2 parents c64e5d2 + b8eac9f commit cfa6be6
Show file tree
Hide file tree
Showing 72 changed files with 10,481 additions and 9,861 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
BYOND_MAJOR: 515
BYOND_MINOR: 1619
SPACEMAN_DMM_VERSION: suite-1.7.2
SPACEMAN_DMM_VERSION: suite-1.8
jobs:
DreamChecker:
runs-on: ubuntu-20.04
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/_planes_layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ What is the naming convention for planes or layers?
#define HIGHEST_GAME_LAYER 50

#define ABOVE_GAME_PLANE -1
#define SEETHROUGH_PLANE -3

#define BLACKNESS_PLANE 0

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/math.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define CEILING(x, y) ( -round(-(x) / (y)) * (y) )

#define CEIL(x) (-round(-(x)))
#define CEIL(x) ceil(x)

// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/spawners.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// A wrapper for _create_spawners that allows us to pretend we're using normal named arguments
#define create_spawners(type, num, arguments...) _create_spawners(type, num, list(##arguments))

#define create_spawner(type, arguments...) create_spawners(type, 1, ##arguments)
#define create_spawner(type, arguments...) _create_spawners(type, 1, list(##arguments))
55 changes: 55 additions & 0 deletions code/__HELPERS/see_through_maps.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//For these defines, check also above for their actual shapes in-game and maybe get a better idea

///Default shape. It's one tile above the atom
#define SEE_THROUGH_MAP_DEFAULT "default"
///A 3x3 area 2 tiles above the atom (trees love to be this shape)
#define SEE_THROUGH_MAP_THREE_X_THREE "3x3"
///2 tiles above the atom
#define SEE_THROUGH_MAP_DEFAULT_TWO_TALL "default_two_tall"
///two rows of three tiles above the atom (small but thick trees love these)
#define SEE_THROUGH_MAP_THREE_X_TWO "3x2"

/**global statics for the see_through_component coordinate maps
* For ease of use, include a comment in the shape of the coordinate map, where O is nothing, X is a hidden tile and A is the object
* List-coordinate layout is list(relative_x, relative_y, relative_z)
* Turf finding algorithm needs the z and you can totally use it, but I can't think of any reason to ever do it
* Also it'd be really cool if you could keep the list-coordinates in here represent their actual relative coords, dont use tabs though since their spacing can differ
*/
var/global/list/see_through_maps = list(
// X
// A
SEE_THROUGH_MAP_DEFAULT = list(
/*----------------*/list(0, 1, 0),
/*----------------*/list(0, 0, 0)
),

// XXX
// XXX
// XXX
// OAO
SEE_THROUGH_MAP_THREE_X_THREE = list(
list(-1, 3, 0), list(0, 3, 0), list(1, 3, 0),
list(-1, 2, 0), list(0, 2, 0), list(1, 2, 0),
list(-1, 1, 0), list(0, 1, 0), list(1, 1, 0)
),

// X
// X
// A
SEE_THROUGH_MAP_DEFAULT_TWO_TALL = list(
/*----------------*/list(0, 2, 0),
/*----------------*/list(0, 1, 0),
/*----------------*/list(0, 0, 0)
),

// XXX
// XXX
// OAO
SEE_THROUGH_MAP_THREE_X_TWO = list(
list(-1, 2, 0), list(0, 2, 0), list(1, 2, 0),
list(-1, 1, 0), list(0, 1, 0), list(1, 1, 0)
),

)


4 changes: 4 additions & 0 deletions code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
/// Call by name proc reference, checks if the proc is existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)
#endif

#if DM_VERSION < 515
#define ceil(x) (-round(-(x)))
#endif
1 change: 0 additions & 1 deletion code/_globalvars/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var/global/list/global_map = null
//3 - AI satellite
//5 - empty space

var/global/list/wizardstart = list()
var/global/list/newplayer_start = list()
var/global/list/latejoin = list()
var/global/list/prisonwarp = list() //prisoners go to these
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/hud/rendering/plane_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
appearance_flags = PLANE_MASTER //should use client color
blend_mode = BLEND_OVERLAY

/atom/movable/screen/plane_master/seethrough
name = "seethrough plane master"
plane = SEETHROUGH_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/ghost
name = "ghost plane master"
plane = GHOST_PLANE
Expand Down
5 changes: 4 additions & 1 deletion code/datums/atom_huds/atom_hud_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@

if(M.mind || new_icon_state) //in mindless mobs, only null is acceptable, otherwise we're antagging a mindless mob, meaning we should runtime
M.mind.antag_hud_icon_state = new_icon_state

if(ishuman(M))
var/mob/living/carbon/human/H = M
holder.pixel_y = H.species.hud_offset_y
holder.pixel_x = H.species.hud_offset_x

//MIND PROCS
//these are called by mind.transfer_to()
Expand Down
37 changes: 32 additions & 5 deletions code/datums/atom_huds/atom_hud_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
/mob/living/proc/med_hud_set_health()
var/image/holder = hud_list[HEALTH_HUD]
holder.icon_state = "hud[RoundHealth(src)]"
if(ishuman(src))
var/mob/living/carbon/human/H = src
holder.pixel_y = H.species.hud_offset_y
holder.pixel_x = H.species.hud_offset_x

//for carbon suit sensors
/mob/living/carbon/med_hud_set_health()
Expand Down Expand Up @@ -146,6 +150,11 @@
holder.icon_state = "hudhealthy"
else
holder.icon_state = "hudill[min(virus_threat, 7)]"
if(!ishuman(src))
return
var/mob/living/carbon/human/H = src
holder.pixel_y = H.species.hud_offset_y
holder.pixel_x = H.species.hud_offset_x

/mob/living/carbon/human/med_hud_set_status()
..()
Expand All @@ -156,6 +165,8 @@
holder = hud_list[INSURANCE_HUD]
var/insurance_type = get_insurance_type(src)
holder.icon_state = "hud_insurance_[insurance_type]"
holder.pixel_y = species.hud_offset_y
holder.pixel_x = species.hud_offset_x

/***********************************************
Security HUDs! Basic mode shows only the job.
Expand All @@ -165,47 +176,63 @@
holder.icon_state = "hudunknown"
if(wear_id?.GetID())
holder.icon_state = "hud[ckey(wear_id.GetJobName())]"
holder.pixel_y = -8
holder.pixel_y = species.hud_offset_y - 8
holder.pixel_x = species.hud_offset_x
sec_hud_set_security_status()

/mob/living/proc/sec_hud_set_implants()
var/image/holder
var/species_offset_hud_Y = 0
var/species_offset_hud_X = 0
if(ishuman(src))
var/mob/living/carbon/human/H = src
species_offset_hud_Y = H.species.hud_offset_y
species_offset_hud_X = H.species.hud_offset_x
var/y = 0
for(var/i in list(IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD, IMPMINDS_HUD, IMPOBED_HUD))
holder = hud_list[i]
holder.icon_state = null
holder.pixel_x = species_offset_hud_X

if(HAS_TRAIT(src, TRAIT_VISUAL_LOYAL) || HAS_TRAIT(src, TRAIT_FAKELOYAL_VISUAL))
holder = hud_list[IMPLOYAL_HUD]
holder.icon_state = "hud_imp_loyal"
holder.pixel_y = species_offset_hud_Y
holder.pixel_x = species_offset_hud_X
y += -5

if(HAS_TRAIT(src, TRAIT_VISUAL_MINDSHIELD))
holder = hud_list[IMPMINDS_HUD]
holder.icon_state = "hud_imp_mindshield"
holder.pixel_y = y
holder.pixel_y = y + species_offset_hud_Y
holder.pixel_x = species_offset_hud_X
y += -5

if(HAS_TRAIT(src, TRAIT_VISUAL_OBEY))
holder = hud_list[IMPOBED_HUD]
holder.icon_state = "hud_imp_obedience"
holder.pixel_y = y
holder.pixel_y = y + species_offset_hud_Y
holder.pixel_x = species_offset_hud_X
y += -5

if(HAS_TRAIT(src, TRAIT_VISUAL_CHEM))
holder = hud_list[IMPCHEM_HUD]
holder.icon_state = "hud_imp_chem"
holder.pixel_y = y
holder.pixel_y = y + species_offset_hud_Y
holder.pixel_x = species_offset_hud_X
y += -5

if(HAS_TRAIT(src, TRAIT_VISUAL_TRACK))
holder = hud_list[IMPTRACK_HUD]
holder.icon_state = "hud_imp_tracking"
holder.pixel_y = y
holder.pixel_y = y + species_offset_hud_Y
holder.pixel_x = species_offset_hud_X
y += -5

/mob/living/carbon/human/proc/sec_hud_set_security_status()
var/image/holder = hud_list[WANTED_HUD]
holder.pixel_y = species.hud_offset_y
holder.pixel_x = species.hud_offset_x
var/perpname = get_visible_name(TRUE)
if(perpname)
var/datum/data/record/R = find_security_record("name", perpname)
Expand Down
39 changes: 39 additions & 0 deletions code/datums/components/fishing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/datum/component/fishing
var/list/catchable_things
var/catch_time
var/catchable_things_amount
var/catch_chance

/datum/component/fishing/Initialize(catchable_things, catch_time = 5 SECONDS, catchable_things_amount = 15, catch_chance = 50)
src.catchable_things = catchable_things
src.catch_time = catch_time
src.catchable_things_amount = catchable_things_amount
src.catch_chance = catch_chance

RegisterSignal(parent, list(COMSIG_PARENT_ATTACKBY), PROC_REF(try_catch))

/datum/component/fishing/proc/try_catch(datum/source, obj/item/I, mob/living/user)
SIGNAL_HANDLER

if(istype(I, /obj/item/weapon/wirerod) && !user.is_busy())
INVOKE_ASYNC(src, PROC_REF(start_fishing), I, user)
return COMPONENT_NO_AFTERATTACK

/datum/component/fishing/proc/start_fishing(obj/item/I, mob/living/user)
var/atom/A = parent
if(catchable_things_amount < 3)
to_chat(user, "<span class='warning'>Looks like there is almost no things left in this location.</span>")
A.visible_message("<span class='notice'>[user] starts fishing.</span>")
if(!do_after(user, catch_time, target = A))
A.visible_message("<span class='notice'>[user] stops fishing.</span>")
return
if(!prob(catch_chance))
A.visible_message("<span class='notice'>[user] fails to catch anything.</span>")
return
if(!catchable_things_amount)
to_chat(user, "<span class='warning'>No things left here, time to change location.</span>")
return
catchable_things_amount--
var/catchable_path = pickweight(catchable_things)
var/thing = new catchable_path(get_turf(A), get_step(user, get_dir(A, user)))
A.visible_message("<span class='notice'>[user] has caught [thing].</span>")
Loading

0 comments on commit cfa6be6

Please sign in to comment.