/datum/quirk/web_weaving name = "Web Weaver" desc = "for whatever reason, you are able to weave silk webs, albeit to a limited extent" value = 0 //ERP quirk gain_text = "You find yourself able to weave webs." lose_text = "You are no longer able to weave webs." mob_trait = TRAIT_WEB_WEAVER ///What action is linked with this quirk? var/datum/action/innate/wrap_target/linked_action1 var/datum/action/innate/make_web/linked_action2 /datum/quirk/web_weaving/post_add() linked_action1 = new linked_action1.Grant(quirk_holder) linked_action2 = new linked_action2.Grant(quirk_holder) /datum/quirk/web_weaving/remove() linked_action1.Remove(quirk_holder) linked_action2.Remove(quirk_holder) return ..() /datum/action/innate/wrap_target name = "wrap" desc = "encases a humanoid in a web cocoon." icon_icon = 'GainStation13/icons/obj/clothing/web.dmi' button_icon_state = "web_bindings" background_icon_state = "bg_alien" /datum/action/innate/wrap_target/Activate() var/mob/living/carbon/user = owner if(!user || !ishuman(user)) return FALSE var/mob/living/carbon/human/target = user.pulling if(!target || !ishuman(target) || user.grab_state < GRAB_AGGRESSIVE) //Add a check for a bondage pref whenever that gets added in. to_chat(user, "You need to aggressively grab a humanoid to use this.") return FALSE if(target.wear_suit) var/obj/item/clothing/suit = target.wear_suit if(istype(suit, /obj/item/clothing/suit/straight_jacket/web)) user.visible_message("[user] begins to fully encase [target] in a cocoon!", "You begin to fully encase [target] in a cocoon.") if(!do_after(user, 30 SECONDS, target)) return FALSE var/obj/structure/spider/cocoon/quirk/spawned_cocoon = new(target.loc) if(!target.forceMove(spawned_cocoon)) qdel(spawned_cocoon) return FALSE spawned_cocoon.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3") var/cocoon_size = target.size_multiplier var/matrix/new_matrix = new new_matrix.Scale(cocoon_size) new_matrix.Translate(0,16 * (cocoon_size-1)) spawned_cocoon.transform = new_matrix return TRUE user.visible_message("[user] attempts to remove [target]'s [target.wear_suit]!", "You attempt to remove [target]'s [target.wear_suit].") if(!do_after(user, 10 SECONDS, target) || !target.dropItemToGround(suit)) return FALSE var/obj/item/clothing/suit/straight_jacket/web/wrapping = new if(!wrapping) return FALSE user.visible_message("[user] attempts to wrap [target] inside of [wrapping]!", "You attempt to wrap [target] inside of [wrapping].") if(!do_after(user, 20 SECONDS, target) || !target.equip_to_slot_if_possible(wrapping, ITEM_SLOT_OCLOTHING, TRUE, TRUE)) user.visible_message("[user] fails to wrap [target] inside of [wrapping]!", "You fail to wrap [target] inside of [wrapping].") return FALSE user.visible_message("[user] successfully [target] inside of [wrapping]!", "You successfully wrap [target] inside of [wrapping].") return TRUE /obj/item/clothing/suit/straight_jacket/web name = "web bindings" desc = "A mesh of sticky web that binds whoever is stuck inside of it" icon = 'GainStation13/icons/obj/clothing/web.dmi' mob_overlay_icon = 'GainStation13/icons/mob/web.dmi' icon_state = "web_bindings" item_state = "web_bindings" breakouttime = 600 //1 minute is reasonable. equip_delay_other = 0 equip_delay_self = 0 mutantrace_variation = NONE /obj/item/clothing/suit/straight_jacket/web/equipped(mob/user, slot) . = ..() if((user.get_item_by_slot(ITEM_SLOT_OCLOTHING)) != src && !QDELETED(src)) qdel(src) /obj/structure/spider/cocoon/quirk max_integrity = 20 /datum/action/innate/make_web name = "weave" desc = "spins a sticky web." icon_icon = 'icons/effects/effects.dmi' button_icon_state = "stickyweb1" background_icon_state = "bg_alien" /datum/action/innate/make_web/Activate() var/turf/T = get_turf(owner) owner.visible_message("[owner] begins spinning a web!", "You begin spinning a web.") var/obj/structure/spider/stickyweb/W = locate() in get_turf(src) if(W || !do_after(owner, 10 SECONDS, T)) owner.visible_message("[owner] fails to spin a web!", "You fail to spin web.") return FALSE new /obj/structure/spider/stickyweb(T) owner.visible_message("[owner] spins a sticky web!", "You spin a sticky web.") return TRUE /obj/structure/spider/stickyweb/CanPass(atom/movable/mover, turf/target) if (genetic) return if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider) || HAS_TRAIT(mover, TRAIT_WEB_WEAVER)) return TRUE else if(isliving(mover)) if(istype(mover.pulledby, /mob/living/simple_animal/hostile/poison/giant_spider)) return TRUE if(mover.pulledby) if(HAS_TRAIT(mover.pulledby, TRAIT_WEB_WEAVER)) return TRUE if(prob(50)) to_chat(mover, "You get stuck in \the [src] for a moment.") return FALSE else if(istype(mover, /obj/item/projectile)) return prob(30) return TRUE