Merge pull request #1427 from CHOMPStationBot/upstream-merge-9793

[MIRROR] Silky, silky webs. Adds Weaver trait, with ability to weave spiderwebs and more!
This commit is contained in:
Nadyr
2021-02-28 08:08:43 -05:00
committed by GitHub
13 changed files with 358 additions and 46 deletions

View File

@@ -539,4 +539,22 @@ var/global/list/remainless_species = list(SPECIES_PROMETHEAN,
for(var/species_name in whitelisted_icons)
custom_species_bases += species_name
// Weaver recipe stuff
paths = typesof(/datum/weaver_recipe/structure) - /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 = typesof(/datum/weaver_recipe/item) - /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()

View File

@@ -200,10 +200,6 @@ var/global/list/datum/dna/gene/dna_genes[0]
size_multiplier = player_sizes_list.Find(N)
break
var/taurtype = /datum/sprite_accessory/tail/taur/spider
if(istype(character.tail_style, taurtype))
character.verbs += /mob/living/proc/weaveWebBindings
// Technically custom_species is not part of the UI, but this place avoids merge problems.
src.custom_species = character.custom_species
src.base_species = character.species.base_species

View File

@@ -69,7 +69,8 @@
//Organs and blood
handle_organs()
stabilize_body_temperature() //Body temperature adjusts itself (self-regulation)
weightgain() //VORESTATION EDIT
weightgain() //VOREStation Addition
process_weaver_silk() //VOREStation Addition
handle_shock()
handle_pain()
@@ -77,7 +78,7 @@
handle_medical_side_effects()
handle_heartbeat()
handle_nif() //VOREStation Add
handle_nif() //VOREStation Addition
if(!client)
species.handle_npc(src)

View File

@@ -6,6 +6,14 @@
else if (nutrition <= MAX_NUTRITION_TO_LOSE && stat != 2 && weight > MIN_MOB_WEIGHT && weight_loss)
weight -= species.metabolism*(0.01*weight_loss) // starvation weight loss
/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)
/mob/living/carbon/human/proc/handle_hud_list_vr()
//Right-side status hud updates with left side one.

View File

@@ -20,6 +20,11 @@
var/wikilink = null //link to wiki page for species
var/icon_height = 32
var/agility = 20 //prob() to do agile things
var/is_weaver = FALSE
var/silk_production = FALSE
var/silk_reserve = 100
var/silk_max_reserve = 500
var/silk_color = "#FFFFFF"
var/list/traits = list()

View File

@@ -850,3 +850,150 @@
set category = "Abilities"
pass_flags ^= PASSTABLE //I dunno what this fancy ^= is but Aronai gave it to me.
to_chat(src, "You [pass_flags&PASSTABLE ? "will" : "will NOT"] move over tables/railings/trays!")
/mob/living/carbon/human/proc/check_silk_amount()
set name = "Check Silk Amount"
set category = "Abilities"
if(species.is_weaver)
to_chat(src, "Your silk reserves are at [species.silk_reserve]/[species.silk_max_reserve].")
else
to_chat(src, "<span class='warning'>You are not a weaver! How are you doing this? Tell a developer!</span>")
/mob/living/carbon/human/proc/toggle_silk_production()
set name = "Toggle Silk Production"
set category = "Abilities"
if(species.is_weaver)
species.silk_production = !(species.silk_production)
to_chat(src, "You are [species.silk_production ? "now" : "no longer"] producing silk.")
else
to_chat(src, "<span class='warning'>You are not a weaver! How are you doing this? Tell a developer!</span>")
/mob/living/carbon/human/proc/weave_structure()
set name = "Weave Structure"
set category = "Abilities"
if(!(species.is_weaver))
to_chat(src, "<span class='warning'>You are not a weaver! How are you doing this? Tell a developer!</span>")
return
var/choice
var/datum/weaver_recipe/structure/desired_result
var/finalized = "No"
while(finalized == "No" && src.client)
choice = input(src,"What would you like to weave?") as null|anything in weavable_structures
desired_result = weavable_structures[choice]
if(!desired_result || !istype(desired_result))
return
if(choice)
finalized = alert(src, "Are you sure you want to weave [desired_result.title]? It will cost you [desired_result.cost] silk.","Confirmation","Yes","No")
if(!desired_result || !istype(desired_result))
return
if(desired_result.cost > species.silk_reserve)
to_chat(src, "<span class='warning'>You don't have enough silk to weave that!</span>")
return
if(stat)
to_chat(src, "<span class='warning'>You can't do that in your current state!</span>")
return
if(locate(desired_result.result_type) in src.loc)
to_chat(src, "<span class='warning'>You can't create another weaversilk [desired_result.title] here!</span>")
return
if(!isturf(src.loc))
to_chat(src, "<span class='warning'>You can't weave here!</span>")
return
if(do_after(src, desired_result.time, exclusive = TRUE))
if(desired_result.cost > species.silk_reserve)
to_chat(src, "<span class='warning'>You don't have enough silk to weave that!</span>")
return
if(locate(desired_result.result_type) in src.loc)
to_chat(src, "<span class='warning'>You can't create another weaversilk [desired_result.title] here!</span>")
return
if(!isturf(src.loc))
to_chat(src, "<span class='warning'>You can't weave here!</span>")
return
species.silk_reserve = max(species.silk_reserve - desired_result.cost, 0)
//new desired_result.result_type(src.loc)
var/atom/O = new desired_result.result_type(src.loc)
O.color = species.silk_color
/mob/living/carbon/human/proc/weave_item()
set name = "Weave Item"
set category = "Abilities"
if(!(species.is_weaver))
return
var/choice
var/datum/weaver_recipe/item/desired_result
var/finalized = "No"
while(finalized == "No" && src.client)
choice = input(src,"What would you like to weave?") as null|anything in weavable_items
desired_result = weavable_items[choice]
if(!desired_result || !istype(desired_result))
return
if(choice)
finalized = alert(src, "Are you sure you want to weave [desired_result.title]? It will cost you [desired_result.cost] silk.","Confirmation","Yes","No")
if(!desired_result || !istype(desired_result))
return
if(!(species.is_weaver))
to_chat(src, "<span class='warning'>You are not a weaver! How are you doing this? Tell a developer!</span>")
return
if(desired_result.cost > species.silk_reserve)
to_chat(src, "<span class='warning'>You don't have enough silk to weave that!</span>")
return
if(stat)
to_chat(src, "<span class='warning'>You can't do that in your current state!</span>")
return
if(!isturf(src.loc))
to_chat(src, "<span class='warning'>You can't weave here!</span>")
return
if(do_after(src, desired_result.time, exclusive = TRUE))
if(desired_result.cost > species.silk_reserve)
to_chat(src, "<span class='warning'>You don't have enough silk to weave that!</span>")
return
if(!isturf(src.loc))
to_chat(src, "<span class='warning'>You can't weave here!</span>")
return
species.silk_reserve = max(species.silk_reserve - desired_result.cost, 0)
//new desired_result.result_type(src.loc)
var/atom/O = new desired_result.result_type(src.loc)
O.color = species.silk_color
/mob/living/carbon/human/proc/set_silk_color()
set name = "Set Silk Color"
set category = "Abilities"
if(!(species.is_weaver))
to_chat(src, "<span class='warning'>You are not a weaver! How are you doing this? Tell a developer!</span>")
return
var/new_silk_color = input("Pick a color for your woven products:","Silk Color", species.silk_color) as null|color
if(new_silk_color)
species.silk_color = new_silk_color

View File

@@ -383,7 +383,11 @@
icobase_tail = 1
inherent_verbs = list(
/mob/living/proc/weaveWebBindings)
/mob/living/carbon/human/proc/check_silk_amount,
/mob/living/carbon/human/proc/toggle_silk_production,
/mob/living/carbon/human/proc/weave_structure,
/mob/living/carbon/human/proc/weave_item,
/mob/living/carbon/human/proc/set_silk_color)
min_age = 18
max_age = 80
@@ -419,6 +423,10 @@
base_color = "#333333" //Blackish-gray
blood_color = "#0952EF" //Spiders have blue blood.
is_weaver = TRUE
silk_reserve = 500
silk_max_reserve = 1000
/datum/species/spider/handle_environment_special(var/mob/living/carbon/human/H)
if(H.stat == DEAD) // If they're dead they won't need anything.
return

View File

@@ -272,3 +272,17 @@
desc = "You are able to move unhindered on snow."
cost = 2 //YW EDIT
var_changes = list("snow_movement" = -2)
/datum/trait/weaver
name = "Weaver"
desc = "You can produce silk and create various articles of clothing and objects."
cost = 2
var_changes = list("is_weaver" = 1)
/datum/trait/weaver/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..()
H.verbs |= /mob/living/carbon/human/proc/check_silk_amount
H.verbs |= /mob/living/carbon/human/proc/toggle_silk_production
H.verbs |= /mob/living/carbon/human/proc/weave_structure
H.verbs |= /mob/living/carbon/human/proc/weave_item
H.verbs |= /mob/living/carbon/human/proc/set_silk_color

View File

@@ -0,0 +1,113 @@
// Structures
/obj/effect/weaversilk
name = "weaversilk web"
desc = "A thin layer of fiberous webs. It looks like it can be torn down with one strong hit."
icon = 'icons/vore/weaver_icons_vr.dmi'
anchored = 1
density = 0
/obj/effect/weaversilk/attack_hand(mob/user as mob)
..()
if(user.a_intent == I_HURT)
to_chat(user,"<span class='warning'>You easily tear down [name].</span>")
qdel(src)
/obj/effect/weaversilk/floor
var/possible_icon_states = list("floorweb1", "floorweb2", "floorweb3", "floorweb4", "floorweb5", "floorweb6", "floorweb7", "floorweb8")
plane = DIRTY_PLANE
/obj/effect/weaversilk/floor/Initialize()
..()
icon_state = pick(possible_icon_states)
/obj/effect/weaversilk/wall
name = "weaversilk web wall"
desc = "A thin layer of fiberous webs, but just thick enough to block your way. It looks like it can be torn down with one strong hit."
icon_state = "wallweb1"
var/possible_icon_states = list("wallweb1", "wallweb2", "wallweb3")
density = 1
/obj/effect/weaversilk/wall/Initialize()
..()
icon_state = pick(possible_icon_states)
/obj/effect/weaversilk/wall/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mover
if(H.species.is_weaver)
return TRUE
..()
/obj/structure/bed/double/weaversilk_nest
name = "weaversilk nest"
desc = "A nest of some kind, made of fiberous material."
icon = 'icons/vore/weaver_icons_vr.dmi'
icon_state = "nest"
base_icon = "nest"
/obj/structure/bed/double/weaversilk_nest/update_icon()
return
/obj/structure/bed/double/weaversilk_nest/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter())
return
..()
/obj/structure/bed/double/weaversilk_nest/attack_hand(mob/user as mob)
..()
if(user.a_intent == I_HURT && !has_buckled_mobs())
to_chat(user,"<span class='warning'>You easily tear down [name].</span>")
qdel(src)
/obj/effect/weaversilk/trap
name = "weaversilk trap"
desc = "A silky, yet firm trap. Be careful not to step into it! Or don't..."
icon_state = "trap"
var/trap_active = TRUE
/obj/effect/weaversilk/trap/Crossed(atom/movable/AM as mob|obj)
if(AM.is_incorporeal())
return
if(istype(AM, /mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if(H.species.is_weaver)
return
if(isliving(AM) && trap_active)
var/mob/living/L = AM
if(L.m_intent == "run")
L.visible_message(
"<span class='danger'>[L] steps on \the [src].</span>",
"<span class='danger'>You step on \the [src]!</span>",
"<b>You hear a squishy noise!</b>"
)
set_dir(L.dir)
can_buckle = 1
buckle_mob(L)
L.Stun(1 SECOND)
to_chat(L, "<span class='danger'>The sticky fibers of \the [src] ensnare, trapping you in place!</span>")
trap_active = 0
can_buckle = initial(can_buckle)
desc += " Actually, it looks like it's been all spent."
..()
// Items
// TODO: Spidersilk clothing and actual bindings, once sprites are ready.
/obj/item/clothing/suit/weaversilk_bindings
icon = 'icons/vore/custom_clothes_vr.dmi'
icon_override = 'icons/vore/custom_clothes_vr.dmi'
name = "weaversilk bindings"
desc = "A webbed cocoon that completely restrains the wearer."
icon_state = "web_bindings"
item_state = "web_bindings_mob"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL
//CHOMPedit - Teshari sprite, this was originally a YW edit of the old web bindings
sprite_sheets = list(
SPECIES_TESHARI = 'icons/vore/custom_onmob_yw.dmi'
)
//CHOMPedit end

View File

@@ -0,0 +1,36 @@
/datum/weaver_recipe
var/title = null
var/result_type
var/cost = 0
var/time = 5 SECONDS
/datum/weaver_recipe/structure
/datum/weaver_recipe/structure/floor
title = "floor"
result_type = /obj/effect/weaversilk/floor
cost = 25
time = 1 SECOND
/datum/weaver_recipe/structure/wall
title = "wall"
result_type = /obj/effect/weaversilk/wall
cost = 100
/datum/weaver_recipe/structure/nest
title = "nest"
result_type = /obj/structure/bed/double/weaversilk_nest
cost = 100
/datum/weaver_recipe/structure/trap
title = "trap"
result_type = /obj/effect/weaversilk/trap
cost = 250
time = 15 SECONDS
/datum/weaver_recipe/item
cost = 50
/datum/weaver_recipe/item/bindings
title = "bindings"
result_type = /obj/item/clothing/suit/weaversilk_bindings

View File

@@ -1,35 +0,0 @@
/obj/item/clothing/suit/web_bindings/
icon = 'icons/vore/custom_clothes_vr.dmi'
icon_override = 'icons/vore/custom_clothes_vr.dmi'
name = "web bindings"
desc = "A webbed cocoon that completely restrains the wearer."
icon_state = "web_bindings"
item_state = "web_bindings_mob"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL
//yw edit - Teshari sprite
sprite_sheets = list(
SPECIES_TESHARI = 'icons/vore/custom_onmob_yw.dmi'
)
//yw edit end
//yw edit start - Teshari Sprite
/obj/item/clothing/suit/web_bindings/get_worn_icon_file(var/body_type,var/slot_name,var/default_icon,var/inhands)
if(body_type == SPECIES_TESHARI)
if(!inhands)
return 'icons/vore/custom_onmob_yw.dmi'
return ..()
//yw edit end
/mob/living/proc/weaveWebBindings()
set name = "Weave Web Bindings"
set category = "Species Powers"
if(nutrition >= 30) //This isn't a huge problem. This is so you can bind people up.
src.visible_message("<span class='notice'>\the [src] pulls silk from their manibles and delicately weaves it into bindings.</span>")
adjust_nutrition(-30)
spawn(30) //5 seconds to weave the bindings~
var/obj/item/clothing/suit/web_bindings/bindings = new() //This sprite is amazing, I must say.
src.put_in_hands(bindings)
else
to_chat(src, "You do not have enough nutrition to create webbing!") //CK~

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -2816,6 +2816,8 @@
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\positive_ch.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\trait.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\trait_ch.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\weaver_objs.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\weaver_recipies.dm"
#include "code\modules\mob\living\carbon\human\species\virtual_reality\avatar.dm"
#include "code\modules\mob\living\carbon\human\species\virtual_reality\opaque_form.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_powers.dm"
@@ -3951,7 +3953,6 @@
#include "code\modules\vore\hook-defs_vr.dm"
#include "code\modules\vore\trycatch_vr.dm"
#include "code\modules\vore\appearance\preferences_vr.dm"
#include "code\modules\vore\appearance\spider_taur_powers_vr.dm"
#include "code\modules\vore\appearance\sprite_accessories_ch.dm"
#include "code\modules\vore\appearance\sprite_accessories_taur_vr.dm"
#include "code\modules\vore\appearance\sprite_accessories_taur_yw.dm"