예제 #1
0
 /// <summary>
 ///   <para>Uses the given <paramref name="customNameInfo"/> to get localization strings.</para>
 /// </summary>
 public void SetTranslations(CustomNameInfo customNameInfo)
 {
     Translations[0] = customNameInfo.English;
     Translations[1] = customNameInfo.SChinese;
     Translations[2] = customNameInfo.German;
     Translations[3] = customNameInfo.Spanish;
     Translations[4] = customNameInfo.Brazilian;
     Translations[5] = customNameInfo.Russian;
     Translations[6] = customNameInfo.French;
     Translations[7] = customNameInfo.KoreanA;
 }
예제 #2
0
        /// <summary>
        ///   <para>Creates a new <see cref="CustomName"/> with the specified <paramref name="id"/>, <paramref name="type"/> and <paramref name="info"/>.</para>
        /// </summary>
        public static CustomName CreateCustomName(string id, string type, CustomNameInfo info)
        {
            CustomName customName = GetCustomName(id, type);

            if (customName != null)
            {
                string message = string.Concat("A CustomName with Id \"", id, "\" and Type \"", type, "\" already exists!");
                Logger.LogError(message);
                throw new ArgumentException(message, nameof(id));
            }
            CustomNames.Add(customName = new CustomName(id, type, info));

            Logger.LogDebug(string.Concat("A CustomName with Id \"", id, "\" and Type \"", type, "\" was created."));

            return(customName);
        }
예제 #3
0
        /// <summary>
        ///   <para>Creates a new <see cref="CustomTrait"/> with the specified <paramref name="id"/>, <paramref name="name"/> and <paramref name="description"/>.</para>
        /// </summary>
        public static CustomTrait CreateCustomTrait(string id, bool unlockedFromStart, CustomNameInfo name, CustomNameInfo description)
        {
            CustomTrait customTrait = GetCustomTrait(id);

            if (customTrait != null)
            {
                string message = string.Concat("A CustomTrait with Id \"", id, "\" already exists!");
                Logger.LogError(message);
                throw new ArgumentException(message, nameof(id));
            }
            CustomTraits.Add(customTrait = new CustomTrait(id,
                                                           CreateCustomName(id, "StatusEffect", name),
                                                           CreateCustomName(id, "Description", description)
                                                           ));
            customTrait.Unlocked = unlockedFromStart;

            PluginInstance.Setup(customTrait);

            Logger.LogDebug(string.Concat("A CustomTrait with Id \"", id, "\" was created."));

            return(customTrait);
        }
예제 #4
0
        /// <summary>
        ///   <para>Creates a new <see cref="CustomAbility"/> with the specified <paramref name="id"/>, <paramref name="sprite"/>, <paramref name="name"/> and <paramref name="description"/>.</para>
        /// </summary>
        public static CustomAbility CreateCustomAbility(string id, Sprite sprite, bool unlockedFromStart, CustomNameInfo name, CustomNameInfo description, Action <InvItem> setupDetails)
        {
            CustomAbility customAbility = GetCustomAbility(id);

            if (customAbility != null)
            {
                string message = string.Concat("A CustomAbility with Id \"", id, "\" already exists!");
                Logger.LogError(message);
                throw new ArgumentException(message, nameof(id));
            }
            CustomAbilities.Add(customAbility = new CustomAbility(id,
                                                                  CreateCustomName(id, "Item", name),
                                                                  CreateCustomName(id, "Description", description)
                                                                  ));
            customAbility.Unlocked     = unlockedFromStart;
            customAbility.Sprite       = sprite;
            customAbility.SetupDetails = setupDetails;
            sprite.name = id;

            PluginInstance.Setup(customAbility);

            Logger.LogDebug(string.Concat("A CustomAbility with Id \"", id, "\" was created."));

            return(customAbility);
        }
예제 #5
0
        /// <summary>
        ///   <para>Creates a new <see cref="CustomMutator"/> with the specified <paramref name="id"/>, <paramref name="name"/> and <paramref name="description"/>.</para>
        /// </summary>
        public static CustomMutator CreateCustomMutator(string id, bool unlockedFromStart, CustomNameInfo name, CustomNameInfo description)
        {
            CustomMutator customMutator = GetCustomMutator(id);

            if (customMutator != null)
            {
                string message = string.Concat("A CustomMutator with Id \"", id, "\" already exists!");
                Logger.LogError(message);
                throw new ArgumentException(message, nameof(id));
            }
            CustomMutators.Add(customMutator = new CustomMutator(id,
                                                                 CreateCustomName(id, "Unlock", name),
                                                                 CreateCustomName("D_" + id, "Unlock", description)
                                                                 ));
            customMutator.Unlocked = unlockedFromStart;

            PluginInstance.Setup(customMutator);

            Logger.LogDebug(string.Concat("A CustomMutator with Id \"", id, "\" was created."));

            return(customMutator);
        }
예제 #6
0
 internal CustomName(string id, string type, CustomNameInfo info)
 {
     Id           = id;
     Type         = type;
     Translations = info.ToArray();
 }