public void FlushBuffs() { for (int i = 0; i < EquipSlot.Length; i++) { if (EquipSlot[i].ItemChild != null && EquipSlot[i].ItemChild.GetComponent <FragmentItem>()) { m_PlayerStatus.AddStatusBuff(EquipSlot[i].ItemChild.GetComponent <FragmentItem>().ItemFragment.buffs); } } }
public override void UseSkill(Transform _trans) { if (MSkillStatus == SkillStatusEnum.Ready) { MSkillStatus = SkillStatusEnum.Continued; m_WaitTime = 0; status = _trans.parent.GetComponent <Status>(); status.AddStatusBuff(buffs); VFXControllerM.Instance.GetWindHelpFire(_trans, DurationTime); } }
/// <summary> /// 造成伤害 /// </summary> /// <param name="damager"></param> /// <param name="ignoreInvincible"></param> public void TakeDamage(TakeDamager damager, List <IBuff> buffs = null, bool ignoreInvincible = false) { AttackPoint = damager.hitPoint;//damager.AttackPoints[0].point; // 无敌,或忽略伤害 if ((m_Invulnerable && !ignoreInvincible) || CurrentHealth <= 0) { return; } //we can reach that point if the damager was one that was ignoring invincible state. //We still want the callback that we were hit, but not the damage to be removed from health. if (!m_Invulnerable) { // 如果身上带有buff, 则刷新buff时间持续时间和效果 -- 需求变为可以有相同 buff if (buffs != null) { foreach (IBuff buff in buffs) { if (buff != null) { status.AddStatusBuff(buff); //buff.BuffOnEnter(gameObject); } /* 需求变为可以有相同 buff * if (buff != null) * { * if (!status.ContainsStatusBuff(buff.getBuffType())) * { * status.AddStatusBuff(buff); * buff.BuffOnEnter(gameObject); * } * else * { * IBuff b = status.FindStatusBuff(buff.getBuffType()); * if (b != null && buff.LV > b.LV) b.FlushLV(b.LV); * } * }*/ } } if (damager.IsSpike() && status.StatusType != CharacterType.Boss) { status.HP -= float.MaxValue; } else { status.HP -= damager.CurrentDamagNum * status.HurtInfluences; } //Debug.Log( status.HP); OnHealthSet.Invoke(this); } m_DamageDirection = transform.position + (Vector3)centreOffset - damager.transform.position; OnTakeDamage.Invoke(damager, this); if (status.HP <= 0) { OnDie.Invoke(damager, this); //m_ResetHealthOnSceneReload = true; EnableInvulnerability(); if (disableOnDeath) { gameObject.SetActive(false); } } }