mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- scriptified doorshock
This commit is contained in:
parent
15cd80cad3
commit
63a8c3148c
10 changed files with 25 additions and 37 deletions
|
@ -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();
|
||||
|
|
|
@ -849,11 +849,6 @@ void movestandables_d(void)
|
|||
moveviewscreen(act);
|
||||
}
|
||||
|
||||
else if (picnum == DOORSHOCK)
|
||||
{
|
||||
movedoorshock(act);
|
||||
}
|
||||
|
||||
else if (picnum == TOUCHPLATE)
|
||||
{
|
||||
movetouchplate(act, TOUCHPLATE);
|
||||
|
|
|
@ -732,11 +732,6 @@ void movestandables_r(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
else if (picnum == DOORSHOCK)
|
||||
{
|
||||
movedoorshock(act);
|
||||
}
|
||||
|
||||
else if (picnum == TOUCHPLATE)
|
||||
{
|
||||
movetouchplate(act, TOUCHPLATE);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
{
|
||||
|
|
|
@ -35,4 +35,5 @@ spawnclasses
|
|||
4527 = DukeSideBolt3
|
||||
4528 = DukeSideBolt4
|
||||
660 = DukeWaterdrip
|
||||
160 = DukeDoorshock
|
||||
}
|
||||
|
|
|
@ -27,5 +27,6 @@ spawnclasses
|
|||
1129 = DukeBolt3
|
||||
1130 = DukeBolt4
|
||||
239 = DukeWaterdrip
|
||||
120 = DukeDoorshock
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
22
wadsrc/static/zscript/games/duke/actors/doorshock.zs
Normal file
22
wadsrc/static/zscript/games/duke/actors/doorshock.zs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue