use of de.Keyle.MyPet.skill.skills.BehaviorImpl in project MyPet by xXKeyleXx.
the class BehaviorDuelTarget method shouldStart.
@Override
public boolean shouldStart() {
Behavior behaviorSkill = myPet.getSkills().get(Behavior.class);
if (!behaviorSkill.isActive() || behaviorSkill.getBehavior() != BehaviorMode.Duel) {
return false;
}
if (myPet.getDamage() <= 0 && myPet.getRangedDamage() <= 0) {
return false;
}
if (!petEntity.canMove()) {
return false;
}
if (petEntity.hasTarget()) {
return false;
}
if (duelOpponent != null) {
this.target = duelOpponent;
return true;
}
for (EntityMyPet entityMyPet : this.petEntity.world.a(EntityMyPet.class, this.petOwnerEntity.getBoundingBox().grow((double) range, (double) range, (double) range))) {
MyPet targetMyPet = entityMyPet.getMyPet();
if (entityMyPet != petEntity && entityMyPet.isAlive()) {
if (!targetMyPet.getSkills().isActive(BehaviorImpl.class) || !targetMyPet.getEntity().get().canMove()) {
continue;
}
BehaviorImpl targetbehavior = targetMyPet.getSkills().get(BehaviorImpl.class);
if (targetbehavior.getBehavior() != BehaviorMode.Duel) {
continue;
}
if (targetMyPet.getDamage() == 0) {
continue;
}
this.target = entityMyPet;
return true;
}
}
return false;
}
use of de.Keyle.MyPet.skill.skills.BehaviorImpl in project MyPet by xXKeyleXx.
the class EntityMyEnderman method doMyPetTick.
protected void doMyPetTick() {
super.doMyPetTick();
BehaviorImpl skill = getMyPet().getSkills().get(BehaviorImpl.class);
Behavior.BehaviorMode behavior = skill.getBehavior();
if (behavior == Behavior.BehaviorMode.Aggressive) {
if (!getMyPet().isScreaming()) {
getMyPet().setScreaming(true);
}
} else {
if (getMyPet().isScreaming()) {
getMyPet().setScreaming(false);
}
}
}
use of de.Keyle.MyPet.skill.skills.BehaviorImpl in project MyPet by xXKeyleXx.
the class EntityMyVex method doMyPetTick.
protected void doMyPetTick() {
super.doMyPetTick();
BehaviorImpl skill = getMyPet().getSkills().get(BehaviorImpl.class);
Behavior.BehaviorMode behavior = skill.getBehavior();
if (behavior == Behavior.BehaviorMode.Aggressive) {
if (!isAggressive) {
isAggressive = true;
this.updateVisuals();
}
} else {
if (isAggressive) {
isAggressive = false;
this.updateVisuals();
}
}
}
use of de.Keyle.MyPet.skill.skills.BehaviorImpl in project MyPet by xXKeyleXx.
the class EntityMyVex method doMyPetTick.
@Override
protected void doMyPetTick() {
super.doMyPetTick();
BehaviorImpl skill = getMyPet().getSkills().get(BehaviorImpl.class);
Behavior.BehaviorMode behavior = skill.getBehavior();
if (behavior == Behavior.BehaviorMode.Aggressive) {
if (!isAggressive) {
isAggressive = true;
this.updateVisuals();
}
} else {
if (isAggressive) {
isAggressive = false;
this.updateVisuals();
}
}
}
use of de.Keyle.MyPet.skill.skills.BehaviorImpl in project MyPet by xXKeyleXx.
the class EntityMyBee method doMyPetTick.
protected void doMyPetTick() {
super.doMyPetTick();
BehaviorImpl skill = getMyPet().getSkills().get(BehaviorImpl.class);
Behavior.BehaviorMode behavior = skill.getBehavior();
if (behavior == Behavior.BehaviorMode.Aggressive) {
if (!isAngry) {
isAngry = true;
this.updateVisuals();
}
} else {
if (isAngry) {
isAngry = false;
this.updateVisuals();
}
}
}
Aggregations