use of WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage in project BloodMagic by WayofTime.
the class RitualEffectAlphaPact method performEffect.
@Override
public void performEffect(IMasterRitualStone ritualStone) {
String owner = ritualStone.getOwner();
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
if (world.getWorldTime() % 20 != 0) {
return;
}
LocalRitualStorage stor = ritualStone.getLocalStorage();
if (stor instanceof LocalStorageAlphaPact) {
LocalStorageAlphaPact storage = (LocalStorageAlphaPact) stor;
Object[] demonList = storage.hoardList.toArray();
for (Object demon : demonList) {
if (demon instanceof EntityLivingBase) {
if (!((EntityLivingBase) demon).isEntityAlive()) {
System.out.println(storage.hoardList.remove(demon));
}
}
}
System.out.println("Hi!");
int summons = 0;
int horizontalRange = 25;
int verticalRange = 20;
if (storage.hoardList.isEmpty()) {
IHoardDemon demon = this.getRandomDemonForStage(world, x, y, z, horizontalRange, verticalRange);
if (demon instanceof EntityLivingBase) {
world.spawnEntityInWorld((EntityLivingBase) demon);
storage.thrallDemon(demon);
}
} else {
}
}
}
use of WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage in project BloodMagic by WayofTime.
the class TEMasterStone method readFromNBT.
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
isActive = tag.getBoolean("isActive");
owner = tag.getString("owner");
cooldown = tag.getInteger("cooldown");
var1 = tag.getInteger("var1");
direction = tag.getInteger("direction");
currentRitualString = tag.getString("currentRitualString");
isRunning = tag.getBoolean("isRunning");
runningTime = tag.getInteger("runningTime");
NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND);
int size = tagList.tagCount();
this.tanks = new ReagentContainer[size];
for (int i = 0; i < size; i++) {
NBTTagCompound savedTag = tagList.getCompoundTagAt(i);
this.tanks[i] = ReagentContainer.readFromNBT(savedTag);
}
NBTTagList attunedTagList = tag.getTagList("attunedTankMap", Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < attunedTagList.tagCount(); i++) {
NBTTagCompound savedTag = attunedTagList.getCompoundTagAt(i);
Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent"));
this.attunedTankMap.put(reagent, savedTag.getInteger("amount"));
}
customRitualTag = tag.getCompoundTag("customRitualTag");
LocalRitualStorage newStorage = Rituals.getLocalStorage(currentRitualString);
NBTTagCompound localStorageTag = tag.getCompoundTag("localStorage");
if (newStorage != null) {
newStorage.readFromNBT(localStorageTag);
storage = newStorage;
storage.xCoord = xCoord;
storage.yCoord = yCoord;
storage.zCoord = zCoord;
}
}
use of WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage in project BloodMagic by WayofTime.
the class EntityMinorDemonGrunt method onUpdate.
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate() {
if (!this.enthralled) {
TileEntity tile = this.worldObj.getTileEntity(this.demonPortal.xCoord, this.demonPortal.yCoord, this.demonPortal.zCoord);
if (tile instanceof TEDemonPortal) {
((TEDemonPortal) tile).enthrallDemon(this);
this.enthralled = true;
} else if (tile instanceof IMasterRitualStone) {
IMasterRitualStone stone = (IMasterRitualStone) tile;
LocalRitualStorage stor = stone.getLocalStorage();
if (stor instanceof LocalStorageAlphaPact) {
LocalStorageAlphaPact storage = (LocalStorageAlphaPact) stor;
storage.thrallDemon(this);
}
}
}
super.onUpdate();
}
Aggregations