mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 02:51:46 +00:00
- use actors in the AIState interface.
This was a massive cppy/paste operation that only changed function headers and a few internal calls.
This commit is contained in:
parent
1b487c1b05
commit
abd19f4e1d
25 changed files with 1129 additions and 579 deletions
|
@ -9,8 +9,8 @@ Enemy enemy[MAXTYPES];
|
|||
|
||||
int checksight_ang = 0;
|
||||
|
||||
void skeletonChill(PLAYER& plr, short i);
|
||||
void goblinChill(PLAYER& plr, short i);
|
||||
void skeletonChill(PLAYER& plr, DWHActor* i);
|
||||
void goblinChill(PLAYER& plr, DWHActor* i);
|
||||
|
||||
|
||||
void createDemonAI();
|
||||
|
@ -246,10 +246,10 @@ void aiProcess() {
|
|||
spr.z = zr_florz;
|
||||
}
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
int j = sectactor->GetSpriteIndex();
|
||||
|
||||
if (tspr.picnum == PATROLPOINT) {
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
|
@ -282,7 +282,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].chase != nullptr)
|
||||
enemy[spr.detail].chase(plr, i);
|
||||
enemy[spr.detail].chase(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(RESURECT);
|
||||
|
@ -291,7 +291,7 @@ void aiProcess() {
|
|||
SPRITE& spr = actor->s();
|
||||
i = actor->GetSpriteIndex();
|
||||
if (enemy[spr.detail].resurect != nullptr) {
|
||||
enemy[spr.detail].resurect(plr, i);
|
||||
enemy[spr.detail].resurect(plr, actor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].search != nullptr)
|
||||
enemy[spr.detail].search(plr, i);
|
||||
enemy[spr.detail].search(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(NUKED);
|
||||
|
@ -318,7 +318,7 @@ void aiProcess() {
|
|||
}
|
||||
else {
|
||||
if (enemy[spr.detail].nuked != nullptr)
|
||||
enemy[spr.detail].nuked(plr, i);
|
||||
enemy[spr.detail].nuked(plr, actor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].frozen != nullptr)
|
||||
enemy[spr.detail].frozen(plr, i);
|
||||
enemy[spr.detail].frozen(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(PAIN);
|
||||
|
@ -339,7 +339,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].pain != nullptr)
|
||||
enemy[spr.detail].pain(plr, i);
|
||||
enemy[spr.detail].pain(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(FACE);
|
||||
|
@ -349,7 +349,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].face != nullptr)
|
||||
enemy[spr.detail].face(plr, i);
|
||||
enemy[spr.detail].face(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(ATTACK);
|
||||
|
@ -364,7 +364,7 @@ void aiProcess() {
|
|||
}
|
||||
|
||||
if (enemy[spr.detail].attack != nullptr)
|
||||
enemy[spr.detail].attack(plr, i);
|
||||
enemy[spr.detail].attack(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(FLEE);
|
||||
|
@ -374,7 +374,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].flee != nullptr)
|
||||
enemy[spr.detail].flee(plr, i);
|
||||
enemy[spr.detail].flee(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(CAST);
|
||||
|
@ -384,7 +384,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].cast != nullptr)
|
||||
enemy[spr.detail].cast(plr, i);
|
||||
enemy[spr.detail].cast(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(DIE);
|
||||
|
@ -394,7 +394,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].die != nullptr)
|
||||
enemy[spr.detail].die(plr, i);
|
||||
enemy[spr.detail].die(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(SKIRMISH);
|
||||
|
@ -404,7 +404,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].skirmish != nullptr)
|
||||
enemy[spr.detail].skirmish(plr, i);
|
||||
enemy[spr.detail].skirmish(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(STAND);
|
||||
|
@ -414,7 +414,7 @@ void aiProcess() {
|
|||
i = actor->GetSpriteIndex();
|
||||
|
||||
if (enemy[spr.detail].stand != nullptr)
|
||||
enemy[spr.detail].stand(plr, i);
|
||||
enemy[spr.detail].stand(plr, actor);
|
||||
}
|
||||
|
||||
it.Reset(CHILL);
|
||||
|
@ -425,10 +425,10 @@ void aiProcess() {
|
|||
|
||||
switch (spr.detail) {
|
||||
case GOBLINTYPE:
|
||||
goblinChill(plr, i);
|
||||
goblinChill(plr, actor);
|
||||
break;
|
||||
case SKELETONTYPE:
|
||||
skeletonChill(plr, i);
|
||||
skeletonChill(plr, actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ struct EnemyInfo
|
|||
};
|
||||
|
||||
|
||||
using AIState = void (*)(PLAYER &plr, short i);
|
||||
using AIState = void (*)(PLAYER &plr, DWHActor* actor);
|
||||
|
||||
|
||||
struct Enemy
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void chasedemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasedemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -73,13 +75,20 @@ static void chasedemon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchdemon(PLAYER& plr, short i) {
|
||||
static void searchdemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
aisearch(plr, i, true);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void paindemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paindemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = DEMON;
|
||||
|
@ -91,8 +100,10 @@ static void paindemon(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facedemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facedemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7), spr.sectnum);
|
||||
|
||||
|
@ -120,8 +131,10 @@ static void facedemon(PLAYER& plr, short i) {
|
|||
}
|
||||
|
||||
|
||||
static void attackdemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackdemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (plr.z < spr.z) {
|
||||
spr.z -= TICSPERFRAME << 8;
|
||||
|
@ -142,8 +155,11 @@ static void attackdemon(PLAYER& plr, short i) {
|
|||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
}
|
||||
|
||||
static void fleedemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleedemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -175,8 +191,10 @@ static void fleedemon(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castdemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castdemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -193,8 +211,11 @@ static void castdemon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukeddemon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukeddemon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
trailingsmoke(i, false);
|
||||
newstatus((short)i, DIE);
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
BEGIN_WH_NS
|
||||
|
||||
|
||||
static void chasedevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasedevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -59,8 +62,11 @@ static void chasedevil(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void diedevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diedevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -78,8 +84,11 @@ static void diedevil(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void paindevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paindevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = DEVIL;
|
||||
|
@ -92,10 +101,10 @@ static void paindevil(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facedevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
|
||||
static void facedevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -123,8 +132,11 @@ static void facedevil(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void fleedevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleedevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -155,8 +167,10 @@ static void fleedevil(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void attackdevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackdevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -183,8 +197,10 @@ static void attackdevil(PLAYER& plr, short i) {
|
|||
sprite[i].ang = getangle(plr.x - sprite[i].x, plr.y - sprite[i].y);
|
||||
}
|
||||
|
||||
static void resurectdevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectdevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -196,13 +212,18 @@ static void resurectdevil(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchdevil(PLAYER& plr, short i) {
|
||||
static void searchdevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void frozendevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozendevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -212,8 +233,10 @@ static void frozendevil(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukeddevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukeddevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -233,8 +256,10 @@ static void nukeddevil(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void castdevil(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castdevil(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
|
|
@ -6,11 +6,14 @@ BEGIN_WH_NS
|
|||
static int checksight_x, checksight_y = 0;
|
||||
|
||||
static void checkspeed(int i, int speed);
|
||||
static void dragonAttack2(PLAYER& plr, short i);
|
||||
static void dragonAttack2(PLAYER& plr, DWHActor* i);
|
||||
static void firebreath(PLAYER& plr, int i, int a, int b, int c);
|
||||
|
||||
static void chasedragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasedragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -70,8 +73,11 @@ static void chasedragon(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void fleedragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleedragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -102,8 +108,11 @@ static void fleedragon(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void diedragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diedragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -120,8 +129,11 @@ static void diedragon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void castdragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castdragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum++;
|
||||
|
@ -190,8 +202,10 @@ static void castdragon(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void attackdragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackdragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -205,8 +219,10 @@ static void attackdragon(PLAYER& plr, short i) {
|
|||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
}
|
||||
|
||||
static void resurectdragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectdragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -218,13 +234,18 @@ static void resurectdragon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchdragon(PLAYER& plr, short i) {
|
||||
static void searchdragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, true);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void frozendragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozendragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -234,8 +255,10 @@ static void frozendragon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukeddragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukeddragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -248,18 +271,21 @@ static void nukeddragon(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void paindragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paindragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
aimove(i);
|
||||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facedragon(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
|
||||
static void facedragon(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -294,18 +320,19 @@ void dragonProcess(PLAYER& plr)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
SPRITE& spr = actor->s();
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
switch (spr.detail) {
|
||||
case DRAGON:
|
||||
dragonAttack2(plr, i);
|
||||
dragonAttack2(plr, actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void dragonAttack2(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dragonAttack2(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void throwspank(PLAYER& plr, int i);
|
||||
static void throwspank(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chasefatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chasefatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -59,8 +62,10 @@ static void chasefatwitch(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void resurectfatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -72,13 +77,18 @@ static void resurectfatwitch(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchfatwitch(PLAYER& plr, short i) {
|
||||
static void searchfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void nukedfatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -91,8 +101,11 @@ static void nukedfatwitch(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painfatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = FATWITCH;
|
||||
|
@ -105,8 +118,10 @@ static void painfatwitch(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facefatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facefatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7), spr.sectnum);
|
||||
|
||||
|
@ -133,8 +148,10 @@ static void facefatwitch(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void attackfatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -160,8 +177,11 @@ static void attackfatwitch(PLAYER& plr, short i) {
|
|||
sprite[i].ang = getangle(plr.x - sprite[i].x, plr.y - sprite[i].y);
|
||||
}
|
||||
|
||||
static void fleefatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleefatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -192,8 +212,10 @@ static void fleefatwitch(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castfatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castfatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -203,14 +225,17 @@ static void castfatwitch(PLAYER& plr, short i) {
|
|||
|
||||
if (spr.picnum == FATWITCHATTACK + 3) {
|
||||
sprite[i].picnum = FATWITCH;
|
||||
throwspank(plr, i);
|
||||
throwspank(plr, actor);
|
||||
newstatus(i, CHASE);
|
||||
}
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void diefatwitch(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diefatwitch(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -229,15 +254,20 @@ static void diefatwitch(PLAYER& plr, short i) {
|
|||
}
|
||||
|
||||
|
||||
static void throwspank(PLAYER& plr, int i) {
|
||||
int j = insertsprite(sprite[i].sectnum, MISSILE);
|
||||
static void throwspank(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
int j = insertsprite(spr.sectnum, MISSILE);
|
||||
if (j == -1)
|
||||
return;
|
||||
spritesound(S_WITCHTHROW, &sprite[i]);
|
||||
|
||||
sprite[j].x = sprite[i].x;
|
||||
sprite[j].y = sprite[i].y;
|
||||
sprite[j].z = sector[sprite[i].sectnum].floorz - ((tileHeight(sprite[i].picnum) >> 1) << 8);
|
||||
spritesound(S_WITCHTHROW, &spr);
|
||||
|
||||
sprite[j].x = spr.x;
|
||||
sprite[j].y = spr.y;
|
||||
sprite[j].z = sector[spr.sectnum].floorz - ((tileHeight(spr.picnum) >> 1) << 8);
|
||||
sprite[j].cstat = 0; // Hitscan does not hit other bullets
|
||||
sprite[j].picnum = FATSPANK;
|
||||
sprite[j].shade = -15;
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
BEGIN_WH_NS
|
||||
|
||||
|
||||
static void chasefish(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasefish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -76,12 +79,16 @@ static void chasefish(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void diefish(PLAYER& plr, short i) {
|
||||
static void diefish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
deletesprite(i);
|
||||
}
|
||||
|
||||
static void attackfish(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackfish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.z = sector[sprite[i].sectnum].floorz;
|
||||
|
||||
|
@ -115,8 +122,10 @@ static void attackfish(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void skirmishfish(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishfish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -138,14 +147,18 @@ static void skirmishfish(PLAYER& plr, short i) {
|
|||
return;
|
||||
}
|
||||
|
||||
static void searchfish(PLAYER& plr, short i) {
|
||||
static void searchfish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void facefish(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facefish(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplfred(PLAYER& plr, short i);
|
||||
static void checkexplfred(PLAYER& plr, DWHActor* i);
|
||||
|
||||
|
||||
static void chasefred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasefred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -77,11 +80,13 @@ static void chasefred(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void skirmishfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -102,11 +107,14 @@ static void skirmishfred(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void diefred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diefred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -124,14 +132,19 @@ static void diefred(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchfred(PLAYER& plr, short i) {
|
||||
static void searchfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -141,9 +154,10 @@ static void frozenfred(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void facefred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facefred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -171,11 +185,13 @@ static void facefred(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void attackfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -212,8 +228,11 @@ static void attackfred(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleefred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleefred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -244,11 +263,14 @@ static void fleefred(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void painfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = FRED;
|
||||
|
@ -260,11 +282,13 @@ static void painfred(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplfred(plr, i);
|
||||
checkexplfred(plr, actor);
|
||||
}
|
||||
|
||||
static void resurectfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -276,12 +300,15 @@ static void resurectfred(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void checkexplfred(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplfred(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplgoblin(PLAYER& plr, short i);
|
||||
static void checkexplgoblin(PLAYER& plr, DWHActor* i);
|
||||
|
||||
|
||||
static void chasegoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasegoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -83,11 +86,14 @@ static void chasegoblin(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
static void diegoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diegoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -105,8 +111,11 @@ static void diegoblin(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void paingoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paingoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = GOBLIN;
|
||||
|
@ -118,11 +127,13 @@ static void paingoblin(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
static void facegoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facegoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -150,11 +161,14 @@ static void facegoblin(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
static void fleegoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleegoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -184,11 +198,13 @@ static void fleegoblin(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
static void standgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void standgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) {
|
||||
|
@ -216,8 +232,10 @@ static void standgoblin(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void attackgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -255,8 +273,10 @@ static void attackgoblin(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void resurectgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -268,14 +288,19 @@ static void resurectgoblin(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchgoblin(PLAYER& plr, short i) {
|
||||
static void searchgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
static void frozengoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozengoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -285,8 +310,10 @@ static void frozengoblin(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -299,8 +326,10 @@ static void nukedgoblin(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -322,11 +351,13 @@ static void skirmishgoblin(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
void goblinChill(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
void goblinChill(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -339,8 +370,11 @@ void goblinChill(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void goblinWar(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void goblinWar(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
short k;
|
||||
|
||||
if (spr.lotag > 256) {
|
||||
|
@ -487,7 +521,7 @@ static void goblinWar(PLAYER& plr, short i) {
|
|||
break;
|
||||
}
|
||||
|
||||
checkexplgoblin(plr, i);
|
||||
checkexplgoblin(plr, actor);
|
||||
}
|
||||
|
||||
void goblinWarProcess(PLAYER& plr)
|
||||
|
@ -500,19 +534,22 @@ void goblinWarProcess(PLAYER& plr)
|
|||
|
||||
switch (spr.detail) {
|
||||
case GOBLINTYPE:
|
||||
goblinWar(plr, i);
|
||||
goblinWar(plr, actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void checkexplgoblin(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplgoblin(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& spri = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& spri = sectactor->s();
|
||||
int j = sectactor->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - spri.x); // x distance to sprite
|
||||
int dy = abs(spr.y - spri.y); // y distance to sprite
|
||||
|
|
|
@ -4,11 +4,14 @@
|
|||
BEGIN_WH_NS
|
||||
|
||||
static void gonzopike(short s, PLAYER& plr);
|
||||
static void checkexplgonzo(PLAYER& plr, short i);
|
||||
static boolean patrolprocess(PLAYER& plr, short i);
|
||||
static void checkexplgonzo(PLAYER& plr, DWHActor* i);
|
||||
static boolean patrolprocess(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chasegonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chasegonzo(PLAYER& plr, short const i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -105,7 +108,7 @@ static void chasegonzo(PLAYER& plr, short const i) {
|
|||
break;
|
||||
}
|
||||
else {
|
||||
if (!patrolprocess(plr, i))
|
||||
if (!patrolprocess(plr, actor))
|
||||
newstatus(i, FLEE);
|
||||
}
|
||||
break;
|
||||
|
@ -153,7 +156,7 @@ static void chasegonzo(PLAYER& plr, short const i) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (!patrolprocess(plr, i))
|
||||
if (!patrolprocess(plr, actor))
|
||||
newstatus(i, FLEE);
|
||||
}
|
||||
|
||||
|
@ -184,11 +187,13 @@ static void chasegonzo(PLAYER& plr, short const i) {
|
|||
}
|
||||
}
|
||||
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void resurectgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -216,8 +221,10 @@ static void resurectgonzo(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -240,24 +247,32 @@ static void skirmishgonzo(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void searchgonzo(PLAYER& plr, short i) {
|
||||
aisearch(plr, i, false);
|
||||
static void searchgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (!checksector6(i))
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void nukedgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
trailingsmoke(i, false);
|
||||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
static void frozengonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozengonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -280,8 +295,11 @@ static void frozengonzo(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void paingonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paingonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
switch (sprite[i].picnum) {
|
||||
|
@ -306,12 +324,13 @@ static void paingonzo(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void facegonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facegonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -339,11 +358,14 @@ static void facegonzo(PLAYER& plr, short i) {
|
|||
if (plr.invisibletime < 0 && checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void attackgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
||||
|
@ -426,8 +448,11 @@ static void attackgonzo(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleegonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleegonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -460,11 +485,13 @@ static void fleegonzo(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgonzo(plr, i);
|
||||
checkexplgonzo(plr, actor);
|
||||
}
|
||||
|
||||
static void castgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -480,8 +507,11 @@ static void castgonzo(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void diegonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diegonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -607,10 +637,10 @@ static short searchpatrol(SPRITE& spr) {
|
|||
short target = -1;
|
||||
|
||||
WHStatIterator it(ATTACK2);
|
||||
while (auto actor = it.Next())
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = itActor->s();
|
||||
int j = itActor->GetSpriteIndex();
|
||||
|
||||
int dist = abs(tspr.x - spr.x) + abs(tspr.y - spr.y);
|
||||
if (dist < mindist) {
|
||||
|
@ -622,8 +652,11 @@ static short searchpatrol(SPRITE& spr) {
|
|||
return target;
|
||||
}
|
||||
|
||||
static boolean patrolprocess(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static boolean patrolprocess(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
short target = searchpatrol(spr);
|
||||
if (target != -1) {
|
||||
SPRITE& tspr = sprite[target];
|
||||
|
@ -671,13 +704,16 @@ static void gonzopike(short s, PLAYER& plr) {
|
|||
|
||||
}
|
||||
|
||||
static void checkexplgonzo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplgonzo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
int j = sectactor->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -3,12 +3,15 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplgron(PLAYER& plr, short i);
|
||||
static void checkexplgron(PLAYER& plr, DWHActor* i);
|
||||
static void throwhalberd(int s);
|
||||
|
||||
|
||||
static void chasegron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasegron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -115,11 +118,13 @@ static void chasegron(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void resurectgron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -146,8 +151,10 @@ static void resurectgron(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishgron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -169,17 +176,22 @@ static void skirmishgron(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void searchgron(PLAYER& plr, short i) {
|
||||
static void searchgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void nukedgron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -199,8 +211,10 @@ static void nukedgron(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void frozengron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozengron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -215,8 +229,11 @@ static void frozengron(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void paingron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void paingron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
if (spr.picnum == GRONHALPAIN)
|
||||
|
@ -234,12 +251,13 @@ static void paingron(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void facegron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facegron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -267,11 +285,13 @@ static void facegron(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void attackgron(PLAYER& plr, short const i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (spr.picnum == GRONSWATTACK) {
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
|
@ -322,8 +342,11 @@ static void attackgron(PLAYER& plr, short const i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleegron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleegron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -353,11 +376,13 @@ static void fleegron(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplgron(plr, i);
|
||||
checkexplgron(plr, actor);
|
||||
}
|
||||
|
||||
static void castgron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -378,8 +403,11 @@ static void castgron(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void diegron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diegron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.picnum == GRONSWDIE || spr.picnum == GRONHALDIE || spr.picnum == GRONMUDIE)
|
||||
|
@ -407,13 +435,16 @@ static void diegron(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void checkexplgron(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplgron(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& spri = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& spri = sectactor->s();
|
||||
int j = sectactor->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - spri.x); // x distance to sprite
|
||||
int dy = abs(spr.y - spri.y); // y distance to sprite
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void chaseguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chaseguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -70,8 +73,10 @@ static void chaseguardian(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -91,8 +96,10 @@ static void nukedguardian(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void attackguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (plr.z < spr.z) {
|
||||
spr.z -= TICSPERFRAME << 8;
|
||||
|
@ -113,9 +120,10 @@ static void attackguardian(PLAYER& plr, short i) {
|
|||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
}
|
||||
|
||||
static void faceguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void faceguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -144,13 +152,19 @@ static void faceguardian(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void searchguardian(PLAYER& plr, short i) {
|
||||
static void searchguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, true);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleeguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleeguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -185,8 +199,11 @@ static void fleeguardian(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void painguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = GUARDIAN;
|
||||
|
@ -198,8 +215,10 @@ static void painguardian(PLAYER& plr, short i) {
|
|||
// setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castguardian(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castguardian(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplimp(PLAYER& plr, short i);
|
||||
static void checkexplimp(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chaseimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chaseimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -84,11 +87,13 @@ static void chaseimp(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplimp(plr, i);
|
||||
checkexplimp(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -98,8 +103,11 @@ static void frozenimp(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = IMP;
|
||||
|
@ -112,8 +120,11 @@ static void painimp(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void dieimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dieimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -131,15 +142,20 @@ static void dieimp(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
trailingsmoke(i, false);
|
||||
newstatus((short)i, DIE);
|
||||
}
|
||||
|
||||
static void resurectimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -151,9 +167,10 @@ static void resurectimp(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void faceimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void faceimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -181,11 +198,14 @@ static void faceimp(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplimp(plr, i);
|
||||
checkexplimp(plr, actor);
|
||||
}
|
||||
|
||||
static void fleeimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleeimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -216,11 +236,13 @@ static void fleeimp(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplimp(plr, i);
|
||||
checkexplimp(plr, actor);
|
||||
}
|
||||
|
||||
static void attackimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -256,14 +278,19 @@ static void attackimp(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void searchimp(PLAYER& plr, short i) {
|
||||
static void searchimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplimp(plr, i);
|
||||
checkexplimp(plr, actor);
|
||||
}
|
||||
|
||||
static void skirmishimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -285,16 +312,19 @@ static void skirmishimp(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplimp(plr, i);
|
||||
checkexplimp(plr, actor);
|
||||
}
|
||||
|
||||
static void checkexplimp(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplimp(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sect = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sect->s();
|
||||
int j = sect->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -5,8 +5,11 @@ BEGIN_WH_NS
|
|||
|
||||
void spawnabaddy(int i, int monster);
|
||||
|
||||
static void chasejudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasejudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -69,8 +72,10 @@ static void chasejudy(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void resurectjudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -82,13 +87,18 @@ static void resurectjudy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchjudy(PLAYER& plr, short i) {
|
||||
static void searchjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void nukedjudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -101,8 +111,11 @@ static void nukedjudy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painjudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = JUDY;
|
||||
|
@ -115,8 +128,10 @@ static void painjudy(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facejudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facejudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
|
||||
|
@ -145,8 +160,10 @@ static void facejudy(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void attackjudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -173,8 +190,11 @@ static void attackjudy(PLAYER& plr, short i) {
|
|||
sprite[i].ang = getangle(plr.x - sprite[i].x, plr.y - sprite[i].y);
|
||||
}
|
||||
|
||||
static void fleejudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleejudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -205,8 +225,10 @@ static void fleejudy(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castjudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castjudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -224,10 +246,10 @@ static void castjudy(PLAYER& plr, short i) {
|
|||
if (krand() % 100 > 40) {
|
||||
// raise the dead
|
||||
WHStatIterator it(DEAD);
|
||||
while (auto actor = it.Next())
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
SPRITE& spr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& spr = itActor->s();
|
||||
int j = itActor->GetSpriteIndex();
|
||||
|
||||
spr.lotag = (short)((krand() % 120) + 120);
|
||||
kills--;
|
||||
|
@ -320,8 +342,11 @@ static void castjudy(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void diejudy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diejudy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
|
|
@ -5,8 +5,11 @@ BEGIN_WH_NS
|
|||
|
||||
void spawnabaddy(int i, int monster);
|
||||
|
||||
static void chasekatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasekatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -59,8 +62,10 @@ static void chasekatie(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void resurectkatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectkatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -72,13 +77,19 @@ static void resurectkatie(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchkatie(PLAYER& plr, short i) {
|
||||
static void searchkatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void painkatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painkatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = KATIE;
|
||||
|
@ -91,8 +102,10 @@ static void painkatie(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facekatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facekatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.ang = (short)(getangle(plr.x - spr.x, plr.y - spr.y) & 2047);
|
||||
|
||||
|
@ -121,8 +134,10 @@ static void facekatie(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void attackkatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackkatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -148,8 +163,11 @@ static void attackkatie(PLAYER& plr, short i) {
|
|||
sprite[i].ang = getangle(plr.x - sprite[i].x, plr.y - sprite[i].y);
|
||||
}
|
||||
|
||||
static void fleekatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleekatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -185,8 +203,10 @@ static void fleekatie(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castkatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castkatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -240,8 +260,11 @@ static void castkatie(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void diekatie(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diekatie(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplkobold(PLAYER& plr, short i);
|
||||
static void checkexplkobold(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chasekobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chasekobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -87,11 +90,14 @@ static void chasekobold(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
static void diekobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diekobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -109,8 +115,11 @@ static void diekobold(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = KOBOLD;
|
||||
|
@ -122,12 +131,13 @@ static void painkobold(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
static void facekobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facekobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -155,11 +165,14 @@ static void facekobold(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
static void fleekobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleekobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -189,11 +202,13 @@ static void fleekobold(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
static void attackkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -228,8 +243,10 @@ static void attackkobold(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void resurectkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -241,16 +258,21 @@ static void resurectkobold(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchkobold(PLAYER& plr, short i) {
|
||||
static void searchkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
if ((krand() % 100) > 98)
|
||||
spritesound(S_KSNARL1 + (krand() % 4), &sprite[i]);
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -260,8 +282,10 @@ static void frozenkobold(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -281,8 +305,10 @@ static void nukedkobold(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -304,17 +330,20 @@ static void skirmishkobold(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplkobold(plr, i);
|
||||
checkexplkobold(plr, actor);
|
||||
}
|
||||
|
||||
|
||||
static void checkexplkobold(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplkobold(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sect = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sect->s();
|
||||
int j = sect->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
BEGIN_WH_NS
|
||||
|
||||
|
||||
static void standkurt(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void standkurt(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) {
|
||||
if (cansee(spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7), spr.sectnum, plr.x, plr.y,
|
||||
|
@ -20,25 +22,31 @@ static void standkurt(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedkurt(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedkurt(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
trailingsmoke(i, false);
|
||||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
static void kurtExplo(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void kurtExplo(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
spr.picnum++;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 12;
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sect = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sect->s();
|
||||
int j = sect->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplminotaur(PLAYER& plr, short i);
|
||||
static void checkexplminotaur(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chaseminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chaseminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -84,11 +87,13 @@ static void chaseminotaur(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
static void resurectminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -100,8 +105,10 @@ static void resurectminotaur(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -123,11 +130,13 @@ static void skirmishminotaur(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
static void nukedminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -147,8 +156,11 @@ static void nukedminotaur(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = MINOTAUR;
|
||||
|
@ -160,12 +172,13 @@ static void painminotaur(PLAYER& plr, short i) {
|
|||
processfluid(i, zr_florhit, false);
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
static void faceminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void faceminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -193,11 +206,13 @@ static void faceminotaur(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
static void attackminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -234,8 +249,11 @@ static void attackminotaur(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void dieminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dieminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -253,8 +271,11 @@ static void dieminotaur(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void fleeminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleeminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -284,11 +305,13 @@ static void fleeminotaur(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -298,20 +321,25 @@ static void frozenminotaur(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchminotaur(PLAYER& plr, short i) {
|
||||
static void searchminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplminotaur(plr, i);
|
||||
checkexplminotaur(plr, actor);
|
||||
}
|
||||
|
||||
|
||||
static void checkexplminotaur(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplminotaur(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -5,8 +5,11 @@ BEGIN_WH_NS
|
|||
|
||||
static void newguyarrow(short s, PLAYER& plr);
|
||||
|
||||
static void standnewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void standnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) {
|
||||
if (cansee(spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7), spr.sectnum, plr.x, plr.y,
|
||||
plr.z, plr.sector) && plr.invisibletime < 0) {
|
||||
|
@ -20,8 +23,11 @@ static void standnewguy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void chasenewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chasenewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -100,8 +106,10 @@ static void chasenewguy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void resurectnewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -131,8 +139,10 @@ static void resurectnewguy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishnewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -154,20 +164,29 @@ static void skirmishnewguy(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void searchnewguy(PLAYER& plr, short i) {
|
||||
static void searchnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void nukednewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukednewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
trailingsmoke(i, false);
|
||||
newstatus((short)i, DIE);
|
||||
}
|
||||
|
||||
static void painnewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = NEWGUY;
|
||||
|
@ -180,8 +199,10 @@ static void painnewguy(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void facenewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facenewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -209,8 +230,11 @@ static void facenewguy(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void fleenewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleenewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -243,8 +267,10 @@ static void fleenewguy(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void attacknewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attacknewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -296,8 +322,11 @@ static void attacknewguy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void dienewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dienewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -315,8 +344,10 @@ static void dienewguy(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void castnewguy(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castnewguy(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
|
|
@ -3,29 +3,42 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void chaserat(PLAYER& plr, short i) {
|
||||
static void chaserat(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
newstatus(i, FLEE);
|
||||
}
|
||||
|
||||
static void searchrat(PLAYER& plr, short i) {
|
||||
sprite[i].ang = (short) (((krand() & 512 - 256) + sprite[i].ang + 1024) & 2047);
|
||||
static void searchrat(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
spr.ang = (short) (((krand() & 512 - 256) + spr.ang + 1024) & 2047);
|
||||
newstatus(i, FLEE);
|
||||
}
|
||||
|
||||
static void facerat(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void facerat(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
spr.ang = (short) (((krand() & 512 - 256) + spr.ang + 1024) & 2047); // NEW
|
||||
spr.owner = sprite[plr.spritenum].owner;
|
||||
newstatus(i, FLEE);
|
||||
}
|
||||
|
||||
static void dierat(PLAYER& plr, short i) {
|
||||
static void dierat(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
deletesprite(i);
|
||||
}
|
||||
|
||||
static void fleerat(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleerat(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplskeleton(PLAYER& plr, short i);
|
||||
static void checkexplskeleton(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chaseskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chaseskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -84,11 +87,14 @@ static void chaseskeleton(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplskeleton(plr, i);
|
||||
checkexplskeleton(plr, actor);
|
||||
}
|
||||
|
||||
static void dieskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dieskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -106,9 +112,10 @@ static void dieskeleton(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void faceskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void faceskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -136,11 +143,14 @@ static void faceskeleton(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplskeleton(plr, i);
|
||||
checkexplskeleton(plr, actor);
|
||||
}
|
||||
|
||||
static void fleeskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleeskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.picnum = SKELETON;
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
@ -173,11 +183,13 @@ static void fleeskeleton(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplskeleton(plr, i);
|
||||
checkexplskeleton(plr, actor);
|
||||
}
|
||||
|
||||
static void standskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void standskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
|
||||
if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) {
|
||||
|
@ -202,8 +214,10 @@ static void standskeleton(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void attackskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -238,8 +252,10 @@ static void attackskeleton(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void resurectskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -251,14 +267,19 @@ static void resurectskeleton(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchskeleton(PLAYER& plr, short i) {
|
||||
static void searchskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplskeleton(plr, i);
|
||||
checkexplskeleton(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -268,8 +289,10 @@ static void frozenskeleton(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -289,8 +312,10 @@ static void nukedskeleton(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -312,11 +337,13 @@ static void skirmishskeleton(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplskeleton(plr, i);
|
||||
checkexplskeleton(plr, actor);
|
||||
}
|
||||
|
||||
void skeletonChill(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
void skeletonChill(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -329,13 +356,15 @@ void skeletonChill(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void checkexplskeleton(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplskeleton(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void chaseskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void chaseskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -56,8 +59,10 @@ static void chaseskully(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void resurectskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -69,13 +74,18 @@ static void resurectskully(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void searchskully(PLAYER& plr, short i) {
|
||||
static void searchskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void nukedskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -88,8 +98,11 @@ static void nukedskully(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void painskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void painskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
spr.picnum = SKULLY;
|
||||
|
@ -102,9 +115,10 @@ static void painskully(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void faceskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void faceskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -133,8 +147,10 @@ static void faceskully(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void attackskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -160,8 +176,11 @@ static void attackskully(PLAYER& plr, short i) {
|
|||
sprite[i].ang = getangle(plr.x - sprite[i].x, plr.y - sprite[i].y);
|
||||
}
|
||||
|
||||
static void fleeskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleeskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -192,8 +211,10 @@ static void fleeskully(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void castskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void castskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -210,8 +231,11 @@ static void castskully(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void dieskully(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void dieskully(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void checkexplspider(PLAYER& plr, short i);
|
||||
static void checkexplspider(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chasespider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chasespider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -84,11 +87,13 @@ static void chasespider(PLAYER& plr, short i) {
|
|||
newstatus(i, DIE);
|
||||
}
|
||||
|
||||
checkexplspider(plr, i);
|
||||
checkexplspider(plr, actor);
|
||||
}
|
||||
|
||||
static void resurectspider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void resurectspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -100,8 +105,10 @@ static void resurectspider(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void skirmishspider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void skirmishspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
|
@ -123,17 +130,22 @@ static void skirmishspider(PLAYER& plr, short i) {
|
|||
if (checksector6(i))
|
||||
return;
|
||||
|
||||
checkexplspider(plr, i);
|
||||
checkexplspider(plr, actor);
|
||||
}
|
||||
|
||||
static void searchspider(PLAYER& plr, short i) {
|
||||
static void searchspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
|
||||
aisearch(plr, i, false);
|
||||
if (!checksector6(i))
|
||||
checkexplspider(plr, i);
|
||||
checkexplspider(plr, actor);
|
||||
}
|
||||
|
||||
static void frozenspider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void frozenspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
@ -143,9 +155,10 @@ static void frozenspider(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void facespider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facespider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
boolean cansee = ::cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum);
|
||||
|
@ -173,11 +186,13 @@ static void facespider(PLAYER& plr, short i) {
|
|||
if (checkdist(plr, i))
|
||||
newstatus(i, ATTACK);
|
||||
|
||||
checkexplspider(plr, i);
|
||||
checkexplspider(plr, actor);
|
||||
}
|
||||
|
||||
static void attackspider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
|
||||
spr.z = zr_florz;
|
||||
|
@ -220,8 +235,11 @@ static void attackspider(PLAYER& plr, short i) {
|
|||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleespider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleespider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -252,11 +270,14 @@ static void fleespider(PLAYER& plr, short i) {
|
|||
|
||||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
|
||||
checkexplspider(plr, i);
|
||||
checkexplspider(plr, actor);
|
||||
}
|
||||
|
||||
static void diespider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diespider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -274,13 +295,16 @@ static void diespider(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void checkexplspider(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void checkexplspider(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sectactor = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sectactor->s();
|
||||
int j = sectactor->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
|
||||
BEGIN_WH_NS
|
||||
|
||||
static void willowDrain(PLAYER& plr, short i);
|
||||
static void willowDrain(PLAYER& plr, DWHActor* i);
|
||||
|
||||
static void chasewillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
static void chasewillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0)
|
||||
spr.lotag = 250;
|
||||
|
@ -67,8 +70,10 @@ static void chasewillow(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void attackwillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void attackwillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (plr.z < spr.z)
|
||||
|
@ -138,9 +143,10 @@ static void attackwillow(PLAYER& plr, short i) {
|
|||
spr.z = floorz;
|
||||
}
|
||||
|
||||
static void facewillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
|
||||
static void facewillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
|
||||
spr.sectnum) && plr.invisibletime < 0) {
|
||||
|
@ -167,13 +173,20 @@ static void facewillow(PLAYER& plr, short i) {
|
|||
newstatus(i, ATTACK);
|
||||
}
|
||||
|
||||
static void searchwillow(PLAYER& plr, short i) {
|
||||
static void searchwillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
aisearch(plr, i, true);
|
||||
checksector6(i);
|
||||
}
|
||||
|
||||
static void fleewillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void fleewillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
short osectnum = spr.sectnum;
|
||||
|
||||
|
@ -205,8 +218,11 @@ static void fleewillow(PLAYER& plr, short i) {
|
|||
setsprite(i, spr.x, spr.y, spr.z);
|
||||
}
|
||||
|
||||
static void diewillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void diewillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
|
||||
if (spr.lotag <= 0) {
|
||||
|
@ -227,8 +243,10 @@ static void diewillow(PLAYER& plr, short i) {
|
|||
}
|
||||
}
|
||||
|
||||
static void nukedwillow(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void nukedwillow(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
if (isWh2()) {
|
||||
chunksofmeat(plr, i, spr.x, spr.y, spr.z, spr.sectnum, spr.ang);
|
||||
|
@ -247,14 +265,16 @@ void willowProcess(PLAYER& plr)
|
|||
|
||||
switch (spr.detail) {
|
||||
case WILLOWTYPE:
|
||||
willowDrain(plr, i);
|
||||
willowDrain(plr, actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void willowDrain(PLAYER& plr, short i) {
|
||||
SPRITE& spr = sprite[i];
|
||||
static void willowDrain(PLAYER& plr, DWHActor* actor)
|
||||
{
|
||||
int i = actor->GetSpriteIndex();
|
||||
SPRITE& spr = actor->s();
|
||||
|
||||
spr.lotag -= TICSPERFRAME;
|
||||
if (spr.lotag < 0) {
|
||||
|
|
|
@ -1371,10 +1371,10 @@ void animateobjs(PLAYER& plr) {
|
|||
}
|
||||
|
||||
WHSectIterator it(spr.sectnum);
|
||||
while (auto actor = it.Next())
|
||||
while (auto sect = it.Next())
|
||||
{
|
||||
SPRITE& tspr = actor->s();
|
||||
int j = actor->GetSpriteIndex();
|
||||
SPRITE& tspr = sect->s();
|
||||
int j = sect->GetSpriteIndex();
|
||||
|
||||
int dx = abs(spr.x - tspr.x); // x distance to sprite
|
||||
int dy = abs(spr.y - tspr.y); // y distance to sprite
|
||||
|
|
Loading…
Reference in a new issue