Files
CHOMPStation2/code/modules/projectiles/ammunition.dm
unknown 39b467c9da New bullet types, projectile rewrite
* Refactors projectile Bump()
* Converts projectile_type var strings to paths
* Reorganizes bullet projectile paths
* Made a pass through all the bullet_act() definitions. Mainly ensured that damage_type is checked when dealing damage to certain objects. Removed stupid /turf bullet_act() override, replaced with on_hit() overrides on the relevant projectiles.

* Adds shotgun pellets projectile. Adds Raptor's shotgun slug sprite.
* Gives stunshots more of their own identity, refluffs them as taser cartridges for shotguns. They still aren't obtainable anywhere unless spawned.
* Makes projectiles pass through girders and cultgirders with a certain probability, unless the girder itself was clicked.
* Projectiles are also able to pass through grilles. Low damage projectiles have a chance to be blocked by grilles. High damage projectiles have a chance to have some damage absorbed by the grille.
* Makes projectiles for blanks invisible.
* Adds flash bullet types
* Adds support for 'penetrating' projectiles
* Swaps .45 and 9mm projectile types. .45s hit slightly harder, 9mils have more ammo capacity.
2015-02-06 20:09:32 -05:00

79 lines
2.3 KiB
Plaintext

/obj/item/ammo_casing
name = "bullet casing"
desc = "A bullet casing."
icon = 'icons/obj/ammo.dmi'
icon_state = "s-casing"
flags = CONDUCT
slot_flags = SLOT_BELT
throwforce = 1
w_class = 1.0
var/caliber = "" //Which kind of guns it can be loaded into
var/projectile_type //The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet
New()
..()
if(ispath(projectile_type))
BB = new projectile_type(src)
pixel_x = rand(-10.0, 10)
pixel_y = rand(-10.0, 10)
set_dir(pick(cardinal))
/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
if(BB)
if(initial(BB.name) == "bullet")
var/tmp_label = ""
var/label_text = sanitize(copytext(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), 1, MAX_NAME_LEN))
if(length(label_text) > 20)
user << "\red The inscription can be at most 20 characters long."
else
if(label_text == "")
user << "\blue You scratch the inscription off of [initial(BB)]."
BB.name = initial(BB.name)
else
user << "\blue You inscribe \"[label_text]\" into \the [initial(BB.name)]."
BB.name = "[initial(BB.name)] \"[label_text]\""
else
user << "\blue You can only inscribe a metal bullet." //because inscribing beanbags is silly
else
user << "\blue There is no bullet in the casing to inscribe anything into."
/obj/item/ammo_casing/examine(mob/user)
..()
if (!BB)
user << "This one is spent."
//Boxes of ammo
/obj/item/ammo_magazine
name = "ammo box (.357)"
desc = "A box of ammo"
icon_state = "357"
icon = 'icons/obj/ammo.dmi'
flags = CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
matter = list("metal" = 50000)
throwforce = 2
w_class = 2.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
New()
for(var/i = 1, i <= max_ammo, i++)
stored_ammo += new ammo_type(src)
update_icon()
update_icon()
if(multiple_sprites)
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
desc = "There are [stored_ammo.len] shell\s left!"