*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@280 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-04-27 17:54:22 +00:00
parent 169911219c
commit 11e3296f5c
6 changed files with 39 additions and 22 deletions
@@ -11,5 +11,5 @@
md3animation 0 1 0 25 // idle
md3animation 8 13 0 25 // grenade pull
md3animation 0 1 0 25 // reload
md3animation 21 13 0 25 // grenade throw
md3animation 0 1 0 25 // reload
+1 -1
View File
@@ -52,7 +52,7 @@ void renderplayer(dynent *d)
if(!d) return;
int team = rb_team_int(d->team);
sprintf_sd(mdl)("playermodels/%s/%i", team==TEAM_CLA ? "terrorist" : "counterterrorist", min(0, max(d->skin, (rb_team_int(d->team)==TEAM_CLA ? 3 : 5))));
sprintf_sd(mdl)("playermodels/%s/0%i", team==TEAM_CLA ? "terrorist" : "counterterrorist", min(0, max(d->skin, (rb_team_int(d->team)==TEAM_CLA ? 3 : 5))));
renderclient(d, isteam(player1->team, d->team), mdl, false, 1.6f);
if(d->gunselect>=0 && d->gunselect<NUMGUNS)
+2 -1
View File
@@ -164,7 +164,8 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th
};
strcpy_s(d->name, text);
sgetstr();
strcpy_s(d->team, text);
strcpy_s(d->team, text);
getint(p);
d->lifesequence = getint(p);
break;
};
+2 -1
View File
@@ -287,7 +287,8 @@ void radd(dynent *d)
d->mag[GUN_KNIFE] = 1;
d->mag[GUN_PISTOL] = 8;
d->ammo[GUN_PISTOL] = 24;
d->ammo[GUN_PISTOL] = 24;
d->mag[GUN_GRENADE] = d->ammo[GUN_GRENADE] = 0;
if (m_pistol || d->primary==GUN_PISTOL) // || pistol only mode!
{
+19 -8
View File
@@ -433,9 +433,12 @@ struct weaponmove
bool akimbo = player1->akimbo && player1->gunselect==GUN_PISTOL;
bool throwingnade = player1->gunselect==GUN_GRENADE && player1->thrownademillis;
int timediff = throwingnade ? (lastmillis-player1->thrownademillis) : lastmillis-basetime;
int animtime = attackdelay(player1->gunselect);
int rtime = reloadtime(player1->gunselect);
kick = k_rot = 0.0f;
pos = player1->o;
anim = MDL_GUN_IDLE;
bool attacking = player1->lastaction && player1->lastattackgun==player1->gunselect /*&& lastmillis-player1->lastaction<rtime*/;
if(akimbo && basetime>lastmillis) // akimbo gun queued for reloading
{
@@ -444,28 +447,36 @@ struct weaponmove
else if(player1->reloading)
{
anim = MDL_GUN_RELOAD;
int rtime = reloadtime(player1->gunselect);
float percent_done = (float)(timediff)*100.0f/rtime;
if(percent_done >= 100) percent_done = 100;
k_rot = -(sin((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90);
}
else if(throwingnade && timediff>animtime-rtime/2 && timediff<animtime && attacking)
{
anim = MDL_GUN_IDLE;
float percent_done = (float)50.0f+(timediff-(animtime-rtime/2))*100.0f/rtime;
k_rot = -(sin((float)(percent_done*2/100.0f*90.0f)*PI/180.0f)*90);
}
else
{
vec sway = base;
float percent_done = 0.0f;
float k_back = 0.0f;
if(player1->gunselect==player1->lastattackgun)
{
int animtime = /*throwingnade ? 5000 : */attackdelay(player1->gunselect);
int percent_done = timediff*100/animtime;
if(percent_done > 100) percent_done = 100.0;
percent_done = timediff*100.0f/(float)animtime;
if(percent_done > 100.0f) percent_done = 100.0f;
// f(x) = -sin(x-1.5)^3
kick = -sin(pow((1.5f/100*percent_done)-1.5f,3));
kick = -sin(pow((1.5f/100.0f*percent_done)-1.5f,3));
};
if(kick>0.01f)
{
if(throwingnade) { anim = MDL_GUN_ATTACK2; return; }
if(attacking && timediff<animtime)
{
if(throwingnade)
{
anim = MDL_GUN_ATTACK2;
}
else anim = MDL_GUN_ATTACK;
};
+14 -10
View File
@@ -17,13 +17,13 @@ guninfo guns[NUMGUNS] =
{ S_SUBGUN, S_RSUBGUN, 1650, 80, 17, 0, 0, 70, 15, 30, 1, 2, "subgun" },
{ S_SNIPER, S_RSNIPER, 1950, 1500, 72, 0, 0, 60, 50, 5, 4, 4, "sniper" },
{ S_ASSULT, S_RASSULT, 2000, 130, 20, 0, 0, 20, 40, 20, 0, 2, "assult" }, //recoil was 44
{ S_GRENADE, S_NULL, 1000, 2000, 150, 20, 6, 1, 1, 1, 3, 1, "grenade" },
{ S_GRENADE, S_NULL, 1000, 2500, 150, 20, 6, 1, 1, 1, 3, 1, "grenade" },
};
bool gun_changed = false;
void changeweapon(int gun)
void weapon(int gun)
{
if(gun>=0) gun %= G_NUM;
else gun = G_NUM-(gun % G_NUM);
@@ -48,10 +48,10 @@ void shiftweapon(int i)
default: gun=G_PRIMARY; break;
};
gun += i;
changeweapon(gun);
weapon(gun);
}
COMMAND(changeweapon, ARG_1INT);
COMMAND(weapon, ARG_1INT);
COMMAND(shiftweapon, ARG_1INT);
void reload()
@@ -314,7 +314,6 @@ void throw_nade(dynent *d, vec &to, physent *p)
if(d==player1)
{
d->thrownademillis = lastmillis;
int percent_done = (lastmillis-p->millis)*100/2000;
if(percent_done < 0 || percent_done > 100) percent_done = 100;
addmsg(1, 9, SV_SHOT, d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), percent_done);
@@ -505,7 +504,8 @@ void spreadandrecoil(vec & from, vec & to, dynent * d)
if(d->pitch<80.0f) d->pitch += guns[d->gunselect].recoil*0.05f;
};
VAR(grenadepulltime, 0, 100, 10000);
//VAR(grenadepulltime, 0, 100, 10000);
const int grenadepulltime = 650;
bool akimboside = false;
int akimbolastaction[2] = {0,0};
@@ -517,9 +517,13 @@ void shoot(dynent *d, vec &targ)
if(!d->attacking && d->gunselect==GUN_GRENADE && curnade) // throw
{
if(attacktime>grenadepulltime) throw_nade(d, targ, curnade);
if(attacktime>grenadepulltime)
{
d->thrownademillis = lastmillis;
throw_nade(d, targ, curnade);
}
return;
}
};
if(attacktime<d->gunwait) return;
d->gunwait = 0;
@@ -539,9 +543,9 @@ void shoot(dynent *d, vec &targ)
d->attacking = true; //make akimbo auto
akimbolastaction[akimboside?1:0] = lastmillis;
akimboside = !akimboside;
}
d->lastaction = lastmillis;
}
d->lastaction = lastmillis;
d->lastattackgun = d->gunselect;
if(!d->mag[d->gunselect]) { playsoundc(S_NOAMMO); d->gunwait = 250; d->lastattackgun = -1; return; };