even more work

This commit is contained in:
Fox-McCloud
2017-01-22 08:11:31 -05:00
parent 10c0e734c3
commit 706347fd84
37 changed files with 321 additions and 267 deletions
-1
View File
@@ -6,7 +6,6 @@
var/time = 30 //time in deciseconds
var/parts[] = list() //type paths of items that will be placed in the result
var/chem_catalists[] = list() //like tools but for reagents
var/fruit[] = list() //grown products required by the recipe
var/category = CAT_MISC // Recipe category
/datum/crafting_recipe/proc/AdjustChems(var/obj/resultobj as obj)
+5 -7
View File
@@ -283,8 +283,7 @@
/datum/spacevine_mutation/flowering/on_grow(obj/effect/spacevine/holder)
if(holder.energy == 2 && prob(severity) && !locate(/obj/structure/alien/resin/flower_bud_enemy) in range(5,holder))
var/obj/structure/alien/resin/flower_bud_enemy/FBE = new /obj/structure/alien/resin/flower_bud_enemy(get_turf(holder))
FBE.layer = holder.layer+0.1
new /obj/structure/alien/resin/flower_bud_enemy(get_turf(holder))
/datum/spacevine_mutation/flowering/on_cross(obj/effect/spacevine/holder, mob/living/crosser)
if(prob(25))
@@ -337,8 +336,8 @@
KZ.production = (master.spread_cap / initial(master.spread_cap)) * 5
mutations = list()
set_opacity(0)
if(has_buckled_mobs())
unbuckle_all_mobs(force=1)
if(buckled_mob)
unbuckle_mob()
return ..()
/obj/effect/spacevine/proc/on_chem_effect(datum/reagent/R)
@@ -500,7 +499,6 @@
icon_state = pick("Med1", "Med2", "Med3")
energy = 1
set_opacity(1)
layer = 5
else
icon_state = pick("Hvy1", "Hvy2", "Hvy3")
energy = 2
@@ -509,10 +507,10 @@
SM.on_grow(src)
/obj/effect/spacevine/proc/entangle_mob()
if(!has_buckled_mobs() && prob(25))
if(!buckled_mob && prob(25))
for(var/mob/living/V in loc)
entangle(V)
if(has_buckled_mobs())
if(buckled_mob)
break //only capture one mob at a time
@@ -213,12 +213,7 @@
for(var/i = 1, i <= slots.len, i++)
var/obj/item/O = slots[i]
if(istype(O, recipe.ingredients[i]))
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
if(G.seed && G.seed.kitchen_tag == recipe.tags[i])
number_matches++
else
number_matches++
number_matches++
if(number_matches == 3)
return recipe
return null
@@ -3,7 +3,6 @@
var/name = ""
var/description = ""
var/list/ingredients[3]
var/list/tags[3]
var/datum/reagent/result = null
@@ -12,12 +11,10 @@
name = "Example"
description = "This is an example."
ingredients = list(thing_1, thing_2, thing_3)
tags = list(null, "tag_2", null)
result = "water"
The ingredients list must have 3 non-null entries.
The tags list must have 3 entries, using null where a tag is unused.
Failing to ensure both lists have EXACTLY 3 entries (unless the system is updated in the future to use a different number) will result in runtimes.
Failing to ensure the list has EXACTLY 3 entries (unless the system is updated in the future to use a different number) will result in runtimes.
There is no excuse to do this wrong now that there is an example for you. --FalseIncarnate
*/
+9 -1
View File
@@ -44,4 +44,12 @@
/obj/item/weapon/reagent_containers/food/snacks/meat/ham
name = "Ham"
desc = "Taste like bacon."
list_reagents = list("protein" = 3, "porktonium" = 10)
list_reagents = list("protein" = 3, "porktonium" = 10)
/obj/item/weapon/reagent_containers/food/snacks/meat/meatwheat
name = "meatwheat clump"
desc = "This doesn't look like meat, but your standards aren't <i>that</i> high to begin with."
list_reagents = list("nutriment" = 3, "vitamin" = 2, "blood" = 5)
filling_color = rgb(150, 0, 0)
icon_state = "meatwheat_clump"
bitesize = 4
+15 -6
View File
@@ -27,12 +27,8 @@
user.visible_message("<span class='notice'>[user] finishes eating \the [src].</span>")
user.unEquip(src) //so icons update :[
Post_Consume(M)
if(trash)
if(ispath(trash,/obj/item))
var/obj/item/TrashItem = new trash(user)
user.put_in_hands(TrashItem)
else if(istype(trash,/obj/item))
user.put_in_hands(trash)
var/obj/item/trash_item = generate_trash(usr)
usr.put_in_hands(trash_item)
qdel(src)
return
@@ -175,6 +171,19 @@
return
/obj/item/weapon/reagent_containers/food/snacks/proc/generate_trash(atom/location)
if(trash)
if(ispath(trash, /obj/item))
. = new trash(location)
trash = null
return
else if(istype(trash, /obj/item))
var/obj/item/trash_item = trash
trash_item.forceMove(location)
. = trash
trash = null
return
/obj/item/weapon/reagent_containers/food/snacks/Destroy()
if(contents)
for(var/atom/movable/something in contents)
@@ -48,11 +48,7 @@
return 0
for(var/Type in subtypesof(/datum/deepfryer_special))
var/datum/deepfryer_special/P = new Type()
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
if(G.seed.kitchen_tag != P.input)
continue
else if(!istype(I, P.input))
if(!istype(I, P.input))
continue
return P
return 0
@@ -45,7 +45,7 @@
acceptable_items |= item
for(var/reagent in recipe.reagents)
acceptable_reagents |= reagent
if(recipe.items || recipe.fruit)
if(recipe.items)
max_n_of_items = max(max_n_of_items,recipe.count_n_items())
else
qdel(recipe)
@@ -142,14 +142,10 @@
//END RECIPE DATUMS
/obj/machinery/processor/proc/select_recipe(var/X)
/obj/machinery/processor/proc/select_recipe(X)
for(var/Type in subtypesof(/datum/food_processor_process) - /datum/food_processor_process/mob)
var/datum/food_processor_process/P = new Type()
if(istype(X, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = X
if(G.seed.kitchen_tag != P.input)
continue
else if(!istype(X, P.input))
if(!istype(X, P.input))
continue
return P
return 0
@@ -14,9 +14,16 @@
/mob/living/simple_animal/hostile/poison/bees/bee_friendly()
return 1
/mob/living/simple_animal/bot/bee_friendly()
if(paicard)
return 0
return 1
/mob/living/simple_animal/diona/bee_friendly()
return 1
/mob/living/carbon/human/bee_friendly()
if(dna && dna.species && dna.species.id == "pod") //bees pollinate plants, duh.
if(get_species() == "Diona") //bees pollinate plants, duh.
return 1
if((wear_suit && (wear_suit.flags & THICKMATERIAL)) && (head && (head.flags & THICKMATERIAL)))
return 1
+3 -3
View File
@@ -237,7 +237,7 @@
update_genes()
update_icon()
else
var/obj/item/I = usr.get_active_held_item()
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/seeds))
if(!usr.drop_item())
return
@@ -251,7 +251,7 @@
disk = null
update_genes()
else
var/obj/item/I = usr.get_active_held_item()
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/disk/plantgene))
if(!usr.drop_item())
return
@@ -383,7 +383,7 @@
..()
if(istype(W, /obj/item/weapon/pen))
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
if(user.get_active_hand() != W)
return
if(!in_range(src, user) && loc != user)
return
@@ -74,3 +74,13 @@
origin_tech = "biotech=6;materials=5"
light_range = 3
seed = /obj/item/seeds/ambrosia/gaia
// Ambrosia Cruciatus
/obj/item/seeds/ambrosia/cruciatus
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/cruciatus
potency = 10
mutatelist = list()
reagents_add = list("thc" = 0.15, "silver_sulfadiazine" = 0.15, "styptic_powder" = 0.1, "bath salts" = 0.20, "plantmatter" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/cruciatus
seed = /obj/item/seeds/ambrosia/cruciatus
+2 -2
View File
@@ -25,7 +25,7 @@
bitesize = 5
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is aiming [src] at [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is aiming the [src.name] at themself! It looks like \he's trying to commit suicide.</span>")
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1, -1)
sleep(25)
if(!user)
@@ -49,7 +49,7 @@
throw_range = 7
/obj/item/weapon/grown/bananapeel/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is deliberately slipping on [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is deliberately slipping on the [src.name]! It looks like \he's trying to commit suicide.</span>")
playsound(loc, 'sound/misc/slip.ogg', 50, 1, -1)
return (BRUTELOSS)
+1 -1
View File
@@ -83,7 +83,7 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/meatwheat/attack_self(mob/living/user)
user.visible_message("<span class='notice'>[user] crushes [src] into meat.</span>", "<span class='notice'>You crush [src] into something that resembles meat.</span>")
playsound(user, 'sound/effects/blobattack.ogg', 50, 1)
var/obj/item/weapon/reagent_containers/food/snacks/meat/slab/meatwheat/M = new(get_turf(user))
var/obj/item/weapon/reagent_containers/food/snacks/meat/meatwheat/M = new(get_turf(user))
user.drop_item()
qdel(src)
user.put_in_hands(M)
+1 -19
View File
@@ -74,22 +74,4 @@
var/mob/held_mob
filling_color = "#F8F8FF"
bitesize_mod = 4
origin_tech = "biotech=4;magnets=5"
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/attack_hand(mob/user)
..()
if(ismob(loc))
held_mob = loc
processing_objects.Add(src)
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/process()
if(held_mob && loc == held_mob)
if(held_mob.is_holding(src))
if(hasvar(held_mob,"gloves") && held_mob:gloves)
return
held_mob.bodytemperature += 15 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(10))
to_chat(held_mob, "<span class='warning'>Your hand holding [src] burns!</span>")
else
held_mob = null
..()
origin_tech = "biotech=4;magnets=5"
@@ -43,10 +43,8 @@
GT = new stacktype(user.loc)
GT.amount = grassAmt
for(var/obj/item/stack/tile/T in user.loc)
if((T.type == stacktype) && (T.amount < T.max_amount))
GT.merge(T)
if(GT.amount <= 0)
break
if((T.type == stacktype) && (T.amount < T.max_amount) && (T != GT))
T.attackby(GT, user)
qdel(src)
return
+1 -1
View File
@@ -22,7 +22,7 @@
return S
/obj/item/seeds/kudzu/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] swallows the pack of kudzu seeds! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] swallows the pack of kudzu seeds! It looks like \he's trying to commit suicide..</span>")
plant(user)
return (BRUTELOSS)
+12 -10
View File
@@ -44,24 +44,26 @@
attack_verb = list("stung")
/obj/item/weapon/grown/nettle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is eating some of [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is eating some of the [src.name]! It looks like \he's trying to commit suicide.</span>")
return (BRUTELOSS|TOXLOSS)
/obj/item/weapon/grown/nettle/pickup(mob/living/user)
..()
if(!iscarbon(user))
if(!ishuman(user))
return 0
var/mob/living/carbon/C = user
if(C.gloves)
var/mob/living/carbon/human/H = user
if(H.gloves)
return 0
var/hit_zone = (C.held_index_to_dir(C.active_hand_index) == "l" ? "l_":"r_") + "arm"
var/obj/item/bodypart/affecting = C.get_bodypart(hit_zone)
var/organ = ((H.hand ? "l_":"r_") + "arm")
var/obj/item/organ/external/affecting = H.get_organ(organ)
if(affecting)
if(affecting.receive_damage(0, force))
C.update_damage_overlays()
to_chat(C, "<span class='userdanger'>The nettle burns your bare hand!</span>")
if(affecting.take_damage(0, force))
H.UpdateDamageIcon()
to_chat(H, "<span class='userdanger'>The nettle burns your bare hand!</span>")
return 1
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user,proximity)
if(!proximity) return
if(force > 0)
@@ -104,7 +106,7 @@
to_chat(M, "<span class='danger'>You are stunned by the powerful acid of the Deathnettle!</span>")
add_logs(user, M, "attacked", src)
M.adjust_blurriness(force/7)
M.AdjustEyeBlurry(force/7)
if(prob(20))
M.Paralyse(force / 6)
M.Weaken(force / 15)
+6 -18
View File
@@ -6,7 +6,7 @@
icon_state = "seed-replicapod"
species = "replicapod"
plantname = "Replica Pod"
product = /mob/living/carbon/human //verrry special -- Urist
product = /mob/living/carbon/human/diona //verrry special -- Urist
lifespan = 50
endurance = 8
maturation = 10
@@ -35,12 +35,12 @@
features = bloodSample.data["features"]
factions = bloodSample.data["factions"]
W.reagents.clear_reagents()
user << "<span class='notice'>You inject the contents of the syringe into the seeds.</span>"
to_chat(user, "<span class='notice'>You inject the contents of the syringe into the seeds.</span>")
contains_sample = 1
else
user << "<span class='warning'>The seeds reject the sample!</span>"
to_chat(user, "<span class='warning'>The seeds reject the sample!</span>")
else
user << "<span class='warning'>The seeds already contain a genetic sample!</span>"
to_chat(user, "<span class='warning'>The seeds already contain a genetic sample!</span>")
else
return ..()
@@ -66,30 +66,22 @@
else
if(M.ckey == ckey && M.stat == DEAD && !M.suiciding)
make_podman = 1
if(isliving(M))
var/mob/living/L = M
make_podman = !L.hellbound
break
else //If the player has ghosted from his corpse before blood was drawn, his ckey is no longer attached to the mob, so we need to match up the cloned player through the mind key
for(var/mob/M in player_list)
if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == 2 && !M.suiciding)
if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == DEAD && !M.suiciding)
if(isobserver(M))
var/mob/dead/observer/O = M
if(!O.can_reenter_corpse)
break
make_podman = 1
if(isliving(M))
var/mob/living/L = M
make_podman = !L.hellbound
ckey_holder = M.ckey
break
if(make_podman) //all conditions met!
var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc)
var/mob/living/carbon/human/diona/podman = new /mob/living/carbon/human/diona(parent.loc)
if(realName)
podman.real_name = realName
else
podman.real_name = "Pod Person [rand(0,999)]"
mind.transfer_to(podman)
if(ckey)
podman.ckey = ckey
@@ -97,10 +89,6 @@
podman.ckey = ckey_holder
podman.gender = blood_gender
podman.faction |= factions
if(!features["mcolor"])
features["mcolor"] = "#59CE00"
podman.hardset_dna(null,null,podman.real_name,blood_type,/datum/species/pod,features)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman
podman.set_cloned_appearance()
else //else, one packet of seeds. maybe two
var/seed_count = 1
+1 -1
View File
@@ -52,7 +52,7 @@
/obj/item/weapon/grown/log/attackby(obj/item/weapon/W, mob/user, params)
if(W.sharpness)
if(is_sharp(W))
user.show_message("<span class='notice'>You make [plank_name] out of \the [src]!</span>", 1)
var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(seed.potency / 25))
var/old_plank_amount = plank.amount
+1 -4
View File
@@ -58,7 +58,4 @@
if(!..()) //was it caught by a mob?
if(seed)
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_throw_impact(src, hit_atom)
/obj/item/weapon/grown/microwave_act(obj/machine/microwave/M)
return
T.on_throw_impact(src, hit_atom)
+17 -10
View File
@@ -33,7 +33,7 @@
reagents.add_reagent("weedkiller", 100)
/obj/item/weapon/reagent_containers/spray/weedspray/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is huffing the [src.name]! It looks like \he's trying to commit suicide.</span>")
return (TOXLOSS)
/obj/item/weapon/reagent_containers/spray/pestspray // -- Skie
@@ -55,7 +55,7 @@
reagents.add_reagent("pestkiller", 100)
/obj/item/weapon/reagent_containers/spray/pestspray/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is huffing the [src.name]! It looks like \he's trying to commit suicide.</span>")
return (TOXLOSS)
/obj/item/weapon/cultivator
@@ -92,10 +92,17 @@
edge = 1
/obj/item/weapon/hatchet/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is chopping at [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is chopping at \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/weapon/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon = 'icons/obj/weapons.dmi'
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/weapon/scythe
icon_state = "scythe0"
name = "scythe"
@@ -113,13 +120,13 @@
hitsound = 'sound/weapons/bladeslice.ogg'
/obj/item/weapon/scythe/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is beheading [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(iscarbon(user))
var/mob/living/carbon/C = user
var/obj/item/bodypart/BP = C.get_bodypart("head")
if(BP)
BP.drop_limb()
playsound(loc,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1)
user.visible_message("<span class='suicide'>[user] is beheading \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting)
affecting.droplimb(1, DROPLIMB_EDGE)
playsound(loc, pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg'), 50, 1, -1)
return (BRUTELOSS)
// *************************************
+2 -2
View File
@@ -313,10 +313,10 @@
/datum/plant_gene/trait/noreact/on_new(obj/item/weapon/reagent_containers/food/snacks/grown/G, newloc)
..()
G.reagents.set_reacting(FALSE)
G.flags |= NOREACT
/datum/plant_gene/trait/noreact/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
G.reagents.set_reacting(TRUE)
G.flags &= ~NOREACT
G.reagents.handle_reactions()
@@ -127,7 +127,7 @@
for(var/obj/machinery/hydroponics/tester in view(12,src))
considered[tester] = 1
if(!tester.seed)
if(!tester.myseed)
considered[tester] += 50
if(tester.weedlevel > 0)
considered[tester] += 5
@@ -154,7 +154,7 @@
else
if(HP.harvest || HP.dead)
HP.attack_hand(src)
else if(!HP.seed)
else if(!HP.myseed)
var/obj/item/seeds/SEED = new /obj/item/seeds/random(src)
custom_emote(1, "[pick("gibbers","drools","slobbers","claps wildly","spits")] towards [TARGET], producing a [SEED]!")
HP.attackby(SEED, src)
@@ -403,26 +403,6 @@
ingredients += I
I.forceMove(null)
for(var/P in R.fruit)
for(var/i = 1 to R.fruit[P])
var/obj/item/I = locate(P) in allContents
if(I)
ingredients += I
I.forceMove(null)
continue
I = locate(P) in rangeCheck
TARGET = I
if(I && !Adjacent(I))
tryWalk(get_turf(I))
sleep(get_dist(src, I))
if(!I || !(I in rangeCheck))
refundrecipe(ingredients)
return 0
custom_emote(1, "[pick("gibbers","drools","slobbers","claps wildly","spits")], picking up [I].")
ingredients += I
I.forceMove(null)
// cheaply cook the ingredients into result
sleep(R.time)
for(var/obj/I in ingredients)
@@ -579,8 +559,8 @@
var/highest_count = 0
var/datum/recipe/winner = null
for(var/datum/recipe/R in available_recipes)
if(R.check_items(ingredientZone) >= 0 && R.check_fruit(ingredientZone) >= 0)
var/count = (R.items ? R.items.len : 0) + (R.fruit ? R.fruit.len : 0)
if(R.check_items(ingredientZone) >= 0)
var/count = (R.items ? R.items.len : 0)
if(count > highest_count)
highest_count = count
winner = R
@@ -158,6 +158,7 @@
icon_living = "chick"
icon_dead = "chick_dead"
icon_gib = "chick_gib"
gender = FEMALE
speak = list("Cherp.","Cherp?","Chirrup.","Cheep!")
speak_emote = list("cheeps")
emote_hear = list("cheeps")
@@ -201,9 +202,10 @@ var/global/chicken_count = 0
/mob/living/simple_animal/chicken
name = "\improper chicken"
desc = "Hopefully the eggs are good this season."
icon_state = "chicken"
icon_living = "chicken"
icon_dead = "chicken_dead"
gender = FEMALE
icon_state = "chicken_brown"
icon_living = "chicken_brown"
icon_dead = "chicken_brown_dead"
speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.")
speak_emote = list("clucks","croons")
emote_hear = list("clucks")
@@ -212,62 +214,68 @@ var/global/chicken_count = 0
speak_chance = 2
turns_per_move = 3
butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat = 2)
var/egg_type = /obj/item/weapon/reagent_containers/food/snacks/egg
var/food_type = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "kicks the"
attacktext = "kicks"
health = 10
maxHealth = 10
health = 15
maxHealth = 15
ventcrawler = 2
var/eggsleft = 0
var/chicken_color
var/eggsFertile = TRUE
var/body_color
var/icon_prefix = "chicken"
pass_flags = PASSTABLE | PASSMOB
mob_size = MOB_SIZE_SMALL
can_hide = 1
can_collar = 1
var/list/feedMessages = list("It clucks happily.","It clucks happily.")
var/list/layMessage = list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")
var/list/validColors = list("brown","black","white")
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
/mob/living/simple_animal/chicken/New()
..()
if(!chicken_color)
chicken_color = pick( list("brown","black","white") )
icon_state = "chicken_[chicken_color]"
icon_living = "chicken_[chicken_color]"
icon_dead = "chicken_[chicken_color]_dead"
if(!body_color)
body_color = pick(validColors)
icon_state = "[icon_prefix]_[body_color]"
icon_living = "[icon_prefix]_[body_color]"
icon_dead = "[icon_prefix]_[body_color]_dead"
pixel_x = rand(-6, 6)
pixel_y = rand(0, 10)
chicken_count += 1
/mob/living/simple_animal/chicken/death(gibbed)
..()
..(gibbed)
chicken_count -= 1
/mob/living/simple_animal/chicken/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown)) //feedin' dem chickens
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
if(G.seed.kitchen_tag == "wheat")
if(!stat && eggsleft < 8)
user.visible_message("\blue [user] feeds [O] to [name]! It clucks happily.","\blue You feed [O] to [name]! It clucks happily.")
user.drop_item()
qdel(O)
eggsleft += rand(1, 4)
// to_chat(world, eggsleft)
else
to_chat(user, "\blue [name] doesn't seem hungry!")
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
if(istype(O, food_type)) //feedin' dem chickens
if(!stat && eggsleft < 8)
var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
user.visible_message(feedmsg)
user.drop_item()
qdel(O)
eggsleft += rand(1, 4)
//world << eggsleft
else
to_chat(user, "\blue [name] doesn't seem interested in [O]!")
to_chat(user, "<span class='warning'>[name] doesn't seem hungry!</span>")
else
..()
/mob/living/simple_animal/chicken/Life()
. = ..()
if(. && prob(3) && eggsleft > 0)
visible_message("[src] [pick("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")]")
if((. && prob(3) && eggsleft > 0) && egg_type)
visible_message("[src] [pick(layMessage)]")
eggsleft--
var/obj/item/weapon/reagent_containers/food/snacks/egg/E = new(get_turf(src))
var/obj/item/E = new egg_type(get_turf(src))
E.pixel_x = rand(-6,6)
E.pixel_y = rand(-6,6)
if(chicken_count < MAX_CHICKENS && prob(10))
processing_objects.Add(E)
if(eggsFertile)
if(chicken_count < MAX_CHICKENS && prob(25))
processing_objects.Add(E)
/obj/item/weapon/reagent_containers/food/snacks/egg/var/amount_grown = 0
/obj/item/weapon/reagent_containers/food/snacks/egg/process()
@@ -0,0 +1,116 @@
/obj/structure/alien/resin/flower_bud_enemy //inheriting basic attack/damage stuff from alien structures
name = "flower bud"
desc = "A large pulsating plant..."
icon = 'icons/effects/spacevines.dmi'
icon_state = "flower_bud"
layer = MOB_LAYER + 0.9
opacity = 0
canSmoothWith = list()
smooth = SMOOTH_FALSE
var/growth_time = 1200
/obj/structure/alien/resin/flower_bud_enemy/New()
..()
var/list/anchors = list()
anchors += locate(x-2,y+2,z)
anchors += locate(x+2,y+2,z)
anchors += locate(x-2,y-2,z)
anchors += locate(x+2,y-2,z)
for(var/turf/T in anchors)
var/datum/beam/B = Beam(T, "vine", time=INFINITY, maxdistance=5, beam_type=/obj/effect/ebeam/vine)
B.sleep_time = 10 //these shouldn't move, so let's slow down updates to 1 second (any slower and the deletion of the vines would be too slow)
addtimer(src, "bear_fruit", growth_time)
/obj/structure/alien/resin/flower_bud_enemy/proc/bear_fruit()
visible_message("<span class='danger'>the plant has borne fruit!</span>")
new /mob/living/simple_animal/hostile/venus_human_trap(get_turf(src))
qdel(src)
/obj/effect/ebeam/vine
name = "thick vine"
mouse_opacity = 1
desc = "A thick vine, painful to the touch."
/obj/effect/ebeam/vine/Crossed(atom/movable/AM)
if(isliving(AM))
var/mob/living/L = AM
if(!("vines" in L.faction))
L.adjustBruteLoss(5)
to_chat(L, "<span class='alert'>You cut yourself on the thorny vines.</span>")
/mob/living/simple_animal/hostile/venus_human_trap
name = "venus human trap"
desc = "Now you know how the fly feels."
icon_state = "venus_human_trap"
layer = MOB_LAYER + 0.9
health = 50
maxHealth = 50
ranged = 1
harm_intent_damage = 5
melee_damage_lower = 25
melee_damage_upper = 25
a_intent = I_HARM
attack_sound = 'sound/weapons/bladeslice.ogg'
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
unsuitable_atmos_damage = 0
faction = list("hostile","vines","plants")
var/list/grasping = list()
var/max_grasps = 4
var/grasp_chance = 20
var/grasp_pull_chance = 85
var/grasp_range = 4
del_on_death = 1
/mob/living/simple_animal/hostile/venus_human_trap/handle_automated_action()
if(..())
for(var/mob/living/L in grasping)
if(L.stat == DEAD)
var/datum/beam/B = grasping[L]
if(B)
B.End()
grasping -= L
//Can attack+pull multiple times per cycle
if(L.Adjacent(src))
L.attack_animal(src)
else
if(prob(grasp_pull_chance))
dir = get_dir(src,L) //staaaare
step(L,get_dir(L,src)) //reel them in
L.Weaken(3) //you can't get away now~
if(grasping.len < max_grasps)
grasping:
for(var/mob/living/L in view(grasp_range, src))
if(L == src || faction_check(L) || (L in grasping) || L == target)
continue
for(var/t in getline(src,L))
for(var/a in t)
var/atom/A = a
if(A.density && A != L)
continue grasping
if(prob(grasp_chance))
L << "<span class='userdanger'>\The [src] has you entangled!</span>"
grasping[L] = Beam(L, "vine", time=INFINITY, maxdistance=5, beam_type=/obj/effect/ebeam/vine)
break //only take 1 new victim per cycle
/mob/living/simple_animal/hostile/venus_human_trap/OpenFire(atom/the_target)
var/dist = get_dist(src,the_target)
Beam(the_target, "vine", time=dist*2, maxdistance=dist+2, beam_type=/obj/effect/ebeam/vine)
the_target.attack_animal(src)
/mob/living/simple_animal/hostile/venus_human_trap/CanAttack(atom/the_target)
. = ..()
if(.)
if(the_target in grasping)
return 0