Skip to content

Commit

Permalink
New headcrabs! (ParadiseSS13#12352)
Browse files Browse the repository at this point in the history
  • Loading branch information
Terilia authored and variableundefined committed Sep 21, 2019
1 parent b81d5a6 commit 4ea66b4
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 5 deletions.
26 changes: 23 additions & 3 deletions code/modules/events/headcrabs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
#define LOC_GAMBLING_DEN 19

#define HEADCRAB_NORMAL 0
/*#define HEADCRAB_SPECIAL 1
#define HEADCRAB_CLOWN 2 */ //Planned for the future
#define HEADCRAB_FASTMIX 1
#define HEADCRAB_FAST 2
#define HEADCRAB_POISONMIX 3
#define HEADCRAB_POISON 4
/*#define HEADCRAB_CLOWN 5 */ //Planned for the future. maybe

/datum/event/headcrabs
announceWhen = 10
Expand Down Expand Up @@ -104,11 +107,24 @@

var/list/spawn_types = list()
var/max_number
headcrab = 0 //rand(0,x) for the future
headcrab = rand(0, 4) //rand(0,x) for the future
switch(headcrab) //Switch is for the future
if(HEADCRAB_NORMAL)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab)
max_number = 6
if(HEADCRAB_FASTMIX)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab, /mob/living/simple_animal/hostile/headcrab/fast)
max_number = 8
if(HEADCRAB_FAST)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab/fast)
max_number = 6
if(HEADCRAB_POISONMIX)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab, /mob/living/simple_animal/hostile/headcrab/poison)
max_number = 4
if(HEADCRAB_POISON)
spawn_types = list(/mob/living/simple_animal/hostile/headcrab/poison)
max_number = 3


var/num = rand(2,max_number)
while(turfs.len > 0 && num > 0)
Expand Down Expand Up @@ -144,3 +160,7 @@
#undef LOC_GAMBLING_DEN

#undef HEADCRAB_NORMAL
#undef HEADCRAB_FASTMIX
#undef HEADCRAB_FAST
#undef HEADCRAB_POISONMIX
#undef HEADCRAB_POISON
70 changes: 68 additions & 2 deletions code/modules/mob/living/simple_animal/hostile/headcrab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
attack_sound = 'sound/creatures/headcrab_attack.ogg'
speak_emote = list("hisses")
var/is_zombie = 0
stat_attack = DEAD //so they continue to attack when they are on the ground.
stat_attack = DEAD //so they continue to attack when they are on the ground.
var/host_species = ""
var/list/human_overlays = list()

Expand Down Expand Up @@ -94,7 +94,7 @@


/mob/living/simple_animal/hostile/headcrab/update_icons()
..()
. = ..()
if(is_zombie)
overlays.Cut()
overlays = human_overlays
Expand All @@ -104,3 +104,69 @@
else if(host_species == "Gray")
I = image('icons/mob/headcrab.dmi', icon_state = "headcrabpod_gray")
overlays += I



/mob/living/simple_animal/hostile/headcrab/fast
name = "fast headcrab"
desc = "A fast parasitic creature that would like to connect with your brain stem."
icon = 'icons/mob/headcrab.dmi'
icon_state = "fast_headcrab"
icon_living = "fast_headcrab"
icon_dead = "fast_headcrab_dead"
health = 30
maxHealth = 30
ranged_cooldown_time = 30
jumpdistance = 8
jumpspeed = 2
speak_emote = list("screech")

/mob/living/simple_animal/hostile/headcrab/fast/update_icons()
. = ..()
if(is_zombie)
overlays.Cut()
overlays = human_overlays
var/image/I = image('icons/mob/headcrab.dmi', icon_state = "fast_headcrabpod")
if(host_species == "Vox")
I = image('icons/mob/headcrab.dmi', icon_state = "fast_headcrabpod_vox")
else if(host_species == "Gray")
I = image('icons/mob/headcrab.dmi', icon_state = "fast_headcrabpod_gray")
overlays += I

/mob/living/simple_animal/hostile/headcrab/fast/Zombify(mob/living/carbon/human/H)
. = ..()
speak = list('sound/creatures/fast_zombie_idle1.ogg','sound/creatures/fast_zombie_idle2.ogg','sound/creatures/fast_zombie_idle3.ogg')

/mob/living/simple_animal/hostile/headcrab/poison
name = "poison headcrab"
desc = "A poison parasitic creature that would like to connect with your brain stem."
icon = 'icons/mob/headcrab.dmi'
icon_state = "poison_headcrab"
icon_living = "poison_headcrab"
icon_dead = "poison_headcrab_dead"
health = 60
maxHealth = 60
ranged_cooldown_time = 50
jumpdistance = 3
jumpspeed = 1
attack_sound = 'sound/creatures/ph_scream1.ogg'
speak_emote = list("screech")

/mob/living/simple_animal/hostile/headcrab/poison/update_icons()
. = ..()
if(is_zombie)
overlays.Cut()
overlays = human_overlays
var/image/I = image('icons/mob/headcrab.dmi', icon_state = "poison_headcrabpod")
if(host_species == "Vox")
I = image('icons/mob/headcrab.dmi', icon_state = "poison_headcrabpod_vox")
else if(host_species == "Gray")
I = image('icons/mob/headcrab.dmi', icon_state = "poison_headcrabpod_gray")
overlays += I


/mob/living/simple_animal/hostile/headcrab/poison/AttackingTarget()
. = ..()
var/mob/living/carbon/C = target
if(C.can_inject(null, 0, "head", 0))
C.reagents.add_reagent("lsd", 5)
Binary file modified icons/mob/headcrab.dmi
Binary file not shown.
Binary file added sound/creatures/fast_zombie_idle1.ogg
Binary file not shown.
Binary file added sound/creatures/fast_zombie_idle2.ogg
Binary file not shown.
Binary file added sound/creatures/fast_zombie_idle3.ogg
Binary file not shown.
Binary file added sound/creatures/ph_scream1.ogg
Binary file not shown.

0 comments on commit 4ea66b4

Please sign in to comment.