Files
S.P.L.U.R.T-Station-13/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
2019-11-27 01:54:10 +01:00

133 lines
4.2 KiB
Plaintext

/mob/living/simple_animal/hostile/megafauna
name = "boss of this gym"
desc = "Attack the weak point for massive damage."
health = 1000
maxHealth = 1000
a_intent = INTENT_HARM
sentience_type = SENTIENCE_BOSS
environment_smash = ENVIRONMENT_SMASH_RWALLS
mob_biotypes = list(MOB_ORGANIC, MOB_EPIC)
obj_damage = 400
light_range = 3
faction = list("mining", "boss")
weather_immunities = list("lava","ash")
movement_type = FLYING
robust_searching = 1
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 = 4
aggro_vision_range = 15
anchored = TRUE
mob_size = MOB_SIZE_LARGE
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 = PREVENT_CONTENTS_EXPLOSION_1
var/list/crusher_loot
var/medal_type
var/score_type = BOSS_SCORE
var/elimination = 0
var/anger_modifier = 0
var/obj/item/gps/internal
var/recovery_time = 0
/mob/living/simple_animal/hostile/megafauna/Initialize(mapload)
. = ..()
apply_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
/mob/living/simple_animal/hostile/megafauna/Destroy()
QDEL_NULL(internal)
. = ..()
/mob/living/simple_animal/hostile/megafauna/death(gibbed)
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(!(flags_1 & ADMIN_SPAWNED_1))
var/tab = "megafauna_kills"
if(crusher_kill)
tab = "megafauna_kills_crusher"
SSblackbox.record_feedback("tally", tab, 1, "[initial(name)]")
if(!elimination) //used so the achievment only occurs for the last legion to die.
grant_achievement(medal_type, score_type, crusher_kill)
..()
/mob/living/simple_animal/hostile/megafauna/proc/spawn_crusher_loot()
loot = crusher_loot
/mob/living/simple_animal/hostile/megafauna/gib()
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)
if(!client && ranged && ranged_cooldown <= world.time)
OpenFire()
if(L.Adjacent(src) && (L.stat != CONSCIOUS))
if(vore_active && L.devourable == TRUE)
vore_attack(src,L,src)
LoseTarget()
else
devour(L)
/mob/living/simple_animal/hostile/megafauna/proc/devour(mob/living/L)
if(!L)
return
visible_message(
"<span class='danger'>[src] devours [L]!</span>",
"<span class='userdanger'>You feast on [L], restoring your health!</span>")
if(!is_station_level(z) || client) //NPC monsters won't heal while on station
adjustBruteLoss(-L.maxHealth/2)
L.gib()
/mob/living/simple_animal/hostile/megafauna/ex_act(severity, target)
switch (severity)
if (1)
adjustBruteLoss(250)
if (2)
adjustBruteLoss(100)
if(3)
adjustBruteLoss(50)
/mob/living/simple_animal/hostile/megafauna/proc/SetRecoveryTime(buffer_time)
recovery_time = world.time + buffer_time
/mob/living/simple_animal/hostile/megafauna/proc/grant_achievement(medaltype, scoretype, crusher_kill)
if(!medal_type || (flags_1 & ADMIN_SPAWNED_1) || !SSmedals.hub_enabled) //Don't award medals if the medal type isn't set
return FALSE
for(var/mob/living/L in view(7,src))
if(L.stat || !L.client)
continue
var/client/C = L.client
SSmedals.UnlockMedal("Boss [BOSS_KILL_MEDAL]", C)
SSmedals.UnlockMedal("[medaltype] [BOSS_KILL_MEDAL]", C)
if(crusher_kill && istype(L.get_active_held_item(), /obj/item/twohanded/kinetic_crusher))
SSmedals.UnlockMedal("[medaltype] [BOSS_KILL_MEDAL_CRUSHER]", C)
SSmedals.SetScore(BOSS_SCORE, C, 1)
SSmedals.SetScore(score_type, C, 1)
return TRUE