From 1e43c67660645bd867109e35035e0bb2a99fdf3f Mon Sep 17 00:00:00 2001 From: Electroblob <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 4 Jun 2018 17:17:33 +0100 Subject: [PATCH] Tweak summoned creature targeting so that non-evil wizards' minions no longer attack players unless the player in question has angered the wizard --- .../wizardry/entity/living/ISummonedCreature.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/electroblob/wizardry/entity/living/ISummonedCreature.java b/src/main/java/electroblob/wizardry/entity/living/ISummonedCreature.java index 30c852ab..3c7e9a12 100644 --- a/src/main/java/electroblob/wizardry/entity/living/ISummonedCreature.java +++ b/src/main/java/electroblob/wizardry/entity/living/ISummonedCreature.java @@ -181,8 +181,18 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData { if(!entity.isInvisible() && isValidTarget(entity)){ // ... and is a player, they can be attacked, since players can't be in the whitelist or the - // blacklist. - if(entity instanceof EntityPlayer) return true; + // blacklist ... + if(entity instanceof EntityPlayer){ + // ... unless the creature was summoned by a good wizard who the player has not angered. + if(getCaster() instanceof EntityWizard){ + if(((EntityWizard)getCaster()).getRevengeTarget() != entity + && ((EntityWizard)getCaster()).getAttackTarget() != entity) { + return false; + } + } + + return true; + } // ... and is a mob, a summoned creature, a wizard ... if((entity instanceof IMob || entity instanceof ISummonedCreature