The creature bohy has set of parts, which can have one of int states, which are named constants and associated with races. They usually used for basic description.
public static const TYPE_HUMAN:int = 0;
public static const TYPE_EQUINE:int = 1;
public static const TYPE_BOVINE:int = 2;
public static const TYPE_CANINE:int = 3;
public static const TYPE_FELINE:int = 4;
public static const TYPE_VULPINE:int = 5;
Also, some parts have flags. They used for extended specifications, also for some common things between races.
public static const FLAG_LONG:int = 1;
public static const FLAG_PREHENSILE:int = 2;
public static const FLAG_LUBRICATED:int = 3;
public static const FLAG_FLUFFY:int = 4;
public static const FLAG_SQUISHY:int = 5;
public static const FLAG_SMOOTH:int = 6;
So each part can be descripted by one type variable and anyamount of flags. And race detection works like this:
Code:
public function race(): String {
if (foxScore() >= 4) race = faceType == GLOBAL.TYPE_VULPINE ? "fox-morph" : mf("fox-man", "fox-girl");
if (kitsuneScore() >= 5 && (race.indexOf("fox") == -1 || tailCount > 1)) race = "kitsune";
if (kaithritScore() >= 3 && race == "human") race = "half-kaithrit";
if (kaithritScore() >= 6) race = "kaithrit";
if (felineScore() >= 5 && race != "kaithrit") {
if (hasTail(GLOBAL.TYPE_FELINE) && tailCount > 1) race = "nekomata";
else if (dragonScore() >= 4) race = "dragonne";
else if (faceType == GLOBAL.TYPE_FELINE) race = "cat-morph";
else race = rawmfn(mfn("cat-man", "cat-girl", "cat-boy"), "cat-girl", "feline");
}
if (race == "human" && humanScore() < 4) race = "alien hybrid";
return race;
}
Code:
public function kaithritScore(): int {
var counter: int = 0;
if (earType == GLOBAL.TYPE_FELINE) counter++;
if (tailType == GLOBAL.TYPE_FELINE && tailCount == 1) counter++;
if (tailType == GLOBAL.TYPE_FELINE && tailCount == 2) counter += 2;
if (counter > 0 && faceType == GLOBAL.TYPE_HUMAN) counter++;
if (counter > 1 && armType == GLOBAL.TYPE_FELINE && !hasArmFlag(GLOBAL.FLAG_FURRED)) counter++;
if (counter > 2 && legType == GLOBAL.TYPE_HUMAN && legCount == 2 && hasLegFlag(GLOBAL.FLAG_PLANTIGRADE)) counter++;
if (counter > 3 && eyeType == GLOBAL.TYPE_FELINE && faceType == GLOBAL.TYPE_HUMAN) counter += 2;
if (counter > 5 && hasCock(GLOBAL.TYPE_FELINE)) counter++;
if (femininity < 75) counter--;
if (femininity < 50 && !hasBreasts()) counter--;
return counter;
}
public function felineScore(): int {
var counter: int = 0;
if (earType == GLOBAL.TYPE_FELINE) counter++;
if (hasTail(GLOBAL.TYPE_FELINE)) counter++;
if (faceType == GLOBAL.TYPE_FELINE || faceType == GLOBAL.TYPE_NALEEN_FACE) counter++;
if (armType == GLOBAL.TYPE_FELINE && hasArmFlag(GLOBAL.FLAG_FURRED)) counter++;
if (legType == GLOBAL.TYPE_FELINE && hasLegFlag(GLOBAL.FLAG_DIGITIGRADE)) counter++;
if (eyeType == GLOBAL.TYPE_FELINE && faceType == GLOBAL.TYPE_FELINE) counter++;
if (counter > 1 && cockTotal(GLOBAL.TYPE_FELINE) == cockTotal()) counter++;
return counter;
}