Extensions:Character Pairings

From Lorekeeper Wiki
Revision as of 07:15, 5 September 2023 by Cylunny (talk | contribs) (configuration part 1)
Jump to navigation Jump to search
Character Pairings
Description Allows two characters to be paired/bred for new MYO slots.
Author(s) Cylunny
Status testing
Github lorekeeper/tree/extension/character-pairings
LK Version 2.1.2
Contains a Migration






A character breeding/pairing extension! This extension serves as a baseline and should be flexible enough for simple breeding systems, or for not yet existing ones! If your system is very specific, feel free to edit parts of this for your own use. For the sake of breeding, this also adds the sex field to characters (character images to be clear). This field is optional.

Installation

  • pull & deal with merge conflicts
  • php artisan add-site-settings
  • php artisan migrate
  • php artisan optimize x2
  • php artisan update-extension-tracker

Configuration

While everything should be set up with a default value, you have a lot of configurations options!

Site Settings

Within your site settings, you will find these new fields:

  • pairing_cooldown - 0: Disabled. Number of days to wait between pairing a character.
  • pairing_female_percentage - 0: Disabled, do not roll sex. 1-100: Chance to generate a male offspring. Must total 100 with the pairing_male_percentage setting.
  • pairing_male_percentage - 0: Disabled, do not roll sex. 1-100: Chance to generate a male offspring. Must total 100 with the pairing_female_percentage setting.
  • pairing_sex_restrictions - 0: Any character can be paired. 1: Only male/female characters can be paired.
  • pairing_trait_inheritance - Number between 0-100. Percentage chance to inherit traits from both parents upon generating offspring. Set 100 for always. Set 0 for never (or any value inbetween).

Existing Data

Rarities

Rarities have a new field that allows you to set the inherit chance for any trait of that rarity. For example, a common trait could be inherited 90% of the time, a rare one 25% of the time, etc. They should default to 50% upon running the migrations.

Species

Species have a new field that allows you to set the inherit chance of the species. They should default to 50 upon running the migrations. IMPORTANT NOTE: If one species is set to 50 and the other to 50, then the likelyhood of inheriting one is the same. However, if one species is set to 100 it does NOT mean it is inherited 100% of the time. If the second species is 50, then the total chance is 150, making the first species twice as likely to be inherited instead.

Subtypes

The same functionality as for species applies.

Trait Categories

Trait categories get two new fields that allow you to set a min and a max number of traits from this category that can be inherited. Let's say you have a trait category for wings and your character can only have one wing trait at a time. You can then set the wings category to inherit 0-1. Or, if you would like to always force a wing trait, 1-1. The default for all categories is 0-5.

New Item Tags

Two new item tags were added. One is the pairing item that is required for the user to create a pairing. The other is a boost item that can boost chances.

Pairing Item Tag

tbe

Boost Item Tag

tbe

Usage

Troubleshooting

As the process with all it's options is rather complex, I expect some issues here and there. If you find something, feel free to contact me- I am Cylunny on the lorekeeper discord!

Images

See Also

If this extension helped you, feel free to support me on Kofi!