Skip to content

Commit

Permalink
fix: acount for avg shield damage modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jul 5, 2024
1 parent 20f437d commit 89ce56a
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .vscode/enverant.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// Define path to Freelancer Folder root
// "FREELANCER_FOLDER": "${env:HOME}/windows10shared/fl-files-discovery"
"FREELANCER_FOLDER": "${env:HOME}/windows10shared/fl-files-vanilla",
"FREELANCER_FOLDER": "${env:HOME}/windows10shared/fl-files-discovery",
// "FREELANCER_FOLDER": "${env:HOME}/windows10shared/fl-files-vanilla",
"DEV_ENV": "true",
"DARKSTAT_LOG_LEVEL": "DEBUG",
"UTILS_LOG_LEVEL": "DEBUG",
Expand Down
26 changes: 21 additions & 5 deletions darkstat/front/guns.templ
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ templ GunTable(guns []configs_export.Gun, mode GunTabMode, pinm PinMod, disco fr
<th style="width:5px;">Price</th>
<th style="width:5px;">Buyable</th>
<th style="width:5px;">Hull Dmg</th>
<th style="width:5px;">Shield Dmg</th>
<th style="width:5px;">
@Tooltip("(Hull Dmg * HullDmgFactor + Energy Dmg) * Avg Shield Dmg Modifier") {
@MultiLinestring([]string{"Avg", "Shield", "Dmg"})
}
</th>
<th style="width:5px;">Power Usage</th>
<th style="width:5px;">Refire</th>
if mode == GunsMissiles {
Expand All @@ -65,7 +69,9 @@ templ GunTable(guns []configs_export.Gun, mode GunTabMode, pinm PinMod, disco fr
</th>
}
<th style="width:5px;">Hull Dmg/s</th>
<th style="width:5px;">Sheld Dmg/s</th>
<th style="width:5px;">
@MultiLinestring([]string{"Avg", "Sheld", "Dmg/s"})
</th>
<th style="width:5px;">Power/s</th>
<th style="width:5px;">
@MultiLinestring([]string{"Average", "Efficiency"})
Expand Down Expand Up @@ -109,14 +115,16 @@ templ GunRow(gun configs_export.Gun, mode GunTabMode, pinm PinMod, disco frontty
<td>{ strconv.Itoa(gun.Price) } </td>
<td>{ strconv.FormatBool(configs_export.Buyable(gun.Bases)) }</td>
<td>{ strconv.Itoa(gun.HullDamage) }</td>
<td>{ strconv.Itoa(gun.ShieldDamage) }</td>
<td>
{ strconv.Itoa(gun.AvgShieldDamage) }
</td>
<td>{ fmt.Sprintf("%.2f", gun.PowerUsage) }</td>
<td>{ fmt.Sprintf("%.2f", gun.Refire) }</td>
if mode == GunsMissiles {
<td>{ fmt.Sprintf("%.4f", gun.Missile.MaxAngularVelocity) }</td>
}
<td>{ fmt.Sprintf("%.2f",gun.HullDamagePerSec) }</td>
<td>{ fmt.Sprintf("%.2f",gun.ShieldDamagePerSec) }</td>
<td>{ fmt.Sprintf("%.2f",gun.AvgShieldDamagePerSec) }</td>
<td>{ fmt.Sprintf("%.2f",gun.PowerPerSec) }</td>
<td>{ fmt.Sprintf("%.2f",gun.AvgEfficiency) }</td>
<td>{ fmt.Sprintf("%.2f",gun.HullEfficiency) }</td>
Expand Down Expand Up @@ -195,6 +203,12 @@ templ GunShowModifiersShared() {
<th style="width:100px;">Damage Modifier</th>
<th style="width:100px;">Hull Dmg</th>
<th style="width:100px;">Shield Dmg</th>
<th style="width:100px;">
@MultiLinestring([]string{"Moded", "Hull Dmg"})
</th>
<th style="width:100px;">
@MultiLinestring([]string{"Moded", "Shield Dmg"})
</th>
<th style="max-width:100%;"></th>
</tr>
</thead>
Expand All @@ -208,13 +222,15 @@ templ GunShowModifiers(gun configs_export.Gun) {
@BottomFilterBar()
<div class="bottom_name">{ gun.Name }</div>
@GunShowModifiersShared() {
for _, bonus := range gun.DamangeBonuses {
for _, bonus := range gun.DamageBonuses {
<tr
onclick="RowHighlighter(this)"
>
<td>{ gun.DamageType }</td>
<td>{ bonus.Type }</td>
<td>{ fmt.Sprintf("%.2f", bonus.Modifier) }</td>
<td>{ strconv.Itoa(int(gun.HullDamage)) }</td>
<td>{ strconv.Itoa(int(gun.ShieldDamage)) }</td>
<td>{ strconv.Itoa(int(float64(gun.HullDamage)*bonus.Modifier)) }</td>
<td>{ strconv.Itoa(int(float64(gun.ShieldDamage)*bonus.Modifier)) }</td>
<td></td>
Expand Down
9 changes: 9 additions & 0 deletions darkstat/front/shared.templ
Original file line number Diff line number Diff line change
Expand Up @@ -737,3 +737,12 @@ templ WriteLimit(limit int) {
{ children... }
@templ.Raw("</div>")
}

templ Tooltip(tooltip string) {
<span class="tooltip">
{ children... }
<span class="tooltiptext">
{ tooltip }
</span>
</span>
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.1

require (
github.com/a-h/templ v0.2.543
github.com/darklab8/fl-configs v0.70.3
github.com/darklab8/fl-configs v0.70.4
github.com/darklab8/fl-data-discovery v0.2.1
github.com/darklab8/go-typelog v0.6.0
github.com/darklab8/go-utils v0.17.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/darklab8/fl-configs v0.70.2 h1:/QQC5sDz4QtIteEtEAuUusI1d0wyVLlDdyHcAJ
github.com/darklab8/fl-configs v0.70.2/go.mod h1:tmhFrMlTKVh2JeHmd+3Phq/sWDYdA294c8sMj48YhoE=
github.com/darklab8/fl-configs v0.70.3 h1:Y0t++5hsOiTCxwrhFcSRpZTBXwjhamD4x/5fn+oEMvQ=
github.com/darklab8/fl-configs v0.70.3/go.mod h1:tmhFrMlTKVh2JeHmd+3Phq/sWDYdA294c8sMj48YhoE=
github.com/darklab8/fl-configs v0.70.4 h1:LOqiXgWVbipQ55THag6aeyZeiceL9GKEkRZqRglCUFQ=
github.com/darklab8/fl-configs v0.70.4/go.mod h1:tmhFrMlTKVh2JeHmd+3Phq/sWDYdA294c8sMj48YhoE=
github.com/darklab8/fl-data-discovery v0.2.1 h1:iMBnEs1gN/nJN4szZqo5OSfow8nj9sceHOh8g+K8WR4=
github.com/darklab8/fl-data-discovery v0.2.1/go.mod h1:SgRh0N3cWrhslXVkc5LJXK52Mw4+Fdsbmv+0qkNJ6QI=
github.com/darklab8/go-typelog v0.6.0 h1:Ci8imc7ScXiy5e1qMgf46NyJjrqNLPoIE1gbVe7bxl4=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## explicit; go 1.20
github.com/a-h/templ
github.com/a-h/templ/safehtml
# github.com/darklab8/fl-configs v0.70.3
# github.com/darklab8/fl-configs v0.70.4
## explicit; go 1.21.1
github.com/darklab8/fl-configs/configs/config_consts
github.com/darklab8/fl-configs/configs/configs_export
Expand Down

0 comments on commit 89ce56a

Please sign in to comment.