-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy path_megafauna.dm
172 lines (154 loc) · 5.79 KB
/
_megafauna.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
/mob/living/simple_animal/hostile/megafauna
name = "boss of this gym"
desc = "Attack the weak point for massive damage."
health = 1000
maxHealth = 1000
spacewalk = TRUE
combat_mode = TRUE
sentience_type = SENTIENCE_BOSS
environment_smash = ENVIRONMENT_SMASH_RWALLS
mob_biotypes = MOB_ORGANIC|MOB_EPIC
obj_damage = 400
light_range = 3
faction = list("mining", "boss")
weather_immunities = ALL
movement_type = FLYING
robust_searching = TRUE
ranged_ignores_vision = TRUE
stat_attack = DEAD
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
damage_coeff = list(BRUTE = 1, BURN = 0.5, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1)
minbodytemp = 0
maxbodytemp = INFINITY
vision_range = 5
aggro_vision_range = 18
move_force = MOVE_FORCE_OVERPOWERING
move_resist = MOVE_FORCE_OVERPOWERING
pull_force = MOVE_FORCE_OVERPOWERING
mob_size = MOB_SIZE_HUGE
layer = LARGE_MOB_LAYER //Looks weird with them slipping under mineral walls and cameras and shit otherwise
mouse_opacity = MOUSE_OPACITY_OPAQUE // Easier to click on in melee, they're giant targets anyway
flags_1 = HEAR_1 | PREVENT_CONTENTS_EXPLOSION_1
/// Crusher loot dropped when the megafauna is killed with a crusher
var/list/crusher_loot
/// Achievement given to surrounding players when the megafauna is killed
var/achievement_type
/// Crusher achievement given to players when megafauna is killed
var/crusher_achievement_type
/// Score given to players when megafauna is killed
var/score_achievement_type
/// If the megafauna was actually killed (not just dying, then transforming into another type)
var/elimination = 0
/// Modifies attacks when at lower health
var/anger_modifier = 0
/// Name for the GPS signal of the megafauna
var/gps_name = null
/// Next time the megafauna can use a melee attack
var/recovery_time = 0
/// If this is a megafauna that is real (has achievements, gps signal)
var/true_spawn = TRUE
/// The chosen attack by the megafauna
var/chosen_attack = 1
/// Attack actions, sets chosen_attack to the number in the action
var/list/attack_action_types = list()
/// Summoning line, said when summoned via megafauna vents.
var/summon_line = "I'll kick your ass!"
var/nest_range = 10
var/small_sprite_type
/mob/living/simple_animal/hostile/megafauna/Initialize(mapload)
. = ..()
if(gps_name && true_spawn)
AddComponent(/datum/component/gps, gps_name)
ADD_TRAIT(src, TRAIT_NO_TELEPORT, MEGAFAUNA_TRAIT)
for(var/action_type in attack_action_types)
var/datum/action/innate/megafauna_attack/attack_action = new action_type()
attack_action.Grant(src)
if(small_sprite_type)
var/datum/action/small_sprite/small_action = new small_sprite_type()
small_action.Grant(src)
/mob/living/simple_animal/hostile/megafauna/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change)
if(nest && nest.parent && get_dist(nest.parent, src) > nest_range)
var/turf/closest = get_turf(nest.parent)
for(var/i = 1 to nest_range)
closest = get_step(closest, get_dir(closest, src))
forceMove(closest) // someone teleported out probably and the megafauna kept chasing them
target = null
return
return ..()
/mob/living/simple_animal/hostile/megafauna/death(gibbed, list/force_grant)
if(health > 0)
return
else
var/datum/status_effect/crusher_damage/C = has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
var/crusher_kill = FALSE
if(C && crusher_loot && C.total_damage >= maxHealth * 0.6)
spawn_crusher_loot()
crusher_kill = TRUE
if(true_spawn && !(flags_1 & ADMIN_SPAWNED_1))
var/tab = "megafauna_kills"
if(crusher_kill)
tab = "megafauna_kills_crusher"
if(!elimination) //So legion only gets tallied once they all get killed
SSblackbox.record_feedback("tally", tab, 1, "[initial(name)]")
..()
/mob/living/simple_animal/hostile/megafauna/proc/spawn_crusher_loot()
loot = crusher_loot
/mob/living/simple_animal/hostile/megafauna/gib(no_brain, no_organs, no_bodyparts, no_items)
if(health > 0)
return
else
..()
/mob/living/simple_animal/hostile/megafauna/dust(just_ash, drop_items, force)
if(!force && health > 0)
return
else
..()
/mob/living/simple_animal/hostile/megafauna/AttackingTarget()
if(recovery_time >= world.time)
return
. = ..()
if(. && isliving(target))
var/mob/living/L = target
if(L.stat != DEAD && !istype(L, /mob/living/simple_animal/slime)) // Megafauna eat slimes
if(!client && ranged && ranged_cooldown <= world.time)
OpenFire()
else
devour(L)
/mob/living/simple_animal/hostile/megafauna/proc/devour(mob/living/L)
if(!L)
return FALSE
visible_message(
span_danger("[src] devours [L]!"),
span_userdanger("You feast on [L], restoring your health!"))
if(!is_station_level(z) || client) //NPC monsters won't heal while on station
adjustBruteLoss(-L.maxHealth/2)
L.gib()
return TRUE
/mob/living/simple_animal/hostile/megafauna/ex_act(severity, target)
switch (severity)
if (EXPLODE_DEVASTATE)
adjustBruteLoss(250)
if (EXPLODE_HEAVY)
adjustBruteLoss(100)
if (EXPLODE_LIGHT)
adjustBruteLoss(50)
/mob/living/simple_animal/hostile/megafauna/proc/SetRecoveryTime(buffer_time, ranged_buffer_time)
recovery_time = world.time + buffer_time
ranged_cooldown = world.time + buffer_time
if(ranged_buffer_time)
ranged_cooldown = world.time + ranged_buffer_time
/datum/action/innate/megafauna_attack
name = "Megafauna Attack"
button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = ""
var/mob/living/simple_animal/hostile/megafauna/M
var/chosen_message
var/chosen_attack_num = 0
/datum/action/innate/megafauna_attack/Grant(mob/living/L)
if(istype(L, /mob/living/simple_animal/hostile/megafauna))
M = L
return ..()
return FALSE
/datum/action/innate/megafauna_attack/Activate()
M.chosen_attack = chosen_attack_num
to_chat(M, chosen_message)