sound fx for bulletholes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1489 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-12-25 21:50:27 +00:00
parent d617e97cdf
commit 998f28dfb0
6 changed files with 13 additions and 12 deletions
+2 -3
View File
@@ -1,6 +1,8 @@
registersound "player/jump" //S_JUMP
registersound "player/step" 60 // S_SOFTLAND
registersound "player/land" 40 // S_HARDLAND
registersound "weapon/clip_empty" // S_BULLETBOUNCE TODO:NEW SOUND
registersound "weapon/clip_empty" // S_BULLETAIR TODO:NEW SOUND
registersound "weapon/knife" //S_KNIFE
registersound "weapon/usp" //S_PISTOL
registersound "weapon/pistol_reload" //S_RPISTOL
@@ -29,9 +31,6 @@ registersound "player/die2" //S_DIE2
registersound "weapon/grenade_exp" //S_FEXPLODE
registersound "player/splash1" //S_SPLASH1
registersound "player/splash2" //S_SPLASH2
registersound "ppm/deathr" //S_GRUNT1 16
registersound "ppm/paine" //S_GRUNT2
registersound "ppm/deathe" //S_RUMBLE
registersound "ctf/flagdrop" //S_FLAGDROP
registersound "ctf/flagpickup" //S_FLAGPICKUP
registersound "ctf/flagreturn" //S_FLAGRETURN
+1
View File
@@ -397,6 +397,7 @@ struct playerent : dynent, playerstate
void selectweapon(int w) { weaponsel = weapons[(gunselect = w)]; }
void setprimary(int w) { primweap = weapons[(primary = w)]; }
void setnextprimary(int w) { nextprimweap = weapons[(nextprimary = w)]; }
bool isspectating() { return state==CS_SPECTATE || (state==CS_DEAD && spectating); }
};
class CBot;
+8 -6
View File
@@ -514,6 +514,7 @@ bool addbullethole(vec &from, vec &to, float radius)
o.add(ray.mul(dist));
o.add(vec(surface).mul(0.005f));
newparticle(o, surface, holettl, 7);
playsound(S_BULLETBOUNCE, NULL, NULL, &o);
return true;
}
@@ -528,15 +529,15 @@ bool addscorchmark(vec &o, float radius)
return true;
}
VARP(shotlinettl, 0, 0, 10000);
void addshotline(dynent *pl, vec &from, vec &to)
{
if(pl == player1) return;
if(rnd(3)) return;
bool fx = player1->isspectating() && shotlinettl > 0; // allow fx only in spect mode
if(rnd(3) && !fx) return; // show all shotlines when fx enabled
int start = 10;
if(camera1->o.dist(to) <= 10.0f) start = 8;
else start = 5;
int start = (camera1->o.dist(to) <= 10.0f) ? 8 : 5;
vec unitv;
float dist = to.dist(from, unitv);
unitv.div(dist);
@@ -545,6 +546,7 @@ void addshotline(dynent *pl, vec &from, vec &to)
o.mul(dist/10+start).add(from);
vec d = unitv;
d.mul(dist/10*-(10-start-2)).add(to);
newparticle(o, d, 75, 6);
newparticle(o, d, fx ? shotlinettl : 75, 6);
//playsound(S_BULLETAIR, NULL, NULL, NULL),
}
+1 -1
View File
@@ -84,7 +84,7 @@ void renderteamscore(void *menu, teamscore *t)
sline &line = scorelines.add();
s_sprintfd(plrs)("(%d %s)", t->teammembers.length(), t->teammembers.length() == 1 ? "player" : "players");
if(m_teammode) s_sprintf(line.s)("%d\t%d\t\t\t\t%s\t\t%s", t->frags, t->deaths, team_string(t->team), plrs);
static color teamcolors[2] = { color(1, 0, 0, 0.2f), color(0, 0, 1, 0.2f) };
static color teamcolors[2] = { color(1.0f, 0, 0, 0.2f), color(0, 0, 1.0f, 0.2f) };
line.bgcolor = &teamcolors[t->team];
loopv(t->teammembers) renderscore(menu, t->teammembers[i]);
}
-1
View File
@@ -330,7 +330,6 @@ void updatechanvol(int chan, int svol, soundloc *sl)
{
vol -= (int)(dist*3*soundvol/255); // simple mono distance attenuation
if(vol<0) vol = 0;
conoutf("vol %d", vol);
}
if(sl->pse) // control looping physent sound volume
{
+1 -1
View File
@@ -3,6 +3,7 @@ enum
{
S_JUMP = 0,
S_SOFTLAND, S_HARDLAND,
S_BULLETBOUNCE, S_BULLETAIR,
S_KNIFE,
S_PISTOL, S_RPISTOL,
S_SHOTGUN, S_RSHOTGUN,
@@ -16,7 +17,6 @@ enum
S_DIE1, S_DIE2,
S_FEXPLODE,
S_SPLASH1, S_SPLASH2,
S_GRUNT1, S_GRUNT2, S_RUMBLE,
S_FLAGDROP, S_FLAGPICKUP, S_FLAGRETURN, S_FLAGSCORE,
S_GRENADEPULL, S_GRENADETHROW,
S_RAKIMBO, S_GUNCHANGE, S_GIB, S_HEADSHOT,