Added demon chests, started working on loot system, improved demon AI
This commit is contained in:
parent
98e7d6ede7
commit
37d0fc69f1
16 changed files with 376 additions and 74 deletions
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class DemonHoardPacket
|
||||
|
@ -9,7 +10,7 @@ public abstract class DemonHoardPacket
|
|||
|
||||
}
|
||||
|
||||
public abstract int summonDemons(World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian);
|
||||
public abstract int summonDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian);
|
||||
|
||||
public abstract boolean canFitType(DemonType type);
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
|
||||
public class DemonPacketAngel extends DemonHoardPacket
|
||||
{
|
||||
|
@ -19,12 +20,15 @@ public class DemonPacketAngel extends DemonHoardPacket
|
|||
}
|
||||
|
||||
@Override
|
||||
public int summonDemons(World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian)
|
||||
public int summonDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian)
|
||||
{
|
||||
Entity entity = new EntityFallenAngel(world);
|
||||
EntityLivingBase entity = new EntityMinorDemonGrunt(world);
|
||||
entity.setPosition(x, y, z);
|
||||
|
||||
world.spawnEntityInWorld(entity);
|
||||
|
||||
teDemonPortal.enthrallDemon(entity);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DemonPacketRegistry
|
||||
|
@ -61,18 +62,18 @@ public class DemonPacketRegistry
|
|||
return "";
|
||||
}
|
||||
|
||||
public static int spawnDemons(World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian)
|
||||
public static int spawnDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian)
|
||||
{
|
||||
return spawnDemons(world, x, y, z, getDemonPacketName(type, tier, spawnGuardian), type, tier, spawnGuardian);
|
||||
return spawnDemons(teDemonPortal, world, x, y, z, getDemonPacketName(type, tier, spawnGuardian), type, tier, spawnGuardian);
|
||||
}
|
||||
|
||||
public static int spawnDemons(World world, int x, int y, int z, String name, DemonType type, int tier, boolean spawnGuardian)
|
||||
public static int spawnDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, String name, DemonType type, int tier, boolean spawnGuardian)
|
||||
{
|
||||
DemonHoardPacket packet = packetMap.get(name);
|
||||
|
||||
if(packet != null)
|
||||
{
|
||||
return packet.summonDemons(world, x, y, z, type, tier, spawnGuardian);
|
||||
return packet.summonDemons(teDemonPortal, world, x, y, z, type, tier, spawnGuardian);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.entity.EntityLivingBase;
|
|||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
|
@ -21,13 +20,16 @@ import net.minecraft.item.ItemFood;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.ai.EntityAIOccasionalRangedAttack;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.ai.EntityDemonAIHurtByTarget;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.ai.IOccasionalRangedAttackMob;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
@ -37,11 +39,13 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
private EntityAIOccasionalRangedAttack aiArrowAttack = new EntityAIOccasionalRangedAttack(this, 1.0D, 40, 40, 15.0F, 5);
|
||||
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
|
||||
|
||||
private boolean isAngry = false;
|
||||
private boolean isAngry = true;
|
||||
private Int3 demonPortal;
|
||||
|
||||
private static float maxTamedHealth = 50.0F;
|
||||
private static float maxUntamedHealth = 50.0F;
|
||||
private static float maxTamedHealth = 200.0F;
|
||||
private static float maxUntamedHealth = 200.0F;
|
||||
|
||||
private boolean enthralled = false;
|
||||
|
||||
public EntityMinorDemonGrunt(World par1World)
|
||||
{
|
||||
|
@ -56,7 +60,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(3, new EntityDemonAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
this.setTamed(false);
|
||||
|
@ -215,6 +219,15 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
@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;
|
||||
}
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
@ -437,4 +450,11 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean thrallDemon(TEDemonPortal teDemonPortal)
|
||||
{
|
||||
this.setPortalLocation(new Int3(teDemonPortal.xCoord, teDemonPortal.yCoord, teDemonPortal.zCoord));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
|
||||
public interface IHoardDemon
|
||||
{
|
||||
public void setPortalLocation(Int3 position);
|
||||
public Int3 getPortalLocation();
|
||||
public boolean thrallDemon(TEDemonPortal teDemonPortal);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue