From f9168f4d86877bd27dcf6e7ce02dcd984fa410f7 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sun, 4 Feb 2024 05:33:25 -0500 Subject: [PATCH] Vore engine and other stuff --- code/modules/mob/living/simple_mob/defense.dm | 3 + .../modules/mob/living/simple_mob/elements.dm | 57 +++++++++++++++++++ code/modules/mob/living/simple_mob/feeding.dm | 27 +++++++++ vorestation.dme | 1 + 4 files changed, 88 insertions(+) create mode 100644 code/modules/mob/living/simple_mob/elements.dm create mode 100644 code/modules/mob/living/simple_mob/feeding.dm diff --git a/code/modules/mob/living/simple_mob/defense.dm b/code/modules/mob/living/simple_mob/defense.dm index 7c31c3c83d2..68b9829f1c1 100644 --- a/code/modules/mob/living/simple_mob/defense.dm +++ b/code/modules/mob/living/simple_mob/defense.dm @@ -92,6 +92,9 @@ to_chat(user, "\The [src] can't be [harvest_verb] so soon.") return + if(user.a_intent == I_HELP && istype(O, /obj/item/weapon/reagent_containers/food/snacks)) + handle_food(O,user) + if(can_tame(O, user)) to_chat(user, "You offer \the [src] \the [O].") if(tame_prob(O, user)) diff --git a/code/modules/mob/living/simple_mob/elements.dm b/code/modules/mob/living/simple_mob/elements.dm new file mode 100644 index 00000000000..f6fb9d546ec --- /dev/null +++ b/code/modules/mob/living/simple_mob/elements.dm @@ -0,0 +1,57 @@ +/mob/living/simple_mob + var/sm_element = "c" + +/mob/living/simple_mob/vore/e/engine + name = "Electric guy" + desc = "It looks pretty fluffy!" + + sm_element = "e" + var/energy_charge = 0 + var/discharge = FALSE + + var/datum/powernet/PN + var/obj/structure/cable/attached + + +/mob/living/simple_mob/vore/e/engine/Life() + . = ..() + + if(discharge) + + else if(nutrition >= 300) + energy_charge += 100 + nutrition -= 1 + + else if(energy_charge >= 1000) + discharge = TRUE + +/mob/living/simple_mob/vore/solargrub/Life() + . = ..() + if(!.) return + + if(!ai_holder.target) + //first, check for potential cables nearby to powersink + var/turf/S = loc + attached = locate(/obj/structure/cable) in S + if(attached) + set_AI_busy(TRUE) + if(prob(2)) + src.visible_message("\The [src] begins to sink power from the net.") + if(prob(5)) + var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() + sparks.set_up(5, 0, get_turf(src)) + sparks.start() + anchored = TRUE + PN = attached.powernet + PN.draw_power(100000) // previous value 150000 + var/apc_drain_rate = 750 //Going to see if grubs are better as a minimal bother. previous value : 4000 + for(var/obj/machinery/power/terminal/T in PN.nodes) + if(istype(T.master, /obj/machinery/power/apc)) + var/obj/machinery/power/apc/A = T.master + if(A.operating && A.cell) + var/cur_charge = A.cell.charge / CELLRATE + var/drain_val = min(apc_drain_rate, cur_charge) + A.cell.use(drain_val * CELLRATE) + else if(!attached && anchored) + anchored = FALSE + PN = null diff --git a/code/modules/mob/living/simple_mob/feeding.dm b/code/modules/mob/living/simple_mob/feeding.dm new file mode 100644 index 00000000000..0b78d432047 --- /dev/null +++ b/code/modules/mob/living/simple_mob/feeding.dm @@ -0,0 +1,27 @@ +/mob/living/simple_mob/proc/handle_food(var/obj/item/weapon/reagent_containers/food/snacks/O as obj, var/mob/user as mob) + if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks)) + return ..() + if(resting) + to_chat(user, "\The [src] is napping, and doesn't respond to \the [O].") + return + if(nutrition >= max_nutrition) + if(user == src) + to_chat(src, "You're too full to eat another bite.") + return + to_chat(user, "\The [src] seems too full to eat.") + return + + if(stat) + return ..() + + user.setClickCooldown(user.get_attack_speed(O)) + if(O.reagents) + O.reagents.trans_to_mob(src, O.bitesize, CHEM_INGEST) + adjust_nutrition(O.bitesize * 20) + O.bitecount ++ + O.On_Consume(src) + if(O) + to_chat(user, "\The [src] takes a bite of \the [O].") + if(user != src) + to_chat(src, "\The [user] feeds \the [O] to you.") + playsound(src, 'sound/items/eatfood.ogg', 75, 1) diff --git a/vorestation.dme b/vorestation.dme index 6758e0c2da2..ad5aefde151 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3066,6 +3066,7 @@ #include "code\modules\mob\living\simple_mob\combat.dm" #include "code\modules\mob\living\simple_mob\defense.dm" #include "code\modules\mob\living\simple_mob\donteatpets_vr.dm" +#include "code\modules\mob\living\simple_mob\feeding.dm" #include "code\modules\mob\living\simple_mob\hands.dm" #include "code\modules\mob\living\simple_mob\harvesting.dm" #include "code\modules\mob\living\simple_mob\life.dm"