@@ -84,44 +84,68 @@ public override void ParseForInfo()
8484 weaponStatHandle . TryGetValue ( out UDataTable dataTable , "DataTable" ) &&
8585 dataTable . TryGetDataTableRow ( weaponRowName . Text , StringComparison . OrdinalIgnoreCase , out var weaponRowValue ) )
8686 {
87- if ( weaponRowValue . TryGetValue ( out int bpc , "BulletsPerCartridge" ) )
87+ weaponRowValue . TryGetValue ( out float dmgPb , "DmgPB" ) ; //Damage at point blank
88+ weaponRowValue . TryGetValue ( out float mdpc , "MaxDamagePerCartridge" ) ; //Max damage a weapon can do in a single hit, usually used for shotguns
89+ weaponRowValue . TryGetValue ( out float dmgCritical , "DamageZone_Critical" ) ; //Headshot multiplier
90+ weaponRowValue . TryGetValue ( out int clipSize , "ClipSize" ) ; //Item magazine size
91+ weaponRowValue . TryGetValue ( out float firingRate , "FiringRate" ) ; //Item firing rate, value is shots per second
92+ weaponRowValue . TryGetValue ( out float armTime , "ArmTime" ) ; //Time it takes for traps to be able to be set off
93+ weaponRowValue . TryGetValue ( out float reloadTime , "ReloadTime" ) ; //Time it takes for a weapon to reload
94+ weaponRowValue . TryGetValue ( out int bpc , "BulletsPerCartridge" ) ; //Amount of pellets shot by a weapon at once, usually for shotguns
95+ weaponRowValue . TryGetValue ( out float heatMax , "OverheatingMaxValue" ) ; //Maximum heat overheating weapons can hold before they need to cool off
96+ weaponRowValue . TryGetValue ( out float heatPerShot , "OverheatHeatingValue" ) ; //Heat generated per shot on overheat weapons
97+ weaponRowValue . TryGetValue ( out float overheatCooldown , "OverheatedCooldownDelay" ) ; //Cooldown after a weapon reaches its maximum heat capacity
8898 {
8999 var multiplier = bpc != 0f ? bpc : 1 ;
90- if ( weaponRowValue . TryGetValue ( out float dmgPb , "DmgPB" ) && dmgPb != 0f )
100+ if ( dmgPb != 0f )
91101 {
92- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "35D04D1B45737BEA25B69686D9E085B9" , "Damage" ) , dmgPb * multiplier , 200 ) ) ;
102+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "35D04D1B45737BEA25B69686D9E085B9" , "Damage" ) , dmgPb * multiplier , 160 ) ) ;
93103 }
94104
95- if ( weaponRowValue . TryGetValue ( out float mdpc , "MaxDamagePerCartridge" ) && mdpc >= 0f )
105+ if ( mdpc > 0f && dmgPb * dmgCritical * multiplier > mdpc )
96106 {
97- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "0DEF2455463B008C4499FEA03D149EDF" , "Headshot Damage" ) , mdpc , 200 ) ) ;
107+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "0DEF2455463B008C4499FEA03D149EDF" , "Headshot Damage" ) , mdpc , 160 ) ) ;
98108 }
99- else if ( weaponRowValue . TryGetValue ( out float dmgCritical , "DamageZone_Critical" ) )
109+
110+ else if ( dmgCritical != 0f && dmgCritical != 1f && dmgPb != 0f )
100111 {
101- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "0DEF2455463B008C4499FEA03D149EDF" , "Headshot Damage" ) , dmgPb * dmgCritical * multiplier , 200 ) ) ;
112+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "0DEF2455463B008C4499FEA03D149EDF" , "Headshot Damage" ) , dmgPb * dmgCritical * multiplier , 160 ) ) ;
102113 }
103114 }
115+ if ( clipSize > 999f || clipSize == 0f )
116+ {
117+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "068239DD4327B36124498C9C5F61C038" , "Magazine Size" ) , Utils . GetLocalizedResource ( "" , "0FAE8E5445029F2AA209ADB0FE49B23C" , "Infinite" ) , - 1 ) ) ;
118+ }
119+
120+ else if ( clipSize != 0f )
121+ {
122+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "068239DD4327B36124498C9C5F61C038" , "Magazine Size" ) , clipSize , 40 ) ) ;
123+ }
104124
105- if ( weaponRowValue . TryGetValue ( out int clipSize , "ClipSize" ) && clipSize != 0 )
125+ if ( firingRate != 0f )
106126 {
107- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "068239DD4327B36124498C9C5F61C038 " , "Magazine Size " ) , clipSize , 50 ) ) ;
127+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "27B80BA44805ABD5A2D2BAB2902B250C " , "Fire Rate " ) , firingRate , 11 ) ) ;
108128 }
109129
110- if ( weaponRowValue . TryGetValue ( out float firingRate , "FiringRate" ) && firingRate != 0f )
130+ if ( armTime != 0f )
111131 {
112- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "27B80BA44805ABD5A2D2BAB2902B250C " , "Fire Rate " ) , firingRate , 15 ) ) ;
132+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "3BFEB8BD41A677CC5F45B9A90D6EAD6F " , "Arming Delay " ) , armTime , 5 ) ) ;
113133 }
114134
115- if ( weaponRowValue . TryGetValue ( out float armTime , "ArmTime" ) && armTime != 0f )
135+ if ( reloadTime != 0f && clipSize < 999f && clipSize != 0f )
116136 {
117- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "3BFEB8BD41A677CC5F45B9A90D6EAD6F " , "Arming Delay " ) , armTime , 125 ) ) ;
137+ _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "6EA26D1A4252034FBD869A90F9A6E49A " , "Reload Time " ) , reloadTime , 10 ) ) ;
118138 }
119139
120- if ( weaponRowValue . TryGetValue ( out float reloadTime , "ReloadTime" ) && reloadTime ! = 0f )
140+ if ( overheatCooldown != 0f && clipSize > 999f || overheatCooldown != 0f && clipSize = = 0f )
121141 {
122- _statistics . Add ( new IconStat ( Utils . GetLocalizedResource ( "" , "6EA26D1A4252034FBD869A90F9A6E49A" , "Reload Time" ) , reloadTime , 15 ) ) ;
142+ _statistics . Add ( new IconStat ( "Overheat Cooldown" , overheatCooldown , 5 ) ) ;
123143 }
124144
145+ if ( heatMax != 0f && heatPerShot != 0f && clipSize > 999f || heatMax != 0f && heatPerShot != 0f && clipSize == 0f )
146+ {
147+ _statistics . Add ( new IconStat ( "Shots to Overheat" , Math . Ceiling ( heatMax / heatPerShot ) , 80 ) ) ;
148+ }
125149 if ( ( Object . ExportType . Equals ( "FortContextTrapItemDefinition" , StringComparison . OrdinalIgnoreCase ) ||
126150 Object . ExportType . Equals ( "FortTrapItemDefinition" , StringComparison . OrdinalIgnoreCase ) ) &&
127151 weaponRowValue . TryGetValue ( out UDataTable durabilityTable , "Durability" ) &&
@@ -285,6 +309,10 @@ public void Draw(SKCanvas c, SKColor sliderColor, int width, int height, ref flo
285309 _statPaint . Color = SKColors . White ;
286310 c . DrawText ( _value . ToString ( ) , new SKPoint ( width - 50 , y + 10 ) , _statPaint ) ;
287311
312+ if ( _maxValue == - 1 ) //fill bar if max value is set to -1, for things that don't return a number here but should still be represented as the maximum value
313+ {
314+ c . DrawRect ( new SKRect ( height * 2 , y , Math . Min ( width - height , sliderRight ) , y + 5 ) , _statPaint ) ;
315+ }
288316 if ( _maxValue < 1 || ! float . TryParse ( _value . ToString ( ) , out var floatValue ) ) return ;
289317 if ( floatValue < 0 )
290318 floatValue = 0 ;
0 commit comments