Example #1
0
        /// <summary>
        /// Registers the price for a plort into the economy director
        /// </summary>
        /// <param name="valueMap">The map with the price value</param>
        public static void RegisterMarketPrice(EconomyDirector.ValueMap valueMap)
        {
            if (ModLoader.CurrentStep != LoadingState.REGISTER)
            {
                throw new Exception("You can only register things during the 'Register' step");
            }

            MARKET_VALUES.RemoveWhere(map => map.accept == valueMap.accept);
            MARKET_VALUES.Add(valueMap);
        }
Example #2
0
        public static void RegisterFireSlimes()
        {
            Identifiable.Id id      = Identifiable.Id.FIRE_PLORT;
            Identifiable.Id slimeId = Identifiable.Id.FIRE_SLIME;

            EconomyDirector.ValueMap valueMap = GetValueMap(id);

            PlortRegistry.RegisterPlort(slimeId, valueMap.value * 4, valueMap.fullSaturation);

            DroneRegistry.RegisterBasicTarget(slimeId); //And make so that the drones can grab slimes

            Console.Log("Slime:" + slimeId + " registred perfectly");
        }
Example #3
0
        public override void Load()
        {
            Console.Log("Loading SlimesAndMarket");

            try                                                               //Try the code there, if some error arises then it calls the "catch" function
            {
                foreach (Identifiable.Id slime in ExtraSlimes.VANILLA_SLIMES) //For each slime int he slime class
                {
                    Console.Log("Printing Slime: " + slime.ToString());

                    EconomyDirector.ValueMap valueMap = Extension.GetValueMap(slime);

                    //If the slime is a puddle/fire/quicksilver slime then add the plort id, else just add the id of the slime (true/false argumeter tells the programm if it's a puddle/fire/quicksilver slime or regular slimes, except tarrs and lucky slimes)
                    //We are getting the informations of the plort of the correct slime (to make normal prices)
                    //But if we find nothing then return null
                    Console.Log("   valueMap not found...");
                    if (valueMap == null)
                    {
                        continue;
                    }
                    Console.Log("   ...or maybe yes? Now registering slimes");

                    PlortRegistry.RegisterPlort(slime, valueMap.value * 4, valueMap.fullSaturation); //Else, if the slime is a regular slime, then register the slime (make so that you can sell it) for 4 times the original price more.

                    DroneRegistry.RegisterBasicTarget(slime);                                        //And make so that the drones can grab slimes

                    Console.Log("Slime: " + slime + " registred perfectly");
                }
            }
            catch (Exception e)                                                     //But if an error was found
            {
                Console.Log("Slimes and Market mod error (Vanilla): " + e.Message); //Then log the error into the SRML.log file
            }

            ExtraSlimes.RegisterSaberSlimes();
            ExtraSlimes.RegisterGoldSlimes();
            ExtraSlimes.RegisterFireSlimes();
            ExtraSlimes.RegisterPuddleSlimes();
            ExtraSlimes.RegisterQuicksilverSlimes();
            ExtraSlimes.RegisterLuckySlimes();
        }
Example #4
0
 public static void AddEconomyEntry(EconomyDirector.ValueMap map)
 {
     valueMapsToPatch.Add(map);
 }