aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ProtectionEnchantment.h
blob: 910e32dfb2e9cfff46419207e89f5aec56bfc5b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include "Enchantment.h"

class ProtectionEnchantment : public Enchantment
{
public:
	static const int ALL = 0;
	static const int FIRE = 1;
	static const int FALL = 2;
	static const int EXPLOSION = 3;
	static const int PROJECTILE = 4;

private:
	static const int names[];
	static const int minCost[];
	static const int levelCost[];
	static const int levelCostSpan[];

public:
	const int type;

	ProtectionEnchantment(int id, int frequency, int type);

	virtual int getMinCost(int level);
	virtual int getMaxCost(int level);
	virtual int getMaxLevel();
	virtual int getDamageProtection(int level, DamageSource *source);
	virtual int getDescriptionId();
	virtual bool isCompatibleWith(Enchantment *other) const;
	static int getFireAfterDampener(shared_ptr<Entity> entity, int time);
	static double getExplosionKnockbackAfterDampener(shared_ptr<Entity> entity, double power);
};