2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic.api.ritual.imperfect;
|
2015-10-31 17:58:47 -07:00
|
|
|
|
2015-11-02 18:00:48 -08:00
|
|
|
import lombok.EqualsAndHashCode;
|
2015-11-02 17:45:11 -08:00
|
|
|
import lombok.Getter;
|
2015-10-31 17:58:47 -07:00
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-12-29 13:00:26 -08:00
|
|
|
import net.minecraft.util.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
2016-02-25 08:54:18 -05:00
|
|
|
import WayofTime.bloodmagic.api.BlockStack;
|
2015-10-31 17:58:47 -07:00
|
|
|
|
2015-12-29 13:00:26 -08:00
|
|
|
/**
|
2015-12-30 15:34:40 -05:00
|
|
|
* Abstract class for creating new imperfect rituals. ImperfectRituals need be
|
|
|
|
* registered with
|
2015-12-29 13:00:26 -08:00
|
|
|
* {@link WayofTime.bloodmagic.api.registry.ImperfectRitualRegistry#registerRitual(ImperfectRitual)}
|
|
|
|
*/
|
2015-10-31 17:58:47 -07:00
|
|
|
@RequiredArgsConstructor
|
2015-11-02 17:45:11 -08:00
|
|
|
@Getter
|
2015-11-02 18:00:48 -08:00
|
|
|
@EqualsAndHashCode
|
2015-12-30 15:34:40 -05:00
|
|
|
public abstract class ImperfectRitual
|
|
|
|
{
|
2015-10-31 17:58:47 -07:00
|
|
|
|
2015-11-02 17:45:11 -08:00
|
|
|
private final String name;
|
2015-10-31 17:58:47 -07:00
|
|
|
private final BlockStack requiredBlock;
|
|
|
|
private final int activationCost;
|
|
|
|
private final boolean lightshow;
|
2016-01-01 18:54:58 -08:00
|
|
|
private final String unlocalizedName;
|
2015-10-31 17:58:47 -07:00
|
|
|
|
2015-12-29 13:00:26 -08:00
|
|
|
/**
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param name
|
2016-01-02 17:56:37 -05:00
|
|
|
* - The name of the ritual
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param requiredBlock
|
2016-01-02 17:56:37 -05:00
|
|
|
* - The block required above the ImperfectRitualStone
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param activationCost
|
2016-01-02 17:56:37 -05:00
|
|
|
* - Base LP cost for activating the ritual
|
2015-12-29 13:00:26 -08:00
|
|
|
*/
|
2016-01-01 18:54:58 -08:00
|
|
|
public ImperfectRitual(String name, BlockStack requiredBlock, int activationCost, String unlocalizedName)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2016-01-01 18:54:58 -08:00
|
|
|
this(name, requiredBlock, activationCost, false, unlocalizedName);
|
2015-10-31 17:58:47 -07:00
|
|
|
}
|
|
|
|
|
2015-12-29 13:00:26 -08:00
|
|
|
/**
|
|
|
|
* Called when the player activates the ritual
|
|
|
|
* {@link WayofTime.bloodmagic.tile.TileImperfectRitualStone#performRitual(World, BlockPos, ImperfectRitual, EntityPlayer)}
|
2015-12-30 15:34:40 -05:00
|
|
|
*
|
|
|
|
* @param imperfectRitualStone
|
2016-01-02 17:56:37 -05:00
|
|
|
* - The {@link IImperfectRitualStone} that the ritual is bound to
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param player
|
2016-01-02 17:56:37 -05:00
|
|
|
* - The player activating the ritual
|
2015-12-29 13:00:26 -08:00
|
|
|
* @return - Whether activation was successful
|
|
|
|
*/
|
2015-10-31 17:58:47 -07:00
|
|
|
public abstract boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player);
|
2015-11-02 17:45:11 -08:00
|
|
|
|
|
|
|
@Override
|
2015-12-30 15:34:40 -05:00
|
|
|
public String toString()
|
|
|
|
{
|
2015-11-02 17:45:11 -08:00
|
|
|
return getName() + ":" + getRequiredBlock().toString() + "@" + getActivationCost();
|
|
|
|
}
|
2015-10-31 17:58:47 -07:00
|
|
|
}
|