Commit 3b5ad3e3 authored by wyykak's avatar wyykak

add dingdang support

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent a7fdb95b
<?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>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0665CA3B-C14F-40EC-ABFB-AD46A695F5A3}</ProjectGuid> <ProjectGuid>{0665CA3B-C14F-40EC-ABFB-AD46A695F5A3}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<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>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> <Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86'"> </PropertyGroup>
<PlatformTarget>x86</PlatformTarget> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugType>pdbonly</DebugType> <PlatformTarget>x86</PlatformTarget>
<Optimize>true</Optimize> <DebugType>pdbonly</DebugType>
<OutputPath>bin\Release\</OutputPath> <Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup> <Prefer32Bit>false</Prefer32Bit>
<StartupObject>BotWrapper.BotWrapper</StartupObject> </PropertyGroup>
</PropertyGroup> <PropertyGroup>
<PropertyGroup> <StartupObject>BotWrapper.BotWrapper</StartupObject>
<ApplicationIcon>WindBot.ico</ApplicationIcon> </PropertyGroup>
</PropertyGroup> <PropertyGroup>
<ItemGroup> <ApplicationIcon>WindBot.ico</ApplicationIcon>
<Reference Include="System" /> </PropertyGroup>
<Reference Include="System.Data" /> <ItemGroup>
<Reference Include="System.Xml" /> <Reference Include="System" />
</ItemGroup> <Reference Include="System.Data" />
<ItemGroup> <Reference Include="System.Xml" />
<Compile Include="BotWrapper.cs" /> </ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <ItemGroup>
</ItemGroup> <Compile Include="BotWrapper.cs" />
<ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" />
<None Include="app.config" /> </ItemGroup>
<None Include="bot.conf"> <ItemGroup>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <None Include="app.config" />
</None> <None Include="bot.conf">
</ItemGroup> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ItemGroup> </None>
<Content Include="WindBot.ico" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Content Include="WindBot.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>
\ No newline at end of file
<?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 />
...@@ -183,4 +185,4 @@ ...@@ -183,4 +185,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>
\ No newline at end of file
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