|
0
|
1 |
#include "theft.h"
|
|
|
2 |
#include "firealrm.h"
|
|
|
3 |
#include "common.h"
|
|
|
4 |
|
|
|
5 |
static bool theftInProgress = false;
|
|
|
6 |
/*
|
|
|
7 |
Uint32 progressSteal(Uint32 interval)
|
|
|
8 |
{
|
|
|
9 |
if(!keysHeldDown[10])
|
|
|
10 |
{
|
|
|
11 |
SDL_RemoveTimer(fadeTimer);
|
|
|
12 |
theftInProgress = false;
|
|
|
13 |
return 0;
|
|
|
14 |
}
|
|
|
15 |
else
|
|
|
16 |
{
|
|
|
17 |
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
return interval;
|
|
|
21 |
}*/
|
|
|
22 |
|
|
|
23 |
void stealItem(int levelIndex)
|
|
|
24 |
{
|
|
|
25 |
if(stealProgress < 128)
|
|
|
26 |
stealProgress += 1;
|
|
|
27 |
else
|
|
|
28 |
{
|
|
|
29 |
for(int i = 0; i < sizeof player.objectsStolen; i++)
|
|
|
30 |
{
|
|
|
31 |
if(!player.objectsStolen[i])
|
|
|
32 |
{
|
|
|
33 |
if(levelTiles[player.x * LEVEL_WIDTH + player.y] == 'T')
|
|
|
34 |
{
|
|
|
35 |
fireAlarmTimer = SDL_AddTimer(1000, ALRM_soundFireAlarm, 0);
|
|
|
36 |
}
|
|
|
37 |
player.objectsStolen[i] = levelTiles[player.x * LEVEL_WIDTH + player.y];
|
|
|
38 |
break;
|
|
|
39 |
}
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
levelTiles[player.x * LEVEL_WIDTH + player.y] = ' ';
|
|
|
43 |
stealProgress = 0;
|
|
|
44 |
}
|
|
|
45 |
}
|