-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
webbing.dm
52 lines (43 loc) · 1.72 KB
/
webbing.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//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
/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."
icon_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 ..()