Esempio n. 1
0
        private void StartRandomFire()
        {
            int num = OPBombDefGetValue.OPBombGetImpactRadius(this.def) + 2;

            FireUtility.TryStartFireIn((from x in GenRadial.RadialCellsAround(base.Position, (float)num, true)
                                        where x.InBounds(base.Map)
                                        select x).RandomElementByWeight((IntVec3 x) => OPBombardment.DistanceChanceFactor.Evaluate(x.DistanceTo(base.Position))), base.Map, Rand.Range(0.1f, 0.925f));
        }
Esempio n. 2
0
        private void CreateRandomExplosion()
        {
            ThingDef def = this.def;
            int      num = OPBombDefGetValue.OPBombGetDmg(def);

            if (num < 1)
            {
                num = 1;
            }
            if (num > 99)
            {
                num = 99;
            }
            int num2 = OPBombDefGetValue.OPBombGetImpactRadius(def);

            if (num2 < 1)
            {
                num2 = 1;
            }
            if (num2 > 30)
            {
                num2 = 30;
            }
            int num3 = OPBombDefGetValue.OPBombGetBlastMinRadius(def);
            int num4 = OPBombDefGetValue.OPBombGetBlastMaxRadius(def);

            if (num4 > 10)
            {
                num4 = 10;
            }
            if (num4 < 1)
            {
                num4 = 1;
            }
            if (num3 > num4)
            {
                num3 = num4;
            }
            if (num3 < 1)
            {
                num3 = 1;
            }
            IntVec3 intVec = (from x in GenRadial.RadialCellsAround(base.Position, (float)num2, true)
                              where x.InBounds(base.Map)
                              select x).RandomElementByWeight((IntVec3 x) => OPBombardment.DistanceChanceFactor.Evaluate(x.DistanceTo(base.Position)));
            float     num5       = (float)Rand.Range(num3, num4);
            Map       map        = base.Map;
            float     num6       = num5;
            DamageDef bomb       = DamageDefOf.Bomb;
            Thing     instigator = this.instigator;
            ThingDef  weaponDef  = this.weaponDef;

            GenExplosion.DoExplosion(intVec, map, num6, bomb, instigator, num, -1f, null, weaponDef, def, null, null, 0f, 1, false, null, 0f, 1, 0f, false);
        }