添加左侧&右侧目标

This commit is contained in:
xianyi
2025-08-26 17:12:46 +08:00
parent 20d9af7540
commit b7551ebbe7
3 changed files with 65 additions and 1 deletions

View File

@@ -362,6 +362,30 @@ namespace TcgEngine
targets.Add(target);
}
if (target == AbilityTarget.LastTargetedLeft)
{
Card lastTarget = data.GetCard(data.last_target);
if (lastTarget != null && lastTarget.slot.x > Slot.x_min)
{
Slot leftSlot = new Slot(lastTarget.slot.x - 1, lastTarget.slot.y, lastTarget.slot.p);
Card leftCard = data.GetSlotCard(leftSlot);
if (leftCard != null && AreTargetConditionsMet(data, caster, leftCard))
targets.Add(leftCard);
}
}
if (target == AbilityTarget.LastTargetedRight)
{
Card lastTarget = data.GetCard(data.last_target);
if (lastTarget != null && lastTarget.slot.x < Slot.x_max)
{
Slot rightSlot = new Slot(lastTarget.slot.x + 1, lastTarget.slot.y, lastTarget.slot.p);
Card rightCard = data.GetSlotCard(rightSlot);
if (rightCard != null && AreTargetConditionsMet(data, caster, rightCard))
targets.Add(rightCard);
}
}
if (target == AbilityTarget.LastSummoned)
{
Card target = data.GetCard(data.last_summoned);
@@ -684,7 +708,9 @@ namespace TcgEngine
LastPlayed = 70, //Last card that was played
LastTargeted = 72, //Last card that was targeted with an ability
LastDestroyed = 74, //Last card that was killed
LastTargetedLeft = 73, //Last card that was targeted with an ability and is on the left side of the board
LastTargetedRight = 74, //Last card that was targeted with an ability and is on the right side of the board
LastDestroyed = 75, //Last card that was killed
LastSummoned = 77, //Last card that was summoned or created
}