93 lines
2.6 KiB
C#
93 lines
2.6 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年10月12日 星期六 10:10:12
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System;
|
|
using MemoryPack;
|
|
using RuntimeData;
|
|
using TH1_Logic.Core;
|
|
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
public partial class PatchouliRestSkill : SkillBase
|
|
{
|
|
public PatchouliRestSkill()
|
|
{
|
|
IsLevelSkill = true;
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
//_level = 1;
|
|
Score = 2;
|
|
_levelLimit = 2;
|
|
_autoDisappear = false;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.PATCHOULIREST;
|
|
}
|
|
|
|
public override void AddLevel(MapData map, UnitData origin, UnitData self, int add)
|
|
{
|
|
if (self.GetSkill(SkillType.PATCHOULISTONEPRO, out _)) _levelLimit = 4;
|
|
else _levelLimit = 2;
|
|
base.AddLevel(map, origin, self, add);
|
|
|
|
var count = Main.PlayerLogic.UpdateSightByRadius_LogicView(map,self.Player(map),self.Grid(map),self.GetSightRange(map,self.Grid(map)));
|
|
self.HeroTask(map)?.OnExploredGrids(map,self,count);
|
|
|
|
}
|
|
|
|
public override int GetExtraSight(UnitData self, MapData mapData)
|
|
{
|
|
if (Level > 0) return Level;
|
|
return 0;
|
|
}
|
|
|
|
public override int GetExtraAttackRange(MapData mapData, UnitData self)
|
|
{
|
|
if(Level >= 2) return 1;
|
|
return 0;
|
|
}
|
|
|
|
public override void ReduceLevel(MapData map, UnitData origin, int reduce)
|
|
{
|
|
_level -= reduce;
|
|
if (_level >= 0) return;
|
|
|
|
var dmg = 3;
|
|
if (dmg >= origin.Health) dmg = origin.Health - 1;
|
|
Main.UnitLogic.DamageSettlement(map, origin, origin, dmg, DamageType.KillSelf);
|
|
_level = 0;
|
|
}
|
|
|
|
public override void OnTurnEnd(IdentifierBase identifier, MapData mapData)
|
|
{
|
|
var self = identifier as UnitData;
|
|
if (self == null) return;
|
|
if (_level <= 0) return;
|
|
Main.UnitLogic.RecoverHealth_Legacy(mapData, self, self, _level);
|
|
}
|
|
|
|
public override float GetAttackAdditionParam(MapData mapData, UnitData self, UnitData target = null)
|
|
{
|
|
return _level * 0.5f;
|
|
}
|
|
|
|
public override float GetDefenseAdditionParam(MapData mapData, UnitData self, UnitData target = null)
|
|
{
|
|
return _level * 0.5f;
|
|
}
|
|
|
|
public override bool ReservedOnTransform(UnitData self, UnitFullType fullType)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|