mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 22:18:27 +01:00
Add 'as anything' to various for loops
This commit is contained in:
@@ -31,20 +31,19 @@
|
||||
|
||||
if(do_after(user, 5 SECONDS))
|
||||
to_chat(user, "<span class='notice'>\The [src] can possibly be restored with:</span>")
|
||||
for(var/resource in material_needs)
|
||||
var/obj/item/res = resource
|
||||
if(material_needs[resource] > 0)
|
||||
for(var/obj/item/res as anything in material_needs)
|
||||
if(material_needs[res] > 0)
|
||||
var/res_name = ""
|
||||
if(ispath(res,/obj/item/stack/material))
|
||||
var/obj/item/stack/material/mat_stack = res
|
||||
var/datum/material/mat = get_material_by_name("[initial(mat_stack.default_type)]")
|
||||
if(material_needs[resource]>1)
|
||||
if(material_needs[res]>1)
|
||||
res_name = "[mat.use_name] [mat.sheet_plural_name]"
|
||||
else
|
||||
res_name = "[mat.use_name] [mat.sheet_singular_name]"
|
||||
else
|
||||
res_name = initial(res.name)
|
||||
to_chat(user, "<span class='notice'>- x [material_needs[resource]] [res_name]</span>")
|
||||
to_chat(user, "<span class='notice'>- x [material_needs[res]] [res_name]</span>")
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/setup_gun(var/obj/item/weapon/gun/path)
|
||||
if(ispath(path))
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
if(batt.shots_left)
|
||||
return new chambered.projectile_type()
|
||||
else
|
||||
for(var/B in ammo_magazine.stored_ammo)
|
||||
var/obj/item/ammo_casing/microbattery/other_batt = B
|
||||
for(var/obj/item/ammo_casing/microbattery/other_batt as anything in ammo_magazine.stored_ammo)
|
||||
if(istype(other_batt,chambered.type) && other_batt.shots_left)
|
||||
switch_to(other_batt)
|
||||
return new chambered.projectile_type()
|
||||
@@ -53,8 +52,7 @@
|
||||
charge_left = batt.shots_left
|
||||
max_charge = initial(batt.shots_left)
|
||||
if(ammo_magazine) //Crawl to find more
|
||||
for(var/B in ammo_magazine.stored_ammo)
|
||||
var/obj/item/ammo_casing/microbattery/bullet = B
|
||||
for(var/obj/item/ammo_casing/microbattery/bullet as anything in ammo_magazine.stored_ammo)
|
||||
if(istype(bullet,batt.type))
|
||||
charge_left += bullet.shots_left
|
||||
max_charge += initial(bullet.shots_left)
|
||||
@@ -178,8 +176,7 @@
|
||||
return //Why bother
|
||||
|
||||
var/current = 0
|
||||
for(var/B in stored_ammo)
|
||||
var/obj/item/ammo_casing/microbattery/batt = B
|
||||
for(var/obj/item/ammo_casing/microbattery/batt as anything in stored_ammo)
|
||||
var/image/cap = image(icon, icon_state = "[capname]_cap")
|
||||
cap.color = batt.type_color
|
||||
cap.pixel_x = current * x_offset //Caps don't need a pixel_y offset
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
. = ..()
|
||||
if(Adjacent(user) && max_mod_capacity)
|
||||
. += "<b>[get_remaining_mod_capacity()]%</b> mod capacity remaining."
|
||||
for(var/A in get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
for(var/obj/item/borg/upgrade/modkit/M as anything in get_modkits())
|
||||
. += "<span class='notice'>There is a [M.name] mod installed, using <b>[M.cost]%</b> capacity.</span>"
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/attackby(obj/item/A, mob/user)
|
||||
@@ -46,8 +45,7 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/get_remaining_mod_capacity()
|
||||
var/current_capacity_used = 0
|
||||
for(var/A in get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
for(var/obj/item/borg/upgrade/modkit/M as anything in get_modkits())
|
||||
current_capacity_used += M.cost
|
||||
return max_mod_capacity - current_capacity_used
|
||||
|
||||
@@ -57,8 +55,7 @@
|
||||
. += A
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/modify_projectile(obj/item/projectile/kinetic/K)
|
||||
for(var/A in get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
for(var/obj/item/borg/upgrade/modkit/M as anything in get_modkits())
|
||||
M.modify_projectile(K)
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/consume_next_projectile()
|
||||
@@ -185,8 +182,7 @@
|
||||
. = TRUE
|
||||
if(denied_type)
|
||||
var/number_of_denied = 0
|
||||
for(var/A in KA.get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
for(var/obj/item/borg/upgrade/modkit/M as anything in KA.get_modkits())
|
||||
if(istype(M, denied_type))
|
||||
number_of_denied++
|
||||
if(number_of_denied >= maximum_of_type)
|
||||
|
||||
Reference in New Issue
Block a user