mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 17:31:14 +00:00
- converted weaponsandammosprites into a class pointer array and fixed RR's bogus content.
It's a Duke only feature. RR can use it but would have spawned some non-functional items.
This commit is contained in:
parent
f78c971eac
commit
53e92097ac
8 changed files with 54 additions and 50 deletions
|
@ -94,3 +94,20 @@ xx(RedneckBoatGrenade)
|
|||
xx(RedneckBowlingBall)
|
||||
xx(RedneckSlingbladeAttack)
|
||||
xx(RedneckChickenArrow)
|
||||
xx(DukeDevastatorAmmo)
|
||||
xx(DukeRPGAmmo)
|
||||
xx(DukeJetpack)
|
||||
xx(DukeShield)
|
||||
xx(DukeFirstAid)
|
||||
xx(DukeSteroids)
|
||||
xx(DukeFreezeAmmo)
|
||||
xx(RedneckCrossbow)
|
||||
xx(RedneckRiflegun)
|
||||
xx(RedneckBlasterammo)
|
||||
xx(RedneckDynamiteAmmo)
|
||||
xx(RedneckCowpie)
|
||||
xx(RedneckWhiskey)
|
||||
xx(RedneckPorkRinds)
|
||||
xx(RedneckMoonshine)
|
||||
xx(RedneckTitgun)
|
||||
xx(RedneckTitAmmo)
|
||||
|
|
|
@ -40,21 +40,21 @@ BEGIN_DUKE_NS
|
|||
|
||||
void initactorflags_d()
|
||||
{
|
||||
gs.weaponsandammosprites[0] = DTILE_RPGSPRITE;
|
||||
gs.weaponsandammosprites[1] = DTILE_CHAINGUNSPRITE;
|
||||
gs.weaponsandammosprites[2] = DTILE_DEVISTATORAMMO;
|
||||
gs.weaponsandammosprites[3] = DTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[4] = DTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[5] = DTILE_JETPACK;
|
||||
gs.weaponsandammosprites[6] = DTILE_SHIELD;
|
||||
gs.weaponsandammosprites[7] = DTILE_FIRSTAID;
|
||||
gs.weaponsandammosprites[8] = DTILE_STEROIDS;
|
||||
gs.weaponsandammosprites[9] = DTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[10] = DTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[11] = DTILE_RPGSPRITE;
|
||||
gs.weaponsandammosprites[12] = DTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[13] = DTILE_FREEZESPRITE;
|
||||
gs.weaponsandammosprites[14] = DTILE_FREEZEAMMO;
|
||||
gs.weaponsandammosprites[0] = DukeRPGSpriteClass;
|
||||
gs.weaponsandammosprites[1] = DukeChaingunSpriteClass;
|
||||
gs.weaponsandammosprites[2] = DukeDevastatorAmmoClass;
|
||||
gs.weaponsandammosprites[3] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[4] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[5] = DukeJetpackClass;
|
||||
gs.weaponsandammosprites[6] = DukeShieldClass;
|
||||
gs.weaponsandammosprites[7] = DukeFirstAidClass;
|
||||
gs.weaponsandammosprites[8] = DukeSteroidsClass;
|
||||
gs.weaponsandammosprites[9] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[10] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[11] = DukeRPGSpriteClass;
|
||||
gs.weaponsandammosprites[12] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[13] = DukeFreezeSpriteClass;
|
||||
gs.weaponsandammosprites[14] = DukeFreezeAmmoClass;
|
||||
gs.firstdebris = DTILE_SCRAP6;
|
||||
|
||||
TILE_APLAYER = DTILE_APLAYER;
|
||||
|
|
|
@ -34,21 +34,21 @@ BEGIN_DUKE_NS
|
|||
|
||||
void initactorflags_r()
|
||||
{
|
||||
gs.weaponsandammosprites[0] = RTILE_CROSSBOWSPRITE;
|
||||
gs.weaponsandammosprites[1] = RTILE_RIFLEGUNSPRITE;
|
||||
gs.weaponsandammosprites[2] = RTILE_DEVISTATORAMMO;
|
||||
gs.weaponsandammosprites[3] = RTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[4] = RTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[5] = RTILE_COWPIE;
|
||||
gs.weaponsandammosprites[6] = RTILE_SHIELD;
|
||||
gs.weaponsandammosprites[7] = RTILE_FIRSTAID;
|
||||
gs.weaponsandammosprites[8] = RTILE_STEROIDS;
|
||||
gs.weaponsandammosprites[9] = RTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[10] = RTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[11] = RTILE_CROSSBOWSPRITE;
|
||||
gs.weaponsandammosprites[12] = RTILE_RPGAMMO;
|
||||
gs.weaponsandammosprites[13] = RTILE_TITSPRITE;
|
||||
gs.weaponsandammosprites[14] = RTILE_FREEZEAMMO;
|
||||
gs.weaponsandammosprites[0] = RedneckCrossbowClass;
|
||||
gs.weaponsandammosprites[1] = RedneckRiflegunClass;
|
||||
gs.weaponsandammosprites[2] = RedneckBlasterammoClass;
|
||||
gs.weaponsandammosprites[3] = RedneckDynamiteAmmoClass;
|
||||
gs.weaponsandammosprites[4] = RedneckDynamiteAmmoClass;
|
||||
gs.weaponsandammosprites[5] = RedneckCowpieClass;
|
||||
gs.weaponsandammosprites[6] = RedneckWhiskeyClass;
|
||||
gs.weaponsandammosprites[7] = RedneckPorkRindsClass;
|
||||
gs.weaponsandammosprites[8] = RedneckMoonshineClass;
|
||||
gs.weaponsandammosprites[9] = RedneckDynamiteAmmoClass;
|
||||
gs.weaponsandammosprites[10] = RedneckDynamiteAmmoClass;
|
||||
gs.weaponsandammosprites[11] = RedneckCrossbowClass;
|
||||
gs.weaponsandammosprites[12] = RedneckDynamiteAmmoClass;
|
||||
gs.weaponsandammosprites[13] = RedneckTitgunClass;
|
||||
gs.weaponsandammosprites[14] = RedneckTitAmmoClass;
|
||||
|
||||
TILE_APLAYER = RTILE_APLAYER;
|
||||
TILE_DRONE = RTILE_DRONE;
|
||||
|
|
|
@ -42,7 +42,7 @@ struct DukeGameInfo
|
|||
|
||||
ActorInfo actorinfo[MAXTILES];
|
||||
int16_t max_ammo_amount[MAX_WEAPONS];
|
||||
int16_t weaponsandammosprites[15];
|
||||
PClassActor* weaponsandammosprites[15];
|
||||
int displayflags;
|
||||
|
||||
// global gamevars from WW2GI. Put here so we can modify these values without having to depend on CON.
|
||||
|
|
|
@ -507,19 +507,6 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, spawnsprite, DukeActor_Spawnsprite)
|
|||
ACTION_RETURN_POINTER(DukeActor_Spawnsprite(self, type));
|
||||
}
|
||||
|
||||
DDukeActor* DukeActor_spawnweaponorammo(DDukeActor* origin, unsigned intname)
|
||||
{
|
||||
if (intname > 14) return nullptr;
|
||||
return spawn(origin, gs.weaponsandammosprites[intname]);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, spawnweaponorammo, DukeActor_spawnweaponorammo)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DDukeActor);
|
||||
PARAM_INT(type);
|
||||
ACTION_RETURN_POINTER(DukeActor_spawnweaponorammo(self, type));
|
||||
}
|
||||
|
||||
void DukeActor_Lotsofglass(DDukeActor* origin, int count, walltype* wal)
|
||||
{
|
||||
lotsofglass(origin, wal, count);
|
||||
|
@ -1781,6 +1768,7 @@ DEFINE_FIELD_X(DukeGameInfo, DukeGameInfo, stickybomb_lifetime);
|
|||
DEFINE_FIELD_X(DukeGameInfo, DukeGameInfo, stickybomb_lifetime_var);
|
||||
DEFINE_FIELD_X(DukeGameInfo, DukeGameInfo, grenade_lifetime);
|
||||
DEFINE_FIELD_X(DukeGameInfo, DukeGameInfo, grenade_lifetime_var);
|
||||
DEFINE_FIELD_X(DukeGameInfo, DukeGameInfo, weaponsandammosprites);
|
||||
|
||||
DEFINE_GLOBAL_UNSIZED(gs)
|
||||
|
||||
|
@ -1829,12 +1817,11 @@ DEFINE_FIELD_X(ActorAction, ActorAction, increment);
|
|||
DEFINE_FIELD_X(ActorAction, ActorAction, delay);
|
||||
|
||||
|
||||
// this is only a temporary helper until weaponsandammosprites can be migrated to real class types. We absolutely do not want any access to tile numbers in the scripts - even now.
|
||||
void tspritetype_setWeaponOrAmmoSprite(tspritetype* targ, unsigned z)
|
||||
{
|
||||
if (z < 15)
|
||||
{
|
||||
targ->picnum = gs.weaponsandammosprites[z];
|
||||
targ->setspritetexture(GetDefaultByType(gs.weaponsandammosprites[z])->spr.spritetexture());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,9 @@ class DukeScrap : DukeActor
|
|||
}
|
||||
else
|
||||
{
|
||||
if (self.spriteextra == Scrap1 && self.yint > 0)
|
||||
if (self.spriteextra == Scrap1 && self.yint > 0 && self.yint <= 15)
|
||||
{
|
||||
let spawned = self.spawnweaponorammo(self.yint - 1); // fixme later!
|
||||
let spawned = self.spawn(gs.weaponsandammosprites[self.yint - 1]);
|
||||
if (spawned)
|
||||
{
|
||||
spawned.SetPosition(self.pos);
|
||||
|
@ -83,7 +83,7 @@ class DukeScrap : DukeActor
|
|||
{
|
||||
if (self.spriteextra == Scrap1 && self.yint > 0)
|
||||
{
|
||||
tspr.setWeaponOrAmmoSprite(self.yint - 1); // needed so that we don't have to export tile numbers to scripting.
|
||||
tspr.setWeaponOrAmmoSprite(self.yint - 1); // needed so that we don't have to export 'picnum' to scripting.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -295,7 +295,6 @@ class DukeActor : CoreActor native
|
|||
native void StopSound(Sound snd, int flags = 0);
|
||||
native DukeActor spawn(class<DukeActor> type);
|
||||
native DukeActor spawnsprite(int type); // for cases where the map has a picnum stored. Avoid when possible.
|
||||
native DukeActor spawnweaponorammo(int type);
|
||||
native void lotsofglass(int count, walltype wal = null);
|
||||
native void lotsofcolourglass(int count, walltype wal = null);
|
||||
native void makeitfall();
|
||||
|
|
|
@ -490,6 +490,7 @@ struct DukeGameInfo native
|
|||
readonly native int stickybomb_lifetime_var;
|
||||
readonly native int grenade_lifetime;
|
||||
readonly native int grenade_lifetime_var;
|
||||
readonly native class<DukeActor> weaponsandammosprites[15];
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue