攻击
This commit is contained in:
parent
a027e7752b
commit
bd0c31fcf2
@ -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)
|
||||
|
19
Role/Role.cs
19
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,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色基类,玩家处理事件
|
||||
/// </summary>
|
||||
@ -152,7 +161,13 @@ public class Role : Fun
|
||||
|
||||
public List<BUff> buffList = new List<BUff>();
|
||||
|
||||
|
||||
public CharacterFlags Tags = 0;
|
||||
public bool hasfalg(CharacterFlags flag)
|
||||
{
|
||||
return (Tags & flag) == flag;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 储存buff
|
||||
/// </summary>
|
||||
@ -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) // 如果暴击发生
|
||||
|
Loading…
Reference in New Issue
Block a user