mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Makes unloading ballistic weapons better (Namely revolvers)
This commit is contained in:
@@ -98,7 +98,6 @@
|
|||||||
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, TRUE)
|
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, TRUE)
|
||||||
A.update_icon()
|
A.update_icon()
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
return num_loaded
|
return num_loaded
|
||||||
|
|
||||||
/obj/item/ammo_box/attack_self(mob/user)
|
/obj/item/ammo_box/attack_self(mob/user)
|
||||||
@@ -132,6 +131,12 @@
|
|||||||
boolets++
|
boolets++
|
||||||
return boolets
|
return boolets
|
||||||
|
|
||||||
|
/obj/item/ammo_box/magazine/proc/ammo_list(drop_list = FALSE)
|
||||||
|
var/list/L = stored_ammo.Copy()
|
||||||
|
if(drop_list)
|
||||||
|
stored_ammo.Cut()
|
||||||
|
return L
|
||||||
|
|
||||||
/obj/item/ammo_box/magazine/proc/empty_magazine()
|
/obj/item/ammo_box/magazine/proc/empty_magazine()
|
||||||
var/turf_mag = get_turf(src)
|
var/turf_mag = get_turf(src)
|
||||||
for(var/obj/item/ammo in stored_ammo)
|
for(var/obj/item/ammo in stored_ammo)
|
||||||
|
|||||||
@@ -22,6 +22,16 @@
|
|||||||
for(var/i in 1 to rand(0, max_ammo*2))
|
for(var/i in 1 to rand(0, max_ammo*2))
|
||||||
rotate()
|
rotate()
|
||||||
|
|
||||||
|
/obj/item/ammo_box/magazine/internal/cylinder/ammo_list(drop_list = FALSE)
|
||||||
|
var/list/L = list()
|
||||||
|
for(var/i=1 to stored_ammo.len)
|
||||||
|
var/obj/item/ammo_casing/bullet = stored_ammo[i]
|
||||||
|
if(bullet)
|
||||||
|
L.Add(bullet)
|
||||||
|
if(drop_list)//We have to maintain the list size, to emulate a cylinder
|
||||||
|
stored_ammo[i] = null
|
||||||
|
return L
|
||||||
|
|
||||||
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
|
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
|
||||||
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
|
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
chambered = magazine.get_round((bolt_type == BOLT_TYPE_NO_BOLT))
|
chambered = magazine.get_round((bolt_type == BOLT_TYPE_NO_BOLT))
|
||||||
if (bolt_type != BOLT_TYPE_OPEN)
|
if (bolt_type != BOLT_TYPE_OPEN)
|
||||||
chambered.forceMove(src)
|
chambered.forceMove(src)
|
||||||
|
|
||||||
/obj/item/gun/ballistic/proc/rack(mob/user = null)
|
/obj/item/gun/ballistic/proc/rack(mob/user = null)
|
||||||
if (bolt_type == BOLT_TYPE_NO_BOLT) //If there's no bolt, nothing to rack
|
if (bolt_type == BOLT_TYPE_NO_BOLT) //If there's no bolt, nothing to rack
|
||||||
return
|
return
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
eject_magazine(user, FALSE, AM)
|
eject_magazine(user, FALSE, AM)
|
||||||
else
|
else
|
||||||
to_chat(user, "<span class='notice'>There's already a [magazine_wording] in \the [src].</span>")
|
to_chat(user, "<span class='notice'>There's already a [magazine_wording] in \the [src].</span>")
|
||||||
return
|
return
|
||||||
if (istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box))
|
if (istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box))
|
||||||
if (bolt_type == BOLT_TYPE_NO_BOLT || internal_magazine)
|
if (bolt_type == BOLT_TYPE_NO_BOLT || internal_magazine)
|
||||||
if (chambered && !chambered.BB)
|
if (chambered && !chambered.BB)
|
||||||
@@ -301,10 +301,7 @@
|
|||||||
return
|
return
|
||||||
if(bolt_type == BOLT_TYPE_NO_BOLT)
|
if(bolt_type == BOLT_TYPE_NO_BOLT)
|
||||||
var/num_unloaded = 0
|
var/num_unloaded = 0
|
||||||
while (get_ammo() > 0)
|
for(var/obj/item/ammo_casing/CB in get_ammo_list(TRUE, TRUE))
|
||||||
var/obj/item/ammo_casing/CB
|
|
||||||
CB = magazine.get_round(FALSE)
|
|
||||||
chambered = null
|
|
||||||
CB.forceMove(drop_location())
|
CB.forceMove(drop_location())
|
||||||
CB.bounce_away(FALSE, NONE)
|
CB.bounce_away(FALSE, NONE)
|
||||||
num_unloaded++
|
num_unloaded++
|
||||||
@@ -320,7 +317,7 @@
|
|||||||
if (recent_rack > world.time)
|
if (recent_rack > world.time)
|
||||||
return
|
return
|
||||||
recent_rack = world.time + rack_delay
|
recent_rack = world.time + rack_delay
|
||||||
rack(user)
|
rack(user)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -343,6 +340,15 @@
|
|||||||
boolets += magazine.ammo_count()
|
boolets += magazine.ammo_count()
|
||||||
return boolets
|
return boolets
|
||||||
|
|
||||||
|
/obj/item/gun/ballistic/proc/get_ammo_list(countchambered = TRUE, drop_all = FALSE)
|
||||||
|
var/list/rounds = list()
|
||||||
|
if(chambered && countchambered)
|
||||||
|
rounds.Add(chambered)
|
||||||
|
if(drop_all)
|
||||||
|
chambered = null
|
||||||
|
rounds.Add(magazine.ammo_list(drop_all))
|
||||||
|
return rounds
|
||||||
|
|
||||||
#define BRAINS_BLOWN_THROW_RANGE 3
|
#define BRAINS_BLOWN_THROW_RANGE 3
|
||||||
#define BRAINS_BLOWN_THROW_SPEED 1
|
#define BRAINS_BLOWN_THROW_SPEED 1
|
||||||
/obj/item/gun/ballistic/suicide_act(mob/user)
|
/obj/item/gun/ballistic/suicide_act(mob/user)
|
||||||
|
|||||||
Reference in New Issue
Block a user