From 76016c75f926f7863867ae00775bb63409eba25d Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sat, 25 Jul 2020 21:27:32 +0100 Subject: [PATCH] yes --- code/game/objects/items/pet_carrier.dm | 33 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index e04278600d..32e7ac49b4 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -24,6 +24,7 @@ var/max_occupant_weight = MOB_SIZE_SMALL //This is calculated from the mob sizes of occupants var/entrance_name = "door" //name of the entrance to the item var/escape_time = 200 //how long it takes for mobs above small sizes to escape (for small sizes, its randomly 1.5 to 2x this) + var/alternate_escape_time = 0 //how long it takes for mobs to escape when the entrance is open var/load_time = 30 //how long it takes for mobs to be loaded into the pet carrier var/has_lock_sprites = TRUE //whether to load the lock overlays or not var/allows_hostiles = FALSE //does the pet carrier allow hostile entities to be held within it? @@ -129,10 +130,17 @@ /obj/item/pet_carrier/container_resist(mob/living/user) //don't do the whole resist timer thing if it's open! if(open) - loc.visible_message("[user] climbs out of [src]!", \ - "[user] jumps out of [src]!") - remove_occupant(user) - return + if(alternate_escape_time > 0) + loc.visible_message("The [src] begins to shake!") + if(do_after(user, alternate_escape_time, target = user)) + loc.visible_message("[user] jumps out of [src]") + remove_occupant(user) + return + else //instant escape, different message + loc.visible_message("[user] climbs out of [src]!", \ + "[user] jumps out of [src]!") + remove_occupant(user) + return user.changeNext_move(CLICK_CD_BREAKOUT) user.last_special = world.time + CLICK_CD_BREAKOUT @@ -181,21 +189,22 @@ /obj/item/pet_carrier/proc/load_occupant(mob/living/user, mob/living/target) if(pet_carrier_full(src)) to_chat(user, "[src] is already carrying too much!") - return + return FALSE user.visible_message("[user] starts loading [target] into [src].", \ "You start loading [target] into [src]...", null, null, target) to_chat(target, "[user] starts loading you into [user.p_their()] [name]!") if(!do_mob(user, target, load_time)) - return + return FALSE if(target in occupants) - return + return FALSE if(pet_carrier_full(src)) //Run the checks again, just in case to_chat(user, "[src] is already carrying too much!") - return + return FALSE user.visible_message("[user] loads [target] into [src]!", \ "You load [target] into [src].", null, null, target) to_chat(target, "[user] loads you into [user.p_their()] [name]!") add_occupant(target) + return TRUE /obj/item/pet_carrier/proc/add_occupant(mob/living/occupant) if(occupant in occupants || !istype(occupant)) @@ -231,7 +240,8 @@ allows_hostiles = TRUE //can fit hostile creatures, with the move resist restrictions in place, this means they still cannot take things like legions/goliaths/etc regardless has_lock_sprites = FALSE //jar doesn't show the regular lock overlay custom_materials = list(/datum/material/glass = 1000, /datum/material/bluespace = 600) - escape_time = 100 //half the time of a bluespace bodybag + escape_time = 200 //equal to the time of a bluespace bodybag + alternate_escape_time = 100 var/datum/gas_mixture/occupant_gas_supply /obj/item/pet_carrier/bluespace/update_icon_state() @@ -272,10 +282,15 @@ REMOVE_TRAIT(occupant, TRAIT_NOBREATH, "bluespace_container_no_breath") REMOVE_TRAIT(occupant, TRAIT_RESISTHIGHPRESSURE, "bluespace_container_resist_high_pressure") REMOVE_TRAIT(occupant, TRAIT_RESISTLOWPRESSURE, "bluespace_container_resist_low_pressure") + name = initial(name) /obj/item/pet_carrier/bluespace/return_air() if(!occupant_gas_supply) occupant_gas_supply = new return occupant_gas_supply +/obj/item/pet_carrier/bluespace/load_occupant(mob/living/user, mob/living/target) + if(..()) + name = "[initial(name)] ([target])" + #undef pet_carrier_full