public BaseLive(int only_id, int id) { DamagePackUs = new DamagePack(this); m_buffReceive = new BuffReceive(this); m_onlyID = only_id; m_typeID = id; m_islive = true; }
protected virtual void Attack(BaseLive other) { m_buffReceive.OnPreAttackFunc.Invoke(DamagePackUs); DamagePack pack = DealAttack(other); other.BeHurted(pack); m_buffReceive.OnNextAttackFunc.Invoke(DamagePackUs); }
public void Damage(DamagePack dPack) { if (isDead) { return; } CurrentHealth -= dPack.damageAmount; Debug.Log(string.Format("<color=yellow>[{0}]</color> Player Received <color=red>{1}</color> damage", Time.time.ToString("F1"), dPack.damageAmount)); }
protected virtual void Attack(params BaseLive[] others) { m_buffReceive.OnPreAttackFunc.Invoke(DamagePackUs); for (int i = 0; i < others.Length; i++) { DamagePack pack = DealAttack(others[i]); others[i].BeHurted(pack); } m_buffReceive.OnNextAttackFunc.Invoke(DamagePackUs); }
public void EmitDamageEffect(DamagePack damagePack) { string debugMessage = ""; DamagedType damagedType = damagePack.damaged.damageType; if (RedirectionEvents.ContainsKey(damagedType)) { DamagerType damagerType = damagePack.damager.damagerType; if (RedirectionEvents[damagedType].ContainsKey(damagerType)) { RedirectionEvents[damagedType][damagerType](damagePack); return; } debugMessage = damagedType + " has no VFX function for " + damagerType + " loaded. Please add this."; } else { debugMessage = damagedType + " has no VFX functions loaded. Please add them."; } Debug.LogFormat("<color=#0000FF>" + debugMessage + "</color>"); }
private void EmitDirectionalBlood(DamagePack pack) { // Determine Position to emit blood from: Vector3 position = pack.damaged.owner.position; RaycastHit hit; if (Physics.Raycast(position, Vector3.down, out hit, 5F, LayerMasker.GetLayerMask(Layers.Ground))) { position = hit.point; } else { // We'll set the 'y' to zero which should be near the floor... position.y = 0; } // Obtain lateral impact direction Vector3 impactDir = pack.damager.impactDirection; Vector2 projectileDir = new Vector2(impactDir.x, impactDir.z); // Queue Up Blood with the GoreManager //GoreManager.Instance.QueueSplat(position, projectileDir); }
public DamageOverTimeStatusEffect(Status owner, DamagePack damagePack, Persistance persistance, int duration) : base(owner, persistance, duration) { DamagePack = damagePack; }
public void AddDamagePack(DamagePack damagePack) { DamagePack.Add(damagePack); }
protected override void DealHurted(DamagePack pack) { throw new System.NotImplementedException(); }
public static void ApplyDamagePack(this Ped ped, float damage, float multiplier, DamagePack damagePack) { Function.Call((Hash)5106960513763051839L, new InputArgument[4] { InputArgument.op_Implicit(((Entity)ped).get_Handle()), InputArgument.op_Implicit(damagePack.ToString()), InputArgument.op_Implicit(damage), InputArgument.op_Implicit(multiplier) }); }
public static void ApplyDamagePack(this Ped ped, float damage, float multiplier, DamagePack damagePack) { Function.Call(GTA.Native.Hash.APPLY_PED_DAMAGE_PACK, (InputArgument[])new InputArgument[4] { ped.Handle, damagePack.ToString(), damage, multiplier }); }
protected abstract void DealHurted(DamagePack pack);
public virtual void BeHurted(DamagePack pack) { m_buffReceive.OnPreHurtFunc.Invoke(pack); DealHurted(pack); m_buffReceive.OnNextHurtFunc.Invoke(pack); }
public void Apply(DamagePack damagePack) { }
/// <summary> /// 4 /// </summary> public abstract void OnNextHurted(DamagePack pack);
/// <summary> /// 3 /// </summary> public abstract void OnPreHurted(DamagePack pack);
/// <summary> /// 2 /// </summary> public abstract void OnNextAttack(DamagePack pack);
/// <summary> /// 1 /// </summary> public abstract void OnPreAttack(DamagePack pack);