Files
XMen/Assets/Scripts/Weapons/Bullets/TurretBullet.cs
2025-07-10 14:49:53 +08:00

24 lines
629 B
C#

using System.Collections;
using System.Collections.Generic;
using DragonLi.Frame;
using UnityEngine;
public class TurretBullet : Bullet
{
public override void OnApplyDamage(IDamagable damagable)
{
int id = (int)BulletType.Turret;
int[] damages = GameManager.Ins.BulletDescInfos[id].Damage;
int randomDamage = Random.Range(damages[0], damages[1]);
bool IsCriticalHit = false;
if (randomDamage > (damages[1] - (damages[1] - damages[0]) * 0.35f))
{
IsCriticalHit = true;
}
damagable.ApplyDamage(randomDamage, IsCriticalHit, transform);
}
}