diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index e661f9856..244a05879 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -1814,6 +1814,51 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckFor3DCeilingHit, CheckFor3DCeilingHit ACTION_RETURN_BOOL(P_CheckFor3DCeilingHit(self, z, trigger)); } +//===================================================================================== +// +// Bounce exports +// +//===================================================================================== +DEFINE_ACTION_FUNCTION(AActor, BounceActor) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_OBJECT(blocking, AActor); + PARAM_BOOL(onTop); + + ACTION_RETURN_BOOL(P_BounceActor(self, blocking, onTop)); +} + +DEFINE_ACTION_FUNCTION(AActor, BounceWall) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_POINTER(l, line_t); + + auto cur = self->BlockingLine; + if (l) + self->BlockingLine = l; + + bool res = P_BounceWall(self); + self->BlockingLine = cur; + + ACTION_RETURN_BOOL(res); +} + +DEFINE_ACTION_FUNCTION(AActor, BouncePlane) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_POINTER(plane, secplane_t); + + ACTION_RETURN_BOOL(self->FloorBounceMissile(*plane)); +} + +DEFINE_ACTION_FUNCTION(AActor, PlayBounceSound) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_BOOL(onFloor); + + self->PlayBounceSound(onFloor); + return 0; +} static int isFrozen(AActor *self) diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index fe8feefc3..0b62a64fd 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -810,6 +810,10 @@ class Actor : Thinker native native clearscope double GetGravity() const; native void DoMissileDamage(Actor target); native void PlayPushSound(); + native bool BounceActor(Actor blocking, bool onTop); + native bool BounceWall(Line l = null); + native bool BouncePlane(SecPlane plane); + native void PlayBounceSound(bool onFloor); clearscope double PitchTo(Actor target, double zOfs = 0, double targZOfs = 0, bool absolute = false) const {