Skip to content

Commit

Permalink
this works
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadeAware committed Mar 19, 2022
1 parent f3f1b89 commit 5ff46df
Show file tree
Hide file tree
Showing 22 changed files with 556 additions and 5 deletions.
6 changes: 6 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3397,6 +3397,7 @@
#include "maps\~unit_tests\unit_testing.dm"
#include "modular_mithra\code\__defines\misc.dm"
#include "modular_mithra\code\__defines\species.dm"
#include "modular_mithra\code\_helpers\global_lists.dm"
#include "modular_mithra\code\_onclick\click.dm"
#include "modular_mithra\code\datums\mutable_appearance.dm"
#include "modular_mithra\code\game\machinery\cryopod.dm"
Expand All @@ -3411,13 +3412,18 @@
#include "modular_mithra\code\modules\mithra\preferences_vr.dm"
#include "modular_mithra\code\modules\mithra\spawncheck.dm"
#include "modular_mithra\code\modules\mithra\sprite_accessories_vr.dm"
#include "modular_mithra\code\modules\mithra\taurbodies.dm"
#include "modular_mithra\code\modules\mithra\traits.dm"
#include "modular_mithra\code\modules\mithra\traits_negative.dm"
#include "modular_mithra\code\modules\mithra\traits_neutral.dm"
#include "modular_mithra\code\modules\mithra\traits_positive.dm"
#include "modular_mithra\code\modules\mithra\update_icons_vr.dm"
#include "modular_mithra\code\modules\mob\animations.dm"
#include "modular_mithra\code\modules\mob\inventory.dm"
#include "modular_mithra\code\modules\mob\living\carbon\human\species\trait_stuff\traits.dm"
#include "modular_mithra\code\modules\mob\living\carbon\human\species\trait_stuff\weaver_abilities.dm"
#include "modular_mithra\code\modules\mob\living\carbon\human\species\trait_stuff\weaver_constructions.dm"
#include "modular_mithra\code\modules\mob\living\carbon\human\species\trait_stuff\weaver_objects.dm"
#include "modular_mithra\code\modules\organs\robolimbs.dm"
#include "modular_mithra\code\modules\reagents\reagent_containers\glass.dm"
#include "modular_mithra\code\modules\research\designs.dm"
Expand Down
10 changes: 10 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@

handle_medical_side_effects()

process_weaver_silk()

if(!client && !mind)
species.handle_npc(src)

Expand Down Expand Up @@ -1147,3 +1149,11 @@
..()
if((CE_THIRDEYE in chem_effects) || (MUTATION_XRAY in mutations))
set_sight(sight|SEE_TURFS|SEE_MOBS|SEE_OBJS)

/mob/living/carbon/human/proc/process_weaver_silk()
if(!species || !(species.is_weaver))
return

if(species.silk_reserve < species.silk_max_reserve && species.silk_production == TRUE && nutrition > 100)
species.silk_reserve = min(species.silk_reserve + 2, species.silk_max_reserve)
adjust_nutrition(-0.4)
51 changes: 49 additions & 2 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ var/global/list/damage_icon_parts = list()

// blend the individual damage states with our icons
for(var/obj/item/organ/external/O in organs)
if(O.is_stump())
if(isnull(O) || O.is_stump() || O.is_hidden_by_tail())
continue

O.update_damstate()
Expand Down Expand Up @@ -309,7 +309,7 @@ var/global/list/damage_icon_parts = list()

for(var/organ_tag in species.has_limbs)
var/obj/item/organ/external/part = organs_by_name[organ_tag]
if(isnull(part) || part.is_stump())
if(isnull(part) || part.is_stump() || part.is_hidden_by_tail()) //Edit allowing tails to prevent bodyparts rendering, granting more spriter freedom for taur/digitigrade stuff.
icon_key += "0"
continue
for(var/M in part.markings)
Expand All @@ -328,13 +328,17 @@ var/global/list/damage_icon_parts = list()
icon_key += "#000000"
for(var/M in part.markings)
icon_key += "[M][part.markings[M]["color"]]"
if(istype(tail_style, /datum/sprite_accessory/tail/taur))
if(tail_style.clip_mask) //VOREStation Edit.
icon_key += tail_style.clip_mask_state
if(BP_IS_ROBOTIC(part))
icon_key += "2[part.model ? "-[part.model]": ""]"
else if(part.status & ORGAN_DEAD)
icon_key += "3"
else
icon_key += "1"


icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"

var/icon/base_icon
Expand All @@ -345,6 +349,20 @@ var/global/list/damage_icon_parts = list()
var/obj/item/organ/external/chest = get_organ(BP_CHEST)
base_icon = chest.get_icon()

var/icon/Cutter = null

if(istype(tail_style, /datum/sprite_accessory/tail/taur)) // Tail icon 'cookie cutters' are filled in where icons are preserved. We need to invert that.
if(tail_style.clip_mask) //VOREStation Edit.
Cutter = new(icon = tail_style.icon, icon_state = tail_style.clip_mask_state)

Cutter.Blend("#000000", ICON_MULTIPLY) // Make it all black.

Cutter.SwapColor("#00000000", "#FFFFFFFF") // Everywhere empty, make white.
Cutter.SwapColor("#000000FF", "#00000000") // Everywhere black, make empty.

Cutter.Blend("#000000", ICON_MULTIPLY) // Black again.


for(var/obj/item/organ/external/part in (organs-chest))
var/icon/temp = part.get_icon()
//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
Expand All @@ -368,6 +386,35 @@ var/global/list/damage_icon_parts = list()
else
base_icon.Blend(temp, ICON_OVERLAY)

for(var/obj/item/organ/external/part in organs)
if(isnull(part) || part.is_stump() || part.is_hidden_by_tail()) //VOREStation Edit allowing tails to prevent bodyparts rendering, granting more spriter freedom for taur/digitigrade stuff.
continue
var/icon/temp = part.get_icon(skeleton)

if((part.organ_tag in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)) && Cutter)
temp.Blend(Cutter, ICON_AND, x = -16) //WAS 16, NOW 32

//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
//And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part)
if(part.icon_position & (LEFT | RIGHT))
var/icon/temp2 = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi', icon_state = "blank")
temp2.Insert(new/icon(temp,dir=NORTH),dir=NORTH)
temp2.Insert(new/icon(temp,dir=SOUTH),dir=SOUTH)
if(!(part.icon_position & LEFT))
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(!(part.icon_position & RIGHT))
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_OVERLAY)
if(part.icon_position & LEFT)
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(part.icon_position & RIGHT)
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_UNDERLAY)
else if(part.icon_position & UNDER)
base_icon.Blend(temp, ICON_UNDERLAY)
else
base_icon.Blend(temp, ICON_OVERLAY)

if(!skeleton)
if(husk)
base_icon.ColorTone(husk_color_mod)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/organs/external/_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1380,3 +1380,7 @@ obj/item/organ/external/proc/remove_clamps()
. += max_delay * 3/8
else if(BP_IS_ROBOTIC(src))
. += max_delay * CLAMP01(damage/max_damage)

/obj/item/organ/external/proc/is_hidden_by_tail()
if(owner && owner.tail_style && owner.tail_style.hide_body_parts && (organ_tag in owner.tail_style.hide_body_parts))
return 1
6 changes: 6 additions & 0 deletions code/modules/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
var/min_age = 18
var/max_age = 70

var/is_weaver = FALSE
var/silk_production = FALSE
var/silk_reserve = 100
var/silk_max_reserve = 500
var/silk_color = "#FFFFFF"

// Speech vars.
var/assisted_langs = list() // The languages the species can't speak without an assisted organ.
var/list/speech_sounds // A list of sounds to potentially play when speaking.
Expand Down
Binary file not shown.
Binary file added icons/mob/taurmob/taursuits_naga.dmi
Binary file not shown.
Binary file added icons/mob/taurmob/taursuits_slug.dmi
Binary file not shown.
Binary file added icons/mob/taurmob/taursuits_spider.dmi
Binary file not shown.
Binary file added icons/weaver_icons_vr.dmi
Binary file not shown.
5 changes: 4 additions & 1 deletion modular_mithra/code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

//For custom species
#define STARTING_SPECIES_POINTS 1
#define MAX_SPECIES_TRAITS 5
#define MAX_SPECIES_TRAITS 5

//taur helpers
#define istaurtail(A) istype(A, /datum/sprite_accessory/tail/taur)
22 changes: 22 additions & 0 deletions modular_mithra/code/_helpers/global_lists.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/hook/startup/proc/init_mirthacustom_datum_ref_lists()
var/paths

// Weaver recipe stuff
paths = subtypesof(/datum/weaver_recipe/structure)
for(var/path in paths)
var/datum/weaver_recipe/instance = new path()
if(!instance.title)
continue //A prototype or something
weavable_structures[instance.title] = instance

paths = subtypesof(/datum/weaver_recipe/item)
for(var/path in paths)
var/datum/weaver_recipe/instance = new path()
if(!instance.title)
continue //A prototype or something
weavable_items[instance.title] = instance

return 1 // Hooks must return 1

var/global/list/weavable_structures = list()
var/global/list/weavable_items = list()
10 changes: 10 additions & 0 deletions modular_mithra/code/modules/mithra/sprite_accessories_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@
var/ani_state // State when wagging/animated
var/extra_overlay_w // Wagging state for extra overlay

var/list/hide_body_parts = list() //Uses organ tag defines. Bodyparts in this list do not have their icons rendered, allowing for more spriter freedom when doing taur/digitigrade stuff.

var/icon/clip_mask_icon = null //Icon file used for clip mask.
var/clip_mask_state = null //Icon state to generate clip mask. Clip mask is used to 'clip' off the lower part of clothing such as jumpsuits & full suits.
var/icon/clip_mask = null //Instantiated clip mask of given icon and state

/datum/sprite_accessory/tail/New()
. = ..()
if(clip_mask_icon && clip_mask_state)
clip_mask = icon(icon = clip_mask_icon, icon_state = clip_mask_state)

/datum/sprite_accessory/tail/invisible
name = "hide species-sprite tail"
Expand Down
149 changes: 149 additions & 0 deletions modular_mithra/code/modules/mithra/taurbodies.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
//Hi, hey, hello!
//This was ripped from VIRGO STATION (Copied directly, comments and all). Credit goes to them for the majority of this! I am not a coder.
//Please don't mess with the code unless you know what you're doing.
// -ShadeAware

//ADDING TAUR BODIES CRASH COURSE:
// Get an icon, put it in 'icons/mob/human_races/sprite_accessories/taurs.dmi'
// Create a datum like below
// Name it, set the icon_state to the name of the sprite in the .dmi file.
// If your icon fiddles with normal legs a lot, ENSURE you have a clip_mask_icon AND clip_mask_state to cut off the sprites of clothing! Example includes the Spider Taur.
// OPTIONAL: Set a suit sprite if you've sprited hardsuit bodies for them. Remember the icon sprite tag!

/datum/sprite_accessory/tail/taur
name = "You should not see this..."
icon = 'icons/mob/human_races/sprite_accessories/taurs.dmi'
do_colouration = 1 // Yes color, using tail color
color_blend_mode = ICON_MULTIPLY // The sprites for taurs are designed for ICON_MULTIPLY

var/icon/suit_sprites = null //File for suit sprites, if any.
var/icon/under_sprites = null

var/icon_sprite_tag // This is where we put stuff like _Horse, so we can assign icons easier.

hide_body_parts = list(BP_L_LEG, BP_L_FOOT, BP_R_LEG, BP_R_FOOT) //Exclude pelvis just in case.
clip_mask_icon = 'icons/mob/human_races/sprite_accessories/taurs.dmi'
clip_mask_state = "taur_clip_mask_def" //Used to clip off the lower part of suits & uniforms.

// Species-unique long tails/taurhalves

// Tails/taurhalves for everyone

/datum/sprite_accessory/tail/taur/naga
name = "Naga (Taur)"
icon_state = "naga_s"
suit_sprites = 'icons/mob/taurmob/taursuits_naga.dmi'
icon_sprite_tag = "naga"

/datum/sprite_accessory/tail/taur/naga/naga_2c
name = "Naga dual-color (Taur)"
icon_state = "naga_s"
extra_overlay = "naga_markings"
icon_sprite_tag = "naga"

/datum/sprite_accessory/tail/taur/spider
name = "Spider (Taur)"
icon_state = "spider_s"
suit_sprites = 'icons/mob/taurmob/taursuits_spider.dmi'
icon_sprite_tag = "spider"

/datum/sprite_accessory/tail/taur/tents
name = "Tentacles (Taur)"
icon_state = "tentacle_s"
icon_sprite_tag = "tentacle"

/datum/sprite_accessory/tail/taur/slug
name = "Slug (Taur)"
icon_state = "slug_s"
suit_sprites = 'icons/mob/taurmob/taursuits_slug.dmi'
icon_sprite_tag = "slug"

/datum/sprite_accessory/tail/taur/alraune_2c
name = "Alraune (dual color)"
icon_state = "alraunecolor_s"
ani_state = "alraunecolor_closed_s"
do_colouration = 1
extra_overlay = "alraunecolor_markings"
extra_overlay_w = "alraunecolor_closed_markings"
clip_mask_state = "taur_clip_mask_alraune"
icon_sprite_tag = "alraune"

/datum/sprite_accessory/tail/taur/wasp
name = "Wasp (dual color)"
icon_state = "wasp_s"
extra_overlay = "wasp_markings"
clip_mask_state = "taur_clip_mask_wasp"
icon_sprite_tag = "wasp"

/*/datum/sprite_accessory/tail/taur/mermaid
name = "Mermaid (Taur)"
icon_state = "mermaid_s"
icon_sprite_tag = "mermaid"*/

/datum/sprite_accessory/tail/taur/wolf
name = "Wolf (Taur)"
icon_state = "wolf_s"
//under_sprites = 'icons/mob/taursuits_wolf.dmi'
//suit_sprites = 'icons/mob/taursuits_wolf.dmi'
icon_sprite_tag = "wolf"

/datum/sprite_accessory/tail/taur/wolf/wolf_2c
name = "Wolf dual-color (Taur)"
icon_state = "wolf_s"
extra_overlay = "wolf_markings"
icon_sprite_tag = "wolf2c"

/datum/sprite_accessory/tail/taur/wolf/synthwolf
name = "SynthWolf dual-color (Taur)"
icon_state = "synthwolf_s"
extra_overlay = "synthwolf_markings"
icon_sprite_tag = "synthwolf"

/datum/sprite_accessory/tail/taur/horse
name = "Horse (Taur)"
icon_state = "horse_s"
//under_sprites = 'icons/mob/taursuits_horse.dmi'
//suit_sprites = 'icons/mob/taursuits_horse.dmi'
icon_sprite_tag = "horse"

/datum/sprite_accessory/tail/taur/horse/horse_2c
name = "Horse & colorable tail (Taur)"
extra_overlay = "horse_markings"
icon_sprite_tag = "wolf2c"

/datum/sprite_accessory/tail/taur/horse/synthhorse
name = "SynthHorse dual-color (Taur)"
icon_state = "synthhorse_s"
extra_overlay = "synthhorse_markings"
icon_sprite_tag = "synthhorse"

/datum/sprite_accessory/tail/taur/cow
name = "Cow (Taur)"
icon_state = "cow_s"
//suit_sprites = 'icons/mob/taursuits_cow.dmi'
icon_sprite_tag = "cow"

/datum/sprite_accessory/tail/taur/deer
name = "Deer dual-color (Taur)"
icon_state = "deer_s"
extra_overlay = "deer_markings"
//suit_sprites = 'icons/mob/taursuits_deer.dmi'
icon_sprite_tag = "deer"

/datum/sprite_accessory/tail/taur/lizard
name = "Lizard (Taur)"
icon_state = "lizard_s"
//suit_sprites = 'icons/mob/taursuits_lizard.dmi'
icon_sprite_tag = "lizard"

/datum/sprite_accessory/tail/taur/lizard/lizard_2c
name = "Lizard dual-color (Taur)"
icon_state = "lizard_s"
extra_overlay = "lizard_markings"
icon_sprite_tag = "lizard2c"

/datum/sprite_accessory/tail/taur/lizard/synthlizard
name = "SynthLizard dual-color (Taur)"
icon_state = "synthlizard_s"
extra_overlay = "synthlizard_markings"
icon_sprite_tag = "synthlizard"
10 changes: 8 additions & 2 deletions modular_mithra/code/modules/mithra/update_icons_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var/global/list/wing_icon_cache = list()
return image(tail_s)

//If you have a custom tail selected
if(tail_style && !(wear_suit && wear_suit.flags_inv & HIDETAIL))
if(tail_style && !(wear_suit && wear_suit.flags_inv & HIDETAIL && !istaurtail(tail_style)))
var/icon/tail_s = new/icon("icon" = tail_style.icon, "icon_state" = tail_style.ani_state ? tail_style.ani_state : tail_style.icon_state)
if(tail_style.do_colouration)
tail_s.Blend(rgb(src.r_tail, src.g_tail, src.b_tail), tail_style.color_blend_mode)
Expand Down Expand Up @@ -54,7 +54,13 @@ var/global/list/wing_icon_cache = list()
tail_s.Blend(overlay, ICON_OVERLAY)
qdel(overlay)

return image(tail_s)
var/image/working = image(tail_s)

if(istaurtail(tail_style))
//var/datum/sprite_accessory/tail/taur/taurtype = tail_style
working.pixel_x = -16

return working
return null

/mob/living/carbon/human/
Expand Down
Loading

0 comments on commit 5ff46df

Please sign in to comment.