diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 2a54de8e5..1ab13138a 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -379,6 +379,7 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip clipmove(ppos, &dasectp, change * 0.5, 64., 4., 4., cliptype, result); else { + // todo: move this mess to the actor definitions once we have them all available. double clipdist; if (actor->spr.picnum == DTILE_LIZMAN) clipdist = 18.25; @@ -393,7 +394,7 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip // conditional code from hell... if (dasectp == nullptr || (dasectp != nullptr && ((actor->actorstayput != nullptr && actor->actorstayput != dasectp) || - ((actor->spr.picnum == DTILE_BOSS2) && actor->spr.pal == 0 && dasectp->lotag != 3) || + ((actor->spr.picnum == DTILE_BOSS2) && actor->spr.pal == 0 && dasectp->lotag != ST_3) || ((actor->spr.picnum == DTILE_BOSS1 || actor->spr.picnum == DTILE_BOSS2) && dasectp->lotag == ST_1_ABOVE_WATER) || (dasectp->lotag == ST_1_ABOVE_WATER && (actor->spr.picnum == DTILE_LIZMAN || (actor->spr.picnum == DTILE_LIZTROOP && actor->vel.Z == 0))) )) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 29e411601..aa11d8412 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -988,20 +988,6 @@ void shoot_d(DDukeActor* actor, int atwith, PClass *cls) case DTILE_FIREBALL: shootfireball(actor, p, spos, sang); return; - - case DTILE_FIREFLY: // DTILE_BOSS5 shot - { - auto k = spawn(actor, atwith); - if (k) - { - k->setsector(sect); - k->spr.pos = spos; - k->spr.Angles.Yaw = sang; - k->vel.X = 500 / 16.; - k->vel.Z = 0; - } - return; - } } } diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index e9f283cc4..c9b7ff940 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -70,34 +70,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* { switch (act->spr.picnum) { - case DTILE_FIREFLY: - act->spr.scale = DVector2(0.625, 0.625); - act->clipdist = 20; - - if (actj) - act->spr.lotag = 0; - - if ((act->spr.lotag > ud.player_skill) || ud.monsters_off) - { - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_MISC); - break; - } - else - { - makeitfall(act); - - act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; - - if (actj) { - act->timetosleep = 0; - check_fta_sounds_d(act); - ChangeActorStat(act, STAT_ACTOR); - } - else - ChangeActorStat(act, STAT_ZOMBIEACTOR); - } - return act; case DTILE_WHISPYSMOKE: ChangeActorStat(act, STAT_MISC); act->spr.pos.X += krandf(16) - 8; diff --git a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses index 81ac465a3..3d7c36d69 100644 --- a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses @@ -12,6 +12,7 @@ spawnclasses 5310 = DukeBoss5 5311 = DukeBoss5Stayput + 5180 = DukeFirefly 5134 = DukeFlamethrowerSprite 5135 = DukeFlamethrowerAmmo diff --git a/wadsrc/static/zscript/games/duke/actors/firefly.zs b/wadsrc/static/zscript/games/duke/actors/firefly.zs index 3d219107d..2e029a706 100644 --- a/wadsrc/static/zscript/games/duke/actors/firefly.zs +++ b/wadsrc/static/zscript/games/duke/actors/firefly.zs @@ -1,6 +1,4 @@ -// for now only the effect is scriptified. - class DukeFireflyFlyingEffect : DukeActor { default @@ -45,3 +43,27 @@ class DukeFireflyFlyingEffect : DukeActor } } } + +class DukeFirefly : DukeActor +{ + default + { + pic "FIREFLY"; + } + + override bool ShootThis(DukeActor shooter, DukePlayer p, Vector3 spos, double sang) + { + let k = shooter.spawn("DukeFirefly"); + if (k) + { + k.sector = shooter.sector; + k.pos = spos; + k.Angle = sang; + k.vel.X = 500 / 16.; + k.vel.Z = 0; + } + return true; + } +} + + \ No newline at end of file