diff --git a/code/__DEFINES/fish.dm b/code/__DEFINES/fish.dm index 52eb9152730..62954a649e2 100644 --- a/code/__DEFINES/fish.dm +++ b/code/__DEFINES/fish.dm @@ -97,6 +97,7 @@ #define AQUARIUM_LAYER_MODE_BOTTOM "bottom" #define AQUARIUM_LAYER_MODE_TOP "top" #define AQUARIUM_LAYER_MODE_AUTO "auto" +#define AQUARIUM_LAYER_MODE_BEHIND_GLASS "behind_glass" #define FISH_ALIVE "alive" #define FISH_DEAD "dead" diff --git a/code/modules/fishing/aquarium/aquarium.dm b/code/modules/fishing/aquarium/aquarium.dm index 88d0791acdf..5eb2a7f4374 100644 --- a/code/modules/fishing/aquarium/aquarium.dm +++ b/code/modules/fishing/aquarium/aquarium.dm @@ -1,7 +1,13 @@ #define AQUARIUM_LAYER_STEP 0.01 /// Aquarium content layer offsets -#define AQUARIUM_MIN_OFFSET 0.01 +#define AQUARIUM_MIN_OFFSET 0.02 #define AQUARIUM_MAX_OFFSET 1 +/// The layer of the glass overlay +#define AQUARIUM_GLASS_LAYER 0.01 +/// The layer of the aquarium pane borders +#define AQUARIUM_BORDERS_LAYER AQUARIUM_MAX_OFFSET + AQUARIUM_LAYER_STEP +/// Layer for stuff rendered below the glass overlay +#define AQUARIUM_BELOW_GLASS_LAYER 0.01 /obj/structure/aquarium name = "aquarium" @@ -10,7 +16,7 @@ anchored = TRUE icon = 'icons/obj/aquarium.dmi' - icon_state = "aquarium_base" + icon_state = "aquarium_map" integrity_failure = 0.3 @@ -27,9 +33,6 @@ /// Can fish reproduce in this quarium. var/allow_breeding = FALSE - var/glass_icon_state = "aquarium_glass" - var/broken_glass_icon_state = "aquarium_glass_broken" - //This is the area where fish can swim var/aquarium_zone_min_px = 2 var/aquarium_zone_max_px = 31 @@ -55,6 +58,7 @@ create_reagents(6, SEALED_CONTAINER) RegisterSignal(reagents, COMSIG_REAGENTS_NEW_REAGENT, PROC_REF(start_autofeed)) AddComponent(/datum/component/plumbing/aquarium) + ADD_KEEP_TOGETHER(src, INNATE_TRAIT) /obj/structure/aquarium/proc/track_if_fish(atom/source, atom/initialized) SIGNAL_HANDLER @@ -108,13 +112,15 @@ */ //optional todo: hook up sending surface changed on aquarium changing layers switch(layer_type) + if(AQUARIUM_LAYER_MODE_BEHIND_GLASS) + return AQUARIUM_BELOW_GLASS_LAYER if(AQUARIUM_LAYER_MODE_BOTTOM) - return layer + AQUARIUM_MIN_OFFSET + return AQUARIUM_MIN_OFFSET if(AQUARIUM_LAYER_MODE_TOP) - return layer + AQUARIUM_MAX_OFFSET + return AQUARIUM_MAX_OFFSET if(AQUARIUM_LAYER_MODE_AUTO) - var/chosen_layer = layer + AQUARIUM_MIN_OFFSET + AQUARIUM_LAYER_STEP - while((chosen_layer in used_layers) && (chosen_layer <= layer + AQUARIUM_MAX_OFFSET)) + var/chosen_layer = AQUARIUM_MIN_OFFSET + AQUARIUM_LAYER_STEP + while((chosen_layer in used_layers) && (chosen_layer <= AQUARIUM_MAX_OFFSET)) chosen_layer += AQUARIUM_LAYER_STEP used_layers += chosen_layer return chosen_layer @@ -129,14 +135,23 @@ .[AQUARIUM_PROPERTIES_PY_MIN] = aquarium_zone_min_py .[AQUARIUM_PROPERTIES_PY_MAX] = aquarium_zone_max_py +/obj/structure/aquarium/update_icon() + . = ..() + ///"aquarium_map" is used for mapping, so mappers can tell what it's. + icon_state = "aquarium_base" + /obj/structure/aquarium/update_overlays() . = ..() if(panel_open) . += "panel" - //Glass overlay goes on top of everything else. - var/mutable_appearance/glass_overlay = mutable_appearance(icon,broken ? broken_glass_icon_state : glass_icon_state,layer=AQUARIUM_MAX_OFFSET-1) - . += glass_overlay + ///The glass overlay + var/suffix = fluid_type == AQUARIUM_FLUID_AIR ? "air" : "water" + if(broken) + suffix += "_broken" + . += mutable_appearance(icon, "aquarium_glass_cracks", layer = AQUARIUM_BORDERS_LAYER) + . += mutable_appearance(icon, "aquarium_glass_[suffix]", layer = AQUARIUM_GLASS_LAYER) + . += mutable_appearance(icon, "aquarium_borders", layer = AQUARIUM_BORDERS_LAYER) /obj/structure/aquarium/examine(mob/user) . = ..() @@ -338,11 +353,14 @@ #undef AQUARIUM_LAYER_STEP #undef AQUARIUM_MIN_OFFSET #undef AQUARIUM_MAX_OFFSET +#undef AQUARIUM_GLASS_LAYER +#undef AQUARIUM_BORDERS_LAYER +#undef AQUARIUM_BELOW_GLASS_LAYER /obj/structure/aquarium/prefilled/Initialize(mapload) . = ..() - new /obj/item/aquarium_prop/rocks(src) + new /obj/item/aquarium_prop/sand(src) new /obj/item/aquarium_prop/seaweed(src) new /obj/item/fish/goldfish(src) diff --git a/code/modules/fishing/aquarium/aquarium_kit.dm b/code/modules/fishing/aquarium/aquarium_kit.dm index d7547e92ef6..3aafa178f26 100644 --- a/code/modules/fishing/aquarium/aquarium_kit.dm +++ b/code/modules/fishing/aquarium/aquarium_kit.dm @@ -127,10 +127,10 @@ icon_state = "seaweeds_back" layer_mode = AQUARIUM_LAYER_MODE_BOTTOM -/obj/item/aquarium_prop/rockfloor - name = "rock floor" - icon_state = "rockfloor" - layer_mode = AQUARIUM_LAYER_MODE_BOTTOM +/obj/item/aquarium_prop/sand + name = "aquarium sand" + icon_state = "sand" + layer_mode = AQUARIUM_LAYER_MODE_BEHIND_GLASS /obj/item/aquarium_prop/treasure name = "tiny treasure chest" diff --git a/code/modules/fishing/fish/fish_types.dm b/code/modules/fishing/fish/fish_types.dm index 5ff62266ad9..51fcf61307a 100644 --- a/code/modules/fishing/fish/fish_types.dm +++ b/code/modules/fishing/fish/fish_types.dm @@ -203,6 +203,8 @@ name = "needlefish" desc = "A tiny, transparent fish which resides in large schools in the oceans of Tizira. A common food for other, larger fish." icon_state = "needlefish" + dedicated_in_aquarium_icon_state = "needlefish_small" + sprite_width = 7 required_fluid_type = AQUARIUM_FLUID_SALTWATER stable_population = 12 fillet_type = null @@ -216,6 +218,9 @@ name = "armorfish" desc = "A small shellfish native to Tizira's oceans, known for its exceptionally hard shell. Consumed similarly to prawns." icon_state = "armorfish" + dedicated_in_aquarium_icon_state = "armorfish_small" + sprite_height = 5 + sprite_width = 6 required_fluid_type = AQUARIUM_FLUID_SALTWATER stable_population = 10 fillet_type = /obj/item/food/fishmeat/armorfish @@ -231,8 +236,6 @@ dedicated_in_aquarium_icon_state = "chrab_small" sprite_height = 9 sprite_width = 8 - source_height = 9 - source_width = 8 stable_population = 4 feeding_frequency = 15 MINUTES random_case_rarity = FISH_RARITY_RARE diff --git a/icons/obj/aquarium.dmi b/icons/obj/aquarium.dmi index 19e2e68c4f8..64f67563723 100644 Binary files a/icons/obj/aquarium.dmi and b/icons/obj/aquarium.dmi differ