Merge branch 'master' into master

This commit is contained in:
Izac Joof Forsgren
2020-08-10 23:15:30 +02:00
committed by GitHub
214 changed files with 7027 additions and 3702 deletions

View File

@@ -29,8 +29,8 @@
set_dir(pick(cardinal)) //spin spent casings
update_icon()
/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(W.is_screwdriver())
/obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob)
if(I.is_screwdriver())
if(!BB)
to_chat(user, "<font color='blue'>There is no bullet in the casing to inscribe anything into.</font>")
return
@@ -45,6 +45,39 @@
else
to_chat(user, "<font color='blue'>You inscribe \"[label_text]\" into \the [initial(BB.name)].</font>")
BB.name = "[initial(BB.name)] (\"[label_text]\")"
else if(istype(I, /obj/item/ammo_magazine) && isturf(loc)) // Mass magazine reloading.
var/obj/item/ammo_magazine/box = I
if (!box.can_remove_ammo || box.reloading)
return ..()
box.reloading = TRUE
var/boolets = 0
var/turf/floor = loc
for(var/obj/item/ammo_casing/bullet in floor)
if(box.stored_ammo.len >= box.max_ammo)
break
if(box.caliber == bullet.caliber && bullet.BB)
if (boolets < 1)
to_chat(user, "<span class='notice'>You start collecting shells.</span>") // Say it here so it doesn't get said if we don't find anything useful.
if(do_after(user,5,box))
if(box.stored_ammo.len >= box.max_ammo) // Double check because these can change during the wait.
break
if(bullet.loc != floor)
continue
bullet.forceMove(box)
box.stored_ammo.Add(bullet)
box.update_icon()
boolets++
else
break
if(boolets > 0)
to_chat(user, "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>")
else
to_chat(user, "<span class='warning'>You fail to collect anything!</span>")
box.reloading = FALSE
else
return ..()
/obj/item/ammo_casing/update_icon()
if(!BB)
@@ -84,6 +117,7 @@
var/initial_ammo = null
var/can_remove_ammo = TRUE // Can this thing have bullets removed one-by-one? As of first implementation, only affects smart magazines
var/reloading = FALSE // Is this magazine being reloaded, currently? - Currently only useful for automatic pickups, ignored by manual reloading.
var/multiple_sprites = 0
//because BYOND doesn't support numbers as keys in associative lists
@@ -115,7 +149,7 @@
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
user.remove_from_mob(C)
C.loc = src
C.forceMove(src)
stored_ammo.Add(C)
update_icon()
if(istype(W, /obj/item/ammo_magazine/clip))
@@ -131,7 +165,7 @@
return
var/obj/item/ammo_casing/AC = L.stored_ammo[1] //select the next casing.
L.stored_ammo -= AC //Remove this casing from loaded list of the clip.
AC.loc = src
AC.forceMove(src)
stored_ammo.Insert(1, AC) //add it to the head of our magazine's list
L.update_icon()
playsound(src, 'sound/weapons/flipblade.ogg', 50, 1)

View File

@@ -88,6 +88,10 @@
name = "magazine (.45 AP)"
ammo_type = /obj/item/ammo_casing/a45/ap
/obj/item/ammo_magazine/m45/hp
name = "magazine (.45 HP)"
ammo_type = /obj/item/ammo_casing/a45/hp
/obj/item/ammo_magazine/box/emp/b45
name = "ammunition box (.45 haywire)"
ammo_type = /obj/item/ammo_casing/a45/emp
@@ -293,6 +297,11 @@
name = "top mounted magazine (9mm practice)"
ammo_type = /obj/item/ammo_casing/a9mm/practice
/obj/item/ammo_magazine/m9mmt/ap
name = "top mounted magazine (9mm armor piercing)"
ammo_type = /obj/item/ammo_casing/a9mm/ap
matter = list(DEFAULT_WALL_MATERIAL = 1000, MAT_PLASTEEL = 2000)
/obj/item/ammo_magazine/m9mmp90
name = "large capacity top mounted magazine (9mm armor-piercing)"
icon_state = "p90"

View File

@@ -131,6 +131,7 @@
desc = "A .45 Armor-Piercing bullet casing."
icon_state = "r-casing"
projectile_type = /obj/item/projectile/bullet/pistol/medium/ap
matter = list(DEFAULT_WALL_MATERIAL = 50, MAT_PLASTEEL = 25)
/obj/item/ammo_casing/a45/practice
desc = "A .45 practice bullet casing."
@@ -160,6 +161,7 @@
/obj/item/ammo_casing/a45/hp
desc = "A .45 hollow-point bullet casing."
projectile_type = /obj/item/projectile/bullet/pistol/medium/hp
matter = list(DEFAULT_WALL_MATERIAL = 60, MAT_PLASTIC = 15)
/*
* 10mm
@@ -246,6 +248,14 @@
// projectile_type = /obj/item/projectile/bullet/shotgun/ion
matter = list(DEFAULT_WALL_MATERIAL = 360, "uranium" = 240)
/obj/item/ammo_casing/a12g/flechette
name = "shotgun flechette"
desc = "A 12 gauge flechette cartidge, also known as nailshot."
icon_state = "slshell"
caliber = "12g"
projectile_type = /obj/item/projectile/scatter/flechette
matter = list(DEFAULT_WALL_MATERIAL = 360, MAT_PLASTEEL = 100)
/*
* 7.62mm
*/

View File

@@ -27,6 +27,10 @@
/obj/item/projectile/bullet/pellet/shotgun/flak = 3
)
/*
* Energy
*/
/obj/item/projectile/scatter/laser
damage = 40
@@ -61,6 +65,12 @@
/obj/item/projectile/bullet/shotgun/ion = 3
)
/*
* Flame
*/
/obj/item/projectile/scatter/flamethrower
damage = 5
submunition_spread_max = 100
@@ -70,3 +80,19 @@
submunitions = list(
/obj/item/projectile/bullet/incendiary/flamethrower/tiny = 7
)
/*
* Ballistic
*/
/obj/item/projectile/scatter/flechette
damage = 60
submunition_spread_max = 40
submunition_spread_min = 10
submunitions = list(
/obj/item/projectile/bullet/magnetic/flechette/small = 4
)