Beispiel #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);
 }