Files
Polaris/code/modules/projectiles/guns/projectile.dm
mport2004@gmail.com 67d4ceffb0 Job system should be working now. I had a '==' where a '&' should have been that would cause it to only work when you had one job of the same level and department selected.
The loyalty implant box now spawn in the HoS' locker and not in nullspace.
Gave the HoS' locker a secbelt.
The revolver now use the proper bullet.
Robotics spawn with their labcoat/toolbox.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2346 316c924e-a436-60f5-8080-3fe189b3f50e
2011-10-12 23:00:48 +00:00

64 lines
1.6 KiB
Plaintext

/obj/item/weapon/gun/projectile
desc = "A classic revolver. Uses 357 ammo"
name = "revolver"
icon_state = "revolver"
caliber = "357"
origin_tech = "combat=2;materials=2"
w_class = 3.0
m_amt = 1000
var
ammo_type = "/obj/item/ammo_casing/a357"
list/loaded = list()
max_shells = 7
load_method = 0 //0 = Single shells or quick loader, 1 = magazine
New()
for(var/i = 1, i <= max_shells, i++)
loaded += new ammo_type(src)
update_icon()
load_into_chamber()
if(!loaded.len) return 0
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
loaded -= AC //Remove casing from loaded list.
AC.loc = get_turf(src) //Eject casing onto ground.
if(AC.BB)
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
return 1
return 0
attackby(var/obj/item/A as obj, mob/user as mob)
var/num_loaded = 0
if(istype(A, /obj/item/ammo_magazine))
var/obj/item/ammo_magazine/AM = A
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
if(loaded.len >= max_shells)
break
if(AC.caliber == caliber && loaded.len < max_shells)
AC.loc = src
AM.stored_ammo -= AC
loaded += AC
num_loaded++
else if(istype(A, /obj/item/ammo_casing) && !load_method)
var/obj/item/ammo_casing/AC = A
if(AC.caliber == caliber && loaded.len < max_shells)
user.drop_item()
AC.loc = src
loaded += AC
num_loaded++
if(num_loaded)
user << text("\blue You load [] shell\s into the gun!", num_loaded)
A.update_icon()
return
update_icon()
desc = initial(desc) + text(" Has [] rounds remaining.", loaded.len)