private void onDungeonBoostActivated(DungeonBoost dungeonBoost, SkillType fromSkill)
 {
     if (ConfigDungeonBoosts.IsBox(dungeonBoost.Properties.Type))
     {
         for (int i = 0; i < this.m_heroStats.Count; i++)
         {
             HeroStats stats = this.m_heroStats[i];
             if (fromSkill != SkillType.NONE)
             {
                 string key = fromSkill.ToString();
                 if (!stats.SkillDungeonBoostBoxDestructionCounts.ContainsKey(key))
                 {
                     stats.SkillDungeonBoostBoxDestructionCounts.Add(key, 1.0);
                 }
                 else
                 {
                     Dictionary <string, double> dictionary;
                     string str2;
                     double num2 = dictionary[str2];
                     (dictionary = stats.SkillDungeonBoostBoxDestructionCounts)[str2 = key] = num2 + 1.0;
                 }
             }
             stats.DungeonBoostBoxesDestroyed++;
         }
     }
 }
示例#2
0
        private void onCharacterHordeSpawned(Room.Spawnpoint spawnpoint, bool isBoss)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
            Player        player        = GameLogic.Binder.GameState.Player;

            activeDungeon.ActiveRoom.flagAllDungeonBoostsForOffscreenDestroy();
            Room.Spawnpoint             islandSpawnpoint = activeDungeon.ActiveRoom.getClosestIslandSpawnpoint(spawnpoint.WorldPt);
            List <MarkerSpawnPointDeco> list             = activeDungeon.ActiveRoom.getDecoSpawnpointMarkersForIsland(islandSpawnpoint);

            if ((App.Binder.ConfigMeta.DUNGEON_BOOST_BOX_SPAWN_ENABLED_DURING_FRENZY || !GameLogic.Binder.FrenzySystem.isFrenzyActive()) && (islandSpawnpoint != this.m_lastIslandSpawnpointForBoxes))
            {
                this.m_validDecoSpawnpoints.Clear();
                for (int i = 0; i < list.Count; i++)
                {
                    MarkerSpawnPointDeco item = list[i];
                    if (ConfigDungeons.DUNGEON_DECO_CATEGORIES_AS_DUNGEON_BOOST_SPAWNPOINTS.Contains(item.DecoCategoryType) && (item.ActiveDeco != null))
                    {
                        this.m_validDecoSpawnpoints.Add(item);
                    }
                }
                int num2 = ConfigDungeonBoosts.GetBoxSpawnCountForFloor(player, activeDungeon.Floor, this.m_validDecoSpawnpoints.Count);
                for (int j = 0; (j < this.m_validDecoSpawnpoints.Count) && (j < num2); j++)
                {
                    MarkerSpawnPointDeco deco2 = this.m_validDecoSpawnpoints[j];
                    Vector3 position           = deco2.transform.position;
                    Vector3 vector4            = islandSpawnpoint.WorldPt - deco2.transform.position;
                    Vector3 normalized         = vector4.normalized;
                    Vector3 worldPt            = position + ((Vector3)(normalized * 1f));
                    float   fallbackStep       = ConfigDungeonBoosts.BOX_RADIUS;
                    worldPt   = activeDungeon.ActiveRoom.calculateNearestEmptySpot(worldPt, normalized, 1f, fallbackStep, 6f, new int?(Layers.DungeonBoostEmptySpotLayerMask));
                    worldPt.y = activeDungeon.ActiveRoom.WorldGroundPosY;
                    SpawnBox(CmdRollDungeonBoostBoxTable.ExecuteStatic(App.Binder.ConfigLootTables.DungeonBoostBoxTable, player), player, worldPt);
                }
            }
            this.m_lastIslandSpawnpointForBoxes = islandSpawnpoint;
        }