/* * @Author: 白哉 * @Description: * @Date: 2025年10月12日 星期六 10:10:12 * @Modify: */ using System; using System.Collections.Generic; using MemoryPack; using RuntimeData; namespace Logic.Skill { public partial class SakuyaFlySkill : SkillBase { public SakuyaFlySkill() { IsPermanent = true; TurnsLimit = 0; Score = 2; } public override SkillType GetSkillType() { return SkillType.SAKUYAFLY; } public override bool IsCanMoveGiantNearbyGrid(UnitData unit, MapData map) { return true; } public override void OnMove(UnitData self, GridData grid, MapData mapData, MoveType moveType) { if (moveType != MoveType.SkillMove) return; var player = self.Player(mapData); if (player == null) return; var selfUnitList = new HashSet(); mapData.GetUnitDataListByPlayerId(player.Id, selfUnitList); if (!mapData.GetGridDataByUnitId(self.Id, out var targetGrid)) return; var roundGrid = mapData.GridMap.GetAroundGridData(1, 1, targetGrid); bool isExcute = false; foreach (var gridData in roundGrid) { if (targetGrid == gridData) continue; var unit = gridData.Unit(mapData); if (unit == null || unit == self) continue; if (unit.UnitFullType.UnitType != UnitType.Giant && unit.UnitFullType.UnitType != UnitType.RemiliaEgyptianKoakuma) continue; if (!selfUnitList.Contains(unit)) continue; unit.AddSkill(SkillType.SAKUYAGUARD); isExcute = true; } if (isExcute) self.AP = 1; } } }