raze/source/games/duke/src/dukeactor.h

37 lines
819 B
C
Raw Normal View History

2020-10-17 07:14:31 +00:00
#pragma once
#include "dobject.h"
#include "build.h"
BEGIN_DUKE_NS
using DukeStatIterator = TStatIterator<DDukeActor>;
using DukeSectIterator = TSectIterator<DDukeActor>;
using DukeSpriteIterator = TSpriteIterator<DDukeActor>;
inline DDukeActor* DDukePlayer::GetActor()
2020-10-17 07:26:52 +00:00
{
return static_cast<DDukeActor*>(actor);
2020-10-17 07:26:52 +00:00
}
inline int DDukePlayer::GetPlayerNum()
2020-10-17 07:26:52 +00:00
{
return GetActor()->PlayerIndex();
2020-10-17 07:26:52 +00:00
}
DDukeActor* spawn(DDukeActor* spawner, PClassActor* pname);
DDukeActor* spawnsprite(DDukeActor* origin, int typeId);
2022-01-17 23:30:43 +00:00
// return type is int for scripting - the value must still be true or false!
2023-04-16 08:41:38 +00:00
inline int badguy(const DDukeActor* pSprite)
2020-10-17 07:26:52 +00:00
{
return !!(pSprite->flags1 & (SFLAG_BADGUY | SFLAG_INTERNAL_BADGUY));
2020-10-17 07:26:52 +00:00
}
2023-04-16 08:41:38 +00:00
inline int bossguy(const DDukeActor* pSprite)
2020-10-17 07:26:52 +00:00
{
return !!(pSprite->flags1 & SFLAG_BOSS);
2020-10-17 07:26:52 +00:00
}
2020-10-17 07:14:31 +00:00
END_DUKE_NS