46 lines
1.2 KiB
C#
46 lines
1.2 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 HealSkill : SkillBase
|
|
{
|
|
public HealSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
Score = 4;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.HEAL;
|
|
}
|
|
|
|
// 治疗周围一圈的单位
|
|
public override void OnTurnStart(UnitData self, MapData mapData)
|
|
{
|
|
var selfUnitList = new HashSet<UnitData>();
|
|
mapData.GetUnitDataListByPlayerId(mapData.PlayerMap.SelfPlayerId, selfUnitList);
|
|
if (!mapData.GetGridDataByUnitId(self.Id, out var targetGrid)) return;
|
|
var roundGrid = mapData.GridMap.GetAroundGridData(1, 1, targetGrid);
|
|
foreach (var grid in roundGrid)
|
|
{
|
|
if (!mapData.GetUnitDataByGid(grid.Id, out var unit)) continue;
|
|
if (!selfUnitList.Contains(unit)) continue;
|
|
unit.Health += 5;
|
|
}
|
|
}
|
|
}
|
|
} |