-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathlegionnaire.dm
368 lines (333 loc) · 13.9 KB
/
legionnaire.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
#define LEGIONNAIRE_CHARGE 1
#define HEAD_DETACH 2
#define BONFIRE_TELEPORT 3
#define SPEW_SMOKE 4
/**
* # Legionnaire
*
* A towering skeleton, embodying the power of Legion.
* As it's health gets lower, the head does more damage.
* It's attacks are as follows:
* - Charges at the target after a telegraph, throwing them across the arena should it connect.
* - Legionnaire's head detaches, attacking as it's own entity. Has abilities of it's own later into the fight. Once dead, regenerates after a brief period. If the skill is used while the head is off, it will be killed.
* - Leaves a pile of bones at your location. Upon using this skill again, you'll swap locations with the bone pile.
* - Spews a cloud of smoke from it's maw, wherever said maw is.
* A unique fight incorporating the head mechanic of legion into a whole new beast. Combatants will need to make sure the tag-team of head and body don't lure them into a deadly trap.
*/
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire
name = "legionnaire"
desc = "A towering skeleton, embodying the terrifying power of Legion."
icon_state = "legionnaire"
icon_living = "legionnaire"
icon_aggro = "legionnaire"
icon_dead = "legionnaire_dead"
icon_gib = "syndicate_gib"
health_doll_icon = "legionnaire"
maxHealth = 800
health = 800
melee_damage_lower = 30
melee_damage_upper = 30
attack_vis_effect = ATTACK_EFFECT_SLASH
attacktext = "slashes its arms at"
//attack_verb_simple = "slash your arms at"
attack_sound = 'sound/weapons/bladeslice.ogg'
throw_message = "doesn't affect the sturdiness of"
speed = 0
move_to_delay = 3
mouse_opacity = MOUSE_OPACITY_ICON
gps_name = "Wailing Signal"
deathsound = 'sound/magic/curse.ogg'
deathmessage = "'s arms reach out before it falls apart onto the floor, lifeless."
loot_drop = /obj/item/crusher_trophy/legionnaire_spine
attack_action_types = list(/datum/action/innate/elite_attack/legionnaire_charge,
/datum/action/innate/elite_attack/head_detach,
/datum/action/innate/elite_attack/bonfire_teleport,
/datum/action/innate/elite_attack/spew_smoke)
var/mob/living/simple_animal/hostile/asteroid/elite/legionnairehead/myhead = null
var/obj/structure/legionnaire_bonfire/mypile = null
var/has_head = TRUE
/datum/action/innate/elite_attack/legionnaire_charge
name = "Legionnaire Charge"
button_icon_state = "legionnaire_charge"
chosen_message = span_boldwarning("You will attempt to grab your opponent and throw them.")
chosen_attack_num = LEGIONNAIRE_CHARGE
/datum/action/innate/elite_attack/head_detach
name = "Release Head"
button_icon_state = "head_detach"
chosen_message = span_boldwarning("You will now detach your head or kill it if it is already released.")
chosen_attack_num = HEAD_DETACH
/datum/action/innate/elite_attack/bonfire_teleport
name = "Bonfire Teleport"
button_icon_state = "bonfire_teleport"
chosen_message = span_boldwarning("You will leave a bonfire. Second use will let you swap positions with it indefintiely. Using this move on the same tile as your active bonfire removes it.")
chosen_attack_num = BONFIRE_TELEPORT
/datum/action/innate/elite_attack/spew_smoke
name = "Spew Smoke"
button_icon_state = "spew_smoke"
chosen_message = span_boldwarning("Your head will spew smoke in an area, wherever it may be.")
chosen_attack_num = SPEW_SMOKE
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/OpenFire()
if(client)
switch(chosen_attack)
if(LEGIONNAIRE_CHARGE)
legionnaire_charge(target)
if(HEAD_DETACH)
head_detach(target)
if(BONFIRE_TELEPORT)
bonfire_teleport()
if(SPEW_SMOKE)
spew_smoke()
return
var/aiattack = rand(1,4)
switch(aiattack)
if(LEGIONNAIRE_CHARGE)
legionnaire_charge(target)
if(HEAD_DETACH)
head_detach(target)
if(BONFIRE_TELEPORT)
bonfire_teleport()
if(SPEW_SMOKE)
spew_smoke()
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/legionnaire_charge(target)
ranged_cooldown = world.time + 50
var/dir_to_target = get_dir(get_turf(src), get_turf(target))
var/turf/T = get_step(get_turf(src), dir_to_target)
for(var/i in 1 to 4)
new /obj/effect/temp_visual/dragon_swoop/legionnaire(T)
T = get_step(T, dir_to_target)
playsound(src,'sound/magic/demon_attack1.ogg', 200, 1)
visible_message(span_boldwarning("[src] prepares to charge!"))
addtimer(CALLBACK(src, PROC_REF(legionnaire_charge_2), dir_to_target, 0), 5)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/legionnaire_charge_2(move_dir, times_ran)
if(times_ran >= 4)
return
var/turf/T = get_step(get_turf(src), move_dir)
if(ismineralturf(T))
var/turf/closed/mineral/M = T
M.attempt_drill()
if(T.density)
return
for(var/obj/structure/window/W in T.contents)
return
for(var/obj/machinery/door/D in T.contents)
return
forceMove(T)
playsound(src,'sound/effects/bang.ogg', 200, 1)
var/list/hit_things = list()
var/throwtarget = get_edge_target_turf(src, move_dir)
for(var/mob/living/L in T.contents - hit_things - src)
if(faction_check_mob(L))
return
hit_things += L
visible_message(span_boldwarning("[src] attacks [L] with much force!"))
to_chat(L, span_userdanger("[src] grabs you and throws you with much force!"))
L.safe_throw_at(throwtarget, 10, 1, src)
L.Paralyze(20)
L.adjustBruteLoss(50)
addtimer(CALLBACK(src, PROC_REF(legionnaire_charge_2), move_dir, (times_ran + 1)), 2)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/head_detach(target)
ranged_cooldown = world.time + 10
if(myhead != null)
myhead.adjustBruteLoss(600)
return
if(has_head)
has_head = FALSE
icon_state = "legionnaire_headless"
icon_living = "legionnaire_headless"
icon_aggro = "legionnaire_headless"
visible_message(span_boldwarning("[src]'s head flies off!"))
var/mob/living/simple_animal/hostile/asteroid/elite/legionnairehead/newhead = new /mob/living/simple_animal/hostile/asteroid/elite/legionnairehead(loc)
newhead.flags_1 |= (flags_1 & ADMIN_SPAWNED_1)
newhead.GiveTarget(target)
newhead.faction = faction.Copy()
myhead = newhead
myhead.body = src
if(health < maxHealth * 0.25)
myhead.melee_damage_lower = 30
myhead.melee_damage_upper = 30
else if(health < maxHealth * 0.5)
myhead.melee_damage_lower = 20
myhead.melee_damage_upper = 20
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/onHeadDeath()
myhead = null
addtimer(CALLBACK(src, PROC_REF(regain_head)), 50)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/regain_head()
has_head = TRUE
if(stat == DEAD)
return
icon_state = "legionnaire"
icon_living = "legionnaire"
icon_aggro = "legionnaire"
visible_message(span_boldwarning("The top of [src]'s spine leaks a black liquid, forming into a skull!"))
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/bonfire_teleport()
ranged_cooldown = world.time + 5
if(mypile == null)
var/obj/structure/legionnaire_bonfire/newpile = new /obj/structure/legionnaire_bonfire(loc)
mypile = newpile
mypile.myowner = src
playsound(get_turf(src),'sound/items/fultext_deploy.ogg', 200, 1)
visible_message(span_boldwarning("[src] summons a bonfire on [get_turf(src)]!"))
return
else
var/turf/legionturf = get_turf(src)
var/turf/pileturf = get_turf(mypile)
if(legionturf == pileturf)
mypile.take_damage(100)
mypile = null
return
playsound(pileturf,'sound/items/fultext_deploy.ogg', 200, 1)
playsound(legionturf,'sound/items/fultext_deploy.ogg', 200, 1)
visible_message(span_boldwarning("[src] melts down into a burning pile of bones!"))
forceMove(pileturf)
visible_message(span_boldwarning("[src] forms from the bonfire!"))
mypile.forceMove(legionturf)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/proc/spew_smoke()
ranged_cooldown = world.time + 60
var/turf/T = null
if(myhead != null)
T = get_turf(myhead)
else
T = get_turf(src)
if(myhead != null)
myhead.visible_message(span_boldwarning("[myhead] spews smoke from its maw!"))
else if(!has_head)
visible_message(span_boldwarning("[src] spews smoke from the tip of their spine!"))
else
visible_message(span_boldwarning("[src] spews smoke from its maw!"))
var/datum/effect_system/fluid_spread/smoke/smoke = new
smoke.set_up(2, location = T)
smoke.start()
/obj/item/gps/internal/legionnaire
icon_state = null
gpstag = "Wailing Signal"
desc = "One vs many."
invisibility = 100
//The legionnaire's head. Basically the same as any legion head, but we have to tell our creator when we die so they can generate another head.
/mob/living/simple_animal/hostile/asteroid/elite/legionnairehead
name = "legionnaire head"
desc = "The legionnaire's head floating by itself. One shouldn't get too close, though once it sees you, you really don't have a choice."
icon_state = "legionnaire_head"
icon_living = "legionnaire_head"
icon_aggro = "legionnaire_head"
icon_dead = "legionnaire_dead"
icon_gib = "syndicate_gib"
maxHealth = 80
health = 80
melee_damage_lower = 10
melee_damage_upper = 10
attack_vis_effect = ATTACK_EFFECT_BITE
attacktext = "bites at"
//attack_verb_simple = "bite at"
attack_sound = 'sound/effects/curse1.ogg'
throw_message = "simply misses"
speed = 0
move_to_delay = 2
del_on_death = 1
deathmessage = "crumbles away!"
faction = list()
ranged = FALSE
var/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/body = null
true_spawn = FALSE
/mob/living/simple_animal/hostile/asteroid/elite/legionnairehead/death()
. = ..()
if(body)
body.onHeadDeath()
//The legionnaire's bonfire, which can be swapped positions with. Also sets flammable living beings on fire when they walk over it.
/obj/structure/legionnaire_bonfire
name = "bone pile"
desc = "A pile of bones which seems to occasionally move a little. It's probably a good idea to smash them."
icon = 'icons/obj/lavaland/legionnaire_bonfire.dmi'
icon_state = "bonfire"
max_integrity = 100
move_resist = MOVE_FORCE_EXTREMELY_STRONG
anchored = TRUE
density = FALSE
light_range = 4
light_color = LIGHT_COLOR_RED
var/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/myowner = null
/obj/structure/legionnaire_bonfire/Entered(atom/movable/mover, atom/target)
if(isliving(mover))
var/mob/living/L = mover
L.adjust_fire_stacks(3)
L.ignite_mob()
. = ..()
/obj/structure/legionnaire_bonfire/Destroy()
if(myowner != null)
myowner.mypile = null
. = ..()
//The visual effect which appears in front of legionnaire when he goes to charge.
/obj/effect/temp_visual/dragon_swoop/legionnaire
duration = 10
color = rgb(0,0,0)
/obj/effect/temp_visual/dragon_swoop/legionnaire/Initialize(mapload)
. = ..()
transform *= 0.33
// Legionnaire's loot: Legionnaire Spine
/obj/item/crusher_trophy/legionnaire_spine
name = "legionnaire spine"
desc = "The spine of a legionnaire. It almost feels like it's moving..."
icon = 'icons/obj/lavaland/elite_trophies.dmi'
icon_state = "legionnaire_spine"
denied_type = /obj/item/crusher_trophy/legionnaire_spine
bonus_value = 20
/obj/item/crusher_trophy/legionnaire_spine/effect_desc()
return "mark detonation to have a <b>[bonus_value]%</b> chance to summon a loyal legion skull"
/obj/item/crusher_trophy/legionnaire_spine/on_mark_detonation(mob/living/target, mob/living/user)
if(rand(1, 100) <= bonus_value && target.stat != DEAD)
var/mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/A = new /mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion(user.loc)
A.flags_1 |= (flags_1 & ADMIN_SPAWNED_1)
A.GiveTarget(target)
A.friends = user
A.faction = user.faction.Copy()
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant
name = "attendant"
desc = "A towering protector who doesn't share its smaller cousins' aversion to lethality. Its large stature can assist its allies in traversing difficult terrain."
maxHealth = 200
health = 200
melee_damage_lower = 15
melee_damage_upper = 15
color = "#7422a3"
deathmessage = "'s arms reach out before it crumbles away to nothing."
loot_drop = null
var/fauna_damage_bonus = 15
del_on_death = 1
can_buckle = 1
buckle_lying = 0
movement_type = FLYING //for the sake of riding them across lava
do_footstep = FALSE
tame = 1
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant/death()
GLOB.aide_list -= src
..()
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant/AttackingTarget()
. = ..()
var/mob/living/L = target
if(ismegafauna(L) || istype(L, /mob/living/simple_animal/hostile/asteroid))
L.apply_damage(fauna_damage_bonus, BRUTE)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant/Initialize(mapload)
. = ..()
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(10,40, MOB_LAYER), TEXT_SOUTH = list(-10, 40, MOB_LAYER), TEXT_EAST = list(0, 40, MOB_LAYER), TEXT_WEST = list( 0, 40, MOB_LAYER)))
D.set_vehicle_dir_layer(SOUTH, ABOVE_MOB_LAYER)
D.set_vehicle_dir_layer(NORTH, OBJ_LAYER)
D.set_vehicle_dir_layer(EAST, ABOVE_MOB_LAYER)
D.set_vehicle_dir_layer(WEST, ABOVE_MOB_LAYER)
D.vehicle_move_delay = 1
RegisterSignal(src, COMSIG_MOVABLE_BUCKLE, PROC_REF(give_abilities))
RegisterSignal(src, COMSIG_MOVABLE_UNBUCKLE, PROC_REF(remove_abilities))
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant/proc/give_abilities(mob/living/elite, mob/living/M, force = FALSE)
toggle_ai(AI_OFF)
if(istype(click_intercept, /datum/action/cooldown/spell/pointed/drakeling))
var/datum/action/cooldown/spell/pointed/drakeling/D = click_intercept
D.unset_click_ability(D.owner)
for(var/datum/action/action in attack_action_types)
action.Remove(src)
action.Grant(M)
/mob/living/simple_animal/hostile/asteroid/elite/legionnaire/attendant/proc/remove_abilities(mob/living/elite, mob/living/M, force = FALSE)
toggle_ai(AI_ON)
if(istype(M.click_intercept, /datum/action/cooldown/spell/pointed/drakeling))
var/datum/action/cooldown/spell/pointed/drakeling/D = M.click_intercept
D.unset_click_ability(D.owner)
for(var/datum/action/action in attack_action_types)
action.Remove(M)
action.Grant(src)