mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-25 08:34:23 +00:00
* Rewrites how action buttons icons are generated, makes them layer nicer. Allows observers to see a mob's action buttons. * conflicts * Modular! * update modular * icon icon icon icon icon Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> Co-authored-by: Funce <funce.973@gmail.com>
66 lines
2.1 KiB
Plaintext
66 lines
2.1 KiB
Plaintext
//spider webs
|
|
/datum/mutation/human/webbing
|
|
name = "Webbing Production"
|
|
desc = "Allows the user to lay webbing, and travel through it."
|
|
quality = POSITIVE
|
|
text_gain_indication = "<span class='notice'>Your skin feels webby.</span>"
|
|
instability = 15
|
|
power_path = /datum/action/cooldown/spell/lay_genetic_web
|
|
energy_coeff = 1
|
|
|
|
/datum/mutation/human/webbing/modify()
|
|
. = ..()
|
|
var/datum/action/cooldown/spell/lay_genetic_web/to_modify =.
|
|
|
|
if(!istype(to_modify)) // null or invalid
|
|
return
|
|
|
|
if(GET_MUTATION_ENERGY(src) == 1) //energetic chromosome outputs a value less than 1 when present, 1 by default
|
|
to_modify.webbing_time = initial(to_modify.webbing_time)
|
|
return
|
|
to_modify.webbing_time = 2 SECONDS
|
|
|
|
/datum/mutation/human/webbing/on_acquiring(mob/living/carbon/human/owner)
|
|
if(..())
|
|
return
|
|
ADD_TRAIT(owner, TRAIT_WEB_WEAVER, GENETIC_MUTATION)
|
|
|
|
/datum/mutation/human/webbing/on_losing(mob/living/carbon/human/owner)
|
|
if(..())
|
|
return
|
|
REMOVE_TRAIT(owner, TRAIT_WEB_WEAVER, GENETIC_MUTATION)
|
|
|
|
// In the future this could be unified with the spider's web action
|
|
/datum/action/cooldown/spell/lay_genetic_web
|
|
name = "Lay Web"
|
|
desc = "Drops a web. Only you will be able to traverse your web easily, making it pretty good for keeping you safe."
|
|
button_icon = 'icons/mob/actions/actions_genetic.dmi'
|
|
button_icon_state = "lay_web"
|
|
|
|
cooldown_time = 4 SECONDS //the same time to lay a web
|
|
spell_requirements = NONE
|
|
|
|
/// How long it takes to lay a web
|
|
var/webbing_time = 4 SECONDS
|
|
/// The path of web that we create
|
|
var/web_path = /obj/structure/spider/stickyweb/genetic
|
|
|
|
/datum/action/cooldown/spell/lay_genetic_web/cast(atom/cast_on)
|
|
var/turf/web_spot = cast_on.loc
|
|
if(!isturf(web_spot) || (locate(web_path) in web_spot))
|
|
to_chat(cast_on, span_warning("You can't lay webs here!"))
|
|
reset_spell_cooldown()
|
|
return FALSE
|
|
|
|
cast_on.visible_message(
|
|
span_notice("[cast_on] begins to secrete a sticky substance."),
|
|
span_notice("You begin to lay a web."),
|
|
)
|
|
|
|
if(!do_after(cast_on, webbing_time, target = web_spot))
|
|
to_chat(cast_on, span_warning("Your web spinning was interrupted!"))
|
|
return
|
|
|
|
new web_path(web_spot, cast_on)
|
|
return ..()
|