Add config option to treat passive creatures as allies
This commit is contained in:
@@ -158,6 +158,8 @@ public final class Settings {
|
|||||||
public boolean teleportThroughUnbreakableBlocks = false;
|
public boolean teleportThroughUnbreakableBlocks = false;
|
||||||
/** <b>[Server-only]</b> Whether to allow players to damage their designated allies using magic. */
|
/** <b>[Server-only]</b> Whether to allow players to damage their designated allies using magic. */
|
||||||
public FriendlyFire friendlyFire = FriendlyFire.ALL;
|
public FriendlyFire friendlyFire = FriendlyFire.ALL;
|
||||||
|
/** <b>[Server-only]</b> Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc. */
|
||||||
|
public boolean passiveMobsAreAllies = false;
|
||||||
/** <b>[Server-only]</b> Whether to allow players to disarm other players using the telekinesis spell. */
|
/** <b>[Server-only]</b> Whether to allow players to disarm other players using the telekinesis spell. */
|
||||||
public boolean telekineticDisarmament = true;
|
public boolean telekineticDisarmament = true;
|
||||||
/** <b>[Server-only]</b> Whether summoned creatures can revenge attack their caster if their caster attacks them. */
|
/** <b>[Server-only]</b> Whether summoned creatures can revenge attack their caster if their caster attacks them. */
|
||||||
@@ -578,6 +580,14 @@ public final class Settings {
|
|||||||
friendlyFire = FriendlyFire.fromName(property.getString());
|
friendlyFire = FriendlyFire.fromName(property.getString());
|
||||||
propOrder.add(property.getName());
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
|
property = config.get(DIFFICULTY_CATEGORY, "passiveMobsAreAllies", true,
|
||||||
|
"Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.");
|
||||||
|
property.setLanguageKey("config." + Wizardry.MODID + ".passive_mobs_are_allies");
|
||||||
|
Wizardry.proxy.setToNamedBooleanEntry(property);
|
||||||
|
property.setRequiresWorldRestart(false);
|
||||||
|
passiveMobsAreAllies = property.getBoolean();
|
||||||
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
property = config.get(DIFFICULTY_CATEGORY, "minionRevengeTargeting", true,
|
property = config.get(DIFFICULTY_CATEGORY, "minionRevengeTargeting", true,
|
||||||
"Whether summoned creatures can revenge attack their owner if their owner attacks them.");
|
"Whether summoned creatures can revenge attack their owner if their owner attacks them.");
|
||||||
property.setLanguageKey("config." + Wizardry.MODID + ".minion_revenge_targeting");
|
property.setLanguageKey("config." + Wizardry.MODID + ".minion_revenge_targeting");
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import electroblob.wizardry.Wizardry;
|
|||||||
import electroblob.wizardry.data.WizardData;
|
import electroblob.wizardry.data.WizardData;
|
||||||
import electroblob.wizardry.registry.WizardryPotions;
|
import electroblob.wizardry.registry.WizardryPotions;
|
||||||
import electroblob.wizardry.spell.MindControl;
|
import electroblob.wizardry.spell.MindControl;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.*;
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.IEntityOwnable;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.common.util.FakePlayer;
|
import net.minecraftforge.common.util.FakePlayer;
|
||||||
@@ -123,6 +120,14 @@ public final class AllyDesignationSystem {
|
|||||||
// I really shouldn't need to do this, but fake players seem to break stuff...
|
// I really shouldn't need to do this, but fake players seem to break stuff...
|
||||||
if(target instanceof FakePlayer) return false;
|
if(target instanceof FakePlayer) return false;
|
||||||
|
|
||||||
|
// Use a positive check for these rather than a negative check for monsters, because we only want mobs
|
||||||
|
// that are definitely passive
|
||||||
|
if(Wizardry.settings.passiveMobsAreAllies && (target.isCreatureType(EnumCreatureType.AMBIENT, false)
|
||||||
|
|| target.isCreatureType(EnumCreatureType.CREATURE, false)
|
||||||
|
|| target.isCreatureType(EnumCreatureType.WATER_CREATURE, false))){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Tests whether the target is a creature that was summoned by the attacker
|
// Tests whether the target is a creature that was summoned by the attacker
|
||||||
// if(target instanceof ISummonedCreature && ((ISummonedCreature)target).getCaster() == attacker){
|
// if(target instanceof ISummonedCreature && ((ISummonedCreature)target).getCaster() == attacker){
|
||||||
// return false;
|
// return false;
|
||||||
|
|||||||
@@ -1193,6 +1193,10 @@ config.ebwizardry.legacy_wand_levelling.true=Yes - I liked it how it was!
|
|||||||
config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
|
config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
|
||||||
config.ebwizardry.friendly_fire=Friendly Fire
|
config.ebwizardry.friendly_fire=Friendly Fire
|
||||||
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
|
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
|
||||||
|
config.ebwizardry.passive_mobs_are_allies=Passive Mobs Are Allies
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.tooltip=Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.true=Yes - don't hurt the animals!
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak phoenix-grilled!
|
||||||
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
||||||
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
|
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
|
||||||
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!
|
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!
|
||||||
|
|||||||
@@ -1193,6 +1193,10 @@ config.ebwizardry.legacy_wand_levelling.true=Yes - I liked it how it was!
|
|||||||
config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
|
config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
|
||||||
config.ebwizardry.friendly_fire=Friendly Fire
|
config.ebwizardry.friendly_fire=Friendly Fire
|
||||||
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
|
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
|
||||||
|
config.ebwizardry.passive_mobs_are_allies=Passive Mobs Are Allies
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.tooltip=Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.true=Yes - don't hurt the animals!
|
||||||
|
config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak phoenix-grilled!
|
||||||
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
||||||
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
|
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
|
||||||
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!
|
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!
|
||||||
|
|||||||
Reference in New Issue
Block a user