// Script that contains all horse properties and their bounds
// Author: InnerTri


// No imports needed, since this is just a class declaration
// and a declaration of arrays made up of said class



// Classes
// Define a class for properties
// Was using multiple arrays to hold the property names, mins and maxes,
// but this is slightly easier now that we have a lot of properties
// numeric properties are inherited by children
class EntityBehaviorNumericProperty {
	name = "";
	min = 0;
	max = 0;

	constructor(name, min, max) {
		this.name = name;
		this.min = min;
		this.max = max;
	}
}

// class for Attribute properties,
// since their component's names will differ from what we've named them
class EntityBehaviorAttributeProperty {
	componentName = "";
	min = 0;
	max = 0;

	constructor(componentName, min, max) {
		this.componentName = componentName;
		this.min = min;
		this.max = max;
	}
}





// define all of the inherited properties of any given horse
// seperate arrays since color properties are inherited
// by choosing one of the parent's (or mutate),
// and scale properties are inherited by averaging
// both parents multiplied by a mutation factor
export const horseColorProps = [
	new EntityBehaviorNumericProperty("cyn_hao:base_id", 0, 21),
	new EntityBehaviorNumericProperty("cyn_hao:pattern_id", 0, 17),
	new EntityBehaviorNumericProperty("cyn_hao:head_id", 0, 16),
	new EntityBehaviorNumericProperty("cyn_hao:sock_id", 0, 13),
	new EntityBehaviorNumericProperty("cyn_hao:mane_id", 0, 13)
];

// Unicorn Color properties
// probably foolish to export a single-element array,
// but doing it this way to use our existing functions
export const unicornColorProps = [
	new EntityBehaviorNumericProperty("cyn_hao:base_id", 0, 7)
];

// Rainbow Horse Color properties
// probably foolish to export a single-element array,
// but doing it this way to use our existing functions
export const rainbowColorProps = [
	new EntityBehaviorNumericProperty("cyn_hao:base_id", 0, 15)
];

// Big Seahorse Color properties
// probably foolish to export a single-element array,
// but doing it this way to use our existing functions
export const seahorseBigColorProps = [
	new EntityBehaviorNumericProperty("cyn_hao:base_id", 0, 9)
];





// Wild bounds reference:
// "cyn_hao:height_scale": "math.random(-0.1, 0.15)",
// "cyn_hao:density_scale": "math.random(-0.15, 0.07)",
// "cyn_hao:tail_scale": "math.random(0.6, 1.5)"

// Tamed Horse Scale limits
export const horseScaleProps = [
	new EntityBehaviorNumericProperty("cyn_hao:height_scale", -0.125, 0.1875),
	new EntityBehaviorNumericProperty("cyn_hao:density_scale", -0.1875, 0.0875),
	//  NOTE
	// Tail scale is 1-based, NOT 0-based like height and density scales!
	new EntityBehaviorNumericProperty("cyn_hao:tail_scale", 0.45, 1.875)
];



// Wild bounds reference:
// "cyn_hao:height_scale": "math.random(-0.04, 0.075)",
// "cyn_hao:density_scale": "math.random(-0.075, 0.03)",
// "cyn_hao:tail_scale": "math.random(0.75, 1.25)"

// Tamed Donkey Scale limits
export const donkeyScaleProps = [
	new EntityBehaviorNumericProperty("cyn_hao:height_scale", -0.0625, 0.09375),
	new EntityBehaviorNumericProperty("cyn_hao:density_scale", -0.09375, 0.04375),
	//  NOTE
	// Tail scale is 1-based, NOT 0-based like height and density scales!
	new EntityBehaviorNumericProperty("cyn_hao:tail_scale", 0.675, 1.4375)
];




// Reference Attributes, though this may be outdated
// copy-pasted from the spreadsheet



// 			HORSE Attributes									DONKEY Attributes				
// 			Health	Speed	Jump								Health	Speed	Jump		
// 		Min	15		0.12	0.5								Min	15		0.1		0.5		
// 		Max	40		0.45	1.15							Max	35		0.3		0.8		
// 		Inc	2.5		0.033	0.065							Inc	2		0.02	0.03		
// 		Avg	27.5	0.285	0.825							Avg	25		0.2		0.65		
												
// Group	Hmin	Hmax	Smin	Smax	Jmin	Jmax		Group	Hmin	Hmax	Smin	Smax	Jmin	Jmax
// 0		15		17.5	0.12	0.153	0.5		0.565		0		15		17		0.1		0.12	0.5		0.53
// 1		17.5	20		0.153	0.186	0.565	0.63		1		17		19		0.12	0.14	0.53	0.56
// 2		20		22.5	0.186	0.219	0.63	0.695		2		19		21		0.14	0.16	0.56	0.59
// 3		22.5	25		0.219	0.252	0.695	0.76		3		21		23		0.16	0.18	0.59	0.62
// 4		25		27.5	0.252	0.285	0.76	0.825		4		23		25		0.18	0.2		0.62	0.65
// 5		27.5	30		0.285	0.318	0.825	0.89		5		25		27		0.2		0.22	0.65	0.68
// 6		30		32.5	0.318	0.351	0.89	0.955		6		27		29		0.22	0.24	0.68	0.71
// 7		32.5	35		0.351	0.384	0.955	1.02		7		29		31		0.24	0.26	0.71	0.74
// 8		35		37.5	0.384	0.417	1.02	1.085		8		31		33		0.26	0.28	0.74	0.77
// 9		37.5	40		0.417	0.45	1.085	1.15		9		33		35		0.28	0.3		0.77	0.8
												
// Vanilla	15		30		0.1125	0.3375	0.4		1.0			Vanilla	15		30		0.175	0.175	0.5		0.5









// Failed attempt at dynamically setting horses (max) health
// Unfortunately, the extent of what we can do is set their CURRENT
// health, but this has no impact on the min or max possible health
// left in in case it suddenly becomes available
// // Attribute Limits

// // NOTE that these are the ABSOLUTE bounds!!!
// // wild horse bounds are smaller than these,
// // and that is defined in the entity_spawned event
// // however, bred horses can exceed those bounds,
// // thus they use these bounds as limits instead

// // Wild Horse Attribute Limits:
// // Health: 15 - 30
// // Speed: 0.12 - 0.34
// // Jump: 0.5 - 1.05

// // Tamed Horse Attribute limits
// export const horseAttributeProps = [
// 	new EntityBehaviorAttributeProperty("minecraft:health", 15, 40),
// 	new EntityBehaviorAttributeProperty("minecraft:movement", 0.12, 0.45),
// 	new EntityBehaviorAttributeProperty("minecraft:horse.jump_strength", 0.5, 1.15)
// ];

// // Wild Donkey Attribute Limits:
// // Donkey Tame Limits are 1/2 of Horse Tame Limits
// // Health: 15 - 30
// // Speed: 0.1 - 0.25
// // Jump: 0.5 - 0.7

// // Tamed Donkey Attribute limits
// export const donkeyAttributeProps = [
// 	new EntityBehaviorAttributeProperty("minecraft:health", 15, 35),
// 	new EntityBehaviorAttributeProperty("minecraft:movement", 0.1, 0.3),
// 	new EntityBehaviorAttributeProperty("minecraft:horse.jump_strength", 0.5, 0.8)
// ];