Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YSPplayer committed Jun 18, 2023
1 parent f1837f3 commit 5db1aeb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 34 deletions.
46 changes: 21 additions & 25 deletions Game/AI/Decks/ZefraExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,21 @@ public ZefraExecutor(GameAI ai, Duel duel) : base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.CalledbytheGrave, CalledbytheGraveEffect);
AddExecutor(ExecutorType.Activate, CardId.BorreloadSavageDragon, BorreloadSavageDragonEffect_2);
AddExecutor(ExecutorType.Activate, CardId.F_A_DawnDragster);
AddExecutor(ExecutorType.Activate, CardId.F_A_DawnDragster, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.NinePillarsofYangZing, NinePillarsofYangZingEffect);
AddExecutor(ExecutorType.Activate, CardId.ZefraDivineStrike, ZefraDivineStrikeEffect);
AddExecutor(ExecutorType.Activate, CardId.HeraldoftheArcLight, HeraldoftheArcLightEffect);
AddExecutor(ExecutorType.Activate, CardId.TruKingofAllCalamities, TruKingofAllCalamitiesEffect);
AddExecutor(ExecutorType.Activate, CardId.PSY_FramegearGamma);
AddExecutor(ExecutorType.Activate, CardId.PSY_FramegearGamma, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.MaxxC, DefaultMaxxC);
AddExecutor(ExecutorType.Activate, CardId.SupremeKingDragonDarkwurm, SupremeKingDragonDarkwurmEffect);
AddExecutor(ExecutorType.Activate, CardId.ServantofEndymion, ServantofEndymionEffect);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, TerraformingEffect);
AddExecutor(ExecutorType.Activate, CardId.SpellPowerMastery);
AddExecutor(ExecutorType.Activate, CardId.SpellPowerMastery, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.DragonShrine, DragonShrineEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.Activate, CardId.DarkContractwiththGate, DarkContractwiththGateEffect);
AddExecutor(ExecutorType.Activate, CardId.Terraforming);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.OracleofZefra, OracleofZefraEffect);
AddExecutor(ExecutorType.Activate, CardId.ZefraProvidence, ZefraProvidenceEffect);
AddExecutor(ExecutorType.Activate, CardId.AstrographSorcerer, AstrographSorcererEffect);
Expand Down Expand Up @@ -497,7 +497,7 @@ public ZefraExecutor(GameAI ai, Duel duel) : base(ai, duel)
AddExecutor(ExecutorType.Activate, CardId.Blackwing_ZephyrostheElite, Blackwing_ZephyrostheEliteEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Raidraptor_ForceStrix, Raidraptor_ForceStrixSummon);
AddExecutor(ExecutorType.Activate, CardId.Raidraptor_ForceStrix, Raidraptor_ForceStrixEffect);
AddExecutor(ExecutorType.Activate, CardId.Rank_Up_MagicSoulShaveForce);
AddExecutor(ExecutorType.Activate, CardId.Rank_Up_MagicSoulShaveForce, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.Raider_Wing, Raider_WingEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Raidraptor_SingingLanius);
//xyz mode
Expand Down Expand Up @@ -530,7 +530,7 @@ public ZefraExecutor(GameAI ai, Duel duel) : base(ai, duel)
CardId.DDSavantKepler,CardId.StellarknightZefraxciton,CardId.ShaddollZefracore,CardId.SupremeKingDragonDarkwurm};
for (int i = 0; i < p_summon_ids.Count; ++i) AddExecutor(ExecutorType.Summon, p_summon_ids[i], DefaultSummon);
AddExecutor(ExecutorType.Summon, DefaultSummon);
AddExecutor(ExecutorType.Activate, CardId.Deskbot001);
AddExecutor(ExecutorType.Activate, CardId.Deskbot001, ResetFlag);
AddExecutor(ExecutorType.Activate, CardId.TheMightyMasterofMagic, TheMightyMasterofMagicEffect);
AddExecutor(ExecutorType.Activate, CardId.DestrudotheLostDragon_Frisson, DestrudotheLostDragon_FrissonEffect);
AddExecutor(ExecutorType.Summon, CardId.Blackwing_ZephyrostheElite, DefaultSummon_2);
Expand All @@ -547,7 +547,7 @@ public override void OnNewTurn()
if (duel_start)
{
duel_start = false;
AI.OnCustom((int)CustomMessage.Happy);
AI.SendCustomChat((int)CustomMessage.Happy);
}
activate_SupremeKingDragonDarkwurm_1 = false;
activate_SupremeKingDragonDarkwurm_2 = false;
Expand Down Expand Up @@ -576,8 +576,13 @@ public override void OnNewTurn()
}
private bool ZefraProvidenceEffect()
{
if (Card.Location == CardLocation.Grave)
if (ActivateDescription == 96)
{
if (should_destory)
{
should_destory = false;
return false;
}
return BeforeResult(ExecutorType.Activate);
}
else
Expand Down Expand Up @@ -705,6 +710,7 @@ private bool BeforeResult(ExecutorType type)
{
if (type == ExecutorType.Activate)
{
ResetFlag();
++activate_count;
}
if (type == ExecutorType.Summon)
Expand All @@ -719,7 +725,7 @@ private bool GoToEndPhase()
&& activate_count + summon_count < 5 && !enemy_activate)
{

AI.OnCustom((int)CustomMessage.Angry);
AI.SendCustomChat((int)CustomMessage.Angry);
return true;
}
return false;
Expand Down Expand Up @@ -1399,7 +1405,7 @@ private bool CrystronHalqifibraxSummon()
AI.SelectMaterials(materials);
if (materials.Distinct().Count() <= 3)
{
AI.OnCustom((int)CustomMessage.Surprise);
AI.SendCustomChat((int)CustomMessage.Surprise);
}
return true;
}
Expand Down Expand Up @@ -1675,6 +1681,11 @@ public override bool OnSelectHand()
{
return true;
}
private bool ResetFlag()
{
should_destory = false;
return true;
}
private bool HeraldoftheArcLightEffect()
{
if (Card.Location == CardLocation.MonsterZone)
Expand Down Expand Up @@ -1760,21 +1771,6 @@ public override int OnSelectPlace(int cardId, int player, CardLocation location,

return base.OnSelectPlace(cardId, player, location, available);
}
public override bool OnSelectEffectYn(ClientCard card, int desc)
{
if (card == null) return false;
if (card.Id == CardId.ZefraProvidence && card.Location == CardLocation.Grave)
{
if (should_destory)
{
should_destory = false;
return false;
}
return true;
}
should_destory = false;
return base.OnSelectEffectYn(card, desc);
}
private IList<ClientCard> _OnSelectPendulumSummon(IList<ClientCard> cards, int min, int max)
{
List<int> ids = func.GetSelectCardIdList();
Expand Down
2 changes: 1 addition & 1 deletion Game/AI/Dialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void SendChaining(string card)
InternalSendMessage(_chaining, card);
}

public void SendCustom(int index, params object[] opts)
public void SendCustomChat(int index, params object[] opts)
{
InternalSendCustomMessage(index, opts);
}
Expand Down
5 changes: 0 additions & 5 deletions Game/AI/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ public virtual void OnSelectChain(IList<ClientCard> cards)
return;
}

public virtual bool OnSelectEffectYn(ClientCard card, int desc)
{
return true;
}

public virtual bool OnSelectYesNo(int desc)
{
return true;
Expand Down
6 changes: 3 additions & 3 deletions Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public void OnStart()
/// <summary>
/// Customized called when the AI do something in a duel.
/// </summary>
public void OnCustom(int index, params object[] opts)
public void SendCustomChat(int index, params object[] opts)
{
_dialogs.SendCustom(index, opts);
_dialogs.SendCustomChat(index, opts);
}

/// <summary>
Expand Down Expand Up @@ -386,7 +386,7 @@ public bool OnSelectEffectYn(ClientCard card, int desc)
foreach (CardExecutor exec in Executor.Executors)
{
if (ShouldExecute(exec, card, ExecutorType.Activate, desc))
return Executor.OnSelectEffectYn(card, desc);
return true;
}
return false;
}
Expand Down

0 comments on commit 5db1aeb

Please sign in to comment.