47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description: 可隐匿技能
|
|
* @Date: 2026年03月06日
|
|
* @Modify:
|
|
*/
|
|
|
|
using RuntimeData;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using MemoryPack;
|
|
using TH1Renderer;
|
|
using UnityEngine;
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
public partial class CanHideSkill : SkillBase
|
|
{
|
|
public CanHideSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
Score = 4;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.CanHide;
|
|
}
|
|
|
|
public override void BeforeMove(UnitData self, GridData grid, MapData mapData, MoveType moveType, List<Vector2Int> path = null)
|
|
{
|
|
bool needVFX = !self.GetSkill(SkillType.HideState, out _);
|
|
self.AddOrOverrideSkill(SkillType.HideState, mapData, self.Id);
|
|
if (needVFX && self.InMainSight())
|
|
{
|
|
//播放雾气特效
|
|
self.Grid(mapData)?.Renderer(mapData)?.PlayVFXInSight(new GridVFXParams(GridVFXType.Fog));
|
|
//刷新origin的显示
|
|
self.Renderer(mapData)?.InstantUpdateUnit(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|