2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
#include "Zombie.h"
|
|
|
|
|
|
|
|
|
|
class DamageSource;
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
// SKIN BY XaPhobia Chris Beidler
|
2026-03-01 12:16:08 +08:00
|
|
|
class PigZombie : public Zombie
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
eINSTANCEOF GetType() { return eTYPE_PIGZOMBIE; }
|
|
|
|
|
static Entity *create(Level *level) { return new PigZombie(level); }
|
|
|
|
|
|
|
|
|
|
private:
|
2026-03-03 03:04:10 +08:00
|
|
|
static AttributeModifier *SPEED_MODIFIER_ATTACKING;
|
|
|
|
|
|
2026-03-01 12:16:08 +08:00
|
|
|
int angerTime;
|
2026-03-03 03:04:10 +08:00
|
|
|
int playAngrySoundIn;
|
|
|
|
|
shared_ptr<Entity> lastAttackTarget;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
void _init();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PigZombie(Level *level);
|
|
|
|
|
|
|
|
|
|
protected:
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual void registerAttributes();
|
|
|
|
|
virtual bool useNewAi();
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual void tick();
|
|
|
|
|
virtual bool canSpawn();
|
|
|
|
|
virtual void addAdditonalSaveData(CompoundTag *tag);
|
|
|
|
|
virtual void readAdditionalSaveData(CompoundTag *tag);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
protected:
|
2026-03-02 17:37:16 +07:00
|
|
|
virtual shared_ptr<Entity> findAttackTarget();
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual bool hurt(DamageSource *source, float dmg);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
private:
|
2026-03-02 17:37:16 +07:00
|
|
|
void alert(shared_ptr<Entity> target);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual int getAmbientSound();
|
|
|
|
|
virtual int getHurtSound();
|
|
|
|
|
virtual int getDeathSound();
|
|
|
|
|
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
|
|
|
|
|
|
|
|
|
|
public:
|
2026-03-03 03:04:10 +08:00
|
|
|
virtual bool mobInteract(shared_ptr<Player> player);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
protected:
|
|
|
|
|
virtual void dropRareDeathLoot(int rareLootLevel);
|
|
|
|
|
virtual int getDeathLoot();
|
|
|
|
|
virtual void populateDefaultEquipmentSlots();
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual MobGroupData *finalizeMobSpawn(MobGroupData *groupData, int extraData = 0); // 4J Added extraData param
|
2026-03-01 12:16:08 +08:00
|
|
|
};
|