#pragma once using namespace std; class Mob; class Entity; class Arrow; class Fireball; class Player; #include "ChatPacket.h" class DamageSource { public: static DamageSource *inFire; static DamageSource *onFire; static DamageSource *lava; static DamageSource *inWall; static DamageSource *drown; static DamageSource *starve; static DamageSource *cactus; static DamageSource *fall; static DamageSource *outOfWorld; static DamageSource *genericSource; static DamageSource *explosion; static DamageSource *controlledExplosion; static DamageSource *magic; static DamageSource *dragonbreath; static DamageSource *wither; static DamageSource *anvil; static DamageSource *fallingBlock; static DamageSource *mobAttack(shared_ptr mob); static DamageSource *playerAttack(shared_ptr player); static DamageSource *arrow(shared_ptr arrow, shared_ptr owner); static DamageSource *fireball(shared_ptr fireball, shared_ptr owner); static DamageSource *thrown(shared_ptr entity, shared_ptr owner); static DamageSource *indirectMagic(shared_ptr entity, shared_ptr owner); static DamageSource *thorns(shared_ptr source); private: bool _bypassArmor; bool _bypassInvul; // food exhastion caused by being damaged by this source float exhaustion; bool isFireSource; bool _isProjectile; bool _scalesWithDifficulty; bool _isMagic; public: bool isProjectile(); DamageSource *setProjectile(); bool isBypassArmor(); float getFoodExhaustion(); bool isBypassInvul(); //wstring msgId; ChatPacket::EChatPacketMessage m_msgId; // 4J Made int so we can localise protected: //DamageSource(const wstring &msgId); DamageSource(ChatPacket::EChatPacketMessage msgId); public: virtual ~DamageSource() {} virtual shared_ptr getDirectEntity(); virtual shared_ptr getEntity(); protected: DamageSource *bypassArmor(); DamageSource *bypassInvul(); DamageSource *setIsFire(); DamageSource *setScalesWithDifficulty(); public: virtual bool scalesWithDifficulty(); bool isMagic(); DamageSource *setMagic(); // 4J Stu - Made return a packet //virtual wstring getLocalizedDeathMessage(shared_ptr player); virtual shared_ptr getDeathMessagePacket(shared_ptr player); bool isFire(); ChatPacket::EChatPacketMessage getMsgId(); // 4J Stu - Used to return String };