添加左侧&右侧目标

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

@@ -42,6 +42,24 @@ namespace TcgEngine
return gdata.GetCard(gdata.last_played);
if (attacker_type == EffectAttackerType.LastTargeted)
return gdata.GetCard(gdata.last_target);
if (attacker_type == EffectAttackerType.LastTargetedLeft)
{
Card lastTarget = gdata.GetCard(gdata.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);
return gdata.GetSlotCard(leftSlot);
}
}
if (attacker_type == EffectAttackerType.LastTargetedRight)
{
Card lastTarget = gdata.GetCard(gdata.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);
return gdata.GetSlotCard(rightSlot);
}
}
return null;
}
}
@@ -52,5 +70,7 @@ namespace TcgEngine
AbilityTriggerer = 25,
LastPlayed = 70,
LastTargeted = 72,
LastTargetedLeft = 73,
LastTargetedRight = 74,
}
}

View File

@@ -42,6 +42,24 @@ namespace TcgEngine
return gdata.GetCard(gdata.last_played);
if (attacker_type == EffectAttackerType.LastTargeted)
return gdata.GetCard(gdata.last_target);
if (attacker_type == EffectAttackerType.LastTargetedLeft)
{
Card lastTarget = gdata.GetCard(gdata.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);
return gdata.GetSlotCard(leftSlot);
}
}
if (attacker_type == EffectAttackerType.LastTargetedRight)
{
Card lastTarget = gdata.GetCard(gdata.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);
return gdata.GetSlotCard(rightSlot);
}
}
return null;
}
}