Pet carriers.

Code by DisturbHerb, icons by Azwald/Sunkiisu.
A handheld item which can hold some mob instances inside with support for visually displaying its occupants with vis_contents. This was created without access to the pre-existing chicken carrier code so it could be pretty bad.
The icon for the carrier is constructed using a base where two /obj/dummys are layered on top. These dummy objects are held in the carrier's vis_contents and each of them hold the mobs and the door of the carrier. The reason why the vis_contents of vis_contents_proxy hold the mobs rather than the carrier doing so directly is so that an alpha mask can prevent parts of the occupants from rendering outside of the inside of the carrier.
Vars | |
actionbar_duration | Time it takes for each action (eg. grabbing, releasing). |
---|---|
allowed_mob_types | Please override this in child types to specify what can actually fit in. |
can_break_out | If FALSE, an occupant cannot escape the carrier on their own. |
carrier_max_capacity | How many mobs can fit inside the crate. Usually not overridden by anything, this is to let the system be permissive for var-editing. |
carrier_occupants | A list of the current occupants inside the carrier. |
carrier_vis_flags | Carrier-related (grate_proxy, vis_contents_proxy) vis_flags. |
damage_per_resist | The damage dealt to the door's health upon resisting. |
default_mob_type | Type path, If not null, the pet carrier will spawn with one of this mob on New(). |
door_health | Causes the door to open and release its occupants when it reaches 0, subsequently resetting itself to the maximum. |
explicit_name_limit | Number of mobs named explicitly on examine() before switching to "there's a lot of mobs in here wow". |
grate_proxy | Grate object to be held in src.vis_contents |
mob_vis_flags | Mob-specific vis_flags. |
release_mob_icon_state | The icon_state for the src.RELEASE_MOB() actionbar. |
trap_mob_icon_state | The icon_state for the src.TRAP_MOB() actionbar. |
vis_contents_proxy | Proxy object for storing the vis_contents of each occupant, which itself is contained in the vis_contents of the parent carrier. |
Procs | |
add_mob | Directly adds a target mob to the carrier. |
eject_mob | Directly ejects a target mob from the carrier. |
release_mob | Called when a given mob/user releases an mob after an actionbar. |
take_door_damage | Deals damage to the door. If the remaining health <= 0, release everyone and reset the carrier. |
trap_mob | Called when a given mob/user steals a mob after an actionbar. |
Var Details
actionbar_duration

Time it takes for each action (eg. grabbing, releasing).
allowed_mob_types

Please override this in child types to specify what can actually fit in.
can_break_out

If FALSE, an occupant cannot escape the carrier on their own.
carrier_max_capacity

How many mobs can fit inside the crate. Usually not overridden by anything, this is to let the system be permissive for var-editing.
carrier_occupants

A list of the current occupants inside the carrier.
carrier_vis_flags

Carrier-related (grate_proxy, vis_contents_proxy) vis_flags.
damage_per_resist

The damage dealt to the door's health upon resisting.
default_mob_type

Type path, If not null, the pet carrier will spawn with one of this mob on New().
door_health

Causes the door to open and release its occupants when it reaches 0, subsequently resetting itself to the maximum.
explicit_name_limit

Number of mobs named explicitly on examine() before switching to "there's a lot of mobs in here wow".
grate_proxy

Grate object to be held in src.vis_contents
mob_vis_flags

Mob-specific vis_flags.
release_mob_icon_state

The icon_state for the src.RELEASE_MOB() actionbar.
trap_mob_icon_state

The icon_state for the src.TRAP_MOB() actionbar.
vis_contents_proxy

Proxy object for storing the vis_contents of each occupant, which itself is contained in the vis_contents of the parent carrier.
Proc Details
add_mob
Directly adds a target mob to the carrier.
eject_mob
Directly ejects a target mob from the carrier.
release_mob
Called when a given mob/user releases an mob after an actionbar.
take_door_damage
Deals damage to the door. If the remaining health <= 0, release everyone and reset the carrier.
trap_mob
Called when a given mob/user steals a mob after an actionbar.