diff --git a/code/datums/components/traits/slip_prone.dm b/code/datums/components/traits/slip_prone.dm new file mode 100644 index 00000000000..26f2ae11e36 --- /dev/null +++ b/code/datums/components/traits/slip_prone.dm @@ -0,0 +1,43 @@ +/** + * Like unlucky, but only has a chance of slipping into someone! + */ +/datum/component/slip_prone + dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS + +/datum/component/slip_prone/RegisterWithParent() + RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(attempt_slip)) + +/datum/component/slip_prone/UnregisterFromParent() + UnregisterSignal(parent, COMSIG_MOVABLE_MOVED) + +/datum/component/slip_prone/proc/attempt_slip(atom/movable/our_guy) + SIGNAL_HANDLER + + if(!isliving(our_guy) || isbelly(our_guy.loc)) + return + + var/mob/living/living_guy = our_guy + if(living_guy.is_incorporeal()) //no being unlucky if you don't even exist on the same plane. + return + + if(!prob(0.6)) + return + + var/turf/our_guy_pos = get_turf(our_guy) + if(!our_guy_pos) + return + + for(var/turf/the_turf as anything in our_guy_pos.AdjacentTurfs(check_blockage = FALSE)) //need false so we can check disposal units + if(iswall(the_turf)) + continue + + for(var/mob/living/living_mob in the_turf) + if(living_mob == our_guy || (living_mob.vore_selected == living_guy.vore_selected)) + continue //Don't do anything to ourselves. + if(living_mob.stat) + continue + if(!can_stumble_vore(living_guy, living_mob) && !can_stumble_vore(living_mob, living_guy)) //Works both ways! Either way, someone's getting eaten! + continue + living_mob.stumble_into(living_guy) //logic reversed here because the game is DUMB. This means that living_guy is stumbling into the target! + living_guy.visible_message(span_danger("[living_guy] loses their balance and slips into [living_mob]!"), span_boldwarning("You lose your balance, slipping into [living_mob]!")) + return diff --git a/code/modules/mob/living/carbon/human/species/station/traits/negative.dm b/code/modules/mob/living/carbon/human/species/station/traits/negative.dm index d8f44764a30..82e5887a76d 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/negative.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/negative.dm @@ -588,7 +588,7 @@ hidden = FALSE custom_only = FALSE added_component_path = /datum/component/omen/trait - excludes = list(/datum/trait/negative/unlucky/major) + excludes = list(/datum/trait/negative/unlucky/major, /datum/trait/neutral/slip_prone) /datum/trait/negative/unlucky/major @@ -599,7 +599,7 @@ is_genetrait = TRUE hidden = TRUE //VOREStation Note: Disabled added_component_path = /datum/component/omen/trait/major - excludes = list(/datum/trait/negative/unlucky) + excludes = list(/datum/trait/negative/unlucky, /datum/trait/neutral/slip_prone) activation_message= span_cult(span_bold("What a terrible night to have a curse!")) primitive_expression_messages=list("unluckily stubs their toe!") diff --git a/code/modules/mob/living/carbon/human/species/station/traits/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits/neutral.dm index 451e9cfb7d8..6087505688a 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/neutral.dm @@ -1965,3 +1965,13 @@ /datum/trait/neutral/slobber/apply(var/datum/species/S, var/mob/living/carbon/human/human) ..() ADD_TRAIT(human, TRAIT_SLOBBER, ROUNDSTART_TRAIT) + +/datum/trait/neutral/slip_prone + name = "Slip Prone (Vore)" + desc = "You're prone to slips, trips, and falls when next to others, resulting in occasionally falling into them! (This takes spontaneous prefs into account!)" + cost = 0 + is_genetrait = FALSE + hidden = FALSE + custom_only = FALSE + added_component_path = /datum/component/slip_prone + excludes = list(/datum/trait/negative/unlucky/major, /datum/trait/negative/unlucky) diff --git a/vorestation.dme b/vorestation.dme index 55a4f70b8da..d2a5981da48 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -792,6 +792,7 @@ #include "code\datums\components\traits\nutrition_size_change.dm" #include "code\datums\components\traits\photosynth.dm" #include "code\datums\components\traits\radiation_effects.dm" +#include "code\datums\components\traits\slip_prone.dm" #include "code\datums\components\traits\unlucky.dm" #include "code\datums\components\traits\waddle.dm" #include "code\datums\components\traits\weaver.dm"