Skip to content

Commit

Permalink
Zombies added to gamelay, although not random events.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZomgPonies committed Sep 18, 2013
1 parent a12cd4b commit d1f5b1a
Show file tree
Hide file tree
Showing 11 changed files with 379 additions and 2 deletions.
3 changes: 3 additions & 0 deletions baystation12.dme
Expand Up @@ -22,6 +22,7 @@
#define FILE_DIR "icons/misc"
#define FILE_DIR "icons/mob"
#define FILE_DIR "icons/mob/human_races"
#define FILE_DIR "icons/mob/otherHuman"
#define FILE_DIR "icons/obj"
#define FILE_DIR "icons/obj/assemblies"
#define FILE_DIR "icons/obj/atmospherics"
Expand Down Expand Up @@ -148,6 +149,7 @@
#include "code\datums\diseases\robotic_transformation.dm"
#include "code\datums\diseases\wizarditis.dm"
#include "code\datums\diseases\xeno_transformation.dm"
#include "code\datums\diseases\zombie_transformation.dm"
#include "code\datums\diseases\advance\advance.dm"
#include "code\datums\diseases\advance\presets.dm"
#include "code\datums\diseases\advance\symptoms\beard.dm"
Expand Down Expand Up @@ -1064,6 +1066,7 @@
#include "code\modules\mob\living\simple_animal\hostile\russian.dm"
#include "code\modules\mob\living\simple_animal\hostile\syndicate.dm"
#include "code\modules\mob\living\simple_animal\hostile\tree.dm"
#include "code\modules\mob\living\simple_animal\hostile\zombie.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\drone.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm"
Expand Down
118 changes: 118 additions & 0 deletions code/datums/diseases/zombie_transformation.dm
@@ -0,0 +1,118 @@
/datum/disease/zombie_transformation //Labeling the class as an effect type
name = "zombie virus"
max_stages = 5
spread_type = CONTACT_GENERAL //Maybe switch back to hands?
hidden = list(1, 0)
cure = "Spaceacillin"
cure_id ="necrocure"
cure_list = list("necrocure", "zmeat")
cure_chance = 5
holder = /mob/living/simple_animal/hostile/zombie
agent = "Necrophobes T"
affected_species = list("Human", "Monkey") //Monkeys can carry the virus but are not directly affected by it
desc = null
severity = "DANGEROUS"
permeability_mod = 0.8
contagious_period = 0
var/gibbed = 0
var/faction = "undead"
stage_minimum_age = 110
stage_prob = 10
longevity = 600

/datum/disease/zombie_transformation/stage_act()
if(istype(affected_mob, /mob/living/simple_animal/hostile/zombie)) //Double check first, suppose to stop zombie from curing itself...
return //Do nothing
..() //There is still a chance that the dead body will "cure" itself, anybody killed by zeds will probably either cure or turn
if(affected_mob.stat == 2 && !istype(affected_mob, /mob/living/carbon/monkey))
sleep(rand(10,3000))
affected_mob:Turnundead() //Doesn't support turning monkies undead
return //add turn zombie
if(istype(affected_mob, /mob/living/carbon/human)) //Percents might be a little high
switch(stage)
if(2)
if(prob(4))
affected_mob << "\blue You feel hot."
affected_mob.bodytemperature += 10
if(prob(4))
affected_mob.say("*cough")
return
if(prob(1))
affected_mob << "\red You smell meat."
if(3)
if(prob(8))
affected_mob << "\red Your skin itches."
var/vatk_target = pick("head", "chest", "l_hand", "r_hand", "l_leg", "r_leg")
affected_mob.apply_damage(2, BRUTE, vatk_target)
if(prob(5))
affected_mob << "\red Your stomache hurts."
affected_mob.nutrition -= 20
return
if(prob(5))
affected_mob << "\red You are feeling tired."
affected_mob.drowsyness += 5
if(4)
if(prob(3))
affected_mob.say("*choke")
var/vatk_target = pick("head", "chest")
affected_mob.apply_damage(5, BRUTE, vatk_target)
var/turf/simulated/pos = get_turf(affected_mob)
pos.add_blood_floor(affected_mob)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
//add blood effect
if(prob(15))
affected_mob.hallucination += 5
if(prob(8))
affected_mob << pick("\red Kill them.", "\red You are not going to escape", "\red They won't miss their legs.")
affected_mob.hallucination += 25
return
if(prob(2))
affected_mob << "\blue Through sheer will you're holding your sanity together."
affected_mob.hallucination = 0
return
if(prob(7))
affected_mob.custom_emote(1, "is having trouble keeping their eyes open.")
affected_mob.drowsyness += 2
return
if(prob(1))
affected_mob << pick("\red You come to the realization that you're infected and possibly about to turn.")
affected_mob.nutrition -= 50
affected_mob.drowsyness += 30
affected_mob.hallucination = 0
var/vatk_target = pick("head", "chest", "l_hand", "r_hand", "l_leg", "r_leg")
affected_mob.apply_damage(20, BRUTE, vatk_target)
if(5)
if(!istype(affected_mob, /mob/living/carbon/monkey))
affected_mob:Turnundead()

/datum/disease/zombie_transformation/process() //Almost the same thing, a few tweaks needed for dead people.
if(!holder)
active_diseases -= src
return
if(prob(65))
spread(holder)

if(affected_mob.faction == null)
cure(0)
return

if(affected_mob)
for(var/datum/disease/D in affected_mob.viruses)
if(D != src)
if(IsSame(D))
//error("Deleting [D.name] because it's the same as [src.name].")
del(D) // if there are somehow two viruses of the same kind in the system, delete the other one

if(holder == affected_mob)
if(affected_mob.stat != DEAD) //he's alive
stage_act()
else //he's dead.
if(spread_type!=SPECIAL)
spread_type = CONTACT_GENERAL
stage_act() //Dead and not a zombie, should act

if(affected_mob.faction == "undead" || istype(affected_mob, /mob/living/carbon/monkey) && affected_mob.stat == 2) //the virus is in inanimate obj, dead zed, or monkey
if(prob(70))
if(--longevity<=0)
cure(0)
return
50 changes: 50 additions & 0 deletions code/modules/events/zombie_outbreak.dm
@@ -0,0 +1,50 @@
/datum/event/zombie_outbreak
startWhen = 40
announceWhen = 20
endWhen = 800
oneShot = 1 //DON'T SPAWN ANOTHER OUTBREAK, one is bad enough
var/spawncount = 12 //Base zombie count

/datum/event/carp_migration/setup()
announceWhen = rand(10, 40)
startWhen = rand(announceWhen, 50) //Doesn't pick anything before announcement
endWhen = rand(600,1200)

/datum/event/zombie_outbreak/start()
var/count = 0
if(player_list.len < 12)
count = 2
else if(player_list.len < 22)
count = 1
else
count = 0
for(count, count < 3, count++)
for(var/mob/living/carbon/F in living_mob_list) //Has a chance to spawn zombies on players or mobs
sleep(20)
if(prob(40))
var/mob/living/simple_animal/hostile/zombie/ZEDS = new(F.loc) //Have to give a var that's under zombie and call new.
playsound(F.loc, 'sound/effects/phasein.ogg', vol = 80, vary = 1,extrarange = 6)

//Ripped spider_infestation code
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)
if(temp_vent.network.normal_members.len > 50)
vents += temp_vent

while((spawncount >= 1) && vents.len)
sleep(5)
var/obj/vent = pick(vents)
var/mob/living/simple_animal/hostile/zombie/ZEDS = new(vent.loc)
playsound(vent.loc, 'sound/effects/phasein.ogg', vol = 80, vary = 1,extrarange = 6)
vents -= vent
spawncount--

/datum/event/zombie_outbreak/announce()
var/alertshouted = pick(
"A Boscalian ship has jumped into our sector.",
"Unidentified vessel has passed our perimeter, detecting blue technology.",
"Detecting Syndicate signal.",
"Biological scans picking up level 10 biohazard. Please find the nearest BioHazard locker and prepare for sterilization procedures.")
command_alert(alertshouted)
world << sound('sound/AI/spanomalies.ogg')
73 changes: 73 additions & 0 deletions code/modules/mob/living/simple_animal/hostile/zombie.dm
@@ -0,0 +1,73 @@
//Locking movement speed //This doesn't do anything.
var/const/move_speed = 1
var/const/m_intent = "walk"
var/const/speed = -1


/mob/living/simple_animal/hostile/zombie
name = "zombie"
desc = "Cannablism at its best."
icon = 'icons/mob//otherHuman/human.dmi'
icon_state = "zombie_s"
icon_living = "zombie_s"
icon_dead = "zombie_l"
speak = list("...", "f...a.", "rrrhhn", "..zzzooo..", "..phleahsh..")
emote_see = list("starts moving towards flesh", "turns")
speak_chance = 1
turns_per_move = 3
response_help = "unphazed"
response_disarm = "shoves"
response_harm = "hits"
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/undead
meat_amount = 1
stop_automated_movement_when_pulled = 0
maxHealth = 250
health = 250
move_to_delay = 6 //This is what slows down movement, change it if humans can outwalk a zombie

harm_intent_damage = 2
melee_damage_lower = 7
melee_damage_upper = 19
attacktext = "bites"
attack_sound = "sound/effects/bite.ogg"

minbodytemp = 200
maxbodytemp = 340
cold_damage_per_tick = 4 //Zombies are almost immune to the cold
heat_damage_per_tick = 50 //Zombies are extremely weak to fire

min_oxy = 0 //These zombies don't need to breath
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
unsuitable_atoms_damage = 0

wall_smash = 1 //Add push as well?
a_intent = "harm"
faction = "undead"

New() //Any zombie created will have the virus
..()
var/datum/disease/D = new /datum/disease/zombie_transformation
D.holder = src
D.affected_mob = src
src.viruses += D

SA_attackable(target_mob)
if (isliving(target_mob))
var/mob/living/L = target_mob
if(L.stat != DEAD) //Make sure the target is completely dead
return (0)
if (istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
if (M.occupant)
return (0)
if (istype(target_mob,/obj/machinery/bot))
var/obj/machinery/bot/B = target_mob
if(B.health > 0)
return (0)
return (1)
40 changes: 40 additions & 0 deletions code/modules/mob/transform_procs.dm
Expand Up @@ -376,3 +376,43 @@




//////////////////////Grutor:
/////////////////////Zombie tranformation into NPC type zombie//////////////
////////////////////I'm very certain we can just remove player key//////////
////////////////move it to AI control instead and change body icon//////////
////////////////////////to zombie. But o'well lol//////////////////////////
/mob/living/carbon/human/proc/Turnundead()
if (monkeyizing)
return
for(var/obj/item/W in src)
drop_from_inventory(W) //should be replace with look for something that can transfer items
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
for(var/t in organs) //this really should not be necessary
del(t)

var/mob/living/simple_animal/hostile/new_zombie = new /mob/living/simple_animal/hostile/zombie (src.loc)

new_zombie.name = "Zombie \red[name]"
new_zombie.desc = "A person that has fallen victim to cannibles."
new_zombie.loc = loc
//If you wish everything from here to there can be edited out...
new_zombie.dna = dna //Don't know why I did this, you can't prick em with a needle
if(src.viruses) //Checks and see if the source has any viruses
for(var/datum/disease/tempvirus in new_zombie.viruses) //retrieves anything of disease type
tempvirus.cure(0) //For each virus found cure it
//One day we will need this...
for(var/datum/disease/cv in src.viruses)
new_zombie.viruses += cv //Add/assign the list to the zombie
cv.affected_mob = new_zombie //Change the copy's var to zombie
cv.strain_data = cv.strain_data.Copy() //what? line 520 does this already....
cv.holder = new_zombie //new_zombie is holder of the virus
cv.carrier = 1
//Edit from there to hear if you wish.
spawn(0)//To prevent the proc from returning null.
del(src)
return
59 changes: 59 additions & 0 deletions code/modules/reagents/Chemistry-Reagents.dm
Expand Up @@ -3501,3 +3501,62 @@ datum
M.confused = max(M.confused+15,15)
..()
return


//Grutor
/////////////////Zombie Stuff//////////////////

//This isn't implemented yet, future updates might change this
necroblood
name = "Zombie blood"
id = "necroblood"
description = "It's blood, but it looks like jello."
reagent_state = LIQUID

//So you don't need to be a virologist
necrocure
name = "Zombie Cure"
id = "necrocure"
description = "The thing only stopping you from turning."
reagent_state = LIQUID
nutriment_factor = 0
color = "#54C754" // rgb: 84, 199, 84

z_meat
name = "Zombie Juice"
id = "zmeat"
description = "Definitely smells funny."
reagent_state = LIQUID
color = "#E23351"
var/said_it_before = 0
var/fate_is_sealed = 0

on_mob_life(var/mob/living/M as mob)
..()
if(said_it_before == 0)
M << "You are starting to have regrets..."
said_it_before = 1
if(prob(8) && istype(M, /mob/living/carbon) && fate_is_sealed == 0) //Per reagent tick there is a chance this person will explode
fate_is_sealed = 1
sleep(rand(80, 250))
for(var/obj/item/W in M) //Some items will not be recovered..
if(prob(70))
M.drop_from_inventory(W)
M.gib()
return
/* Not tested
necrovirus
name = "Zombie Virus"
id = "necrodisease"
description = "It's said it can bring the dead back to life."
reagent_state = SOLID
on_mob_life(var/mob/living/carbon/M as mob)
if(!M) M = holder.my_atom
var/datum/disease/D = new /datum/disease/zombie_transformation
D.holder = M
D.affected_mob = M
M.viruses += D
..()
return
*/
18 changes: 17 additions & 1 deletion code/modules/reagents/Chemistry-Recipes.dm
Expand Up @@ -1954,5 +1954,21 @@ datum
required_reagents = list("spacemountainwind" = 1, "coffee" = 1)
result_amount = 2


//Grutor
///////////////////////Zombie recipes////////////////////////////

necrocure
name = "Zombie Cure"
id = "necrocure"
result = "necrocure"
required_reagents = list("sterilizine" = 2, "zmeat" = 2)
result_amount = 5
/* Not Tested
necrodisease
name = "Zombie Virus"
id = "necrodisease"
result = "necrodisease"
required_reagents = list("zombiepowder" = 2, "cryptobiolin" = 2)
result_amount = 5
*/

0 comments on commit d1f5b1a

Please sign in to comment.