示例#1
0
        public void syncCombatantsLists()
        {
            CombatData       combat  = this._app.Game.CombatData.GetCombat(this._app.GameDatabase, this._combatID, this._systemID, this._turn);
            PlayerCombatData player1 = combat.GetPlayer(this._app.LocalPlayer.ID);

            foreach (PlayerInfo playerInfo in this._app.GameDatabase.GetPlayerInfos())
            {
                PlayerInfo player = playerInfo;
                if (combat.GetPlayer(player.ID) != null)
                {
                    DiplomacyInfo diplomacyInfo = this._app.GameDatabase.GetDiplomacyInfo(player1.PlayerID, player.ID);
                    string        itemGlobalId;
                    if (diplomacyInfo.State == DiplomacyState.WAR)
                    {
                        this._app.UI.AddItem("enemiesList", "", player.ID, "");
                        itemGlobalId = this._app.UI.GetItemGlobalID("enemiesList", "", player.ID, "");
                        this.EnemyPlayers.Add(player.ID);
                    }
                    else
                    {
                        this._app.UI.AddItem("alliesList", "", player.ID, "");
                        itemGlobalId = this._app.UI.GetItemGlobalID("alliesList", "", player.ID, "");
                    }
                    PlayerSetup playerSetup   = this._app.GameSetup.Players.FirstOrDefault <PlayerSetup>((Func <PlayerSetup, bool>)(x => x.databaseId == player.ID));
                    string      propertyValue = playerSetup == null || !(playerSetup.Name != "") ? player.Name : playerSetup.Name;
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "name"), "text", propertyValue);
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "playeravatar"), "texture", player.AvatarAssetPath);
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "badge"), "texture", player.BadgeAssetPath);
                    this._app.UI.SetPropertyColorNormalized(this._app.UI.Path(itemGlobalId, "primaryColor"), "color", player.PrimaryColor);
                    this._app.UI.SetPropertyColorNormalized(this._app.UI.Path(itemGlobalId, "secondaryColor"), "color", player.SecondaryColor);
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "avatarButton"), "id", "avatarButton|" + (diplomacyInfo.State == DiplomacyState.WAR ? "E|" : "A|") + player.ID.ToString());
                }
            }
        }
示例#2
0
        public void Initialize()
        {
            this.App.UI.SetPropertyColor(this.UI.Path(this.ID, DiplomacyCard.UIsecondaryColor), "color", this.Player.SecondaryColor * (float)byte.MaxValue);
            this.App.UI.SetPropertyColor(this.UI.Path(this.ID, DiplomacyCard.UIempireColor), "color", this.Player.PrimaryColor * (float)byte.MaxValue);
            this.App.UI.SetPropertyString(this.UI.Path(this.ID, DiplomacyCard.UIavatar), "sprite", Path.GetFileNameWithoutExtension(this.Player.AvatarAssetPath));
            this.App.UI.SetPropertyString(this.UI.Path(this.ID, DiplomacyCard.UIbadge), "sprite", Path.GetFileNameWithoutExtension(this.Player.BadgeAssetPath));
            if (this.App.GameDatabase.GetDiplomacyStateBetweenPlayers(this.App.LocalPlayer.ID, this.Player.ID) == DiplomacyState.WAR)
            {
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UIpeace), false);
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UIwar), true);
            }
            else
            {
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UIpeace), true);
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UIwar), false);
            }
            DiplomacyInfo diplomacyInfo = this.App.GameDatabase.GetDiplomacyInfo(this.Player.ID, this.App.LocalPlayer.ID);

            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodHatred), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodHostile), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodDistrust), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodIndifferent), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodTrust), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodFriend), false);
            this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodLove), false);
            switch (diplomacyInfo.GetDiplomaticMood())
            {
            case DiplomaticMood.Hatred:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodHatred), true);
                break;

            case DiplomaticMood.Hostility:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodHostile), true);
                break;

            case DiplomaticMood.Distrust:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodDistrust), true);
                break;

            case DiplomaticMood.Indifference:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodIndifferent), true);
                break;

            case DiplomaticMood.Trust:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodTrust), true);
                break;

            case DiplomaticMood.Friendship:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodFriend), true);
                break;

            case DiplomaticMood.Love:
                this.App.UI.SetVisible(this.UI.Path(this.ID, DiplomacyCard.UImoodLove), true);
                break;
            }
        }
        public override int ReadFrom(byte[] Buffer, int StartIndex=0)
        {
            int cursor = StartIndex;

            if ((UserCommandType)Buffer[cursor] != CommandType)
                throw new Exception(ERRORWRONGTYPEBYTE);
            else
            {
                cursor++;                                                   // Type     (1 byte)

                DiplomacyInfo = new DiplomacyInfo(Buffer, cursor);          // DiplomacyInfo (n bytes)
                cursor += DiplomacyInfo.ByteLength;
            }

            return cursor - StartIndex;
        }       
示例#4
0
        public static ScriptModules Resume(GameDatabase db)
        {
            ScriptModules scriptModules = new ScriptModules();

            scriptModules.VonNeumann      = VonNeumann.ResumeEncounter(db);
            scriptModules.Swarmers        = Swarmers.ResumeEncounter(db);
            scriptModules.Gardeners       = Gardeners.ResumeEncounter(db);
            scriptModules.AsteroidMonitor = AsteroidMonitor.ResumeEncounter(db);
            scriptModules.MorrigiRelic    = MorrigiRelic.ResumeEncounter(db);
            scriptModules.Slaver          = Slaver.ResumeEncounter(db);
            scriptModules.Pirates         = Pirates.ResumeEncounter(db);
            scriptModules.Spectre         = Spectre.ResumeEncounter(db);
            scriptModules.GhostShip       = GhostShip.ResumeEncounter(db);
            scriptModules.MeteorShower    = MeteorShower.ResumeEncounter(db);
            scriptModules.SystemKiller    = SystemKiller.ResumeEncounter(db);
            scriptModules.Locust          = Locust.ResumeEncounter(db);
            scriptModules.Comet           = Comet.ResumeEncounter(db);
            if (db.HasEndOfFleshExpansion())
            {
                scriptModules.NeutronStar = NeutronStar.ResumeEncounter(db);
                scriptModules.SuperNova   = SuperNova.ResumeEncounter();
            }
            List <PlayerInfo> list = db.GetPlayerInfos().Where <PlayerInfo>((Func <PlayerInfo, bool>)(x =>
            {
                if (!x.isStandardPlayer)
                {
                    return(!x.includeInDiplomacy);
                }
                return(false);
            })).ToList <PlayerInfo>();

            foreach (int playerID in db.GetStandardPlayerIDs().ToList <int>())
            {
                foreach (PlayerInfo playerInfo in list)
                {
                    DiplomacyInfo diplomacyInfo = db.GetDiplomacyInfo(playerID, playerInfo.ID);
                    if (diplomacyInfo.State != DiplomacyState.WAR)
                    {
                        db.UpdateDiplomacyState(playerID, playerInfo.ID, DiplomacyState.WAR, diplomacyInfo.Relations, true);
                    }
                }
            }
            return(scriptModules);
        }
        public GuildListViewer()
        {
            this.Dock = DockStyle.Fill;
            this.data = new DiplomacyInfo();

            this.splitMain.Dock = DockStyle.Fill;
            this.splitMain.Orientation = Orientation.Vertical;
            splitMain.SplitterDistance = 80;
            splitMain.FixedPanel = FixedPanel.None;
            splitMain.IsSplitterFixed = false;

            CreateTable();
            CreateGuildsGrid();
            CreateListBoxes();
            CreateLabels();
            CreateButtons();

            this.Controls.Add(splitMain);
        }
示例#6
0
        public GuildListViewer()
        {
            this.Dock = DockStyle.Fill;
            this.data = new DiplomacyInfo();

            this.splitMain.Dock        = DockStyle.Fill;
            this.splitMain.Orientation = Orientation.Vertical;
            splitMain.SplitterDistance = 80;
            splitMain.FixedPanel       = FixedPanel.None;
            splitMain.IsSplitterFixed  = false;

            CreateTable();
            CreateGuildsGrid();
            CreateListBoxes();
            CreateLabels();
            CreateButtons();


            this.Controls.Add(splitMain);
        }
        public void UpdateFromPlayerInfo(int localPlayerID, PlayerInfo targetPlayerInfo)
        {
            this._playerNameLabel.SetText(targetPlayerInfo.Name);
            this._avatarImage.SetTexture(targetPlayerInfo.AvatarAssetPath);
            this._badgeImage.SetTexture(targetPlayerInfo.BadgeAssetPath);
            DiplomacyInfo diplomacyInfo = this._game.GameDatabase.GetDiplomacyInfo(localPlayerID, targetPlayerInfo.ID);
            string        spriteName    = null;

            if (diplomacyInfo != null)
            {
                spriteName = diplomacyInfo.GetDiplomaticMoodSprite();
            }
            if (!string.IsNullOrEmpty(spriteName))
            {
                this._relationImage.SetVisible(true);
                this._relationImage.SetSprite(spriteName);
            }
            else
            {
                this._relationImage.SetVisible(false);
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public DataController()
        {          
            // create lists
            roomObjects = new RoomObjectList(300);
            roomObjectsFiltered = new RoomObjectListFiltered(roomObjects);
            projectiles = new ProjectileList(50);
            onlinePlayers = new OnlinePlayerList(200);
            inventoryObjects = new InventoryObjectList(100);
            avatarCondition = new StatNumericList(5);
            avatarAttributes = new StatNumericList(10);
            avatarSkills = new SkillList(100);
            avatarSpells = new SkillList(100);
            avatarQuests = new SkillList(100);
            roomBuffs = new ObjectBaseList<ObjectBase>(30);
            avatarBuffs = new ObjectBaseList<ObjectBase>(30);
            spellObjects = new SpellObjectList(100);
            backgroundOverlays = new BackgroundOverlayList(5);
            playerOverlays = new ObjectBaseList<PlayerOverlay>(10);            
            chatMessages = new BaseList<ServerString>(101);
            gameMessageLog = new BaseList<GameMessage>(100);
            visitedTargets = new List<RoomObject>(50);
            clickedTargets = new List<uint>(50);
            actionButtons = new ActionButtonList();
            ignoreList = new List<string>(20);
            chatCommandHistory = new List<string>(20);

            // attach some listeners
            RoomObjects.ListChanged += OnRoomObjectsListChanged;
            Projectiles.ListChanged += OnProjectilesListChanged;
            ChatMessages.ListChanged += OnChatMessagesListChanged;

            // make some lists sorted
            OnlinePlayers.SortByName();
            AvatarSkills.SortByResourceName();
            AvatarSpells.SortByResourceName();
            SpellObjects.SortByName();
            
            // create single data objects
            roomInformation = new RoomInfo();
            lightShading = new LightShading(0, new SpherePosition(0, 0));
            backgroundMusic = new PlayMusic();
            guildInfo = new GuildInfo();
            guildShieldInfo = new GuildShieldInfo();
            guildAskData = new GuildAskData();
            diplomacyInfo = new DiplomacyInfo();
            adminInfo = new AdminInfo();
            tradeInfo = new TradeInfo();
            buyInfo = new BuyInfo();
            welcomeInfo = new WelcomeInfo();
            charCreationInfo = new CharCreationInfo();
            statChangeInfo = new StatChangeInfo();
            newsGroup = new NewsGroup();
            objectContents = new ObjectContents();
            effects = new Effects();
            lookPlayer = new PlayerInfo();
            lookObject = new ObjectInfo();
            clientPreferences = new PreferencesFlags();

            // some values
            ChatMessagesMaximum = 100;
            ChatCommandHistoryMaximum = 20;
            ChatCommandHistoryIndex = -1;
            AvatarObject = null;
            IsResting = false;
            SelfTarget = false;
            IsNextAttackApplyCastOnHighlightedObject = false;
            AvatarID = UInt32.MaxValue;
            TargetID = UInt32.MaxValue;
            ViewerPosition = V3.ZERO;
            UIMode = UIMode.None;
        }
 public UserCommandGuildGuildList(DiplomacyInfo DiplomacyInfo)
 {
     this.DiplomacyInfo = DiplomacyInfo;
 }
示例#10
0
        private static void SyncPlayerStatsState(
            App game,
            string panelName,
            PlayerInfo playerInfo,
            bool updateButtonIds)
        {
            FactionInfo   factionInfo                     = game.GameDatabase.GetFactionInfo(playerInfo.FactionID);
            string        propertyValue1                  = string.Format("{0:000}", (object)Math.Abs(game.GameDatabase.GetFactionInfo(game.GameDatabase.GetPlayerFactionID(game.Game.LocalPlayer.ID)).IdealSuitability - factionInfo.IdealSuitability));
            string        enginePlantTechString           = GameSession.GetBestEnginePlantTechString(game, playerInfo.ID);
            string        engineTechString                = GameSession.GetBestEngineTechString(game, playerInfo.ID);
            string        propertyValue2                  = game.GameDatabase.GetPlayerInfo(game.Game.LocalPlayer.ID).FactionDiplomacyPoints[factionInfo.ID].ToString();
            DiplomacyInfo diplomacyInfo                   = game.GameDatabase.GetDiplomacyInfo(playerInfo.ID, game.Game.LocalPlayer.ID);
            int           numHistoryTurns                 = 10;
            int           currentTurn                     = game.GameDatabase.GetTurnCount();
            List <DiplomacyReactionHistoryEntryInfo> list = game.GameDatabase.GetDiplomacyReactionHistory(playerInfo.ID, game.Game.LocalPlayer.ID, currentTurn, 10).ToList <DiplomacyReactionHistoryEntryInfo>();

            int[] numArray = new int[numHistoryTurns];
            numArray[numHistoryTurns - 1] = diplomacyInfo.Relations;
            string propertyValue3 = numArray[numHistoryTurns - 1].ToString();

            for (int i = numHistoryTurns - 2; i >= 0; --i)
            {
                numArray[i] = numArray[i + 1] + list.Where <DiplomacyReactionHistoryEntryInfo>((Func <DiplomacyReactionHistoryEntryInfo, bool>)(x =>
                {
                    int?turnCount = x.TurnCount;
                    int num       = currentTurn - (numHistoryTurns - 1 - i);
                    if (turnCount.GetValueOrDefault() == num)
                    {
                        return(turnCount.HasValue);
                    }
                    return(false);
                })).Sum <DiplomacyReactionHistoryEntryInfo>((Func <DiplomacyReactionHistoryEntryInfo, int>)(y => y.Difference));
                propertyValue3 = propertyValue3 + "|" + numArray[i].ToString();
            }
            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIRelationsGraph), "data", propertyValue3);
            string diplomaticMoodSprite = diplomacyInfo.GetDiplomaticMoodSprite();

            if (!string.IsNullOrEmpty(diplomaticMoodSprite))
            {
                game.UI.SetVisible(DiplomacyUI.UIRelation, true);
                game.UI.SetPropertyString(DiplomacyUI.UIRelation, "sprite", diplomaticMoodSprite);
            }
            else
            {
                game.UI.SetVisible(DiplomacyUI.UIRelation, false);
            }
            game.UI.SetText(game.UI.Path(panelName, DiplomacyUI.UIRelationText), DiplomacyUI.GetRelationText(diplomacyInfo.State));
            string propertyValue4 = Path.GetFileNameWithoutExtension(playerInfo.AvatarAssetPath);

            if (propertyValue4 == "")
            {
                propertyValue4 = game.AssetDatabase.GetFaction(playerInfo.FactionID).SplinterAvatarPath();
            }
            game.UI.SetVisible(game.UI.Path(panelName, "eliminated"), (playerInfo.isDefeated ? 1 : 0) != 0);
            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIAvatar), "sprite", propertyValue4);
            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIBadge), "sprite", Path.GetFileNameWithoutExtension(playerInfo.BadgeAssetPath));
            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIHazardRating), "text", propertyValue1);
            game.UI.SetVisible(game.UI.Path(panelName, DiplomacyUI.UIHazardRating), (factionInfo.Name != "loa" ? 1 : 0) != 0);
            game.UI.SetVisible(game.UI.Path(panelName, "hazardtitle"), (factionInfo.Name != "loa" ? 1 : 0) != 0);
            if (playerInfo.isStandardPlayer)
            {
                game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIDriveTech), "text", enginePlantTechString);
                game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIDriveSpecial), "text", engineTechString);
            }
            else
            {
                game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIDriveTech), "text", App.Localize("@UI_DIPLOMACY_TECHLEVEL_1"));
                game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIDriveSpecial), "text", "");
            }
            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIStatRpdValue), "text", propertyValue2);
            GovernmentInfo governmentInfo = game.GameDatabase.GetGovernmentInfo(playerInfo.ID);

            game.UI.SetPropertyString(game.UI.Path(panelName, DiplomacyUI.UIGovernmentType), "text", App.Localize(string.Format("@UI_EMPIRESUMMARY_{0}", (object)governmentInfo.CurrentType.ToString().ToUpper())));
        }
示例#11
0
        public override void Initialize()
        {
            CombatData       combat  = this._app.Game.CombatData.GetCombat(this._app.GameDatabase, this._combatID, this._systemID, this._turn);
            PlayerCombatData player1 = combat.GetPlayer(this._app.LocalPlayer.ID);

            if (player1 == null)
            {
                this._app.UI.CloseDialog((Dialog)this, true);
            }
            else
            {
                IEnumerable <PlayerInfo> playerInfos    = this._app.GameDatabase.GetPlayerInfos();
                StarSystemInfo           starSystemInfo = this._app.GameDatabase.GetStarSystemInfo(combat.SystemID);
                string str1 = App.Localize("@ADMIRAL_LOCATION_DEEP_SPACE");
                if (starSystemInfo != (StarSystemInfo)null)
                {
                    str1 = starSystemInfo.Name;
                }
                this._app.UI.SetPropertyString("summaryText", "text", "Combat - " + player1.VictoryStatus.ToString() + " at " + str1);
                int    num1   = 0;
                int    num2   = 0;
                float  val2_1 = 0.0f;
                float  val2_2 = 0.0f;
                double num3   = 0.0;
                double num4   = 0.0;
                float  num5   = 0.0f;
                double num6   = 0.0;
                double num7   = 0.0;
                float  num8   = 0.0f;
                int    num9   = 0;
                int    num10  = 0;
                Dictionary <int, float> dictionary1 = new Dictionary <int, float>();
                Dictionary <int, float> dictionary2 = new Dictionary <int, float>();
                foreach (PlayerInfo playerInfo in playerInfos)
                {
                    PlayerInfo       player  = playerInfo;
                    PlayerCombatData player2 = combat.GetPlayer(player.ID);
                    if (player2 != null)
                    {
                        DiplomacyInfo diplomacyInfo = this._app.GameDatabase.GetDiplomacyInfo(player1.PlayerID, player.ID);
                        string        itemGlobalId1;
                        if (diplomacyInfo.State == DiplomacyState.WAR)
                        {
                            this._app.UI.AddItem("enemiesAvatars", "", player.ID, "");
                            itemGlobalId1 = this._app.UI.GetItemGlobalID("enemiesAvatars", "", player.ID, "");
                        }
                        else
                        {
                            this._app.UI.AddItem("alliesAvatars", "", player.ID, "");
                            itemGlobalId1 = this._app.UI.GetItemGlobalID("alliesAvatars", "", player.ID, "");
                        }
                        PlayerSetup playerSetup   = this._app.GameSetup.Players.FirstOrDefault <PlayerSetup>((Func <PlayerSetup, bool>)(x => x.databaseId == player.ID));
                        string      propertyValue = playerSetup == null ? player.Name : playerSetup.Name;
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId1, "name"), "text", propertyValue);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId1, "playeravatar"), "texture", player.AvatarAssetPath);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId1, "badge"), "texture", player.BadgeAssetPath);
                        this._app.UI.SetPropertyColorNormalized(this._app.UI.Path(itemGlobalId1, "primaryColor"), "color", player.PrimaryColor);
                        this._app.UI.SetPropertyColorNormalized(this._app.UI.Path(itemGlobalId1, "secondaryColor"), "color", player.SecondaryColor);
                        this._app.UI.AddItem("combatSummary", "", player.ID, "");
                        string itemGlobalId2 = this._app.UI.GetItemGlobalID("combatSummary", "", player.ID, "");
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId2, "itemName"), "text", propertyValue);
                        List <ShipData>   shipData1   = player2.ShipData;
                        List <WeaponData> weaponData1 = player2.WeaponData;
                        List <PlanetData> planetData1 = player2.PlanetData;
                        int   count  = shipData1.Count;
                        int   num11  = 0;
                        float val1_1 = 0.0f;
                        float val1_2 = 0.0f;
                        Dictionary <int, string> dictionary3 = new Dictionary <int, string>();
                        foreach (ShipData shipData2 in shipData1)
                        {
                            num11  += shipData2.killCount;
                            val1_1 += shipData2.damageDealt;
                            val1_2 += shipData2.damageReceived;
                            if (diplomacyInfo.State == DiplomacyState.WAR)
                            {
                                num10 += shipData2.destroyed ? 1 : 0;
                            }
                            else
                            {
                                num9 += shipData2.destroyed ? 1 : 0;
                            }
                            if (!dictionary3.ContainsKey(shipData2.designID))
                            {
                                this._app.UI.AddItem(this._app.UI.Path(itemGlobalId2, "shipList"), "", shipData2.designID, "");
                                dictionary3.Add(shipData2.designID, this._app.UI.GetItemGlobalID(this._app.UI.Path(itemGlobalId2, "shipList"), "", shipData2.designID, ""));
                            }
                        }
                        foreach (WeaponData weaponData2 in weaponData1)
                        {
                            if (diplomacyInfo.State == DiplomacyState.WAR)
                            {
                                if (!dictionary2.ContainsKey(weaponData2.weaponID))
                                {
                                    dictionary2.Add(weaponData2.weaponID, 0.0f);
                                }
                                Dictionary <int, float> dictionary4;
                                int weaponId;
                                (dictionary4 = dictionary2)[weaponId = weaponData2.weaponID] = dictionary4[weaponId] + weaponData2.damageDealt;
                            }
                            else
                            {
                                if (!dictionary1.ContainsKey(weaponData2.weaponID))
                                {
                                    dictionary1.Add(weaponData2.weaponID, 0.0f);
                                }
                                Dictionary <int, float> dictionary4;
                                int weaponId;
                                (dictionary4 = dictionary1)[weaponId = weaponData2.weaponID] = dictionary4[weaponId] + weaponData2.damageDealt;
                            }
                        }
                        foreach (PlanetData planetData2 in planetData1)
                        {
                            ColonyInfo colonyInfoForPlanet = this._app.GameDatabase.GetColonyInfoForPlanet(planetData2.orbitalObjectID);
                            if (colonyInfoForPlanet != null)
                            {
                                if (colonyInfoForPlanet.PlayerID != this._app.LocalPlayer.ID)
                                {
                                    num3 += planetData2.imperialDamage;
                                    num4 += planetData2.civilianDamage.Sum <PopulationData>((Func <PopulationData, double>)(x => x.damage));
                                    num5 += planetData2.infrastructureDamage;
                                }
                                else
                                {
                                    num6 += planetData2.imperialDamage;
                                    num7 += planetData2.civilianDamage.Sum <PopulationData>((Func <PopulationData, double>)(x => x.damage));
                                    num8 += planetData2.infrastructureDamage;
                                }
                            }
                        }
                        foreach (int key in dictionary3.Keys)
                        {
                            int        des        = key;
                            DesignInfo designInfo = this._app.GameDatabase.GetDesignInfo(des);
                            int        num12      = shipData1.Where <ShipData>((Func <ShipData, bool>)(x => x.designID == des)).Count <ShipData>();
                            this._app.UI.SetSliderRange(this._app.UI.Path(dictionary3[des], "stotalUnits"), 0, count);
                            this._app.UI.SetSliderValue(this._app.UI.Path(dictionary3[des], "stotalUnits"), num12);
                            this._app.UI.SetPropertyString(this._app.UI.Path(dictionary3[des], "stotalUnitsLabel"), "text", num12.ToString());
                            int num13 = shipData1.Where <ShipData>((Func <ShipData, bool>)(x => x.designID == des)).Sum <ShipData>((Func <ShipData, int>)(x => x.killCount));
                            this._app.UI.SetSliderRange(this._app.UI.Path(dictionary3[des], "sdestroyedUnits"), 0, num11);
                            this._app.UI.SetSliderValue(this._app.UI.Path(dictionary3[des], "sdestroyedUnits"), num13);
                            this._app.UI.SetPropertyString(this._app.UI.Path(dictionary3[des], "sdestroyedUnitsLabel"), "text", num13.ToString());
                            float num14 = shipData1.Where <ShipData>((Func <ShipData, bool>)(x => x.designID == des)).Sum <ShipData>((Func <ShipData, float>)(x => x.damageDealt));
                            this._app.UI.SetSliderRange(this._app.UI.Path(dictionary3[des], "sdamageInflicted"), 0, (int)val1_1);
                            this._app.UI.SetSliderValue(this._app.UI.Path(dictionary3[des], "sdamageInflicted"), (int)num14);
                            this._app.UI.SetPropertyString(this._app.UI.Path(dictionary3[des], "sdamageInflictedLabel"), "text", num14.ToString("N0"));
                            float num15 = shipData1.Where <ShipData>((Func <ShipData, bool>)(x => x.designID == des)).Sum <ShipData>((Func <ShipData, float>)(x => x.damageReceived));
                            this._app.UI.SetSliderRange(this._app.UI.Path(dictionary3[des], "sdamageTaken"), 0, (int)val1_2);
                            this._app.UI.SetSliderValue(this._app.UI.Path(dictionary3[des], "sdamageTaken"), (int)num15);
                            this._app.UI.SetPropertyString(this._app.UI.Path(dictionary3[des], "sdamageTakenLabel"), "text", num15.ToString("N0"));
                            this._app.UI.SetPropertyString(this._app.UI.Path(dictionary3[des], "subitem_label"), "text", designInfo.Name);
                        }
                        num1   = Math.Max(count, num1);
                        num2   = Math.Max(num11, num2);
                        val2_1 = Math.Max(val1_1, val2_1);
                        val2_2 = Math.Max(val1_2, val2_2);
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId2, "totalUnits"), 0, count);
                        this._app.UI.SetSliderValue(this._app.UI.Path(itemGlobalId2, "totalUnits"), count);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId2, "totalUnitsLabel"), "text", count.ToString());
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId2, "destroyedUnits"), 0, num11);
                        this._app.UI.SetSliderValue(this._app.UI.Path(itemGlobalId2, "destroyedUnits"), num11);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId2, "destroyedUnitsLabel"), "text", num11.ToString());
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId2, "damageInflicted"), 0, (int)val1_1);
                        this._app.UI.SetSliderValue(this._app.UI.Path(itemGlobalId2, "damageInflicted"), (int)val1_1);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId2, "damageInflictedLabel"), "text", val1_1.ToString("N0"));
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId2, "damageTaken"), 0, (int)val1_2);
                        this._app.UI.SetSliderValue(this._app.UI.Path(itemGlobalId2, "damageTaken"), (int)val1_2);
                        this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId2, "damageTakenLabel"), "text", val1_2.ToString("N0"));
                    }
                }
                foreach (PlayerInfo playerInfo in playerInfos)
                {
                    if (combat.GetPlayer(playerInfo.ID) != null)
                    {
                        string itemGlobalId = this._app.UI.GetItemGlobalID("combatSummary", "", playerInfo.ID, "");
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId, "totalUnits"), 0, num1);
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId, "destroyedUnits"), 0, num2);
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId, "damageInflicted"), 0, (int)val2_1);
                        this._app.UI.SetSliderRange(this._app.UI.Path(itemGlobalId, "damageTaken"), 0, (int)val2_2);
                    }
                }
                foreach (int key in dictionary1.Keys)
                {
                    int weapon = key;
                    this._app.UI.AddItem("alliedWeaponList", "", weapon, "");
                    string itemGlobalId = this._app.UI.GetItemGlobalID("alliedWeaponList", "", weapon, "");
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "damageDealt"), "text", dictionary1[weapon].ToString("N0"));
                    LogicalWeapon logicalWeapon  = this._app.AssetDatabase.Weapons.First <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.UniqueWeaponID == weapon));
                    string        iconSpriteName = logicalWeapon.IconSpriteName;
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "weaponIcon"), "sprite", iconSpriteName);
                    this._app.UI.SetPropertyString(itemGlobalId, "tooltip", logicalWeapon.WeaponName);
                }
                foreach (int key in dictionary2.Keys)
                {
                    int weapon = key;
                    this._app.UI.AddItem("enemyWeaponList", "", weapon, "");
                    string itemGlobalId = this._app.UI.GetItemGlobalID("enemyWeaponList", "", weapon, "");
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "damageDealt"), "text", dictionary2[weapon].ToString("N0"));
                    string iconSpriteName = this._app.AssetDatabase.Weapons.First <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.UniqueWeaponID == weapon)).IconSpriteName;
                    this._app.UI.SetPropertyString(this._app.UI.Path(itemGlobalId, "weaponIcon"), "sprite", iconSpriteName);
                }
                int    num16 = 0;
                string text1 = "";
                if (num7 > 0.0 && num6 > 0.0)
                {
                    text1 = text1 + num6.ToString("N0") + " Imperialists and " + num7.ToString("N0") + " civilians lost. ";
                }
                else if (num7 > 0.0)
                {
                    text1 = text1 + num7.ToString("N0") + " civilians lost. ";
                }
                else if (num6 > 0.0)
                {
                    text1 = text1 + num6.ToString("N0") + " Imperialists lost. ";
                }
                if (num4 > 0.0 && num3 > 0.0)
                {
                    text1 = text1 + num3.ToString("N0") + " enemy Imperialists and " + num4.ToString("N0") + " enemy civilians killed.";
                }
                else if (num4 > 0.0)
                {
                    text1 = text1 + num4.ToString("N0") + " enemy civilians killed.";
                }
                else if (num3 > 0.0)
                {
                    text1 = text1 + num3.ToString("N0") + " enemy Imperialists killed.";
                }
                if (text1.Length > 0)
                {
                    this._app.UI.AddItem("happenings", "", num16++, text1);
                }
                string text2 = "";
                float  num17;
                if ((double)num8 > 0.01)
                {
                    string str2 = text2;
                    num17 = num8 * 100f;
                    string str3 = num17.ToString("#0.00");
                    text2 = str2 + "Infrastructure reduced by " + str3 + "%";
                }
                if ((double)num5 > 0.01)
                {
                    string str2 = text2;
                    num17 = num5 * 100f;
                    string str3 = num17.ToString("#0.00");
                    text2 = str2 + " Enemy infrastructure reduced by " + str3 + "%";
                }
                if (text2.Length > 0)
                {
                    this._app.UI.AddItem("happenings", "", num16++, text2);
                }
                string str4 = "";
                if (num9 > 0)
                {
                    str4 = num9 <= 1 ? str4 + num9.ToString() + " friendly ship lost. " : str4 + num9.ToString() + " friendly ships lost. ";
                }
                if (num10 > 0)
                {
                    str4 = num9 <= 1 ? str4 + num10.ToString() + " enemy ship destroyed." : str4 + num10.ToString() + " enemy ships destroyed.";
                }
                if (str4.Length <= 0)
                {
                    return;
                }
                UICommChannel ui         = this._app.UI;
                int           userItemId = num16;
                int           num18      = userItemId + 1;
                string        text3      = str4;
                ui.AddItem("happenings", "", userItemId, text3);
            }
        }