use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantingUtils method craftItem.
public static AbstractItem craftItem(AbstractCoreItem ingredient, List<ItemEffect> effects) {
AbstractItem craftedItem = null;
craftedItem = AbstractItemType.generateItem((AbstractItemType) ingredient.getEnchantmentItemType(effects));
List<ItemEffect> effectsToBeAdded = new ArrayList<>();
effectsToBeAdded.addAll(effects);
craftedItem.setItemEffects(effectsToBeAdded);
craftedItem.setName(getPotionName(ingredient, effectsToBeAdded));
craftedItem.setColour(ingredient.getEnchantmentEffect().getColour());
craftedItem.setSVGString(getSVGString(ingredient, effectsToBeAdded));
return craftedItem;
}
use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantmentEventListener method handleEvent.
@Override
public void handleEvent(Event event) {
if (itemToEnchant != null) {
if (itemToEnchant.getEnchantmentEffect() != null) {
EnchantmentDialogue.resetEnchantmentVariables();
EnchantmentDialogue.ingredient = itemToEnchant;
}
} else if (primaryModifier != null) {
EnchantmentDialogue.primaryMod = primaryModifier;
} else if (secondaryModifier != null) {
EnchantmentDialogue.secondaryMod = secondaryModifier;
} else if (potency != null) {
EnchantmentDialogue.potency = potency;
} else if (effect) {
ItemEffect e = EnchantmentDialogue.effects.get(effectIndex);
EnchantmentDialogue.effects.remove(e);
} else if (limit != EnchantmentDialogue.limit) {
EnchantmentDialogue.limit = limit;
}
if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getPrimaryModifiers().contains(EnchantmentDialogue.primaryMod)) {
EnchantmentDialogue.primaryMod = EnchantmentDialogue.ingredient.getEnchantmentEffect().getPrimaryModifiers().get(0);
}
if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getSecondaryModifiers(EnchantmentDialogue.primaryMod).contains(EnchantmentDialogue.secondaryMod)) {
EnchantmentDialogue.secondaryMod = EnchantmentDialogue.ingredient.getEnchantmentEffect().getSecondaryModifiers(EnchantmentDialogue.primaryMod).get(0);
}
if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getPotencyModifiers(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod).contains(EnchantmentDialogue.potency)) {
EnchantmentDialogue.potency = TFPotency.MINOR_BOOST;
}
if (EnchantmentDialogue.limit > EnchantmentDialogue.ingredient.getEnchantmentEffect().getLimits(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod)) {
EnchantmentDialogue.limit = EnchantmentDialogue.ingredient.getEnchantmentEffect().getLimits(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod);
}
Main.game.setContent(new Response("Enchanting", "Start enchanting.", EnchantmentDialogue.ENCHANTMENT_MENU));
}
Aggregations