Search in sources :

Example 1 with SPELL_GROUP

use of main.content.enums.entity.SpellEnums.SPELL_GROUP in project Eidolons by IDemiurge.

the class SpellRadialManager method constructNestedSpellNodes.

private static List<RadialValueContainer> constructNestedSpellNodes(List<DC_SpellObj> spells, Unit source, DC_Obj target) {
    Set<SPELL_GROUP> spell_groups = new HashSet<>();
    List<SPELL_ASPECT> aspects = new ArrayList<>();
    for (DC_SpellObj spell : spells) {
        SPELL_GROUP group = spell.getSpellGroup();
        spell_groups.add(group);
        for (SPELL_ASPECT g : SPELL_ASPECT.values()) {
            if (!aspects.contains(g)) {
                if (new ArrayList<>(Arrays.asList(g.groups)).contains(spell.getSpellGroup())) {
                    aspects.add(g);
                }
            }
        }
    }
    return spell_groups.size() > 8 ? aspects.stream().map(el -> createNodeBranch(new RadialSpellAspect(el), source, target)).collect(Collectors.toList()) : spell_groups.stream().map(el -> createNodeBranch(new RadialSpellGroup(el), source, target)).collect(Collectors.toList());
}
Also used : SPELL_GROUP(main.content.enums.entity.SpellEnums.SPELL_GROUP) DC_SpellObj(eidolons.entity.active.DC_SpellObj)

Example 2 with SPELL_GROUP

use of main.content.enums.entity.SpellEnums.SPELL_GROUP in project Eidolons by IDemiurge.

the class DivinationMaster method initSpellPool.

private static void initSpellPool() {
    spellPool = new ArrayList<>();
    // add up all weights, roll, preCheck within which range. Should be fair,
    // right?
    SPELL_GROUP chosenGroup = new RandomWizard<SPELL_GROUP>().getObjectByWeight(spellGroups);
    List<ObjType> types = DataManager.toTypeList(DataManager.getTypesSubGroupNames(DC_TYPE.SPELLS, StringMaster.getWellFormattedString(chosenGroup.name())), DC_TYPE.SPELLS);
    FilterMaster.filterOut(types, sdCondition);
    Collections.sort(types, getComparator());
    spellPool.addAll(types);
}
Also used : SPELL_GROUP(main.content.enums.entity.SpellEnums.SPELL_GROUP) ObjType(main.entity.type.ObjType)

Example 3 with SPELL_GROUP

use of main.content.enums.entity.SpellEnums.SPELL_GROUP in project Eidolons by IDemiurge.

the class RadialSpellAspect method getItems.

@Override
public List<RADIAL_ITEM> getItems(Unit source) {
    ArrayList<RADIAL_ITEM> list = new ArrayList<>();
    List<DC_SpellObj> spells = new ArrayList<>(source.getSpells());
    if (spells.size() < maxPlainSize) {
        spells.forEach(spell -> list.add(new EntityNode(spell)));
        return list;
    }
    spells.removeIf(spell -> !spell.getAspect().toString().equalsIgnoreCase(aspect.toString()));
    for (SPELL_GROUP g : aspect.groups) {
        List<DC_SpellObj> group = new ArrayList<>(spells);
        group.removeIf(spell -> !spell.getSpellGroup().equals(g));
        if (group.size() > 0) {
            list.add(new RadialSpellGroup(g));
        }
    }
    return list;
}
Also used : SPELL_GROUP(main.content.enums.entity.SpellEnums.SPELL_GROUP) ArrayList(java.util.ArrayList) DC_SpellObj(eidolons.entity.active.DC_SpellObj)

Aggregations

SPELL_GROUP (main.content.enums.entity.SpellEnums.SPELL_GROUP)3 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 ArrayList (java.util.ArrayList)1 ObjType (main.entity.type.ObjType)1