Skip to content

Commit 20d72b4

Browse files
committed
add pw configs for attack charges + refresh and attack options for PW (wired)
1 parent f911514 commit 20d72b4

6 files changed

Lines changed: 191 additions & 1 deletion

File tree

ZkData/Ef/DynamicConfig.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ public class DynamicConfig
3838

3939
[Description("Map vote always tries to include some of the most popular maps (precentile <0.2), this value controls how big fraction of offers is most popular maps.")]
4040
public double MapVoteFractionOfPopularMaps { get; set; } = 0.5;
41+
4142

43+
[Description("PlanetWars: number of attack options shown to the attacking faction each turn.")]
44+
public int PwAttackOptionCount { get; set; } = 6;
45+
46+
[Description("PlanetWars: maximum attack charges a player can hold. 0 disables the charge system.")]
47+
public int PwAttackChargesMax { get; set; } = 2;
48+
49+
[Description("PlanetWars: minutes a player must sit below max charges before gaining one passively.")]
50+
public int PwAttackChargesRechargeMinutes { get; set; } = 60;
51+
4252

4353
public static DynamicConfig Instance;
4454

ZkData/Migrations/202604222356320_AddPwDynamicConfigs.Designer.cs

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace ZkData.Migrations
2+
{
3+
using System;
4+
using System.Data.Entity.Migrations;
5+
6+
public partial class AddPwDynamicConfigs : DbMigration
7+
{
8+
public override void Up()
9+
{
10+
AddColumn("dbo.DynamicConfigs", "PwAttackOptionCount", c => c.Int(nullable: false, defaultValue: 6));
11+
AddColumn("dbo.DynamicConfigs", "PwAttackChargesMax", c => c.Int(nullable: false, defaultValue: 2));
12+
AddColumn("dbo.DynamicConfigs", "PwAttackChargesRechargeMinutes", c => c.Int(nullable: false, defaultValue: 60));
13+
}
14+
15+
public override void Down()
16+
{
17+
DropColumn("dbo.DynamicConfigs", "PwAttackChargesRechargeMinutes");
18+
DropColumn("dbo.DynamicConfigs", "PwAttackChargesMax");
19+
DropColumn("dbo.DynamicConfigs", "PwAttackOptionCount");
20+
}
21+
}
22+
}

ZkData/Migrations/202604222356320_AddPwDynamicConfigs.resx

Lines changed: 126 additions & 0 deletions
Large diffs are not rendered by default.

ZkData/ZkData.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@
495495
<Compile Include="Migrations\202404060935038_AddPopularMapsFraction.Designer.cs">
496496
<DependentUpon>202404060935038_AddPopularMapsFraction.cs</DependentUpon>
497497
</Compile>
498+
<Compile Include="Migrations\202604222356320_AddPwDynamicConfigs.cs" />
499+
<Compile Include="Migrations\202604222356320_AddPwDynamicConfigs.Designer.cs" />
498500
<Compile Include="SpringFilesUnitsyncAttempt.cs" />
499501
<Compile Include="SteamWebApi.cs" />
500502
<Compile Include="UserLanguageNoteAttribute.cs" />
@@ -946,6 +948,7 @@
946948
<EmbeddedResource Include="Migrations\202404060935038_AddPopularMapsFraction.resx">
947949
<DependentUpon>202404060935038_AddPopularMapsFraction.cs</DependentUpon>
948950
</EmbeddedResource>
951+
<EmbeddedResource Include="Migrations\202604222356320_AddPwDynamicConfigs.resx" />
949952
<EmbeddedResource Include="ZkDataResources.resx">
950953
<Generator>ResXFileCodeGenerator</Generator>
951954
<LastGenOutput>ZkDataResources.Designer.cs</LastGenOutput>

ZkLobbyServer/SpringieInterface/PlanetWarsMatchMaker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ private void ResetAttackOptions()
766766
using (var db = new ZkDataContext())
767767
{
768768
var gal = db.Galaxies.First(x => x.IsDefault);
769-
var cnt = 6;
769+
var cnt = DynamicConfig.Instance.PwAttackOptionCount;
770770
var attacker = db.Factions.Single(x => x.FactionID == AttackingFaction.FactionID);
771771
var planets =
772772
gal.Planets.Where(x => x.OwnerFactionID != AttackingFaction.FactionID)

0 commit comments

Comments
 (0)