Ejemplo n.º 1
0
        public override ActionResponse Handle()
        {
            BuffOption buff;

            if (buffType == "random")
            {
                buff = BuffManager.getRandomBuff(1)[0];
            }
            else
            {
                buff = BuffManager.getIDtoBuff(buffType);
            }

            if (buff == null)
            {
                BNC_Core.Logger.Log($"Could not find buff type of: {buffType}", StardewModdingAPI.LogLevel.Error);
                return(ActionResponse.Done);
            }
            else
            {
                //If not Default
                if (Duration != 1200 && Duration > 0 && Duration < 5000)
                {
                    buff.setDuration(Duration);
                }

                BuffManager.AddBuffToQueue(buff);
                return(ActionResponse.Done);
            }
        }
Ejemplo n.º 2
0
        public override ActionResponse Handle()
        {
            BuffOption buff = new BuffOption(id, Name);

            //If not Default
            if (Duration != 1200 && Duration > 0 && Duration < 5000)
            {
                buff.setDuration(Duration);
            }

            buff.addShortDesc(ShortDesc);

            if (Attack != 0)
            {
                buff.add_attack(Attack);
            }

            if (Defense != 0)
            {
                buff.add_defense(Defense);
            }

            if (Farming != 0)
            {
                buff.add_farming(Farming);
            }

            if (Foraging != 0)
            {
                buff.add_foraging(Foraging);
            }

            if (MaxStamina != 0)
            {
                buff.add_maxStamina(MaxStamina);
            }

            if (Speed != 0)
            {
                buff.add_speed(Speed);
            }

            if (Luck != 0)
            {
                buff.add_luck(Luck);
            }

            if (MagneticRadius != 0)
            {
                buff.add_magneticRadius(MagneticRadius);
            }

            if (Mining != 0)
            {
                buff.add_mining(Mining);
            }

            if (Glowing == 1)
            {
                var prop = typeof(Color).GetProperty(GlowingColor);
                if (prop != null)
                {
                    buff.setGlow((Color)prop.GetValue(GlowingColor));
                }
                else
                {
                    buff.setGlow(Color.LightBlue);
                }
            }

            if (buff == null)
            {
                BNC_Core.Logger.Log($"Could not find buff type of: {id}", StardewModdingAPI.LogLevel.Error);
                return(ActionResponse.Done);
            }
            else
            {
                BuffManager.AddBuffToQueue(buff);
                return(ActionResponse.Done);
            }
        }