コード例 #1
0
ファイル: Explosion.cs プロジェクト: Basipek/unitystation
        //https://www.geeksforgeeks.org/bresenhams-circle-drawing-algorithm/
        // Function for circle-generation
        // using Bresenham's algorithm
        static void circleBres(ExplosionData explosionData, int xc, int yc, int r)
        {
            int x = 0, y = r;
            int d = 3 - 2 * r;

            drawCircle(explosionData, xc, yc, x, y);
            while (y >= x)
            {
                // for each pixel we will
                // draw all eight pixels

                x++;

                // check for decision parameter
                // and correspondingly
                // update d, x, y
                if (d > 0)
                {
                    y--;
                    d = d + 4 * (x - y) + 10;
                }
                else
                {
                    d = d + 4 * x + 6;
                }

                drawCircle(explosionData, xc, yc, x, y);
                //delay(50);
            }
        }
コード例 #2
0
        private void DoSafeExplosion(Vector2 position)
        {
            ExplosionData data = DataCloners.CopyExplosionData(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData);

            data.ignoreList.Add(Owner.specRigidbody);
            Exploder.Explode(position, data, Vector2.zero);
        }
コード例 #3
0
ファイル: Explode.cs プロジェクト: BigPig96/Cubechero
 public Explode(ExplosionData data)
 {
     _damage       = data.damage;
     _lesionRadius = data.lesionRadius;
     _targets      = new Collider[data.maxTargets];
     _damageMask   = data.targetsMask;
 }
コード例 #4
0
    public void Hit(ExplosionData explosion)
    {
        rigidbody.isKinematic = false;
        collider.enabled      = true;

        rigidbody.AddExplosionForce(1000.0f, explosion.position - new Vector3(0.0f, 2.5f, 0.0f), explosion.size + 2.5f);
    }
コード例 #5
0
 public void AddExplosion(ExplosionData edata, GameTime gameTime)
 {
     for (int i = 0; i < edata.NumberOfParticles; i++)
     {
         AddExplosionParticle(edata.Position, edata.Size, edata.MinAngle, edata.MaxAngle, edata.MaxAge, gameTime, edata.CustomTexture);
     }
 }
コード例 #6
0
 IEnumerator SetOffExplosion(ExplosionData e)
 {
     yield return new WaitForSeconds(e.delay);
     GameObject explosion = (GameObject) Instantiate(e.explosion);
     explosion.transform.position = this.transform.position + e.offset;
     explosion.transform.parent = this.transform.parent;
     explosion.GetComponent<Detonator>().Explode();
 }
コード例 #7
0
 private void OnDestruction(Projectile bullet)
 {
     if (Owner && Owner.specRigidbody)
     {
         ExplosionData LinearChainExplosionData = Gungeon.Game.Items["katana_bullets"].GetComponent <ComplexProjectileModifier>().LinearChainExplosionData.CopyExplosionData();
         LinearChainExplosionData.ignoreList.Add(Owner.specRigidbody);
         Exploder.Explode(bullet.specRigidbody.UnitCenter, LinearChainExplosionData, Vector2.zero);
     }
 }
コード例 #8
0
    public void Hit(ExplosionData explosion)
    {
        health -= explosion.damage;

        if (health <= 0)
        {
            Die(explosion);
        }
    }
コード例 #9
0
        public void DoSafeExplosion(Vector3 position)
        {
            ExplosionData defaultSmallExplosionData2 = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData;

            this.smallPlayerSafeExplosion.effect     = defaultSmallExplosionData2.effect;
            this.smallPlayerSafeExplosion.ignoreList = defaultSmallExplosionData2.ignoreList;
            this.smallPlayerSafeExplosion.ss         = defaultSmallExplosionData2.ss;
            Exploder.Explode(position, this.smallPlayerSafeExplosion, Vector2.zero, null, false, CoreDamageTypes.None, false);
        }
コード例 #10
0
    private static string resourcePath = "CustomItems/Resources/P2/sticky_bomb"; //Refers to an embedded png in the project. Make sure to embed your resources!

    public static void Init()
    {
        GameObject obj  = new GameObject();
        var        item = obj.AddComponent <StickyBomb>();

        ItemBuilder.AddSpriteToObject(itemID, resourcePath, obj);

        string shortDesc = "Get it off me!";
        string longDesc  = "5% chance on hit to attach a bomb to an enemy, detonating for 2000% of your base damage.\n\n" +
                           "See the orange end? Don't touch it.";

        ItemBuilder.SetupItem(item, shortDesc, longDesc, "kts");
        item.quality = PickupObject.ItemQuality.C;

        stickyBombPrefab = SpriteBuilder.SpriteFromResource(resourcePath).GetComponent <tk2dSprite>().gameObject;
        GameObject.DontDestroyOnLoad(stickyBombPrefab);
        FakePrefab.MarkAsFakePrefab(stickyBombPrefab);
        stickyBombPrefab.SetActive(false);

        var explosionTemplate = Gungeon.Game.Items["c4"].GetComponent <RemoteMineItem>().objectToSpawn.GetComponent <RemoteMineController>().explosionData;

        explosionData = new ExplosionData()
        {
            useDefaultExplosion = false,
            doDamage            = true,
            forceUseThisRadius  = false,
            damageRadius        = 2.5f,
            damageToPlayer      = 0,
            damage                       = 60f,
            breakSecretWalls             = false,
            secretWallsRadius            = 4.5f,
            forcePreventSecretWallDamage = false,
            doDestroyProjectiles         = true,
            doForce                      = true,
            pushRadius                   = 6f,
            force                  = 50f,
            debrisForce            = 50f,
            preventPlayerForce     = false,
            explosionDelay         = 0.1f,
            usesComprehensiveDelay = false,
            comprehensiveDelay     = 0f,
            effect                 = explosionTemplate.effect,
            doScreenShake          = true,
            ss = explosionTemplate.ss,
            doStickyFriction             = true,
            doExplosionRing              = true,
            isFreezeExplosion            = false,
            freezeRadius                 = 0f,
            freezeEffect                 = null,
            playDefaultSFX               = true,
            IsChandelierExplosion        = false,
            rotateEffectToNormal         = false,
            ignoreList                   = explosionTemplate.ignoreList,
            overrideRangeIndicatorEffect = null,
        };
    }
コード例 #11
0
            public override void OnBeamHit(Vector2 contact, Projectile projectile)
            {
                if (projectile)
                {
                    ExplosionData explosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;
                    explosion.damage = 130; explosion.doDestroyProjectiles = true;

                    Exploder.Explode(contact, explosion, Vector2.zero, damageTypes: projectile.damageTypes);
                }
            }
コード例 #12
0
        public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1)
        {
            base.OnEffectApplied(actor, effectData, partialAmount);
            AIActor        Grenade            = EnemyDatabase.GetOrLoadByGuid("4d37ce3d666b4ddda8039929225b7ede");
            ExplodeOnDeath DoYouWantToExplode = actor.gameObject.AddComponent <ExplodeOnDeath>();
            ExplosionData  explosionData      = Grenade.GetComponent <ExplodeOnDeath>().explosionData;

            explosionData.damageToPlayer     = 0;
            DoYouWantToExplode.explosionData = explosionData;
        }
コード例 #13
0
ファイル: MithrixHammer.cs プロジェクト: Some-Bunny/BunnyMod
        public void Blam(Vector3 position)
        {
            AkSoundEngine.PostEvent("Play_OBJ_nuke_blast_01", gameObject);
            ExplosionData defaultSmallExplosionData2 = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData;

            this.smallPlayerSafeExplosion.effect     = defaultSmallExplosionData2.effect;
            this.smallPlayerSafeExplosion.ignoreList = defaultSmallExplosionData2.ignoreList;
            this.smallPlayerSafeExplosion.ss         = defaultSmallExplosionData2.ss;
            Exploder.Explode(position, this.smallPlayerSafeExplosion, Vector2.zero, null, false, CoreDamageTypes.None, false);
        }
コード例 #14
0
        private IEnumerator HandleEnemySuck(AIActor target)
        {
            Transform copySprite = this.CreateEmptySprite(target);

            if (this.m_owner.PlayerHasActiveSynergy("#RELODIN_-_EXPLODIN"))
            {
                ExplosionData explosionData = new ExplosionData();
                explosionData.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData);
                explosionData.damageToPlayer = 0f;
                Exploder.Explode(target.sprite.WorldCenter, explosionData, new Vector2());
            }
            if (this.m_owner.PlayerHasActiveSynergy("RECYCLE_COLLECT_AND_USE") && UnityEngine.Random.value <= 0.05f)
            {
                GenericLootTable singleItemRewardTable = GameManager.Instance.RewardManager.CurrentRewardData.SingleItemRewardTable;
                LootEngine.SpawnItem(singleItemRewardTable.SelectByWeight(false), this.m_owner.CenterPosition, Vector2.up, 1f, true, false, false);
            }
            Vector3 startPosition = copySprite.transform.position;
            float   elapsed       = 0f;
            float   duration      = 0.5f;

            while (elapsed < duration)
            {
                elapsed += BraveTime.DeltaTime;
                if (this.m_owner.CurrentGun && copySprite)
                {
                    Vector3 position = this.m_owner.CurrentGun.PrimaryHandAttachPoint.position;
                    float   t        = elapsed / duration * (elapsed / duration);
                    copySprite.position   = Vector3.Lerp(startPosition, position, t);
                    copySprite.rotation   = Quaternion.Euler(0f, 0f, 360f * BraveTime.DeltaTime) * copySprite.rotation;
                    copySprite.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), t);
                }
                yield return(null);
            }
            if (copySprite)
            {
                UnityEngine.Object.Destroy(copySprite.gameObject);
            }
            if (this.m_owner.CurrentGun)
            {
                this.m_owner.CurrentGun.GainAmmo(1);
                if (this.m_owner.PlayerHasActiveSynergy("#OILER_CYLINDER") && UnityEngine.Random.value <= 0.25f)
                {
                    this.m_owner.CurrentGun.GainAmmo(1);
                }
            }
            if (this.m_owner.PlayerHasActiveSynergy("#SIXTHER_CHAMBER"))
            {
                DevilishSynergy();
            }
            if (this.m_owner.PlayerHasActiveSynergy("#YELLOWER_CHAMBER"))
            {
                KaliberSynergy();
            }
            yield break;
        }
コード例 #15
0
            public void Execute(int index)
            {
                var explosionData = new ExplosionData
                {
                    position = positions[index].Value,
                    range    = shells[index].explosionRadius,
                    damage   = shells[index].explosionDamage
                };

                explosions[index] = explosionData;
            }
コード例 #16
0
ファイル: Explosion.cs プロジェクト: Basipek/unitystation
 // Function to put Locations
 // at subsequence points
 static void drawCircle(ExplosionData explosionData, int xc, int yc, int x, int y)
 {
     explosionData.CircleCircumference.Add(new Vector2Int(xc + x, yc + y));
     explosionData.CircleCircumference.Add(new Vector2Int(xc - x, yc + y));
     explosionData.CircleCircumference.Add(new Vector2Int(xc + x, yc - y));
     explosionData.CircleCircumference.Add(new Vector2Int(xc - x, yc - y));
     explosionData.CircleCircumference.Add(new Vector2Int(xc + y, yc + x));
     explosionData.CircleCircumference.Add(new Vector2Int(xc - y, yc + x));
     explosionData.CircleCircumference.Add(new Vector2Int(xc + y, yc - x));
     explosionData.CircleCircumference.Add(new Vector2Int(xc - y, yc - x));
 }
コード例 #17
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Aegis Gun", "aegis");

            Game.Items.Rename("outdated_gun_mods:aegis_gun", "spapi:aegis_gun");
            gun.gameObject.AddComponent <AegisGunController>();
            GunExt.SetShortDescription(gun, "En Guarde!");
            GunExt.SetLongDescription(gun, "Reloading shields enemy bullets.\n\nThis handgun was made out of a sword. Through, the melee abilities of the sword it was made from were completelly nullified, so this weapon doesn't anger the" +
                                      " jammed.");
            GunExt.SetupSprite(gun, null, "aegis_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(464) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.DefaultTintColor      = new Color(1, 1, 1).WithAlpha(0.45f);
            projectile.HasDefaultTint        = true;
            projectile.name = "Explosive_Aegis_Shell";
            ExplosionData data = (PickupObjectDatabase.GetById(81) as Gun).DefaultModule.projectiles[0].GetComponent <ExplosiveModifier>().explosionData.CopyExplosionData();

            data.doDestroyProjectiles = false;
            data.doForce = false;
            data.damage *= 0.35f;
            ExplosiveModifier mod = projectile.gameObject.GetOrAddComponent <ExplosiveModifier>();

            mod.explosionData                     = data;
            gun.reloadClipLaunchFrame             = 0;
            gun.DefaultModule.cooldownTime        = 0.2f;
            gun.DefaultModule.numberOfShotsInClip = 4;
            gun.reloadTime = 1.4f;
            gun.SetBaseMaxAmmo(150);
            gun.quality            = PickupObject.ItemQuality.B;
            gun.gunSwitchGroup     = Toolbox.GetGunById(380).gunSwitchGroup;
            gun.muzzleFlashEffects = Toolbox.GetGunById(334).muzzleFlashEffects;
            gun.barrelOffset.transform.localPosition = new Vector3(0.9f, 0.55f, 0f);
            gun.encounterTrackable.EncounterGuid     = "aegis_junk";
            AdvancedDualWieldSynergyProcessor dualWieldController = gun.gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();

            dualWieldController.SynergyNameToCheck = "#SHIELD_BROS";
            dualWieldController.PartnerGunID       = 380;
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(380);
        }
コード例 #18
0
    /*
     *  1: petite explo (mine qui pete, small smoke trail only, no fire)
     *  2: med/Large explo orange / rouge + etincelles (pas vraiment explo)
     *  3: redish fire, flamme rouge montante + bcp black smoke
     *  4: redish idem, larger
     *  5: yellow/orange expl, +bcp black smoke
     *  6 :idem
     *  7: vomit, 8: gore block explo
     *  9: like 6
     *
     *  10: molotov (fire ball when in the air)
     *  11-12: yellow etincelles only, no smoke
     *  13: orange boom no smoke, like 1
     *  14-19: crée un bout de bidons détruit
     *  14: le bout part en l'air avec une trainée de flamme ("napalm")
     *  15/ 16: additionnal "napalm"
     */

    public override void Execute(List <string> _params, CommandSenderInfo _senderInfo)
    {
        Printer.Print("ConsoleCmdExplShowExplo", _params);
        EntityPlayerLocal player = GameManager.Instance.World.GetLocalPlayers()[0];

        if (_params[0] == "p")
        {
            Color color = Color.white;
            if (_params.Count >= 3)
            {
                string[] split = _params[2].Split(',');
                float[]  def   = new float[] { 0, 0, 0, 1 };
                for (int k = 0; k < split.Length; k++)
                {
                    def[k] = float.Parse(split[k]);
                }
                color = new Color(def[0], def[1], def[2], def[3]);
            }
            Printer.Print(color);
            ExecuteParticle(_params[1], player.GetPosition() + new Vector3(0, 0, 6), color);
            return;
        }
        else if (_params[0] == "pa")
        {
            ExecuteParticleAttach(_params[1], player.GetPosition());
            return;
        }
        else if (_params[0] == "pg")
        {
            ExecuteParticleGhost(_params[1], player.GetPosition());
            return;
        }
        else if (_params[0] == "s")
        {
            float intens = 1f;
            if (_params.Count > 0)
            {
                intens = float.Parse(_params[1]);
            }
            ExecuteScreenEffect(_params[1]);
            return;
        }
        int ei = int.Parse(_params[0]);

        Emplacement place = Emplacement.At(player.GetPosition() + new Vector3(0, 1, 10), Vectors.Float.Zero); // N

        ItemClass         itemClass = ItemClass.GetItemClass("thrownAmmoMolotovCocktail", false);
        DynamicProperties baseProps = itemClass.Properties;
        ExplosionData     ed        = new ExplosionData(baseProps);

        ed.ParticleIndex = ei;
        GameManager.Instance.ExplosionServer(0, place.position, place.ipos, Quaternion.identity, ed, player.entityId, 0.1f, false, null); // try -1
    }
コード例 #19
0
ファイル: SkillData.cs プロジェクト: RogueCollab/RogueEssence
        public SkillData()
        {
            Name    = new LocalText();
            Desc    = new LocalText();
            Comment = "";

            Data      = new BattleData();
            Explosion = new ExplosionData();

            Strikes      = 1;
            HitboxAction = new AttackAction();
        }
コード例 #20
0
 protected override void OnPickedUpByPlayer(PlayerController player)
 {
     if (DataForProjectiles == null)
     {
         DataForProjectiles = DataCloners.CopyExplosionData(StaticExplosionDatas.explosiveRoundsExplosion);
     }
     if (!DataForProjectiles.ignoreList.Contains(player.specRigidbody))
     {
         DataForProjectiles.ignoreList.Add(player.specRigidbody);
     }
     base.OnPickedUpByPlayer(player);
 }
コード例 #21
0
    private void Die(ExplosionData explosion)
    {
        collider.enabled = false;

        for (int i = 0; i < parts.Count; ++i)
        {
            parts[i].Hit(explosion);
        }

        PlayerUI.instance.AddScore(5);

        Invoke("ResetParts", 10.0f);
    }
コード例 #22
0
 // Token: 0x0600017A RID: 378 RVA: 0x0001376C File Offset: 0x0001196C
 public static ExplosionData CopyExplosionData(this ExplosionData other)
 {
     return(new ExplosionData
     {
         useDefaultExplosion = other.useDefaultExplosion,
         doDamage = other.doDamage,
         forceUseThisRadius = other.forceUseThisRadius,
         damageRadius = other.damageRadius,
         damageToPlayer = other.damageToPlayer,
         damage = other.damage,
         breakSecretWalls = other.breakSecretWalls,
         secretWallsRadius = other.secretWallsRadius,
         forcePreventSecretWallDamage = other.forcePreventSecretWallDamage,
         doDestroyProjectiles = other.doDestroyProjectiles,
         doForce = other.doForce,
         pushRadius = other.pushRadius,
         force = other.force,
         debrisForce = other.debrisForce,
         preventPlayerForce = other.preventPlayerForce,
         explosionDelay = other.explosionDelay,
         usesComprehensiveDelay = other.usesComprehensiveDelay,
         comprehensiveDelay = other.comprehensiveDelay,
         effect = other.effect,
         doScreenShake = other.doScreenShake,
         ss = new ScreenShakeSettings
         {
             magnitude = other.ss.magnitude,
             speed = other.ss.speed,
             time = other.ss.time,
             falloff = other.ss.falloff,
             direction = new Vector2
             {
                 x = other.ss.direction.x,
                 y = other.ss.direction.y
             },
             vibrationType = other.ss.vibrationType,
             simpleVibrationTime = other.ss.simpleVibrationTime,
             simpleVibrationStrength = other.ss.simpleVibrationStrength
         },
         doStickyFriction = other.doStickyFriction,
         doExplosionRing = other.doExplosionRing,
         isFreezeExplosion = other.isFreezeExplosion,
         freezeRadius = other.freezeRadius,
         freezeEffect = other.freezeEffect,
         playDefaultSFX = other.playDefaultSFX,
         IsChandelierExplosion = other.IsChandelierExplosion,
         rotateEffectToNormal = other.rotateEffectToNormal,
         ignoreList = other.ignoreList,
         overrideRangeIndicatorEffect = other.overrideRangeIndicatorEffect
     });
 }
コード例 #23
0
        public ItemData()
        {
            Name    = new LocalText();
            Desc    = new LocalText();
            Icon    = -1;
            Comment = "";

            ItemStates = new StateCollection <ItemState>();

            UseAction = new AttackAction();
            Explosion = new ExplosionData();
            UseEvent  = new BattleData();
            ThrowAnim = new Content.AnimData();
        }
コード例 #24
0
 public static ExplosionData Lightning2()
 {
     if (_lightning2 == null)
     {
         _lightning2 = new ExplosionData
         {
             Delay      = 1000,
             Animations = Sprites.CthulhuLightning2,
             Size       = 75,
             Damage     = 55
         };
     }
     return(_lightning2);
 }
コード例 #25
0
    protected override void OnUpdate()
    {
        var ecb = m_endSimulationEntityCommandBufferSystem.CreateCommandBuffer().ToConcurrent();

        var randomLinearVelocityArray  = new NativeArray <float3>(2, Allocator.TempJob);
        var randomAngularVelocityArray = new NativeArray <float3>(2, Allocator.TempJob);

        for (var i = 0; i < randomAngularVelocityArray.Length; i++)
        {
            randomLinearVelocityArray[i]  = new float3(m_random.NextFloat(-2, 2), m_random.NextFloat(3, 5), 0);
            randomAngularVelocityArray[i] = new float3(m_random.NextFloat(-2, 2), m_random.NextFloat(5, 10), m_random.NextFloat(6, 10));
        }

        Entities.WithoutBurst().ForEach((Entity _entity, int entityInQueryIndex, ref DestroyComponent _sliceComponent,
                                         ref
                                         Translation _translation, ref Cutable _cutable) =>
        {
            var explosionData = new ExplosionData
            {
                m_position = _translation.Value,
                m_type     = 0
            };

            EntityDestroyEventListener.DetectEvent(explosionData);

            for (int i = 0; i < _cutable.m_numberOfParts; i++)
            {
                var halfFruit = ecb.Instantiate(entityInQueryIndex, _cutable.m_cutEntity);
                ecb.SetComponent(entityInQueryIndex, halfFruit, new Translation
                {
                    Value = _translation.Value
                });

                ecb.SetComponent(entityInQueryIndex, halfFruit, new Rotation()
                {
                    Value = Quaternion.Euler(0, i * 180, 0)
                });

                ecb.SetComponent(entityInQueryIndex, halfFruit, new PhysicsVelocity()
                {
                    Linear  = randomLinearVelocityArray[i],
                    Angular = randomAngularVelocityArray[i]
                });
            }
            ecb.DestroyEntity(entityInQueryIndex, _entity);
        }).WithDeallocateOnJobCompletion(randomLinearVelocityArray).WithDeallocateOnJobCompletion(randomAngularVelocityArray)
        .ScheduleParallel();

        m_endSimulationEntityCommandBufferSystem.AddJobHandleForProducer(this.Dependency);
    }
コード例 #26
0
        public static void Explode(Vector3 position, ExplosionData data, Vector2 sourceNormal, Action onExplosionBegin = null, bool ignoreQueues = false, CoreDamageTypes damageTypes = CoreDamageTypes.None, bool ignoreDamageCaps = false)
        {
            if (ChaosConsole.explosionQueueDisabled)
            {
                ignoreQueues = true;
            }

            if (data.useDefaultExplosion && data != GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData)
            {
                DoDefaultExplosion(position, sourceNormal, onExplosionBegin, ignoreQueues, damageTypes, ignoreDamageCaps);
            }
            else
            {
                GameObject gameObject = new GameObject("temp_explosion_processor", new Type[] { typeof(ChaosExploder) });
                gameObject.GetComponent <ChaosExploder>().DoExplode(position, data, sourceNormal, onExplosionBegin, ignoreQueues, damageTypes, ignoreDamageCaps);
            }
        }
コード例 #27
0
    private void Explode(Collider other)
    {
        isFired = false;

        var explosion = new ExplosionData(transform.position, 5.0f, damage);

        Debug.Log("Send explosion message to all in nearby area.");

        var objects = new List <Collider>(Physics.OverlapSphere(transform.position, 5.0f));

        for (int i = 0; i < objects.Count; ++i)
        {
            objects[i].gameObject.SendMessage("Hit", explosion, SendMessageOptions.DontRequireReceiver);
        }

        playerMech.ReturnMissile(this);
        fireCone.gameObject.SetActive(false);
    }
コード例 #28
0
ファイル: BCMEntityClass.cs プロジェクト: xorex/BadCompanySM
 public BCMExplosionData(ExplosionData expl)
 {
     Particle   = expl.ParticleIndex;
     BlockR     = expl.BlockRadius;
     EntityR    = expl.EntityRadius;
     BuffsR     = expl.BuffsRadius;
     BlastPower = expl.BlastPower;
     EntityDam  = expl.EntityDamage;
     BlockDam   = expl.BlockDamage;
     //todo:
     //damageMultiplier = expl.damageMultiplier;
     if (expl.BuffActions != null)
     {
         foreach (var buff in expl.BuffActions)
         {
             Buffs.Add(buff.Class?.Name);
         }
     }
 }
コード例 #29
0
        private void ReaverBeat(Projectile projectile)
        {
            this.Boom(projectile.sprite.WorldCenter);
            bool flag = projectile != null;

            if (flag)
            {
                PlayerController playerController = this.gun.CurrentOwner as PlayerController;
                Vector2          a = playerController.sprite.WorldCenter - projectile.sprite.WorldCenter;
                playerController.knockbackDoer.ApplyKnockback(-a, 0f, false);
                Projectile        projectile1   = ((Gun)ETGMod.Databases.Items[180]).DefaultModule.projectiles[0];
                ExplosiveModifier component     = projectile.GetComponent <ExplosiveModifier>();
                ExplosionData     explosionData = component.explosionData;
                component.doDistortionWave     = true;
                component.explosionData.damage = 0f;
                Exploder.Explode(projectile.sprite.WorldCenter, explosionData, Vector2.zero, null, false, CoreDamageTypes.None, false);
                playerController.ForceBlank(0f, 0.5f, false, true, new Vector2?(projectile.sprite.WorldCenter), false, 300f);
            }
        }
コード例 #30
0
        public void Update(float dt)
        {
            if (m_queuedExplosions.Count <= 0)
            {
                return;
            }
            int x = m_queuedExplosions[0].X;
            int y = m_queuedExplosions[0].Y;
            int z = m_queuedExplosions[0].Z;

            m_pressureByPoint            = new SparseSpatialArray <float>(x, y, z, 0f);
            m_surroundingPressureByPoint = new SparseSpatialArray <SurroundingPressurePoint>(x, y, z, new SurroundingPressurePoint
            {
                IsIncendiary = false,
                Pressure     = 0f
            });
            m_projectilesCount = 0;
            m_generatedProjectiles.Clear();
            bool flag = false;
            int  num  = 0;

            while (num < m_queuedExplosions.Count)
            {
                ExplosionData explosionData = m_queuedExplosions[num];
                if (MathUtils.Abs(explosionData.X - x) <= 4 && MathUtils.Abs(explosionData.Y - y) <= 4 && MathUtils.Abs(explosionData.Z - z) <= 4)
                {
                    m_queuedExplosions.RemoveAt(num);
                    SimulateExplosion(explosionData.X, explosionData.Y, explosionData.Z, explosionData.Pressure, explosionData.IsIncendiary);
                    flag |= !explosionData.NoExplosionSound;
                }
                else
                {
                    num++;
                }
            }
            PostprocessExplosions(flag);
            if (!ShowExplosionPressure)
            {
                m_pressureByPoint            = null;
                m_surroundingPressureByPoint = null;
            }
        }
コード例 #31
0
 public ChaosKickableObject()
 {
     rollSpeed                 = 6f;
     rollAnimations            = null;
     goopFrequency             = 0.05f;
     goopRadius                = 1f;
     breakTimerLength          = 3f;
     RollingDestroysSafely     = false;
     triggersBreakTimer        = false;
     AllowTopWallTraversal     = true;
     explodesOnKick            = true;
     willDefinitelyExplode     = false;
     spawnObjectOnSelfDestruct = false;
     useDefaultExplosion       = false;
     hasRollingAnimations      = false;
     RollingBreakAnim          = "red_barrel_break";
     m_lastOutlineDirection    = (DungeonData.Direction)(-1);
     m_objectSpawned           = false;
     TableExplosionData        = EnemyDatabase.GetOrLoadByGuid("4d37ce3d666b4ddda8039929225b7ede").gameObject.GetComponent <ExplodeOnDeath>().explosionData;
 }