mirror of
https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-11-25 03:49:46 +00:00
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
41
src/world/entity/ai/goal/target/HurtByTargetGoal.h
Executable file
41
src/world/entity/ai/goal/target/HurtByTargetGoal.h
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef NET_MINECRAFT_WORLD_ENTITY_AI_GOAL_TARGET__HurtByTargetGoal_H__
|
||||
#define NET_MINECRAFT_WORLD_ENTITY_AI_GOAL_TARGET__HurtByTargetGoal_H__
|
||||
|
||||
//package net.minecraft.world.entity->ai.goal.target;
|
||||
|
||||
#include "TargetGoal.h"
|
||||
#include "../../../../phys/AABB.h"
|
||||
|
||||
class HurtByTargetGoal: public TargetGoal
|
||||
{
|
||||
typedef TargetGoal super;
|
||||
public:
|
||||
HurtByTargetGoal(Monster* mob, bool alertSameType)
|
||||
: super(mob, 16, false),
|
||||
alertSameType(alertSameType)
|
||||
{
|
||||
setRequiredControlFlags(TargetGoal::TargetFlag);
|
||||
}
|
||||
|
||||
bool canUse() {
|
||||
return canAttack(mob->getLastHurtByMob(), true);
|
||||
}
|
||||
|
||||
void start() {
|
||||
mob->setTarget(mob->getLastHurtByMob());
|
||||
|
||||
// if (alertSameType) {
|
||||
// List<Entity> nearby = mob.level->getEntitiesOfClass(mob.getClass(), AABB.newTemp(mob.x, mob.y, mob.z, mob.x + 1, mob.y + 1, mob.z + 1).grow(within, 4, within));
|
||||
// for (Entity* ent : nearby) {
|
||||
// Mob other = (Mob) ent;
|
||||
// if (this->mob == other) continue;
|
||||
// if (other.getTarget() != NULL) continue;
|
||||
// other.setTarget(mob.getLastHurtByMob());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
private:
|
||||
bool alertSameType;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_WORLD_ENTITY_AI_GOAL_TARGET__HurtByTargetGoal_H__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue