This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
2020-03-01 18:19:59 +00:00
|
|
|
package com.thebrokenrail.sorcerycraft.spell;
|
|
|
|
|
2020-03-06 23:35:29 +00:00
|
|
|
import com.thebrokenrail.sorcerycraft.spell.registry.Spell;
|
2020-03-01 18:19:59 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.item.Items;
|
2020-03-03 23:08:22 +00:00
|
|
|
import net.minecraft.util.Identifier;
|
2020-03-01 18:19:59 +00:00
|
|
|
|
|
|
|
public class FlameSpell extends Spell {
|
2020-03-03 23:08:22 +00:00
|
|
|
public FlameSpell(Identifier id, int level) {
|
2020-03-01 18:19:59 +00:00
|
|
|
super(id, level);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(Entity target, Entity source, Entity attacker) {
|
|
|
|
target.setFireTicks(400 + (getLevel() * 200));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getXPCost() {
|
|
|
|
switch (getLevel()) {
|
|
|
|
case 0: {
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
case 1: {
|
|
|
|
return 16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack getItemCost() {
|
|
|
|
switch (getLevel()) {
|
|
|
|
case 0: {
|
|
|
|
return new ItemStack(Items.FLINT_AND_STEEL);
|
|
|
|
}
|
|
|
|
case 1: {
|
|
|
|
return new ItemStack(Items.FIRE_CHARGE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ItemStack.EMPTY;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMaxLevel() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
}
|