# Conflicts:
#	source/games/duke/src/sbar.cpp
This commit is contained in:
Christoph Oelckers 2020-05-05 16:33:23 +02:00
parent cde100598c
commit cb54a03d60
16 changed files with 716 additions and 141 deletions

View file

@ -65,14 +65,10 @@ bool ceilingspace(int sectnum)
{ {
case MOONSKY1: case MOONSKY1:
case BIGORBIT1: case BIGORBIT1:
return !(g_gameType & GAMEFLAG_RRALL); return true;
case RR_MOONSKY1:
case RR_BIGORBIT1:
return !!(g_gameType & GAMEFLAG_RRALL);
} }
} }
return 0; return false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -89,14 +85,93 @@ bool floorspace(int sectnum)
{ {
case MOONSKY1: case MOONSKY1:
case BIGORBIT1: case BIGORBIT1:
return !(g_gameType & GAMEFLAG_RRALL); return true;
case RR_MOONSKY1:
case RR_BIGORBIT1:
return !!(g_gameType & GAMEFLAG_RRALL);
} }
} }
return 0; return false;
}
void addammo(short weapon, struct player_struct* p, short amount)
{
p->ammo_amount[weapon] += amount;
if (p->ammo_amount[weapon] > max_ammo_amount[weapon])
p->ammo_amount[weapon] = max_ammo_amount[weapon];
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void addweapon(struct player_struct* p, short weapon)
{
if (p->gotweapon[weapon] == 0)
{
p->gotweapon.Set(weapon);
if (weapon == SHRINKER_WEAPON)
p->gotweapon.Set(GROW_WEAPON);
}
p->random_club_frame = 0;
if (p->holster_weapon == 0)
{
p->weapon_pos = -1;
p->last_weapon = p->curr_weapon;
}
else
{
p->weapon_pos = 10;
p->holster_weapon = 0;
p->last_weapon = -1;
}
p->kickback_pic = 0;
#ifdef EDUKE
if (p->curr_weapon != weapon)
{
short snum;
snum = sprite[p->i].yvel;
SetGameVarID(g_iWeaponVarID, weapon, p->i, snum);
if (p->curr_weapon >= 0)
{
SetGameVarID(g_iWorksLikeVarID, aplWeaponWorksLike[weapon][snum], p->i, snum);
}
else
{
SetGameVarID(g_iWorksLikeVarID, -1, p->i, snum);
}
SetGameVarID(g_iReturnVarID, 0, -1, snum);
OnEvent(EVENT_CHANGEWEAPON, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, -1, snum) == 0)
{
p->curr_weapon = weapon;
}
}
#else
p->curr_weapon = weapon;
#endif
switch (weapon)
{
case KNEE_WEAPON:
case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON:
case HANDBOMB_WEAPON:
break;
case SHOTGUN_WEAPON:
spritesound(SHOTGUN_COCK, p->i);
break;
case PISTOL_WEAPON:
spritesound(INSERT_CLIP, p->i);
break;
default:
spritesound(SELECT_WEAPON, p->i);
break;
}
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -107,8 +182,6 @@ bool floorspace(int sectnum)
bool ifsquished(int i, int p) bool ifsquished(int i, int p)
{ {
if (g_gameType & GAMEFLAG_RRALL) return false; // this function is a no-op in RR's source.
bool squishme = false; bool squishme = false;
if (sprite[i].picnum == TILE_APLAYER && ud.clipping) if (sprite[i].picnum == TILE_APLAYER && ud.clipping)
return false; return false;

View file

@ -5882,7 +5882,7 @@ DETONATEB:
P_AddAmmo(pPlayer, RPG_WEAPON, 1); P_AddAmmo(pPlayer, RPG_WEAPON, 1);
A_PlaySound(DUKE_GET, pPlayer->i); A_PlaySound(DUKE_GET, pPlayer->i);
if ((pPlayer->gotweapon & (1<<HANDBOMB_WEAPON)) == 0 || pSprite->owner == pPlayer->i) if ((pPlayer->gotweapon[HANDBOMB_WEAPON]) == 0 || pSprite->owner == pPlayer->i)
P_AddWeapon(pPlayer, HANDBOMB_WEAPON); P_AddWeapon(pPlayer, HANDBOMB_WEAPON);
if (sprite[pSprite->owner].picnum != TILE_APLAYER) if (sprite[pSprite->owner].picnum != TILE_APLAYER)

View file

@ -433,7 +433,7 @@ void G_DoCheats(void)
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
{ {
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
pPlayer->gotweapon |= (1<<weaponNum); pPlayer->gotweapon.Set(weaponNum);
} }
if (RRRA) pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1; if (RRRA) pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1;
@ -568,7 +568,7 @@ void G_DoCheats(void)
int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS; int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS;
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
pPlayer->gotweapon |= (1 << weaponNum); pPlayer->gotweapon.Set(weaponNum);
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
@ -786,7 +786,7 @@ void G_DoCheats(void)
case CHEAT_RARHETT: case CHEAT_RARHETT:
ud.god = 0; ud.god = 0;
pPlayer->gotweapon = 1<<KNEE_WEAPON; pPlayer->gotweapon.Set(KNEE_WEAPON);
pPlayer->curr_weapon = KNEE_WEAPON; pPlayer->curr_weapon = KNEE_WEAPON;
pPlayer->nocheat = 1; pPlayer->nocheat = 1;
sprite[pPlayer->i].extra = 1; sprite[pPlayer->i].extra = 1;
@ -852,7 +852,7 @@ void G_DoCheats(void)
case CHEAT_RAMIKAEL: case CHEAT_RAMIKAEL:
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS; weaponNum++)
{ {
pPlayer->gotweapon |= 1 << weaponNum; pPlayer->gotweapon.Set(weaponNum);
pPlayer->ammo_amount[weaponNum] = 66; pPlayer->ammo_amount[weaponNum] = 66;
} }

View file

@ -228,7 +228,7 @@ void G_OnMotorcycle(DukePlayer_t *pPlayer, int spriteNum)
pPlayer->on_motorcycle = 1; pPlayer->on_motorcycle = 1;
pPlayer->last_full_weapon = pPlayer->curr_weapon; pPlayer->last_full_weapon = pPlayer->curr_weapon;
pPlayer->curr_weapon = MOTORCYCLE_WEAPON; pPlayer->curr_weapon = MOTORCYCLE_WEAPON;
pPlayer->gotweapon |= (1 << MOTORCYCLE_WEAPON); pPlayer->gotweapon.Set(MOTORCYCLE_WEAPON);
pPlayer->vel.x = 0; pPlayer->vel.x = 0;
pPlayer->vel.y = 0; pPlayer->vel.y = 0;
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
@ -253,7 +253,7 @@ void G_OffMotorcycle(DukePlayer_t *pPlayer)
if (!A_CheckSoundPlaying(pPlayer->i,42)) if (!A_CheckSoundPlaying(pPlayer->i,42))
A_PlaySound(42, pPlayer->i); A_PlaySound(42, pPlayer->i);
pPlayer->on_motorcycle = 0; pPlayer->on_motorcycle = 0;
pPlayer->gotweapon &= ~(1<<MOTORCYCLE_WEAPON); pPlayer->gotweapon.Clear(MOTORCYCLE_WEAPON);
pPlayer->curr_weapon = pPlayer->last_full_weapon; pPlayer->curr_weapon = pPlayer->last_full_weapon;
P_CheckWeapon(pPlayer); P_CheckWeapon(pPlayer);
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
@ -293,7 +293,7 @@ void G_OnBoat(DukePlayer_t *pPlayer, int spriteNum)
pPlayer->on_boat = 1; pPlayer->on_boat = 1;
pPlayer->last_full_weapon = pPlayer->curr_weapon; pPlayer->last_full_weapon = pPlayer->curr_weapon;
pPlayer->curr_weapon = BOAT_WEAPON; pPlayer->curr_weapon = BOAT_WEAPON;
pPlayer->gotweapon |= (1<<BOAT_WEAPON); pPlayer->gotweapon.Set(BOAT_WEAPON);
pPlayer->vel.x = 0; pPlayer->vel.x = 0;
pPlayer->vel.y = 0; pPlayer->vel.y = 0;
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
@ -306,7 +306,7 @@ void G_OffBoat(DukePlayer_t *pPlayer)
if (pPlayer->on_boat) if (pPlayer->on_boat)
{ {
pPlayer->on_boat = 0; pPlayer->on_boat = 0;
pPlayer->gotweapon &= ~(1<<BOAT_WEAPON); pPlayer->gotweapon.Clear(BOAT_WEAPON);
pPlayer->curr_weapon = pPlayer->last_full_weapon; pPlayer->curr_weapon = pPlayer->last_full_weapon;
P_CheckWeapon(pPlayer); P_CheckWeapon(pPlayer);
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
@ -6935,7 +6935,6 @@ void app_loop();
// TODO: reorder (net)actor_t to eliminate slop and update assertion // TODO: reorder (net)actor_t to eliminate slop and update assertion
EDUKE32_STATIC_ASSERT(sizeof(actor_t)%4 == 0); EDUKE32_STATIC_ASSERT(sizeof(actor_t)%4 == 0);
EDUKE32_STATIC_ASSERT(sizeof(DukePlayer_t)%4 == 0);
static const char* actions[] = { static const char* actions[] = {
"Move_Forward", "Move_Forward",

View file

@ -1028,19 +1028,19 @@ void G_DoGameStartup(const int32_t *params)
g_bouncemineRadius = params[j++]; g_bouncemineRadius = params[j++];
g_seenineRadius = params[j++]; g_seenineRadius = params[j++];
g_player[0].ps->max_ammo_amount[1] = params[j++]; max_ammo_amount[1] = g_player[0].ps->max_ammo_amount[1] = params[j++];
g_player[0].ps->max_ammo_amount[2] = params[j++]; max_ammo_amount[2] = g_player[0].ps->max_ammo_amount[2] = params[j++];
g_player[0].ps->max_ammo_amount[3] = params[j++]; max_ammo_amount[3] = g_player[0].ps->max_ammo_amount[3] = params[j++];
g_player[0].ps->max_ammo_amount[4] = params[j++]; max_ammo_amount[4] = g_player[0].ps->max_ammo_amount[4] = params[j++];
g_player[0].ps->max_ammo_amount[5] = params[j++]; max_ammo_amount[5] = g_player[0].ps->max_ammo_amount[5] = params[j++];
g_player[0].ps->max_ammo_amount[6] = params[j++]; max_ammo_amount[6] = g_player[0].ps->max_ammo_amount[6] = params[j++];
g_player[0].ps->max_ammo_amount[7] = params[j++]; max_ammo_amount[7] = g_player[0].ps->max_ammo_amount[7] = params[j++];
g_player[0].ps->max_ammo_amount[8] = params[j++]; max_ammo_amount[8] = g_player[0].ps->max_ammo_amount[8] = params[j++];
g_player[0].ps->max_ammo_amount[9] = params[j++]; max_ammo_amount[9] = g_player[0].ps->max_ammo_amount[9] = params[j++];
g_player[0].ps->max_ammo_amount[11] = params[j++]; max_ammo_amount[11] = g_player[0].ps->max_ammo_amount[11] = params[j++];
if (RR) if (RR)
g_player[0].ps->max_ammo_amount[12] = params[j++]; max_ammo_amount[12] = g_player[0].ps->max_ammo_amount[12] = params[j++];
g_damageCameras = params[j++]; g_damageCameras = params[j++];
g_numFreezeBounces = params[j++]; g_numFreezeBounces = params[j++];
@ -1050,9 +1050,9 @@ void G_DoGameStartup(const int32_t *params)
if (RRRA) if (RRRA)
{ {
g_player[0].ps->max_ammo_amount[13] = params[j++]; max_ammo_amount[13] = g_player[0].ps->max_ammo_amount[13] = params[j++];
g_player[0].ps->max_ammo_amount[14] = params[j++]; max_ammo_amount[14] = g_player[0].ps->max_ammo_amount[14] = params[j++];
g_player[0].ps->max_ammo_amount[16] = params[j++]; max_ammo_amount[16] = g_player[0].ps->max_ammo_amount[16] = params[j++];
} }
} }

View file

@ -879,7 +879,7 @@ static void VM_AddWeapon(DukePlayer_t * const pPlayer, int const weaponNum, int
return; return;
} }
if ((pPlayer->gotweapon & (1 << weaponNum)) == 0) if ((pPlayer->gotweapon[weaponNum]) == 0)
{ {
P_AddWeapon(pPlayer, weaponNum); P_AddWeapon(pPlayer, weaponNum);
} }
@ -891,7 +891,7 @@ static void VM_AddWeapon(DukePlayer_t * const pPlayer, int const weaponNum, int
P_AddAmmo(pPlayer, weaponNum, nAmount); P_AddAmmo(pPlayer, weaponNum, nAmount);
if (pPlayer->curr_weapon == KNEE_WEAPON && (pPlayer->gotweapon & (1<<weaponNum))) if (pPlayer->curr_weapon == KNEE_WEAPON && (pPlayer->gotweapon[weaponNum]))
P_AddWeapon(pPlayer, weaponNum); P_AddWeapon(pPlayer, weaponNum);
} }
@ -911,7 +911,7 @@ static void VM_AddAmmo(DukePlayer_t * const pPlayer, int const weaponNum, int co
P_AddAmmo(pPlayer, weaponNum, nAmount); P_AddAmmo(pPlayer, weaponNum, nAmount);
if (pPlayer->curr_weapon == KNEE_WEAPON && (pPlayer->gotweapon & (1<<weaponNum))) if (pPlayer->curr_weapon == KNEE_WEAPON && (pPlayer->gotweapon[weaponNum]))
P_AddWeapon(pPlayer, weaponNum); P_AddWeapon(pPlayer, weaponNum);
} }

View file

@ -2921,47 +2921,6 @@ void freehashnames(void)
} }
#endif #endif
static struct dynitem g_dynWeaponList[] =
{
{ "KNEE_WEAPON", DVPTR(KNEE_WEAPON), KNEE_WEAPON__STATIC, KNEE_WEAPON__STATIC },
{ "PISTOL_WEAPON", DVPTR(PISTOL_WEAPON), PISTOL_WEAPON__STATIC, PISTOL_WEAPON__STATIC },
{ "SHOTGUN_WEAPON", DVPTR(SHOTGUN_WEAPON), SHOTGUN_WEAPON__STATIC, SHOTGUN_WEAPON__STATIC },
{ "CHAINGUN_WEAPON", DVPTR(CHAINGUN_WEAPON), CHAINGUN_WEAPON__STATIC, CHAINGUN_WEAPON__STATIC },
{ "RPG_WEAPON", DVPTR(RPG_WEAPON), RPG_WEAPON__STATIC, HANDBOMB_WEAPON__STATIC },
{ "HANDBOMB_WEAPON", DVPTR(HANDBOMB_WEAPON), HANDBOMB_WEAPON__STATIC, RPG_WEAPON__STATIC },
{ "SHRINKER_WEAPON", DVPTR(SHRINKER_WEAPON), SHRINKER_WEAPON__STATIC, SHRINKER_WEAPON__STATIC },
{ "DEVISTATOR_WEAPON", DVPTR(DEVISTATOR_WEAPON), DEVISTATOR_WEAPON__STATIC, FREEZE_WEAPON__STATIC },
{ "TRIPBOMB_WEAPON", DVPTR(TRIPBOMB_WEAPON), TRIPBOMB_WEAPON__STATIC, TRIPBOMB_WEAPON__STATIC },
{ "FREEZE_WEAPON", DVPTR(FREEZE_WEAPON), FREEZE_WEAPON__STATIC, DEVISTATOR_WEAPON__STATIC },
{ "HANDREMOTE_WEAPON", DVPTR(HANDREMOTE_WEAPON), HANDREMOTE_WEAPON__STATIC, HANDREMOTE_WEAPON__STATIC },
{ "GROW_WEAPON", DVPTR(GROW_WEAPON), GROW_WEAPON__STATIC, GROW_WEAPON__STATIC },
{ "BOWLINGBALL_WEAPON", DVPTR(BOWLINGBALL_WEAPON), BOWLINGBALL_WEAPON__STATIC, BOWLINGBALL_WEAPON__STATIC },
{ "MOTORCYCLE_WEAPON", DVPTR(MOTORCYCLE_WEAPON), MOTORCYCLE_WEAPON__STATIC, MOTORCYCLE_WEAPON__STATIC },
{ "BOAT_WEAPON", DVPTR(BOAT_WEAPON), BOAT_WEAPON__STATIC, BOAT_WEAPON__STATIC },
{ "SLINGBLADE_WEAPON", DVPTR(SLINGBLADE_WEAPON), SLINGBLADE_WEAPON__STATIC, SLINGBLADE_WEAPON__STATIC },
{ "CHICKEN_WEAPON", DVPTR(CHICKEN_WEAPON), CHICKEN_WEAPON__STATIC, CHICKEN_WEAPON__STATIC },
{ NULL, NULL, -1, -1 },
};
int32_t KNEE_WEAPON = KNEE_WEAPON__STATIC;
int32_t PISTOL_WEAPON = PISTOL_WEAPON__STATIC;
int32_t SHOTGUN_WEAPON = SHOTGUN_WEAPON__STATIC;
int32_t CHAINGUN_WEAPON = CHAINGUN_WEAPON__STATIC;
int32_t RPG_WEAPON = RPG_WEAPON__STATIC;
int32_t HANDBOMB_WEAPON = HANDBOMB_WEAPON__STATIC;
int32_t SHRINKER_WEAPON = SHRINKER_WEAPON__STATIC;
int32_t DEVISTATOR_WEAPON = DEVISTATOR_WEAPON__STATIC;
int32_t TRIPBOMB_WEAPON = TRIPBOMB_WEAPON__STATIC;
int32_t FREEZE_WEAPON = FREEZE_WEAPON__STATIC;
int32_t HANDREMOTE_WEAPON = HANDREMOTE_WEAPON__STATIC;
int32_t GROW_WEAPON = GROW_WEAPON__STATIC;
int32_t BOWLINGBALL_WEAPON = BOWLINGBALL_WEAPON__STATIC;
int32_t MOTORCYCLE_WEAPON = MOTORCYCLE_WEAPON__STATIC;
int32_t BOAT_WEAPON = BOAT_WEAPON__STATIC;
int32_t SLINGBLADE_WEAPON = SLINGBLADE_WEAPON__STATIC;
int32_t CHICKEN_WEAPON = CHICKEN_WEAPON__STATIC;
// This is run after all CON define's have been processed to set up the // This is run after all CON define's have been processed to set up the
// dynamic->static tile mapping. // dynamic->static tile mapping.
void G_InitDynamicTiles(void) void G_InitDynamicTiles(void)
@ -2978,9 +2937,6 @@ void G_InitDynamicTiles(void)
DynamicTileMap[*(g_dynTileList[i].dynvalptr)] = g_dynTileList[i].staticval_rr; DynamicTileMap[*(g_dynTileList[i].dynvalptr)] = g_dynTileList[i].staticval_rr;
NameToTileIndex.Insert(g_dynTileList[i].str, *(g_dynTileList[i].dynvalptr)); NameToTileIndex.Insert(g_dynTileList[i].str, *(g_dynTileList[i].dynvalptr));
} }
for (i = 0; g_dynWeaponList[i].staticval >= 0; i++)
*(g_dynWeaponList[i].dynvalptr) = g_dynWeaponList[i].staticval_rr;
PHEIGHT = PHEIGHT_RR; PHEIGHT = PHEIGHT_RR;
} }
@ -2991,9 +2947,6 @@ void G_InitDynamicTiles(void)
NameToTileIndex.Insert(g_dynTileList[i].str, *(g_dynTileList[i].dynvalptr)); NameToTileIndex.Insert(g_dynTileList[i].str, *(g_dynTileList[i].dynvalptr));
} }
for (i=0; g_dynWeaponList[i].staticval >= 0; i++)
DynamicWeaponMap[*(g_dynWeaponList[i].dynvalptr)] = g_dynWeaponList[i].staticval;
DynamicTileMap[0] = 0; DynamicTileMap[0] = 0;
g_blimpSpawnItems[0] = TILE_RPGSPRITE; g_blimpSpawnItems[0] = TILE_RPGSPRITE;

View file

@ -3571,25 +3571,28 @@ enum dukeweapon_t
MAX_WEAPONS MAX_WEAPONS
}; };
extern int16_t DynamicWeaponMap[MAX_WEAPONS]; enum dukeweapon_t_alt
{
KNEE_WEAPON, // 0
PISTOL_WEAPON,
SHOTGUN_WEAPON,
CHAINGUN_WEAPON,
RPG_WEAPON,
HANDBOMB_WEAPON, // 5
SHRINKER_WEAPON,
DEVISTATOR_WEAPON,
TRIPBOMB_WEAPON,
FREEZE_WEAPON,
HANDREMOTE_WEAPON, // 10
GROW_WEAPON,
BOWLINGBALL_WEAPON,
MOTORCYCLE_WEAPON,
BOAT_WEAPON,
SLINGBLADE_WEAPON, // 15
CHICKEN_WEAPON,
};
extern int32_t KNEE_WEAPON; extern int16_t DynamicWeaponMap[MAX_WEAPONS];
extern int32_t PISTOL_WEAPON;
extern int32_t SHOTGUN_WEAPON;
extern int32_t CHAINGUN_WEAPON;
extern int32_t RPG_WEAPON;
extern int32_t HANDBOMB_WEAPON;
extern int32_t SHRINKER_WEAPON;
extern int32_t DEVISTATOR_WEAPON;
extern int32_t TRIPBOMB_WEAPON;
extern int32_t FREEZE_WEAPON;
extern int32_t HANDREMOTE_WEAPON;
extern int32_t GROW_WEAPON;
extern int32_t BOWLINGBALL_WEAPON;
extern int32_t MOTORCYCLE_WEAPON;
extern int32_t BOAT_WEAPON;
extern int32_t SLINGBLADE_WEAPON;
extern int32_t CHICKEN_WEAPON;
#define DYNAMICWEAPONMAP(Weaponnum) (DynamicWeaponMap[Weaponnum]) #define DYNAMICWEAPONMAP(Weaponnum) (DynamicWeaponMap[Weaponnum])

View file

@ -4605,7 +4605,7 @@ void P_DropWeapon(int const playerNum)
sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang); sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang);
sprite[newSprite].owner = pPlayer->ammo_amount[MOTORCYCLE_WEAPON]; sprite[newSprite].owner = pPlayer->ammo_amount[MOTORCYCLE_WEAPON];
pPlayer->on_motorcycle = 0; pPlayer->on_motorcycle = 0;
pPlayer->gotweapon &= ~(1<<MOTORCYCLE_WEAPON); pPlayer->gotweapon.Clear(MOTORCYCLE_WEAPON);
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
pPlayer->moto_do_bump = 0; pPlayer->moto_do_bump = 0;
pPlayer->moto_speed = 0; pPlayer->moto_speed = 0;
@ -4621,7 +4621,7 @@ void P_DropWeapon(int const playerNum)
sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang); sprite[newSprite].ang = fix16_to_int(pPlayer->q16ang);
sprite[newSprite].owner = pPlayer->ammo_amount[BOAT_WEAPON]; sprite[newSprite].owner = pPlayer->ammo_amount[BOAT_WEAPON];
pPlayer->on_boat = 0; pPlayer->on_boat = 0;
pPlayer->gotweapon &= ~(1<<BOAT_WEAPON); pPlayer->gotweapon.Clear(BOAT_WEAPON);
pPlayer->q16horiz = F16(100); pPlayer->q16horiz = F16(100);
pPlayer->moto_do_bump = 0; pPlayer->moto_do_bump = 0;
pPlayer->moto_speed = 0; pPlayer->moto_speed = 0;
@ -4689,34 +4689,34 @@ void P_AddWeapon(DukePlayer_t *pPlayer, int weaponNum)
if (pPlayer->on_motorcycle || pPlayer->on_boat) if (pPlayer->on_motorcycle || pPlayer->on_boat)
{ {
pPlayer->gotweapon |= (1<<weaponNum); pPlayer->gotweapon.Set(weaponNum);
if (weaponNum == SHRINKER_WEAPON) if (weaponNum == SHRINKER_WEAPON)
{ {
pPlayer->gotweapon |= (1<<GROW_WEAPON); pPlayer->gotweapon.Set(GROW_WEAPON);
pPlayer->ammo_amount[GROW_WEAPON] = 1; pPlayer->ammo_amount[GROW_WEAPON] = 1;
} }
else if (weaponNum == RPG_WEAPON) else if (weaponNum == RPG_WEAPON)
pPlayer->gotweapon |= (1<<CHICKEN_WEAPON); pPlayer->gotweapon.Set(CHICKEN_WEAPON);
else if (weaponNum == SLINGBLADE_WEAPON) else if (weaponNum == SLINGBLADE_WEAPON)
pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1; pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1;
return; return;
} }
if ((pPlayer->gotweapon & (1<<weaponNum)) == 0) if ((pPlayer->gotweapon[weaponNum]) == 0)
{ {
pPlayer->gotweapon |= (1<<weaponNum); pPlayer->gotweapon.Set(weaponNum);
if (weaponNum == SHRINKER_WEAPON) if (weaponNum == SHRINKER_WEAPON)
{ {
pPlayer->gotweapon |= (1<<GROW_WEAPON); pPlayer->gotweapon.Set(GROW_WEAPON);
if (RR) if (RR)
pPlayer->ammo_amount[GROW_WEAPON] = 1; pPlayer->ammo_amount[GROW_WEAPON] = 1;
} }
if (RRRA) if (RRRA)
{ {
if (weaponNum == RPG_WEAPON) if (weaponNum == RPG_WEAPON)
pPlayer->gotweapon |= (1<<CHICKEN_WEAPON); pPlayer->gotweapon.Set(CHICKEN_WEAPON);
else if (weaponNum == SLINGBLADE_WEAPON) else if (weaponNum == SLINGBLADE_WEAPON)
pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 50; pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 50;
} }
@ -4796,7 +4796,7 @@ void P_CheckWeapon(DukePlayer_t *pPlayer)
if (weaponNum == pPlayer->curr_weapon) if (weaponNum == pPlayer->curr_weapon)
return; return;
if ((pPlayer->gotweapon & (1<<weaponNum)) && pPlayer->ammo_amount[weaponNum] > 0) if ((pPlayer->gotweapon[weaponNum]) && pPlayer->ammo_amount[weaponNum] > 0)
{ {
P_AddWeapon(pPlayer, weaponNum); P_AddWeapon(pPlayer, weaponNum);
return; return;
@ -4805,7 +4805,7 @@ void P_CheckWeapon(DukePlayer_t *pPlayer)
weaponNum = pPlayer->curr_weapon; weaponNum = pPlayer->curr_weapon;
if ((pPlayer->gotweapon & (1<<weaponNum)) && pPlayer->ammo_amount[weaponNum] > 0) if ((pPlayer->gotweapon[weaponNum]) && pPlayer->ammo_amount[weaponNum] > 0)
return; return;
playerNum = P_Get(pPlayer->i); playerNum = P_Get(pPlayer->i);
@ -4822,7 +4822,7 @@ void P_CheckWeapon(DukePlayer_t *pPlayer)
weaponNum = RR ? DEVISTATOR_WEAPON : FREEZE_WEAPON; weaponNum = RR ? DEVISTATOR_WEAPON : FREEZE_WEAPON;
else weaponNum--; else weaponNum--;
if (weaponNum == KNEE_WEAPON || ((pPlayer->gotweapon & (1<<weaponNum)) && pPlayer->ammo_amount[weaponNum] > 0)) if (weaponNum == KNEE_WEAPON || ((pPlayer->gotweapon[weaponNum]) && pPlayer->ammo_amount[weaponNum] > 0))
break; break;
} }
@ -5922,7 +5922,7 @@ static void P_ProcessWeapon(int playerNum)
if (playerNum == screenpeek) if (playerNum == screenpeek)
pus = 1; pus = 1;
pPlayer->ammo_amount[TRIPBOMB_WEAPON]--; pPlayer->ammo_amount[TRIPBOMB_WEAPON]--;
pPlayer->gotweapon &= ~(1<<TRIPBOMB_WEAPON); pPlayer->gotweapon.Clear(TRIPBOMB_WEAPON);
if (pPlayer->on_ground && TEST_SYNC_KEY(playerBits, SK_CROUCH) && (!RRRA || !pPlayer->on_motorcycle)) if (pPlayer->on_ground && TEST_SYNC_KEY(playerBits, SK_CROUCH) && (!RRRA || !pPlayer->on_motorcycle))
{ {
FwdVel = 15; FwdVel = 15;
@ -5963,7 +5963,7 @@ static void P_ProcessWeapon(int playerNum)
if ((*weaponFrame) > 40) if ((*weaponFrame) > 40)
{ {
(*weaponFrame) = 0; (*weaponFrame) = 0;
pPlayer->gotweapon &= ~(1 << BOWLINGBALL_WEAPON); pPlayer->gotweapon.Clear(BOWLINGBALL_WEAPON);
P_CheckWeapon(pPlayer); P_CheckWeapon(pPlayer);
} }
break; break;
@ -9418,4 +9418,6 @@ int P_HasKey(int sectNum, int playerNum)
return 0; return 0;
} }
int16_t max_ammo_amount[MAX_WEAPONS];
END_DUKE_NS END_DUKE_NS

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "namesdyn.h" #include "namesdyn.h"
#include "fix16.h" #include "fix16.h"
#include "net.h" #include "net.h"
#include "tarray.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS
@ -114,7 +115,7 @@ typedef struct {
int16_t got_access, last_extra, inv_amount[GET_MAX], curr_weapon, holoduke_on; int16_t got_access, last_extra, inv_amount[GET_MAX], curr_weapon, holoduke_on;
int16_t last_weapon, weapon_pos, kickback_pic; int16_t last_weapon, weapon_pos, kickback_pic;
int16_t ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS]; int16_t ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS];
uint32_t gotweapon; FixedBitArray<MAX_WEAPONS> gotweapon;
char inven_icon, jetpack_on, heat_on; char inven_icon, jetpack_on, heat_on;
} DukeStatus_t; } DukeStatus_t;
@ -133,7 +134,7 @@ typedef struct {
// Need to carefully think about implications! // Need to carefully think about implications!
// TODO: rearrange this if the opportunity arises! // TODO: rearrange this if the opportunity arises!
// KEEPINSYNC lunatic/_defs_game.lua // KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct player_struct {
vec3_t pos, opos, vel, npos; vec3_t pos, opos, vel, npos;
vec2_t bobpos, fric; vec2_t bobpos, fric;
@ -147,7 +148,7 @@ typedef struct {
uint32_t interface_toggle_flag; uint32_t interface_toggle_flag;
uint16_t max_actors_killed, actors_killed; uint16_t max_actors_killed, actors_killed;
uint32_t gotweapon; FixedBitArray<MAX_WEAPONS> gotweapon;
uint16_t zoom; uint16_t zoom;
int16_t loogiex[64], loogiey[64], sbs, sound_pitch; int16_t loogiex[64], loogiey[64], sbs, sound_pitch;
@ -381,6 +382,7 @@ static inline int P_GetP(const void *pSprite)
// Get the player index given an TILE_APLAYER sprite index. // Get the player index given an TILE_APLAYER sprite index.
static inline int P_Get(int32_t spriteNum) { return P_GetP((const uspritetype *)&sprite[spriteNum]); } static inline int P_Get(int32_t spriteNum) { return P_GetP((const uspritetype *)&sprite[spriteNum]); }
extern int16_t max_ammo_amount[MAX_WEAPONS];
END_DUKE_NS END_DUKE_NS

View file

@ -973,7 +973,7 @@ void P_ResetStatus(int playerNum)
if (pPlayer->on_motorcycle) if (pPlayer->on_motorcycle)
{ {
pPlayer->on_motorcycle = 0; pPlayer->on_motorcycle = 0;
pPlayer->gotweapon &= ~(1 << MOTORCYCLE_WEAPON); pPlayer->gotweapon.Clear(MOTORCYCLE_WEAPON);
pPlayer->curr_weapon = SLINGBLADE_WEAPON; pPlayer->curr_weapon = SLINGBLADE_WEAPON;
} }
pPlayer->lotag800kill = 0; pPlayer->lotag800kill = 0;
@ -992,7 +992,7 @@ void P_ResetStatus(int playerNum)
if (pPlayer->on_boat) if (pPlayer->on_boat)
{ {
pPlayer->on_boat = 0; pPlayer->on_boat = 0;
pPlayer->gotweapon &= ~(1 << BOAT_WEAPON); pPlayer->gotweapon.Clear(BOAT_WEAPON);
pPlayer->curr_weapon = SLINGBLADE_WEAPON; pPlayer->curr_weapon = SLINGBLADE_WEAPON;
} }
pPlayer->not_on_water = 0; pPlayer->not_on_water = 0;
@ -1030,12 +1030,15 @@ void P_ResetWeapons(int playerNum)
pPlayer->weapon_pos = WEAPON_POS_START; pPlayer->weapon_pos = WEAPON_POS_START;
pPlayer->curr_weapon = PISTOL_WEAPON; pPlayer->curr_weapon = PISTOL_WEAPON;
pPlayer->kickback_pic = 5; pPlayer->kickback_pic = 5;
pPlayer->gotweapon = ((1 << PISTOL_WEAPON) | (1 << KNEE_WEAPON) | (1 << HANDREMOTE_WEAPON)); pPlayer->gotweapon.Zero();
pPlayer->gotweapon.Set(PISTOL_WEAPON);
pPlayer->gotweapon.Set(KNEE_WEAPON);
pPlayer->gotweapon.Set(HANDREMOTE_WEAPON);
pPlayer->ammo_amount[PISTOL_WEAPON] = min<int16_t>(pPlayer->max_ammo_amount[PISTOL_WEAPON], 48); pPlayer->ammo_amount[PISTOL_WEAPON] = min<int16_t>(pPlayer->max_ammo_amount[PISTOL_WEAPON], 48);
if (RRRA) if (RRRA)
{ {
g_chickenWeaponTimer = 0; g_chickenWeaponTimer = 0;
pPlayer->gotweapon |= (1 << SLINGBLADE_WEAPON); pPlayer->gotweapon.Set(SLINGBLADE_WEAPON);
pPlayer->ammo_amount[KNEE_WEAPON] = 1; pPlayer->ammo_amount[KNEE_WEAPON] = 1;
pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1; pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1;
pPlayer->on_motorcycle = 0; pPlayer->on_motorcycle = 0;
@ -1974,12 +1977,12 @@ end_vol4a:
if (worksLike == PISTOL_WEAPON) if (worksLike == PISTOL_WEAPON)
{ {
pPlayer->curr_weapon = weaponNum; pPlayer->curr_weapon = weaponNum;
pPlayer->gotweapon |= (1 << weaponNum); pPlayer->gotweapon.Set(weaponNum);
pPlayer->ammo_amount[weaponNum] = min<int16_t>(pPlayer->max_ammo_amount[weaponNum], 48); pPlayer->ammo_amount[weaponNum] = min<int16_t>(pPlayer->max_ammo_amount[weaponNum], 48);
} }
else if (worksLike == KNEE_WEAPON || (!RR && worksLike == HANDREMOTE_WEAPON) || (RRRA && worksLike == SLINGBLADE_WEAPON)) else if (worksLike == KNEE_WEAPON || (!RR && worksLike == HANDREMOTE_WEAPON) || (RRRA && worksLike == SLINGBLADE_WEAPON))
{ {
pPlayer->gotweapon |= (1 << weaponNum); pPlayer->gotweapon.Set(weaponNum);
if (RRRA) if (RRRA)
pPlayer->ammo_amount[KNEE_WEAPON] = 1; pPlayer->ammo_amount[KNEE_WEAPON] = 1;
} }
@ -2363,7 +2366,7 @@ int G_EnterLevel(int gameMode)
{ {
for (bssize_t i = PISTOL_WEAPON; i < MAX_WEAPONS; i++) for (bssize_t i = PISTOL_WEAPON; i < MAX_WEAPONS; i++)
g_player[0].ps->ammo_amount[i] = 0; g_player[0].ps->ammo_amount[i] = 0;
g_player[0].ps->gotweapon &= (1<<KNEE_WEAPON); g_player[0].ps->gotweapon.Clear(KNEE_WEAPON);
} }
pPlayer->q16ang = fix16_from_int(lbang); pPlayer->q16ang = fix16_from_int(lbang);
@ -2380,8 +2383,8 @@ int G_EnterLevel(int gameMode)
{ {
for (bssize_t i = PISTOL_WEAPON; i < MAX_WEAPONS; i++) for (bssize_t i = PISTOL_WEAPON; i < MAX_WEAPONS; i++)
g_player[0].ps->ammo_amount[i] = 0; g_player[0].ps->ammo_amount[i] = 0;
g_player[0].ps->gotweapon &= (1<<KNEE_WEAPON); g_player[0].ps->gotweapon.Clear(KNEE_WEAPON);
g_player[0].ps->gotweapon |= (1<<SLINGBLADE_WEAPON); g_player[0].ps->gotweapon.Set(SLINGBLADE_WEAPON);
g_player[0].ps->ammo_amount[SLINGBLADE_WEAPON] = 1; g_player[0].ps->ammo_amount[SLINGBLADE_WEAPON] = 1;
g_player[0].ps->curr_weapon = SLINGBLADE_WEAPON; g_player[0].ps->curr_weapon = SLINGBLADE_WEAPON;
} }
@ -2440,7 +2443,7 @@ int G_EnterLevel(int gameMode)
P_ResetWeapons(i); P_ResetWeapons(i);
P_ResetInventory(i); P_ResetInventory(i);
g_player[i].ps->gotweapon &= ~(1 << PISTOL_WEAPON); g_player[i].ps->gotweapon.Clear(PISTOL_WEAPON);
g_player[i].ps->ammo_amount[PISTOL_WEAPON] = 0; g_player[i].ps->ammo_amount[PISTOL_WEAPON] = 0;
g_player[i].ps->curr_weapon = KNEE_WEAPON; g_player[i].ps->curr_weapon = KNEE_WEAPON;

View file

@ -690,7 +690,7 @@ public:
auto ShadeForWeapon = [=](int weapon, int optweapon = -1) auto ShadeForWeapon = [=](int weapon, int optweapon = -1)
{ {
// Headache-inducing math at play here. // Headache-inducing math at play here.
return (((!p->ammo_amount[weapon]) | ((p->gotweapon & (1 << weapon)) == 0)) * 9) + 12 - 18 * ((cw == weapon) || (optweapon != -1 && cw == optweapon)); return (((!p->ammo_amount[weapon]) | ((p->gotweapon[weapon]) == 0)) * 9) + 12 - 18 * ((cw == weapon) || (optweapon != -1 && cw == optweapon));
}; };
DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], p->max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3); DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], p->max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3);
@ -792,7 +792,7 @@ public:
} }
else else
{ {
if (p->gotweapon & (1 << (i + 1))) { if (p->gotweapon[i+1]) {
DrawGraphic(tileGetTexture(TILE_AMMO_ICON + i), 18 + i * 32, top - 6, DI_ITEM_OFFSETS, 1, 0, 0, sbscale, sbscale); DrawGraphic(tileGetTexture(TILE_AMMO_ICON + i), 18 + i * 32, top - 6, DI_ITEM_OFFSETS, 1, 0, 0, sbscale, sbscale);
} }
format.Format("%d", p->ammo_amount[i+1]); format.Format("%d", p->ammo_amount[i+1]);

View file

@ -3844,7 +3844,7 @@ CHECKINV1:
if (currentWeapon == -1) currentWeapon = FREEZE_WEAPON; if (currentWeapon == -1) currentWeapon = FREEZE_WEAPON;
else if (currentWeapon == 10) currentWeapon = KNEE_WEAPON; else if (currentWeapon == 10) currentWeapon = KNEE_WEAPON;
if ((pPlayer->gotweapon & (1<<currentWeapon)) && pPlayer->ammo_amount[currentWeapon] > 0) if ((pPlayer->gotweapon[currentWeapon]) && pPlayer->ammo_amount[currentWeapon] > 0)
{ {
if (!RR && currentWeapon == SHRINKER_WEAPON && pPlayer->subweapon&(1<<GROW_WEAPON)) if (!RR && currentWeapon == SHRINKER_WEAPON && pPlayer->subweapon&(1<<GROW_WEAPON))
currentWeapon = GROW_WEAPON; currentWeapon = GROW_WEAPON;
@ -3852,14 +3852,14 @@ CHECKINV1:
break; break;
} }
else if (!RR && currentWeapon == GROW_WEAPON && pPlayer->ammo_amount[GROW_WEAPON] == 0 else if (!RR && currentWeapon == GROW_WEAPON && pPlayer->ammo_amount[GROW_WEAPON] == 0
&& (pPlayer->gotweapon & (1<<SHRINKER_WEAPON)) && pPlayer->ammo_amount[SHRINKER_WEAPON] > 0) && (pPlayer->gotweapon[SHRINKER_WEAPON]) && pPlayer->ammo_amount[SHRINKER_WEAPON] > 0)
{ {
weaponNum = SHRINKER_WEAPON; weaponNum = SHRINKER_WEAPON;
pPlayer->subweapon &= ~(1<<GROW_WEAPON); pPlayer->subweapon &= ~(1<<GROW_WEAPON);
break; break;
} }
else if (!RR && currentWeapon == SHRINKER_WEAPON && pPlayer->ammo_amount[SHRINKER_WEAPON] == 0 else if (!RR && currentWeapon == SHRINKER_WEAPON && pPlayer->ammo_amount[SHRINKER_WEAPON] == 0
&& (pPlayer->gotweapon & (1<<SHRINKER_WEAPON)) && pPlayer->ammo_amount[GROW_WEAPON] > 0) && (pPlayer->gotweapon[SHRINKER_WEAPON]) && pPlayer->ammo_amount[GROW_WEAPON] > 0)
{ {
weaponNum = GROW_WEAPON; weaponNum = GROW_WEAPON;
pPlayer->subweapon |= (1<<GROW_WEAPON); pPlayer->subweapon |= (1<<GROW_WEAPON);
@ -3883,7 +3883,7 @@ CHECKINV1:
{ {
if (sprite[spriteNum].picnum == TILE_HEAVYHBOMB && sprite[spriteNum].owner == pPlayer->i) if (sprite[spriteNum].picnum == TILE_HEAVYHBOMB && sprite[spriteNum].owner == pPlayer->i)
{ {
pPlayer->gotweapon |= 1<<HANDREMOTE_WEAPON; pPlayer->gotweapon.Set(HANDREMOTE_WEAPON);
weaponNum = HANDREMOTE_WEAPON; weaponNum = HANDREMOTE_WEAPON;
break; break;
} }
@ -3992,7 +3992,7 @@ CHECKINV1:
playerBits |= BIT(SK_HOLSTER); playerBits |= BIT(SK_HOLSTER);
pPlayer->weapon_pos = WEAPON_POS_LOWER; pPlayer->weapon_pos = WEAPON_POS_LOWER;
} }
else if ((uint32_t)weaponNum < MAX_WEAPONS && (pPlayer->gotweapon & (1<<weaponNum)) && pPlayer->curr_weapon != weaponNum) else if ((uint32_t)weaponNum < MAX_WEAPONS && (pPlayer->gotweapon[weaponNum]) && pPlayer->curr_weapon != weaponNum)
switch (DYNAMICWEAPONMAP(weaponNum)) switch (DYNAMICWEAPONMAP(weaponNum))
{ {
case SLINGBLADE_WEAPON__STATIC: case SLINGBLADE_WEAPON__STATIC:
@ -4032,7 +4032,7 @@ rrtripbomb_case:
case HANDBOMB_WEAPON__STATIC: case HANDBOMB_WEAPON__STATIC:
case TRIPBOMB_WEAPON__STATIC: case TRIPBOMB_WEAPON__STATIC:
if (RR && weaponNum == TILE_TRIPBOMB) goto rrtripbomb_case; if (RR && weaponNum == TILE_TRIPBOMB) goto rrtripbomb_case;
if (pPlayer->ammo_amount[weaponNum] > 0 && (pPlayer->gotweapon & (1<<weaponNum))) if (pPlayer->ammo_amount[weaponNum] > 0 && (pPlayer->gotweapon[weaponNum]))
P_AddWeapon(pPlayer, weaponNum); P_AddWeapon(pPlayer, weaponNum);
break; break;
case MOTORCYCLE_WEAPON__STATIC: case MOTORCYCLE_WEAPON__STATIC:

View file

@ -51,6 +51,10 @@ enum esound_t
int A_CheckSoundPlaying(int spriteNum, int soundNum, int channel = 0); int A_CheckSoundPlaying(int spriteNum, int soundNum, int channel = 0);
int A_PlaySound(int soundNum, int spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0); int A_PlaySound(int soundNum, int spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0);
inline int spritesound(int soundnum, int spritenum)
{
return A_PlaySound(soundnum, spritenum);
}
int A_CheckAnySoundPlaying(int spriteNum); int A_CheckAnySoundPlaying(int spriteNum);
int S_CheckSoundPlaying(int soundNum); int S_CheckSoundPlaying(int soundNum);
inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPlaying(soundNum); } inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPlaying(soundNum); }

106
source/games/rr/actors.cpp Normal file
View file

@ -0,0 +1,106 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
Copyright (C) 2017-2019 - Nuke.YKT
Copyright (C) 2020 - Christoph Oelckers
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: EDuke source was in transition. Changes are in-progress in the
source as it is released.
This file is a combination of code from the following sources:
- EDuke 2 by Matt Saettler
- JFDuke by Jonathon Fowler (jf@jonof.id.au),
- DukeGDX and RedneckGDX by Alexander Makarov-[M210] (m210-2007@mail.ru)
- Redneck Rampage reconstructed source by Nuke.YKT
Note:
Most of this code follows DukeGDX and RedneckGDX because for Java it had
to undo all the macro hackery that make the Duke source extremely hard to read.
The other code bases were mainly used to add missing feature support (e.g. WW2GI)
and verify correctness.
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include "global.h"
#include "names.h"
BEGIN_RR_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool ceilingspace(int sectnum)
{
if ((sector[sectnum].ceilingstat & 1) && sector[sectnum].ceilingpal == 0)
{
switch (sector[sectnum].ceilingpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return true;
}
}
return false;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool floorspace(int sectnum)
{
if ((sector[sectnum].floorstat & 1) && sector[sectnum].ceilingpal == 0)
{
switch (sector[sectnum].floorpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return true;
}
}
return false;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool ifsquished(int i, int p)
{
return false; // this function is a no-op in RR's source.
}
END_RR_NS

430
source/games/rr/names.h Normal file
View file

@ -0,0 +1,430 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of 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
*/
//-------------------------------------------------------------------------
enum
{
GRID = 0,
SECTOREFFECTOR = 1,
ACTIVATOR = 2,
TOUCHPLATE = 3,
ACTIVATORLOCKED = 4,
MUSICANDSFX = 5,
LOCATORS = 6,
CYCLER = 7,
MASTERSWITCH = 8,
RESPAWN = 9,
GPSPEED = 10,
JAILDOOR = 11,
LNRDTAG = 15,
SIGN1 = 16,
SIGN2 = 17,
TORCH = 18,
FIRSTGUNSPRITE = 21,
RIFLESPRITE = 22,
CROSSBOWSPRITE = 23,
TEATGUN = 24,
BUZSAWSPRITE = 25,
DYNAMITE = 26,
POWDERKEGSPRITE = 27,
SHOTGUNSPRITE = 28,
ALIENARMGUN = 29,
HEALTHBOX = 30,
AMMOBOX = 31,
TEATAMMO = 32,
INVENTORYBOX = 33,
DOORKEYS = 34,
LIGHTNIN = 35,
DESTRUCTO = 36,
JAILSOUND = 38,
AMMO = 40,
RIFLEAMMO = 41,
ALIENBLASTERAMMO = 42,
BLADEAMMO = 43,
HBOMBAMMO = 47,
SHOTGUNAMMO = 49,
BEER = 51,
PORKBALLS = 52,
WHISKEY = 53,
MOONSHINE = 55,
SNORKLE = 56,
COWPIE = 57,
DOORKEY = 60,
BOOTS = 61,
MINECARTKILLER = 67,
SHADESECTOR = 68,
SOUNDFX = 71,
MULTISWITCH = 98,
DOORSHOCK = 120,
FLOORSLIME = 132,
BIGFORCE = 135,
SCREENBREAK6 = 164,
SCREENBREAK7 = 165,
SCREENBREAK8 = 166,
FANSPRITEWORK = 210,
FANSPRITE = 211,
FANSPRITEBROKE = 215,
GRATE1 = 234,
BGRATE1 = 235,
WATERDRIP = 239,
WATERBUBBLE = 240,
WATERBUBBLEMAKER = 241,
W_FORCEFIELD = 242,
LIGHTSWITCH2 = 250,
UFOBEAM = 252,
BOULDER = 256,
BOULDER1 = 264,
BOWLLINE = 280,
CHICKENA = 285,
CHICKENC = 286,
HEADCHK = 287,
FEATHERCHK = 288,
LOAF = 289,
NUGGETS = 290,
PACKEDCHK = 291,
BONELESSCHK = 292,
JIBSCHK = 293,
BIGFNTCURSOR = 512,
SMALLFNTCURSOR = 513,
STARTALPHANUM = 514,
ENDALPHANUM = 607,
BIGALPHANUM = 632,
BIGPERIOD = 694,
BIGCOMMA = 695,
BIGX = 696,
BIGQ = 697,
BIGSEMI = 698,
BIGCOLIN = 699,
THREEBYFIVE = 702,
BIGAPPOS = 714,
MINIFONT = 718,
RESPAWNMARKERRED = 866,
MOONSKY1 = 1022,
MOONSKY2 = 1023,
MOONSKY3 = 1024,
MOONSKY4 = 1025,
BIGORBIT1 = 1026,
BIGORBIT2 = 1027,
BIGORBIT3 = 1028,
BIGORBIT4 = 1029,
BIGORBIT5 =1030,
WATERTILE2 = 1045,
GLASS = 1056,
GLASS2 = 1057,
CRACK1 = 1075,
CRACK2 = 1076,
CRACK3 = 1077,
CRACK4 = 1078,
FOOTPRINTS = 1079,
MIRROR = 1089,
WATERFOUNTAIN = 1092,
REACTOR = 1107,
REACTORBURNT = 1108,
REACTORSPARK = 1109,
BOLT1 = 1127,
CAMERA1 = 1134,
FOOTPRINTS2 = 1144,
FOOTPRINTS3 = 1145,
FOOTPRINTS4 = 1146,
SLIME = 1161,
QUEBALL = 1184,
STRIPEBALL = 1185,
POCKET = 1186,
NEON1 = 1200,
NEON2 = 1201,
BOUNCEMINE = 1204,
BULLETHOLE = 1212,
TIRE = 1230,
NEON3 = 1241,
NEON4 = 1242,
NEON5 = 1243,
GLASSPIECES = 1256,
NEON6 = 1264,
OOZFILTER = 1273,
FLOORPLASMA = 1276,
BOTTLE12 = 1282,
BOTTLE13 = 1283,
BOTTLE14 = 1284,
BOTTLE15 = 1285,
BOTTLE16 = 1286,
BOTTLE17 = 1287,
BOTTLE18 = 1288,
VENDMACHINE = 1291,
VENDMACHINEBROKE = 1293,
COLAMACHINE = 1294,
COLAMACHINEBROKE = 1296,
CRANE = 1299,
BLOODPOOL = 1303,
CANWITHSOMETHING = 1309,
FEATHERS = 1310,
BANNER = 1313,
SEENINE = 1324,
SEENINEDEAD = 1325,
STEAM = 1327,
CEILINGSTEAM = 1332,
TRANSPORTERBEAM = 1338,
RAT = 1344,
TRASH = 1346,
WATERSPLASH2 = 1383,
BLOOD = 1391,
TRANSPORTERSTAR = 1398,
ALIENBLAST = 1409,
TONGUE = 1414,
MORTER = 1416,
MUD = 1420,
RADIUSEXPLOSION = 1426,
FORCERIPPLE = 1427,
INNERJAW = 1439,
EXPLOSION2 = 1441,
EXPLOSION3 = 1442,
JIBS1 = 1463,
JIBS2 = 1468,
JIBS3 = 1473,
JIBS4 = 1478,
JIBS5 = 1483,
BURNING = 1494,
FIRE = 1495,
JIBS6 = 1515,
BLOODSPLAT1 = 1525,
BLOODSPLAT3 = 1526,
BLOODSPLAT2 = 1527,
BLOODSPLAT4 = 1528,
OOZ = 1529,
WALLBLOOD1 = 1530,
WALLBLOOD2 = 1531,
WALLBLOOD3 = 1532,
WALLBLOOD4 = 1533,
WALLBLOOD5 = 1534,
WALLBLOOD6 = 1535,
WALLBLOOD7 = 1536,
WALLBLOOD8 = 1537,
OOZ2 = 1538,
BURNING2 = 1539,
FIRE2 = 1540,
SMALLSMOKE = 1554,
SMALLSMOKEMAKER = 1555,
SCRAP6 = 1595,
SCRAP1 = 1605,
SCRAP2 = 1609,
SCRAP3 = 1613,
SCRAP4 = 1617,
SCRAP5 = 1621,
F1HELP = 1633,
MENUSCREEN = 1641,
MENUBAR = 1642,
KILLSICON = 1643,
WHISHKEY_ICON = 1645,
EMPTY_ICON = 1646,
BOTTOMSTATUSBAR = 1647,
BOOT_ICON = 1648,
FRAGBAR = 1650,
COWPIE_ICON = 1652,
SNORKLE_ICON = 1653,
MOONSHINE_ICON = 1654,
BEER_ICON = 1655,
ACCESS_ICON = 1656,
DIGITALNUM = 1657,
SLIDEBAR = 1674,
WINDOWBORDER1 = 1679,
TEXTBOX = 1680,
WINDOWBORDER2 = 1681,
INGAMELNRDTHREEDEE = 1684,
TENSCREEN = 1685,
NEWCROSSHAIR = 1689,
CROSSHAIR = 1692,
SHELL = 1702,
SHOTGUNSHELL = 1704,
FORCESPHERE = 1759,
SHOTSPARK1 = 1764,
CROSSBOW = 1774,
TORNADO = 1930,
TIKILAMP = 1990,
POPCORN = 2021,
TESLACON = 2056,
TESLABALL = 2094,
DILDO = 2095,
TESLA = 2097,
HURTRAIL = 2221,
LOCKSWITCH1 = 2224,
REACTOR2 = 2239,
REACTOR2SPARK = 2243,
REACTOR2BURNT = 2247,
EXPLOSION2BOT = 2272,
SELECTDIR = 2444,
VIEWBORDER = 2520,
ORDERING = 2531,
TEXTSTORY = 2541,
LOADSCREEN = 2542,
STARSKY2 = 2577,
SPINNINGNUKEICON = 896,
TOILETPAPER = 2864,
BUSTAWIN5A = 2878,
BUSTAWIN5B = 2879,
BUSTAWIN4A = 2898,
BUSTAWIN4B = 2899,
FRAMEEFFECT1 = 2999,
LOAFTILE = 3120,
NUGGETTILE = 3122,
BROASTEDTILE = 3123,
BONELESSTILE = 3124,
HEAD1TILE = 3132,
HEAD2TILE = 3133,
CHICKENATILE = 3190,
CHICKENBTILE = 3191,
CHICKENCTILE = 3192,
NEWPISTOL = 3328,
NEWPISTOLCOCK = 3336,
NEWCROWBAR = 3340,
CROWBAR = NEWCROWBAR,
NEWSHOTGUN = 3350,
SHOTGUN = NEWSHOTGUN,
NEWDYNAMITE = 3360,
RIFLE = 3380,
CIRCLESTUCK = 3388,
SHITBALL = 3390,
BUZSAW = 3395,
CIRCLESAW = 3400,
LUMBERBLADE = 3411,
FIRELASER = 3420,
BOWLINGBALL = 3430,
BOWLINGBALLSPRITE = 3437,
OWHIP = 3471,
UWHIP = 3475,
BACKGROUND = 3822,
APLAYERTOP = 3840,
APLAYER = 3845,
PLAYERONWATER = 3860,
LNYDLADDER = 3975,
LNRDLYINGDEAD = 3998,
LNRDGUN = 4041,
LNRDTORSO = 4046,
LNRLEG = 4055,
DOGATTACK = 4060,
BILLYWALK = 4096,
BILLYDIE = 4137,
BILLYCOCK = 4147,
BILLYRAY = 4162,
BILLYSHOOT = 4162,
BILLYRAYSTAYPUT = 4163,
BILLYBUT = 4188,
BILLYSCRATCH = 4191,
BILLYSNIFF = 4195,
BILLYWOUND = 4202,
BILLYGORE = 4228,
BILLYJIBA = 4235,
BILLYJIBB = 4244,
DOGRUN = 4260,
DOGDIE = 4295,
DOGDEAD = 4303,
DOGBARK = 4305,
LTH = 4352,
LTHSTRAFE = 4395,
LTHLOAD = 4430,
LTHDIE = 4456,
BUBBASCRATCH = 4464,
BUBBANOSE = 4476,
BUBBAPISS = 4487,
BUBBASTAND = 4504,
BUBBAOUCH = 4506,
BUBBADIE = 4513,
BUBBADEAD = 4523,
HULK = 4649,
HULKSTAYPUT = 4650,
HULKA = 4651,
HULKB = 4652,
HULKC = 4653,
HULKJIBA = 4748,
HULKJIBB = 4753,
HULKJIBC = 4758,
SBSWIPE = 4770,
SBPAIN = 4810,
SBDIE = 4820,
HEN = 4861,
HENSTAYPUT = 4862,
HENSTAND = 4897,
MOSQUITO = 4916,
PIG = 4945,
PIGSTAYPUT = 4946,
PIGEAT = 4983,
SBMOVE = 5015,
SBSPIT = 5050,
SBDIP = 5085,
MINION = 5120,
MINIONSTAYPUT = 5121,
UFO1 = 5270,
UFO2 = 5274,
UFO3 = 5278,
UFO4 = 5282,
UFO5 = 5286,
MINJIBA = 5290,
MINJIBB = 5295,
MINJIBC = 5300,
COW = 5317,
COOT = 5376,
COOTSTAYPUT = 5377,
COOTSHOOT = 5411,
COOTDIE = 5437,
COOTDUCK = 5481,
COOTPAIN = 5548,
COOTTRANS = 5568,
COOTGETUP = 5579,
ECLAIRHEALTH = 5595,
COOTJIBA = 5602,
COOTJIBB = 5607,
COOTJIBC = 5616,
VIXEN = 5635,
VIXENPAIN = 5675,
VIXENDIE = 5710,
VIXENSHOOT = 5720,
VIXENWDN = 5740,
VIXENWUP = 5775,
VIXENKICK = 5805,
VIXENTELE = 5845,
VIXENTEAT = 5851,
//RA
AIRPLANE = 8450,
SWAMPBUGGY = 7233,
MOTORCYCLE = 7220,
CHIKENCROSSBOW = 1781,
BIKERSTAND = 5995,
BIKERRIDE = 5890,
BIKERRIDEDAISY = 6401,
MINIONAIRBOAT = 7192,
HULKAIRBOAT = 7199,
DAISYMAE = 6658,
DAISYAIRBOAT = 7206,
MINIONUFO = 5260,
JACKOLOPE = 7280,
BANJOCOOTER = 7030,
GUITARBILLY = 7035,
MAMAJACKOLOPE = 8705,
};