December 2014 files

This commit is contained in:
Loki Rautio
2026-03-01 11:00:23 -06:00
parent b691c43c44
commit 8fd3ac6e37
2049 changed files with 260190 additions and 134787 deletions

View File

@@ -1,11 +1,12 @@
#pragma once
using namespace std;
class Mob;
class LivingEntity;
class Entity;
class Arrow;
class Fireball;
class Player;
class Explosion;
#include "ChatPacket.h"
@@ -22,22 +23,20 @@ public:
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> mob);
static DamageSource *mobAttack(shared_ptr<LivingEntity> mob);
static DamageSource *playerAttack(shared_ptr<Player> player);
static DamageSource *arrow(shared_ptr<Arrow> arrow, shared_ptr<Entity> owner);
static DamageSource *fireball(shared_ptr<Fireball> fireball, shared_ptr<Entity> owner);
static DamageSource *thrown(shared_ptr<Entity> entity, shared_ptr<Entity> owner);
static DamageSource *indirectMagic(shared_ptr<Entity> entity, shared_ptr<Entity> owner);
static DamageSource *thorns(shared_ptr<Entity> source);
static DamageSource *explosion(Explosion *explosion);
private:
bool _bypassArmor;
bool _bypassInvul;
@@ -47,10 +46,13 @@ private:
bool _isProjectile;
bool _scalesWithDifficulty;
bool _isMagic;
bool _isExplosion;
public:
bool isProjectile();
DamageSource *setProjectile();
bool isExplosion();
DamageSource *setExplosion();
bool isBypassArmor();
float getFoodExhaustion();
@@ -58,10 +60,11 @@ public:
//wstring msgId;
ChatPacket::EChatPacketMessage m_msgId; // 4J Made int so we can localise
ChatPacket::EChatPacketMessage m_msgWithItemId; // 4J: Renamed from m_msgWithSourceId (it was already renamed in places, just made consistent)
protected:
//DamageSource(const wstring &msgId);
DamageSource(ChatPacket::EChatPacketMessage msgId);
DamageSource(ChatPacket::EChatPacketMessage msgId, ChatPacket::EChatPacketMessage msgWithItemId = ChatPacket::e_ChatCustom);
public:
virtual ~DamageSource() {}
@@ -83,8 +86,12 @@ public:
// 4J Stu - Made return a packet
//virtual wstring getLocalizedDeathMessage(shared_ptr<Player> player);
virtual shared_ptr<ChatPacket> getDeathMessagePacket(shared_ptr<Player> player);
virtual shared_ptr<ChatPacket> getDeathMessagePacket(shared_ptr<LivingEntity> player);
bool isFire();
ChatPacket::EChatPacketMessage getMsgId(); // 4J Stu - Used to return String
// 4J Added
bool equals(DamageSource *source);
virtual DamageSource *copy();
};