Search in sources :

Example 1 with Binding

use of am2.spell.shapes.Binding in project ArsMagica2 by Mithion.

the class TileEntityCraftingAltar method matchCurrentRecipe.

private boolean matchCurrentRecipe() {
    ISpellPart part = SpellRecipeManager.instance.getPartByRecipe(currentAddedItems);
    if (part == null)
        return false;
    ArrayList<KeyValuePair<ISpellPart, byte[]>> currentShapeGroupList = getShapeGroupToAddTo();
    if (part instanceof Summon)
        handleSummonShape();
    if (part instanceof Binding)
        handleBindingShape();
    byte[] metaData = new byte[0];
    if (part instanceof ISpellModifier) {
        metaData = ((ISpellModifier) part).getModifierMetadata(currentAddedItems.toArray(new ItemStack[currentAddedItems.size()]));
        if (metaData == null) {
            metaData = new byte[0];
        }
    }
    //we're now creating the body of the spell
    if (currentShapeGroupList == null) {
        spellDef.add(new KeyValuePair<ISpellPart, byte[]>(part, metaData));
    } else {
        currentShapeGroupList.add(new KeyValuePair<ISpellPart, byte[]>(part, metaData));
    }
    return true;
}
Also used : Binding(am2.spell.shapes.Binding) KeyValuePair(am2.utility.KeyValuePair) Summon(am2.spell.components.Summon) ISpellModifier(am2.api.spell.component.interfaces.ISpellModifier) ISpellPart(am2.api.spell.component.interfaces.ISpellPart)

Example 2 with Binding

use of am2.spell.shapes.Binding in project ArsMagica2 by Mithion.

the class TileEntityCraftingAltar method AddSpecialMetadata.

private void AddSpecialMetadata(ItemStack craftStack) {
    if (addedPhylactery != null) {
        Summon summon = (Summon) SkillManager.instance.getSkill("Summon");
        summon.setSummonType(craftStack, addedPhylactery);
    }
    if (addedBindingCatalyst != null) {
        Binding binding = (Binding) SkillManager.instance.getSkill("Binding");
        binding.setBindingType(craftStack, addedBindingCatalyst);
    }
}
Also used : Binding(am2.spell.shapes.Binding) Summon(am2.spell.components.Summon)

Aggregations

Summon (am2.spell.components.Summon)2 Binding (am2.spell.shapes.Binding)2 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)1 ISpellPart (am2.api.spell.component.interfaces.ISpellPart)1 KeyValuePair (am2.utility.KeyValuePair)1