mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
The big ammo simplification (#8171)
This commit is contained in:
@@ -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