Example #1
0
        void OnItemExploded(ExplosiveDynamicServer ItemExploded, IExplosion Explosion)
        {
            if (ItemExploded.name == "C4DynamicObject(Clone)" || ItemExploded.name == "TerritoryC4DynamicObject(Clone)")
            {
                bool    bZoneInterfering  = false;
                Vector3 ExplosionLocation = ItemExploded.networkView.InitialPosition;

                foreach (RaidBlockZone RBZ in RaidBlockedZones)
                {
                    double Distance = Math.Sqrt(Math.Pow(ExplosionLocation.x - RBZ.Location.x, 2) + Math.Pow(ExplosionLocation.y - RBZ.Location.y, 2));

                    if (Distance <= ZoneSize)
                    {
                        bZoneInterfering = true;
                    }
                }

                if (!bZoneInterfering)
                {
                    RaidBlockedZones.Add(new RaidBlockZone(ExplosionLocation, RaidTimer));

                    if (RaidBlockTimer == null)
                    {
                        StartTimer();
                    }

                    Puts("Created new raid zone: " + ExplosionLocation.ToString());
                }
            }
        }
    private void createExplosion()
    {
        GameObject explosion = Instantiate(Explosion, transform.position, Quaternion.identity);
        IExplosion exp       = explosion.GetComponent <IExplosion>();

        exp.SetDamage(mBulletDamage);
    }
 public void DeepCopyIn(
     IExplosion item,
     IExplosionGetter rhs,
     ErrorMaskBuilder?errorMask,
     TranslationCrystal?copyMask,
     bool deepCopy)
 {
     base.DeepCopyIn(
         (IFallout4MajorRecord)item,
         (IFallout4MajorRecordGetter)rhs,
         errorMask,
         copyMask,
         deepCopy: deepCopy);
 }
Example #4
0
        // IsExplosion Object
        private bool IsExplosionObject()
        {
            if (explosionObject != null)
            {
                m_Transform.position = nextPosition - m_Transform.forward; //nextPosition - prevPosition;

                IExplosion tmpExplosion = explosionObject.SpawnCopy(m_Transform.position, Random.rotation);

                tmpExplosion.SetHitMask(hitMask);
                tmpExplosion.StartExplode(owner);

                Destroy(gameObject);

                return(true);
            }

            return(false);
        }
Example #5
0
    public IExplosion GetExplosion(OfensiveType type)
    {
        IExplosion explosion = null;

        if (explosions.ContainsKey(type))
        {
            explosion = explosions[type];
        }
        else
        {
            switch (type)
            {
            case OfensiveType.Buff:
                explosion = new PoisonExplosion();
                break;

            case OfensiveType.Chain:
                explosion = new ChainExplosion();
                break;

            case OfensiveType.Debuff:
                explosion = new IceExplosion();
                break;

            case OfensiveType.Direct:
                explosion = new PoisonExplosion();
                break;

            case OfensiveType.Explosion:
                explosion = new FireExplosion();
                break;

            case OfensiveType.Poison:
                explosion = new PoisonExplosion();
                break;
            }

            explosions.Add(type, explosion);
        }

        return(explosion);
    }
 public void Explode(Collider2D target, AttackType type)
 {
     try
     {
         sprite.sprite = null;
         explosion     = ExplosionCache.GetInstance().GetExplosion(this.type.ofensiveType);
         if (explosion != null)
         {
             explosion.Explode(target, warHead, type);
             if (animator.runtimeAnimatorController != null)
             {
                 //Debug.Log("?");
                 animator.SetTrigger("Explosion");
             }
         }
     }
     catch (Exception e)
     {
         Debug.Log("  " + e);
     }
 }
 public void RemapLinks(IExplosion obj, IReadOnlyDictionary <FormKey, FormKey> mapping)
 {
     base.RemapLinks(obj, mapping);
 }