Skip to content

Commit f22986e

Browse files
committed
New weapon: Chili run
1 parent 181efb4 commit f22986e

File tree

10 files changed

+68
-17
lines changed

10 files changed

+68
-17
lines changed

AUTHORS.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
## Lead developer
1+
## Programming
22
* Simen Heggestøyl (simenheg@gmail.com)
3-
4-
## Code contributors
53
* Gwilym Kuiper
64
* Patrick Bauge Skevik (patrisk@student.matnat.uio.no)
75

8-
## Alpha testers
9-
* Anders Heggestøyl
6+
## Testing
7+
* Anders Heggestøyl (anders.heggestoyl@gmail.com)
108
* Håkon Normann
119

12-
## Music
13-
* Charles Vaughan (cs.vaughan@tiscali.co.uk)
10+
## Graphics
11+
* Simen Heggestøyl
12+
* Anders Heggestøyl
13+
* Ravenmore (http://dycha.net)
1414

1515
## Sound effects
16-
* Charles Vaughan
16+
* Charles Vaughan (cs.vaughan@tiscali.co.uk)
1717
* Simen Heggestøyl
1818

19-
## Logo design
20-
* Anders Heggestøyl (anders.heggestoyl@gmail.com)
21-
22-
## Font: Anka/Coder (license: Open Font License)
23-
* Andrey Makarov (makarov at openfontlibrary.org)
19+
## Music
20+
* Charles Vaughan
2421

25-
## Font: Jura (license: Open Font License)
26-
* Daniel Johnson (Daniel_J at openfontlibrary.org)
22+
## Fonts
23+
* Anka/Coder by Andrey Makarov (OFL)
24+
* Jura by Daniel Johnson (OFL)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 0.1.9 - ??.??.??
22
* General:
3+
* A new weapon has been added: Chili run.
34
* The weapon Disable has been removed.
45
* Autoconf is now used for building.
56
* FPS is capped at 100, which should make Zatacka X less CPU hungry.

data/gfx/wi_chilirun.png

2.73 KB
Loading

data/gfx/wis_chilirun.png

985 Bytes
Loading

data/sound/chilirun.ogg

16.7 KB
Binary file not shown.

src/sound.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static Mix_Chunk *seMole = NULL;
3737
static Mix_Chunk *seWarp = NULL;
3838
static Mix_Chunk *seGhost = NULL;
3939
static Mix_Chunk *seTronmode = NULL;
40+
static Mix_Chunk *seChilirun = NULL;
4041
static Mix_Chunk *seSwitch = NULL;
4142
static Mix_Chunk *sounds[N_SOUNDS];
4243

@@ -119,6 +120,8 @@ int initSound(void)
119120
return -1;
120121
if (loadSound(seTronmode, "tronmode", SOUND_TRON) == -1)
121122
return -1;
123+
if (loadSound(seChilirun, "chilirun", SOUND_CHILIRUN) == -1)
124+
return -1;
122125
if (loadSound(seSwitch, "switch", SOUND_SWITCH) == -1)
123126
return -1;
124127

src/sound.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ enum sounds {
2525
SOUND_WARP,
2626
SOUND_GHOST,
2727
SOUND_TRON,
28+
SOUND_CHILIRUN,
2829
SOUND_SWITCH,
2930
N_SOUNDS
3031
};

src/weapon.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "player.h"
55

6-
#define N_WEAPONS 10
6+
#define N_WEAPONS 11
77
#define N_ILLEGAL_2P_WEPS 1
88
#define WEP_SPACEMOD 42
99
#define WEP_SMALL_INIT_OFFSET 4 /* Offset between score and icon */
@@ -21,6 +21,7 @@
2121
#define DURATION_MOLE 350
2222
#define DURATION_GHOSTWALK 2100
2323
#define DURATION_TRON 3000
24+
#define DURATION_CHILIRUN 1500
2425

2526
enum weapons {
2627
WEP_LIGHTNINGSPEED = 0,
@@ -32,6 +33,7 @@ enum weapons {
3233
WEP_WARP,
3334
WEP_GHOST,
3435
WEP_TRON,
36+
WEP_CHILI_RUN,
3537
WEP_SWITCH
3638
};
3739

@@ -52,6 +54,7 @@ int wepMole(struct player *p, bool on);
5254
int wepWarp(struct player *p, bool on);
5355
int wepGhost(struct player *p, bool on);
5456
int wepTron(struct player *p, bool on);
57+
int wepChilirun(struct player *p, bool on);
5558
int wepSwitch(struct player *p, bool on);
5659

5760
static struct weapon wep_list[N_WEAPONS] = {
@@ -64,6 +67,7 @@ static struct weapon wep_list[N_WEAPONS] = {
6467
{wepWarp, 4, "Warp", "Warp to a random spot", "on the map."},
6568
{wepGhost, 1, "Ghost walk", "Transform into ghost", "form."},
6669
{wepTron, 1, "Tron-mode", "No more smooth turns.", ""},
70+
{wepChilirun, 1, "Chili run", "Hot hot hot!", ""},
6771
{wepSwitch, 1, "Switch-aroo", "SWITCH-AROOOO!", ""}
6872
};
6973

src/zatackax.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,14 +1015,16 @@ void drawExtras(void)
10151015
}
10161016

10171017
/* Active weapons */
1018-
if (activeFreeze || activeConfusion || activeTron) {
1018+
if (activeFreeze || activeConfusion || activeTron || activeChilirun) {
10191019
SDL_Rect offset = {WINDOW_W - wepIcons[0]->w, 0, 0, 0};
10201020
if (activeFreeze)
10211021
SDL_BlitSurface(wepIcons[WEP_FROSTWAVE + 1], NULL, screen, &offset);
10221022
if (activeConfusion)
10231023
SDL_BlitSurface(wepIcons[WEP_CONFUSION + 1], NULL, screen, &offset);
10241024
if (activeTron)
10251025
SDL_BlitSurface(wepIcons[WEP_TRON + 1], NULL, screen, &offset);
1026+
if (activeChilirun)
1027+
SDL_BlitSurface(wepIcons[WEP_CHILI_RUN + 1], NULL, screen, &offset);
10261028
}
10271029
}
10281030

@@ -1318,6 +1320,35 @@ int wepTron(struct player *p __attribute__ ((unused)), bool on)
13181320
return DURATION_TRON;
13191321
}
13201322

1323+
/**
1324+
* Weapon: Chili run
1325+
*
1326+
* @param p Weapon user.
1327+
* @param on 1 to use weapon, 0 to disable weapon.
1328+
*/
1329+
int wepChilirun(struct player *p, bool on)
1330+
{
1331+
struct player *target;
1332+
unsigned int i;
1333+
1334+
activeChilirun = on;
1335+
1336+
if (on) {
1337+
playSound(SOUND_CHILIRUN, sound);
1338+
}
1339+
else {
1340+
refreshGameScreen();
1341+
}
1342+
1343+
for (target = &players[0], i = 0; i < nPlayers; ++i, ++target) {
1344+
if (target != p) {
1345+
target->speed = on ? 2 : 1;
1346+
}
1347+
}
1348+
1349+
return DURATION_CHILIRUN;
1350+
}
1351+
13211352
/**
13221353
* Weapon: switch-aroo
13231354
*
@@ -2360,6 +2391,14 @@ int loadFiles(void)
23602391
fileNotFound("data/gfx/wis_tron.png");
23612392
return 0;
23622393
}
2394+
if ((wiChilirun = loadImage("data/gfx/wi_chilirun.png")) == NULL) {
2395+
fileNotFound("data/gfx/wi_chilirun.png");
2396+
return 0;
2397+
}
2398+
if ((wisChilirun = loadImage("data/gfx/wis_chilirun.png")) == NULL) {
2399+
fileNotFound("data/gfx/wis_chilirun.png");
2400+
return 0;
2401+
}
23632402
if ((wiSwitch = loadImage("data/gfx/wi_switch.png")) == NULL) {
23642403
fileNotFound("data/gfx/wi_switch.png");
23652404
return 0;
@@ -2448,6 +2487,7 @@ int loadFiles(void)
24482487
wepIcons[WEP_WARP + 1] = wiWarp;
24492488
wepIcons[WEP_GHOST + 1] = wiGhost;
24502489
wepIcons[WEP_TRON + 1] = wiTron;
2490+
wepIcons[WEP_CHILI_RUN + 1] = wiChilirun;
24512491
wepIcons[WEP_SWITCH + 1] = wiSwitch;
24522492

24532493
smallWepIcons[WEP_LIGHTNINGSPEED] = wisSpeed;
@@ -2459,6 +2499,7 @@ int loadFiles(void)
24592499
smallWepIcons[WEP_WARP] = wisWarp;
24602500
smallWepIcons[WEP_GHOST] = wisGhost;
24612501
smallWepIcons[WEP_TRON] = wisTron;
2502+
smallWepIcons[WEP_CHILI_RUN] = wisChilirun;
24622503
smallWepIcons[WEP_SWITCH] = wisSwitch;
24632504

24642505
return 1;

src/zatackax.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ static bool screenFreeze = false;
118118
static bool activeFreeze = false;
119119
static bool activeConfusion = false;
120120
static bool activeTron = false;
121+
static bool activeChilirun = false;
121122

122123
static unsigned int scorecap = DEFAULT_SCORECAP;
123124
static bool fullscreen = DEFAULT_FULLSCREEN;
@@ -171,6 +172,8 @@ static SDL_Surface *wiGhost = NULL;
171172
static SDL_Surface *wisGhost = NULL;
172173
static SDL_Surface *wiTron = NULL;
173174
static SDL_Surface *wisTron = NULL;
175+
static SDL_Surface *wiChilirun = NULL;
176+
static SDL_Surface *wisChilirun = NULL;
174177
static SDL_Surface *wiSwitch = NULL;
175178
static SDL_Surface *wisSwitch = NULL;
176179
static struct SDL_Surface **parrows;

0 commit comments

Comments
 (0)