[MIRROR] Cleans up some Initializes (#943)

* Cleans up some Initializes

* Update farm_animals.dm

* Delete farm_animals.dm.rej

* Update farm_animals.dm
This commit is contained in:
CitadelStationBot
2017-05-18 11:13:53 -05:00
committed by Poojawa
parent 620b756025
commit c61bb0476f
11 changed files with 340 additions and 351 deletions

View File

@@ -6,7 +6,7 @@
INITIALIZE_IMMEDIATE(/obj/effect/statclick) INITIALIZE_IMMEDIATE(/obj/effect/statclick)
/obj/effect/statclick/Initialize(mapload, text, target) //Don't port this to Initialize it's too critical /obj/effect/statclick/Initialize(mapload, text, target) //Don't port this to Initialize it's too critical
..() . = ..()
name = text name = text
src.target = target src.target = target

View File

@@ -45,13 +45,6 @@
remove_radio(src, frequency) remove_radio(src, frequency)
frequency = add_radio(src, new_frequency) frequency = add_radio(src, new_frequency)
/obj/item/device/radio/New()
wires = new /datum/wires/radio(src)
if(prison_radio)
wires.cut(WIRE_TX) // OH GOD WHY
secure_radio_connections = new
..()
/obj/item/device/radio/proc/recalculateChannels() /obj/item/device/radio/proc/recalculateChannels()
channels = list() channels = list()
translate_binary = 0 translate_binary = 0
@@ -92,7 +85,11 @@
return ..() return ..()
/obj/item/device/radio/Initialize() /obj/item/device/radio/Initialize()
..() wires = new /datum/wires/radio(src)
if(prison_radio)
wires.cut(WIRE_TX) // OH GOD WHY
secure_radio_connections = new
. = ..()
frequency = sanitize_frequency(frequency, freerange) frequency = sanitize_frequency(frequency, freerange)
set_frequency(frequency) set_frequency(frequency)
@@ -296,6 +293,7 @@
// --- Cold, emotionless machines. --- // --- Cold, emotionless machines. ---
else if(isobj(M)) else if(isobj(M))
jobname = "Machine" jobname = "Machine"
voice = capitalize(voice)
// --- Unidentifiable mob --- // --- Unidentifiable mob ---
else else
@@ -599,4 +597,4 @@
/obj/item/device/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag. /obj/item/device/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
listening = 0 // And it's nice to have a subtype too for future features. listening = 0 // And it's nice to have a subtype too for future features.
dog_fashion = /datum/dog_fashion/back dog_fashion = /datum/dog_fashion/back

View File

@@ -502,7 +502,7 @@
/obj/item/weapon/storage/Initialize(mapload) /obj/item/weapon/storage/Initialize(mapload)
..() . = ..()
can_hold = typecacheof(can_hold) can_hold = typecacheof(can_hold)
cant_hold = typecacheof(cant_hold) cant_hold = typecacheof(cant_hold)

View File

@@ -30,7 +30,7 @@
initial_gas_mix = "o2=14;n2=23;TEMP=300" initial_gas_mix = "o2=14;n2=23;TEMP=300"
/turf/open/indestructible/necropolis/Initialize() /turf/open/indestructible/necropolis/Initialize()
..() . = ..()
if(prob(12)) if(prob(12))
icon_state = "necro[rand(2,3)]" icon_state = "necro[rand(2,3)]"

View File

@@ -431,9 +431,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/obj/effect/statclick/ahelp /obj/effect/statclick/ahelp
var/datum/admin_help/ahelp_datum var/datum/admin_help/ahelp_datum
/obj/effect/statclick/ahelp/New(loc, datum/admin_help/AH) /obj/effect/statclick/ahelp/Initialize(mapload, datum/admin_help/AH)
ahelp_datum = AH ahelp_datum = AH
..(loc) . = ..()
/obj/effect/statclick/ahelp/update() /obj/effect/statclick/ahelp/update()
return ..(ahelp_datum.name) return ..(ahelp_datum.name)

View File

@@ -39,7 +39,7 @@
if(!blocks_air) if(!blocks_air)
air = new air = new
air.copy_from_turf(src) air.copy_from_turf(src)
..() . = ..()
/turf/open/Destroy() /turf/open/Destroy()
if(active_hotspot) if(active_hotspot)

View File

@@ -797,7 +797,7 @@ Pass a positive integer as an argument to override a bot's default speed.
var/mob/living/simple_animal/bot/owner = null var/mob/living/simple_animal/bot/owner = null
/obj/machinery/bot_core/Initialize() /obj/machinery/bot_core/Initialize()
..() . = ..()
owner = loc owner = loc
if(!istype(owner)) if(!istype(owner))
qdel(src) qdel(src)
@@ -919,4 +919,4 @@ Pass a positive integer as an argument to override a bot's default speed.
if(!data_hud_type) if(!data_hud_type)
return return
var/datum/atom_hud/datahud = GLOB.huds[data_hud_type] var/datum/atom_hud/datahud = GLOB.huds[data_hud_type]
datahud.add_hud_to(src) datahud.add_hud_to(src)

View File

@@ -1,331 +1,322 @@
//goat //goat
/mob/living/simple_animal/hostile/retaliate/goat /mob/living/simple_animal/hostile/retaliate/goat
name = "goat" name = "goat"
desc = "Not known for their pleasant disposition." desc = "Not known for their pleasant disposition."
icon_state = "goat" icon_state = "goat"
icon_living = "goat" icon_living = "goat"
icon_dead = "goat_dead" icon_dead = "goat_dead"
speak = list("EHEHEHEHEH","eh?") speak = list("EHEHEHEHEH","eh?")
speak_emote = list("brays") speak_emote = list("brays")
emote_hear = list("brays.") emote_hear = list("brays.")
emote_see = list("shakes its head.", "stamps a foot.", "glares around.") emote_see = list("shakes its head.", "stamps a foot.", "glares around.")
speak_chance = 1 speak_chance = 1
turns_per_move = 5 turns_per_move = 5
see_in_dark = 6 see_in_dark = 6
butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 4) butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 4)
response_help = "pets" response_help = "pets"
response_disarm = "gently pushes aside" response_disarm = "gently pushes aside"
response_harm = "kicks" response_harm = "kicks"
faction = list("neutral") faction = list("neutral")
attack_same = 1 attack_same = 1
attacktext = "kicks" attacktext = "kicks"
attack_sound = 'sound/weapons/punch1.ogg' attack_sound = 'sound/weapons/punch1.ogg'
health = 40 health = 40
maxHealth = 40 maxHealth = 40
melee_damage_lower = 1 melee_damage_lower = 1
melee_damage_upper = 2 melee_damage_upper = 2
environment_smash = 0 environment_smash = 0
stop_automated_movement_when_pulled = 1 stop_automated_movement_when_pulled = 1
blood_volume = BLOOD_VOLUME_NORMAL blood_volume = BLOOD_VOLUME_NORMAL
var/obj/item/udder/udder = null var/obj/item/udder/udder = null
devourable = TRUE devourable = TRUE
/mob/living/simple_animal/hostile/retaliate/goat/Initialize() /mob/living/simple_animal/hostile/retaliate/goat/Initialize()
udder = new() udder = new()
..() . = ..()
/mob/living/simple_animal/hostile/retaliate/goat/Destroy()
qdel(udder) /mob/living/simple_animal/hostile/retaliate/goat/Destroy()
udder = null qdel(udder)
return ..() udder = null
return ..()
/mob/living/simple_animal/hostile/retaliate/goat/Life()
. = ..() /mob/living/simple_animal/hostile/retaliate/goat/Life()
if(.) . = ..()
//chance to go crazy and start wacking stuff if(.)
if(!enemies.len && prob(1)) //chance to go crazy and start wacking stuff
Retaliate() if(!enemies.len && prob(1))
Retaliate()
if(enemies.len && prob(10))
enemies = list() if(enemies.len && prob(10))
LoseTarget() enemies = list()
src.visible_message("<span class='notice'>[src] calms down.</span>") LoseTarget()
if(stat == CONSCIOUS) src.visible_message("<span class='notice'>[src] calms down.</span>")
udder.generateMilk() if(stat == CONSCIOUS)
eat_plants() udder.generateMilk()
if(!pulledby) var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc
for(var/direction in shuffle(list(1,2,4,8,5,6,9,10))) if(SV)
var/step = get_step(src, direction) SV.eat(src)
if(step) if(!pulledby)
if(locate(/obj/structure/spacevine) in step || locate(/obj/structure/glowshroom) in step) for(var/direction in shuffle(list(1,2,4,8,5,6,9,10)))
Move(step, get_dir(src, step)) var/step = get_step(src, direction)
if(step)
/mob/living/simple_animal/hostile/retaliate/goat/Retaliate() if(locate(/obj/structure/spacevine) in step)
..() Move(step, get_dir(src, step))
src.visible_message("<span class='danger'>[src] gets an evil-looking gleam in [p_their()] eye.</span>")
/mob/living/simple_animal/hostile/retaliate/goat/Retaliate()
/mob/living/simple_animal/hostile/retaliate/goat/Move() ..()
..() src.visible_message("<span class='danger'>[src] gets an evil-looking gleam in [p_their()] eye.</span>")
if(!stat)
eat_plants() /mob/living/simple_animal/hostile/retaliate/goat/Move()
..()
/mob/living/simple_animal/hostile/retaliate/goat/proc/eat_plants() if(!stat)
var/eaten = FALSE var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc
var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc if(SV)
if(SV) SV.eat(src)
SV.eat(src)
eaten = TRUE /mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O, mob/user, params)
if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass))
var/obj/structure/glowshroom/GS = locate(/obj/structure/glowshroom) in loc udder.milkAnimal(O, user)
if(GS) return 1
qdel(GS) else
eaten = TRUE return ..()
if(eaten && prob(10)) //cow
say("Nom") /mob/living/simple_animal/cow
name = "cow"
/mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O, mob/user, params) desc = "Known for their milk, just don't tip them over."
if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass)) icon_state = "cow"
udder.milkAnimal(O, user) icon_living = "cow"
return 1 icon_dead = "cow_dead"
else icon_gib = "cow_gib"
return ..() gender = FEMALE
speak = list("moo?","moo","MOOOOOO")
//cow speak_emote = list("moos","moos hauntingly")
/mob/living/simple_animal/cow emote_hear = list("brays.")
name = "cow" emote_see = list("shakes its head.")
desc = "Known for their milk, just don't tip them over." speak_chance = 1
icon_state = "cow" turns_per_move = 5
icon_living = "cow" see_in_dark = 6
icon_dead = "cow_dead" butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 6)
icon_gib = "cow_gib" response_help = "pets"
gender = FEMALE response_disarm = "gently pushes aside"
speak = list("moo?","moo","MOOOOOO") response_harm = "kicks"
speak_emote = list("moos","moos hauntingly") attacktext = "kicks"
emote_hear = list("brays.") attack_sound = 'sound/weapons/punch1.ogg'
emote_see = list("shakes its head.") health = 50
speak_chance = 1 maxHealth = 50
turns_per_move = 5 var/obj/item/udder/udder = null
see_in_dark = 6 gold_core_spawnable = 2
butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 6) blood_volume = BLOOD_VOLUME_NORMAL
response_help = "pets" devourable = TRUE
response_disarm = "gently pushes aside"
response_harm = "kicks" /mob/living/simple_animal/cow/Initialize()
attacktext = "kicks" udder = new()
attack_sound = 'sound/weapons/punch1.ogg' . = ..()
health = 50
maxHealth = 50 /mob/living/simple_animal/cow/Destroy()
var/obj/item/udder/udder = null qdel(udder)
gold_core_spawnable = 2 udder = null
blood_volume = BLOOD_VOLUME_NORMAL return ..()
devourable = TRUE
/mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params)
/mob/living/simple_animal/cow/Initialize() if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass))
udder = new() udder.milkAnimal(O, user)
..() return 1
else
/mob/living/simple_animal/cow/Destroy() return ..()
qdel(udder)
udder = null /mob/living/simple_animal/cow/Life()
return ..() . = ..()
if(stat == CONSCIOUS)
/mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params) udder.generateMilk()
if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass))
udder.milkAnimal(O, user) /mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M)
return 1 if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead)
else M.visible_message("<span class='warning'>[M] tips over [src].</span>",
return ..() "<span class='notice'>You tip over [src].</span>")
to_chat(src, "<span class='userdanger'>You are tipped over by [M]!</span>")
/mob/living/simple_animal/cow/Life() Weaken(30)
. = ..() icon_state = icon_dead
if(stat == CONSCIOUS) spawn(rand(20,50))
udder.generateMilk() if(!stat && M)
icon_state = icon_living
/mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M) var/external
if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead) var/internal
M.visible_message("<span class='warning'>[M] tips over [src].</span>", switch(pick(1,2,3,4))
"<span class='notice'>You tip over [src].</span>") if(1,2,3)
to_chat(src, "<span class='userdanger'>You are tipped over by [M]!</span>") var/text = pick("imploringly.", "pleadingly.",
Weaken(30) "with a resigned expression.")
icon_state = icon_dead external = "[src] looks at [M] [text]"
spawn(rand(20,50)) internal = "You look at [M] [text]"
if(!stat && M) if(4)
icon_state = icon_living external = "[src] seems resigned to its fate."
var/external internal = "You resign yourself to your fate."
var/internal visible_message("<span class='notice'>[external]</span>",
switch(pick(1,2,3,4)) "<span class='revennotice'>[internal]</span>")
if(1,2,3) else
var/text = pick("imploringly.", "pleadingly.", ..()
"with a resigned expression.")
external = "[src] looks at [M] [text]" /mob/living/simple_animal/chick
internal = "You look at [M] [text]" name = "\improper chick"
if(4) desc = "Adorable! They make such a racket though."
external = "[src] seems resigned to its fate." icon_state = "chick"
internal = "You resign yourself to your fate." icon_living = "chick"
visible_message("<span class='notice'>[external]</span>", icon_dead = "chick_dead"
"<span class='revennotice'>[internal]</span>") icon_gib = "chick_gib"
else gender = FEMALE
..() speak = list("Cherp.","Cherp?","Chirrup.","Cheep!")
speak_emote = list("cheeps")
/mob/living/simple_animal/chick emote_hear = list("cheeps.")
name = "\improper chick" emote_see = list("pecks at the ground.","flaps its tiny wings.")
desc = "Adorable! They make such a racket though." density = 0
icon_state = "chick" speak_chance = 2
icon_living = "chick" turns_per_move = 2
icon_dead = "chick_dead" butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 1)
icon_gib = "chick_gib" response_help = "pets"
gender = FEMALE response_disarm = "gently pushes aside"
speak = list("Cherp.","Cherp?","Chirrup.","Cheep!") response_harm = "kicks"
speak_emote = list("cheeps") attacktext = "kicks"
emote_hear = list("cheeps.") health = 3
emote_see = list("pecks at the ground.","flaps its tiny wings.") maxHealth = 3
density = 0 ventcrawler = VENTCRAWLER_ALWAYS
speak_chance = 2 var/amount_grown = 0
turns_per_move = 2 pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 1) mob_size = MOB_SIZE_TINY
response_help = "pets" gold_core_spawnable = 2
response_disarm = "gently pushes aside" devourable = TRUE
response_harm = "kicks"
attacktext = "kicks" /mob/living/simple_animal/chick/Initialize()
health = 3 . = ..()
maxHealth = 3 pixel_x = rand(-6, 6)
ventcrawler = VENTCRAWLER_ALWAYS pixel_y = rand(0, 10)
var/amount_grown = 0
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB /mob/living/simple_animal/chick/Life()
mob_size = MOB_SIZE_TINY . =..()
gold_core_spawnable = 2 if(!.)
devourable = TRUE return
if(!stat && !ckey)
/mob/living/simple_animal/chick/Initialize() amount_grown += rand(1,2)
..() if(amount_grown >= 100)
pixel_x = rand(-6, 6) new /mob/living/simple_animal/chicken(src.loc)
pixel_y = rand(0, 10) qdel(src)
/mob/living/simple_animal/chick/Life() /mob/living/simple_animal/chick/holo/Life()
. =..() ..()
if(!.) amount_grown = 0
return
if(!stat && !ckey) /mob/living/simple_animal/chicken
amount_grown += rand(1,2) name = "\improper chicken"
if(amount_grown >= 100) desc = "Hopefully the eggs are good this season."
new /mob/living/simple_animal/chicken(src.loc) gender = FEMALE
qdel(src) icon_state = "chicken_brown"
icon_living = "chicken_brown"
/mob/living/simple_animal/chick/holo/Life() icon_dead = "chicken_brown_dead"
..() speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.")
amount_grown = 0 speak_emote = list("clucks","croons")
emote_hear = list("clucks.")
/mob/living/simple_animal/chicken emote_see = list("pecks at the ground.","flaps its wings viciously.")
name = "\improper chicken" density = 0
desc = "Hopefully the eggs are good this season." speak_chance = 2
gender = FEMALE turns_per_move = 3
icon_state = "chicken_brown" butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2)
icon_living = "chicken_brown" var/egg_type = /obj/item/weapon/reagent_containers/food/snacks/egg
icon_dead = "chicken_brown_dead" var/food_type = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat
speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.") response_help = "pets"
speak_emote = list("clucks","croons") response_disarm = "gently pushes aside"
emote_hear = list("clucks.") response_harm = "kicks"
emote_see = list("pecks at the ground.","flaps its wings viciously.") attacktext = "kicks"
density = 0 health = 15
speak_chance = 2 maxHealth = 15
turns_per_move = 3 ventcrawler = VENTCRAWLER_ALWAYS
butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2) var/eggsleft = 0
var/egg_type = /obj/item/weapon/reagent_containers/food/snacks/egg var/eggsFertile = TRUE
var/food_type = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat var/body_color
response_help = "pets" var/icon_prefix = "chicken"
response_disarm = "gently pushes aside" pass_flags = PASSTABLE | PASSMOB
response_harm = "kicks" mob_size = MOB_SIZE_SMALL
attacktext = "kicks" var/list/feedMessages = list("It clucks happily.","It clucks happily.")
health = 15 var/list/layMessage = list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")
maxHealth = 15 var/list/validColors = list("brown","black","white")
ventcrawler = VENTCRAWLER_ALWAYS gold_core_spawnable = 2
var/eggsleft = 0 var/static/chicken_count = 0
var/eggsFertile = TRUE devourable = TRUE
var/body_color
var/icon_prefix = "chicken" /mob/living/simple_animal/chicken/Initialize()
pass_flags = PASSTABLE | PASSMOB . = ..()
mob_size = MOB_SIZE_SMALL if(!body_color)
var/list/feedMessages = list("It clucks happily.","It clucks happily.") body_color = pick(validColors)
var/list/layMessage = list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.") icon_state = "[icon_prefix]_[body_color]"
var/list/validColors = list("brown","black","white") icon_living = "[icon_prefix]_[body_color]"
gold_core_spawnable = 2 icon_dead = "[icon_prefix]_[body_color]_dead"
var/static/chicken_count = 0 pixel_x = rand(-6, 6)
devourable = TRUE pixel_y = rand(0, 10)
++chicken_count
/mob/living/simple_animal/chicken/Initialize()
..() /mob/living/simple_animal/chicken/Destroy()
if(!body_color) --chicken_count
body_color = pick(validColors) return ..()
icon_state = "[icon_prefix]_[body_color]"
icon_living = "[icon_prefix]_[body_color]" /mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
icon_dead = "[icon_prefix]_[body_color]_dead" if(istype(O, food_type)) //feedin' dem chickens
pixel_x = rand(-6, 6) if(!stat && eggsleft < 8)
pixel_y = rand(0, 10) var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
++chicken_count user.visible_message(feedmsg)
user.drop_item()
/mob/living/simple_animal/chicken/Destroy() qdel(O)
--chicken_count eggsleft += rand(1, 4)
return ..() //to_chat(world, eggsleft)
else
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params) to_chat(user, "<span class='warning'>[name] doesn't seem hungry!</span>")
if(istype(O, food_type)) //feedin' dem chickens else
if(!stat && eggsleft < 8) ..()
var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
user.visible_message(feedmsg) /mob/living/simple_animal/chicken/Life()
user.drop_item() . =..()
qdel(O) if(!.)
eggsleft += rand(1, 4) return
//to_chat(world, eggsleft) if((!stat && prob(3) && eggsleft > 0) && egg_type)
else visible_message("[src] [pick(layMessage)]")
to_chat(user, "<span class='warning'>[name] doesn't seem hungry!</span>") eggsleft--
else var/obj/item/E = new egg_type(get_turf(src))
..() E.pixel_x = rand(-6,6)
E.pixel_y = rand(-6,6)
/mob/living/simple_animal/chicken/Life() if(eggsFertile)
. =..() if(chicken_count < MAX_CHICKENS && prob(25))
if(!.) START_PROCESSING(SSobj, E)
return
if((!stat && prob(3) && eggsleft > 0) && egg_type) /obj/item/weapon/reagent_containers/food/snacks/egg/var/amount_grown = 0
visible_message("[src] [pick(layMessage)]") /obj/item/weapon/reagent_containers/food/snacks/egg/process()
eggsleft-- if(isturf(loc))
var/obj/item/E = new egg_type(get_turf(src)) amount_grown += rand(1,2)
E.pixel_x = rand(-6,6) if(amount_grown >= 100)
E.pixel_y = rand(-6,6) visible_message("[src] hatches with a quiet cracking sound.")
if(eggsFertile) new /mob/living/simple_animal/chick(get_turf(src))
if(chicken_count < MAX_CHICKENS && prob(25)) STOP_PROCESSING(SSobj, src)
START_PROCESSING(SSobj, E) qdel(src)
else
/obj/item/weapon/reagent_containers/food/snacks/egg/var/amount_grown = 0 STOP_PROCESSING(SSobj, src)
/obj/item/weapon/reagent_containers/food/snacks/egg/process()
if(isturf(loc))
amount_grown += rand(1,2) /obj/item/udder
if(amount_grown >= 100) name = "udder"
visible_message("[src] hatches with a quiet cracking sound.")
new /mob/living/simple_animal/chick(get_turf(src)) /obj/item/udder/Initialize()
STOP_PROCESSING(SSobj, src) reagents = new(50)
qdel(src) reagents.my_atom = src
else reagents.add_reagent("milk", 20)
STOP_PROCESSING(SSobj, src) . = ..()
/obj/item/udder/proc/generateMilk()
/obj/item/udder if(prob(5))
name = "udder" reagents.add_reagent("milk", rand(5, 10))
/obj/item/udder/Initialize() /obj/item/udder/proc/milkAnimal(obj/O, mob/user)
create_reagents(50) var/obj/item/weapon/reagent_containers/glass/G = O
reagents.add_reagent("milk", 20) if(G.reagents.total_volume >= G.volume)
..() to_chat(user, "<span class='danger'>[O] is full.</span>")
return
/obj/item/udder/proc/generateMilk() var/transfered = reagents.trans_to(O, rand(5,10))
if(prob(5)) if(transfered)
reagents.add_reagent("milk", rand(5, 10)) user.visible_message("[user] milks [src] using \the [O].", "<span class='notice'>You milk [src] using \the [O].</span>")
else
/obj/item/udder/proc/milkAnimal(obj/O, mob/user) to_chat(user, "<span class='danger'>The udder is dry. Wait a bit longer...</span>")
var/obj/item/weapon/reagent_containers/glass/G = O
if(G.reagents.total_volume >= G.volume)
to_chat(user, "<span class='danger'>[O] is full.</span>")
return
var/transfered = reagents.trans_to(O, rand(5,10))
if(transfered)
user.visible_message("[user] milks [src] using \the [O].", "<span class='notice'>You milk [src] using \the [O].</span>")
else
to_chat(user, "<span class='danger'>The udder is dry. Wait a bit longer...</span>")

View File

@@ -55,7 +55,7 @@
/mob/living/simple_animal/hostile/Initialize() /mob/living/simple_animal/hostile/Initialize()
..() . = ..()
if(!targets_from) if(!targets_from)
targets_from = src targets_from = src

View File

@@ -86,7 +86,7 @@
var/tame = 0 var/tame = 0
/mob/living/simple_animal/Initialize() /mob/living/simple_animal/Initialize()
..() . = ..()
GLOB.simple_animals += src GLOB.simple_animals += src
handcrafting = new() handcrafting = new()
if(gender == PLURAL) if(gender == PLURAL)

View File

@@ -36,7 +36,7 @@
continue continue
var/datum/atom_hud/alternate_appearance/AA = v var/datum/atom_hud/alternate_appearance/AA = v
AA.onNewMob(src) AA.onNewMob(src)
..() . = ..()
/atom/proc/prepare_huds() /atom/proc/prepare_huds()
hud_list = list() hud_list = list()