mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- all of player_w.cpp
This commit is contained in:
parent
be591e9cf9
commit
b891646c37
1 changed files with 37 additions and 38 deletions
|
@ -108,27 +108,26 @@ void DoFire(struct player_struct *p, short snum)
|
||||||
|
|
||||||
void DoSpawn(struct player_struct *p, short snum)
|
void DoSpawn(struct player_struct *p, short snum)
|
||||||
{
|
{
|
||||||
int j;
|
|
||||||
if(!aplWeaponSpawn[p->curr_weapon][snum])
|
if(!aplWeaponSpawn[p->curr_weapon][snum])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
j = fi.spawn(p->i, aplWeaponSpawn[p->curr_weapon][snum]);
|
auto j = spawn(p->GetActor(), aplWeaponSpawn[p->curr_weapon][snum]);
|
||||||
|
|
||||||
if((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE2 ) )
|
if((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE2 ) )
|
||||||
{
|
{
|
||||||
// like shotgun shells
|
// like shotgun shells
|
||||||
sprite[j].ang += 1024;
|
j->s.ang += 1024;
|
||||||
ssp(j,CLIPMASK0);
|
ssp(j,CLIPMASK0);
|
||||||
sprite[j].ang += 1024;
|
j->s.ang += 1024;
|
||||||
// p->kickback_pic++;
|
// p->kickback_pic++;
|
||||||
}
|
}
|
||||||
else if((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE3 ) )
|
else if((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE3 ) )
|
||||||
{
|
{
|
||||||
// like chaingun shells
|
// like chaingun shells
|
||||||
sprite[j].ang += 1024;
|
j->s.ang += 1024;
|
||||||
sprite[j].ang &= 2047;
|
j->s.ang &= 2047;
|
||||||
sprite[j].xvel += 32;
|
j->s.xvel += 32;
|
||||||
sprite[j].z += (3<<8);
|
j->s.z += (3<<8);
|
||||||
ssp(j,CLIPMASK0);
|
ssp(j,CLIPMASK0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +310,7 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect)
|
||||||
{
|
{
|
||||||
auto p = &ps[snum];
|
auto p = &ps[snum];
|
||||||
int pi = p->i;
|
int pi = p->i;
|
||||||
int i, j, k;
|
int i, k;
|
||||||
int psectlotag = sector[psect].lotag;
|
int psectlotag = sector[psect].lotag;
|
||||||
|
|
||||||
// already firing...
|
// already firing...
|
||||||
|
@ -342,33 +341,33 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect)
|
||||||
i = -512 - mulscale16(p->horizon.sum().asq16(), 20);
|
i = -512 - mulscale16(p->horizon.sum().asq16(), 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
j = EGS(p->cursectnum,
|
auto j = EGS(p->cursectnum,
|
||||||
p->posx + (sintable[(p->angle.ang.asbuild() + 512) & 2047] >> 6),
|
p->posx + (sintable[(p->angle.ang.asbuild() + 512) & 2047] >> 6),
|
||||||
p->posy + (sintable[p->angle.ang.asbuild() & 2047] >> 6),
|
p->posy + (sintable[p->angle.ang.asbuild() & 2047] >> 6),
|
||||||
p->posz, HEAVYHBOMB, -16, 9, 9,
|
p->posz, HEAVYHBOMB, -16, 9, 9,
|
||||||
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, pi, 1);
|
p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, p->GetActor(), 1);
|
||||||
|
|
||||||
{
|
{
|
||||||
int lGrenadeLifetime = GetGameVar("GRENADE_LIFETIME", NAM_GRENADE_LIFETIME, nullptr, snum);
|
int lGrenadeLifetime = GetGameVar("GRENADE_LIFETIME", NAM_GRENADE_LIFETIME, nullptr, snum);
|
||||||
int lGrenadeLifetimeVar = GetGameVar("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, nullptr, snum);
|
int lGrenadeLifetimeVar = GetGameVar("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, nullptr, snum);
|
||||||
// set timer. blows up when at zero....
|
// set timer. blows up when at zero....
|
||||||
sprite[j].extra = lGrenadeLifetime
|
j->s.extra = lGrenadeLifetime
|
||||||
+ mulscale(krand(), lGrenadeLifetimeVar, 14)
|
+ mulscale(krand(), lGrenadeLifetimeVar, 14)
|
||||||
- lGrenadeLifetimeVar;
|
- lGrenadeLifetimeVar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == 15)
|
if (k == 15)
|
||||||
{
|
{
|
||||||
sprite[j].yvel = 3;
|
j->s.yvel = 3;
|
||||||
sprite[j].z += (8 << 8);
|
j->s.z += (8 << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
k = hits(p->GetActor());
|
k = hits(p->GetActor());
|
||||||
if (k < 512)
|
if (k < 512)
|
||||||
{
|
{
|
||||||
sprite[j].ang += 1024;
|
j->s.ang += 1024;
|
||||||
sprite[j].zvel /= 3;
|
j->s.zvel /= 3;
|
||||||
sprite[j].xvel /= 3;
|
j->s.xvel /= 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->hbomb_on = 1;
|
p->hbomb_on = 1;
|
||||||
|
|
Loading…
Reference in a new issue