From dab3aac96e7864b13c2bf92eefb4e1a389e2dfa1 Mon Sep 17 00:00:00 2001 From: Mithrandalf Date: Sun, 24 Nov 2019 23:56:56 +0000 Subject: [PATCH 1/3] adds container diving --- .../subtypes/animal/passive/mouse_vr.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm index e86cfd3934..f1b1c31586 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm @@ -20,3 +20,20 @@ if((I_HELP) && U.canClick()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects U.setClickCooldown(U.get_attack_speed()) //if there's a cleaner way in baycode, I'll change this U.visible_message("[U] [M.response_help] \the [M].") + +/mob/living/simple_mob/animal/passive/mouse/MouseDrop(var/obj/item/weapon/storage/S) + if(istype(S, /obj/item/weapon/storage)) + var/obj/item/weapon/holder/H = new holder_type(get_turf(src)) //this works weird, but it creates an empty holder, to see if that holder can fit + if(S.can_be_inserted(H)) + H.held_mob = src + src.forceMove(H) + visible_message("\the [src] squeezes into \the [S].") + H.forceMove(S) + H.sync(src) + return 1 + else + qdel(H) //this deletes the empty holder if it doesnt work + to_chat(usr,"You can't fit inside \the [S]!") + return 0 + else + ..() From f91d81b4db6b5aedd1d936532cebdfbb3ada8b6f Mon Sep 17 00:00:00 2001 From: Mithrandalf Date: Tue, 26 Nov 2019 03:03:40 +0000 Subject: [PATCH 2/3] Updates scooping to work way better, tweaks --- code/modules/mob/holder.dm | 2 ++ .../subtypes/animal/passive/mouse_vr.dm | 28 +++++++++++++++---- code/modules/vore/resizing/resize_vr.dm | 4 +-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 25a6ed122a..4d4e35d730 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -134,6 +134,8 @@ var/list/holder_mob_icon_cache = list() /mob/living/MouseDrop(var/atom/over_object) var/mob/living/carbon/human/H = over_object if(holder_type && issmall(src) && istype(H) && !H.lying && Adjacent(H) && (src.a_intent == I_HELP && H.a_intent == I_HELP)) //VOREStation Edit + if(istype(src, /mob/living/simple_mob/animal/passive/mouse)) //vorestation edit + return ..() //vorestation edit if(!issmall(H) || !istype(src, /mob/living/carbon/human)) get_scooped(H, (usr == src)) return diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm index f1b1c31586..53f31f934e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm @@ -9,9 +9,14 @@ desc = "A small rodent, often seen hiding in maintenance areas and making a nuisance of itself. And stealing cheese, or annoying the chef. SQUEAK! <3" -/mob/living/simple_mob/animal/passive/mouse/attack_hand(mob/living/hander) - if(hander.a_intent == I_HELP) //if lime intent - get_scooped(hander) //get scooped + size_multiplier = 0.25 + movement_cooldown = 1 //roughly half the speed of a person + universal_understand = 1 + +/mob/living/simple_mob/animal/passive/mouse/attack_hand(mob/living/L) + if(L.a_intent == I_HELP) //if lime intent + if(!src.attempt_to_scoop(L)) //the superior way to handle scooping, checks size + ..() //mouse too big to grab? pet the large mouse instead else ..() @@ -21,8 +26,16 @@ U.setClickCooldown(U.get_attack_speed()) //if there's a cleaner way in baycode, I'll change this U.visible_message("[U] [M.response_help] \the [M].") -/mob/living/simple_mob/animal/passive/mouse/MouseDrop(var/obj/item/weapon/storage/S) - if(istype(S, /obj/item/weapon/storage)) + +/mob/living/simple_mob/animal/passive/mouse/MouseDrop(var/obj/O) //this proc would be very easy to apply to all mobs with holders + if(!(usr == src || O)) + return ..() + if(istype(O, /mob/living) && O.Adjacent(src)) //controls scooping by mobs + var/mob/living/L = O + if(!src.attempt_to_scoop(L, (src == usr))) + return //this way it doesnt default to the generic animal pickup which isnt size restricted + if(istype(O, /obj/item/weapon/storage) && O.Adjacent(src)) //controls diving into storage + var/obj/item/weapon/storage/S = O var/obj/item/weapon/holder/H = new holder_type(get_turf(src)) //this works weird, but it creates an empty holder, to see if that holder can fit if(S.can_be_inserted(H)) H.held_mob = src @@ -37,3 +50,8 @@ return 0 else ..() + +/mob/living/simple_mob/animal/passive/mouse/resize(var/new_size, var/animate = TRUE) + size_multiplier = max(size_multiplier + 0.75, 1) //keeps sprite sizes consistent, keeps multiplier values low + ..() + size_multiplier = max(size_multiplier - 0.75, 0.25) //the limits here ensure no negative values or infinite shrinkage \ No newline at end of file diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 2073f499c1..8fc76eeb30 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -125,7 +125,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 * Attempt to scoop up this mob up into H's hands, if the size difference is large enough. * @return false if normal code should continue, 1 to prevent normal code. */ -/mob/living/proc/attempt_to_scoop(var/mob/living/M) +/mob/living/proc/attempt_to_scoop(var/mob/living/M, var/mob/living/G) //second one is for the Grabber, only exists for animals to self-grab var/size_diff = M.get_effective_size() - get_effective_size() if(!holder_default && holder_type) holder_default = holder_type @@ -140,7 +140,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 return 0 if(size_diff >= 0.50) holder_type = /obj/item/weapon/holder/micro - var/obj/item/weapon/holder/m_holder = get_scooped(M) + var/obj/item/weapon/holder/m_holder = get_scooped(M, G) holder_type = holder_default if (m_holder) return 1 From 692b26874f09786e69663d19548283e7ad37d436 Mon Sep 17 00:00:00 2001 From: Mithrandalf Date: Tue, 26 Nov 2019 03:30:58 +0000 Subject: [PATCH 3/3] adds size limit for containers --- .../mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm index 53f31f934e..92bddd4f79 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm @@ -37,7 +37,7 @@ if(istype(O, /obj/item/weapon/storage) && O.Adjacent(src)) //controls diving into storage var/obj/item/weapon/storage/S = O var/obj/item/weapon/holder/H = new holder_type(get_turf(src)) //this works weird, but it creates an empty holder, to see if that holder can fit - if(S.can_be_inserted(H)) + if(S.can_be_inserted(H) && (src.size_multiplier <= 0.75)) H.held_mob = src src.forceMove(H) visible_message("\the [src] squeezes into \the [S].")