final fixes.

Restore one hard coded seq access.
When changing actor type, also copy the dmgControl table to have the correct values available.
delete unused thinginfo table.
This commit is contained in:
Christoph Oelckers 2023-10-09 16:41:40 +02:00
parent 1260873add
commit 7f0b501aa2
4 changed files with 15 additions and 603 deletions

View file

@ -658,587 +658,6 @@ const VECTORDATA gVectorData[] = {
},
};
const THINGINFO thingInfo[] = {
//TNT Barrel
{
25,
250,
32,
11,
4096,
80,
CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_BLOCK_HITSCAN,
907,
0,
0,
0,
0,
256, 256, 128, 64, 0, 0, 128,
},
// Armed Proxy Dynamite
{
5,
5,
16,
3,
24576,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3444,
-16,
0,
32,
32,
256, 256, 256, 64, 0, 0, 512,
},
// Armed Remote Dynamite
{
5,
5,
16,
3,
24576,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3457,
-16,
0,
32,
32,
256, 256, 256, 64, 0, 0, 512,
},
// Vase1
{
1,
20,
32,
3,
32768,
80,
0,
739,
0,
0,
0,
0,
256, 0, 256, 128, 0, 0, 0,
},
// Vase2
{
1,
150,
32,
3,
32768,
80,
0,
642,
0,
0,
0,
0,
256, 256, 256, 128, 0, 0, 0,
},
// Crate face
{
10,
0,
0,
0,
0,
0,
0,
462,
0,
0,
0,
0,
0, 0, 0, 256, 0, 0, 0,
},
// Glass window
{
1,
0,
0,
0,
0,
0,
0,
266,
0,
0,
0,
0,
256, 0, 256, 256, 0, 0, 0,
},
// Flourescent Light
{
1,
0,
0,
0,
0,
0,
0,
796,
0,
0,
0,
0,
256, 0, 256, 256, 0, 0, 512,
},
// Wall Crack
{
50,
0,
0,
0,
0,
0,
0,
1127,
0,
0,
0,
0,
0, 0, 0, 256, 0, 0, 0,
},
// Wood Beam
{
8,
0,
0,
0,
0,
0,
0,
1142,
0,
0,
0,
0,
256, 0, 256, 128, 0, 0, 0,
},
// Spider's Web
{
4,
0,
0,
0,
0,
0,
0,
1069,
0,
0,
0,
0,
256, 256, 64, 256, 0, 0, 128,
},
// Metal Grate
{
40,
0,
0,
0,
0,
0,
0,
483,
0,
0,
0,
0,
64, 0, 128, 256, 0, 0, 0,
},
// Flammable Tree
{
1,
0,
0,
0,
0,
0,
0,
-1,
0,
0,
0,
0,
0, 256, 0, 256, 0, 0, 128,
},
// MachineGun Trap
{
1000,
0,
0,
8,
0,
0,
0,
-1,
0,
0,
0,
0,
0, 0, 128, 256, 0, 0, 512,
},
// Falling Rock
{
0,
15,
8,
3,
32768,
0,
0,
-1,
0,
0,
0,
0,
0, 0, 0, 0, 0, 0, 0,
},
// Kickable Pail
{
0,
8,
48,
3,
49152,
0,
0,
-1,
0,
0,
0,
0,
0, 0, 0, 0, 0, 0, 0,
},
// Gib Object
{
10,
2,
0,
0,
32768,
0,
0,
-1,
0,
0,
0,
0,
256, 0, 256, 256, 0, 0, 128,
},
// Explode Object
{
20,
2,
0,
0,
32768,
0,
0,
-1,
0,
0,
0,
0,
0, 0, 0, 256, 0, 0, 128,
},
// Armed stick Of TNT
{
5,
14,
16,
3,
24576,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3422,
-32,
0,
32,
32,
64, 256, 128, 64, 0, 0, 256,
},
// Armed bundle Of TNT
{
5,
14,
16,
3,
24576,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3433,
-32,
0,
32,
32,
64, 256, 128, 64, 0, 0, 256,
},
// Armed aerosol
{
5,
14,
16,
3,
32768,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3467,
-128,
0,
32,
32,
64, 256, 128, 64, 0, 0, 256,
},
// Bone (Flesh Garg.)
{
5,
6,
16,
3,
32768,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
1462,
0,
0,
32,
32,
0, 0, 0, 0, 0, 0, 0,
},
// Some alpha stuff
{
8,
3,
16,
11,
32768,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
-1,
0,
0,
0,
0,
256, 0, 256, 256, 0, 0, 0,
},
// WaterDrip
{
0,
1,
1,
2,
0,
0,
0,
1147,
0,
10,
0,
0,
0, 0, 0, 0, 0, 0, 0,
},
// BloodDrip
{
0,
1,
1,
2,
0,
0,
0,
1160,
0,
2,
0,
0,
0, 0, 0, 0, 0, 0, 0,
},
// Blood chucks1
{
15,
4,
4,
3,
24576,
0,
CSTAT_SPRITE_BLOCK_ALL,
-1,
0,
0,
0,
0,
128, 64, 256, 256, 0, 0, 256,
},
// Blood chucks2
{
30,
30,
8,
3,
8192,
0,
CSTAT_SPRITE_BLOCK_ALL,
-1,
0,
0,
0,
0,
128, 64, 256, 256, 0, 0, 64,
},
// Axe Zombie Head
{
60,
5,
32,
3,
40960,
1280,
CSTAT_SPRITE_BLOCK_ALL,
3405,
0,
0,
40,
40,
128, 64, 256, 256, 0, 0, 64,
},
// Napalm's Alt Fire explosion
{
80,
30,
32,
3,
57344,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3281,
-128,
0,
32,
32,
0, 0, 0, 0, 0, 0, 0,
},
// Fire Pod Explosion
{
80,
30,
32,
3,
57344,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
2020,
-128,
0,
32,
32,
256, 0, 256, 256, 0, 0, 0,
},
// Green Pod Explosion
{
80,
30,
32,
3,
57344,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
1860,
-128,
0,
32,
32,
256, 0, 256, 256, 0, 0, 0,
},
// Life Leech
{
150,
30,
48,
3,
32768,
1600,
CSTAT_SPRITE_BLOCK_ALL,
800,
-128,
0,
48,
48,
64, 64, 112, 64, 0, 96, 96,
},
// Voodoo Head
{
1,
30,
48,
3,
32768,
1600,
0,
2443,
-128,
0,
16,
16,
0, 0, 0, 0, 0, 0, 0,
},
// 433 - kModernThingTNTProx
{
5,
5,
16,
3,
24576,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
3444,
-16,
7,
32,
32,
256, 256, 256, 64, 0, 0, 512,
},
// 434 - kModernThingThrowableRock
{
5,
6,
16,
3,
32768,
1600,
CSTAT_SPRITE_BLOCK_HITSCAN,
1462,
0,
0,
32,
32,
0, 0, 0, 0, 0, 0, 0,
},
// 435 - kModernThingEnemyLifeLeech
{
150,
30,
48,
3,
32768,
1600,
CSTAT_SPRITE_BLOCK_ALL,
800,
-128,
0,
44,
44,
0, 1024, 512, 1024, 0, 64, 512,
},
};
const EXPLOSION explodeInfo[] = {
{
40,
@ -2158,7 +1577,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
break;
case kDudeBurningZombieButcher:
genericDeath(actor, nSeq, 1204, actor->seqStartID() + 10);
genericDeath(actor, nSeq, 1204, 4608 + 10); // this was hardcoded to the non-burning butcher's base seq.
break;
case kDudeBurningInnocent:

View file

@ -64,26 +64,6 @@ enum VECTOR_TYPE {
kVectorMax,
};
struct THINGINFO
{
int16_t startHealth; // defhealth
int16_t mass;
uint8_t clipdist; // defclipdist
int16_t flags; // defflags
int32_t elastic;// fixed, bouncefactor
int32_t dmgResist;
ESpriteFlags cstat; // defcstat
int16_t picno;
int8_t shade;
uint8_t pal;
uint8_t xrepeat;
uint8_t yrepeat;
int16_t dmgControl[kDamageMax]; // damage, also for dudes, rename there.
FTextureID textureID() const { return tileGetTextureID(picno); }
double fClipdist() const { return clipdist * 0.25; }
};
struct EXPLOSION
{
uint8_t repeat;
@ -119,7 +99,6 @@ struct VECTORDATA {
};
extern const EXPLOSION explodeInfo[];
extern const THINGINFO thingInfo[];
extern const VECTORDATA gVectorData[];
const int gDudeDrag = 0x2a00;

View file

@ -176,6 +176,17 @@ public:
// It sucks having to do this but the game heavily depends on being able to swap out the class type and often uses this to manage actor state.
// We'll allow this only for classes that do not add their own data, though.
SetClass(newtype);
// we also must update the dmgControl array to match the new class
auto startdamage = static_cast<DBloodActor*>(GetDefaultByType(newtype))->dmgControl;
if (newtype->IsDescendantOf(BloodDudeBaseClass))
{
for (int j = 0; j < 7; j++)
dmgControl[j] = (int16_t)MulScale(DudeDifficulty[gGameOptions.nDifficulty], startdamage[j], 8);
}
else
{
memcpy(dmgControl, startdamage, sizeof(dmgControl));
}
}
}

View file

@ -1,2 +1,5 @@
xx(BloodMissileBase)
xx(BloodDudeBase)
xx(BloodThingBase)
xx(BloodDudeZombieButcher)