Files
valheim/Assets/_Valheim/Scripts/Weapons/IceSkill.cs
2025-07-04 14:16:14 +08:00

41 lines
846 B
C#

using System.Collections;
using System.Collections.Generic;
using DragonLi.Core;
using Mirror;
using UnityEngine;
using Valheim;
public class IceSkill : NetworkBehaviour
{
public float Atk = 10f;
public float AtkFre = 1f;
public float AreaRange = 3f;
private int AllFrame = 0;
public void Update()
{
if (isServer)
{
AllFrame++;
if (AllFrame % (int)(60 * AtkFre) == 0)
{
IceOnce();
}
}
}
public void IceOnce()
{
List<int> enemyIds = GameManager.Ins.GetRangeEnemyId(transform.position, AreaRange);
foreach (int id in enemyIds)
{
Enemy enemy = GameManager.Ins.EnemyList[id];
if (enemy != null)
{
enemy.Iced(Atk);
}
}
}
}