diff --git a/code/_helpers/global_lists_vr.dm b/code/_helpers/global_lists_vr.dm index 5a3fddc8256..795b2fe0682 100644 --- a/code/_helpers/global_lists_vr.dm +++ b/code/_helpers/global_lists_vr.dm @@ -555,12 +555,6 @@ var/global/list/remainless_species = list(SPECIES_PROMETHEAN, return 1 // Hooks must return 1 var/global/list/weavable_structures = list() -/* -floor web -nest -wall -trap -*/ var/global/list/weavable_items = list() /* jumpsuit diff --git a/code/modules/mob/living/carbon/human/species/species_vr.dm b/code/modules/mob/living/carbon/human/species/species_vr.dm index 5dad639e31f..653af17a1b4 100644 --- a/code/modules/mob/living/carbon/human/species/species_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_vr.dm @@ -24,6 +24,7 @@ var/silk_production = FALSE var/silk_reserve = 100 var/silk_max_reserve = 500 + var/silk_color = "#FFFFFF" var/list/traits = list() diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm index efa50c03750..ebdf6bb7ab7 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm @@ -857,6 +857,8 @@ if(species.is_weaver) to_chat(src, "Your silk reserves are at [species.silk_reserve]/[species.silk_max_reserve].") + else + to_chat(src, "You are not a weaver! How are you doing this? Tell a developer!") /mob/living/carbon/human/proc/toggle_silk_production() set name = "Toggle Silk Production" @@ -865,12 +867,15 @@ 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, "You are not a weaver! How are you doing this? Tell a developer!") /mob/living/carbon/human/proc/weave_structure() set name = "Weave Structure" set category = "Abilities" if(!(species.is_weaver)) + to_chat(src, "You are not a weaver! How are you doing this? Tell a developer!") return var/choice @@ -880,16 +885,120 @@ 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)) + 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, "You don't have enough silk to weave that!") + return + + if(stat) + to_chat(src, "You can't do that in your current state!") + return + + if(locate(desired_result.result_type) in src.loc) + to_chat(src, "You can't create another weaversilk [desired_result.title] here!") + return + + if(!isturf(src.loc)) + to_chat(src, "You can't weave here!") + return + + if(do_after(src, desired_result.time, exclusive = TRUE)) + if(desired_result.cost > species.silk_reserve) + to_chat(src, "You don't have enough silk to weave that!") + return + + if(locate(desired_result.result_type) in src.loc) + to_chat(src, "You can't create another weaversilk [desired_result.title] here!") + return + + if(!isturf(src.loc)) + to_chat(src, "You can't weave here!") + 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_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(!(species.is_weaver)) + to_chat(src, "You are not a weaver! How are you doing this? Tell a developer!") + return + + if(desired_result.cost > species.silk_reserve) + to_chat(src, "You don't have enough silk to weave that!") + return + + if(stat) + to_chat(src, "You can't do that in your current state!") + return + + if(!isturf(src.loc)) + to_chat(src, "You can't weave here!") + return + + if(do_after(src, desired_result.time, exclusive = TRUE)) + if(desired_result.cost > species.silk_reserve) + to_chat(src, "You don't have enough silk to weave that!") + return + + if(!isturf(src.loc)) + to_chat(src, "You can't weave here!") + 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, "You are not a weaver! How are you doing this? Tell a developer!") + 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 + + + + /mob/living/proc/weaveWebBindings() set name = "Weave Web Bindings" set category = "Species Powers" diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm index a850e60534f..f699afd9c70 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm @@ -380,7 +380,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 diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm index 07ad2ce9c32..ecc4571847e 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm @@ -151,4 +151,5 @@ 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 \ No newline at end of file + H.verbs |= /mob/living/carbon/human/proc/weave_item + H.verbs |= /mob/living/carbon/human/proc/set_silk_color \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm index 5b58ad0b9d5..cbac3ed9182 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_objs.dm @@ -1,3 +1,5 @@ +// 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." @@ -6,12 +8,13 @@ density = 0 /obj/effect/weaversilk/attack_hand(mob/user as mob) + ..() if(user.a_intent == I_HURT) to_chat(user,"You easily tear down [name].") qdel(src) /obj/effect/weaversilk/floor - var/possible_icon_states = list("floorweb1", "floorweb2") + var/possible_icon_states = list("floorweb1", "floorweb2", "floorweb3", "floorweb4", "floorweb5", "floorweb6", "floorweb7", "floorweb8") plane = DIRTY_PLANE /obj/effect/weaversilk/floor/Initialize() @@ -22,10 +25,22 @@ 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 = "nest" + name = "weaversilk nest" desc = "A nest of some kind, made of fiberous material." icon = 'icons/vore/weaver_icons_vr.dmi' icon_state = "nest" @@ -45,3 +60,38 @@ to_chat(user,"You easily tear down [name].") 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( + "[L] steps on \the [src].", + "You step on \the [src]!", + "You hear a squishy noise!" + ) + set_dir(L.dir) + can_buckle = 1 + buckle_mob(L) + L.Stun(1 SECOND) + to_chat(L, "The sticky fibers of \the [src] ensnare, trapping you in place!") + trap_active = 0 + can_buckle = initial(can_buckle) + desc += " Actually, it looks like it's been all spent." + ..() + + + +// Items + diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_recipies.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_recipies.dm index 385a2117818..06c9856e150 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_recipies.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/weaver_recipies.dm @@ -2,26 +2,31 @@ var/title = null var/result_type var/cost = 0 - var/time = 50 - var/one_per_turf = FALSE + var/time = 5 SECONDS /datum/weaver_recipe/structure - one_per_turf = TRUE /datum/weaver_recipe/structure/floor - title = "Floor" + title = "floor" result_type = /obj/effect/weaversilk/floor cost = 25 + time = 1 SECOND /datum/weaver_recipe/structure/wall - title = "Wall" + title = "wall" result_type = /obj/effect/weaversilk/wall cost = 100 /datum/weaver_recipe/structure/nest - title = "Wall" + 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 - one_per_turf = FALSE \ No newline at end of file + time = 10 SECONDS \ No newline at end of file diff --git a/icons/vore/weaver_icons_vr.dmi b/icons/vore/weaver_icons_vr.dmi index 0622346156f..17bcdb416af 100644 Binary files a/icons/vore/weaver_icons_vr.dmi and b/icons/vore/weaver_icons_vr.dmi differ