Exemplo n.º 1
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag.Equals("HostileProjectile"))
        {
            //Debug.Log ("Ouch! Hit by a projectile" + this.tag);

            Attack att = collision.gameObject.GetComponent <ProjectileScript> ().AttackData;

            BeingAttackedEventArgs args = new BeingAttackedEventArgs(att, this);

            OnBeingHit(args);
        }
    }
Exemplo n.º 2
0
    public void RegisterBeingAttacked(BeingAttackedEventArgs args)
    {
        List <KeyValuePair <ActorStatsDeclaration, StatMutator> > temp = args.TheAttack.GetStatChanges();

        foreach (KeyValuePair <ActorStatsDeclaration, StatMutator> pair in temp)
        {
            Mechanics.AddMutator(pair.Key, pair.Value);
        }

        Mechanics.Health.ApplyDamage(args.TheAttack.CalculateDamage());

        LastAttacker = args.TheAttack.Attacker;

        // Animator dostaje informacje że postać dostała trafiona
        // Rozpatrz przypadek gdy postać oberwała krytyka
    }
Exemplo n.º 3
0
    public void CreateMeleeAttack(Attack att, string targetTag)
    {
        Collider[] result = Physics.OverlapSphere(
            transform.position,
            GetComponent <CapsuleCollider> ().radius + 1.2f,
            1 << (targetTag.Equals("AlliedCharacters") ? 8 : 9));

        Collider target = (result.Length > 0)? result[GameRandom.NextInt(result.Length)] : null;

        if (targetTag != null && target != null)
        {
            BeingAttackedEventArgs args = new BeingAttackedEventArgs(att, this);

            target.gameObject.GetComponent <ActorScript> ().HurtActor(args);
        }
    }
Exemplo n.º 4
0
 private void GetFucked(BeingAttackedEventArgs args)
 {
     //Debug.Log ("OnBeingHit: Get F****d");
 }
Exemplo n.º 5
0
 public GotHitEventArgs(BeingAttackedEventArgs args)
 {
     Args = args;
 }
Exemplo n.º 6
0
 private void GetFucked(BeingAttackedEventArgs args)
 {
 }
Exemplo n.º 7
0
 public void HurtActor(BeingAttackedEventArgs args)
 {
     OnBeingHit(args);
 }