-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathrust_magic.dm
288 lines (233 loc) · 9.87 KB
/
rust_magic.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
/*
RUST PATH SPELLS GO HERE
*/
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/rust
name = "Decaying Phase"
desc = "A short range spell that allows you to pass unimpeded through walls."
background_icon_state = "bg_heretic"
overlay_icon_state = "bg_heretic_border"
button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "curse"
sound = null
school = SCHOOL_FORBIDDEN
cooldown_time = 15 SECONDS
spell_requirements = SPELL_CASTABLE_WITHOUT_INVOCATION | SPELL_REQUIRES_NO_ANTIMAGIC
exit_jaunt_sound = null
jaunt_duration = 1.5 SECONDS
jaunt_in_time = 0.5 SECONDS
jaunt_out_time = 0.5 SECONDS
jaunt_in_type = /obj/effect/temp_visual/dir_setting/rust_shift
jaunt_out_type = /obj/effect/temp_visual/dir_setting/rust_shift/out
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/rust/do_steam_effects()
return
/obj/effect/temp_visual/dir_setting/rust_shift
name = "rust_shift"
icon = 'icons/effects/effects.dmi'
icon_state = "curse"
duration = 0.5 SECONDS
/obj/effect/temp_visual/dir_setting/rust_shift/out
icon_state = "curse"
/datum/action/cooldown/spell/aoe/rust_conversion
name = "Aggressive Spread"
desc = "Spread rust onto nearby turfs, possibly destroying rusted walls."
background_icon_state = "bg_heretic"
overlay_icon_state = "bg_heretic_border"
button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "corrode"
sound = 'sound/items/welder.ogg'
school = SCHOOL_FORBIDDEN
cooldown_time = 25 SECONDS
invocation = "A'GRSV SPR'D"
invocation_type = INVOCATION_WHISPER
spell_requirements = SPELL_CASTABLE_WITHOUT_INVOCATION | SPELL_REQUIRES_NO_ANTIMAGIC
aoe_radius = 3
/datum/action/cooldown/spell/aoe/rust_conversion/get_things_to_cast_on(atom/center)
var/list/things = list()
for(var/turf/nearby_turf in range(aoe_radius, center))
things += nearby_turf
return things
/datum/action/cooldown/spell/aoe/rust_conversion/cast_on_thing_in_aoe(turf/victim, atom/caster)
// We have less chance of rusting stuff that's further
var/distance_to_caster = get_dist(victim, caster)
var/chance_of_not_rusting = (max(distance_to_caster, 1) - 1) * 100 / (aoe_radius + 1)
if(prob(chance_of_not_rusting))
return
victim.rust_heretic_act()
/datum/action/cooldown/spell/aoe/rust_conversion/small
name = "Rust Conversion"
desc = "Spreads rust onto nearby surfaces."
aoe_radius = 2
// Shoots a straight line of rusty stuff ahead of the caster, what rust monsters get
/datum/action/cooldown/spell/basic_projectile/rust_wave
name = "Patron's Reach"
desc = "Fire a rust spreading projectile in front of you, dealing toxin damage to whatever it hits."
background_icon_state = "bg_heretic"
overlay_icon_state = "bg_heretic_border"
button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "rust_wave"
school = SCHOOL_FORBIDDEN
cooldown_time = 35 SECONDS
invocation = "SPR'D TH' WO'D"
invocation_type = INVOCATION_WHISPER
spell_requirements = SPELL_CASTABLE_WITHOUT_INVOCATION | SPELL_REQUIRES_NO_ANTIMAGIC
projectile_type = /obj/projectile/magic/aoe/rust_wave
/obj/projectile/magic/aoe/rust_wave
name = "Patron's Reach"
icon_state = "eldritch_projectile"
alpha = 180
damage = 30
damage_type = TOX
nodamage = FALSE
hitsound = 'sound/weapons/punch3.ogg'
ignored_factions = list("heretics")
range = 15
speed = 1
/obj/projectile/magic/aoe/rust_wave/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
playsound(src, 'sound/items/welder.ogg', 75, TRUE)
var/list/turflist = list()
var/turf/T1
turflist += get_turf(src)
T1 = get_step(src,turn(movement_dir,90))
turflist += T1
turflist += get_step(T1,turn(movement_dir,90))
T1 = get_step(src,turn(movement_dir,-90))
turflist += T1
turflist += get_step(T1,turn(movement_dir,-90))
for(var/X in turflist)
if(!X || prob(25))
continue
var/turf/T = X
T.rust_heretic_act()
/datum/action/cooldown/spell/basic_projectile/rust_wave/short
name = "Lesser Patron's Reach"
projectile_type = /obj/projectile/magic/aoe/rust_wave/short
/obj/projectile/magic/aoe/rust_wave/short
range = 7
speed = 2
// Shoots out in a wave-like, what rust heretics themselves get
/datum/action/cooldown/spell/cone/staggered/entropic_plume
name = "Entropic Plume"
desc = "Spews forth a disorienting plume that causes enemies to strike each other, briefly blinds them(increasing with range) and poisons them(decreasing with range), while also spreading rust in the path of the plume."
background_icon_state = "bg_heretic"
overlay_icon_state = "bg_heretic_border"
button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "entropic_plume"
sound = 'sound/magic/forcewall.ogg'
school = SCHOOL_FORBIDDEN
cooldown_time = 30 SECONDS
invocation = "'NTR'P'C PL'M'"
invocation_type = INVOCATION_WHISPER
spell_requirements = SPELL_CASTABLE_WITHOUT_INVOCATION | SPELL_REQUIRES_NO_ANTIMAGIC
cone_levels = 5
respect_density = TRUE
/datum/action/cooldown/spell/cone/staggered/entropic_plume/cast(atom/cast_on)
. = ..()
new /obj/effect/temp_visual/dir_setting/entropic(get_step(cast_on, cast_on.dir), cast_on.dir)
/datum/action/cooldown/spell/cone/staggered/entropic_plume/do_turf_cone_effect(turf/target_turf, atom/caster, level)
target_turf.rust_heretic_act()
/datum/action/cooldown/spell/cone/staggered/entropic_plume/do_mob_cone_effect(mob/living/victim, atom/caster, level)
. = ..()
if(victim.can_block_magic() || IS_HERETIC(victim) || IS_HERETIC_MONSTER(victim))
return
victim.apply_status_effect(STATUS_EFFECT_AMOK)
victim.apply_status_effect(STATUS_EFFECT_CLOUDSTRUCK, (level * 1 SECONDS))
if(iscarbon(victim))
var/mob/living/carbon/carbon_victim = victim
carbon_victim.reagents?.add_reagent(/datum/reagent/eldritch, min(1, 6 - level))
/datum/action/cooldown/spell/cone/staggered/entropic_plume/calculate_cone_shape(current_level)
if(current_level == cone_levels)
return 5
else if(current_level == cone_levels - 1)
return 3
else
return 2
/datum/action/cooldown/spell/pointed/rust_construction
name = "Rust Formation"
desc = "Transforms a rusted floor into a full wall of rust. Creating a wall underneath a mob will harm it."
background_icon_state = "bg_heretic"
overlay_icon_state = "bg_heretic_border"
button_icon_state = "shield"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
check_flags = AB_CHECK_INCAPACITATED|AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
school = SCHOOL_FORBIDDEN
cooldown_time = 5 SECONDS
invocation = "Someone raises a wall of rust."
invocation_self_message = "You raise a wall of rust."
invocation_type = INVOCATION_EMOTE
spell_requirements = SPELL_CASTABLE_WITHOUT_INVOCATION | SPELL_REQUIRES_NO_ANTIMAGIC
cast_range = 4
aim_assist = FALSE
/// How long does the filter last on walls we make?
var/filter_duration = 2 MINUTES
/datum/action/cooldown/spell/pointed/rust_construction/is_valid_target(atom/cast_on)
if(!isfloorturf(cast_on))
if(isturf(cast_on) && owner)
cast_on.balloon_alert(owner, "not a floor!")
return FALSE
if(!HAS_TRAIT(cast_on, TRAIT_RUSTY))
if(owner)
cast_on.balloon_alert(owner, "not rusted!")
return FALSE
return TRUE
/datum/action/cooldown/spell/pointed/rust_construction/before_cast(turf/open/cast_on)
. = ..()
if(!isliving(owner))
return
var/mob/living/living_owner = owner
invocation = span_danger("<b>[owner]</b> drags [owner.p_their()] hand[living_owner.usable_hands == 1 ? "":"s"] upwards as a wall of rust rises out of [cast_on]!")
invocation_self_message = span_notice("You drag [living_owner.usable_hands == 1 ? "a hand":"your hands"] upwards as a wall of rust rises out of [cast_on].")
/datum/action/cooldown/spell/pointed/rust_construction/cast(turf/open/cast_on)
. = ..()
var/rises_message = "rises out of [cast_on]"
var/turf/closed/wall/new_wall = cast_on.place_on_top(/turf/closed/wall)
if(!istype(new_wall))
return
playsound(new_wall, 'sound/effects/constructform.ogg', 50, TRUE)
new_wall.rust_heretic_act()
new_wall.name = "\improper enchanted [new_wall.name]"
new_wall.hardness = 10
new_wall.sheet_amount = 0
new_wall.girder_type = null
// I wanted to do a cool animation of a wall raising from the ground
// but I guess a fading filter will have to do for now as walls have 0 depth (currently)
// damn though with 3/4ths walls this'll look sick just imagine it
addtimer(CALLBACK(src, PROC_REF(fade_wall_filter), new_wall), filter_duration * (1/20))
addtimer(CALLBACK(src,PROC_REF(remove_wall_filter), new_wall), filter_duration)
var/message_shown = FALSE
for(var/mob/living/living_mob in cast_on)
message_shown = TRUE
if(IS_HERETIC_OR_MONSTER(living_mob) || living_mob == owner)
living_mob.visible_message(
span_warning("\A [new_wall] [rises_message] and pushes along [living_mob]!"),
span_notice("\A [new_wall] [rises_message] beneath your feet and pushes you along!"),
)
else
living_mob.visible_message(
span_warning("\A [new_wall] [rises_message] and slams into [living_mob]!"),
span_userdanger("\A [new_wall] [rises_message] beneath your feet and slams into you!"),
)
living_mob.apply_damage(10, BRUTE, wound_bonus = 10)
living_mob.Knockdown(5 SECONDS)
living_mob.SpinAnimation(5, 1)
// If we're a multiz map send them to the next floor
var/turf/above_us = get_step_multiz(cast_on, UP)
if(above_us)
living_mob.forceMove(above_us)
continue
// If we're not throw them to a nearby (open) turf
var/list/turfs_by_us = get_adjacent_open_turfs(cast_on)
// If there is no side by us, hardstun them
if(!length(turfs_by_us))
living_mob.Paralyze(5 SECONDS)
continue
// If there's an open turf throw them to the side
living_mob.throw_at(pick(turfs_by_us), 1, 3, thrower = owner, spin = FALSE)
if(!message_shown)
new_wall.visible_message(span_warning("\A [new_wall] [rises_message]!"))
/datum/action/cooldown/spell/pointed/rust_construction/proc/fade_wall_filter(turf/closed/wall)
if(QDELETED(wall))
return
/datum/action/cooldown/spell/pointed/rust_construction/proc/remove_wall_filter(turf/closed/wall)
if(QDELETED(wall))
return