Пример #1
0
 private bool TryExplodeAt(BombsHost.BombState state, TrileInstance nearestNeighbor, ref bool chainsploded, ref bool needsRecull)
 {
   if (nearestNeighbor != null && nearestNeighbor.Enabled && !nearestNeighbor.Trile.Immaterial)
   {
     if (!ActorTypeExtensions.IsChainsploding(nearestNeighbor.Trile.ActorSettings.Type) && !ActorTypeExtensions.IsDestructible(nearestNeighbor.Trile.ActorSettings.Type))
       return true;
     if (!this.bombStates.ContainsKey(nearestNeighbor))
     {
       if (ActorTypeExtensions.IsBomb(nearestNeighbor.Trile.ActorSettings.Type))
         nearestNeighbor.PhysicsState.Respawned = false;
       if (!chainsploded)
       {
         this.bsToAdd.Add(new KeyValuePair<TrileInstance, BombsHost.BombState>(nearestNeighbor, new BombsHost.BombState()
         {
           SincePickup = state.SincePickup - this.ChainsplodeDelay,
           IsChainsploding = true,
           ChainsplodedBy = state
         }));
         chainsploded = true;
       }
       else
       {
         this.ClearDestructible(nearestNeighbor, true);
         this.LevelMaterializer.CullInstanceOut(nearestNeighbor);
         this.DropSupportedTriles(nearestNeighbor);
         needsRecull = true;
       }
       return true;
     }
   }
   return false;
 }
Пример #2
0
 private void DestroyNeighborhood(TrileInstance instance, BombsHost.BombState state)
 {
   Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint);
   Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint);
   bool flag1 = (double) vector3_1.X != 0.0;
   bool flag2 = flag1;
   int num = flag2 ? (int) vector3_2.Z : (int) vector3_2.X;
   Point point1 = new Point(flag1 ? instance.Emplacement.X : instance.Emplacement.Z, instance.Emplacement.Y);
   Point[] pointArray = instance.Trile.ActorSettings.Type == ActorType.BigBomb ? BombsHost.BigBombOffsets : BombsHost.SmallBombOffsets;
   this.LevelManager.WaitForScreenInvalidation();
   foreach (Point point2 in pointArray)
   {
     bool chainsploded = false;
     bool needsRecull = false;
     Point key = new Point(point1.X + point2.X, point1.Y + point2.Y);
     Limit limit;
     if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit))
     {
       limit.End += num;
       TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X);
       while ((flag2 ? id.Z : id.X) != limit.End)
       {
         TrileInstance nearestNeighbor = this.LevelManager.TrileInstanceAt(ref id);
         if (!this.TryExplodeAt(state, nearestNeighbor, ref chainsploded, ref needsRecull))
         {
           if (flag2)
             id.Z += num;
           else
             id.X += num;
         }
         else
           break;
       }
       if (needsRecull)
       {
         this.LevelManager.RecullAt(id);
         this.TrixelParticleSystems.UnGroundAll();
       }
     }
   }
 }