Search in sources :

Example 1 with BACKGROUND

use of main.content.enums.entity.HeroEnums.BACKGROUND in project Eidolons by IDemiurge.

the class ContentGenerator method initHeight.

// public static void generateBfObjParams(ObjType t) {
// BF_OBJECT_TYPE type = new EnumMaster<BF_OBJECT_TYPE>().retrieveEnumConst(
// BF_OBJECT_TYPE.class, t.getProperty(G_PROPS.BF_OBJECT_TYPE));
// BF_OBJECT_GROUP group = new
// EnumMaster<BF_OBJECT_GROUP>().retrieveEnumConst(
// BF_OBJECT_GROUP.class, t.getProperty(G_PROPS.BF_OBJECT_GROUP));
// BF_OBJECT_SIZE size = new EnumMaster<BF_OBJECT_SIZE>().retrieveEnumConst(
// BF_OBJECT_SIZE.class, t.getProperty(PROPS.BF_OBJECT_SIZE));
// BF_OBJ_MATERIAL material = new
// EnumMaster<BF_OBJ_MATERIAL>().retrieveEnumConst(
// BF_OBJ_MATERIAL.class, t.getProperty(PROPS.BF_OBJ_MATERIAL));
// OBJECT_ARMOR_TYPE armorType = new
// EnumMaster<OBJECT_ARMOR_TYPE>().retrieveEnumConst(
// OBJECT_ARMOR_TYPE.class, t.getProperty(PROPS.OBJECT_ARMOR_TYPE));
// 
// if (armorType == null) {
// switch (type) {
// 
// }
// }
// 
// // TODO
// 
// // stone/wood/metal/ ...
// int i = 0;
// List<String> list = getParamsFor(armorType);
// for (PARAMS portrait : params) {
// t.setParam(portrait, list.getOrCreate(i));
// i++;
// }
// list = getResistancesForArmorType(armorType);
// for (PARAMETER portrait : ValuePages.RESISTANCES) {
// t.setParam(portrait, list.getOrCreate(i));
// i++;
// }
// 
// }
// TODO use mods from size? or multiply later...
// private static String getParams(OBJECT_ARMOR_TYPE armorType, PARAMS portrait) {
// switch (armorType) {
// case AETHER:
// return getAETHERParam(portrait);
// case BONE:
// return getBONEParam(portrait);
// case CRYSTAL:
// return getCRYSTALParam(portrait);
// case ETHEREAL:
// return getETHEREALParam(portrait);
// case FLESH:
// return getFLESHParam(portrait);
// case METAL:
// return getMETALParam(portrait);
// case STONE:
// return getSTONEParam(portrait);
// case WOOD:
// return getWOODParam(portrait);
// 
// }
// 
// return null;
// }
// 
// private static List<String> getResistancesForArmorType(OBJECT_ARMOR_TYPE
// armorType) {
// List<String> list = new ArrayList<>();
// for (PARAMETER portrait : ValuePages.RESISTANCES) {
// switch ((PARAMS) portrait) {
// case PIERCING_RESISTANCE:
// list.add(getPIERCING_RESISTANCE(armorType));
// list.add(getOrCreate(armorType));
// break;
// case BLUDGEONING_RESISTANCE:
// list.add(getBLUDGEONING_RESISTANCE(armorType));
// break;
// case SLASHING_RESISTANCE:
// list.add(getSLASHING_RESISTANCE(armorType));
// break;
// case POISON_RESISTANCE:
// list.add(getPOISON_RESISTANCE(armorType));
// break;
// case FIRE_RESISTANCE:
// list.add(getFIRE_RESISTANCE(armorType));
// break;
// case COLD_RESISTANCE:
// list.add(getCOLD_RESISTANCE(armorType));
// break;
// case ACID_RESISTANCE:
// list.add(getACID_RESISTANCE(armorType));
// break;
// case LIGHTNING_RESISTANCE:
// list.add(getLIGHTNING_RESISTANCE(armorType));
// break;
// case SONIC_RESISTANCE:
// list.add(getSONIC_RESISTANCE(armorType));
// break;
// case LIGHT_RESISTANCE:
// list.add(getLIGHT_RESISTANCE(armorType));
// break;
// case CHAOS_RESISTANCE:
// list.add(getCHAOS_RESISTANCE(armorType));
// break;
// case ARCANE_RESISTANCE:
// list.add(getARCANE_RESISTANCE(armorType));
// break;
// case HOLY_RESISTANCE:
// list.add(getHOLY_RESISTANCE(armorType));
// break;
// case SHADOW_RESISTANCE:
// list.add(getSHADOW_RESISTANCE(armorType));
// break;
// case PSIONIC_RESISTANCE:
// list.add(getPSIONIC_RESISTANCE(armorType));
// break;
// case DEATH_RESISTANCE:
// list.add(getDEATH_RESISTANCE(armorType));
// break;
// }
// }
// 
// return list;
// }
// 
// private static List<String> getParamsFor(OBJECT_ARMOR_TYPE armorType) {
// List<String> list = new ArrayList<>();
// for (PARAMS portrait : params) {
// list.add(getParams(armorType, portrait));
// }
// 
// return list;
// }
public static void initHeight(ObjType t) {
    DC_TYPE TYPE = (DC_TYPE) t.getOBJ_TYPE_ENUM();
    if (t.getIntParam(PARAMS.HEIGHT) != 0) {
        return;
    }
    int height = 0;
    switch(TYPE) {
        case BF_OBJ:
            BF_OBJECT_TYPE type = new EnumMaster<BF_OBJECT_TYPE>().retrieveEnumConst(BF_OBJECT_TYPE.class, t.getProperty(G_PROPS.BF_OBJECT_TYPE));
            BF_OBJECT_GROUP group = new EnumMaster<BF_OBJECT_GROUP>().retrieveEnumConst(BF_OBJECT_GROUP.class, t.getProperty(G_PROPS.BF_OBJECT_GROUP));
            if (type != null) {
                switch(type) {
                }
            }
            if (group != null) {
                switch(group) {
                    case ROCKS:
                        height = 100;
                        break;
                    case TREES:
                        height = 1000;
                        break;
                    default:
                        break;
                }
            }
            break;
        case UNITS:
            List<CLASSIFICATIONS> c = new EnumMaster<CLASSIFICATIONS>().getEnumList(CLASSIFICATIONS.class, t.getProperty(G_PROPS.CLASSIFICATIONS));
            if (c.contains(UnitEnums.CLASSIFICATIONS.GIANT)) {
                height = 600;
            } else if (c.contains(UnitEnums.CLASSIFICATIONS.HUMANOID)) {
                height = 180;
            } else if (c.contains(UnitEnums.CLASSIFICATIONS.TALL)) {
                height = 225;
            } else if (c.contains(UnitEnums.CLASSIFICATIONS.SHORT)) {
                height = 125;
            }
        case CHARS:
            RACE race = new EnumMaster<RACE>().retrieveEnumConst(RACE.class, t.getProperty(G_PROPS.RACE));
            BACKGROUND bg = new EnumMaster<BACKGROUND>().retrieveEnumConst(BACKGROUND.class, t.getProperty(G_PROPS.BACKGROUND));
            GENDER g = new EnumMaster<GENDER>().retrieveEnumConst(GENDER.class, t.getProperty(G_PROPS.GENDER));
            if (race != null) {
                switch(race) {
                    case DEMON:
                        height = 200;
                        break;
                    case DWARF:
                        height = 130;
                        break;
                    case ELF:
                        height = 190;
                        break;
                    case GOBLINOID:
                        height = 160;
                        break;
                    case HUMAN:
                        height = 180;
                        if (bg == HeroEnums.BACKGROUND.MAN_OF_WOLF_REALM) {
                            height += 10;
                        }
                        if (bg == HeroEnums.BACKGROUND.MAN_OF_EAGLE_REALM) {
                            height += 15;
                        }
                        break;
                    case VAMPIRE:
                        height = 180;
                        break;
                    default:
                        break;
                }
            }
            if (g == HeroEnums.GENDER.FEMALE) {
                height -= height / 5;
            }
            break;
    }
    t.setParam(PARAMS.HEIGHT, height);
// per race?
// per obj type
}
Also used : DC_TYPE(main.content.DC_TYPE) BF_OBJECT_GROUP(main.content.enums.entity.BfObjEnums.BF_OBJECT_GROUP) BACKGROUND(main.content.enums.entity.HeroEnums.BACKGROUND) RACE(main.content.enums.entity.HeroEnums.RACE) GENDER(main.content.enums.entity.HeroEnums.GENDER) BF_OBJECT_TYPE(main.content.enums.entity.BfObjEnums.BF_OBJECT_TYPE) CLASSIFICATIONS(main.content.enums.entity.UnitEnums.CLASSIFICATIONS)

Example 2 with BACKGROUND

use of main.content.enums.entity.HeroEnums.BACKGROUND in project Eidolons by IDemiurge.

the class PortraitChoiceView method applyChoice.

@Override
protected void applyChoice() {
    CharacterCreator.getHeroManager().saveHero(hero);
    String portrait = data.get(getSelectedIndex());
    hero.setProperty(G_PROPS.IMAGE, portrait, true);
    boolean female = StringMaster.isFemalePortrait(portrait);
    if (female) {
        BACKGROUND bg = hero.getBackground().getFemale();
        hero.setProperty(G_PROPS.GENDER, HeroEnums.GENDER.FEMALE.toString(), true);
        hero.setProperty(G_PROPS.BACKGROUND, bg.toString(), true);
        // int i = 0;
        // if (bg.getRace() != RACE.HUMAN || bg == BACKGROUND.STRANGER)
        // i = 1;
        // SOUNDSET soundset = bg.getSoundsets()[i]; TODO
        hero.setProperty(G_PROPS.SOUNDSET, SOUNDSET.FEMALE.toString(), true);
    } else {
        BACKGROUND bg = hero.getBackground().getMale();
        hero.setProperty(G_PROPS.GENDER, HeroEnums.GENDER.MALE.toString(), true);
        hero.setProperty(G_PROPS.BACKGROUND, bg.toString(), true);
    }
}
Also used : BACKGROUND(main.content.enums.entity.HeroEnums.BACKGROUND)

Example 3 with BACKGROUND

use of main.content.enums.entity.HeroEnums.BACKGROUND in project Eidolons by IDemiurge.

the class NameMaster method generateName.

public static String generateName(Entity hero) {
    RACE race = EntityCheckMaster.getRace(hero);
    BACKGROUND bg = EntityCheckMaster.getBackground(hero);
    switch(race) {
        case HUMAN:
            if (bg.toString().contains("Raven")) {
                return generateName(hero, ravenNameGroups);
            }
            if (bg.toString().contains("Griff")) {
                return generateName(hero, griffNameGroups);
            }
            if (bg.toString().contains("Eagle")) {
                return generateName(hero, eagleNameGroups);
            }
            // return generateName(hero, easterlingNameGroups);
            if (bg.toString().contains("King")) {
                return generateName(hero, kingNameGroups);
            }
            if (bg.toString().contains("Wolf")) {
                return generateName(hero, wolfNameGroups);
            }
            if (bg.toString().contains("Ulduin")) {
                return generateName(hero, ravenNameGroups);
            }
            return generateName(hero, DEFAULT_NAME_GROUP);
        // TODO
        case DEMON:
            return generateName(hero, "Demon");
        case DWARF:
            return generateName(hero, "Dwarven");
        case ELF:
            return generateName(hero, "Elven");
        case GOBLINOID:
            return generateName(hero, "Dwarven");
        case VAMPIRE:
            return generateName(hero, ravenNameGroups);
    }
    return null;
}
Also used : RACE(main.content.enums.entity.HeroEnums.RACE) BACKGROUND(main.content.enums.entity.HeroEnums.BACKGROUND)

Example 4 with BACKGROUND

use of main.content.enums.entity.HeroEnums.BACKGROUND in project Eidolons by IDemiurge.

the class ImageManager method getPortraitsForBackground.

public static List<String> getPortraitsForBackground(String property, Boolean extended) {
    BACKGROUND bg = new EnumMaster<BACKGROUND>().retrieveEnumConst(BACKGROUND.class, property);
    List<String> list = getPortraitMap(extended).get(bg);
    if (list != null) {
        return list;
    }
    list = new ArrayList<>();
    File folder;
    List<String> paths = new ArrayList<>();
    switch(bg) {
        case DARK_ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\dark");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\drow");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "elf\\grey");
            break;
        case FEY_ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\fey");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "elf\\wood");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\ice");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\grey");
            break;
        case GREY_ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\grey");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "elf\\ice");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\fey");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\dark");
            break;
        case HIGH_ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\high");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\ice");
            break;
        case WOOD_ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\wood");
            // paths.add(PORTRAIT_ROOT_PATH + "elf\\grey");
            paths.add(PORTRAIT_ROOT_PATH + "elf\\fey");
            break;
        case ELF:
            paths.add(PORTRAIT_ROOT_PATH + "elf\\");
            break;
        case VAMPIRE:
            paths.add(PORTRAIT_ROOT_PATH + "vampire\\");
            break;
        case INFERI_WARPBORN:
            paths.add(PORTRAIT_ROOT_PATH + "demon\\succubus");
            break;
        case INFERI_HELLSPAWN:
            paths.add(PORTRAIT_ROOT_PATH + "demon\\SPAWN");
            break;
        case INFERI_CHAOSBORN:
            paths.add(PORTRAIT_ROOT_PATH + "demon\\guard");
            break;
        case NORDHEIMER:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Nordheim");
            break;
        case EASTERLING:
            paths.add(PORTRAIT_ROOT_PATH + "human\\East");
            break;
        case WOMAN_OF_EAGLE_REALM:
        case MAN_OF_EAGLE_REALM:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Eagle Realm");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\4arcane");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\1misc");
            break;
        case WOMAN_OF_GRIFF_REALM:
        case MAN_OF_GRIFF_REALM:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Griff Realm");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\3warrior");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\1misc");
            break;
        case WOMAN_OF_KINGS_REALM:
        case MAN_OF_KINGS_REALM:
            paths.add(PORTRAIT_ROOT_PATH + "human\\King Realm");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\1misc");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\3warrior");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\4arcane");
            break;
        case WOMAN_OF_RAVEN_REALM:
        case MAN_OF_RAVEN_REALM:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Raven Realm");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\4arcane");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\6dark");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\2rogue");
            break;
        case WOMAN_OF_WOLF_REALM:
        case MAN_OF_WOLF_REALM:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Wolf Realm");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\6dark");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\2rogue");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic\\3warrior");
            break;
        case STRANGER:
            paths.add(PORTRAIT_ROOT_PATH + "human\\Generic");
            if (!extended) {
                break;
            }
            paths.add(PORTRAIT_ROOT_PATH + "human\\King Realm");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Griff Realm");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Eagle Realm");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Raven Realm");
            paths.add(PORTRAIT_ROOT_PATH + "human\\Wolf Realm");
            break;
        case DWARF:
        case WILDAXE_DWARF:
        case STONESHIELD_DWARF:
        case IRONHELM_DWARF:
        case GRIMBART_DWARF:
        case REDBLAZE_DWARF:
        case FROSTBEARD_DWARF:
        case MOONSILVER_DWARF:
            paths.add(PORTRAIT_ROOT_PATH + "dwarf\\");
            break;
        case RED_ORC:
            paths.add(PORTRAIT_ROOT_PATH + "orc\\red");
            paths.add(PORTRAIT_ROOT_PATH + "orc\\orc");
            break;
        case BLACK_ORC:
            paths.add(PORTRAIT_ROOT_PATH + "orc\\black");
            paths.add(PORTRAIT_ROOT_PATH + "orc\\orc");
            break;
        case PALE_ORC:
            paths.add(PORTRAIT_ROOT_PATH + "orc\\pale");
            paths.add(PORTRAIT_ROOT_PATH + "orc\\orc");
            break;
        case GREEN_ORC:
            paths.add(PORTRAIT_ROOT_PATH + "orc\\green");
            paths.add(PORTRAIT_ROOT_PATH + "orc\\orc");
            break;
        default:
            break;
    }
    for (String path : paths) {
        folder = new File(getImageFolderPath() + path);
        path += "\\";
        for (String file : FileManager.listFiles(folder)) {
            if (new File(getImageFolderPath() + path + file).isFile()) {
                if (!ListMaster.contains(list, file, false)) {
                    list.add(path + file);
                }
            } else if (new File(getImageFolderPath() + path + file).isDirectory()) {
                for (String subfile : new File(getImageFolderPath() + path + file).list()) {
                    if (!ListMaster.contains(list, subfile, false)) {
                        list.add(path + file + "\\" + subfile);
                    } else {
                        continue;
                    }
                }
            }
        }
    }
    getPortraitMap(extended).put(bg, list);
    return list;
}
Also used : ArrayList(java.util.ArrayList) BACKGROUND(main.content.enums.entity.HeroEnums.BACKGROUND) File(java.io.File)

Aggregations

BACKGROUND (main.content.enums.entity.HeroEnums.BACKGROUND)4 RACE (main.content.enums.entity.HeroEnums.RACE)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 DC_TYPE (main.content.DC_TYPE)1 BF_OBJECT_GROUP (main.content.enums.entity.BfObjEnums.BF_OBJECT_GROUP)1 BF_OBJECT_TYPE (main.content.enums.entity.BfObjEnums.BF_OBJECT_TYPE)1 GENDER (main.content.enums.entity.HeroEnums.GENDER)1 CLASSIFICATIONS (main.content.enums.entity.UnitEnums.CLASSIFICATIONS)1