Exemplo n.º 1
0
 private void AffectCell(IntVec3 c)
 {
     if (c.InBounds(base.Map))
     {
         bool flag = this.ShouldCellBeAffectedOnlyByDamage(c);
         if (!flag)
         {
             if (Rand.Chance(this.preExplosionSpawnChance) && c.Walkable(base.Map))
             {
                 this.TrySpawnExplosionThing(this.preExplosionSpawnThingDef, c, this.preExplosionSpawnThingCount);
             }
         }
         this.damType.Worker.ExplosionAffectCell(this, c, this.damagedThings, !flag);
         if (!flag)
         {
             if (Rand.Chance(this.postExplosionSpawnChance) && c.Walkable(base.Map))
             {
                 this.TrySpawnExplosionThing(this.postExplosionSpawnThingDef, c, this.postExplosionSpawnThingCount);
             }
         }
         float num = this.chanceToStartFire;
         if (this.damageFalloff)
         {
             num *= Mathf.Lerp(1f, 0.2f, c.DistanceTo(base.Position) / this.radius);
         }
         if (Rand.Chance(num))
         {
             FireUtility.TryStartFireIn(c, base.Map, Rand.Range(0.1f, 0.925f));
         }
     }
 }
Exemplo n.º 2
0
        public float GetArmorPenetrationAt(IntVec3 c)
        {
            if (!this.damageFalloff)
            {
                return(this.armorPenetration);
            }
            float t = c.DistanceTo(base.Position) / this.radius;

            return(Mathf.Lerp(this.armorPenetration, this.armorPenetration * 0.2f, t));
        }
Exemplo n.º 3
0
        public int GetDamageAmountAt(IntVec3 c)
        {
            if (!damageFalloff)
            {
                return(damAmount);
            }
            float t = c.DistanceTo(base.Position) / radius;

            return(Mathf.Max(GenMath.RoundRandom(Mathf.Lerp(damAmount, (float)damAmount * 0.2f, t)), 1));
        }
Exemplo n.º 4
0
        public int GetDamageAmountAt(IntVec3 c)
        {
            if (!this.damageFalloff)
            {
                return(this.damAmount);
            }
            float t = c.DistanceTo(base.Position) / this.radius;
            int   a = GenMath.RoundRandom(Mathf.Lerp((float)this.damAmount, (float)this.damAmount * 0.2f, t));

            return(Mathf.Max(a, 1));
        }
Exemplo n.º 5
0
        public int GetDamageAmountAt(IntVec3 c)
        {
            if (!this.dealMoreDamageAtCenter)
            {
                return(this.damAmount);
            }
            float t = c.DistanceTo(base.Position) / this.radius;
            int   a = GenMath.RoundRandom(Mathf.Lerp((float)this.damAmount, (float)((float)this.damAmount * 0.20000000298023224), t));

            return(Mathf.Max(a, 1));
        }
Exemplo n.º 6
0
        public float GetArmorPenetrationAt(IntVec3 c)
        {
            float result;

            if (!this.damageFalloff)
            {
                result = this.armorPenetration;
            }
            else
            {
                float t = c.DistanceTo(base.Position) / this.radius;
                result = Mathf.Lerp(this.armorPenetration, this.armorPenetration * 0.2f, t);
            }
            return(result);
        }