Exemplo n.º 1
0
        private void Command_Detonate()
        {
            radius = base.GetComp <CompExplosive>().props.explosiveRadius;
            dmgdef = base.GetComp <CompExplosive>().props.explosiveDamageType;
            BodyPartDamageInfo value         = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside));
            ExplosionInfo      explosionInfo = default(ExplosionInfo);

            explosionInfo.center = base.Position;
            explosionInfo.radius = radius;
            explosionInfo.dinfo  = new DamageInfo(dmgdef, 30, this, new BodyPartDamageInfo?(value), null);
            explosionInfo.Explode();
        }
        protected virtual void Explode()
        {
            this.Destroy(DestroyMode.Vanish);
            BodyPartDamageInfo value         = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside));
            ExplosionInfo      explosionInfo = default(ExplosionInfo);

            explosionInfo.center = base.Position;
            explosionInfo.radius = this.def.projectile.explosionRadius;
            explosionInfo.dinfo  = new DamageInfo(this.def.projectile.damageDef, 999, this.launcher, new BodyPartDamageInfo?(value), null);
            explosionInfo.preExplosionSpawnThingDef  = this.def.projectile.preExplosionSpawnThingDef;
            explosionInfo.postExplosionSpawnThingDef = this.def.projectile.postExplosionSpawnThingDef;
            explosionInfo.explosionSpawnChance       = this.def.projectile.explosionSpawnChance;
            explosionInfo.explosionSound             = this.def.projectile.soundExplode;
            explosionInfo.projectile = this.def;
            explosionInfo.Explode();
        }
Exemplo n.º 3
0
        private void Command_Detonate()
        {
            radius = base.GetComp <CompExplosive>().props.explosiveRadius;
            dmgdef = base.GetComp <CompExplosive>().props.explosiveDamageType;
            this.Destroy(DestroyMode.Vanish);
            BodyPartDamageInfo value         = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside));
            ExplosionInfo      explosionInfo = default(ExplosionInfo);

            explosionInfo.center = Position;
            explosionInfo.radius = radius;
            explosionInfo.dinfo  = new DamageInfo(dmgdef, 100, this, new BodyPartDamageInfo?(value), null);
            explosionInfo.Explode();
            explosionInfo.dinfo = new DamageInfo(dmgdef, 100, this, new BodyPartDamageInfo?(value), null);
            explosionInfo.dinfo = new DamageInfo(dmgdef, 100, this, new BodyPartDamageInfo?(value), null);
            explosionInfo.dinfo = new DamageInfo(dmgdef, 100, this, new BodyPartDamageInfo?(value), null);
            MoteMaker.TryThrowMicroSparks(Position.ToVector3Shifted());
            if (Position.GetRoof() != null)
            {
                if (Find.RoofGrid.RoofDefAt(Position).isThickRoof == true)
                {
                    RoofDef roofType = DefDatabase <RoofDef> .GetNamed("RoofRockThin");

                    Find.RoofGrid.SetRoof(Position, roofType);
                }
                else
                {
                    Find.RoofGrid.SetRoof(Position, null);
                }
            }
            foreach (IntVec3 current in GenAdj.AdjacentSquares8Way(this))
            {
                if (current.GetRoof() != null)
                {
                    if (Find.RoofGrid.RoofDefAt(current).isThickRoof == true)
                    {
                        RoofDef roofType = DefDatabase <RoofDef> .GetNamed("RoofRockThin");

                        Find.RoofGrid.SetRoof(current, roofType);
                    }
                    else
                    {
                        Find.RoofGrid.SetRoof(current, null);
                    }
                }
            }
        }