towel
Vars | |
max_reagent_volume | How many units of liquid can this towel store? |
---|---|
shape | The shape we're currently in. |
wet | Are we currently wet? |
Procs | |
attack_on_liquids_turf | The procedure for remove liquids from turf |
change_towel_shape | Helper to change the shape of the towel, so that it updates its look both in-hand and on the body of the wearer. |
make_used | Simple helper to make the towel into a used towel shape. |
set_wet | Helper proc to handle setting the towel's wet variable, changing the icon_state
accordingly and making the towel look a little damp if wet, and removing that
color if not wet. |
transfer_reagents_to_towel | Helper to transfer reagents to the towel. |
transfer_towel_reagents_to | Helper to transfer reagents from the towel to something else, handling all the work related to ensuring that the towel gets updated visually if it now becomes dry, while also optionally applying a loss factor to the transfer. |
update_slot_related_flags | Helper proc to change the slot flags of the towel based on its shape. |
Var Details
max_reagent_volume
How many units of liquid can this towel store?
shape
The shape we're currently in.
wet
Are we currently wet?
Proc Details
attack_on_liquids_turf
The procedure for remove liquids from turf
The object is called from liquid_interaction element. The procedure check range of mop owner and tile, then check reagents in mop, if reagents volume < mop capacity - liquids absorbs from tile In another way, input a chat about mop capacity Arguments:
- towel - Towel used to absorb liquids
- tile - On which tile the towel will try to absorb liquids
- user - Who tries to absorb liquids with the towel
- liquids - Liquids that user tries to absorb with the towel
change_towel_shape
Helper to change the shape of the towel, so that it updates its look both in-hand and on the body of the wearer.
Arguments:
- user - Mob that's trying to change the shape of the towel.
- new_shape - The new shape that the towel can be in.
- silent (optional) - Whether we produce a to_chat to the user to elaborate on
the new shape it is now in. Requires
user
to be non-null ifTRUE
in order to do anything. Defaults toFALSE
.
make_used
Simple helper to make the towel into a used towel shape.
Arguments:
- user - Mob that's making the towel used. Can be null if
silent
isFALSE
. - silent (optional) - Whether we produce a to_chat to the user to elaborate on
the new shape it is now in. Requires
user
to be non-null ifTRUE
in order to do anything. Defaults toFALSE
.
set_wet
Helper proc to handle setting the towel's wet
variable, changing the icon_state
accordingly and making the towel look a little damp if wet, and removing that
color if not wet.
Arguments:
- new_wetness - Whether we're now wet or not.
- update_visuals (optional) - Whether we call
update_appearance()
andupdate_slot_icon()
. Set toFALSE
if you're already calling a proc that updates the towel's appearance, likechange_towel_shape()
(if you're sure that it WILL change the appearance). Defaults toTRUE
.
transfer_reagents_to_towel
Helper to transfer reagents to the towel.
Arguments:
- source - Reagents source of the reagents transfer.
- amount - Amount of reagents that are going to be affected by the transfer. Won't go above the maximum amount of volume of the towel, and it will handle making sure that it uses the right amount of reagents if the source doesn't have enough reagents for it.
- user - Mob that does the transfer, if any.
- make_used (optional) - Whether or not we change the towel to the used sprite.
Defaults to
TRUE
.
transfer_towel_reagents_to
Helper to transfer reagents from the towel to something else, handling all the work related to ensuring that the towel gets updated visually if it now becomes dry, while also optionally applying a loss factor to the transfer.
Arguments:
- target - Reagents target of the reagents transfer.
- amount - Amount of reagents that are going to be affected by the transfer. Won't go above the maximum amount of volume of the target, and it will handle making sure that it uses the right amount of reagents if the towel doesn't have enough reagents in it for it.
- user - Mob that does the transfer, if any.
- loss_factor (optional) - Factor of reagents that get lost during transfer. Defaults to 0.
- make_used (optional) - Whether or not we change the towel to the used sprite.
Defaults to
FALSE
.
update_slot_related_flags
Helper proc to change the slot flags of the towel based on its shape.