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.
This commit is contained in:
unknown
2015-02-04 17:56:43 -05:00
committed by mwerezak
parent c9eae483c6
commit 39b467c9da
41 changed files with 542 additions and 283 deletions

View File

@@ -161,6 +161,9 @@
del(src)
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
health -= Proj.damage
..()
if(health <= 0)

View File

@@ -5,6 +5,7 @@
layer = 2
var/state = 0
var/health = 200
var/cover = 50 //how much cover the girder provides against projectiles.
/obj/structure/girder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
@@ -14,19 +15,25 @@
return 1
/obj/structure/girder/bullet_act(var/obj/item/projectile/Proj)
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
return -1 //pass through
//Tasers and the like should not damage girders.
if(Proj.damage_type == HALLOSS || Proj.damage_type == TOX || Proj.damage_type == CLONE)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
if(istype(Proj, /obj/item/projectile/beam))
health -= Proj.damage
..()
if(health <= 0)
new /obj/item/stack/sheet/metal(get_turf(src))
del(src)
var/damage = Proj.damage
if(!istype(Proj, /obj/item/projectile/beam))
damage *= 0.4 //non beams do reduced damage
health -= damage
..()
if(health <= 0)
new /obj/item/stack/sheet/metal(get_turf(src))
del(src)
return
return
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench) && state == 0)
@@ -209,11 +216,13 @@
icon_state = "displaced"
anchored = 0
health = 50
cover = 25
/obj/structure/girder/reinforced
icon_state = "reinforced"
state = 2
health = 500
cover = 80
/obj/structure/cultgirder
icon= 'icons/obj/cult.dmi'
@@ -222,6 +231,7 @@
density = 1
layer = 2
var/health = 250
var/cover = 70
/obj/structure/cultgirder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
@@ -258,6 +268,14 @@
dismantle()
/obj/structure/cultgirder/bullet_act(var/obj/item/projectile/Proj) //No beam check- How else will you destroy the cult girder with silver bullets?????
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
return -1 //pass through
//Tasers and the like should not damage cultgirders.
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
health -= Proj.damage
..()
if(health <= 0)

View File

@@ -59,16 +59,33 @@
return !density
/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
if(!Proj) return
//Tasers and the like should not damage grilles.
if(Proj.damage_type == HALLOSS)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
src.health -= Proj.damage*0.2
healthcheck()
return 0
//Flimsy grilles aren't so great at stopping projectiles. However they can absorb some of the impact
var/damage = Proj.damage
var/passthrough
if(damage > 30)
passthrough = 1
if(prob(20))
Proj.damage *= 0.5 //weaken the projectile
else
//weaker bullets are affected to a greater extent
if(prob(20))
passthrough = 0
else
Proj.damage *= 0.5 //weaken the projectile
passthrough = 1
if(passthrough)
. = -1
damage *= 0.1 //if the bullet passes through then the grille avoids most of the damage
src.health -= damage*0.2
spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted
/obj/structure/grille/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(iswirecutter(W))

View File

@@ -38,6 +38,9 @@
return 0
/obj/structure/inflatable/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
health -= Proj.damage
..()
if(health <= 0)

View File

@@ -1,7 +1,7 @@
//wip wip wup
/obj/structure/mirror
name = "\improper SalonPro Nano-Mirror(TM)"
desc = "The leading technology in hair salon products, utilizing nano-machinery to style your hair just right."
name = "mirror"
desc = "A SalonPro Nano-Mirror(TM) brand mirror! The leading technology in hair salon products, utilizing nano-machinery to style your hair just right."
icon = 'icons/obj/watercloset.dmi'
icon_state = "mirror"
density = 0
@@ -70,6 +70,9 @@
/obj/structure/mirror/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
if(prob(Proj.damage * 2))
if(!shattered)
shatter()

View File

@@ -100,7 +100,7 @@
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
//Tasers and the like should not damage windows.
if(Proj.damage_type == HALLOSS)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
..()