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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#ifndef ITEMS_H_INCLUDED
#define ITEMS_H_INCLUDED
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <stdarg.h>
#define BUFF_NONE 0
#define BUFF_HEALTH 1
#define BUFF_IMMORTAL 2
#define BUFF_WATERWALKING 3
#define BUFF_DEFENCE 4
class Item
{
private:
float X;
float Y;
int W;
int H;
int OX;
int OY;
const char* imgAddr;
const char* Name;
int TYPE;
int damage;
int attackSpeed;
int armor;
int buffId;
int buffStr;
int EXTRA_INT_NAME; ///Extra int added
SDL_Surface* surface;
public:
Item();
Item(int x,int y,int w,int h,const char* name,const char* img_addr);
Item(int x,int y,int w,int h,const char* name,const char* img_addr,int flags);
void draw(SDL_Surface* window);
void drawName(SDL_Surface* window,int x,int y);
void move_to(int,int);
void flag(int flag);
void Move(char axis,float speed);
void setWeapon(int Damage,int AttackSpeed);
void setHelmet(int Armor);
void setChestplate(int Armor);
void setLeggins(int Armor);
void setBoots(int Armor);
void setAccessory(int buff_id,int buff_strength);
void setConsumable(int buff_id,int buff_strength);
void setArmor(int Armor);
void setDamage(int Damage);
void randomBuff();
void use();
void destroy();
int getX();
int getY();
int getH();
int getW();
int getOX();
int getOY();
int getItemType();
int getDamage();
int getAttackSpeed();
int getArmor();
int getBuffID();
int getBuffStr();
bool contains(int ,int);
const char* getImgAddr();
const char* getName();
};
#endif // ITEM_H_INCLUDED
|