summaryrefslogtreecommitdiff
path: root/src/base/item.h
blob: 5782ffac3f4efeb58dd5e357cc7efdb1f0ff84f0 (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
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

#ifndef ITEM_H
#    define ITEM_H
#    define ITEM_SYNC_TIMEOUT			5000
#    ifdef __WIN32__
#        define random rand
#    endif
#    define ITEM_MAX_COUNT				1
#    define ITEM_GUN_MAX_FRAME			8
#    define ITEM_MINE_MAX_FRAME			1
#    define ITEM_EXPLOSION_MAX_FRAME	10
#    define ITEM_BONUS_MAX_FRAME		8
#    define ITEM_GUN_WIDTH				50
#    define ITEM_GUN_HEIGHT				20
#    define ITEM_MINE_WIDTH				15
#    define ITEM_MINE_HEIGHT			11
#    define ITEM_EXPLOSION_WIDTH		40
#    define ITEM_EXPLOSION_HEIGHT		40
#    define ITEM_BIG_EXPLOSION_WIDTH	100
#    define ITEM_BIG_EXPLOSION_HEIGHT	100
#    define ITEM_BONUS_WIDTH			20
#    define ITEM_BONUS_HEIGHT			20

#    include "main.h"
#    ifndef PUBLIC_SERVER
#        include "image.h"
#    endif
#    include "list.h"
#    include "tux.h"
#    include "myTimer.h"

typedef struct item_struct {
	int id;
	int type;					// type of thing

	int x;						// item position 
	int y;

	int w;						// item size
	int h;

	int frame;					//number of animation
	int count;

	int author_id;
#    ifndef PUBLIC_SERVER
	image_t *img;				//picture
#    endif
} item_t;

extern bool_t isItemInicialized();
extern void initItem();
extern item_t *newItem(int x, int y, int type, int author_id);
extern void getStatusItem(void *p, int *id, int *x, int *y, int *w, int *h);
extern void setStatusItem(void *p, int x, int y, int w, int h);
extern void replaceItemID(item_t * item, int id);
extern void addNewItem(space_t * spaceItem, int author_id);
#    ifndef PUBLIC_SERVER
extern void drawItem(item_t * p);
extern void drawListItem(list_t * listItem);
#    endif
extern void eventListItem(space_t * listSpace);
extern void eventConflictShotWithItem(arena_t * arena);
extern void eventGiveTuxItem(tux_t * tux, item_t * item, space_t * spaceItem);
extern void eventGiveTuxListItem(tux_t * tux, space_t * spaceItem);
extern void destroyItem(item_t * p);
extern void quitItem();
#endif