diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 0455a9366557..22f64d0a1a6c 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -681,7 +681,7 @@ /obj/item/storage/belt/bandolier name = "bandolier" - desc = "A bandolier for holding ammunition. Does not hold magazines" + desc = "A bandolier for holding ammunition. Does not hold magazines." icon_state = "bandolier" item_state = "bandolier" @@ -695,6 +695,10 @@ /obj/item/ammo_casing )) +/obj/item/storage/belt/bandolier/examine(mob/user) + . = ..() + . += span_notice("The bandolier can be directly loaded by clicking on it with an ammo box.") + /obj/item/storage/belt/fannypack name = "fannypack" desc = "A dorky fannypack for keeping small items in." diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm index 3b1bdbc6eb1c..7f92dfad16a6 100644 --- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm +++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm @@ -125,6 +125,26 @@ to_chat(user, "You load [num_loaded] cartridge\s into \the [src]!") return num_loaded +/obj/item/ammo_box/afterattack(atom/target, mob/user, proximity_flag, click_parameters) + . = ..() + var/num_loaded = 0 + var/obj/item/storage/belt/bandolier/to_load + if(istype(target,/obj/item/storage/belt/bandolier)) + to_load = target + var/datum/component/storage/storage_to_load = to_load.GetComponent(/datum/component/storage) + for(var/obj/item/ammo_casing/casing_to_insert in stored_ammo) + if(!((to_load.contents.len >= storage_to_load.get_max_volume()) || do_after(user, 0.5 SECONDS, src))) + break + if(!storage_to_load.can_be_inserted(casing_to_insert,TRUE,user)) + break + storage_to_load.handle_item_insertion(casing_to_insert,TRUE,user) + stored_ammo -= casing_to_insert + playsound(get_turf(src), 'sound/weapons/gun/general/mag_bullet_insert.ogg', 60, TRUE) + num_loaded++ + update_ammo_count() + if(num_loaded) + to_chat(user, "You load [num_loaded] cartridge\s into \the [to_load]!") + return /obj/item/ammo_box/attack_self(mob/user) var/obj/item/ammo_casing/A = get_round() if(!A)