2020-10-17 07:14:31 +00:00
|
|
|
#pragma once
|
|
|
|
#include "dobject.h"
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
|
|
|
|
2021-11-26 20:13:19 +00:00
|
|
|
using DukeStatIterator = TStatIterator<DDukeActor>;
|
|
|
|
using DukeSectIterator = TSectIterator<DDukeActor>;
|
|
|
|
using DukeSpriteIterator = TSpriteIterator<DDukeActor>;
|
2020-10-27 06:15:03 +00:00
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
inline DDukeActor* DDukePlayer::GetActor()
|
2020-10-17 07:26:52 +00:00
|
|
|
{
|
2023-10-02 02:27:16 +00:00
|
|
|
return static_cast<DDukeActor*>(actor);
|
2020-10-17 07:26:52 +00:00
|
|
|
}
|
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
inline int DDukePlayer::GetPlayerNum()
|
2020-10-17 07:26:52 +00:00
|
|
|
{
|
2023-09-30 10:30:38 +00:00
|
|
|
return GetActor()->PlayerIndex();
|
2020-10-17 07:26:52 +00:00
|
|
|
}
|
|
|
|
|
2022-12-29 08:56:14 +00:00
|
|
|
DDukeActor* spawn(DDukeActor* spawner, PClassActor* pname);
|
2022-12-31 18:56:41 +00:00
|
|
|
DDukeActor* spawnsprite(DDukeActor* origin, int typeId);
|
2022-01-17 23:30:43 +00:00
|
|
|
|
2023-04-09 13:45:19 +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
|
|
|
{
|
2023-04-09 13:45:19 +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
|
|
|
{
|
2023-04-09 13:45:19 +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
|