130 lines
4.4 KiB
C#
130 lines
4.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Combat;
|
|
using Continentis.Mods.Basic.Buffs;
|
|
using Continentis.Mods.Basic.Cards;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.Mods.Basic.Characters
|
|
{
|
|
public class MarshalOfUnderworld : CharacterLogicBase
|
|
{
|
|
public override void Initialize(CharacterBase character)
|
|
{
|
|
base.Initialize(character);
|
|
character.RegisterIntention(
|
|
new Normal(character.intentionSubmodule),
|
|
new SummonFirst(character.intentionSubmodule),
|
|
new UltimateAttackFirst(character.intentionSubmodule));
|
|
}
|
|
|
|
private class Normal : IntentionBase
|
|
{
|
|
public Normal(IntentionSubmodule intentionSubmodule) : base(intentionSubmodule)
|
|
{
|
|
|
|
}
|
|
|
|
public override void RefreshCardWeights()
|
|
{
|
|
characterDeck.PoolPile.ForEach(card =>
|
|
{
|
|
card.weightSubmodule.baseWeight = 0;
|
|
card.weightSubmodule.forceUse = false;
|
|
card.weightSubmodule.forceIgnore = false;
|
|
});
|
|
|
|
foreach (CardInstance card in characterDeck.PoolPile)
|
|
{
|
|
if (card.cardLogic is HellfireBlast)
|
|
{
|
|
card.weightSubmodule.baseWeight = 1;
|
|
}
|
|
else if (card.cardLogic is NecromanticInfusion)
|
|
{
|
|
if (characterRecord.GetLastActionsRecords(3)
|
|
.Any(rec => rec.cardsPlayed.Any(recCard => recCard.cardLogic is NecromanticInfusion)))
|
|
{
|
|
card.weightSubmodule.baseWeight = 0;
|
|
}
|
|
else
|
|
{
|
|
card.weightSubmodule.baseWeight = 1;
|
|
}
|
|
}
|
|
else if (card.cardLogic is GreatswordSweep)
|
|
{
|
|
card.weightSubmodule.baseWeight = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private class SummonFirst : Normal
|
|
{
|
|
public SummonFirst(IntentionSubmodule intentionSubmodule) : base(intentionSubmodule)
|
|
{
|
|
Priority = 20;
|
|
}
|
|
|
|
public override bool Condition()
|
|
{
|
|
List<CharacterBase> allies = CombatMainManager.Instance.characterController.GetAllAllies(character);
|
|
return allies.Count == 1; // Only self is present
|
|
}
|
|
|
|
public override void RefreshCardWeights()
|
|
{
|
|
base.RefreshCardWeights();
|
|
|
|
foreach (CardInstance card in characterDeck.PoolPile)
|
|
{
|
|
if (card.cardLogic is ArmyOfTheDead)
|
|
{
|
|
card.weightSubmodule.forceUse = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private class UltimateAttackFirst : Normal
|
|
{
|
|
public UltimateAttackFirst(IntentionSubmodule intentionSubmodule) : base(intentionSubmodule)
|
|
{
|
|
Priority = 10;
|
|
}
|
|
|
|
public override bool Condition()
|
|
{
|
|
List<CharacterBase> targets = CombatMainManager.Instance.characterController.GetAllEnemies(character);
|
|
foreach (CharacterBase target in targets)
|
|
{
|
|
if (target.combatBuffSubmodule.TryGetBuff(out Burn burn))
|
|
{
|
|
if (burn.unitedStackSubmodule.stackAmount >= 5)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override void RefreshCardWeights()
|
|
{
|
|
base.RefreshCardWeights();
|
|
|
|
foreach (CardInstance card in characterDeck.PoolPile)
|
|
{
|
|
if (card.cardLogic is WrathOfUnderworld)
|
|
{
|
|
card.weightSubmodule.forceUse = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |