意图初步
This commit is contained in:
130
Assets/Mods/Basic/Characters/Scripts/MarshalOfUnderworld.cs
Normal file
130
Assets/Mods/Basic/Characters/Scripts/MarshalOfUnderworld.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
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.cardLogic.weightSubmodule.baseWeight = 0;
|
||||
card.cardLogic.weightSubmodule.forceUse = false;
|
||||
card.cardLogic.weightSubmodule.forceIgnore = false;
|
||||
});
|
||||
|
||||
foreach (CardInstance card in characterDeck.PoolPile)
|
||||
{
|
||||
if (card.cardLogic is HellfireBlast)
|
||||
{
|
||||
card.cardLogic.weightSubmodule.baseWeight = 1;
|
||||
}
|
||||
else if (card.cardLogic is NecromanticInfusion)
|
||||
{
|
||||
if (characterRecord.GetLastActionsRecords(3)
|
||||
.Any(rec => rec.cardsPlayed.Any(recCard => recCard.cardLogic is NecromanticInfusion)))
|
||||
{
|
||||
card.cardLogic.weightSubmodule.baseWeight = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
card.cardLogic.weightSubmodule.baseWeight = 1;
|
||||
}
|
||||
}
|
||||
else if (card.cardLogic is GreatswordSweep)
|
||||
{
|
||||
card.cardLogic.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.cardLogic.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.cardLogic.weightSubmodule.forceUse = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class MarshallOfUnderworld : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user