This commit is contained in:
wulongxiao 2024-12-25 16:33:55 +08:00
parent a027e7752b
commit bd0c31fcf2
2 changed files with 18 additions and 4 deletions

View File

@ -144,8 +144,7 @@ public class Bullet : MonoBehaviour
{ {
direction = 1; direction = 1;
} }
Crole.bloodLoss(new object[] { Crole, role.DamageCreate(), attackObj.damageTyp, role }, direction);
Crole.bloodLoss(new object[] { Crole, role.DamageCreate(), attackObj.damageTyp, role }, direction);
attackObj.bulltes.Remove(this.gameObject); attackObj.bulltes.Remove(this.gameObject);
if (myBulletType != BulletType.Spraying) if (myBulletType != BulletType.Spraying)

View File

@ -29,6 +29,15 @@ public enum Camp
Neutral Neutral
} }
public enum CharacterFlags
{
fly = 1 << 0,
land = 1 << 1,
big = 1 << 2,
min = 1 << 3,
}
/// <summary> /// <summary>
/// 角色基类,玩家处理事件 /// 角色基类,玩家处理事件
/// </summary> /// </summary>
@ -152,6 +161,12 @@ public class Role : Fun
public List<BUff> buffList = new List<BUff>(); public List<BUff> buffList = new List<BUff>();
public CharacterFlags Tags = 0;
public bool hasfalg(CharacterFlags flag)
{
return (Tags & flag) == flag;
}
/// <summary> /// <summary>
/// 储存buff /// 储存buff
@ -165,6 +180,7 @@ public class Role : Fun
public virtual async void Start() public virtual async void Start()
{ {
maxHp = hp; maxHp = hp;
SetSelfInfo(); SetSelfInfo();
@ -481,7 +497,6 @@ public class Role : Fun
{ {
// 生成普通伤害 // 生成普通伤害
float num = UnityEngine.Random.Range(MinAttack, MaxAttack); float num = UnityEngine.Random.Range(MinAttack, MaxAttack);
// 判断是否暴击 // 判断是否暴击
float critChance = UnityEngine.Random.Range(0f, 1f); // 生成一个0到1之间的随机数 float critChance = UnityEngine.Random.Range(0f, 1f); // 生成一个0到1之间的随机数
if (critChance < CritRate) // 如果暴击发生 if (critChance < CritRate) // 如果暴击发生