Files
Bubberstation/code/modules/projectiles/ammunition.dm
sirbayer 19e51caef0 Modification of .gitignore to include admins.txt. Hopefully.`
Added myself to admins.txt for testing.

Merge branch 'srsbsns'

Fucking finally figuring out how to make admins.txt be ignored.

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

stuff

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

latest setting for tgstation.dme

deeply do I loathe these files

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

God I hate gitignore

Merge branch 'master' of https://github.com/tgstation/-tg-station

Modification of .gitignore to include admins.txt. Hopefully.`

Added myself to admins.txt for testing.

Merge branch 'srsbsns'

Fucking finally figuring out how to make admins.txt be ignored.

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

stuff

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

latest setting for tgstation.dme

deeply do I loathe these files

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

God I hate gitignore

Merge branch 'master' of https://github.com/tgstation/-tg-station

Modification of .gitignore to include admins.txt. Hopefully.`

Added myself to admins.txt for testing.

Merge branch 'srsbsns'

Fucking finally figuring out how to make admins.txt be ignored.

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

stuff

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge branch 'master' of https://github.com/tgstation/-tg-station

latest setting for tgstation.dme

deeply do I loathe these files

Merge branch 'master' of https://github.com/tgstation/-tg-station

Conflicts:
	config/admins.txt

God I hate gitignore

Merge branch 'master' of https://github.com/tgstation/-tg-station

Merge remote-tracking branch 'remotes/origin/srsbsns-improvedprojectiles' into srsbsns-improvedprojectiles

Conflicts:
	config/admins.txt
	data/investigate/singulo.html

I don't what I'm doing

Massive overhaul to automatic gun functionality, intended primarily to
allow partially-filled magazines to be released.

Now it compiles and doesn't throw runtimes! Also chambering rounds works
right! Unfortunately the contents still need to be looked at, the Russian
Revolver isn't working, and the Bartender's shotgun is just a nightmare.
Also you still can't eject mags.

Mags eject, most gun work. Shotguns still have a problem with reloading
and chambering. Russian Revolver is a bitch.

Heavy finalizing touches. Fixed references to changed trees. Added
icon_states for some magazines. Fixed revolver glitches and subtyped
double-barreled shotguns to revolvers to fix its glitches. Made bullets
and spent shells more obvious via graphical changes. Probably did some
other things but I can't think of what they'd be.

Sprite tweaks for final preparations for pull request.

final FINAL finalizations.

Adding full paths to overwritten procs for simplicity's sake.

Fixing damaged .gitignore and config/admins.txt.

Finalization for pull preparation. Clean up some descs, eliminate data folder.
2013-10-30 17:56:00 -07:00

107 lines
2.7 KiB
Plaintext

/obj/item/ammo_casing
name = "bullet casing"
desc = "A bullet casing."
icon = 'icons/obj/ammo.dmi'
icon_state = "s-casing"
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
throwforce = 1
w_class = 1.0
var/caliber = null //Which kind of guns it can be loaded into
var/projectile_type = null //The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet
/obj/item/ammo_casing/New()
..()
if(projectile_type)
BB = new projectile_type(src)
pixel_x = rand(-10.0, 10)
pixel_y = rand(-10.0, 10)
dir = pick(alldirs)
update_icon()
/obj/item/ammo_casing/update_icon()
..()
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
//Boxes of ammo
/obj/item/ammo_box
name = "ammo box (.357)"
desc = "A box of ammo"
icon_state = "357"
icon = 'icons/obj/ammo.dmi'
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
m_amt = 50000
throwforce = 2
w_class = 1.0
throw_speed = 4
throw_range = 10
var/list/stored_ammo = list()
var/ammo_type = /obj/item/ammo_casing
var/max_ammo = 7
var/multiple_sprites = 0
var/caliber
/obj/item/ammo_box/New()
for(var/i = 1, i <= max_ammo, i++)
stored_ammo += new ammo_type(src)
update_icon()
/obj/item/ammo_box/proc/get_round(var/keep = 0)
if (!stored_ammo.len)
return null
else
var/b = stored_ammo[stored_ammo.len]
stored_ammo -= b
if (keep)
stored_ammo.Insert(1,b)
return b
/obj/item/ammo_box/proc/give_round(var/obj/item/ammo_casing/r)
var/obj/item/ammo_casing/rb = r
if (rb)
if (stored_ammo.len < max_ammo && rb.caliber == caliber)
stored_ammo += rb
rb.loc = src
return 1
return 0
/obj/item/ammo_box/attackby(var/obj/item/A as obj, mob/user as mob)
var/num_loaded = 0
if(istype(A, /obj/item/ammo_box))
var/obj/item/ammo_box/AM = A
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
if(give_round(AC))
AM.stored_ammo -= AC
num_loaded++
else
break
if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/AC = A
if(give_round(AC))
user.drop_item()
AC.loc = src
num_loaded++
if(num_loaded)
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
A.update_icon()
update_icon()
/obj/item/ammo_box/update_icon()
switch(multiple_sprites)
if(1)
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
if(2)
icon_state = "[initial(icon_state)]-[stored_ammo.len ? "[max_ammo]" : "0"]"
desc = "There are [stored_ammo.len] shell\s left!"
//Behavior for magazines
/obj/item/ammo_box/magazine/proc/ammo_count()
return stored_ammo.len