Weapon Analysis Printing (#10343)

This commit is contained in:
Geeves
2021-02-01 10:22:01 +01:00
committed by GitHub
parent 0e01772360
commit cc50f53ecf
11 changed files with 228 additions and 76 deletions
+6
View File
@@ -959,3 +959,9 @@
else
maptext_x = 22
maptext = "<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 7px;\">[ammo]</span>"
/obj/item/gun/get_print_info(var/no_clear = TRUE)
if(no_clear)
. = ""
. += "Burst: [burst]<br>"
. += "Reliability: [reliability]<br>"
+18
View File
@@ -170,3 +170,21 @@
if(!power_supply)
return 0
return round(power_supply.charge / charge_cost)
/obj/item/gun/energy/get_print_info()
. = ""
. += "Max Shots: [initial(max_shots)]<br>"
. += "Recharge Type: [initial(self_recharge) ? "self recharging" : "not self recharging"]<br>"
if(initial(self_recharge))
. += "Recharge Time: [initial(recharge_time)]<br>"
. += "<br><b>Primary Projectile</b><br>"
var/obj/item/projectile/P = new projectile_type
. += P.get_print_info()
if(secondary_projectile_type)
. += "<br><b>Secondary Projectile</b><br>"
var/obj/item/projectile/P_second = new secondary_projectile_type
. += P_second.get_print_info()
. += "<br>"
. += ..(FALSE)
@@ -325,3 +325,19 @@
to_chat(M, "You describe the gun as [input]. Say hello to your new friend.")
described = 1
return 1
/obj/item/gun/energy/laser/prototype/get_print_info()
. = ..(FALSE)
for(var/i in list(capacitor, focusing_lens, modulator) + gun_mods)
var/obj/item/laser_components/l_component = i
. += "<br>Component Name: [initial(l_component.name)]</br><br>"
var/l_repair_name = initial(l_component.repair_item.name) ? initial(l_component.repair_item.name) : "nothing"
. += "Reliability: [initial(l_component.reliability)]<br>"
. += "Damage Modifier: [initial(l_component.damage)]<br>"
. += "Fire Delay Modifier: [initial(l_component.fire_delay)]<br>"
. += "Shots Modifier: [initial(l_component.fire_delay)]<br>"
. += "Burst Modifier: [initial(l_component.burst)]<br>"
. += "Accuracy Modifier: [initial(l_component.accuracy)]<br>"
. += "Repair Tool: [l_repair_name]<br>"
@@ -268,3 +268,26 @@
if(chambered)
bullets += 1
return bullets
/obj/item/gun/projectile/get_print_info()
. = ""
if(load_method & (SINGLE_CASING|SPEEDLOADER))
. += "Load Type: Single Casing or Speedloader<br>"
. += "Max Shots: [max_shells]<br>"
if(length(loaded))
var/obj/item/ammo_casing/casing = loaded[1]
var/obj/item/projectile/P = new casing.projectile_type
. += "<br><b>Projectile</b><br>"
. += P.get_print_info()
else
. += "No ammunition loaded.<br>"
else
. += "Load Type: Magazine<br>"
if(ammo_magazine)
var/obj/item/ammo_casing/casing = new ammo_magazine.ammo_type
var/obj/item/projectile/P = new casing.projectile_type
. += "<br><b>Projectile</b><br>"
. += P.get_print_info()
else
. += "No magazine inserted.<br>"
. += ..(FALSE)
@@ -251,3 +251,20 @@
capacitor = null
qdel(src)
return TRUE
/obj/item/device/laser_assembly/get_print_info()
. = ""
for(var/i in list(capacitor, focusing_lens, modulator) + gun_mods)
var/obj/item/laser_components/l_component = i
if(!l_component)
continue
. += "<br>Component Name: [initial(l_component.name)]</br><br>"
var/l_repair_name = initial(l_component.repair_item.name) ? initial(l_component.repair_item.name) : "nothing"
. += "Reliability: [initial(l_component.reliability)]<br>"
. += "Damage Modifier: [initial(l_component.damage)]<br>"
. += "Fire Delay Modifier: [initial(l_component.fire_delay)]<br>"
. += "Shots Modifier: [initial(l_component.fire_delay)]<br>"
. += "Burst Modifier: [initial(l_component.burst)]<br>"
. += "Accuracy Modifier: [initial(l_component.accuracy)]<br>"
. += "Repair Tool: [l_repair_name]<br>"
+11
View File
@@ -613,3 +613,14 @@
qdel(i)
beam_segments = null
QDEL_NULL(beam_index)
/obj/item/projectile/get_print_info()
. = "<br>"
. += "Damage: [initial(damage)]<br>"
. += "Damage Type: [initial(damage_type)]<br>"
. += "Blocked by Armor Type: [initial(check_armor)]<br>"
. += "Stuns: [initial(stun) ? "true" : "false"]<br>"
if(initial(shrapnel_type))
var/obj/shrapnel = new shrapnel_type
. += "Shrapnel Type: [shrapnel.name]<br>"
. += "Armor Penetration: [initial(armor_penetration)]%<br>"