예제 #1
0
 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;
 }
예제 #2
0
    protected virtual void Attack(BaseLive other)
    {
        m_buffReceive.OnPreAttackFunc.Invoke(DamagePackUs);
        DamagePack pack = DealAttack(other);

        other.BeHurted(pack);
        m_buffReceive.OnNextAttackFunc.Invoke(DamagePackUs);
    }
예제 #3
0
 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));
 }
예제 #4
0
 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);
 }
예제 #5
0
    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>");
    }
예제 #6
0
    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);
    }
예제 #7
0
 public DamageOverTimeStatusEffect(Status owner, DamagePack damagePack, Persistance persistance, int duration) : base(owner, persistance, duration)
 {
     DamagePack = damagePack;
 }
예제 #8
0
 public void AddDamagePack(DamagePack damagePack)
 {
     DamagePack.Add(damagePack);
 }
예제 #9
0
 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)
     });
 }
예제 #11
0
 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
     });
 }
예제 #12
0
 protected abstract void DealHurted(DamagePack pack);
예제 #13
0
 public virtual void BeHurted(DamagePack pack)
 {
     m_buffReceive.OnPreHurtFunc.Invoke(pack);
     DealHurted(pack);
     m_buffReceive.OnNextHurtFunc.Invoke(pack);
 }
예제 #14
0
 public void Apply(DamagePack damagePack)
 {
 }
예제 #15
0
 /// <summary>
 /// 4
 /// </summary>
 public abstract void OnNextHurted(DamagePack pack);
예제 #16
0
 /// <summary>
 /// 3
 /// </summary>
 public abstract void OnPreHurted(DamagePack pack);
예제 #17
0
 /// <summary>
 /// 2
 /// </summary>
 public abstract void OnNextAttack(DamagePack pack);
예제 #18
0
 /// <summary>
 /// 1
 /// </summary>
 public abstract void OnPreAttack(DamagePack pack);