Commit c69d4a4b authored by wyykak's avatar wyykak

add dingdang support

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent 650a0ad9
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
</configuration> </configuration>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BotWrapper</RootNamespace> <RootNamespace>BotWrapper</RootNamespace>
<AssemblyName>Bot</AssemblyName> <AssemblyName>Bot</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<StartupObject>BotWrapper.BotWrapper</StartupObject> <StartupObject>BotWrapper.BotWrapper</StartupObject>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
#created by ... #created by ...
#main #main
74561023 74561023
16011501
14050011
14050011
10278
74561023 74561023
74561023 74561023
74561020 74561020
...@@ -26,6 +22,7 @@ ...@@ -26,6 +22,7 @@
16000006 16000006
16000006 16000006
10278 10278
10278
10020 10020
10020 10020
10020 10020
...@@ -39,6 +36,9 @@ ...@@ -39,6 +36,9 @@
86379728 86379728
86379728 86379728
14050011 14050011
14050011
14050011
16011501
16011501 16011501
16011501 16011501
#extra #extra
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
23504 23504
23504 23504
23504 23504
17030980
17030980
17030980
!side !side
74561004 74561004
23501 23501
...@@ -33,7 +33,10 @@ namespace WindBot.Game.AI.Decks ...@@ -33,7 +33,10 @@ namespace WindBot.Game.AI.Decks
public const int 幼女化 = 74561045; public const int 幼女化 = 74561045;
public const int 天狗L2 = 23504; public const int 天狗L2 = 23504;
public const int 叮当 = 17030980;
} }
readonly int[] 叮当素材 = { CardId.幼女化, CardId.女神天子, CardId.天子翼, CardId.萨丽艾尔, 16019999};
public THC_DSReimuExecutor(GameAI ai, Duel duel) public THC_DSReimuExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
...@@ -63,6 +66,7 @@ namespace WindBot.Game.AI.Decks ...@@ -63,6 +66,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.有顶天场地, AddExecutor(ExecutorType.Activate, CardId.有顶天场地,
() => !(AlreadySucceeded() && Bot.HasInHand(CardId.梦想天生))); () => !(AlreadySucceeded() && Bot.HasInHand(CardId.梦想天生)));
AddExecutor(ExecutorType.Activate, CardId.灵符); AddExecutor(ExecutorType.Activate, CardId.灵符);
AddExecutor(ExecutorType.SpSummon, CardId.叮当, 叮当特召);
} }
...@@ -77,6 +81,14 @@ namespace WindBot.Game.AI.Decks ...@@ -77,6 +81,14 @@ namespace WindBot.Game.AI.Decks
// go first // go first
return true; return true;
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
{
if (cardId == CardId.萨丽艾尔 && positions.Contains(CardPosition.FaceUpAttack))
{
return CardPosition.FaceUpAttack;
}
return base.OnSelectPosition(cardId, positions);
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable) public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{ {
if (hint == HintMsg.Discard) if (hint == HintMsg.Discard)
...@@ -103,7 +115,7 @@ namespace WindBot.Game.AI.Decks ...@@ -103,7 +115,7 @@ namespace WindBot.Game.AI.Decks
{ {
return false; return false;
} }
return (!AlreadySucceeded() && !HasDSTunerOnField() && HasSpSummonableNonTuner(Card)) || NeedToFreeSZone(); return (!HasDSTunerOnField() && HasSpSummonableNonTuner(Card)) || NeedToFreeSZone();
} }
private bool 女神天子等级提升() private bool 女神天子等级提升()
{ {
...@@ -140,7 +152,7 @@ namespace WindBot.Game.AI.Decks ...@@ -140,7 +152,7 @@ namespace WindBot.Game.AI.Decks
{ {
return true; return true;
} }
if (AlreadySucceeded() || HasDSTunerOnField()) if (HasDSTunerOnField())
{ {
return false; return false;
} }
...@@ -207,10 +219,15 @@ namespace WindBot.Game.AI.Decks ...@@ -207,10 +219,15 @@ namespace WindBot.Game.AI.Decks
private bool 茧墨特召() private bool 茧墨特召()
{ {
if (AlreadySucceeded() || ActivateDescription == Util.GetStringId(CardId.茧墨场地, 1)) if (ActivateDescription == Util.GetStringId(CardId.茧墨场地, 1))
{ {
return false; return false;
} }
if (AlreadySucceeded())
{
AI.SelectCard(CardId.萨丽艾尔, CardId.天子翼);
return true;
}
if (Card.Location == CardLocation.Hand && if (Card.Location == CardLocation.Hand &&
!(Bot.GetFieldSpellCard() != null && Bot.GetFieldSpellCard().IsCode(CardId.茧墨场地) && !Bot.GetFieldSpellCard().IsDisabled() && !JMUsed) || !(Bot.GetFieldSpellCard() != null && Bot.GetFieldSpellCard().IsCode(CardId.茧墨场地) && !Bot.GetFieldSpellCard().IsDisabled() && !JMUsed) ||
NeedToFreeSZone()) NeedToFreeSZone())
...@@ -240,6 +257,10 @@ namespace WindBot.Game.AI.Decks ...@@ -240,6 +257,10 @@ namespace WindBot.Game.AI.Decks
} }
private bool 守备特召() private bool 守备特召()
{ {
if (Bot.HasInMonstersZone(CardId.叮当))
{
return false;
}
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
...@@ -275,6 +296,36 @@ namespace WindBot.Game.AI.Decks ...@@ -275,6 +296,36 @@ namespace WindBot.Game.AI.Decks
} }
return true; return true;
} }
private bool 叮当特召()
{
if (AlreadySucceeded() && Bot.HasInHand(CardId.梦想天生) || Duel.Turn == 1)
{
return false;
}
var material = Bot.GetMonsters().GetMatchingCards((c) => 叮当素材.Contains(c.Id));
var matCount = material.Count - Enemy.GetMonsterCount() * 2;
if (matCount > 1)
{
var ddCount = matCount / 2;
var attackCards = Enemy.GetMonsters().GetMatchingCards((c) => c.IsAttack());
List<ClientCard> targets = new List<ClientCard>();
int totalDamage = 0;
while (targets.Count < ddCount && attackCards.Count > 0)
{
var card = attackCards.GetLowestAttackMonster();
targets.Add(card);
attackCards.Remove(card);
totalDamage += 7200 - card.Attack;
}
totalDamage += 7200 * (ddCount - targets.Count);
if (totalDamage >= Enemy.LifePoints || totalDamage > 5000)
{
AI.SelectMaterials(叮当素材);
return true;
}
}
return false;
}
private bool HasSpSummonableNonTuner(ClientCard ex) private bool HasSpSummonableNonTuner(ClientCard ex)
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindBot</RootNamespace> <RootNamespace>WindBot</RootNamespace>
<AssemblyName>WindBot</AssemblyName> <AssemblyName>WindBot</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<StartupObject /> <StartupObject />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment