From bd0c31fcf25bc3eef01f19b9b6848cc1acf604f7 Mon Sep 17 00:00:00 2001
From: wulongxiao <2545507770@qq.com>
Date: Wed, 25 Dec 2024 16:33:55 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=BB=E5=87=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Role/Bullet.cs | 3 +--
Role/Role.cs | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Role/Bullet.cs b/Role/Bullet.cs
index ad1bc9d..5d4383e 100644
--- a/Role/Bullet.cs
+++ b/Role/Bullet.cs
@@ -144,8 +144,7 @@ public class Bullet : MonoBehaviour
{
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);
if (myBulletType != BulletType.Spraying)
diff --git a/Role/Role.cs b/Role/Role.cs
index db37310..bb2482c 100644
--- a/Role/Role.cs
+++ b/Role/Role.cs
@@ -29,6 +29,15 @@ public enum Camp
Neutral
}
+
+public enum CharacterFlags
+{
+ fly = 1 << 0,
+ land = 1 << 1,
+ big = 1 << 2,
+ min = 1 << 3,
+}
+
///
/// 角色基类,玩家处理事件
///
@@ -152,7 +161,13 @@ public class Role : Fun
public List buffList = new List();
-
+ public CharacterFlags Tags = 0;
+ public bool hasfalg(CharacterFlags flag)
+ {
+ return (Tags & flag) == flag;
+ }
+
+
///
/// 储存buff
///
@@ -165,6 +180,7 @@ public class Role : Fun
public virtual async void Start()
{
+
maxHp = hp;
SetSelfInfo();
@@ -481,7 +497,6 @@ public class Role : Fun
{
// 生成普通伤害
float num = UnityEngine.Random.Range(MinAttack, MaxAttack);
-
// 判断是否暴击
float critChance = UnityEngine.Random.Range(0f, 1f); // 生成一个0到1之间的随机数
if (critChance < CritRate) // 如果暴击发生