package race_types

// Race type category constants
// Converted from C++ RaceTypes.h defines
const (
	// DRAGONKIND category (101-110)
	Dragonkind = 101
	Dragon     = 102
	Drake      = 103
	Drakota    = 104
	Droag      = 105
	Faedrake   = 106
	Sokokar    = 107
	Wurm       = 108
	Wyrm       = 109
	Wyvern     = 110

	// FAY category (111-122)
	Fay        = 111
	ArasaiNPC  = 112
	Bixie      = 113
	Brownie    = 114
	Dryad      = 115
	FaeNPC     = 116
	Fairy      = 117
	Siren      = 118
	Spirit     = 119
	Sprite     = 120
	Treant     = 121 // L&L 8
	Wisp       = 122

	// MAGICAL category (123-154)
	Magical        = 123
	Amorph         = 124
	Construct      = 125
	Animation      = 126
	BoneGolem      = 127
	Bovoch         = 128
	CarrionGolem   = 129
	ClayGolem      = 130
	Cube           = 131
	Dervish        = 132
	Devourer       = 133
	Gargoyle       = 134
	Golem          = 135
	Goo            = 136
	Harpy          = 137
	Imp            = 138
	LivingStatue   = 139
	Mannequin      = 140
	Mimic          = 141
	Moppet         = 142
	Naga           = 143
	Nayad          = 144
	Ooze           = 145
	Rumbler        = 146
	RustMonster    = 147
	Satyr          = 148
	Scarecrow      = 149
	Spheroid       = 150
	TentacleTerror = 151
	Tome           = 152
	Unicorn        = 153
	WoodElemental  = 154

	// MECHANIMAGICAL category (155-157)
	Mechanimagical = 155
	Clockwork      = 156
	IronGuardian   = 157

	// NATURAL category (158-239)
	Natural       = 158
	Animal        = 159
	Aquatic       = 160
	Avian         = 161
	Canine        = 162
	Equine        = 163
	Feline        = 164
	Insect        = 165
	Primate       = 166
	Reptile       = 167
	Anemone       = 168
	Apopheli      = 169
	Armadillo     = 170
	Badger        = 171
	Barracuda     = 172
	Basilisk      = 173
	Bat           = 174
	Bear          = 175
	Beaver        = 176
	Beetle        = 177
	Bovine        = 178
	Brontotherium = 179
	Brute         = 180
	Camel         = 181
	Cat           = 182
	Centipede     = 183
	Cerberus      = 184
	Chimera       = 185
	Chokidai      = 186
	Cobra         = 187
	Cockatrice    = 188
	Crab          = 189
	Crocodile     = 190
	Deer          = 191
	Dragonfly     = 192
	Duck          = 193
	Eel           = 194
	Elephant      = 195
	FlyingSnake   = 196
	Frog          = 197
	Goat          = 198
	Gorilla       = 199
	Griffin       = 200
	Hawk          = 201
	HiveQueen     = 202
	Horse         = 203
	Hyena         = 204
	KhoalRat      = 205
	Kybur         = 206
	Leech         = 207
	Leopard       = 208
	Lion          = 209
	Lizard        = 210
	Mammoth       = 211
	MantaRay      = 212
	MoleRat       = 213
	Monkey        = 214
	Mythical      = 215
	Octopus       = 216
	OwlBear       = 217
	Pig           = 218
	Piranha       = 219
	Raptor        = 220
	Rat           = 221
	Rhinoceros    = 222
	RockCrawler   = 223
	SaberTooth    = 224
	Scorpion      = 225
	SeaTurtle     = 226
	Shark         = 227
	Sheep         = 228
	Slug          = 229
	Snake         = 230
	Spider        = 231
	Stirge        = 232
	Swordfish     = 233
	Tiger         = 234
	Turtle        = 235
	Vermin        = 236
	Vulrich       = 237
	Wolf          = 238
	Yeti          = 239

	// PLANAR category (240-267)
	Planar         = 240
	Abomination    = 241
	AirElemental   = 242
	Amygdalan      = 243
	Avatar         = 244
	Cyclops        = 245
	Demon          = 246
	Djinn          = 247
	EarthElemental = 248
	Efreeti        = 249
	Elemental      = 250
	Ethereal       = 251
	Etherpine      = 252
	EvilEye        = 253
	FireElemental  = 254
	Gazer          = 255
	Gehein         = 256
	Geonid         = 257
	Giant          = 258 // L&L 5
	Salamander     = 259
	ShadowedMan    = 260
	Sphinx         = 261
	Spore          = 262
	Succubus       = 263
	Valkyrie       = 264
	VoidBeast      = 265
	WaterElemental = 266
	Wraith         = 267

	// PLANT category (268-274)
	Plant            = 268
	CarnivorousPlant = 269
	Catoplebas       = 270
	Mantrap          = 271
	RootAbomination  = 272
	RootHorror       = 273
	Succulent        = 274

	// SENTIENT category (275-332)
	Sentient      = 275
	Ashlok        = 276
	Aviak         = 277
	BarbarianNPC  = 278
	BirdMan       = 279
	BoarFiend     = 280
	Bugbear       = 281
	Burynai       = 282
	Centaur       = 283 // L&L 4
	Coldain       = 284
	Dal           = 285
	DarkElfNPC    = 286
	Dizok         = 287
	Drachnid      = 288
	Drafling      = 289
	Drolvarg      = 290
	DwarfNPC      = 291
	EruditeNPC    = 292
	Ettin         = 293
	FreebloodNPC  = 294
	FroglokNPC    = 295
	FrostfellElf  = 296
	FungusMan     = 297
	Gnoll         = 298 // L&L 1
	GnomeNPC      = 299
	Goblin        = 300 // L&L 3
	Gruengach     = 301
	HalfElfNPC    = 302
	HalflingNPC   = 303
	HighElfNPC    = 304
	Holgresh      = 305
	Hooluk        = 306
	Huamein       = 307
	HumanNPC      = 308
	Humanoid      = 309
	IksarNPC      = 310
	Kerigdal      = 311
	KerranNPC     = 312
	Kobold        = 313
	LizardMan     = 314
	Minotaur      = 315
	OgreNPC       = 316
	Orc           = 317 // L&L 2
	Othmir        = 318
	RatongaNPC    = 319
	Ravasect      = 320
	Rendadal      = 321
	Roekillik     = 322
	SarnakNPC     = 323
	Skorpikis     = 324
	Spiroc        = 325
	Troglodyte    = 326
	TrollNPC      = 327
	Ulthork       = 328
	Vultak        = 329
	WoodElfNPC    = 330
	WraithGuard   = 331
	Yhalei        = 332

	// UNDEAD category (333-343)
	Undead      = 333
	Ghost       = 334
	Ghoul       = 335
	Gunthak     = 336
	Horror      = 337
	Mummy       = 338
	ShinreeOrcs = 339
	Skeleton    = 340 // L&L 6
	Spectre     = 341
	VampireNPC  = 342
	Zombie      = 343 // L&L 7

	// WERE category (344-347)
	Were              = 344
	AhrounWerewolves  = 345
	LykulakWerewolves = 346
	Werewolf          = 347
)

// Category name constants
const (
	CategoryDragonkind     = "DRAGONKIND"
	CategoryFay            = "FAY"
	CategoryMagical        = "MAGICAL"
	CategoryMechanimagical = "MECHANIMAGICAL"
	CategoryNatural        = "NATURAL"
	CategoryPlanar         = "PLANAR"
	CategoryPlant          = "PLANT"
	CategorySentient       = "SENTIENT"
	CategoryUndead         = "UNDEAD"
	CategoryWere           = "WERE"
)

// GetRaceTypeCategory returns the base category ID for a given race type ID
// Converted from C++ GetRaceTypeCategory function
func GetRaceTypeCategory(raceTypeID int16) int16 {
	switch {
	case raceTypeID >= Dragonkind && raceTypeID <= Wyvern:
		return Dragonkind
	case raceTypeID >= Fay && raceTypeID <= Wisp:
		return Fay
	case raceTypeID >= Magical && raceTypeID <= WoodElemental:
		return Magical
	case raceTypeID >= Mechanimagical && raceTypeID <= IronGuardian:
		return Mechanimagical
	case raceTypeID >= Natural && raceTypeID <= Yeti:
		return Natural
	case raceTypeID >= Planar && raceTypeID <= Wraith:
		return Planar
	case raceTypeID >= Plant && raceTypeID <= Succulent:
		return Plant
	case raceTypeID >= Sentient && raceTypeID <= Yhalei:
		return Sentient
	case raceTypeID >= Undead && raceTypeID <= Zombie:
		return Undead
	case raceTypeID >= Were && raceTypeID <= Werewolf:
		return Were
	default:
		return 0
	}
}

// GetCategoryName returns the category name for a given category ID
func GetCategoryName(categoryID int16) string {
	switch categoryID {
	case Dragonkind:
		return CategoryDragonkind
	case Fay:
		return CategoryFay
	case Magical:
		return CategoryMagical
	case Mechanimagical:
		return CategoryMechanimagical
	case Natural:
		return CategoryNatural
	case Planar:
		return CategoryPlanar
	case Plant:
		return CategoryPlant
	case Sentient:
		return CategorySentient
	case Undead:
		return CategoryUndead
	case Were:
		return CategoryWere
	default:
		return ""
	}
}