mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Added disloyal mobs
This commit is contained in:
parent
4f65870803
commit
9b70be38be
1 changed files with 10 additions and 3 deletions
|
@ -56,10 +56,10 @@ public class Creature extends Living<LivingEntity> implements WeaklyOwned.Mutabl
|
||||||
|
|
||||||
private boolean discordedChanged = true;
|
private boolean discordedChanged = true;
|
||||||
|
|
||||||
private final Predicate<LivingEntity> targetPredicate = TargetSelecter.<LivingEntity>notOwnerOrFriend(this, this).and(e -> {
|
private final Predicate<LivingEntity> targetPredicate = TargetSelecter.<LivingEntity>notOwnerOrFriend(() -> getOriginatingCaster().getAffinity(), this).and(e -> {
|
||||||
return Equine.of(e)
|
return Equine.of(e)
|
||||||
.filter(eq -> eq instanceof Creature)
|
.filter(eq -> eq instanceof Creature)
|
||||||
.filter(eq -> ((Creature)eq).hasCommonOwner(this))
|
.filter(eq -> isDiscorded() != ((Creature)eq).hasCommonOwner(this))
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -162,6 +162,9 @@ public class Creature extends Living<LivingEntity> implements WeaklyOwned.Mutabl
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initDiscordedAi() {
|
private void initDiscordedAi() {
|
||||||
|
if (getMasterReference().isSet()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
targets.ifPresent(this::clearGoals);
|
targets.ifPresent(this::clearGoals);
|
||||||
// the brain drain
|
// the brain drain
|
||||||
entity.getBrain().clear();
|
entity.getBrain().clear();
|
||||||
|
@ -269,7 +272,11 @@ public class Creature extends Living<LivingEntity> implements WeaklyOwned.Mutabl
|
||||||
@Override
|
@Override
|
||||||
public Affinity getAffinity() {
|
public Affinity getAffinity() {
|
||||||
if (getMaster() instanceof Affine) {
|
if (getMaster() instanceof Affine) {
|
||||||
return ((Affine)getMaster()).getAffinity();
|
Affinity affinity = ((Affine)getMaster()).getAffinity();
|
||||||
|
if (isDiscorded()) {
|
||||||
|
return affinity == Affinity.BAD ? Affinity.GOOD : affinity == Affinity.GOOD ? Affinity.BAD : affinity;
|
||||||
|
}
|
||||||
|
return affinity;
|
||||||
}
|
}
|
||||||
return Affinity.NEUTRAL;
|
return Affinity.NEUTRAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue