/
phorogenic.dm
68 lines (51 loc) · 1.84 KB
/
phorogenic.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
// Phorogenic spiders explode when they die.
// You really shouldn't melee them.
/mob/living/simple_animal/hostile/giant_spider/phorogenic
desc = "Crystalline and purple, it makes you shudder to look at it. This one has haunting purple eyes."
icon_state = "phoron"
icon_living = "phoron"
icon_dead = "phoron_dead"
maxHealth = 200
health = 200
taser_kill = FALSE //You will need more than a peashooter to kill the juggernaut.
natural_weapon = /obj/item/natural_weapon/bite/spider/phorogenic
attack_armor_pen = 15
movement_cooldown = 4
base_attack_cooldown = 2 SECOND
poison_chance = 30
poison_per_bite = 0.5
poison_type = /datum/reagent/toxin/phoron
mob_size = MOB_LARGE
var/exploded = FALSE
var/explosion_radius = 7
var/explosion_max_power = EX_ACT_DEVASTATING
/// Lower bound for explosion delay.
var/explosion_delay_lower = 1 SECONDS
/// Upper bound for explosion delay.
var/explosion_delay_upper = 4 SECONDS
/mob/living/simple_animal/hostile/giant_spider/phorogenic/Initialize()
SetTransform(scale = 1.25)
return ..()
/mob/living/simple_animal/hostile/giant_spider/phorogenic/death()
visible_message(SPAN_DANGER("\The [src]'s body begins to rupture!"))
var/delay = rand(explosion_delay_lower, explosion_delay_upper)
addtimer(new Callback(src, .proc/flash, delay), 0)
return ..()
/mob/living/simple_animal/hostile/giant_spider/phorogenic/proc/flash(delay)
// Flash black and red as a warning.
for (var/i = 1 to delay)
if (i % 2 == 0)
color = "#000000"
else
color = "#ff0000"
sleep(1)
detonate()
/mob/living/simple_animal/hostile/giant_spider/phorogenic/proc/detonate()
// The actual boom.
if (src && !exploded)
visible_message(SPAN_DANGER("\The [src]'s body detonates!"))
exploded = TRUE
explosion(loc, explosion_radius, explosion_max_power)
qdel(src)
/obj/item/natural_weapon/bite/spider/phorogenic
force = 30