diff --git a/.gradle/8.2.1/checksums/checksums.lock b/.gradle/8.2.1/checksums/checksums.lock index dd89e66..7962491 100644 Binary files a/.gradle/8.2.1/checksums/checksums.lock and b/.gradle/8.2.1/checksums/checksums.lock differ diff --git a/.gradle/8.2.1/checksums/sha1-checksums.bin b/.gradle/8.2.1/checksums/sha1-checksums.bin index 6eed126..fd46a0c 100644 Binary files a/.gradle/8.2.1/checksums/sha1-checksums.bin and b/.gradle/8.2.1/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.2.1/executionHistory/executionHistory.bin b/.gradle/8.2.1/executionHistory/executionHistory.bin index dda17fd..c64e8f0 100644 Binary files a/.gradle/8.2.1/executionHistory/executionHistory.bin and b/.gradle/8.2.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.2.1/executionHistory/executionHistory.lock b/.gradle/8.2.1/executionHistory/executionHistory.lock index c99ec8d..15044b2 100644 Binary files a/.gradle/8.2.1/executionHistory/executionHistory.lock and b/.gradle/8.2.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.2.1/fileHashes/fileHashes.bin b/.gradle/8.2.1/fileHashes/fileHashes.bin index 8f0d114..21e1603 100644 Binary files a/.gradle/8.2.1/fileHashes/fileHashes.bin and b/.gradle/8.2.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.2.1/fileHashes/fileHashes.lock b/.gradle/8.2.1/fileHashes/fileHashes.lock index 67152fb..61dd1f0 100644 Binary files a/.gradle/8.2.1/fileHashes/fileHashes.lock and b/.gradle/8.2.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.2.1/fileHashes/resourceHashesCache.bin b/.gradle/8.2.1/fileHashes/resourceHashesCache.bin index 02ddb46..de81cb5 100644 Binary files a/.gradle/8.2.1/fileHashes/resourceHashesCache.bin and b/.gradle/8.2.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 9ad3c96..d6b7143 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index ef55d27..53c24ac 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java index fe78d07..412c90b 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java @@ -1,49 +1,102 @@ package com.zivilon.cinder_loe.entity; import com.zivilon.cinder_loe.CinderLoE; -import lotr.common.LOTRCapes; -import lotr.common.LOTRMod; -import lotr.common.LOTRShields; -import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; -import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import lotr.common.*; +import lotr.common.entity.ai.*; import lotr.common.entity.animal.LOTREntityHorse; -import lotr.common.entity.npc.LOTREntityGondorSoldier; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.entity.npc.LOTRNPCMount; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAIBase; +import lotr.common.entity.npc.*; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import lotr.common.world.structure.LOTRChestContents; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -public class BreeOutrider extends BreeSoldier { +public class BreeOutrider extends LOTREntityBreeGuard { private EntityAIBase rangedAttackAI = this.createBreeRangedAttackAI(); private EntityAIBase meleeAttackAI = this.addBreeAttackAI(); - + private static ItemStack[] guardWeapons = new ItemStack[]{new ItemStack(CinderLoE.swordBree), new ItemStack(CinderLoE.swordBree), new ItemStack(LOTRMod.pikeIron)}; public BreeOutrider(World world) { super(world); + this.setSize(0.6f, 1.8f); + this.getNavigator().setAvoidsWater(true); + this.getNavigator().setBreakDoors(true); + ((EntityLiving)this).tasks.addTask(0, new EntityAISwimming((EntityLiving)this)); + ((EntityLiving)this).tasks.addTask(1, new LOTREntityAIHiredRemainStill(this)); + ((EntityLiving)this).tasks.addTask(2, this.addBreeAttackAI()); + ((EntityLiving)this).tasks.addTask(2, this.createBreeRangedAttackAI()); + ((EntityLiving)this).tasks.addTask(3, new LOTREntityAIFollowHiringPlayer(this)); + ((EntityLiving)this).tasks.addTask(4, new EntityAIOpenDoor((EntityLiving)this, true)); + ((EntityLiving)this).tasks.addTask(5, new EntityAIWander((EntityCreature)this, 1.0)); + ((EntityLiving)this).tasks.addTask(6, new LOTREntityAIEat(this, LOTRFoods.BREE, 8000)); + ((EntityLiving)this).tasks.addTask(6, new LOTREntityAIDrink(this, LOTRFoods.BREE_DRINK, 6000)); + ((EntityLiving)this).tasks.addTask(6, new LOTREntityAIHobbitSmoke(this, 12000)); + ((EntityLiving)this).tasks.addTask(7, new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 10.0f, 0.02f)); + ((EntityLiving)this).tasks.addTask(7, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 5.0f, 0.02f)); + ((EntityLiving)this).tasks.addTask(8, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityLiving.class, 8.0f, 0.02f)); + ((EntityLiving)this).tasks.addTask(9, (EntityAIBase)new EntityAILookIdle((EntityLiving)this)); this.addTargetTasks(true); - this.npcCape = LOTRCapes.RANGER; - this.spawnRidingHorse = true; - this.npcShield = LOTRShields.ALIGNMENT_BREE; } + protected EntityAIBase createBreeRangedAttackAI() { + return new LOTREntityAIRangedAttack(this, 1.25, 30, 40, 16.0f); + } + protected EntityAIBase addBreeAttackAI() { + return new LOTREntityAIAttackOnCollide(this, 1.5, true); + + } + @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - this.getEntityAttribute(LOTREntityNPC.npcRangedAccuracy).setBaseValue(0.5); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2); + } + @Override + public LOTRFaction getFaction() { + return LOTRFaction.BREE; } - protected EntityAIBase createBreeRangedAttackAI() { - return new LOTREntityAIRangedAttack(this, 1.25, 30, 40, 16.0f); + @Override + public void setupNPCGender() { + this.familyInfo.setMale((this).rand.nextBoolean()); + } + + @Override + public void setupNPCName() { + this.familyInfo.setName(LOTRNames.getBreeName((this).rand, this.familyInfo.isMale())); + } + @Override + public String getNPCName() { + return this.familyInfo.getName(); + } + @Override + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + int bones = (this).rand.nextInt(2) + (this).rand.nextInt(i + 1); + for (int l = 0; l < bones; ++l) { + this.dropItem(Items.bone, 1); + } + this.dropBreeItems(flag, i); + dropNPCCrossbowBolts(i); + } + @Override + protected LOTRAchievement getKillAchievement() { + return LOTRAchievement.killBreelander; } - protected EntityAIBase addBreeAttackAI() { - return new LOTREntityAIAttackOnCollide(this, 1.45D, true); + protected void dropBreeItems(boolean flag, int i) { + if ((this).rand.nextInt(6) == 0) { + this.dropChestContents(LOTRChestContents.BREE_HOUSE, 1, 2 + i); + } } + + @Override protected void entityInit() { super.entityInit(); @@ -54,8 +107,13 @@ public class BreeOutrider extends BreeSoldier { @Override public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { data = super.onSpawnWithEgg(data); + int i = (rand.nextInt(guardWeapons.length)); + this.npcItemsInv.setMeleeWeapon(guardWeapons[i].copy()); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsBree)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsBree)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyBree)); setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetBreeKettle)); - this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.swordBree)); this.npcItemsInv.setRangedWeapon(new ItemStack(LOTRMod.ironCrossbow)); this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); return data; @@ -96,12 +154,30 @@ public class BreeOutrider extends BreeSoldier { public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { npcCrossbowAttack(target, f); } - protected void dropFewItems(boolean flag, int i) { - super.dropFewItems(flag, i); - dropNPCCrossbowBolts(i); - } @Override public float getAlignmentBonus() { return 3.0f; } + + @Override + public String getSpeechBank(EntityPlayer entityplayer) { + if (this.isFriendlyAndAligned(entityplayer)) { + if (this.hiredNPCInfo.getHiringPlayer() == entityplayer) { + return "bree/guard/hired"; + } + return "bree/guard/friendly"; + } + return "bree/guard/hostile"; + } + + @Override + public LOTRMiniQuest createMiniQuest() { + return LOTRMiniQuestFactory.BREE.createQuest(this); + } + + @Override + public LOTRMiniQuestFactory getBountyHelpSpeechDir() { + return LOTRMiniQuestFactory.BREE; + } + }