Files
ChibiMango 534d77c389 Created & applied new event_object type (#109)
Created new event type.
some components only allow for an event to be an object, not a string
Co-authored-by: Daan Verstraten <daanverstraten@hotmail.com>
2022-08-22 20:13:13 +02:00

126 lines
5.0 KiB
JSON

{
"$id": "blockception.minecraft.behavior.entities.minecraft.genetics",
"type": "object",
"title": "Genetics",
"additionalProperties": false,
"description": "Defines the way a mob's genes and alleles are passed on to it's offspring, and how those traits manifest in the child. Compatible parent genes are crossed together, the alleles are handed down from the parents to the child, and any matching genetic variants fire off JSON events to modify the child and express the traits.",
"required": [],
"definitions": {
"integer_range": {
"title": "Range",
"examples": [
-1,
{
"range_min": 4,
"range_max": 7
}
],
"oneOf": [
{
"type": "integer"
},
{
"type": "object",
"properties": {
"range_min": {
"type": "integer",
"default": 0,
"description": "Lower bound of the vaues.",
"title": "Range Minimum"
},
"range_max": {
"type": "integer",
"default": 0,
"description": "Upper bound of the vaues.",
"title": "Range Maximum"
}
}
}
]
}
},
"properties": {
"mutation_rate": {
"type": "number",
"description": "Chance that an allele will be replaced with a random one instead of the parent's allele during birth.",
"title": "Mutation Rate",
"default": 0.03125
},
"genes": {
"title": "Genes",
"type": "array",
"description": "The list of genes that this entity has and will cross with a partner during breeding.",
"items": {
"type": "object",
"description": "The list of genes that this entity has and will cross with a partner during breeding.",
"title": "Gene",
"properties": {
"allele_range": {
"title": "Allele Range",
"description": "The range of positive integer allele values for this gene. Spawned mobs will have a random number in this range assigned to them.",
"$ref": "#/definitions/integer_range"
},
"genetic_variants": {
"title": "Genetic Variants",
"type": "array",
"description": "The list of genetic variants for this gene. These check for particular allele combinations and fire events when all of them are satisfied.",
"items": {
"title": "Genetic Variants",
"description": "The genetic variant for this gene. These check for particular allele combinations and fire events when all of them are satisfied.",
"type": "object",
"properties": {
"birth_event": {
"$ref": "../types/event_object.json",
"description": "Event to run when this mob is created and matches the above allele conditions.",
"title": "Brith Event"
},
"both_allele": {
"title": "Both Allele",
"default": -1,
"description": "If this value is non-negative, compare both the mob's main and hidden alleles with this value for a match with both. Can also be a range of integers.",
"$ref": "#/definitions/integer_range"
},
"either_allele": {
"title": "Either Allele",
"type": "integer",
"default": -1,
"description": "If this value is non-negative, compare both the mob's main and hidden alleles with this value for a match with either. Can also be a range of integers."
},
"hidden_allele": {
"title": "Hidden Allele",
"type": "integer",
"default": -1,
"description": "If this value is non-negative, compare the mob's hidden allele with this value for a match. Can also be a range of integers."
},
"main_allele": {
"title": "Main Allele",
"default": -1,
"description": "If this value is non-negative, compare the mob's main allele with this value for a match. Can also be a range of integers.",
"$ref": "#/definitions/integer_range"
},
"mutation_rate": {
"title": "Mutation Rate",
"type": "number",
"default": -1,
"description": "If this value is non-negative, overrides the chance for this gene that an allele will be replaced with a random one instead of the parent's allele during birth. Non-negative values greater than 1 will be the same as the value 1."
}
}
}
},
"name": {
"title": "Name",
"type": "string",
"description": "The name of the gene."
}
}
}
}
},
"examples": [
{
"mutation_rate": 0.0,
"genes": []
}
]
}