2026-03-31 15:28:39 +08:00

76 lines
2.1 KiB
C#

/*
* @Author: 白哉
* @Description:
* @Date: 2025年04月23日 星期三 21:04:18
* @Modify:
*/
using RuntimeData;
using System;
using System.Collections.Generic;
using System.Linq;
using MemoryPack;
using UnityEngine;
namespace Logic.Skill
{
public partial class DashSkill : SkillBase
{
public bool IsTrigger = false;
public override void OnRefresh()
{
IsTrigger = false;
}
public override void OnTurnStart(IdentifierBase identifier, MapData mapData)
{
IsTrigger = false;
}
public override bool ReservedOnTransform(UnitData self, UnitFullType fullType)
{
Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(self.UnitFullType, out var originInfo);
Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(fullType, out var targetInfo);
//如果变形情况是carry相关的
if (originInfo.Skills.Contains(SkillType.CARRY) != targetInfo.Skills.Contains(SkillType.CARRY))
{
return false;
}
return true;
}
public DashSkill()
{
IsPermanent = true;
TurnsLimit = 0;
Score = 4;
}
public override SkillType GetSkillType()
{
return SkillType.DASH;
}
public override void OnDamageOther(MapData mapData, SettlementInfo info)
{
if (info.DamageType != DamageType.ActiveAttack) return;
IsTrigger = true;
}
public override void OnHealOther(MapData mapData, UnitData origin,UnitData target, HealType healType)
{
if (healType != HealType.AttackAllyHeal) return;
IsTrigger = true;
}
public override void OnMove(UnitData self, GridData grid, MapData mapData, MoveType moveType, List<Vector2Int> path = null)
{
if (IsTrigger) return;
if (moveType == MoveType.ActiveMove) self.AddActionPoint(ActionPointType.Attack);
if(self.UnitType == UnitType.MoriyaKnight && moveType == MoveType.SkillMove)self.AddActionPoint(ActionPointType.Attack);
}
}
}