* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
87 lines
2.1 KiB
C++
87 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "EnchantmentCategory.h"
|
|
|
|
class DamageSource;
|
|
class Mob;
|
|
|
|
class Enchantment //implements Descriptive<Enchantment> {
|
|
{
|
|
public :
|
|
//static Enchantment *enchantments[256];
|
|
static EnchantmentArray enchantments;
|
|
static vector<Enchantment *> validEnchantments;
|
|
|
|
static const int FREQ_COMMON = 10;
|
|
static const int FREQ_UNCOMMON = 5;
|
|
static const int FREQ_RARE = 2;
|
|
static const int FREQ_VERY_RARE = 1;
|
|
|
|
// armor
|
|
static Enchantment *allDamageProtection;
|
|
static Enchantment *fireProtection;
|
|
static Enchantment *fallProtection;
|
|
static Enchantment *explosionProtection;
|
|
static Enchantment *projectileProtection;
|
|
static Enchantment *drownProtection;
|
|
static Enchantment *waterWorker;
|
|
static Enchantment *thorns;
|
|
|
|
// weapon
|
|
static Enchantment *damageBonus;
|
|
static Enchantment *damageBonusUndead;
|
|
static Enchantment *damageBonusArthropods;
|
|
static Enchantment *knockback;
|
|
static Enchantment *fireAspect;
|
|
static Enchantment *lootBonus;
|
|
|
|
// digger
|
|
static Enchantment *diggingBonus;
|
|
static Enchantment *untouching;
|
|
static Enchantment *digDurability;
|
|
static Enchantment *resourceBonus;
|
|
|
|
// bows
|
|
static Enchantment *arrowBonus;
|
|
static Enchantment *arrowKnockback;
|
|
static Enchantment *arrowFire;
|
|
static Enchantment *arrowInfinite;
|
|
|
|
const int id;
|
|
|
|
static void staticCtor();
|
|
|
|
private:
|
|
const int frequency;
|
|
|
|
public:
|
|
const EnchantmentCategory *category;
|
|
|
|
protected:
|
|
int descriptionId;
|
|
|
|
private:
|
|
void _init(int id);
|
|
|
|
protected:
|
|
Enchantment(int id, int frequency, const EnchantmentCategory *category);
|
|
Enchantment(int id);
|
|
|
|
public:
|
|
virtual int getFrequency();
|
|
virtual int getMinLevel();
|
|
virtual int getMaxLevel();
|
|
virtual int getMinCost(int level);
|
|
virtual int getMaxCost(int level);
|
|
virtual int getDamageProtection(int level, DamageSource *source);
|
|
virtual float getDamageBonus(int level, shared_ptr<LivingEntity> target);
|
|
virtual bool isCompatibleWith(Enchantment *other) const;
|
|
virtual Enchantment *setDescriptionId(int id);
|
|
virtual int getDescriptionId();
|
|
virtual HtmlString getFullname(int level);
|
|
virtual bool canEnchant(shared_ptr<ItemInstance> item);
|
|
|
|
private:
|
|
// 4J Added
|
|
wstring getLevelString(int level);
|
|
}; |