got through nnextcdud.h

This commit is contained in:
Christoph Oelckers 2023-10-15 09:12:26 +02:00
parent 15ba1bf333
commit 33aa9188d7
10 changed files with 1450 additions and 11 deletions

View file

@ -3,4 +3,5 @@ xx(BloodDudeBase)
xx(BloodPlayerBase)
xx(BloodThingBase)
xx(BloodDudeZombieButcher)
xx(BloodThingObjectExplode)

View file

@ -441,7 +441,10 @@ enum {
kAiStateChase = 4,
kAiStateRecoil = 5,
kAiStateAttack = 6,
kAiStatePatrolBase = 7,
#ifdef NOONE_EXTENSIONS
kAiStateKnockout,
kAiStateIdleSleep,
kAiStatePatrolBase,
kAiStatePatrolWaitL = kAiStatePatrolBase,
kAiStatePatrolWaitC,
kAiStatePatrolWaitW,
@ -452,8 +455,10 @@ enum {
kAiStatePatrolTurnC,
kAiStatePatrolTurnW,
kAiStatePatrolMax,
#endif
};
enum
{
// sprite attributes

View file

@ -635,6 +635,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRIT
("target", w.target, def->target)
("sysdata1", w.sysData1, def->sysData1)
("sysdata2", w.sysData2, def->sysData2)
("sysdata3", w.sysData3, def->sysData3)
("sysdata4", w.sysData4, def->sysData4)
("scale", w.scale, def->scale)
("physattr", w.physAttr, def->physAttr)
("health", w.health, def->health)

View file

@ -102,7 +102,9 @@ struct XSPRITE {
DAngle goalAng; // Dude goal ang
int32_t sysData1; // used to keep here various system data, so user can't change it in map editor
int32_t sysData2; //
int32_t sysData2;
int32_t sysData3;
int32_t sysData4;
int32_t scale; // used for scaling SEQ size on sprites
uint32_t physAttr; // currently used by additional physics sprites to keep its attributes.
uint32_t health;

File diff suppressed because it is too large Load diff

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h"
#include "savegamehelp.h"
#include "nnextsif.h"
#include "nnextcdud.h"
BEGIN_BLD_NS

View file

@ -305,7 +305,6 @@ void nnExtResetGlobals();
void sfxPlayMissileSound(DBloodActor* pSprite, int missileId);
void sfxPlayVectorSound(DBloodActor* pSprite, int vectorId);
// ------------------------------------------------------------------------- //
int debrisGetFreeIndex(void);
void debrisBubble(DBloodActor* nSprite);
void debrisMove(DBloodActor* act);
void debrisConcuss(DBloodActor* nOwner, int listIndex, const DVector3& pos, int dmg);
@ -427,6 +426,16 @@ bool isOnRespawn(DBloodActor* pSpr);
void nnExtOffsetPos(const DVector3& opos, DAngle nAng, DVector3& pos);
void actPropagateSpriteOwner(DBloodActor* pShot, DBloodActor* pSpr);
int nnExtDudeStartHealth(DBloodActor* pSpr, int nHealth);
void nnExtSprScaleSet(DBloodActor* actor, int nScale);
struct Seq;
bool seqCanOverride(Seq* pSeq, int nFrame, bool* xrp, bool* yrp, bool* plu);
inline unsigned int perc2val(unsigned int reqPerc, unsigned int val) { return (val * reqPerc) / 100; }
inline int perc2val(int reqPerc, int val) { return (val * reqPerc) / 100; }
inline double perc2val(int reqPerc, double val) { return (val * reqPerc) / 100; }
void nnExtScaleVelocity(DBloodActor* pSpr, double nVel, const DVector3& dv, int which = 0x03);
void nnExtScaleVelocityRel(DBloodActor* pSpr, double nVel, const DVector3& dv, int which = 0x03);
int nnExtGibSprite(DBloodActor* pSpr, TArray<DBloodActor*>& pOut, GIBTYPE nGibType, const DVector3* pPos, const DVector3* pVel);
inline bool valueIsBetween(int val, int min, int max)
{

View file

@ -241,16 +241,15 @@ void sfxPlay3DSoundVolume(DBloodActor* pActor, int soundId, int playchannel, int
//
//---------------------------------------------------------------------------
void sfxKill3DSound(DBloodActor* pActor, int a2, int a3)
void sfxKill3DSound(DBloodActor* pActor, int a2, FSoundID sid)
{
if (!pActor)
return;
if (a2 >= 0) a2++;
auto sid = soundEngine->FindSoundByResID(a3);
soundEngine->EnumerateChannels([=](FSoundChan* channel)
{
if (channel->SourceType == SOURCE_Actor && channel->Source == pActor && (a2 < 0 || a2 == channel->EntChannel) && (a3 < 0 || sid == channel->OrgID))
if (channel->SourceType == SOURCE_Actor && channel->Source == pActor && (a2 < 0 || a2 == channel->EntChannel) && (sid == NO_SOUND || sid == channel->OrgID))
{
soundEngine->StopChannel(channel);
}
@ -258,6 +257,12 @@ void sfxKill3DSound(DBloodActor* pActor, int a2, int a3)
});
}
void sfxKill3DSound(DBloodActor* pActor, int a2, int a3)
{
auto sid = soundEngine->FindSoundByResID(a3);
sfxKill3DSound(pActor, a2, sid);
}
void sfxKillAllSounds(void)
{
if (soundEngine) soundEngine->EnumerateChannels([](FSoundChan* channel)

View file

@ -40,7 +40,8 @@ inline void sfxPlay3DSound(DBloodActor* pActor, int soundId, int a3 = -1, int a4
{
sfxPlay3DSoundVolume(pActor, soundId, a3, a4, -1, 0);
}
void sfxKill3DSound(DBloodActor* pActor, int a2 = -1, int a3 = -1);
void sfxKill3DSound(DBloodActor* pActor, int a2 = -1, FSoundID a3 = NO_SOUND);
void sfxKill3DSound(DBloodActor* pActor, int a2, int a3);
void sfxKillAllSounds(void);
void sfxSetReverb(bool toggle);
void sfxSetReverb2(bool toggle);

View file

@ -380,21 +380,28 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBloodActor, impactMissile, actImpactMissile)
//
//---------------------------------------------------------------------------
DBloodActor* actDropObject(DBloodActor* actor, int nType)
DBloodActor* actDropObject(DBloodActor* actor, PClass* pType)
{
IFVM(BloodActor, dropObject)
{
PClass* ty = GetSpawnType(nType);
if (ty == nullptr) ty = RUNTIME_CLASS(DBloodActor);
if (pType == nullptr) pType = RUNTIME_CLASS(DBloodActor);
DBloodActor* spawned;
VMReturn ret((void**)&spawned);
VMValue param[] = { actor, ty };
VMValue param[] = { actor, pType };
VMCall(func, param, 2, &ret, 1);
return spawned;
}
return nullptr;
}
DBloodActor* actDropObject(DBloodActor* actor, int nType)
{
auto ty = GetSpawnType(nType);
auto spawned = actDropObject(actor, ty);
if (ty == nullptr) spawned->spr.lotag = nType; // make sure the type is correct even if not bound to a class.
}
//---------------------------------------------------------------------------
//
//