- preparations for the next script exports.

This commit is contained in:
Christoph Oelckers 2022-12-02 23:26:55 +01:00
parent 10e4c90d37
commit cbb3b0ebfb
10 changed files with 26 additions and 12 deletions

View file

@ -25,6 +25,7 @@ xx(DukeGlassPieces1)
xx(DukeGlassPieces2)
xx(DukeNaturalLightning)
xx(RedneckBowlingPin)
xx(DukeReactor)
xx(spawnstate)
xx(brokenstate)

View file

@ -1841,7 +1841,7 @@ void handle_se15(DDukeActor* actor)
//
//---------------------------------------------------------------------------
void handle_se16(DDukeActor* actor, int REACTOR, int REACTOR2)
void handle_se16(DDukeActor* actor)
{
auto sc = actor->sector();
@ -1860,7 +1860,7 @@ void handle_se16(DDukeActor* actor, int REACTOR, int REACTOR2)
DDukeActor* a2;
while ((a2 = it.Next()))
{
if (a2->spr.picnum == REACTOR || a2->spr.picnum == REACTOR2)
if (a2->IsKindOf(NAME_DukeReactor) && a2->spritesetindex == 0)
return;
}
if (a2 == nullptr)

View file

@ -1540,7 +1540,7 @@ void moveeffectors_d(void) //STATNUM 3
break;
case SE_16_REACTOR:
handle_se16(act, REACTOR, REACTOR2);
handle_se16(act);
break;
case SE_17_WARP_ELEVATOR:

View file

@ -1460,7 +1460,7 @@ void moveeffectors_r(void) //STATNUM 3
break;
case SE_16_REACTOR:
handle_se16(act, REACTOR, REACTOR2);
handle_se16(act);
break;
case SE_17_WARP_ELEVATOR:

View file

@ -127,6 +127,7 @@ bool CallAnimate(DDukeActor* actor, tspritetype* hitter);
bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang);
void CallStaticSetup(DDukeActor* actor);
void CallPlayFTASound(DDukeActor* actor);
void CallStandingOn(DDukeActor* actor, player_struct* p);
END_DUKE_NS

View file

@ -59,7 +59,7 @@ void handle_se11(DDukeActor* i);
void handle_se12(DDukeActor* i, int planeonly = 0);
void handle_se13(DDukeActor* i);
void handle_se15(DDukeActor* i);
void handle_se16(DDukeActor* i, int REACTOR, int REACTOR2);
void handle_se16(DDukeActor* i);
void handle_se17(DDukeActor* i);
void handle_se18(DDukeActor* i, bool morecheck);
void handle_se19(DDukeActor* i, int BIGFORCE);

View file

@ -528,5 +528,14 @@ void CallPlayFTASound(DDukeActor* actor)
}
}
void CallStandingOn(DDukeActor* actor, player_struct* p)
{
IFVIRTUALPTR(actor, DDukeActor, StandingOn)
{
VMValue val[] = { actor, p };
VMCall(func, val, 2, nullptr, 0);
}
}
END_DUKE_NS

View file

@ -2759,6 +2759,7 @@ void processinput_d(int snum)
auto ang = (clz.actor()->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle();
p->vel.XY() -= ang.ToVector();
}
CallStandingOn(clz.actor(), p);
}

View file

@ -684,13 +684,13 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at
if (actor->spr.extra >= 0) actor->spr.shade = -96;
scount = 1;
if (atwith == 3471)
if (atwith == OWHIP)
{
vel = 300/16.;
pos.Z -= 15;
scount = 1;
}
else if (atwith == 3475)
else if (atwith == UWHIP)
{
vel = 300/16;
pos.Z += 4;
@ -3361,12 +3361,13 @@ void processinput_r(int snum)
{
if ((actions & SB_CROUCH) && !p->OnMotorcycle)
//if (Sound[436].num == 0)
{
S_PlayActorSound(436, pact);
p->last_pissed_time = 4000;
p->eat = 0;
}
{
S_PlayActorSound(436, pact);
p->last_pissed_time = 4000;
p->eat = 0;
}
}
else CallStandingOn(clz.actor(), p);
}

View file

@ -196,6 +196,7 @@ class DukeActor : CoreActor native
virtual bool animate(tspritetype tspr) { return false; }
virtual void RunState() {} // this is the CON function.
virtual void PlayFTASound() {}
virtual void StandingOn(DukePlayer p) {}
virtual bool shootthis(DukeActor actor, DukePlayer p, Vector3 pos, double ang) const // this gets called on the defaults.
{
return false;