TH1/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/MokouFrenchEggSkill.cs
2025-10-25 02:37:16 +08:00

51 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: 白哉
* @Description:
* @Date: 2025年09月12日 星期四 17:09:18
* @Modify:
*/
using RuntimeData;
using System;
using MemoryPack;
using TH1_Logic.Core;
using Unity.VisualScripting;
namespace Logic.Skill
{
public partial class MokouFrenchEggSkill : SkillBase
{
public UnitFullType FullType;
public MokouFrenchEggSkill()
{
IsPermanent = true;
TurnsLimit = 0;
Score = 4;
}
public override SkillType GetSkillType()
{
return SkillType.MOKOUFRENCHEGG;
}
private void UpdateFullType(UnitData self)
{
FullType.UnitType = UnitType.KaguyaFrenchMokouEgg;
FullType.GiantType = GiantType.None;
FullType.UnitLevel = self.UnitFullType.UnitLevel;
}
public override void OnDamaged(MapData mapData, SettlementInfo info)
{
if (info == null || !info.IsKill || info.DamageTargetGrid == null || info.DamageTargetCity == null) return;
UpdateFullType(info.DamageTarget);
//如果要复活的位置上有地方单位先将对方passiveMove开
if (mapData.GetUnitDataByGid(info.DamageTargetGrid.Id, out var unit))
Main.UnitLogic.PassiveMoveAway(mapData,unit);
mapData.AddUnitData(info.DamageTargetGrid.Id, info.DamageTargetCity.Id, FullType,out var _);
}
}
}