-
-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,064 additions
and
781 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
//* This file is explicitly licensed under the MIT license. *// | ||
//* Copyright (c) 2024 Citadel Station Developers *// | ||
|
||
/** | ||
* Declares a type of flooring. | ||
* | ||
* * Will generate two types. /datum/prototype/flooring/<type>, and /turf/simulated/floor/preset/<type> | ||
* * Will generate the standard (see standard turfmakers) types for the preset turf as well. | ||
* * Name is automatically set on the turf. | ||
* * Icon is automatically set on the turf. | ||
* * Icon state is automatically set on the turf. Make sure the `icon_state` exists in the icon. | ||
* * `mz_flags` is automatically set on the turf. | ||
*/ | ||
#define DECLARE_FLOORING(TYPE) \ | ||
CREATE_STANDARD_TURFS(/turf/simulated/floor/preset##TYPE); \ | ||
/turf/simulated/floor/preset##TYPE { \ | ||
initial_flooring = /datum/prototype/flooring##TYPE; \ | ||
name = /datum/prototype/flooring##TYPE::name; \ | ||
icon = /datum/prototype/flooring##TYPE::icon; \ | ||
icon_state = /datum/prototype/flooring##TYPE::icon_base; \ | ||
mz_flags = /datum/prototype/flooring##TYPE::mz_flags; \ | ||
}; \ | ||
/datum/prototype/flooring##TYPE { \ | ||
__is_not_legacy = TRUE; \ | ||
} \ | ||
/datum/prototype/flooring##TYPE |
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,36 @@ | ||
//* This file is explicitly licensed under the MIT license. *// | ||
//* Copyright (c) 2024 Citadel Station Developers *// | ||
|
||
REPOSITORY_DEF(flooring) | ||
name = "Repository - Flooring" | ||
expected_type = /datum/prototype/flooring | ||
|
||
/// item type to buildable floor type | ||
var/list/build_item_lookup | ||
/// material id to buildable floor type | ||
var/list/build_material_lookup | ||
|
||
/datum/controller/repository/flooring/Create() | ||
build_item_lookup = list() | ||
build_material_lookup = list() | ||
return ..() | ||
|
||
/datum/controller/repository/flooring/load(datum/prototype/flooring/instance) | ||
. = ..() | ||
if(!.) | ||
return | ||
if(ispath(instance.build_type, /obj/item/stack)) | ||
LAZYADD(build_item_lookup[instance.build_type], instance) | ||
else if(ispath(instance.build_type, /datum/prototype/material)) | ||
var/datum/prototype/material/casted_material = instance.build_type | ||
LAZYADD(build_material_lookup[initial(casted_material.id)], instance) | ||
|
||
/datum/controller/repository/flooring/unload(datum/prototype/flooring/instance) | ||
. = ..() | ||
if(!.) | ||
return | ||
if(ispath(instance.build_type, /obj/item/stack)) | ||
LAZYREMOVE(build_item_lookup[instance.build_type], instance) | ||
else if(ispath(instance.build_type, /datum/prototype/material)) | ||
var/datum/prototype/material/casted_material = instance.build_type | ||
LAZYREMOVE(build_material_lookup[initial(casted_material.id)], instance) |
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
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,117 @@ | ||
|
||
/atom/proc/get_examine_name(mob/user) | ||
. = "\a <b>[src]</b>" | ||
var/list/override = list(gender == PLURAL ? "some" : "a", " ", "[name]") | ||
|
||
var/should_override = FALSE | ||
|
||
if(SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override) & COMPONENT_EXNAME_CHANGED) | ||
should_override = TRUE | ||
|
||
|
||
if(blood_DNA && !istype(src, /obj/effect/decal)) | ||
override[EXAMINE_POSITION_BEFORE] = " blood-stained " | ||
should_override = TRUE | ||
|
||
if(should_override) | ||
. = override.Join("") | ||
|
||
/atom/proc/get_examine_desc(mob/user, dist) | ||
return desc | ||
|
||
/// Generate the full examine string of this atom (including icon for goonchat) | ||
/atom/proc/get_examine_string(mob/user, thats = FALSE) | ||
return "[icon2html(src, user)] [thats? "That's ":""][get_examine_name(user)]" | ||
|
||
/** | ||
* Returns an extended list of examine strings for any contained ID cards. | ||
* | ||
* Arguments: | ||
* * user - The user who is doing the examining. | ||
*/ | ||
/atom/proc/get_id_examine_strings(mob/user) | ||
. = list() | ||
return | ||
|
||
/// Used to insert text after the name but before the description in examine() | ||
/atom/proc/get_name_chaser(mob/user, list/name_chaser = list()) | ||
return name_chaser | ||
|
||
/** | ||
* Called when a mob examines (shift click or verb) this atom | ||
* | ||
* Default behaviour is to get the name and icon of the object and it's reagents where | ||
* the [TRANSPARENT] flag is set on the reagents holder | ||
* | ||
* Produces a signal [COMSIG_PARENT_EXAMINE] | ||
* | ||
* @params | ||
* * user - who's examining. can be null | ||
* * dist - effective distance of examine, usually from user to src. | ||
*/ | ||
/atom/proc/examine(mob/user, dist = 1) | ||
var/examine_string = get_examine_string(user, thats = TRUE) | ||
if(examine_string) | ||
. = list("[examine_string].") | ||
else | ||
. = list() | ||
|
||
. += get_name_chaser(user) | ||
if(desc) | ||
. += "<hr>[get_examine_desc(user, dist)]" | ||
if(get_description_info() || get_description_fluff() || length(get_description_interaction(user))) | ||
. += SPAN_TINYNOTICE("<a href='byond://winset?command=.statpanel_goto_tab \"Examine\"'>For more information, click here.</a>") //This feels VERY HACKY but eh its PROBABLY fine | ||
if(integrity_flags & INTEGRITY_INDESTRUCTIBLE) | ||
. += SPAN_NOTICE("It doesn't look like it can be damaged through common means.") | ||
/* | ||
if(custom_materials) | ||
var/list/materials_list = list() | ||
for(var/datum/prototype/material/current_material as anything in custom_materials) | ||
materials_list += "[current_material.name]" | ||
. += "<u>It is made out of [english_list(materials_list)]</u>." | ||
*/ | ||
if(reagents) | ||
if(reagents.reagents_holder_flags & TRANSPARENT) | ||
. += "It contains:" | ||
if(length(reagents.reagent_list)) | ||
var/has_alcohol = FALSE | ||
if(user.can_see_reagents()) //Show each individual reagent | ||
for(var/datum/reagent/current_reagent as anything in reagents.reagent_list) | ||
if(!has_alcohol && istype(current_reagent,/datum/reagent/ethanol)) | ||
has_alcohol = TRUE | ||
. += "• [round(current_reagent.volume, 0.01)] units of [current_reagent.name]" | ||
else //Otherwise, just show the total volume | ||
var/total_volume = 0 | ||
for(var/datum/reagent/current_reagent as anything in reagents.reagent_list) | ||
if(!has_alcohol && istype(current_reagent,/datum/reagent/ethanol)) | ||
has_alcohol = TRUE | ||
total_volume += current_reagent.volume | ||
. += "[total_volume] units of various reagents" | ||
if(has_alcohol) | ||
. += "It smells of alcohol." | ||
else | ||
. += "Nothing." | ||
else if(reagents.reagents_holder_flags & AMOUNT_VISIBLE) | ||
if(reagents.total_volume) | ||
. += SPAN_NOTICE("It has [reagents.total_volume] unit\s left.") | ||
else | ||
. += SPAN_DANGER("It's empty.") | ||
|
||
MATERIAL_INVOKE(src, MATERIAL_TRAIT_EXAMINE, on_examine, ., user, dist) | ||
|
||
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) | ||
|
||
/** | ||
* Called when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1 second) | ||
* | ||
* This is where you can put extra information on something that may be superfluous or not important in critical gameplay | ||
* moments, while allowing people to manually double-examine to take a closer look | ||
* | ||
* Produces a signal [COMSIG_PARENT_EXAMINE_MORE] | ||
*/ | ||
/atom/proc/examine_more(mob/user) | ||
SHOULD_CALL_PARENT(TRUE) | ||
RETURN_TYPE(/list) | ||
|
||
. = list() | ||
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE_MORE, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//* This file is explicitly licensed under the MIT license. *// | ||
//* Copyright (c) 2024 Citadel Station Developers *// | ||
|
||
/** | ||
* * Does not have ( wrappings ). | ||
* * Does not recursively output our location if nested, only the overall turf. | ||
*/ | ||
/atom/proc/coord_log_string() | ||
return "[x],[y],[z]" |
Oops, something went wrong.