TH1/Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/RedMistDefenseSkill.cs
2025-10-19 00:48:06 +08:00

44 lines
1.1 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年04月23日 星期三 21:04:18
* @Modify:
*/
using RuntimeData;
using System;
using MemoryPack;
namespace Logic.Skill
{
public partial class RedMistDefenseSkill : SkillBase
{
public RedMistDefenseSkill()
{
IsPermanent = true;
TurnsLimit = 0;
Score = 2;
}
public override SkillType GetSkillType()
{
return SkillType.REDMISTDEFENSE;
}
public override float GetDefenseMultiplicationParam(MapData mapData, UnitData self, UnitData target = null)
{
if (!mapData.GetGridDataByUnitId(self.Id, out var grid)) return 1f;
if (!grid.HasSpType(GridSpType.RemiliaGrid)) return 1f;
foreach(var t in self.Skills)
if (t.GetSkillType() != SkillType.REDMISTDEFENSE)
{
//如果有任何其他的防御加成则返回1f
if (t.GetDefenseMultiplicationParam(mapData, self, target) > 1f)
return 1f;
}
return 1.5f;
}
}
}