mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
The big ammo simplification (#8171)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
//Created the autolathe entries here to keep stuff organized and also compact so the files aren't too spread out.
|
||||
/* Begone fops of the past! Your ballistics are now cringe
|
||||
/datum/category_item/autolathe/arms/smg_mp5
|
||||
name = "mp5 magazine(9x19mm standard)"
|
||||
path = /obj/item/ammo_magazine/mp5mag
|
||||
@@ -370,4 +371,4 @@
|
||||
name = ".45 LC"
|
||||
path = /obj/item/ammo_casing/a45lc
|
||||
hidden = 1
|
||||
|
||||
*/
|
||||
|
||||
@@ -124,4 +124,4 @@
|
||||
if(ammo_magazine)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-empty"
|
||||
icon_state = "[initial(icon_state)]-empty"
|
||||
|
||||
@@ -1217,7 +1217,7 @@
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
|
||||
..()
|
||||
if(ammo_magazine)
|
||||
icon_state = "c20r-[round(ammo_magazine.stored_ammo.len,4)]"
|
||||
icon_state = "c20r-[round(CLAMP(ammo_magazine.stored_ammo.len*2/3,0,20),4)]"
|
||||
else
|
||||
icon_state = "c20r"
|
||||
return
|
||||
@@ -1278,7 +1278,7 @@
|
||||
/obj/item/weapon/gun/projectile/automatic/z8/update_icon()
|
||||
..()
|
||||
if(ammo_magazine)
|
||||
icon_state = "carbine-[round(ammo_magazine.stored_ammo.len,2)]"
|
||||
icon_state = "carbine-[round(CLAMP(ammo_magazine.stored_ammo.len/2,0,10),2)]"
|
||||
else
|
||||
icon_state = "carbine-e"
|
||||
return
|
||||
|
||||
@@ -273,7 +273,9 @@
|
||||
if(!(load_method & AM.mag_type) || caliber != AM.caliber || allowed_magazines && !is_type_in_list(A, allowed_magazines))
|
||||
to_chat(user, "<span class='warning'>[AM] won't load into [src]!</span>")
|
||||
return
|
||||
switch(AM.mag_type)
|
||||
var/loading_method = AM.mag_type & load_method
|
||||
if(loading_method == (MAGAZINE & SPEEDLOADER)) loading_method = MAGAZINE //Default to magazine if both are valid
|
||||
switch(loading_method)
|
||||
if(MAGAZINE)
|
||||
if(ammo_magazine)
|
||||
to_chat(user, "<span class='warning'>[src] already has a magazine loaded.</span>") //already a magazine here
|
||||
|
||||
Reference in New Issue
Block a user