2026-04-08 04:48:35 -04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Continentis.MainGame.Card;
|
|
|
|
|
|
using Continentis.MainGame.Character;
|
|
|
|
|
|
using Continentis.MainGame.Combat;
|
|
|
|
|
|
using Continentis.MainGame.Commands;
|
|
|
|
|
|
using Continentis.Mods.Basic.Buffs;
|
2026-04-17 12:01:50 -04:00
|
|
|
|
using SLSUtilities.General;
|
2026-04-08 04:48:35 -04:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 猛毒喷射:对主目标施加腐蚀 Buff,
|
|
|
|
|
|
/// 并从剩余敌人中随机选取 Extra_Target_Count 个额外目标(不可重复)同样施加腐蚀 Buff。
|
|
|
|
|
|
/// targetCount = 1,玩家手动指定主目标;额外目标由 PlayEffect 内部随机决定。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class VenomSpray : CardLogicBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private const string BUFF_CORROSION_STACK = "Buff_Corrosion_Stack";
|
|
|
|
|
|
private const string EXTRA_TARGET_COUNT = "Extra_Target_Count";
|
|
|
|
|
|
|
|
|
|
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
|
|
|
|
{
|
|
|
|
|
|
CharacterBase mainTarget = targetList[0];
|
|
|
|
|
|
int corrosionStack = GetAttribute(BUFF_CORROSION_STACK);
|
|
|
|
|
|
|
|
|
|
|
|
// 从所有敌人中排除主目标,不放回随机抽取额外目标
|
|
|
|
|
|
List<CharacterBase> pool = CombatMainManager.Instance.characterController.GetAllEnemies(user);
|
|
|
|
|
|
pool.Remove(mainTarget);
|
|
|
|
|
|
|
|
|
|
|
|
int extraCount = Mathf.Min(GetAttribute(EXTRA_TARGET_COUNT), pool.Count);
|
|
|
|
|
|
List<CharacterBase> extraTargets = new List<CharacterBase>();
|
|
|
|
|
|
for (int i = 0; i < extraCount; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
int index = Random.Range(0, pool.Count);
|
|
|
|
|
|
extraTargets.Add(pool[index]);
|
|
|
|
|
|
pool.RemoveAt(index);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Cmd.Sequential(
|
|
|
|
|
|
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
|
|
|
|
|
Cmd.Do(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(mainTarget, user, this);
|
|
|
|
|
|
foreach (CharacterBase extra in extraTargets)
|
|
|
|
|
|
{
|
|
|
|
|
|
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(extra, user, this);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|