Exemplo n.º 1
0
        public static ItemInfo GatherUnlock(ulong key)
        {
            STUUnlock unlock = GetInstance <STUUnlock>(key);

            if (unlock == null)
            {
                return(null);
            }

            string name        = GetString(unlock.CosmeticName);
            string description = GetDescriptionString(unlock.CosmeticDescription);
            string availableIn = GetString(unlock.CosmeticAvailableIn);

            if (unlock is STUUnlock_Currency)
            {
                name = $"{(unlock as STUUnlock_Currency).Amount} Credits";
            }
            else if (unlock is STULevelPortrait)
            {
                STULevelPortrait portrait = unlock as STULevelPortrait;
                name = $"{portrait.Tier} Star: {portrait.Star} Level: {portrait.Level}";
            }

            if (name == null)
            {
                name = $"{GUID.LongKey(key):X12}";
            }

            return(new ItemInfo(name, unlock.CosmeticRarity.ToString(), unlock.RealName, description, availableIn, unlock, key));
        }
Exemplo n.º 2
0
            private string DumpGUID(IndentHelper indentHelper, ulong guid)
            {
                string baseString = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}]";

                STUInstance[] instances;
                switch (GUID.Type(guid))
                {
                default:
                    return("");

                case 0x7C:
                case 0xA9:
                    return($"{baseString} \"{GetOWString(guid, _handler, _map)}\"");

                case 0x90:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUEncryptionKey encryptionKey = instances[0] as STUEncryptionKey;
                    return($"{baseString} {encryptionKey?.KeyNameProper}:{encryptionKey?.Key}");

                case 0xA5:
                    instances = GetInstances(guid, _handler, _map);
                    STUUnlock unlock      = instances.OfType <STUUnlock>().First();
                    string    baseString2 = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}";
                    if (unlock == null)
                    {
                        return(null);
                    }
                    if (unlock is STUUnlock_Currency)
                    {
                        return($"{baseString2}:Credits] {(unlock as STUUnlock_Currency).Amount} Credits");
                    }
                    else if (unlock is STULevelPortrait)
                    {
                        STULevelPortrait portrait = unlock as STULevelPortrait;
                        return
                            ($"{baseString2}:Credits] {portrait.Tier} Star:{portrait.Star} Level:{portrait.Level}");
                    }
                    else if (unlock is STUCompetitiveCurrencyReward)
                    {
                        STUCompetitiveCurrencyReward competitiveCurrencyReward = unlock as STUCompetitiveCurrencyReward;
                        return
                            ($"{baseString2}:CompetitivePoints] {competitiveCurrencyReward.Amount} points");
                    }
                    else
                    {
                        return($"{baseString2}:{unlock.GetType().Name}] \"{GetOWString(unlock.CosmeticName, _handler, _map)}\"");
                    }

                case 0x9E:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STULoadout ability = instances[0] as STULoadout;
                    return($"{baseString} \"{GetOWString(ability?.Name, _handler, _map)}\" ({ability?.Category})");

                case 0xC5:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGamemode gamemode = instances[0] as STUGamemode;
                    return($"{baseString} \"{GetOWString(gamemode?.DisplayName, _handler, _map)}\"");

                case 0xC6:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGameRulesetSchema gameRulsetSchema = instances[0] as STUGameRulesetSchema;
                    return($"{baseString} \"{GetOWString(gameRulsetSchema?.Name, _handler, _map)}\"");

                case 0x75:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUHero hero = instances[0] as STUHero;
                    return($"{baseString} \"{GetOWString(hero?.Name, _handler, _map)}\"");
                }
            }