Play sound when recharging from power pool.
This commit is contained in:
parent
1073276c6f
commit
a3a4c01049
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -318,6 +318,7 @@ enum
|
||||||
SND_TROPHY,
|
SND_TROPHY,
|
||||||
SND_ELECTRIC_HIT,
|
SND_ELECTRIC_HIT,
|
||||||
SND_ITEM_PAD,
|
SND_ITEM_PAD,
|
||||||
|
SND_POWER_POOL,
|
||||||
SND_MAX
|
SND_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,8 @@ static void tick(void)
|
||||||
s->spriteTime = 12;
|
s->spriteTime = 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s->bobTouching = MAX(s->bobTouching - 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void action(void)
|
static void action(void)
|
||||||
|
@ -102,6 +104,13 @@ static void touch(Entity *other)
|
||||||
{
|
{
|
||||||
world.bob->power = MIN(world.bob->power + 0.05, world.bob->powerMax);
|
world.bob->power = MIN(world.bob->power + 0.05, world.bob->powerMax);
|
||||||
|
|
||||||
|
if (s->bobTouching == 0)
|
||||||
|
{
|
||||||
|
playSound(SND_POWER_POOL, s->uniqueId % MAX_SND_CHANNELS);
|
||||||
|
}
|
||||||
|
|
||||||
|
s->bobTouching = 2;
|
||||||
|
|
||||||
if (world.bob->power == world.bob->powerMax)
|
if (world.bob->power == world.bob->powerMax)
|
||||||
{
|
{
|
||||||
s->thinkTime = FPS * 10;
|
s->thinkTime = FPS * 10;
|
||||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
extern Structure *createStructure(void);
|
extern Structure *createStructure(void);
|
||||||
extern Sprite *getSprite(char *name);
|
extern Sprite *getSprite(char *name);
|
||||||
|
extern void playSound(int snd, int ch);
|
||||||
|
|
||||||
extern Entity *self;
|
extern Entity *self;
|
||||||
extern World world;
|
extern World world;
|
||||||
|
|
|
@ -172,7 +172,8 @@ static void loadSounds(void)
|
||||||
sounds[SND_CONFIRMED] = loadSound("sound/39028__wildweasel__cardlock-open.ogg");
|
sounds[SND_CONFIRMED] = loadSound("sound/39028__wildweasel__cardlock-open.ogg");
|
||||||
sounds[SND_HEART_CELL] = loadSound("sound/162467__kastenfrosch__gotitem.ogg");
|
sounds[SND_HEART_CELL] = loadSound("sound/162467__kastenfrosch__gotitem.ogg");
|
||||||
sounds[SND_ELECTRIC_HIT] = loadSound("sound/46501__phreaksaccount__welder1.ogg");
|
sounds[SND_ELECTRIC_HIT] = loadSound("sound/46501__phreaksaccount__welder1.ogg");
|
||||||
sounds[SND_ITEM_PAD] = loadSound("sound/383779__jay-you__telephone-dialing.ogg");
|
sounds[SND_ITEM_PAD] = loadSound("sound/319996__kenrt__ratchet.ogg");
|
||||||
|
sounds[SND_POWER_POOL] = loadSound("sound/235737__copyc4t__tf-power-tools.ogg");
|
||||||
|
|
||||||
sounds[SND_MISSION_COMPLETE] = loadSound("sound/113989__kastenfrosch__gewonnen.ogg");
|
sounds[SND_MISSION_COMPLETE] = loadSound("sound/113989__kastenfrosch__gewonnen.ogg");
|
||||||
sounds[SND_TROPHY] = loadSound("sound/278142__ricemaster__effect-notify.ogg");
|
sounds[SND_TROPHY] = loadSound("sound/278142__ricemaster__effect-notify.ogg");
|
||||||
|
|
Loading…
Reference in New Issue