mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Weapon Analysis Printing (#10343)
This commit is contained in:
@@ -846,3 +846,13 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
|
||||
/obj/item/proc/extinguish_fire()
|
||||
return
|
||||
|
||||
/obj/item/proc/get_print_info(var/no_clear = TRUE)
|
||||
if(no_clear)
|
||||
. = ""
|
||||
. += "Damage: [force]<br>"
|
||||
. += "Damage Type: [damtype]<br>"
|
||||
. += "Sharp: [sharp ? "yes" : "no"]<br>"
|
||||
. += "Dismemberment: [edge ? "likely to dismember" : "unlikely to dismember"]<br>"
|
||||
. += "Penetration: [armor_penetration]<br>"
|
||||
. += "Throw Force: [throwforce]<br>"
|
||||
|
||||
@@ -122,6 +122,15 @@
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
|
||||
/obj/item/melee/energy/get_print_info()
|
||||
. = ..()
|
||||
. += "Active Damage: [active_force]<br>"
|
||||
. += "Active Throw Force: [active_throwforce]<br>"
|
||||
. += "Blocks Bullets: [can_block_bullets ? "true" : "false"]<br>"
|
||||
. += "Block Chance: [base_block_chance]<br>"
|
||||
. += "Projectile Reflection Chance: [base_reflectchance]<br>"
|
||||
. += "Shield Rating: [shield_power]<br>"
|
||||
|
||||
/obj/item/melee/energy/glaive
|
||||
name = "energy glaive"
|
||||
desc = "An energized glaive."
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Geeves
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Weapon Analyzers can now print reports about their inserted items via a button at the bottom of the UI."
|
||||
@@ -1,72 +1,78 @@
|
||||
<template>
|
||||
<div>
|
||||
<b>Analyzing {{name}} </b><br>
|
||||
<div v-if="$root.$data.assets['icon']">
|
||||
<vui-img name="icon"/>
|
||||
<div v-if="has_inserted">
|
||||
<b>Analyzing {{name}} </b><br>
|
||||
<div v-if="$root.$data.assets['icon']">
|
||||
<vui-img name="icon"/>
|
||||
</div>
|
||||
<div v-if="item == 1">
|
||||
<table class="other">
|
||||
<tr><td> Damage type: </td> <td class = "right"> {{damage_type}} </td> </tr>
|
||||
<tr><td> Item's estimated force-rating: </td> <td class = "right"> {{force}} points</td> </tr>
|
||||
<tr><td> Item's estimated throw force-rating: </td> <td class = "right"> {{throw_force}} points </td> </tr>
|
||||
<template class="active_energy" v-if="energy == 1">
|
||||
<tr> <td> Item's estimated force-rating when activated: </td> <td class = "right"> {{active_force}} points </td> </tr>
|
||||
<tr> <td> Item's estimated throw force-rating when activated: </td> <td class = "right"> {{active_throw_force}} points</td> </tr>
|
||||
<tr> <td> Base block chance is: </td> <td class = "right"> {{base_block_chance}}% </td> </tr>
|
||||
<tr> <td> Base reflect chance is: </td> <td class = "right"> {{base_reflectchance}}% </td> </tr>
|
||||
<tr> <td> Item's estimated shield rating: </td> <td class = "right"> {{shield_power}} points</td> </tr>
|
||||
<tr> <td> Can block bullets: </td> <td class = "right"> {{can_block}} </td> </tr>
|
||||
</template>
|
||||
<tr> <td> Is sharp:</td> <td class = "right"> {{sharp}} </td> </tr>
|
||||
<tr> <td> Chance to dismember: </td> <td class = "right"> {{edge}} </td> </tr>
|
||||
<tr> <td> Item's estimated armor penetration rating: </td> <td class = "right"> {{penetration}} points</td> </tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="active_energy" v-if="gun == 1">
|
||||
<table class="other">
|
||||
<tr><td> Maximum shots: </td> <td class = "right"> {{max_shots}} </td> </tr>
|
||||
<tr><td> Burst: </td> <td class = "right"> {{burst}} </td> </tr>
|
||||
<tr><td> Self recharge: </td> <td class = "right"> {{recharge}} </td> </tr>
|
||||
<tr><td> Recharge time: </td> <td class = "right"> {{recharge_time}} </td> </tr>
|
||||
<tr><td> Reliability: </td> <td class = "right"> {{reliability}} </td> </tr>
|
||||
<br><b>First projectile information: </b><br>
|
||||
<tr><td> Projectile's estimated damage rating: </td> <td class = "right"> {{damage}} points</td> </tr>
|
||||
<tr><td> Projectile's Damage type: </td> <td class = "right"> {{damage_type}} </td> </tr>
|
||||
<tr><td> Projectile's estimated armor penetration rating: </td> <td class = "right"> {{armor_penetration}} points</td> </tr>
|
||||
<tr><td> Projectile's armor damage type: </td> <td class = "right"> {{check_armor}} </td> </tr>
|
||||
<tr><td> Projectile's shrapnel type: </td> <td class = "right"> {{shrapnel_type}} </td> </tr>
|
||||
<tr><td> Stun: </td> <td class = "right"> {{stun}} </td> </tr>
|
||||
<template class="active_energy" v-if="secondary_damage">
|
||||
<br><b>Second projectile information: </b><br>
|
||||
<tr><td> Projectile's estimated damage rating: </td> <td class = "right"> {{secondary_damage}} points</td> </tr>
|
||||
<tr><td> Projectile's damage type: </td> <td class = "right"> {{secondary_damage_type}} </td> </tr>
|
||||
<tr><td> Projectile's estimated armor penetration rating: </td> <td class = "right"> {{secondary_armor_penetration}} points</td> </tr>
|
||||
<tr><td> Projectile's armor damage type: </td> <td class = "right"> {{secondary_check_armor}} </td> </tr>
|
||||
<tr><td> Projectile's shrapnel type: </td> <td class = "right"> {{secondary_shrapnel_type}} </td> </tr>
|
||||
<tr><td> Stun: </td> <td class = "right"> {{secondary_stun}} </td> </tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<div v-if="gun_mods">
|
||||
<br><b>Modular gun information: </b><br>
|
||||
<table class="modular">
|
||||
<tr>
|
||||
<th> Name </th>
|
||||
<th> Reliability </th>
|
||||
<th> Damage modifier </th>
|
||||
<th> Fire delay modifier </th>
|
||||
<th> Number of shots modifier </th>
|
||||
<th> Burst modifier </th>
|
||||
<th> Accuracy modifier </th>
|
||||
<th> Repair tool </th>
|
||||
</tr>
|
||||
<tr v-for="(mod_info, mod_index) in gun_mods" :key="mod_index">
|
||||
<td>{{mod_index}}</td>
|
||||
<td v-for="(info, index) in mod_info" :key="index">
|
||||
{{mod_info[index]}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<vui-button :params="{ print: 1 }">Print Analysis</vui-button>
|
||||
</div>
|
||||
<div v-if="item == 1">
|
||||
<table class="other">
|
||||
<tr><td> Damage type: </td> <td class = "right"> {{damage_type}} </td> </tr>
|
||||
<tr><td> Item's estimated force-rating: </td> <td class = "right"> {{force}} points</td> </tr>
|
||||
<tr><td> Item's estimated throw force-rating: </td> <td class = "right"> {{throw_force}} points </td> </tr>
|
||||
<template class="active_energy" v-if="energy == 1">
|
||||
<tr> <td> Item's estimated force-rating when activated: </td> <td class = "right"> {{active_force}} points </td> </tr>
|
||||
<tr> <td> Item's estimated throw force-rating when activated: </td> <td class = "right"> {{active_throw_force}} points</td> </tr>
|
||||
<tr> <td> Base block chance is: </td> <td class = "right"> {{base_block_chance}}% </td> </tr>
|
||||
<tr> <td> Base reflect chance is: </td> <td class = "right"> {{base_reflectchance}}% </td> </tr>
|
||||
<tr> <td> Item's estimated shield rating: </td> <td class = "right"> {{shield_power}} points</td> </tr>
|
||||
<tr> <td> Can block bullets: </td> <td class = "right"> {{can_block}} </td> </tr>
|
||||
</template>
|
||||
<tr> <td> Is sharp:</td> <td class = "right"> {{sharp}} </td> </tr>
|
||||
<tr> <td> Chance to dismember: </td> <td class = "right"> {{edge}} </td> </tr>
|
||||
<tr> <td> Item's estimated armor penetration rating: </td> <td class = "right"> {{penetration}} points</td> </tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="active_energy" v-if="gun == 1">
|
||||
<table class="other">
|
||||
<tr><td> Maximum shots: </td> <td class = "right"> {{max_shots}} </td> </tr>
|
||||
<tr><td> Burst: </td> <td class = "right"> {{burst}} </td> </tr>
|
||||
<tr><td> Self recharge: </td> <td class = "right"> {{recharge}} </td> </tr>
|
||||
<tr><td> Recharge time: </td> <td class = "right"> {{recharge_time}} </td> </tr>
|
||||
<tr><td> Reliability: </td> <td class = "right"> {{reliability}} </td> </tr>
|
||||
<br><b>First projectile information: </b><br>
|
||||
<tr><td> Projectile's estimated damage rating: </td> <td class = "right"> {{damage}} points</td> </tr>
|
||||
<tr><td> Projectile's Damage type: </td> <td class = "right"> {{damage_type}} </td> </tr>
|
||||
<tr><td> Projectile's estimated armor penetration rating: </td> <td class = "right"> {{armor_penetration}} points</td> </tr>
|
||||
<tr><td> Projectile's armor damage type: </td> <td class = "right"> {{check_armor}} </td> </tr>
|
||||
<tr><td> Projectile's shrapnel type: </td> <td class = "right"> {{shrapnel_type}} </td> </tr>
|
||||
<tr><td> Stun: </td> <td class = "right"> {{stun}} </td> </tr>
|
||||
<template class="active_energy" v-if="secondary_damage">
|
||||
<br><b>Second projectile information: </b><br>
|
||||
<tr><td> Projectile's estimated damage rating: </td> <td class = "right"> {{secondary_damage}} points</td> </tr>
|
||||
<tr><td> Projectile's damage type: </td> <td class = "right"> {{secondary_damage_type}} </td> </tr>
|
||||
<tr><td> Projectile's estimated armor penetration rating: </td> <td class = "right"> {{secondary_armor_penetration}} points</td> </tr>
|
||||
<tr><td> Projectile's armor damage type: </td> <td class = "right"> {{secondary_check_armor}} </td> </tr>
|
||||
<tr><td> Projectile's shrapnel type: </td> <td class = "right"> {{secondary_shrapnel_type}} </td> </tr>
|
||||
<tr><td> Stun: </td> <td class = "right"> {{secondary_stun}} </td> </tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<div v-if="gun_mods">
|
||||
<br><b>Modular gun information: </b><br>
|
||||
<table class="modular">
|
||||
<tr>
|
||||
<th> Name </th>
|
||||
<th> Reliability </th>
|
||||
<th> Damage modifier </th>
|
||||
<th> Fire delay modifier </th>
|
||||
<th> Number of shots modifier </th>
|
||||
<th> Burst modifier </th>
|
||||
<th> Accuracy modifier </th>
|
||||
<th> Repair tool </th>
|
||||
</tr>
|
||||
<tr v-for="(mod_info, mod_index) in gun_mods" :key="mod_index">
|
||||
<td>{{mod_index}}</td>
|
||||
<td v-for="(info, index) in mod_info" :key="index">
|
||||
{{mod_info[index]}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div v-else>
|
||||
<b>No item inserted, analysis unit inactive.</b>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user