mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-11 07:04:01 +01:00
Vore preference helpers (#18656)
* Procs * Pref checks * Snack eat changes * Fix
This commit is contained in:
@@ -91,26 +91,22 @@
|
||||
user = M
|
||||
|
||||
if(food_inserted_micros && food_inserted_micros.len)
|
||||
if(M.can_be_drop_pred && M.food_vore && M.vore_selected)
|
||||
for(var/mob/living/F in food_inserted_micros)
|
||||
if(!F.can_be_drop_prey || !F.food_vore)
|
||||
continue
|
||||
for(var/mob/living/F in food_inserted_micros)
|
||||
var/do_nom = FALSE
|
||||
if(!reagents.total_volume)
|
||||
do_nom = TRUE
|
||||
else
|
||||
var/nom_chance = (1 - (reagents.total_volume / volume))*100
|
||||
if(prob(nom_chance))
|
||||
do_nom = TRUE
|
||||
|
||||
if(do_nom)
|
||||
if(!CanFoodVore(M, F))
|
||||
continue
|
||||
if(isanimal(M) && !F.allowmobvore && !M.ckey) //If the one doing the eating is a simple mob controlled by AI, check mob vore prefs
|
||||
continue
|
||||
|
||||
var/do_nom = FALSE
|
||||
|
||||
if(!reagents.total_volume)
|
||||
do_nom = TRUE
|
||||
else
|
||||
var/nom_chance = (1 - (reagents.total_volume / volume))*100
|
||||
if(prob(nom_chance))
|
||||
do_nom = TRUE
|
||||
|
||||
if(do_nom)
|
||||
F.forceMove(M.vore_selected)
|
||||
food_inserted_micros -= F
|
||||
F.forceMove(M.vore_selected)
|
||||
food_inserted_micros -= F
|
||||
|
||||
if(!reagents.total_volume && changed)
|
||||
M.visible_message(span_notice("[M] finishes drinking from \the [src]."),span_notice("You finish drinking from \the [src]."))
|
||||
|
||||
@@ -59,23 +59,21 @@
|
||||
//Placeholder for effect that trigger on eating that aren't tied to reagents.
|
||||
/obj/item/reagent_containers/food/snacks/proc/On_Consume(var/mob/living/M)
|
||||
if(food_inserted_micros && food_inserted_micros.len)
|
||||
if(M.can_be_drop_pred && M.food_vore && M.vore_selected)
|
||||
for(var/mob/living/F in food_inserted_micros)
|
||||
if(!F.can_be_drop_prey || !F.food_vore)
|
||||
continue
|
||||
for(var/mob/living/F in food_inserted_micros)
|
||||
var/do_nom = FALSE
|
||||
|
||||
var/do_nom = FALSE
|
||||
|
||||
if(!reagents.total_volume)
|
||||
if(!reagents.total_volume)
|
||||
do_nom = TRUE
|
||||
else
|
||||
var/nom_chance = (bitecount/(bitecount + (bitesize / reagents.total_volume) + 1))*100
|
||||
if(prob(nom_chance))
|
||||
do_nom = TRUE
|
||||
else
|
||||
var/nom_chance = (bitecount/(bitecount + (bitesize / reagents.total_volume) + 1))*100
|
||||
if(prob(nom_chance))
|
||||
do_nom = TRUE
|
||||
|
||||
if(do_nom)
|
||||
F.forceMove(M.vore_selected)
|
||||
food_inserted_micros -= F
|
||||
if(do_nom)
|
||||
if(!CanFoodVore(M, F))
|
||||
continue
|
||||
F.forceMove(M.vore_selected)
|
||||
food_inserted_micros -= F
|
||||
|
||||
if(!reagents.total_volume)
|
||||
M.balloon_alert_visible("eats \the [src].","finishes eating \the [src].")
|
||||
|
||||
@@ -359,7 +359,7 @@ emp_act
|
||||
return
|
||||
// PERSON BEING HIT: CAN BE DROP PRED, ALLOWS THROW VORE.
|
||||
// PERSON BEING THROWN: DEVOURABLE, ALLOWS THROW VORE, CAN BE DROP PREY.
|
||||
if((can_be_drop_pred && throw_vore && vore_selected) && (thrown_mob.devourable && thrown_mob.throw_vore && thrown_mob.can_be_drop_prey)) //Prey thrown into pred.
|
||||
if(CanThrowVore(src, thrown_mob))
|
||||
vore_selected.nom_mob(thrown_mob) //Eat them!!!
|
||||
visible_message(span_vwarning("[thrown_mob] is thrown right into [src]'s [lowertext(vore_selected.name)]!"))
|
||||
if(thrown_mob.loc != vore_selected)
|
||||
@@ -369,7 +369,7 @@ emp_act
|
||||
|
||||
// PERSON BEING HIT: CAN BE DROP PREY, ALLOWS THROW VORE, AND IS DEVOURABLE.
|
||||
// PERSON BEING THROWN: CAN BE DROP PRED, ALLOWS THROW VORE.
|
||||
else if((can_be_drop_prey && throw_vore && devourable) && (thrown_mob.can_be_drop_pred && thrown_mob.throw_vore && thrown_mob.vore_selected)) //Pred thrown into prey.
|
||||
else if(CanThrowVore(thrown_mob, src)) //Pred thrown into prey.
|
||||
visible_message(span_vwarning("[src] suddenly slips inside of [thrown_mob]'s [lowertext(thrown_mob.vore_selected.name)] as [thrown_mob] flies into them!"))
|
||||
thrown_mob.vore_selected.nom_mob(src) //Eat them!!!
|
||||
if(src.loc != thrown_mob.vore_selected)
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
var/list/potentials = living_mobs(0)
|
||||
if(potentials.len)
|
||||
var/mob/living/target = pick(potentials)
|
||||
if(istype(target) && target.devourable && target.can_be_drop_prey && vore_selected)
|
||||
if(CanSpontaneousVore(src, target))
|
||||
if(target.buckled)
|
||||
target.buckled.unbuckle_mob(target, force = TRUE)
|
||||
target.forceMove(vore_selected)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
var/list/potentials = living_mobs(0)
|
||||
if(potentials.len)
|
||||
var/mob/living/target = pick(potentials)
|
||||
if(istype(target) && target.devourable && target.can_be_drop_prey && vore_selected)
|
||||
if(CanPhaseVore(src, target))
|
||||
target.forceMove(vore_selected)
|
||||
to_chat(target,span_vwarning("\The [src] phases in around you, [vore_selected.vore_verb]ing you into their [vore_selected.get_belly_name()]!"))
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
var/list/potentials = living_mobs(0)
|
||||
if(potentials.len)
|
||||
var/mob/living/target = pick(potentials)
|
||||
if(istype(target) && target.devourable && target.can_be_drop_prey && vore_selected)
|
||||
if(CanPhaseVore(src, target))
|
||||
target.forceMove(vore_selected)
|
||||
to_chat(target,span_vwarning("\The [src] phases in around you, [vore_selected.vore_verb]ing you into their [vore_selected.get_belly_name()]!"))
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
var/list/potentials = living_mobs(0)
|
||||
if(potentials.len)
|
||||
var/mob/living/target = pick(potentials)
|
||||
if(istype(target) && target.devourable && target.can_be_drop_prey && vore_selected)
|
||||
if(CanSpontaneousVore(src, target))
|
||||
if(target.buckled)
|
||||
target.buckled.unbuckle_mob(target, force = TRUE)
|
||||
target.forceMove(vore_selected)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
return ..()
|
||||
if(istype(A, /mob/living)) //Swoopie gonn swoop
|
||||
var/mob/living/M = A //typecast
|
||||
if(!M.devourable || !M.can_be_drop_prey)
|
||||
if(CanSpontaneousVore(src, A))
|
||||
return ..()
|
||||
Vac.afterattack(M, src, 1)
|
||||
return
|
||||
@@ -246,7 +246,7 @@
|
||||
for(var/atom/movable/AM in D)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/M = AM
|
||||
if(!M.devourable || !M.can_be_drop_prey)
|
||||
if(!CanSpontaneousVore(src, M))
|
||||
to_chat(M, span_warning("[src] plunges their head into \the [D], while you narrowly avoid being sucked up!"))
|
||||
continue
|
||||
to_chat(M, span_warning("[src] plunges their head into \the [D], sucking up everything inside- Including you!"))
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
belly_dest = pick(living_user.vore_organs)
|
||||
if(belly_dest)
|
||||
for(var/mob/living/prey in ToTurf)
|
||||
if(prey != user && prey.can_be_drop_prey)
|
||||
if(CanDropVore(user, prey))
|
||||
prey.forceMove(belly_dest)
|
||||
vore_happened = TRUE
|
||||
to_chat(prey, span_vdanger("[living_user] materializes around you, as you end up in their [belly_dest]!"))
|
||||
|
||||
@@ -119,18 +119,17 @@
|
||||
winner.visible_message(span_bold("\The [winner]") + " is suddenly knocked to the ground.")
|
||||
winner.SetWeakened(max(winner.weakened,50))
|
||||
if(TELEPORTING_CRACKER)
|
||||
if(loser.can_be_drop_pred && loser.vore_selected)
|
||||
if(winner.devourable && winner.can_be_drop_prey)
|
||||
winner.visible_message(span_bold("\The [winner]") + " is teleported to somewhere nearby...")
|
||||
var/datum/effect/effect/system/spark_spread/spk
|
||||
spk = new(winner)
|
||||
if(CanSpontaneousVore(loser, winner))
|
||||
winner.visible_message(span_bold("\The [winner]") + " is teleported to somewhere nearby...")
|
||||
var/datum/effect/effect/system/spark_spread/spk
|
||||
spk = new(winner)
|
||||
|
||||
var/T = get_turf(winner)
|
||||
spk.set_up(5, 0, winner)
|
||||
spk.attach(winner)
|
||||
playsound(T, "sparks", 50, 1)
|
||||
anim(T,winner,'icons/mob/mob.dmi',,"phaseout",,winner.dir)
|
||||
winner.forceMove(loser.vore_selected)
|
||||
var/T = get_turf(winner)
|
||||
spk.set_up(5, 0, winner)
|
||||
spk.attach(winner)
|
||||
playsound(T, "sparks", 50, 1)
|
||||
anim(T,winner,'icons/mob/mob.dmi',,"phaseout",,winner.dir)
|
||||
winner.forceMove(loser.vore_selected)
|
||||
if(WEALTHY_CRACKER)
|
||||
new /obj/random/cash/huge(spawnloc)
|
||||
new /obj/random/cash/huge(spawnloc)
|
||||
|
||||
Reference in New Issue
Block a user