コード例 #1
0
ファイル: Level.cs プロジェクト: JonECG/Brogue
        public Level(IntVec startPoint, Tile[,] tiles, GridBoundList<IEnvironmentObject> environment, GridBoundList<IInteractable> interact, GridBoundList<ILightSource> light, GridBoundList<GameCharacter> characterEntities, int dungeonLevel)
        {
            this.tiles = tiles;
            this.startPoint = startPoint;
            this.Environment = environment;
            this.InteractableEnvironment = interact;
            this.CharacterEntities = characterEntities;
            this.LightSources = light;
            this.DroppedItems = new GridBoundList<Item>();
            this.DungeonLevel = dungeonLevel;
            calculateTiles();
            needToCache = true;
            cachedSolid = new bool[tiles.GetLength(0), tiles.GetLength(1)];

            a = GetStartPoint();
            b = findRandomOpenPosition();
            path = AStar.getPathBetween(this, a, b);
            moveset = AStar.getPossiblePositionsFrom(this, a, 15,false,false);

            for (int i = 0; i < 28; i++)
            {
                //Item item = Item.randomItem(10, 10);

                //Engine.Engine.Log(string.Format("Item Generated: {0}", item.Name));

                //DroppedItems.Add(item, findRandomOpenPosition());
            }
        }
コード例 #2
0
ファイル: DOTAreaOfEffect.cs プロジェクト: JonECG/Brogue
 public override void removeCastingSquares(IntVec cursorPosition)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #3
0
ファイル: Slam.cs プロジェクト: JonECG/Brogue
 public override IntVec[] viewCastRange(Level level, IntVec start)
 {
     List<IntVec> lines = new List<IntVec>();
     lines.AddRange(AStar.getTargetLine(level, start, new IntVec(start.X-radius,start.Y), false));
     lines.AddRange(AStar.getTargetLine(level, start, new IntVec(start.X+radius,start.Y), false));
     lines.AddRange(AStar.getTargetLine(level, start, new IntVec(start.X,start.Y-radius), false));
     lines.AddRange(AStar.getTargetLine(level, start, new IntVec(start.X,start.Y+radius), false));
     radiusSquares = lines.ToArray();
     return radiusSquares;
 }
コード例 #4
0
ファイル: Vault.cs プロジェクト: JonECG/Brogue
 protected override void finishCast(int damage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter test = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (test != null)
         {
             test.TakeDamage(damage, hero);
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #5
0
ファイル: Vault.cs プロジェクト: JonECG/Brogue
 public override void finishCastandDealDamage(int heroLevel, int heroDamage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         if (mapLevel.Move(hero, castSquares[0], true))
         {
             Audio.playSound("Jump");
             cooldown = abilityCooldown;
             wasJustCast = true;
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #6
0
ファイル: Fireball.cs プロジェクト: JonECG/Brogue
 public Fireball()
 {
     name = "Fireball";
     description = "The mage strikes an enemy from a \ndistance with fire.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 7;
     radius = 3;
     abilityCooldown = 5;
     abilityIndex = 10;
 }
コード例 #7
0
ファイル: Flurry.cs プロジェクト: JonECG/Brogue
 public Eviscerate()
 {
     name = "Eviscerate";
     description = "The duelist strikes a single target \nthree times.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 0;
     radius = 1;
     abilityCooldown = 4;
     abilityIndex = 23;
 }
コード例 #8
0
ファイル: Mug.cs プロジェクト: JonECG/Brogue
 public Mug()
 {
     name = "Mug";
     description = "The rogue strikes the enemy chosen, \nand obtains a random item.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 6;
     radius = 1;
     abilityCooldown = 6;
     abilityIndex = 20;
 }
コード例 #9
0
ファイル: Vault.cs プロジェクト: JonECG/Brogue
 public Vault()
 {
     name = "Vault";
     description = "The marksman leaps to the \nselected position.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 0;
     radius = 3;
     abilityCooldown = 5;
     abilityIndex = 28;
 }
コード例 #10
0
ファイル: ArcaneBarrage.cs プロジェクト: JonECG/Brogue
 public ArcaneBarrage()
 {
     name = "Arcane Barrage";
     description = "The spellblade fires a barrage \nof arcane energy at all of the \nselected enemies.";
     castSquares = new IntVec[5];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 5;
     radius = 5;
     abilityCooldown = 12;
     abilityIndex = 19;
 }
コード例 #11
0
ファイル: SteadyShot.cs プロジェクト: JonECG/Brogue
 public SteadyShot()
 {
     name = "Steady Shot";
     description = "The ranger lines up the perfect \nshot on the selected target.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 6;
     radius = 4;
     abilityCooldown = 5;
     abilityIndex = 26;
 }
コード例 #12
0
ファイル: Execute.cs プロジェクト: JonECG/Brogue
 public Execute()
 {
     name = "Execute";
     description = "The warrior strikes the enemy \nchosen. If the enemy is killed, \nthis ability's cooldown is reset.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 6;
     radius = 1;
     abilityCooldown = 8;
     abilityIndex = 4;
 }
コード例 #13
0
ファイル: ShieldBash.cs プロジェクト: JonECG/Brogue
 protected override void finishCast(int damage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter test = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (test != null)
         {
             Audio.playSound("HammerSmash");
             Engine.Engine.AddVisualAttack(test, "Hero/ShieldBash", .25f, 1.0f, .03f);
             test.TakeDamage(damage, hero);
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #14
0
ファイル: Minimap.cs プロジェクト: JonECG/Brogue
        public void UpdateView(IntVec position)
        {
            active.X = position.X - ViewWidth / 2;
            active.Y = position.Y - ViewHeight / 2;

            for (int x = 0; x < ViewWidth; x++)
            {
                for (int y = 0; y < ViewHeight; y++)
                {
                    if (x + active.X >= 0 && y + active.Y >= 0 && x + active.X < detected.GetLength(0) && y + active.Y < detected.GetLength(1))
                    detected[x + active.X, y + active.Y] = true;
                }
            }
        }
コード例 #15
0
ファイル: Assassinate.cs プロジェクト: JonECG/Brogue
 public Assassinate()
 {
     name = "Assassinate";
     description = "The assassin strikes his opponent \nwith great precision";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 7;
     radius = 2;
     abilityCooldown = 12;
     abilityIndex = 24;
 }
コード例 #16
0
ファイル: Execute.cs プロジェクト: JonECG/Brogue
 protected override void finishCast(int damage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter test = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (test != null)
         {
             Engine.Engine.AddVisualAttack(test, "Hero/Execute", .5f, 1.5f, .05f);
             test.TakeDamage(damage, hero);
             cooldown = getCooldown(test);
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #17
0
ファイル: SoulSiphon.cs プロジェクト: JonECG/Brogue
 public SoulSiphon()
 {
     name = "Soul Siphon";
     description = "The mage deals damage to the enemy \nand heals for 100% of the damage \ndealt.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 6;
     radius = 3;
     abilityCooldown = 10;
     abilityIndex = 17;
 }
コード例 #18
0
ファイル: ShieldBash.cs プロジェクト: JonECG/Brogue
 public ShieldBash()
 {
     name = "Shield Bash";
     description = "The sentinel strikes enemies with \nhis shield.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 5;
     radius = 1;
     abilityCooldown = 3;
     abilityIndex = 6;
 }
コード例 #19
0
ファイル: Blink.cs プロジェクト: JonECG/Brogue
 public Blink()
 {
     name = "Blink";
     description = "The mage teleports to the selected \nposition.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 0;
     radius = 2;
     abilityCooldown = 2;
     abilityIndex = 11;
 }
コード例 #20
0
ファイル: DoubleSlash.cs プロジェクト: JonECG/Brogue
 public DoubleSlash()
 {
     name = "Double Slash";
     description = "The warrior strikes a single target \nto deal double damage.";
     castSquares = new IntVec[1];
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 0;
     radius = 1;
     abilityCooldown = 6;
     abilityIndex = 3;
 }
コード例 #21
0
ファイル: WhirlwindSlash.cs プロジェクト: JonECG/Brogue
 public WhirlwindSlash()
 {
     name = "Whirlwind Slash";
     description = "The warrior swings his blade in a \ncircle sending tornadoes \nspiraling towards his foes.";
     radius = 1;
     isActuallyFilled = false;
     castSquares = new IntVec[12];
     baseDamage = 3;
     abilityCooldown = 7;
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     abilityIndex = 1;
 }
コード例 #22
0
ファイル: TimeStop.cs プロジェクト: JonECG/Brogue
 public TimeStop()
 {
     name = "Time Stop";
     description = "The spellweaver stops time for the \nenemies around him.";
     radius = 4;
     isActuallyFilled = false;
     castSquares = new IntVec[40];
     baseDamage = 0;
     abilityCooldown = 20;
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     abilityIndex = 14;
 }
コード例 #23
0
ファイル: Volley.cs プロジェクト: JonECG/Brogue
 public Volley()
 {
     name = "Volley";
     description = "The ranger fires a hail of arrows \nat the selected location.";
     castSquares = new IntVec[5];
     damageRadius = 1;
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     baseDamage = 3;
     radius = 3;
     abilityCooldown = 4;
     abilityIndex = 27;
 }
コード例 #24
0
ファイル: ArcaneBarrage.cs プロジェクト: JonECG/Brogue
 protected override void finishCast(int damage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter test = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (test != null)
         {
             Audio.playSound("Arcane");
             Engine.Engine.AddVisualAttack(hero, test, "Hero/Overload", 1.0f, 1.0f, 0);
             test.DealElementalDamage(Enums.ElementAttributes.Arcane, 7, HeroClasses.Hero.level/2);
             test.TakeDamage(damage, hero);
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #25
0
ファイル: Slam.cs プロジェクト: JonECG/Brogue
 public Slam()
 {
     name = "Slam";
     description = "The brawler slams the ground \nhitting enemies within a line.";
     radius = 4;
     isActuallyFilled = false;
     castSquares = new IntVec[16];
     baseDamage = 5;
     abilityCooldown = 10;
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0, 0);
     }
     abilityIndex = 2;
 }
コード例 #26
0
ファイル: DOTAreaOfEffect.cs プロジェクト: JonECG/Brogue
 public override void addCastingSquares(IntVec cursorPosition)
 {
     if (turnCount == 0)
     {
         turnCount = numTicks;
     }
     if ((castSquares[0].X == 0 && castSquares[0].Y == 0))
     {
         castSquares = radiusSquares;
     }
     else
     {
         isActuallyFilled = true;
     }
 }
コード例 #27
0
ファイル: DoubleSlash.cs プロジェクト: JonECG/Brogue
 protected override void finishCast(int damage, Mapping.Level mapLevel, HeroClasses.Hero hero)
 {
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter test = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (test != null)
         {
             Engine.Engine.AddVisualAttack(test, "Hero/DoubleSlash", .25f, 2.0f, .15f);
             Audio.playSound("Slash", .25f);
             test.TakeDamage(damage, hero);
             if (mapLevel.CharacterEntities.FindPosition(test) != null )
                 test.TakeDamage(damage, hero);
         }
         castSquares[i] = new IntVec(0, 0);
     }
 }
コード例 #28
0
ファイル: TimeStop.cs プロジェクト: JonECG/Brogue
 public override void finishCastandDealDamage(int heroLevel, int heroDamage, Level mapLevel, HeroClasses.Hero hero)
 {
     int damage = calculateDamage(heroLevel, heroDamage);
     cooldown = abilityCooldown;
     wasJustCast = true;
     for (int i = 0; i < castSquares.Length; i++)
     {
         GameCharacter enemy = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (enemy != null)
         {
             drawVisualEffect(hero, enemy);
             enemy.DealElementalDamage(Enums.ElementAttributes.Ice, 7);
         }
         castSquares[i] = new IntVec(0, 0);
     }
     isActuallyFilled = false;
 }
コード例 #29
0
ファイル: Slam.cs プロジェクト: JonECG/Brogue
 public override void finishCastandDealDamage(int heroLevel, int heroDamage, Level mapLevel, HeroClasses.Hero hero)
 {
     int damage = calculateDamage(heroLevel, heroDamage);
     cooldown = abilityCooldown;
     wasJustCast = true;
     for (int i = 0; i < castSquares.Length; i++)
     {
         Audio.playSound("HammerSmash");
         Engine.Engine.AddVisualAttack(castSquares[i], "Hero/hammerSmash", .5f, 1.0f, .05f);
         GameCharacter enemy = (GameCharacter)mapLevel.CharacterEntities.FindEntity(castSquares[i]);
         if (enemy != null)
         {
             enemy.TakeDamage(damage, hero);
         }
         castSquares[i] = new IntVec(0, 0);
     }
     isActuallyFilled = false;
 }
コード例 #30
0
ファイル: ArcaneOverload.cs プロジェクト: JonECG/Brogue
 public ArcaneOverload()
 {
     name = "Arcane Overload";
     description = "The spellblade overloads with \narcane energy, sending out \npulses of arcane damage.";
     radius = 3;
     isActuallyFilled = false;
     castSquares = new IntVec[60];
     baseDamage = 10;
     dotUsed = false;
     wasJustCast = false;
     abilityCooldown = 10;
     numTicks = 4;
     for (int i = 0; i < castSquares.Length; i++)
     {
         castSquares[i] = new IntVec(0,0);
     }
     abilityIndex = 18;
 }
コード例 #31
0
 public NodeMapper(IntVec origin, IEnumerable <IntVec> list)
 {
     _origin = origin;
     _shifts = new List <IntVec>(list);
     _calculateFinalPoints();
 }
コード例 #32
0
 /*
  * 进行干员部署的设置
  */
 public void deploy(IntVec position, int rotation)
 {
     this.nodePosition      = position;
     this.nodeMapper.rotate = rotation;
     this._isOnStage        = true;
 }
コード例 #33
0
 internal bool isFree(IntVec pos)
 {
     return(floorPlan[pos.X, pos.Y]);
 }
コード例 #34
0
 public override IntVec[] viewCastRange(Level level, IntVec start)
 {
     radiusSquares = AStar.getPossiblePositionsFrom(level, start, radius, AStar.CharacterTargeting.PASS_THROUGH, false);
     return(radiusSquares);
 }
コード例 #35
0
 public abstract void drawVisualEffect(IntVec castEnemy);
コード例 #36
0
 public void Add(T t, IntVec position)
 {
     list.Add(Tuple.Create(t, new IntVec(position)));
 }
コード例 #37
0
        public T FindEntity(IntVec position)
        {
            Tuple <T, IntVec> tup = getTupleByPosition(position);

            return((tup != null) ? tup.Item1 : default(T));
        }
コード例 #38
0
 public NodeMapper()
 {
     _origin = new IntVec(0, 0);
     _shifts = new List <IntVec>();
     _calculateFinalPoints();
 }
コード例 #39
0
 public NodeMapper(IntVec origin)
 {
     _origin = origin;
     _shifts = new List <IntVec>();
     _calculateFinalPoints();
 }
コード例 #40
0
 public bool setUnfree(IntVec pos)
 {
     return(setUnfree(pos.X, pos.Y));
 }
コード例 #41
0
        private void damageEnemyIfInRange(IntVec[] hitBox, Level mapLevel, GameCharacter enemy, Weapon weapon, bool playAttack)
        {
            bool found = false;

            if (weapon != null)
            {
                string[] name = weapon.Name.Split();
                for (int i = 0; i < hitBox.Length && !found; i++)
                {
                    IntVec test = mapLevel.CharacterEntities.FindPosition(enemy);
                    if (hitBox[i].Equals(mapLevel.CharacterEntities.FindPosition(enemy)))
                    {
                        int weaponDamage = weapon.Damage + damageBoost + currentlyEquippedItems.getAccessoryDamageIncrease();
                        weaponDamage = (weaponDamage < 1) ? 1 : weaponDamage;
                        found        = true;
                        int damage = (!visible) ? (int)(1.5 * (weaponDamage)) : weaponDamage;
                        if (playAttack)
                        {
                            if (weapon.IsLegendary)
                            {
                                if (name[0] == "Blade" || name[0] == "Executioner" || name[0] == "Bloodthirster" || name[0] == "Pale" || name[0] == "Anarchy" || name[0] == "Judgement")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendarySwordSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("swordAttack");
                                }
                                else if (name[0] == "Kris")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryDaggerSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("DaggerStab");
                                }
                                else if (name[0] == "The")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryClawSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("swordAttack");
                                }
                                else if (name[0] == "40k")
                                {
                                    Audio.playSound("HammerSmash");
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryHammerSmash", .25f, 2.0f, .15f);
                                }
                                else if (name[0] == "Condemned" || name[0] == "Retribution")
                                {
                                    Audio.playSound("ArrowShot");
                                    Engine.Engine.AddVisualAttack(this, enemy, "Enemies/Attacks/Arrow", .25f, 1.0f, .15f);
                                }
                                else if (name[0] == "Kunai" || name[0] == "Heart")
                                {
                                    Engine.Engine.AddVisualAttack(this, enemy, weapon.GetTexture());
                                }
                                else if (name[0] == "Ebony" || name[0] == "Ivory")
                                {
                                    Audio.playSound("Gunshot", .5f);
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/Bullet", .5f, .5f, 0);
                                }
                                else if (name[0] == "Bloodwing")
                                {
                                    Audio.playSound("SniperShot");
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/Bullet", .5f, .5f, 0);
                                }
                                else
                                {
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/MageAttack", .5f, 1.0f, .03f);
                                }
                            }
                            else if (!checkForWeaponType(0, enemy, name, weapon))
                            {
                                checkForWeaponType(1, enemy, name, weapon);
                            }
                            if (Element != null)
                            {
                                for (int j = 0; j < Element.Count; j++)
                                {
                                    switch (Element[j])
                                    {
                                    case ElementAttributes.Fire:
                                        enemy.DealElementalDamage(Element[j], 5, level / 2);
                                        break;

                                    case ElementAttributes.Ice:
                                        enemy.DealElementalDamage(Element[j], 3);
                                        break;

                                    case ElementAttributes.Lighting:
                                        enemy.DealElementalDamage(Element[j], 1, (level));
                                        break;

                                    case ElementAttributes.Arcane:
                                        enemy.DealElementalDamage(Element[j], 7, level / 2);
                                        break;
                                    }
                                }
                            }
                        }
                        for (int j = 0; j < abilities.Length; j++)
                        {
                            if (abilities[j] != null && abilities[j].type == AbilityTypes.Toggle)
                            {
                                ToggleAbility toggle = (ToggleAbility)abilities[j];
                                if (toggle.isActive)
                                {
                                    toggle.toggledAttackEffects(this);
                                }
                            }
                        }
                        enemy.TakeDamage(damage, this);
                        invisibilityTurnCount = 0;
                        turnOver = true;
                    }
                }
            }
        }
コード例 #42
0
                public int getLargestOpening()
                {
                    int    currentOpening = 0;
                    int    largest        = 0;
                    IntVec pos;

                    for (int i = 0; i < dimensions.Height; i++)
                    {
                        pos = new IntVec(dimensions.X - 1, dimensions.Y + i);
                        if (floorPlan[pos.X, pos.Y])
                        {
                            currentOpening++;
                        }
                        else
                        {
                            currentOpening = 0;
                        }
                        largest = Math.Max(largest, currentOpening);
                    }

                    for (int i = 0; i < dimensions.Width; i++)
                    {
                        pos = new IntVec(dimensions.X + i, dimensions.Y - 1);
                        if (floorPlan[pos.X, pos.Y])
                        {
                            currentOpening++;
                        }
                        else
                        {
                            currentOpening = 0;
                        }
                        largest = Math.Max(largest, currentOpening);
                    }

                    for (int i = 0; i < dimensions.Height; i++)
                    {
                        pos = new IntVec(dimensions.X + dimensions.Width, dimensions.Y + i);
                        if (floorPlan[pos.X, pos.Y])
                        {
                            currentOpening++;
                        }
                        else
                        {
                            currentOpening = 0;
                        }
                        largest = Math.Max(largest, currentOpening);
                    }

                    for (int i = 0; i < dimensions.Width; i++)
                    {
                        pos = new IntVec(dimensions.X + i, dimensions.Y + dimensions.Height);
                        if (floorPlan[pos.X, pos.Y])
                        {
                            currentOpening++;
                        }
                        else
                        {
                            currentOpening = 0;
                        }
                        largest = Math.Max(largest, currentOpening);
                    }
                    return(largest);
                }