- tabification of new sources and replacement of the CON instruction symbols.

# Conflicts:
#	source/games/duke/src/zz_gamedef.cpp
This commit is contained in:
Christoph Oelckers 2020-05-12 13:43:24 +02:00
parent deef1b5936
commit 358d1a460f
16 changed files with 6687 additions and 6497 deletions

View file

@ -5,6 +5,7 @@ set( PCH_SOURCES
src/actors_d.cpp
src/actors_lava.cpp
src/bowling.cpp
src/gamedef.cpp
src/zz_actors.cpp
src/sectors.cpp
src/sectors_d.cpp

View file

@ -1577,7 +1577,7 @@ bool queball(int i, int pocket, int queball, int stripeball)
if (x < 1596)
{
// if(s->pal == 12)
// if(s->pal == 12)
{
j = getincangle(ps[p].getang(), getangle(s->x - ps[p].posx, s->y - ps[p].posy));
if (j > -64 && j < 64 && PlayerInput(p, SK_OPEN))
@ -3174,7 +3174,7 @@ void handle_se30(int i, int JIBS6)
l = nextspritesect[j];
if (sprite[j].statnum == 1 && badguy(&sprite[j]) && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS)
{
// if(sprite[j].sectnum != s->sectnum)
// if(sprite[j].sectnum != s->sectnum)
{
short k = sprite[j].sectnum;
updatesector(sprite[j].x, sprite[j].y, &k);
@ -3289,18 +3289,18 @@ void handle_se03(int i)
if (t[4] == 0) return;
int x, p = findplayer(s, &x);
// if(t[5] > 0) { t[5]--; break; }
// if(t[5] > 0) { t[5]--; break; }
if ((global_random / (sh + 1) & 31) < 4 && !t[2])
{
// t[5] = 4+(global_random&7);
// t[5] = 4+(global_random&7);
sc->ceilingpal = s->owner >> 8;
sc->floorpal = s->owner & 0xff;
t[0] = s->shade + (global_random & 15);
}
else
{
// t[5] = 4+(global_random&3);
// t[5] = 4+(global_random&3);
sc->ceilingpal = s->pal;
sc->floorpal = s->pal;
t[0] = t[3];

View file

@ -1932,7 +1932,7 @@ void movetransports_d(void)
switch (sprite[j].statnum)
{
case STAT_PLAYER: // Player
case STAT_PLAYER: // Player
if (sprite[j].owner != -1)
{
@ -2009,7 +2009,7 @@ void movetransports_d(void)
k = 0;
if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].posz > (sector[sect].floorz - (16 << 8)) && (PlayerInput(p, SK_CROUCH) || ps[p].poszv > 2048))
// if( onfloorz && sectlotag == 1 && ps[p].posz > (sector[sect].floorz-(6<<8)) )
// if( onfloorz && sectlotag == 1 && ps[p].posz > (sector[sect].floorz-(6<<8)) )
{
k = 1;
if (screenpeek == p)
@ -2029,7 +2029,7 @@ void movetransports_d(void)
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].posz < (sector[sect].ceilingz + (6 << 8)))
{
k = 1;
// if( sprite[j].extra <= 0) break;
// if( sprite[j].extra <= 0) break;
if (screenpeek == p)
{
FX_StopAllSounds();
@ -2137,8 +2137,8 @@ void movetransports_d(void)
break;
case WATERBUBBLE:
// if( rnd(192) && sprite[j].picnum == WATERBUBBLE)
// break;
// if( rnd(192) && sprite[j].picnum == WATERBUBBLE)
// break;
if (sectlotag > 0)
{
@ -2470,8 +2470,8 @@ static void greenslime(int i)
s->cstat &= 65535 - 8;
s->picnum = GREENSLIME + 4;
// if(s->yrepeat > 62)
// guts(s,JIBS6,5,myconnectindex);
// if(s->yrepeat > 62)
// guts(s,JIBS6,5,myconnectindex);
if (s->xrepeat > 32) s->xrepeat -= krand() & 7;
if (s->yrepeat > 16) s->yrepeat -= krand() & 7;
@ -3453,7 +3453,7 @@ void moveeffectors_d(void) //STATNUM 3
if ((sprite[j].lotag == 14) && (sh == sprite[j].hitag) && (hittype[j].temp_data[0] == t[0]))
{
sprite[j].xvel = s->xvel;
// if( t[4] == 1 )
// if( t[4] == 1 )
{
if (hittype[j].temp_data[5] == 0)
hittype[j].temp_data[5] = dist(&sprite[j], s);

File diff suppressed because it is too large Load diff

View file

@ -171,17 +171,17 @@ void addweapon_r(struct player_struct* p, int weapon)
case SLINGBLADE_WEAPON:
if (!isRRRA()) break;
case KNEE_WEAPON:
case DYNAMITE_WEAPON:
case DYNAMITE_WEAPON:
case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON:
break;
case SHOTGUN_WEAPON:
case SHOTGUN_WEAPON:
spritesound(SHOTGUN_COCK, p->i);
break;
case PISTOL_WEAPON:
case PISTOL_WEAPON:
spritesound(INSERT_CLIP, p->i);
break;
default:
default:
spritesound(EJECT_CLIP, p->i);
break;
}
@ -1691,7 +1691,7 @@ void movetransports_r(void)
switch (sprite[j].statnum)
{
case STAT_PLAYER: // Player
case STAT_PLAYER: // Player
if (sprite[j].owner != -1)
{
@ -2978,12 +2978,12 @@ static int henstand(int i)
void moveactors_r(void)
{
int x, nexti;
int j, sect, p;
spritetype *s;
dojaildoor();
moveminecart();
int x, nexti;
int j, sect, p;
spritetype *s;
dojaildoor();
moveminecart();
if (isRRRA())
{
@ -2991,176 +2991,176 @@ void moveactors_r(void)
}
rr_specialstats();
for (int i = headspritestat[STAT_ACTOR]; i >= 0; i = nexti)
{
nexti = nextspritestat[i];
for (int i = headspritestat[STAT_ACTOR]; i >= 0; i = nexti)
{
nexti = nextspritestat[i];
bool deleteafterexecute = false; // taking a cue here from RedNukem to not run scripts on deleted sprites.
s = &sprite[i];
s = &sprite[i];
sect = s->sectnum;
sect = s->sectnum;
if( s->xrepeat == 0 || sect < 0 || sect >= MAXSECTORS)
if( s->xrepeat == 0 || sect < 0 || sect >= MAXSECTORS)
{
deletesprite(i);
continue;
}
auto t = &hittype[i].temp_data[0];
auto t = &hittype[i].temp_data[0];
hittype[i].bposx = s->x;
hittype[i].bposy = s->y;
hittype[i].bposz = s->z;
hittype[i].bposx = s->x;
hittype[i].bposy = s->y;
hittype[i].bposz = s->z;
switch(s->picnum)
{
case RESPAWNMARKERRED:
case RESPAWNMARKERYELLOW:
case RESPAWNMARKERGREEN:
switch(s->picnum)
{
case RESPAWNMARKERRED:
case RESPAWNMARKERYELLOW:
case RESPAWNMARKERGREEN:
if (!respawnmarker(i, RESPAWNMARKERYELLOW, RESPAWNMARKERGREEN)) continue;
break;
case RAT:
case RAT:
if (!rat(i, !isRRRA())) continue;
break;
case RRTILE3190:
case RRTILE3191:
case RRTILE3192:
if (!chickenplant)
break;
case RRTILE3190:
case RRTILE3191:
case RRTILE3192:
if (!chickenplant)
{
deletesprite(i);
continue;
}
if (sector[sprite[i].sectnum].lotag == 903)
makeitfall(i);
j = movesprite(i,
(s->xvel*sintable[(s->ang+512)&2047])>>14,
(s->xvel*sintable[s->ang&2047])>>14,
s->zvel,CLIPMASK0);
switch (sector[sprite[i].sectnum].lotag)
{
case 901:
sprite[i].picnum = RRTILE3191;
break;
case 902:
sprite[i].picnum = RRTILE3192;
break;
case 903:
if (sprite[i].z >= sector[sprite[i].sectnum].floorz - (8<<8))
if (sector[sprite[i].sectnum].lotag == 903)
makeitfall(i);
j = movesprite(i,
(s->xvel*sintable[(s->ang+512)&2047])>>14,
(s->xvel*sintable[s->ang&2047])>>14,
s->zvel,CLIPMASK0);
switch (sector[sprite[i].sectnum].lotag)
{
case 901:
sprite[i].picnum = RRTILE3191;
break;
case 902:
sprite[i].picnum = RRTILE3192;
break;
case 903:
if (sprite[i].z >= sector[sprite[i].sectnum].floorz - (8<<8))
{
deletesprite(i);
continue;
}
break;
case 904:
break;
case 904:
deletesprite(i);
continue;
break;
}
break;
}
if ((j & 32768) == 32768)
{
deletesprite(i);
continue;
}
break;
break;
case RRTILE3120:
case RRTILE3122:
case RRTILE3123:
case RRTILE3124:
if (!chickenplant)
case RRTILE3120:
case RRTILE3122:
case RRTILE3123:
case RRTILE3124:
if (!chickenplant)
{
deletesprite(i);
continue;
}
makeitfall(i);
j = movesprite(i,
(s->xvel*(sintable[(s->ang+512)&2047]))>>14,
(s->xvel*(sintable[s->ang&2047]))>>14,
s->zvel,CLIPMASK0);
makeitfall(i);
j = movesprite(i,
(s->xvel*(sintable[(s->ang+512)&2047]))>>14,
(s->xvel*(sintable[s->ang&2047]))>>14,
s->zvel,CLIPMASK0);
if ((j & 32768) == 32768)
{
deletesprite(i);
continue;
}
if (sector[s->sectnum].lotag == 903)
{
if (sprite[i].z >= sector[sprite[i].sectnum].floorz - (4<<8))
if (sector[s->sectnum].lotag == 903)
{
if (sprite[i].z >= sector[sprite[i].sectnum].floorz - (4<<8))
{
deletesprite(i);
continue;
}
}
else if (sector[s->sectnum].lotag == 904)
}
else if (sector[s->sectnum].lotag == 904)
{
deletesprite(i);
continue;
}
break;
break;
case RRTILE3132:
if (!chickenplant)
case RRTILE3132:
if (!chickenplant)
{
deletesprite(i);
continue;
}
makeitfall(i);
j = movesprite(i,
(s->xvel*sintable[(s->ang+512)&2047])>>14,
(s->xvel*sintable[s->ang&2047])>>14,
s->zvel,CLIPMASK0);
if (s->z >= sector[s->sectnum].floorz - (8<<8))
{
if (sector[s->sectnum].lotag == 1)
{
j = spawn(i,WATERSPLASH2);
sprite[j].z = sector[sprite[j].sectnum].floorz;
}
makeitfall(i);
j = movesprite(i,
(s->xvel*sintable[(s->ang+512)&2047])>>14,
(s->xvel*sintable[s->ang&2047])>>14,
s->zvel,CLIPMASK0);
if (s->z >= sector[s->sectnum].floorz - (8<<8))
{
if (sector[s->sectnum].lotag == 1)
{
j = spawn(i,WATERSPLASH2);
sprite[j].z = sector[sprite[j].sectnum].floorz;
}
deletesprite(i);
continue;
}
break;
case BOWLINGBALL:
if (s->xvel)
{
if(!S_CheckSoundPlaying(356))
spritesound(356,i);
}
else
{
spawn(i,BOWLINGBALLSPRITE);
}
break;
case BOWLINGBALL:
if (s->xvel)
{
if(!S_CheckSoundPlaying(356))
spritesound(356,i);
}
else
{
spawn(i,BOWLINGBALLSPRITE);
deletesprite(i);
continue;
}
if (sector[s->sectnum].lotag == 900)
{
S_StopEnvSound(356, -1);
}
case RRTILE3440:
case RRTILE3440+1:
case HENSTAND:
case HENSTAND+1:
}
if (sector[s->sectnum].lotag == 900)
{
S_StopEnvSound(356, -1);
}
case RRTILE3440:
case RRTILE3440+1:
case HENSTAND:
case HENSTAND+1:
{
int todo = henstand(i);
if (todo == 2) deleteafterexecute = true;
if (todo == 1) continue;
break;
break;
}
case QUEBALL:
case STRIPEBALL:
case QUEBALL:
case STRIPEBALL:
if (!queball(i, POCKET, QUEBALL, STRIPEBALL)) continue;
break;
case FORCESPHERE:
break;
case FORCESPHERE:
forcesphere(i, FORCESPHERE);
continue;
continue;
case RECON:
case UFO1_RR:
case UFO2:
case UFO3:
case UFO4:
case UFO5:
case RECON:
case UFO1_RR:
case UFO2:
case UFO3:
case UFO4:
case UFO5:
recon(i, EXPLOSION2, FIRELASER, -1, -1, 457, 8, [](int i) ->int
{
auto s = &sprite[i];
@ -3178,30 +3178,30 @@ void moveactors_r(void)
return BILLYRAY;
else return -1;
});
continue;
continue;
case OOZ:
case OOZ:
ooz(i);
continue;
continue;
case EMPTYBIKE:
if (!isRRRA()) break;
makeitfall(i);
getglobalz(i);
if (sector[sect].lotag == 1)
{
setsprite(i,s->x,s->y,hittype[i].floorz+(16<<8));
}
break;
case EMPTYBOAT:
case EMPTYBIKE:
if (!isRRRA()) break;
makeitfall(i);
getglobalz(i);
break;
getglobalz(i);
if (sector[sect].lotag == 1)
{
setsprite(i,s->x,s->y,hittype[i].floorz+(16<<8));
}
break;
case TRIPBOMBSPRITE:
if (!isRRRA() || (sector[sect].lotag != 1 && sector[sect].lotag != 160))
case EMPTYBOAT:
if (!isRRRA()) break;
makeitfall(i);
getglobalz(i);
break;
case TRIPBOMBSPRITE:
if (!isRRRA() || (sector[sect].lotag != 1 && sector[sect].lotag != 160))
if (s->xvel)
{
j = movesprite(i,
@ -3210,47 +3210,47 @@ void moveactors_r(void)
s->zvel,CLIPMASK0);
s->xvel--;
}
break;
break;
case CHEERBOMB:
if (!isRRRA()) break;
case MORTER:
case HEAVYHBOMB:
case HEAVYHBOMB:
heavyhbomb(i);
continue;
case REACTORBURNT:
case REACTOR2BURNT:
continue;
continue;
case REACTORBURNT:
case REACTOR2BURNT:
continue;
case REACTOR:
case REACTOR2:
case REACTOR:
case REACTOR2:
reactor(i, REACTOR, REACTOR2, REACTOR2BURNT, REACTOR2BURNT);
continue;
continue;
case RR_CAMERA1:
case RR_CAMERA1:
camera(i);
continue;
}
continue;
}
// #ifndef VOLOMEONE
if( ud.multimode < 2 && badguy(s) )
{
if( actor_tog == 1)
{
s->cstat = (short)32768;
continue;
}
else if(actor_tog == 2) s->cstat = 257;
}
if( ud.multimode < 2 && badguy(s) )
{
if( actor_tog == 1)
{
s->cstat = (short)32768;
continue;
}
else if(actor_tog == 2) s->cstat = 257;
}
// #endif
p = findplayer(s,&x);
p = findplayer(s,&x);
execute(i,p,x);
execute(i,p,x);
if (deleteafterexecute) deletesprite(i);
}
}
}
@ -3617,7 +3617,7 @@ void moveeffectors_r(void) //STATNUM 3
if ((sprite[j].lotag == 14) && (sh == sprite[j].hitag) && (hittype[j].temp_data[0] == t[0]))
{
sprite[j].xvel = s->xvel;
// if( t[4] == 1 )
// if( t[4] == 1 )
{
if (hittype[j].temp_data[5] == 0)
hittype[j].temp_data[5] = dist(&sprite[j], s);

View file

@ -37,304 +37,304 @@ short pinsectorresetdown(short sect);
void ballreturn(short spr)
{
short j, i, nexti, nextj;
i = headspritestat[105];
while (i >= 0)
{
nexti = nextspritestat[i];
if (sprite[i].picnum == RRTILE281)
if (sprite[spr].sectnum == sprite[i].sectnum)
{
j = headspritestat[105];
while (j >= 0)
{
nextj = nextspritestat[j];
if (sprite[j].picnum == RRTILE282)
if (sprite[i].hitag == sprite[j].hitag)
spawn(j, BOWLINGBALLSPRITE);
if (sprite[j].picnum == RRTILE280)
if (sprite[i].hitag == sprite[j].hitag)
if (sprite[j].lotag == 0)
{
sprite[j].lotag = 100;
sprite[j].extra++;
pinsectorresetdown(sprite[j].sectnum);
}
j = nextj;
}
}
short j, i, nexti, nextj;
i = headspritestat[105];
while (i >= 0)
{
nexti = nextspritestat[i];
if (sprite[i].picnum == RRTILE281)
if (sprite[spr].sectnum == sprite[i].sectnum)
{
j = headspritestat[105];
while (j >= 0)
{
nextj = nextspritestat[j];
if (sprite[j].picnum == RRTILE282)
if (sprite[i].hitag == sprite[j].hitag)
spawn(j, BOWLINGBALLSPRITE);
if (sprite[j].picnum == RRTILE280)
if (sprite[i].hitag == sprite[j].hitag)
if (sprite[j].lotag == 0)
{
sprite[j].lotag = 100;
sprite[j].extra++;
pinsectorresetdown(sprite[j].sectnum);
}
j = nextj;
}
}
i = nexti;
}
i = nexti;
}
}
short pinsectorresetdown(short sect)
{
int vel, j;
j = getanimationgoal(&sector[sect].ceilingz);
int vel, j;
j = getanimationgoal(&sector[sect].ceilingz);
if (j == -1)
{
j = sector[sect].floorz;
vel = 64;
setanimation(sect,&sector[sect].ceilingz,j,vel);
return 1;
}
return 0;
if (j == -1)
{
j = sector[sect].floorz;
vel = 64;
setanimation(sect,&sector[sect].ceilingz,j,vel);
return 1;
}
return 0;
}
short pinsectorresetup(short sect)
{
int vel, j;
j = getanimationgoal(&sector[sect].ceilingz);
int vel, j;
j = getanimationgoal(&sector[sect].ceilingz);
if (j == -1)
{
j = sector[nextsectorneighborz(sect,sector[sect].ceilingz,-1,-1)].ceilingz;
vel = 64;
setanimation(sect,&sector[sect].ceilingz,j,vel);
return 1;
}
return 0;
if (j == -1)
{
j = sector[nextsectorneighborz(sect,sector[sect].ceilingz,-1,-1)].ceilingz;
vel = 64;
setanimation(sect,&sector[sect].ceilingz,j,vel);
return 1;
}
return 0;
}
short checkpins(short sect)
{
short i, pin;
int x, y;
short pins[10];
short nexti, tag;
pin = 0;
for(i=0;i<10;i++) pins[i] = 0;
short i, pin;
int x, y;
short pins[10];
short nexti, tag;
pin = 0;
for(i=0;i<10;i++) pins[i] = 0;
i = headspritesect[sect];
i = headspritesect[sect];
while (i >= 0)
{
nexti = nextspritesect[i];
while (i >= 0)
{
nexti = nextspritesect[i];
if (sprite[i].picnum == RRTILE3440)
{
pin++;
pins[sprite[i].lotag] = 1;
}
if (sprite[i].picnum == RRTILE280)
{
tag = sprite[i].hitag;
}
if (sprite[i].picnum == RRTILE3440)
{
pin++;
pins[sprite[i].lotag] = 1;
}
if (sprite[i].picnum == RRTILE280)
{
tag = sprite[i].hitag;
}
i = nexti;
}
i = nexti;
}
if (tag)
{
tag += 2024;
tileCopySection(2024,0,0,128,64,tag,0,0);
for(i=0;i<10;i++)
{
if (pins[i] == 1)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(2023,0,0,8,8,tag,x-4,y-10);
}
}
}
if (tag)
{
tag += 2024;
tileCopySection(2024,0,0,128,64,tag,0,0);
for(i=0;i<10;i++)
{
if (pins[i] == 1)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(2023,0,0,8,8,tag,x-4,y-10);
}
}
}
return pin;
return pin;
}
void resetpins(short sect)
{
short i, j, nexti, tag;
int x, y;
i = headspritesect[sect];
while (i >= 0)
{
nexti = headspritesect[i];
if (sprite[i].picnum == 3440)
deletesprite(i);
i = nexti;
}
i = headspritesect[sect];
while (i >= 0)
{
nexti = nextspritesect[i];
if (sprite[i].picnum == 283)
{
j = spawn(i,3440);
sprite[j].lotag = sprite[i].lotag;
if (sprite[j].lotag == 3 || sprite[j].lotag == 5)
{
sprite[j].clipdist = (1+(krand()%1))*16+32;
}
else
{
sprite[j].clipdist = (1+(krand()%1))*16+32;
}
sprite[j].ang -= ((krand()&32)-(krand()&64))&2047;
}
if (sprite[i].picnum == 280)
tag = sprite[i].hitag;
i = nexti;
}
if (tag)
{
tag += LANEPICS+1;
tileCopySection(LANEPICS+1,0,0,128,64,tag,0,0);
for(i=0;i<10;i++)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(LANEPICS,0,0,8,8,tag,x-4,y-10);
}
}
short i, j, nexti, tag;
int x, y;
i = headspritesect[sect];
while (i >= 0)
{
nexti = headspritesect[i];
if (sprite[i].picnum == 3440)
deletesprite(i);
i = nexti;
}
i = headspritesect[sect];
while (i >= 0)
{
nexti = nextspritesect[i];
if (sprite[i].picnum == 283)
{
j = spawn(i,3440);
sprite[j].lotag = sprite[i].lotag;
if (sprite[j].lotag == 3 || sprite[j].lotag == 5)
{
sprite[j].clipdist = (1+(krand()%1))*16+32;
}
else
{
sprite[j].clipdist = (1+(krand()%1))*16+32;
}
sprite[j].ang -= ((krand()&32)-(krand()&64))&2047;
}
if (sprite[i].picnum == 280)
tag = sprite[i].hitag;
i = nexti;
}
if (tag)
{
tag += LANEPICS+1;
tileCopySection(LANEPICS+1,0,0,128,64,tag,0,0);
for(i=0;i<10;i++)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(LANEPICS,0,0,8,8,tag,x-4,y-10);
}
}
}
void resetlanepics(void)
{
int x, y;
short i;
short tag, pic;
for(tag=0;tag<4;tag++)
{
pic = tag + 1;
if (pic == 0) continue;
pic += LANEPICS+1;
tileCopySection(LANEPICS+1,0,0,128,64, pic,0,0);
for(i=0;i<10;i++)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(LANEPICS,0,0,8,8,pic,x-4,y-10);
}
}
int x, y;
short i;
short tag, pic;
for(tag=0;tag<4;tag++)
{
pic = tag + 1;
if (pic == 0) continue;
pic += LANEPICS+1;
tileCopySection(LANEPICS+1,0,0,128,64, pic,0,0);
for(i=0;i<10;i++)
{
switch (i)
{
case 0:
x = 64;
y = 48;
break;
case 1:
x = 56;
y = 40;
break;
case 2:
x = 72;
y = 40;
break;
case 3:
x = 48;
y = 32;
break;
case 4:
x = 64;
y = 32;
break;
case 5:
x = 80;
y = 32;
break;
case 6:
x = 40;
y = 24;
break;
case 7:
x = 56;
y = 24;
break;
case 8:
x = 72;
y = 24;
break;
case 9:
x = 88;
y = 24;
break;
}
tileCopySection(LANEPICS,0,0,8,8,pic,x-4,y-10);
}
}
}
END_DUKE_NS

View file

@ -0,0 +1,19 @@
#pragma once
struct sprite_type;
BEGIN_DUKE_NS
#define cmd(a) concmd_ ## a,
#define cmdx(a, b) concmd_ ## a,
#define cmda(a,b)
enum EConCommands
{
#include "condef.h"
};
#undef cmd
#undef cmdx
#undef cmda
END_DUKE_NS

View file

@ -0,0 +1,176 @@
cmd(definelevelname) // 0
cmd(actor) // 1
cmd(addammo) // 2
cmd(ifrnd) // 3
cmd(enda) // 4
cmd(ifcansee) // 5
cmd(ifhitweapon) // 6
cmd(action) // 7
cmd(ifpdistl) // 8
cmd(ifpdistg) // 9
cmd(else) // 10
cmd(strength) // 11
cmd(break) // 12
cmd(shoot) // 13
cmd(palfrom) // 14
cmd(sound) // 15
cmd(fall) // 16
cmd(state) // 17
cmd(ends) // 18
cmd(define) // 19
cmdx(comment, "//") // 20
cmd(ifai) // 21
cmd(killit) // 22
cmd(addweapon) // 23
cmd(ai) // 24
cmd(addphealth) // 25
cmd(ifdead) // 26
cmd(ifsquished) // 27
cmd(sizeto) // 28
cmdx(leftbrace, "{") // 29
cmdx(rightbrace, "}") // 30
cmd(spawn) // 31
cmd(move) // 32
cmd(ifwasweapon) // 33
cmd(ifaction) // 34
cmd(ifactioncount) // 35
cmd(resetactioncount) // 36
cmd(debris) // 37
cmd(pstomp) // 38
cmdx(blockcomment, "/*") // 39
cmd(cstat) // 40
cmd(ifmove) // 41
cmd(resetplayer) // 42
cmd(ifonwater) // 43
cmd(ifinwater) // 44
cmd(ifcanshoottarget) // 45
cmd(ifcount) // 46
cmd(resetcount) // 47
cmd(addinventory) // 48
cmd(ifactornotstayput) // 49
cmd(hitradius) // 50
cmd(ifp) // 51
cmd(count) // 52
cmd(ifactor) // 53
cmd(music) // 54
cmd(include) // 55
cmd(ifstrength) // 56
cmd(definesound) // 57
cmd(guts) // 58
cmd(ifspawnedby) // 59
cmd(gamestartup) // 60
cmd(wackplayer) // 61
cmd(ifgapzl) // 62
cmd(ifhitspace) // 63
cmd(ifoutside) // 64
cmd(ifmultiplayer) // 65
cmd(operate) // 66
cmd(ifinspace) // 67
cmd(debug) // 68
cmd(endofgame) // 69
cmd(ifbulletnear) // 70
cmd(ifrespawn) // 71
cmd(iffloordistl) // 72
cmd(ifceilingdistl) // 73
cmd(spritepal) // 74
cmd(ifpinventory) // 75
cmd(betaname) // 76
cmd(cactor) // 77
cmd(ifphealthl) // 78
cmd(definequote) // 79
cmd(quote) // 80
cmd(ifinouterspace) // 81
cmd(ifnotmoving) // 82
cmd(respawnhitag) // 83
cmd(tip) // 84
cmd(ifspritepal) // 85
cmd(money) // 86
cmda(feathers, money) // RR alias
cmd(soundonce) // 87
cmd(addkills) // 88
cmd(stopsound) // 89
cmd(ifawayfromwall) // 90
cmd(ifcanseetarget) // 91
cmd(globalsound) // 92
cmd(lotsofglass) // 93
cmd(ifgotweaponce) // 94
cmd(getlastpal) // 95
cmd(pkick) // 96
cmd(mikesnd) // 97
cmd(useractor) // 98
cmd(sizeat) // 99
cmd(addstrength) // 100
cmd(cstator) // 101
cmd(mail) // 102
cmd(paper) // 103
cmd(tossweapon) // 104
cmd(sleeptime) // 105
cmd(nullop) // 106
cmd(definevolumename) // 107
cmd(defineskillname) // 108
cmd(ifnosounds) // 109
cmd(clipdist) // 110
cmd(ifangdiffl) // 111
cmd(ifplaybackon) // World Tour 112
// WW2GI
cmd(gamevar) // 112
cmd(ifvarl) // 113
cmd(ifvarg) // 114
cmd(setvarvar) // 115
cmd(setvar) // 116
cmd(addvarvar) // 117
cmd(addvar) // 118
cmd(ifvarvarl) // 119
cmd(ifvarvarg) // 120
cmd(addlogvar) // 121
cmd(addlog) // 122
cmd(onevent) // 123
cmd(endevent) // 124
cmd(ifvare) // 125
cmd(ifvarvare) // 126
// RR
cmd(ifnocover) // 110
cmd(ifhittruck) // 111
cmd(iftipcow) // 112
cmd(isdrunk) // 113
cmd(iseat) // 114
cmd(destroyit) // 115
cmd(larrybird) // 116
cmd(strafeleft) // 117
cmd(straferight) // 118
cmd(ifactorhealthg) // 119
cmd(ifactorhealthl) // 120
cmd(slapplayer) // 121
cmd(ifpdrunk) // 122
cmd(tearitup) // 123
cmd(smackbubba) // 124
cmd(soundtagonce) // 125
cmd(soundtag) // 126
cmd(ifsoundid) // 127
cmd(ifsounddist) // 128
cmd(ifonmud) // 129
cmd(ifcoop) // 130
// RRRA
cmd(ifmotofast) // 131
cmd(ifwind) // 132
cmd(smacksprite) // 133
cmd(ifonmoto) // 134
cmd(ifonboat) // 135
cmd(fakebubba) // 136
cmd(mamatrigger) // 137
cmd(mamaspawn) // 138
cmd(mamaquake) // 139
cmd(mamaend) // 141
cmd(newpic) // 142
cmd(garybanjo) // 143
cmd(motoloopsnd) // 144
cmd(ifsizedown) // 145
cmd(rndmove) // 146
// RR Deer Huntin'. These are merely here for reference because the game is not supported.
// cmd(iffindnewspot)
// cmd(ifpupwind)

View file

@ -0,0 +1,166 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of Enhanced Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
EDuke enhancements integrated: 04/13/2003 - Matt Saettler
Note: This source file IS NOT USED in EDuke source. It has been split
into many sub-files.
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include <string.h>
#include "concmd.h"
#include "cmdlib.h"
BEGIN_DUKE_NS
// parser state: todo: turn into a class
char* textptr;
int32_t line_count;
//---------------------------------------------------------------------------
//
// synthesize the instruction list
//
//---------------------------------------------------------------------------
#define cmd(a) { #a, concmd_ ## a },
#define cmdx(a, b) { b, concmd_ ## a },
#define cmda(a,b) { #a, concmd_ ## b },
struct ConCommand
{
char cmd[20]; // the longest instruction name is 'ifactornotstayput' at 17 characters so if this changes this field must be enlarged.
int instr;
};
static ConCommand cmdList[] =
{
#include "condef.h"
};
#undef cmd
#undef cmdx
#undef cmda
static int cmdCmp(const void *a, const void *b)
{
auto A = (ConCommand*)a;
auto B = (ConCommand*)b;
return strcmp(A->cmd, B->cmd);
}
void SortCommands()
{
qsort(cmdList, countof(cmdList), sizeof(ConCommand), cmdCmp);
}
//---------------------------------------------------------------------------
//
// binary search for keyword
//
//---------------------------------------------------------------------------
int getkeyword(const char* text)
{
ptrdiff_t min = 0;
ptrdiff_t max = countof(cmdList) - 1;
while (min <= max)
{
int mid = (min + max) >> 1;
const int comp = strcmp(text, cmdList[mid].cmd);
if (comp == 0)
{
return cmdList[mid].instr;
}
else if (comp > 0)
{
min = mid + 1;
}
else
{
max = mid - 1;
}
}
return -1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void skiptoendofline()
{
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
textptr++;
}
void skipwhitespace()
{
while (*textptr == ' ' || *textptr == '\t' || *textptr == '\r' || *textptr == '\n')
{
if (*textptr == '\n') line_count++;
textptr++;
}
}
void skipblockcomment()
{
while (*textptr != '*' && textptr[1] != '/')
{
if (*textptr == '\n') line_count++;
if (*textptr == 0) return; // reached the end of the file
textptr++;
}
}
bool skipcomments()
{
while (true)
{
skipwhitespace();
if (*textptr == '/' && textptr[1] == '/')
{
skiptoendofline();
continue;
}
if (*textptr == '/' && textptr[1] == '*')
{
skipblockcomment();
continue;
}
// stop if we got something else
break;
}
return *textptr != 0;
}
END_DUKE_NS

View file

@ -55,7 +55,7 @@ enum
do \
{ \
C_ReportError(-1); \
Printf("%s:%d: error: " Text "\n", g_scriptFileName, g_lineNumber, ##__VA_ARGS__); \
Printf("%s:%d: error: " Text "\n", g_scriptFileName, line_count, ##__VA_ARGS__); \
g_errorCnt++; \
} while (0)
@ -63,7 +63,7 @@ enum
do \
{ \
C_ReportError(-1); \
Printf("%s:%d: warning: " Text "\n", g_scriptFileName, g_lineNumber, ##__VA_ARGS__); \
Printf("%s:%d: warning: " Text "\n", g_scriptFileName, line_count, ##__VA_ARGS__); \
g_warningCnt++; \
} while (0)
@ -91,7 +91,7 @@ extern const uint32_t CheatFunctionFlags[];
extern const uint8_t CheatFunctionIDs[];
extern int32_t g_errorCnt;
extern int32_t g_lineNumber;
extern int32_t line_count;
extern int32_t g_scriptVersion;
extern int32_t g_totalLines;
extern int32_t g_warningCnt;
@ -177,8 +177,19 @@ enum ScriptError_t
WARNING_DUPLICATEDEFINITION,
WARNING_LABELSONLY,
WARNING_VARMASKSKEYWORD,
ERROR_COULDNOTFIND,
ERROR_NOTAGAMEDEF,
ERROR_NOENDSWITCH
};
enum
{
};
#include "concmd.h"
enum ScriptKeywords_t
{
CON_ELSE, // 0

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -275,7 +275,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
{
g_errorCnt++;
C_ReportError(-1);
Printf("%s:%d: error: too many gamevars!\n",g_scriptFileName,g_lineNumber);
Printf("%s:%d: error: too many gamevars!\n",g_scriptFileName,line_count);
return;
}
@ -283,7 +283,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
{
g_errorCnt++;
C_ReportError(-1);
Printf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",g_scriptFileName,g_lineNumber,pszLabel, MAXVARLABEL);
Printf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",g_scriptFileName,line_count,pszLabel, MAXVARLABEL);
return;
}
@ -295,7 +295,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
if (EDUKE32_PREDICT_FALSE(aGameVars[gV].flags & (GAMEVAR_PTR_MASK)))
{
C_ReportError(-1);
Printf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",g_scriptFileName,g_lineNumber,label+(g_labelCnt<<6));
Printf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",g_scriptFileName,line_count,label+(g_labelCnt<<6));
return;
}
else if (EDUKE32_PREDICT_FALSE(!(aGameVars[gV].flags & GAMEVAR_SYSTEM)))