Skip to content

Commit

Permalink
feat: sustained damage is default for burst guns, closes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Dec 22, 2024
1 parent b865579 commit ab0f31f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
4 changes: 2 additions & 2 deletions darkstat/front/docs.templ
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ templ DocsT(mode2 ShowEmpty, disco types.DiscoveryIDs) {
<ul>
<li>All guns information and where to buy them, but some information about them in Missiles tab (including flaks)</li>
if disco.Show {
<li>Some parameters show extra information for sustained usage of burst firing guns</li>
<li>Some parameters show extra information for burst period of damage usage of burst firing guns</li>
<li>Some guns have increased number of barrels affecting their DPS. This is visible in one of columns in square brackets (in same column where other burst params)</li>
}
</ul>
</li>
<li>Guns Mods - Guns modifiers against specific shields. Shield average damage already accounts for using average shield modifiers and uses only obtainable shields.</li>
<li>Missiles - tab with missiles and flak guns (some can be with sustained burst fire stuff)</li>
<li>Missiles - tab with missiles and flak guns (some can be with burst fire stuff)</li>
<li>Ammo
<ul>
<li>ammo and where to buy it. Convinient place to find Anomaly Scanner Batteries</li>
Expand Down
46 changes: 21 additions & 25 deletions darkstat/front/guns.templ
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,41 @@ const (
)

func GetRefire(gun configs_export.Gun) []string {
regular_value := fmt.Sprintf("%6.2f", gun.Refire)
if gun.BurstFire == nil {
return []string{regular_value}
return []string{fmt.Sprintf("%8.2f", gun.Refire)}
}
return []string{regular_value, fmt.Sprintf("( %6.2f )", gun.BurstFire.SustainedRefire)}
return []string{fmt.Sprintf("%8.2f",gun.BurstFire.SustainedRefire), fmt.Sprintf("( %8.2f )", gun.Refire)}
}

func GetHullPerSec(gun configs_export.Gun) []string {
regular_value := fmt.Sprintf("%6.0f",gun.HullDamagePerSec)
if gun.BurstFire == nil {
return []string{regular_value}
return []string{fmt.Sprintf("%8.0f", gun.HullDamagePerSec)}
}
return []string{regular_value, fmt.Sprintf("( %6.0f )",gun.BurstFire.SustainedHullDamagePerSec)}
return []string{fmt.Sprintf("%8.0f",gun.BurstFire.SustainedHullDamagePerSec), fmt.Sprintf("( %8.0f )",gun.HullDamagePerSec)}
}

func GetShieldPerSec(gun configs_export.Gun) []string {
regular_value := fmt.Sprintf("%6.0f",gun.AvgShieldDamagePerSec)
if gun.BurstFire == nil {
return []string{regular_value}
return []string{fmt.Sprintf("%8.0f",gun.AvgShieldDamagePerSec)}
}
return []string{regular_value, fmt.Sprintf("( %6.0f )",gun.BurstFire.SustainedAvgShieldDamagePerSec)}
return []string{fmt.Sprintf("%8.0f",gun.BurstFire.SustainedAvgShieldDamagePerSec), fmt.Sprintf("( %8.0f )",gun.AvgShieldDamagePerSec)}
}

func GetEnergyPerSec(gun configs_export.Gun) []string {
regular_value := fmt.Sprintf("%6.0f",gun.EnergyDamagePerSec)
if gun.BurstFire == nil {
return []string{regular_value}
return []string{fmt.Sprintf("%8.0f",gun.EnergyDamagePerSec)}
}
return []string{regular_value, fmt.Sprintf("( %6.0f )",gun.BurstFire.SustainedEnergyDamagePerSec)}
return []string{fmt.Sprintf("%8.0f",gun.BurstFire.SustainedEnergyDamagePerSec), fmt.Sprintf("( %8.0f )",gun.EnergyDamagePerSec)}
}

func GetPowerPerSec(gun configs_export.Gun) []string {
if gun.BurstFire == nil {
return []string{fmt.Sprintf("%6.0f",gun.PowerUsagePerSec)}
}
return []string{fmt.Sprintf("%6.0f",gun.BurstFire.SustainedPowerUsagePerSec), fmt.Sprintf("( %6.0f )", gun.PowerUsagePerSec)}
}


func GetBurstParams(gun configs_export.Gun) []string {
burst_ammo := ""
if gun.BurstFire != nil {
Expand All @@ -90,14 +94,6 @@ func GetBurstParams(gun configs_export.Gun) []string {
return []string{burst_ammo, fmt.Sprintf("(%.2f)", gun.BurstFire.ReloadTime)}
}

func GetPowerPerSec(gun configs_export.Gun) []string {
regular_value := fmt.Sprintf("%6.0f",gun.PowerUsagePerSec)
if gun.BurstFire == nil {
return []string{regular_value}
}
return []string{regular_value, fmt.Sprintf("( %6.0f )",gun.BurstFire.SustainedPowerUsagePerSec)}
}

templ GunTable(guns []configs_export.Gun, mode GunTabMode, pinm PinMod, disco types.DiscoveryIDs, infocards configs_export.Infocards) {
<table class="sortable">
<thead>
Expand Down Expand Up @@ -127,7 +123,7 @@ templ GunTable(guns []configs_export.Gun, mode GunTabMode, pinm PinMod, disco ty
@MultiLinestring([]string{"Power", "Usage"})
</th>
<th style="width:5px;">
@MultiLinestring([]string{"Refire", "(+Sust.)"})
@MultiLinestring([]string{"Refire", "(+Burst.)"})
</th>
if disco.Show {
<th style="width:5px;">
Expand All @@ -146,16 +142,16 @@ templ GunTable(guns []configs_export.Gun, mode GunTabMode, pinm PinMod, disco ty
</th>
}
<th style="width:5px;">
@MultiLinestring([]string{"Hull", "Dmg/s", "(+Sust.)"})
@MultiLinestring([]string{"Hull", "Dmg/s", "(+Burst.)"})
</th>
<th style="width:5px;">
@MultiLinestring([]string{"Avg", "Sheld", "Dmg/s", "(+Sust.)"})
@MultiLinestring([]string{"Avg", "Sheld", "Dmg/s", "(+Burst.)"})
</th>
<th style="width:5px;">
@MultiLinestring([]string{"Energy", "Dmg/s", "(+Sust.)"})
@MultiLinestring([]string{"Energy", "Dmg/s", "(+Burst.)"})
</th>
<th style="width:5px;">
@MultiLinestring([]string{"Power/s", "(+Sust.)"})
@MultiLinestring([]string{"Power/s", "(+Burst.)"})
</th>
<th style="width:5px;">Range</th>
<th style="width:5px;">Speed</th>
Expand Down

0 comments on commit ab0f31f

Please sign in to comment.