Skip to content

Commit

Permalink
Xeno Backpacks (#1274)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

## About The Pull Request
This pull request adds support for marines to strap a backpack onto
allied xenos. The xeno cannot view the contents of the bag nor interact
with it any way other than through a new shake verb. Marines also have
access to the new shake verb for any emptyable storage item. Shaking a
storage item that is either in your hands or back slot has a high chance
to drop out a single item. Xenos that shake an empty backpack also have
a low chance to drop the backpack on the ground.

Strapping on, unstrapping, and accessing any allied xeno backpack does
take some time to complete.

The item class size of gardener and healer fruit has been lowered to
medium, but they occupy more space in a bag than a regular medium item
(so only five can fit in a typical bag). The intention of this change is
to allow a bag loaded with either fruit (for xenos) or medical supplies
(for marines) that a xeno can go out and distribute, but its primarily
on a marine to facilitate this.

Sprites were created by Jean 'Docteur' Corbeau aka SubjectD9341.


![Preview](https://user-images.githubusercontent.com/76988376/196059419-9833c1a5-5d6e-4354-b9c6-1f8c0ff3bd5a.png)
**NOTE:** _**Some sprites in above are no longer accurate. See updated
images below...**_


![Defender](https://user-images.githubusercontent.com/76988376/207441985-a89accaf-482c-4d94-8fad-cd04737adef7.png)

![SentDroneSpitter](https://user-images.githubusercontent.com/76988376/207442096-b67daf74-8618-4c9f-83b4-d3b3cd067aa0.png)

![RunnerPraeWarrior](https://user-images.githubusercontent.com/76988376/207442390-a32fac4e-2e26-4337-86f0-5c7cc4b8b344.png)

Sprite progress (though ultimately up to them how far they want to go):
- [X] Medic bag on Drone
- [X] Regular bag on Drone
- [X] Medic bag on Defender
- [X] Regular bag on Defender
- [X] Medic bag on Sentinel
- [X] Regular bag on Sentinel
- [X] Medic bag on Runner
- [X] Regular bag on Runner
- [X] Medic bag on Warrior
- [X] Regular bag on Warrior
- [X] Medic bag on Spitter
- [X] Regular bag on Spitter
- [X] Medic bag on Praetorian
- [X] Regular bag on Praetorian

Any unlisted castes aren't planned at this time.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->
Opens up more interactions between marines and xenos, namely for
friendly "greenos". Encourages more cooperation between a friendly xeno
faction because equipping and loading of these backpacks can only be
performed by a marine; a xeno can only shake items out or shake the bag
off. Allowing fruit to be placed in bags is primarily to allow a medic
roony to either provide healing to xenos by shaking out some fruit, or
to marines by shaking out some medical supplies.
## Changelog

<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. Please note that
maintainers freely reserve the right to remove and add tags should they
deem it appropriate. You can attempt to finagle the system all you want,
but it's best to shoot for clear communication right off the bat. -->

:cl: Drathek, SubjectD9341
add: Standard issue marine backpacks can now be equipped to most allied
xenos (Runners/Praetorians/Drones/Defenders/Warriors/Sentinels/Spitters)
and accessed. Use a pack in help intent on a xeno to strap it to her
after a duration. Access it with an empty hand in help intent after a
duration. Drag a xeno with a pack to you when you have an empty hand to
unstrap it from her after a duration.
add: Added the Shake verb to storage items. Humans and xenos can now
shake emptyable inventories which has a 75% chance to drop an item if
there are any. Xenos also have a 25% chance to cause the pack fall off
them when empty.
balance: Resin fruit is now class size medium but size cost large so
five can fit in a backpack.
soundadd: Emptying a storage item now uses the existing rustle sound (or
whatever use_sound its configured to use).
soundadd: Unequipping a backpack now uses the existing rustle sound (or
whatever use_sound its configured to use).
imageadd: Added sprites for regular and medical packs on
Runners/Praetorians/Drones/Defenders/Warriors/Sentinels/Spitters.
code: Any storage item that is STORAGE_ALLOW_EMPTY now either
adds/removes empty_verb and toggle_click_empty depending on if the user
is a xeno.
code: Refactored /atom/movable/vis_obj/xeno_wounds so it can be more
generic as just vis_obj (now it will be used by both wounds and packs
and packs don't need to be xeno_wounds) and use VIS_INHERIT_DIR instead
of a signal.
fix: Xeno wounds no longer inherit hive color.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
  • Loading branch information
Drulikar authored Dec 17, 2022
1 parent 071f89e commit d7e6129
Show file tree
Hide file tree
Showing 21 changed files with 284 additions and 31 deletions.
10 changes: 10 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,16 @@ var/list/default_onmob_icons = list(
WEAR_ACCESSORIES = 'icons/mob/humans/onmob/ties.dmi'
)

var/list/default_xeno_onmob_icons = list(
/mob/living/carbon/Xenomorph/Runner = 'icons/mob/xenos/onmob/runner.dmi',
/mob/living/carbon/Xenomorph/Praetorian = 'icons/mob/xenos/onmob/praetorian.dmi',
/mob/living/carbon/Xenomorph/Drone = 'icons/mob/xenos/onmob/drone.dmi',
/mob/living/carbon/Xenomorph/Warrior = 'icons/mob/xenos/onmob/warrior.dmi',
/mob/living/carbon/Xenomorph/Defender = 'icons/mob/xenos/onmob/defender.dmi',
/mob/living/carbon/Xenomorph/Sentinel = 'icons/mob/xenos/onmob/sentinel.dmi',
/mob/living/carbon/Xenomorph/Spitter = 'icons/mob/xenos/onmob/spitter.dmi'
)

// species names
#define SPECIES_HUMAN "Human"
#define SPECIES_YAUTJA "Yautja"
Expand Down
3 changes: 3 additions & 0 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ Quick adjacency (to turf):
if(recurse > 0)
return loc.Adjacent(neighbor, recurse - 1)
return FALSE
else if(isXeno(loc)) //Xenos don't count as storage depth.
return loc.Adjacent(neighbor, recurse)
return ..()

/*
Special case: This allows you to reach a door when it is visally on top of,
but technically behind, a fire door
Expand Down
30 changes: 30 additions & 0 deletions code/_onclick/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,36 @@
if(user != src)
return . = ..()

if(isXeno(dropping))
var/mob/living/carbon/Xenomorph/xeno = dropping
if(xeno.back)
var/obj/item/back_item = xeno.back
if(xeno.stat != DEAD) // If the Xeno is alive, fight back
var/mob/living/carbon/carbon_user = user
if(!carbon_user || !carbon_user.ally_of_hivenumber(xeno.hivenumber))
user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
playsound(user.loc, 'sound/weapons/pierce.ogg', 25, TRUE)
user.visible_message(SPAN_WARNING("\The [user] tried to unstrap \the [back_item] from [xeno] but instead gets a tail swipe to the head!"))
return
if(user.get_active_hand())
to_chat(user, SPAN_WARNING("You can't unstrap \the [back_item] from [xeno] with your hands full."))
return
user.visible_message(SPAN_NOTICE("\The [user] starts unstrapping \the [back_item] from [xeno]"), \
SPAN_NOTICE("You start unstrapping \the [back_item] from [xeno]."), null, 5, CHAT_TYPE_FLUFF_ACTION)
if(!do_after(user, HUMAN_STRIP_DELAY * user.get_skill_duration_multiplier(), INTERRUPT_ALL, BUSY_ICON_GENERIC, xeno, INTERRUPT_MOVED, BUSY_ICON_GENERIC))
to_chat(user, SPAN_WARNING("You were interrupted!"))
return

if(user.get_active_hand())
return
if(!user.Adjacent(xeno))
return
xeno.drop_inv_item_on_ground(back_item)
if(!back_item || QDELETED(back_item)) //Might be self-deleted?
return
user.put_in_active_hand(back_item)
return

if(pulling != dropping || grab_level != GRAB_AGGRESSIVE || !ishuman(dropping) || !(a_intent & INTENT_GRAB))
return . = ..()

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

var/mob/living/carbon/human/locked_to_mob = null // If the item uses flag MOB_LOCK_ON_PICKUP, this is the mob owner reference.

var/list/equip_sounds//Sounds played when this item is equipped
var/list/equip_sounds //Sounds played when this item is equipped
var/list/unequip_sounds //Same but when unequipped

///Vision impairing effect if worn on head/mask/glasses.
Expand Down
68 changes: 66 additions & 2 deletions code/game/objects/items/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/obj/item/card/id/locking_id = null
var/is_id_lockable = FALSE
var/lock_overridable = TRUE
var/xeno_icon_state = null //the icon_state for xeno's wearing this (using the dmi defined in default_xeno_onmob_icons list)
var/list/xeno_types = null //what xeno types can equip this backpack

/obj/item/storage/backpack/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/card/id/) && is_id_lockable && ishuman(user))
Expand All @@ -27,6 +29,51 @@
if (..() && use_sound)
playsound(loc, use_sound, 15, TRUE, 6)

/obj/item/storage/backpack/attack(mob/living/target_mob, mob/living/user)
if(!xeno_icon_state)
return ..()
if(target_mob.back)
return ..()
if(user.a_intent != INTENT_HELP)
return ..()
if(!xeno_types || !(target_mob.type in xeno_types))
return ..()
if(!isXeno(target_mob))
return ..()
if(HAS_TRAIT(target_mob, TRAIT_XENONID))
return ..() // We don't have backpack sprites for xenoids (yet?)
var/mob/living/carbon/Xenomorph/xeno = target_mob
if(target_mob.stat != DEAD) // If the Xeno is alive, fight back
var/mob/living/carbon/carbon_user = user
if(!carbon_user || !carbon_user.ally_of_hivenumber(xeno.hivenumber))
user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
playsound(user.loc, 'sound/weapons/pierce.ogg', 25, TRUE)
user.visible_message(SPAN_WARNING("\The [user] tried to strap \the [src] onto [target_mob] but instead gets a tail swipe to the head!"))
return FALSE

user.visible_message(SPAN_NOTICE("\The [user] starts strapping \the [src] onto [target_mob]."), \
SPAN_NOTICE("You start strapping \the [src] onto [target_mob]."), null, 5, CHAT_TYPE_FLUFF_ACTION)
if(!do_after(user, HUMAN_STRIP_DELAY * user.get_skill_duration_multiplier(), INTERRUPT_ALL, BUSY_ICON_GENERIC, target_mob, INTERRUPT_MOVED, BUSY_ICON_GENERIC))
to_chat(user, SPAN_WARNING("You were interrupted!"))
return FALSE

// Ensure conditions still valid
if(src != user.get_active_hand())
return FALSE
if(!user.Adjacent(target_mob))
return FALSE
user.drop_inv_item_on_ground(src)
if(!src || QDELETED(src)) //Might be self-deleted?
return FALSE

// Create their vis object if needed
if(!xeno.backpack_icon_carrier)
xeno.backpack_icon_carrier = new(null, xeno)
xeno.vis_contents += xeno.backpack_icon_carrier

target_mob.put_in_back(src)
return FALSE

/obj/item/storage/backpack/proc/toggle_lock(obj/item/card/id/card, mob/living/carbon/human/H)
if(QDELETED(locking_id))
to_chat(H, SPAN_NOTICE("You lock \the [src]!"))
Expand All @@ -48,6 +95,12 @@
storage_close(user)
..()

/obj/item/storage/unequipped(mob/user, slot, silent)
if(slot == WEAR_BACK)
if(use_sound && !silent)
playsound(loc, use_sound, 15, TRUE, 6)
..()

/obj/item/storage/backpack/dropped(mob/user)
mouse_opacity = initial(mouse_opacity)
..()
Expand Down Expand Up @@ -312,18 +365,24 @@ obj/item/storage/backpack/proc/compare_id(var/mob/living/carbon/human/H)
icon_state = "marinepack"
item_state = "marinepack"
has_gamemode_skin = TRUE //replace this with the atom_flag NO_SNOW_TYPE at some point, just rename it to like, NO_MAP_VARIANT_SKIN
xeno_icon_state = "marinepack"
xeno_types = list(/mob/living/carbon/Xenomorph/Runner, /mob/living/carbon/Xenomorph/Praetorian, /mob/living/carbon/Xenomorph/Drone, /mob/living/carbon/Xenomorph/Warrior, /mob/living/carbon/Xenomorph/Defender, /mob/living/carbon/Xenomorph/Sentinel, /mob/living/carbon/Xenomorph/Spitter)

/obj/item/storage/backpack/marine/medic
name = "\improper USCM corpsman backpack"
desc = "A standard-issue backpack worn by USCM medics."
icon_state = "marinepack_medic"
item_state = "marinepack_medic"
xeno_icon_state = "medicpack"
xeno_types = list(/mob/living/carbon/Xenomorph/Runner, /mob/living/carbon/Xenomorph/Praetorian, /mob/living/carbon/Xenomorph/Drone, /mob/living/carbon/Xenomorph/Warrior, /mob/living/carbon/Xenomorph/Defender, /mob/living/carbon/Xenomorph/Sentinel, /mob/living/carbon/Xenomorph/Spitter)

/obj/item/storage/backpack/marine/tech
name = "\improper USCM technician backpack"
desc = "A standard-issue backpack worn by USCM technicians."
icon_state = "marinepack_techi"
item_state = "marinepack_techi"
xeno_icon_state = "marinepack"
xeno_types = list(/mob/living/carbon/Xenomorph/Runner, /mob/living/carbon/Xenomorph/Praetorian, /mob/living/carbon/Xenomorph/Drone, /mob/living/carbon/Xenomorph/Warrior, /mob/living/carbon/Xenomorph/Defender, /mob/living/carbon/Xenomorph/Sentinel, /mob/living/carbon/Xenomorph/Spitter)

/obj/item/storage/backpack/marine/satchel/intel
name = "\improper USCM lightweight expedition pack"
Expand All @@ -338,6 +397,7 @@ obj/item/storage/backpack/proc/compare_id(var/mob/living/carbon/human/H)
worn_accessible = TRUE
storage_slots = null
max_storage_space = 15
xeno_types = null

/obj/item/storage/backpack/marine/satchel/big //wacky squad marine loadout item, its the IO backpack.
name = "\improper USCM logistics IMP backpack"
Expand All @@ -347,7 +407,6 @@ obj/item/storage/backpack/proc/compare_id(var/mob/living/carbon/human/H)
storage_slots = null
max_storage_space = 21 //backpack size


/obj/item/storage/backpack/marine/satchel/medic
name = "\improper USCM corpsman satchel"
desc = "A heavy-duty satchel used by USCM medics. It sacrifices capacity for usability. A small patch is sewn to the top flap."
Expand Down Expand Up @@ -497,20 +556,23 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
desc = "A specially-designed smock with pockets for all your sniper needs."
icon_state = "smock"
worn_accessible = TRUE
xeno_types = null

/obj/item/storage/backpack/marine/marsoc
name = "\improper USCM SOF IMP tactical rucksack"
icon_state = "tacrucksack"
desc = "With a backpack like this, you'll forget you're on a hell march designed to kill you."
worn_accessible = TRUE
has_gamemode_skin = FALSE
xeno_types = null

/obj/item/storage/backpack/marine/rocketpack
name = "\improper USCM IMP M22 rocket bags"
desc = "A specially-designed backpack that fits to the IMP mounting frame on standard USCM pattern M3 armors. It's made of two waterproofed reinforced tubes and one smaller satchel slung at the bottom. The two silos are for rockets, but no one is stopping you from cramming other things in there."
icon_state = "rocketpack"
worn_accessible = TRUE
has_gamemode_skin = FALSE //monkeysfist101 never sprited a snowtype but included duplicate icons. Why?? Recolor and touch up sprite at a later date.
xeno_types = null

/obj/item/storage/backpack/marine/grenadepack
name = "\improper USCM IMP M63A1 grenade satchel"
Expand All @@ -523,6 +585,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
can_hold = list(/obj/item/explosive/grenade)
is_id_lockable = TRUE
has_gamemode_skin = FALSE
xeno_types = null

/obj/item/storage/backpack/marine/grenadepack/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/storage/box/nade_box) || istype(W, /obj/item/storage/backpack/marine/grenadepack) || istype(W, /obj/item/storage/belt/grenade))
Expand All @@ -537,6 +600,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
max_w_class = SIZE_HUGE
storage_slots = 8
can_hold = list(/obj/item/mortar_shell)
xeno_types = null

/// G-8-a general pouch belt
/obj/item/storage/backpack/general_belt
Expand Down Expand Up @@ -715,7 +779,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
max_storage_space = 18
storage_slots = null
has_gamemode_skin = TRUE

xeno_types = null

/obj/item/storage/backpack/marine/engineerpack/Initialize()
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/storage/smartpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
max_storage_space = 14
worn_accessible = TRUE
actions_types = list(/datum/action/item_action/toggle)
xeno_types = null

var/show_exoskeleton = FALSE

Expand Down
66 changes: 66 additions & 0 deletions code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,16 @@ W is always an item. stop_warning prevents messaging. user may be null.**/

return attempt_item_insertion(W, FALSE, user)

/obj/item/storage/equipped(mob/user, slot, silent)
if ((storage_flags & STORAGE_ALLOW_EMPTY))
if(!isXeno(user))
verbs |= /obj/item/storage/verb/empty_verb
verbs |= /obj/item/storage/verb/toggle_click_empty
else
verbs -= /obj/item/storage/verb/empty_verb
verbs -= /obj/item/storage/verb/toggle_click_empty
..()

/obj/item/storage/proc/attempt_item_insertion(obj/item/W as obj, prevent_warning = FALSE, mob/user as mob)
if(!can_be_inserted(W))
return
Expand Down Expand Up @@ -608,6 +618,61 @@ W is always an item. stop_warning prevents messaging. user may be null.**/
remove_from_storage(I, T)
user.visible_message(SPAN_NOTICE("[user] empties \the [src]."),
SPAN_NOTICE("You empty \the [src]."))
if (use_sound)
playsound(loc, use_sound, 25, TRUE, 3)

/obj/item/storage/verb/shake_verb()
set name = "Shake"
set category = "Object"
set src in usr
var/mob/user_mob = usr
shake(user_mob, get_turf(user_mob))

/obj/item/storage/proc/shake(var/mob/user, var/turf/tile)
if(!(storage_flags & STORAGE_ALLOW_EMPTY))
return

if(user.l_hand != src && user.r_hand != src && user.back != src)
return

if(user.is_mob_incapacitated())
return

if (!isturf(tile) || get_dist(src, tile) > 1)
tile = get_turf(src)

if (use_sound)
playsound(loc, use_sound, 25, TRUE, 3)

if(!length(contents))
if(prob(25) && isXeno(user))
user.drop_inv_item_to_loc(src, tile)
user.visible_message(SPAN_NOTICE("[user] shakes \the [src] off."),
SPAN_NOTICE("You shake \the [src] off."))
else
user.visible_message(SPAN_NOTICE("[user] shakes \the [src] but nothing falls out."),
SPAN_NOTICE("You shake \the [src] but nothing falls out. It feels empty."))
return

if(!allowed(user))
user.visible_message(SPAN_NOTICE("[user] shakes \the [src] but nothing falls out."),
SPAN_NOTICE("You shake \the [src] but nothing falls out. Access denied."))
return

if(!prob(75))
user.visible_message(SPAN_NOTICE("[user] shakes \the [src] but nothing falls out."),
SPAN_NOTICE("You shake \the [src] but nothing falls out."))
return

storage_close(user)
var/obj/item/item_obj
if(storage_flags & STORAGE_USING_FIFO_DRAWING)
item_obj = contents[1]
else
item_obj = contents[contents.len]
remove_from_storage(item_obj, tile)
user.visible_message(SPAN_NOTICE("[user] shakes \the [src] and \a [item_obj] falls out."),
SPAN_NOTICE("You shake \the [src] and \a [item_obj] falls out."))

/obj/item/storage/proc/dump_ammo_to(obj/item/ammo_magazine/ammo_dumping, mob/user, var/amount_to_dump = 5) //amount_to_dump should never actually need to be used as default value
if(user.action_busy)
Expand Down Expand Up @@ -674,6 +739,7 @@ W is always an item. stop_warning prevents messaging. user may be null.**/
if (!(storage_flags & STORAGE_ALLOW_EMPTY))
verbs -= /obj/item/storage/verb/empty_verb
verbs -= /obj/item/storage/verb/toggle_click_empty
verbs -= /obj/item/storage/verb/shake_verb

boxes = new
boxes.name = "storage"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/cm_aliens/structures/fruit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@
desc = "A strange fruit that you could eat.. if you REALLY wanted to. Its roots seem to twitch every so often."
icon = 'icons/mob/xenos/fruits.dmi'
icon_state = "fruit_lesser_item"
w_class = SIZE_LARGE
w_class = SIZE_MEDIUM
storage_cost = SIZE_LARGE
bitesize = 2
var/mob/living/carbon/Xenomorph/bound_xeno //Drone linked to this fruit
var/fruit_type = /obj/effect/alien/resin/fruit
Expand Down
2 changes: 2 additions & 0 deletions code/modules/cm_marines/Donor_Items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,8 @@
desc = "Black gloves, favored by Special Operations teams. DONOR ITEM"
name = "Black Ops Black Gloves"

/obj/item/storage/backpack/marine/fluff
xeno_types = null

/obj/item/storage/backpack/marine/fluff/Sado
name = "Tanya's Backpack"
Expand Down
23 changes: 21 additions & 2 deletions code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if(hand) return put_in_r_hand(W)
else return put_in_l_hand(W)

//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
//Puts the item into our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success.
//If both fail it drops it on the floor and returns 0.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(var/obj/item/W)
Expand All @@ -76,7 +76,24 @@
W.dropped(src)
return FALSE


//Puts the item into our back if possible. Returns 1 on success.
/mob/proc/put_in_back(var/obj/item/item)
if(!item)
return FALSE
if(!istype(item))
return FALSE
if(back)
return FALSE
if(item.loc == src && !(item.flags_item & DELONDROP))
item.dropped(src)
item.pickup(src)
item.forceMove(src)
back = item
item.layer = ABOVE_HUD_LAYER
item.plane = ABOVE_HUD_PLANE
item.equipped(src, WEAR_BACK)
update_inv_back()
return TRUE

/mob/proc/drop_item_v() //this is dumb.
if(stat == CONSCIOUS && isturf(loc))
Expand Down Expand Up @@ -366,3 +383,5 @@
return WEAR_L_HAND
if(I == r_hand)
return WEAR_R_HAND
if(I == back)
return WEAR_BACK
Loading

0 comments on commit d7e6129

Please sign in to comment.