From 7453cb8dceb3f787c502234279b4e7e9f82199f7 Mon Sep 17 00:00:00 2001 From: Shadowfire117 Date: Thu, 21 Feb 2019 13:47:57 +0100 Subject: [PATCH 1/3] Adding in a feeding pump! With this you can feed someone liquids automatic while you snuggle and bully them! --- code/game/machinery/feeder.dm | 127 ++++++++++++++++++ code/modules/materials/material_recipes.dm | 3 +- .../reagents/reagent_containers/glass.dm | 3 +- icons/obj/feeder.dmi | Bin 0 -> 1764 bytes vorestation.dme | 3 +- 5 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 code/game/machinery/feeder.dm create mode 100644 icons/obj/feeder.dmi diff --git a/code/game/machinery/feeder.dm b/code/game/machinery/feeder.dm new file mode 100644 index 0000000000..32e98b67db --- /dev/null +++ b/code/game/machinery/feeder.dm @@ -0,0 +1,127 @@ +/obj/machinery/feeder + name = "\improper Feeder" + icon = 'icons/obj/feeder.dmi' + anchored = 0 + density = 0 + + +/obj/machinery/feeder/var/mob/living/carbon/human/attached = null +/obj/machinery/feeder/var/obj/item/weapon/reagent_containers/beaker = null + +/obj/machinery/feeder/update_icon() + if(attached) + icon_state = "feeding" + else + icon_state = "" + + overlays = null + + if(beaker) + var/datum/reagents/reagents = beaker.reagents + if(reagents.total_volume) + var/image/filling = image('icons/obj/feeder.dmi', src, "reagent") + + var/percent = round((reagents.total_volume / beaker.volume) * 100) + switch(percent) + if(0 to 9) filling.icon_state = "reagent0" + if(10 to 19) filling.icon_state = "reagent10" + if(20 to 44) filling.icon_state = "reagent20" + if(45 to 59) filling.icon_state = "reagent45" + if(60 to 74) filling.icon_state = "reagent60" + if(75 to 89) filling.icon_state = "reagent75" + if(90 to 94) filling.icon_state = "reagent90" + if(95 to INFINITY) filling.icon_state = "reagent100" + + filling.icon += reagents.get_color() + overlays += filling + +/obj/machinery/feeder/MouseDrop(over_object, src_location, over_location) + ..() + if(!isliving(usr)) + return + + if(attached) + visible_message("The feeding tube is pulled out of [attached]") + attached = null + update_icon() + return + + if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1) + visible_message("[usr] inserts the feeding tube into \the [over_object].") + attached = over_object + update_icon() + + +/obj/machinery/feeder/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/reagent_containers)) + if(!isnull(beaker)) + user << "There is already a reagent container inserted!" + return + + user.drop_item() + W.loc = src + beaker = W + user << "You insert \the [W] into \the [src]." + update_icon() + return + + if(istype(W, /obj/item/weapon/screwdriver)) + playsound(src, W.usesound, 50, 1) + user << "You start to dismantle the feeder." + if(do_after(user, 15)) + user << "You dismantle the feeder." + var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic(src.loc) + A.amount = 4 + if(beaker) + beaker.loc = get_turf(src) + beaker = null + qdel(src) + return + else + return ..() + + +/obj/machinery/feeder/process() + set background = 1 + + if(attached) + + if(!(get_dist(src, attached) <= 1 && isturf(attached.loc))) + visible_message("The tube is pulled out of [attached]") + attached = null + update_icon() + return + + if(attached && beaker) + // Give food + if(beaker.volume > 0) + var/transfer_amount = 2 + beaker.reagents.trans_to_mob(attached, transfer_amount, CHEM_INGEST) + update_icon() + +/obj/machinery/feeder/attack_hand(mob/user as mob) + if(beaker) + beaker.loc = get_turf(src) + beaker = null + update_icon() + else + return ..() + +/obj/machinery/feeder/examine(mob/user) + ..(user) + if(!(user in view(2)) && user != src.loc) return + + if(beaker) + if(beaker.reagents && beaker.reagents.reagent_list.len) + usr << "Inserted is \a [beaker] with [beaker.reagents.total_volume] units of liquid." + else + usr << "Inserted is an empty [beaker]." + else + usr << "No container is inserted." + + usr << "[attached ? attached : "No one"] is being feed by it." + +/obj/machinery/feeder/CanPass(atom/movable/mover, turf/target, height = 0, air_group = 0) + if(height && istype(mover) && mover.checkpass(PASSTABLE)) //allow bullets, beams, thrown objects, mice, drones, and the like through. + return 1 + return ..() diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index db4ce1132f..b9d06da51e 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -123,7 +123,8 @@ recipes += new/datum/stack_recipe("airtight plastic flaps", /obj/structure/plasticflaps/mining, 5, time = 25, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("water-cooler", /obj/structure/reagent_dispensers/water_cooler, 4, time = 10, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("lampshade", /obj/item/weapon/lampshade, 1, time = 1) - + recipes += new/datum/stack_recipe("Feeder", /obj/machinery/feeder, 4, time = 20, one_per_turf = 1, on_floor = 1) + /material/wood/generate_recipes() ..() recipes += new/datum/stack_recipe("oar", /obj/item/weapon/oar, 2, time = 30, supplied_material = "[name]") diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index c439daac29..6a3e3f49a0 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -44,7 +44,8 @@ /obj/machinery/smartfridge/, /obj/machinery/biogenerator, /obj/structure/frame, - /obj/machinery/radiocarbon_spectrometer + /obj/machinery/radiocarbon_spectrometer, + /obj/machinery/feeder ) /obj/item/weapon/reagent_containers/glass/New() diff --git a/icons/obj/feeder.dmi b/icons/obj/feeder.dmi new file mode 100644 index 0000000000000000000000000000000000000000..90ee460f5f603f7b116215d8d8dfa64674afd87f GIT binary patch literal 1764 zcmZ`)dsx!<8vl_JMk}nei#LY(n9(-$xIm)8W_Xx(OjF8RrfG}NLQz9gg5R{XwDLJ8 zn+{Ddm*!o}Oj}Oo%u7UgJDO92G$rN*1JizrI68ZtbGAJ@f4txK`MmGv{a)Vp^E}@x zzK3WVkXA?l05*7jN%b>&koWQ4WRH6+sm6R2OsN5(N@6PPh907xpRde)3= zb+$-l@=G^S<9}r@)>c7lbu(Kz6r`>noY@vDaMNwA7+6-5lq$J4CMi4n%JR8j0 zshT;LPW^VGV6H z_BdK)NRonE%3PZ~i3jZE6pi`%)pa(z55!+)Hmk|Otct*OliDh<3|$>Y+;)-E>n{ zd^0laybVH z{#(&eQGNKPmRAO1(_*3AU*JfDZr)IM_f8IXhMzLG|0r9m0Wan=;M2C5!q-Nd!}>sm z&M?)Hcj9;5J8*S5ni}q4q9pG4BP|3aZ*-zpZ<`C`zWzYhl%bW9C}VBI&KmL}@6__b zu1#mpw71C)Q?2vg4A)S`r!`^Jx?Hx-SHxYNBx&uxD=FDJs<@T;5e3Jdi#i1j4$)Gr zDW((41jSJpNk}XVI{%P!(DoN=LG5^1D2EjcVY+Z?bNz`9+KvioKjG7&x;o^oQWOnf zpkPl>hj@qKdi@Mps%&U*Yj0+u`?c&D}3kk1pfDbjG@dBfQb zKR00i&u`Zp=f_`Y8;g2^V*k(+FPWz>_3TKj>e0Y}BOsY>mI2@s?|7nOwSjNip(tBh zD|c{*FfsyGsZX;2M7*hFKvJd7$ZLwXp2F8F$0Pv&xNvOTn_(Ww~>Smh^RK(HYCY^dTcXicC4dG{WTco8~iFWWGp0^NE`NtWIn zK4;HAIe)#18^DpwyIbkXEbvF^jcgrp01M_q(Uuaa{ytJ!`qtVqmbJiop*hbsbIOTX zG!G}VbZ=C8{Gb?&iAEeta!y@uvMRK*v+JnpV%N_$w9MpB@>ezx!loYN#?U3yF{|=u z&SU{$?`M#rtm}@>DqjEtdQQ7KI{w{7=(R(!X(Gc_(W3%&Wy=Rki+fJ(iV22bGC~SE z)<7;7zccs@C|oPDSB4TLh?--;`!t|QO=}K%ggb6KH~aLQRQgorDAuV*8{hSz08m}# znJ}Kiyr?~pXFQuBhfj4u-B4zYOap&5KvIVM_FF z!e=qiM7>FM{lL;{edG1_REku+xcHBuApRm^x!}B|O+S>t>tghACFZJoOmcXq?zfko z5ulvD{>u*kq22!%I*3$RxAAkX_aY^Y7+;!2;_-z569*3ya?%}Dw E0_34%4gdfE literal 0 HcmV?d00001 diff --git a/vorestation.dme b/vorestation.dme index 63703aff4c..d6e893feeb 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -670,6 +670,7 @@ #include "code\game\machinery\doorbell_vr.dm" #include "code\game\machinery\doppler_array.dm" #include "code\game\machinery\exonet_node.dm" +#include "code\game\machinery\feeder.dm" #include "code\game\machinery\flasher.dm" #include "code\game\machinery\floodlight.dm" #include "code\game\machinery\floor_light.dm" @@ -2545,8 +2546,8 @@ #include "code\modules\reagents\Chemistry-Reagents.dm" #include "code\modules\reagents\Chemistry-Reagents_vr.dm" #include "code\modules\reagents\Chemistry-Recipes.dm" -#include "code\modules\reagents\Chemistry-Recipes_vr.dm" #include "code\modules\reagents\Chemistry-Recipes_ch.dm" +#include "code\modules\reagents\Chemistry-Recipes_vr.dm" #include "code\modules\reagents\reagent_containers.dm" #include "code\modules\reagents\reagent_dispenser.dm" #include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Core.dm" From f8dd0b814cc363a3b9bec540298fa7142b3df4af Mon Sep 17 00:00:00 2001 From: Shadowfire117 Date: Thu, 21 Feb 2019 18:35:02 +0100 Subject: [PATCH 2/3] Changes to plant mutation to make it possible to get interesting traits, and also small decrease in loss of potency due to mutations. --- code/modules/hydroponics/seed.dm | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 5c6053aba4..85f00a2589 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -516,57 +516,73 @@ if(0) //Plant cancer! set_trait(TRAIT_ENDURANCE,get_trait(TRAIT_ENDURANCE)-rand(10,20),null,0) source_turf.visible_message("\The [display_name] withers rapidly!") + source_turf.visible_message("Mutation 0!") if(1) set_trait(TRAIT_NUTRIENT_CONSUMPTION,get_trait(TRAIT_NUTRIENT_CONSUMPTION)+rand(-(degree*0.1),(degree*0.1)),5,0) set_trait(TRAIT_WATER_CONSUMPTION, get_trait(TRAIT_WATER_CONSUMPTION) +rand(-degree,degree),50,0) set_trait(TRAIT_JUICY, !get_trait(TRAIT_JUICY)) set_trait(TRAIT_STINGS, !get_trait(TRAIT_STINGS)) + source_turf.visible_message("Mutation 1!") if(2) set_trait(TRAIT_IDEAL_HEAT, get_trait(TRAIT_IDEAL_HEAT) + (rand(-5,5)*degree),800,70) set_trait(TRAIT_HEAT_TOLERANCE, get_trait(TRAIT_HEAT_TOLERANCE) + (rand(-5,5)*degree),800,70) set_trait(TRAIT_LOWKPA_TOLERANCE, get_trait(TRAIT_LOWKPA_TOLERANCE)+ (rand(-5,5)*degree),80,0) set_trait(TRAIT_HIGHKPA_TOLERANCE, get_trait(TRAIT_HIGHKPA_TOLERANCE)+(rand(-5,5)*degree),500,110) set_trait(TRAIT_EXPLOSIVE,1) + source_turf.visible_message("Mutation 2!") if(3) set_trait(TRAIT_IDEAL_LIGHT, get_trait(TRAIT_IDEAL_LIGHT)+(rand(-1,1)*degree),30,0) set_trait(TRAIT_LIGHT_TOLERANCE, get_trait(TRAIT_LIGHT_TOLERANCE)+(rand(-2,2)*degree),10,0) + source_turf.visible_message("Mutation 3!") if(4) set_trait(TRAIT_TOXINS_TOLERANCE, get_trait(TRAIT_TOXINS_TOLERANCE)+(rand(-2,2)*degree),10,0) + source_turf.visible_message("Mutation 4!") if(5) + source_turf.visible_message("Mutation 5!") set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0) - if(prob(degree*5)) + if(prob(5)) set_trait(TRAIT_CARNIVOROUS, get_trait(TRAIT_CARNIVOROUS)+rand(-degree,degree),2, 0) if(get_trait(TRAIT_CARNIVOROUS)) source_turf.visible_message("\The [display_name] shudders hungrily.") if(6) + source_turf.visible_message("Mutation 6!") set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0) - if(prob(degree*5)) + if(prob(5)) set_trait(TRAIT_PARASITE,!get_trait(TRAIT_PARASITE)) if(7) + source_turf.visible_message("Mutation 7!") if(get_trait(TRAIT_YIELD) != -1) set_trait(TRAIT_YIELD, get_trait(TRAIT_YIELD)+(rand(-2,2)*degree),10,0) if(8) + source_turf.visible_message("Mutation 8!") set_trait(TRAIT_ENDURANCE, get_trait(TRAIT_ENDURANCE)+(rand(-5,5)*degree),100,10) set_trait(TRAIT_PRODUCTION, get_trait(TRAIT_PRODUCTION)+(rand(-1,1)*degree),10, 1) - set_trait(TRAIT_POTENCY, get_trait(TRAIT_POTENCY)+(rand(-20,20)*degree),200, 0) - if(prob(degree*5)) + set_trait(TRAIT_POTENCY, get_trait(TRAIT_POTENCY)+(rand(-15,20)*degree),200, 0) + if(prob(5)) set_trait(TRAIT_SPREAD, get_trait(TRAIT_SPREAD)+rand(-1,1),2, 0) source_turf.visible_message("\The [display_name] spasms visibly, shifting in the tray.") if(9) + source_turf.visible_message("Mutation 9!") set_trait(TRAIT_MATURATION, get_trait(TRAIT_MATURATION)+(rand(-1,1)*degree),30, 0) - if(prob(degree*5)) + if(prob(5)) set_trait(TRAIT_HARVEST_REPEAT, !get_trait(TRAIT_HARVEST_REPEAT)) if(10) - if(prob(degree*2)) + source_turf.visible_message("Mutation 10!") + if(prob(10)) set_trait(TRAIT_BIOLUM, !get_trait(TRAIT_BIOLUM)) if(get_trait(TRAIT_BIOLUM)) source_turf.visible_message("\The [display_name] begins to glow!") - if(prob(degree*2)) + if(prob(25)) set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]") source_turf.visible_message("\The [display_name]'s glow changes colour!") else source_turf.visible_message("\The [display_name]'s glow dims...") + if(prob(10)) + set_trait(TRAIT_PRODUCES_POWER, 1) + source_turf.visible_message("We got power!") + if(11) + source_turf.visible_message("Mutation 11!") set_trait(TRAIT_TELEPORTING,1) return From a8d69beacfdabda85e19843fcc6b4b8fbbe98275 Mon Sep 17 00:00:00 2001 From: Shadowfire117 Date: Thu, 21 Feb 2019 20:15:05 +0100 Subject: [PATCH 3/3] fix --- code/modules/hydroponics/seed.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 85f00a2589..85918df2ec 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -578,8 +578,8 @@ else source_turf.visible_message("\The [display_name]'s glow dims...") if(prob(10)) - set_trait(TRAIT_PRODUCES_POWER, 1) - source_turf.visible_message("We got power!") + set_trait(TRAIT_PRODUCES_POWER, 1) + source_turf.visible_message("We got power!") if(11) source_turf.visible_message("Mutation 11!")