Skip to content

Commit

Permalink
Merge pull request tgstation#6134 from Menshin/null_loc_mobs_fix
Browse files Browse the repository at this point in the history
Prevent some mobs from spawning in nullspace
  • Loading branch information
RemieRichards committed Dec 3, 2014
2 parents 88ad308 + 76ecd45 commit 8eced8d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
34 changes: 23 additions & 11 deletions code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -639,21 +639,33 @@ obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy/add_juice()
name = "killer-tomato"
desc = "I say to-mah-to, you say tom-mae-to... OH GOD IT'S EATING MY LEGS!!"
icon_state = "killertomato"
var/awakening = 0

/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer/attack(mob/M, mob/user, def_zone)
if(awakening)
user << "<span class='warning'>The tomato is twitching and shaking, preventing you from eating it.</span>"
return
..()

/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
if(awakening || istype(user.loc,/turf/space))
return
user << "<span class='notice'>You begin to awaken the Killer Tomato.</span>"
sleep(30)
var/mob/living/simple_animal/hostile/killertomato/K = new /mob/living/simple_animal/hostile/killertomato(get_turf(src.loc))
K.maxHealth += round(endurance / 3)
K.melee_damage_lower += round(potency / 10)
K.melee_damage_upper += round(potency / 10)
K.move_to_delay -= round(production / 50)
K.health = K.maxHealth
user.unEquip(src)
qdel(src)
K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>")
awakening = 1

spawn(30)
if(!gc_destroyed)
var/mob/living/simple_animal/hostile/killertomato/K = new /mob/living/simple_animal/hostile/killertomato(get_turf(src.loc))
K.maxHealth += round(endurance / 3)
K.melee_damage_lower += round(potency / 10)
K.melee_damage_upper += round(potency / 10)
K.move_to_delay -= round(production / 50)
K.health = K.maxHealth
K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>")
if(user)
user.unEquip(src)
qdel(src)



/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/blood
Expand Down
6 changes: 2 additions & 4 deletions code/modules/mob/living/carbon/brain/brain_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,15 @@
else
M.key = brainmob.key

qdel(brainmob)

M.internal_organs += src
loc = null

//Update the body's icon so it doesnt appear debrained anymore
if(ishuman(M))
H.update_hair(0)

//Update the body's icon so it doesnt appear debrained anymore
if(ishuman(M))
H.update_hair(0)

else
..()

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/simple_animal/friendly/drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
qdel(src)
else
D << "<span class='notice'>You need to remain still to canibalize [src].</span>"
D << "<span class='notice'>You need to remain still to cannibalize [src].</span>"
else
D << "<span class='notice'>You're already in perfect condition!</span>"
if("Nothing")
Expand Down Expand Up @@ -530,7 +530,7 @@
return

var/be_drone = alert("Become a drone? (Warning, You can no longer be cloned!)",,"Yes","No")
if(be_drone == "No")
if(be_drone == "No" || gc_destroyed)
return
var/mob/living/simple_animal/drone/D = new drone_type(get_turf(loc))
D.key = user.key
Expand Down

0 comments on commit 8eced8d

Please sign in to comment.