/
legionnaire.dm
300 lines (273 loc) · 11.4 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
#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_verb_continuous = "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 = 1
move_to_delay = 3
mouse_opacity = MOUSE_OPACITY_ICON
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 class='boldwarning'>You will attempt to grab your opponent and throw them.</span>"
chosen_attack_num = LEGIONNAIRE_CHARGE
/datum/action/innate/elite_attack/head_detach
name = "Release Head"
button_icon_state = "head_detach"
chosen_message = "<span class='boldwarning'>You will now detach your head or kill it if it is already released.</span>"
chosen_attack_num = HEAD_DETACH
/datum/action/innate/elite_attack/bonfire_teleport
name = "Bonfire Teleport"
button_icon_state = "bonfire_teleport"
chosen_message = "<span class='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.</span>"
chosen_attack_num = BONFIRE_TELEPORT
/datum/action/innate/elite_attack/spew_smoke
name = "Spew Smoke"
button_icon_state = "spew_smoke"
chosen_message = "<span class='boldwarning'>Your head will spew smoke in an area, wherever it may be.</span>"
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 class='boldwarning'>[src] prepares to charge!</span>")
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.gets_drilled()
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 class='boldwarning'>[src] attacks [L] with much force!</span>")
to_chat(L, "<span class='userdanger'>[src] grabs you and throws you with much force!</span>")
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 class='boldwarning'>[src]'s head flies off!</span>")
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 class='boldwarning'>The top of [src]'s spine leaks a black liquid, forming into a skull!</span>")
/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 class='boldwarning'>[src] summons a bonfire on [get_turf(src)]!</span>")
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 class='boldwarning'>[src] melts down into a burning pile of bones!</span>")
forceMove(pileturf)
visible_message("<span class='boldwarning'>[src] forms from the bonfire!</span>")
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 class='boldwarning'>[myhead] spews smoke from its maw!</span>")
else if(!has_head)
visible_message("<span class='boldwarning'>[src] spews smoke from the tip of their spine!</span>")
else
visible_message("<span class='boldwarning'>[src] spews smoke from its maw!</span>")
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(2, T)
smoke.start()
//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_verb_continuous = "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
/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 = COLOR_SOFT_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.IgniteMob()
. = ..()
/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()
. = ..()
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 = 50//These skulls are a joke, so this bonus value had to be put on steroidal emergency treatment
/obj/item/crusher_trophy/legionnaire_spine/effect_desc()
return "waveform collapse 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)
return
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()