47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年04月23日 星期三 21:04:18
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System.Collections.Generic;
|
|
using RuntimeData;
|
|
using System;
|
|
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
[Serializable]
|
|
public class StompSkill : SkillBase
|
|
{
|
|
public StompSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
Score = 4;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.STOMP;
|
|
}
|
|
|
|
public override void OnMove(UnitData self, GridData grid, MapData mapData, MoveType moveType)
|
|
{
|
|
var selfUnitList = new HashSet<UnitData>();
|
|
mapData.GetUnitDataListByPlayerId(mapData.PlayerMap.SelfPlayerId, selfUnitList);
|
|
|
|
var roundGrids = mapData.GridMap.GetAroundGridData(1, 1, grid);
|
|
foreach (var roundGrid in roundGrids)
|
|
{
|
|
if (!mapData.GetUnitDataByGid(roundGrid.Id, out var unit)) continue;
|
|
if (selfUnitList.Contains(unit)) continue;
|
|
// 计算攻击伤害
|
|
var damage = Table.Instance.CalcDamage(mapData, self, unit, damagePara:0.5f);
|
|
Main.UnitLogic.Damage(mapData, self, unit, damage);
|
|
}
|
|
}
|
|
}
|
|
} |