Skip to content

Commit

Permalink
Adds drawing to tacmaps (#4475)
Browse files Browse the repository at this point in the history
# About the pull request
Features 
- Gives cic (sos, xo, co) and the queen the ability to draw on the
tactical map and then announce it to their respective factions
- All marine faction members now are able to access the tactical map
announcement through the stat panel, which can be viewed at any time.
- Xenos in addition to having the normal tactical map will also have
access to their own canvas map that can be viewed when Queen is on ovi.
- Ghosts can view the tactical maps for both factions in the Ghost tab
as well as from ghost alert popups.
- Admins can view all the round's drawings and optionally delete them.
# Explain why it's good for the game
Hopefully this will spice things up for cic, queen and players alike.
The idea is command and the queen would now be able to better convey
what they want from their faction, which should help with general
cohesion and likely expand strategic plays on both sides. (don't abuse
it or harry will take it away, or make it more exclusive to the queen
and co)

# Testing photographs and procedure 
<img width="1003" alt="Screen Shot 2023-09-23 at 6 38 25 PM"
src="https://github.com/cmss13-devs/cmss13/assets/122310258/91a2c59b-3b37-4c8c-a395-54c2859ae0f0">
<img width="767" alt="Screen Shot 2023-09-23 at 6 39 08 PM"
src="https://github.com/cmss13-devs/cmss13/assets/122310258/09442be4-b05a-4248-a28f-be1099021ad5">
<img width="779" alt="Screen Shot 2023-09-23 at 6 40 22 PM"
src="https://github.com/cmss13-devs/cmss13/assets/122310258/ffe0b304-0493-43aa-be12-65a0b7287184">
<img width="909" alt="Screen Shot 2023-09-23 at 6 42 54 PM"
src="https://github.com/cmss13-devs/cmss13/assets/122310258/871be607-4f6d-4aff-8a18-9921ea9d0844">

# Changelog

:cl: Cthulhu80, Drathek 
add: Adds drawing to tactical maps, viewable via stat panel for marines
and xeno tacmap for xenos.
fix: Corrupted (and other hives) now have separate tactical maps. 
/:cl:

---------

Co-authored-by: Drathek <[email protected]>
Co-authored-by: Drulikar <[email protected]>
  • Loading branch information
3 people committed Nov 17, 2023
1 parent 145da65 commit 86f2489
Show file tree
Hide file tree
Showing 37 changed files with 1,720 additions and 65 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
#define NOTIFY_ATTACK "attack"
#define NOTIFY_ORBIT "orbit"
#define NOTIFY_JOIN_XENO "join_xeno"
#define NOTIFY_XENO_TACMAP "xeno_tacmap"
#define NOTIFY_USCM_TACMAP "uscm_tacmap"
18 changes: 11 additions & 7 deletions code/__DEFINES/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
#define MINIMAP_FLAG_UPP (1<<3)
#define MINIMAP_FLAG_CLF (1<<4)
#define MINIMAP_FLAG_YAUTJA (1<<5)
#define MINIMAP_FLAG_ALL (1<<6) - 1
#define MINIMAP_FLAG_XENO_CORRUPTED (1<<6)
#define MINIMAP_FLAG_XENO_ALPHA (1<<7)
#define MINIMAP_FLAG_XENO_BRAVO (1<<8)
#define MINIMAP_FLAG_XENO_CHARLIE (1<<9)
#define MINIMAP_FLAG_XENO_DELTA (1<<10)
#define MINIMAP_FLAG_XENO_FERAL (1<<11)
#define MINIMAP_FLAG_XENO_TAMED (1<<12)
#define MINIMAP_FLAG_XENO_MUTATED (1<<13)
#define MINIMAP_FLAG_XENO_FORSAKEN (1<<14)
#define MINIMAP_FLAG_XENO_RENEGADE (1<<15)
#define MINIMAP_FLAG_ALL (1<<16) - 1

///Converts the overworld x and y to minimap x and y values
#define MINIMAP_SCALE 2
Expand Down Expand Up @@ -77,9 +87,3 @@ GLOBAL_LIST_INIT(all_minimap_flags, bitfield2list(MINIMAP_FLAG_ALL))

#define TACMAP_BASE_OCCLUDED "Occluded"
#define TACMAP_BASE_OPEN "Open"

#define TACMAP_DEFAULT "Default"
#define TACMAP_XENO "Xeno"
#define TACMAP_YAUTJA "Yautja"
#define TACMAP_FACTION "Faction"

7 changes: 6 additions & 1 deletion code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,9 @@ world
* * moving - whether or not to use a moving state for the given icon
* * sourceonly - if TRUE, only generate the asset and send back the asset url, instead of tags that display the icon to players
* * extra_clases - string of extra css classes to use when returning the icon string
* * keyonly - if TRUE, only returns the asset key to use get_asset_url manually. Overrides sourceonly.
*/
/proc/icon2html(atom/thing, client/target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null)
/proc/icon2html(atom/thing, client/target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null, keyonly = FALSE)
if (!thing)
return

Expand Down Expand Up @@ -714,6 +715,8 @@ world
SSassets.transport.register_asset(name, thing)
for (var/thing2 in targets)
SSassets.transport.send_assets(thing2, name)
if(keyonly)
return name
if(sourceonly)
return SSassets.transport.get_asset_url(name)
return "<img class='[extra_classes] icon icon-misc' src='[SSassets.transport.get_asset_url(name)]'>"
Expand Down Expand Up @@ -756,6 +759,8 @@ world
SSassets.transport.register_asset(key, rsc_ref, file_hash, icon_path)
for (var/client_target in targets)
SSassets.transport.send_assets(client_target, key)
if(keyonly)
return key
if(sourceonly)
return SSassets.transport.get_asset_url(key)
return "<img class='[extra_classes] icon icon-[icon_state]' src='[SSassets.transport.get_asset_url(key)]'>"
Expand Down
8 changes: 8 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ GLOBAL_LIST_EMPTY(CMBFaxes)
GLOBAL_LIST_EMPTY(GeneralFaxes) //Inter-machine faxes
GLOBAL_LIST_EMPTY(fax_contents) //List of fax contents to maintain it even if source paper is deleted

//datum containing a reference to the flattend map png url, the actual png is stored in the user's cache.
GLOBAL_LIST_EMPTY(uscm_flat_tacmap_data)
GLOBAL_LIST_EMPTY(xeno_flat_tacmap_data)

//datum containing the svg overlay coords in array format.
GLOBAL_LIST_EMPTY(uscm_svg_tacmap_data)
GLOBAL_LIST_EMPTY(xeno_svg_tacmap_data)

GLOBAL_LIST_EMPTY(failed_fultons) //A list of fultoned items which weren't collected and fell back down
GLOBAL_LIST_EMPTY(larva_burst_by_hive)

Expand Down
16 changes: 16 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ GLOBAL_LIST_INIT(pill_icon_mappings, map_pill_icons())
/// In-round override to default OOC color
GLOBAL_VAR(ooc_color_override)

// tacmap cooldown for xenos and marines
GLOBAL_VAR_INIT(uscm_canvas_cooldown, 0)
GLOBAL_VAR_INIT(xeno_canvas_cooldown, 0)

// getFlatIcon cooldown for xenos and marines
GLOBAL_VAR_INIT(uscm_flatten_map_icon_cooldown, 0)
GLOBAL_VAR_INIT(xeno_flatten_map_icon_cooldown, 0)

// latest unannounced flat tacmap for xenos and marines
GLOBAL_VAR(uscm_unannounced_map)
GLOBAL_VAR(xeno_unannounced_map)

//global tacmaps for action button access
GLOBAL_DATUM_INIT(uscm_tacmap_status, /datum/tacmap/drawing/status_tab_view, new)
GLOBAL_DATUM_INIT(xeno_tacmap_status, /datum/tacmap/drawing/status_tab_view/xeno, new)

/// List of roles that can be setup for each gamemode
GLOBAL_LIST_INIT(gamemode_roles, list())

Expand Down
Loading

0 comments on commit 86f2489

Please sign in to comment.