- scriptified doorshock

This commit is contained in:
Christoph Oelckers 2022-11-19 15:40:21 +01:00
parent 15cd80cad3
commit 63a8c3148c
10 changed files with 25 additions and 37 deletions

View file

@ -673,20 +673,6 @@ void detonate(DDukeActor *actor, int explosion)
//
//---------------------------------------------------------------------------
void movedoorshock(DDukeActor* actor)
{
auto sectp = actor->sector();
double j = abs(sectp->ceilingz - sectp->floorz) / 128.;
actor->spr.scale = DVector2(0.25, 0.0625 + j);
actor->spr.pos.Z = sectp->floorz;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void movetouchplate(DDukeActor* actor, int plate)
{
auto sectp = actor->sector();

View file

@ -849,11 +849,6 @@ void movestandables_d(void)
moveviewscreen(act);
}
else if (picnum == DOORSHOCK)
{
movedoorshock(act);
}
else if (picnum == TOUCHPLATE)
{
movetouchplate(act, TOUCHPLATE);

View file

@ -732,11 +732,6 @@ void movestandables_r(void)
continue;
}
else if (picnum == DOORSHOCK)
{
movedoorshock(act);
}
else if (picnum == TOUCHPLATE)
{
movetouchplate(act, TOUCHPLATE);

View file

@ -32,7 +32,6 @@ void movefta();
void clearcameras(int i, player_struct* p);
void RANDOMSCRAP(DDukeActor* i);
void detonate(DDukeActor* i, int explosion);
void movedoorshock(DDukeActor* i);
void movetouchplate(DDukeActor* i, int plate);
void movecanwithsomething(DDukeActor* i);
void bounce(DDukeActor* i);

View file

@ -826,12 +826,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
ChangeActorStat(act, STAT_ACTIVATOR);
break;
case DOORSHOCK:
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
act->spr.shade = -12;
ChangeActorStat(act, STAT_STANDABLE);
break;
case OOZ:
case OOZ2:
{

View file

@ -987,12 +987,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
sectp->lotag ^= 16384;
ChangeActorStat(act, STAT_ACTIVATOR);
break;
case DOORSHOCK:
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
act->spr.shade = -12;
ChangeActorStat(act, STAT_STANDABLE);
break;
case OOZ:
{

View file

@ -35,4 +35,5 @@ spawnclasses
4527 = DukeSideBolt3
4528 = DukeSideBolt4
660 = DukeWaterdrip
160 = DukeDoorshock
}

View file

@ -27,5 +27,6 @@ spawnclasses
1129 = DukeBolt3
1130 = DukeBolt4
239 = DukeWaterdrip
120 = DukeDoorshock
}

View file

@ -63,6 +63,7 @@ version "4.10"
#include "zscript/games/duke/actors/trash.zs"
#include "zscript/games/duke/actors/bolt.zs"
#include "zscript/games/duke/actors/waterdrip.zs"
#include "zscript/games/duke/actors/doorshock.zs"
#include "zscript/games/blood/bloodgame.zs"
#include "zscript/games/blood/ui/menu.zs"

View file

@ -0,0 +1,22 @@
class DukeDoorShock : DukeActor
{
default
{
shade -12;
statnum STAT_STANDABLE;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
}
override void Tick()
{
let sectp = self.sector;
double j = abs(sectp.ceilingz - sectp.floorz) / 128.;
self.scale = (0.25, 0.0625 + j);
self.pos.Z = sectp.floorz;
}
}