mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
Weapon Analysis Printing (#10343)
This commit is contained in:
@@ -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>"
|
||||
@@ -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>"
|
||||
@@ -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>"
|
||||
@@ -140,6 +140,9 @@
|
||||
/obj/machinery/weapons_analyzer/vueui_data_change(list/data, mob/user, datum/vueui/ui)
|
||||
if(!data)
|
||||
. = data = list()
|
||||
|
||||
data["has_inserted"] = item ? TRUE : FALSE
|
||||
|
||||
data["name"] = ""
|
||||
data["item"] = FALSE
|
||||
data["energy"] = FALSE
|
||||
@@ -177,7 +180,7 @@
|
||||
|
||||
if(istype(gun, /obj/item/gun/energy))
|
||||
var/obj/item/gun/energy/E = gun
|
||||
var/obj/item/projectile/P = E.projectile_type
|
||||
var/obj/item/projectile/P = new E.projectile_type
|
||||
data["max_shots"] = initial(E.max_shots)
|
||||
data["recharge"] = initial(E.self_recharge) ? "self recharging" : "not self recharging"
|
||||
data["recharge_time"] = initial(E.recharge_time)
|
||||
@@ -185,7 +188,11 @@
|
||||
data["damage_type"] = initial(P.damage_type)
|
||||
data["check_armor"] = initial(P.check_armor)
|
||||
data["stun"] = initial(P.stun) ? "stuns" : "does not stun"
|
||||
data["shrapnel_type"] = initial(P.shrapnel_type) ? initial(P.shrapnel_type) : "none"
|
||||
if(P.shrapnel_type)
|
||||
var/obj/item/S = new P.shrapnel_type
|
||||
data["shrapnel_type"] = S.name
|
||||
else
|
||||
data["shrapnel_type"] = "none"
|
||||
data["armor_penetration"] = initial(P.armor_penetration)
|
||||
|
||||
if(istype(gun, /obj/item/gun/energy/laser/prototype))
|
||||
@@ -212,14 +219,18 @@
|
||||
|
||||
else
|
||||
var/obj/item/gun/projectile/P_gun = gun
|
||||
var/obj/item/ammo_casing/casing = P_gun.ammo_type
|
||||
var/obj/item/projectile/P = casing.projectile_type
|
||||
var/obj/item/ammo_casing/casing = new P_gun.ammo_type
|
||||
var/obj/item/projectile/P = new casing.projectile_type
|
||||
data["max_shots"] = P_gun.max_shells
|
||||
data["damage"] = initial(P.damage)
|
||||
data["damage_type"] = initial(P.damage_type)
|
||||
data["check_armor"] = initial(P.check_armor)
|
||||
data["stun"] = initial(P.stun) ? "stuns" : "does not stun"
|
||||
data["shrapnel_type"] = initial(P.shrapnel_type) ? initial(P.shrapnel_type) : "none"
|
||||
if(P.shrapnel_type)
|
||||
var/obj/item/S = new P.shrapnel_type
|
||||
data["shrapnel_type"] = S.name
|
||||
else
|
||||
data["shrapnel_type"] = "none"
|
||||
data["burst"] = gun.burst
|
||||
data["reliability"] = gun.reliability
|
||||
|
||||
@@ -252,9 +263,28 @@
|
||||
if (!ui)
|
||||
ui = new(user, src, "wanalyzer-analyzer", width, height, capitalize(name))
|
||||
|
||||
var/icon/Icon_used
|
||||
if(item)
|
||||
Icon_used = new /icon(item.icon, item.icon_state)
|
||||
ui.add_asset("icon", Icon_used)
|
||||
ui.send_asset("icon")
|
||||
ui.open()
|
||||
var/icon/Icon_used = new /icon(item.icon, item.icon_state)
|
||||
ui.add_asset("icon", Icon_used)
|
||||
ui.send_asset("icon")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/weapons_analyzer/Topic(href, href_list, datum/topic_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(href_list["print"] && item)
|
||||
do_print()
|
||||
|
||||
/obj/machinery/weapons_analyzer/proc/do_print()
|
||||
var/obj/item/paper/R = new /obj/item/paper(get_turf(src))
|
||||
R.color = "#fef8ff"
|
||||
R.set_content_unsafe("Weapon Analysis ([item.name])", get_print_info(item))
|
||||
print(R, message = "\The [src] beeps, printing \the [R] after a moment.")
|
||||
|
||||
/obj/machinery/weapons_analyzer/proc/get_print_info(var/obj/item/device)
|
||||
var/dat = "<span class='notice'><b>Analysis performed at [worldtime2text()]</b></span><br>"
|
||||
dat += "<span class='notice'><b>Analyzer Item: [device.name]</b></span><br><br>"
|
||||
dat += device.get_print_info()
|
||||
return dat
|
||||
Reference in New Issue
Block a user