StardewModders / mod-ideas

Submit ideas for mods to create, or find your next mod project!
90 stars 5 forks source link

Animal Breeding Expansion #1076

Open cuteoreo opened 1 year ago

cuteoreo commented 1 year ago

Description: This mod expands the animal breeding mechanics in Stardew Valley, allowing players to breed more unique and rare animals.

Features:

Introduces a new animal breeding building called the "Breeding Barn" which can be purchased from Robin's carpenter shop after the player has built a deluxe barn. Players can place two compatible animals in the Breeding Barn and wait for them to produce offspring. Compatibility is based on the animal species and gender. Breeding different species of animals will result in hybrid offspring with unique appearances and traits. Rare animals, such as the golden chicken, can only be obtained by breeding two specific types of animals together. Players can also breed animals for specific traits, such as increased milk or egg production, faster growth rate, or improved happiness. The Breeding Barn can be upgraded with new features, such as automated feeding and breeding machines. The mod adds new animal breeds, such as ducks, rabbits, and peacocks, which can only be obtained through breeding. Compatibility: This mod should be compatible with most other mods that don't modify the animal breeding mechanics in Stardew Valley.

Implementation: The mod will require adding new assets such as sprites for the new animals, building sprites for the Breeding Barn, and new dialogue for Robin and other characters. The mod will also require modifying the existing animal breeding mechanics in Stardew Valley to support the new features. This can be accomplished through custom code using the Stardew Valley Modding API (SMAPI) and programming in C#.

cuteoreo commented 1 year ago

chatgpt came up with this idea

cuteoreo commented 1 year ago

using StardewValley; using StardewValley.Buildings; using StardewValley.Objects; using System;

namespace AnimalBreedingExpansionMod { public class BreedingBarn : Building { private bool _isBreeding; private int _breedingTime; private int _breedProgress;

    public BreedingBarn() : base()
    {
        _isBreeding = false;
        _breedingTime = 0;
        _breedProgress = 0;
    }

    public override void Update(GameTime time)
    {
        base.Update(time);
        if (_isBreeding)
        {
            _breedProgress++;
            if (_breedProgress >= _breedingTime)
            {
                // Spawn new animal and reset breeding progress
                _isBreeding = false;
                _breedProgress = 0;
                Game1.createObjectDebris(new Object(430, 1), TileLocation, -1);
            }
        }
    }

    public void StartBreeding(Animal animal1, Animal animal2)
    {
        if (animal1.GetType() == animal2.GetType() && animal1.Gender != animal2.Gender)
        {
            // Determine breeding time based on animal rarity
            _breedingTime = GetBreedingTime(animal1.Rarity, animal2.Rarity);
            _isBreeding = true;
        }
    }

    private int GetBreedingTime(int rarity1, int rarity2)
    {
        int averageRarity = (rarity1 + rarity2) / 2;
        int breedingTime = 7 - (int)Math.Floor((double)averageRarity / 2);
        return breedingTime;
    }
}

}

cuteoreo commented 1 year ago

This code defines a new building class called "BreedingBarn" which extends the Stardew Valley "Building" class. The "BreedingBarn" class keeps track of whether the barn is currently breeding animals, the breeding time required for the animals being bred, and the progress towards breeding a new animal.

The "StartBreeding" method takes two Animal objects as input and starts the breeding process if they are compatible based on their species and gender. The "GetBreedingTime" method calculates the breeding time based on the average rarity of the two animals being bred.

This is just a small snippet of the code needed for the mod, but it demonstrates the basic mechanics of animal breeding and how they can be implemented using C# and the Stardew Valley Modding API.

chatgpt wrote part of the code

atravita-mods commented 1 year ago

Heads up - the code from chatgpt is basically nonsense and really isn't helpful.

Also personally if I wanted ideas from the bot I'd interact with the bot myself, guiding it is most of the fun with it, honestly.

aedenthorn commented 1 year ago

srsly are we actually accepting mod suggestions from bots?

cho0pera commented 1 year ago

@cuteoreo - check out: https://www.nexusmods.com/stardewvalley/mods/13974 for an existing breeding overhaul mod if you're interested