Skip to content
Merged

HOG! #37454

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,15 @@ Proc for attack log creation, because really why not
for (var/mob/M in player_list)
if (M.ckey == ckey)
return M

/proc/get_open_maintenance_turfs(var/num)
var/list/turf/simulated/floor/turfs = list()
for(var/areapath in typesof(/area/maintenance))
var/area/A = locate(areapath)
for(var/turf/simulated/floor/F in A.contents)
if(!is_blocked_turf(F))
turfs += F
var/list/turf/simulated/floor/output = list()
for(var/i = 1 to num)
output += pick_n_take(turfs)
return output
8 changes: 7 additions & 1 deletion code/datums/helper_datums/command_alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
message = "The microdosimetry meter onboard [station_name()] has been tripped by recent cosmic interference. Automated Bragg Curve calculations show a threat of ion implantation in crew members, which may lead to sickness or organ failure. Central Command advises regular health screening of staff displaying symptoms of malaise."
..()

/datum/command_alert/hog
name = "HOG"
alert_title = ""
force_report = 1
message = "A Hazardous Organic Grease-source (HOG) has been detected in your station maintenance. Remove it before its secretions damage station equipment."

///////HISS

/datum/command_alert/xenomorph_station_lockdown
Expand Down Expand Up @@ -869,4 +875,4 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked

/datum/command_alert/suspicious_wages/announce(login, account)
message = "Central Command has noticed a suspicious increase in wages. A database action logged in as [login] has assigned a new wage to [account] with a payroll greater than the entire station's budget. Please conduct an emergency audit."
..()
..()
19 changes: 19 additions & 0 deletions code/modules/events/spacehog.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/datum/event/hog
oneShot = TRUE

/datum/event/hog/can_start(var/list/active_with_role)
if((active_with_role["Assistant"] > 4) || (active_with_role["Chef"] > 0))
return 20
return 0

/datum/event/hog/start()
var/list/turf/simulated/floor/turfs = get_open_maintenance_turfs(5)
if(turfs.len < 2) //Pick a turf to spawn at if we can
message_admins("Aborted hog event. Couldn't find maintenance spaces.")
return
command_alert(/datum/command_alert/hog)
var/mob/living/simple_animal/rampagingspacehog/ourhog = new(pick_n_take(turfs))
message_admins("<span class='notice'>Event: hog spawned in at [ourhog.loc] <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[ourhog.x];Y=[ourhog.y];Z=[ourhog.z]'>(JMP)</a></span>")
ourhog.homes += turfs //add the rest in too


86 changes: 86 additions & 0 deletions code/modules/mob/living/simple_animal/hostile/hog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,89 @@ if ungreased adult: l containers

/mob/living/simple_animal/hostile/spacehog/piglet/set_mood(var/mood)
..(HOG_SKITTISH)


//This is not a subtype of spacehog because it is very different than other spacehogs. It does not fight, it has no moods, foraging, hunger needs, etc.
/mob/living/simple_animal/rampagingspacehog
name = "rampaging overgreased feral space hog"
desc = "It leaves a sickly trail of grease and knocks over anyone in its way."
speed = 1 //moves at same speed as a person when not dashing
maxHealth = 450
health = 450
icon = 'icons/mob/hog.dmi'
icon_state = "hog_overgreased"
icon_living = "hog_overgreased"
icon_dead = "hog_overgreased_dead"
speak = list("Oink!","Squee!","Sqwaa!","Ounch!", "SQUEEEEE!","Oink...","Oink, oink", "Oink, oink, oink", "Oink!", "Oiiink.")
emote_hear = list("squeals hauntingly")
emote_see = list("roots about","squeals hauntingly")
emote_sound = list("sound/voice/pigsnort.ogg","sound/voice/pigsqueal.ogg")
response_help = "pats"
response_disarm = "shoves"
response_harm = "hits"
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/box/pig
can_butcher = TRUE
size = SIZE_BIG
var/dashspeed = 3 //How fast it paths!
var/nextsqueal = 0
var/list/homes = list() //Places the rampaging hog will try to go
var/obj/item/weapon/card/id/captains_spare/CS
var/target //Where we're heading
var/list/path = list()

/mob/living/simple_animal/rampagingspacehog/New()
..()
homes += loc
CS = new(src) //The hog can already squeeze through any door, but this makes sure he knows it.

/mob/living/simple_animal/rampagingspacehog/Destroy()
QDEL_NULL(CS)
..()

/mob/living/simple_animal/rampagingspacehog/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0)
//Before departing
var/turf/simulated/T = loc
if(istype(T) && !T.is_wet())
new /obj/effect/overlay/puddle(T, TURF_WET_LUBE, 5 SECONDS) //leave 5 seconds of lube behind
..() //move on

/mob/living/simple_animal/rampagingspacehog/to_bump(var/atom/movable/AM)
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
H.Knockdown(5)
..()

/mob/living/simple_animal/rampagingspacehog/adjustBruteLoss(var/damage)
..()
if(health<=0)
return
if(homes.len<2)
homes += get_open_maintenance_turfs(4)
if(nextsqueal < world.time)
nextsqueal = world.time + (2 SECONDS)
playsound(loc, 'sound/voice/pigsqueal.ogg', 50, 0)
target = pick(homes)
path = get_path_to(src, target, max_distance=500, id = CS)
message_admins("Debug: produced path of size [path.len]. View: [path]")
if(!path)
message_admins("Debug: Rampaging hog failed to get a path.")
pathers += src

/mob/living/simple_animal/rampagingspacehog/Life()
..()

for(var/i = 1 to dashspeed)
if(path.len>0)
process_astar_path()
else
break

/mob/living/simple_animal/rampagingspacehog/process_astar_path()
if(gcDestroyed || stat == DEAD)
return FALSE
Move(path[1])
path.Remove(path[1])
if(!path.len)
playsound(loc, 'sound/voice/pigsnort.ogg', 50, 0)
return FALSE
return TRUE
1 change: 1 addition & 0 deletions vgstation13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,7 @@
#include "code\modules\events\prison_break.dm"
#include "code\modules\events\radiation_storm.dm"
#include "code\modules\events\rogue_drones.dm"
#include "code\modules\events\spacehog.dm"
#include "code\modules\events\spacevine.dm"
#include "code\modules\events\spider_infestation.dm"
#include "code\modules\events\spontaneous_appendicitis.dm"
Expand Down
Loading