- consolidated shoot_d and shoot_r.

This commit is contained in:
Christoph Oelckers 2022-12-23 22:32:37 +01:00
parent ef412c20cc
commit cb8137c32b
21 changed files with 106 additions and 140 deletions

View file

@ -63,6 +63,8 @@ xx(DukeBloodSplat1)
xx(DukeBloodSplat2)
xx(DukeBloodSplat4)
xx(DukeBloodPool)
xx(DukeFirelaser)
xx(RedneckFirelaser)
xx(spawnstate)
xx(brokenstate)
@ -73,4 +75,5 @@ xx(gutsoffset)
xx(falladjustz)
xx(aimoffset)
xx(strength)
xx(autoaimangle)
xx(autoaimangle)
xx(shootzoffset)

View file

@ -177,6 +177,7 @@ static FFlagDef DukeActorFlagDefs[] =
DEFINE_FLAG(SFLAG3, NOHITSCANHIT, DDukeActor, flags1),
DEFINE_FLAG(SFLAG3, SPECIALINIT, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, DONTLIGHTSHOOTER, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, SHOOTCENTERED, DDukeActor, flags3),
};

View file

@ -1055,7 +1055,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
{
auto saved_angle = actor->spr.Angles.Yaw;
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
fi.shoot(actor, RPG, nullptr);
shoot(actor, RPG, nullptr);
actor->spr.Angles.Yaw = saved_angle;
}
}
@ -1541,7 +1541,7 @@ void handle_se05(DDukeActor* actor)
{
auto ang = actor->spr.Angles.Yaw;
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
fi.shoot(actor, -1, PClass::FindActor("DukeFireLaser"));
shoot(actor, -1, PClass::FindActor(isRR()? NAME_RedneckFirelaser : NAME_DukeFirelaser));
actor->spr.Angles.Yaw = ang;
}

View file

@ -1098,7 +1098,7 @@ void moveeffectors_d(void) //STATNUM 3
if (act->counter)
{
if (act->counter == 1)
fi.shoot(act, sc->extra, nullptr);
shoot(act, sc->extra, nullptr);
else if (act->counter == 26 * 5)
act->counter = 0;
act->counter++;

View file

@ -1159,7 +1159,7 @@ void moveeffectors_r(void) //STATNUM 3
if (act->counter)
{
if (act->counter == 1)
fi.shoot(act, sc->extra, nullptr);
shoot(act, sc->extra, nullptr);
else if (act->counter == 26 * 5)
act->counter = 0;
act->counter++;

View file

@ -410,6 +410,7 @@ enum sflags3_t
SFLAG3_NOHITSCANHIT = 0x00000100, // just pretend the hit never happened. RR's tornado uses it.
SFLAG3_SPECIALINIT = 0x00000200, // special aiming case for Duke's BOSS2
SFLAG3_DONTLIGHTSHOOTER = 0x00000400,
SFLAG3_SHOOTCENTERED = 0x00000800, // enemies default to right hand shooting. This disables it.
};

View file

@ -62,8 +62,6 @@ void move_d(DDukeActor* i, int g_p, int g_x);
void move_r(DDukeActor* i, int g_p, int g_x);
void incur_damage_d(player_struct* p);
void incur_damage_r(player_struct* p);
void shoot_d(DDukeActor* i, int atwith, PClass* cls);
void shoot_r(DDukeActor* i, int atwith, PClass* cls);
void selectweapon_d(int snum, int j);
void selectweapon_r(int snum, int j);
int doincrements_d(player_struct* p);
@ -109,7 +107,6 @@ void SetDispatcher()
move_d,
incur_damage_d,
shoot_d,
selectweapon_d,
doincrements_d,
checkweapons_d,
@ -141,7 +138,6 @@ void SetDispatcher()
move_r,
incur_damage_r,
shoot_r,
selectweapon_r,
doincrements_r,
checkweapons_r,

View file

@ -92,7 +92,6 @@ struct Dispatcher
// player
void (*incur_damage)(player_struct* p);
void (*shoot)(DDukeActor*, int, PClass* cls);
void (*selectweapon)(int snum, int j);
int (*doincrements)(player_struct* p);
void (*checkweapons)(player_struct* p);

View file

@ -108,6 +108,7 @@ void playerAimUp(int snum, ESyncBits actions);
void playerAimDown(int snum, ESyncBits actions);
DDukeActor* aim(DDukeActor* s, int aang, bool force = true);
DDukeActor* aim_(DDukeActor* actor, DDukeActor* weapon, double aimangle);
void shoot(DDukeActor* actor, int atwith, PClass* cls);
void checkweapons(player_struct* const p);
int findotherplayer(int p, double* d);
void quickkill(player_struct* p);

View file

@ -652,9 +652,13 @@ PClassActor* CallGetRadiusDamageType(DDukeActor* actor, int targhealth)
//
//==========================================================================
DEFINE_PROPERTY(lookallarounddefault, 0, DukeActor)
DEFINE_PROPERTY(setgamedefaults, 0, DukeActor)
{
if (!isRR()) defaults->flags1 |= SFLAG_LOOKALLAROUND; // feature comes from RR, but we want the option in Duke as well, so this fake property sets the default
if (!isRR())
{
defaults->flags1 |= SFLAG_LOOKALLAROUND; // feature comes from RR, but we want the option in Duke as well, so this fake property sets the default
defaults->FloatVar(NAME_shootzoffset) = -7;
}
else
{
defaults->flags1 |= SFLAG_MOVEFTA_WAKEUPCHECK; // Animals were not supposed to have this, but due to a coding bug the logic was unconditional for everything in the game.

View file

@ -1692,7 +1692,7 @@ int ParseState::parse(void)
break;
case concmd_shoot:
insptr++;
fi.shoot(g_ac, (short)*insptr, nullptr);
shoot(g_ac, (short)*insptr, nullptr);
insptr++;
break;
case concmd_ifsoundid:

View file

@ -908,6 +908,48 @@ void playerAimDown(int snum, ESyncBits actions)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void shoot(DDukeActor* actor, int atwith, PClass* cls)
{
int p;
DVector3 spos;
DAngle sang;
auto const sect = actor->sector();
sang = actor->spr.Angles.Yaw;
if (actor->isPlayer())
{
p = actor->PlayerIndex();
spos = actor->getPosWithOffsetZ().plusZ(ps[p].pyoff + 4);
ps[p].crack_time = CRACK_TIME;
}
else
{
p = -1;
auto tex = TexMan.GetGameTexture(actor->spr.spritetexture());
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tex->GetDisplayHeight() * 0.5) + 4);
spos.Z += actor->FloatVar(NAME_shootzoffset);
if (badguy(actor) && !(actor->flags3 & SFLAG3_SHOOTCENTERED))
{
spos.X -= (sang + DAngle22_5 * 0.75).Sin() * 8;
spos.Y += (sang + DAngle22_5 * 0.75).Cos() * 8;
}
}
if (cls == nullptr)
cls = GetSpawnType(atwith);
CallShootThis(static_cast<DDukeActor*>(GetDefaultByType(cls)), actor, p, spos, sang);
}
//---------------------------------------------------------------------------
//
// split out so that the weapon check can be done right.

View file

@ -81,51 +81,6 @@ void incur_damage_d(player_struct* p)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void shoot_d(DDukeActor* actor, int atwith, PClass *cls)
{
int p;
DVector3 spos;
DAngle sang;
auto const sect = actor->sector();
sang = actor->spr.Angles.Yaw;
if (actor->isPlayer())
{
p = actor->PlayerIndex();
spos = actor->getPosWithOffsetZ().plusZ(ps[p].pyoff + 4);
ps[p].crack_time = CRACK_TIME;
}
else
{
p = -1;
auto tex = TexMan.GetGameTexture(actor->spr.spritetexture());
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tex->GetDisplayHeight() * 0.5) + 4);
if (actor->spr.picnum != DTILE_ROTATEGUN)
{
spos.Z -= 7;
if (badguy(actor) && actor->spr.picnum != DTILE_COMMANDER)
{
spos.X -= (sang + DAngle22_5 * 0.75).Sin() * 8;
spos.Y += (sang + DAngle22_5 * 0.75).Cos() * 8;
}
}
}
if (cls == nullptr)
cls = GetSpawnType(atwith);
CallShootThis(static_cast<DDukeActor*>(GetDefaultByType(cls)), actor, p, spos, sang);
}
//---------------------------------------------------------------------------
//
//
@ -479,7 +434,7 @@ int doincrements_d(player_struct* p)
p->last_quick_kick = p->quick_kick + 1;
p->quick_kick--;
if (p->quick_kick == 8)
fi.shoot(p->GetActor(), DTILE_KNEE, nullptr);
shoot(p->GetActor(), DTILE_KNEE, nullptr);
}
else if (p->last_quick_kick > 0)
p->last_quick_kick--;
@ -1223,7 +1178,7 @@ static void operateweapon(int snum, ESyncBits actions)
case PISTOL_WEAPON: // m-16 in NAM
if (p->kickback_pic == 1)
{
fi.shoot(pact, DTILE_SHOTSPARK1, nullptr);
shoot(pact, DTILE_SHOTSPARK1, nullptr);
S_PlayActorSound(PISTOL_FIRE, pact);
lastvisinc = PlayClock + 32;
p->visibility = 0;
@ -1274,7 +1229,7 @@ static void operateweapon(int snum, ESyncBits actions)
if (p->kickback_pic == 4)
{
for(int ii = 0; ii < 7; ii++)
fi.shoot(pact, DTILE_SHOTGUN, nullptr);
shoot(pact, DTILE_SHOTGUN, nullptr);
p->ammo_amount[SHOTGUN_WEAPON]--;
S_PlayActorSound(SHOTGUN_FIRE, pact);
@ -1343,7 +1298,7 @@ static void operateweapon(int snum, ESyncBits actions)
}
S_PlayActorSound(CHAINGUN_FIRE, pact);
fi.shoot(pact, DTILE_CHAINGUN, nullptr);
shoot(pact, DTILE_CHAINGUN, nullptr);
lastvisinc = PlayClock + 32;
p->visibility = 0;
checkavailweapon(p);
@ -1387,7 +1342,7 @@ static void operateweapon(int snum, ESyncBits actions)
else
p->okickback_pic = p->kickback_pic = 0;
p->ammo_amount[p->curr_weapon]--;
fi.shoot(pact, DTILE_GROWSPARK, nullptr);
shoot(pact, DTILE_GROWSPARK, nullptr);
//#ifdef NAM
//#else
@ -1422,7 +1377,7 @@ static void operateweapon(int snum, ESyncBits actions)
else p->okickback_pic = p->kickback_pic = 0;
p->ammo_amount[SHRINKER_WEAPON]--;
fi.shoot(pact, DTILE_SHRINKER, nullptr);
shoot(pact, DTILE_SHRINKER, nullptr);
if (!isNam())
{
@ -1455,7 +1410,7 @@ static void operateweapon(int snum, ESyncBits actions)
{
p->visibility = 0;
lastvisinc = PlayClock + 32;
fi.shoot(pact, DTILE_RPG, nullptr);
shoot(pact, DTILE_RPG, nullptr);
p->ammo_amount[DEVISTATOR_WEAPON]--;
checkavailweapon(p);
}
@ -1465,7 +1420,7 @@ static void operateweapon(int snum, ESyncBits actions)
{
p->visibility = 0;
lastvisinc = PlayClock + 32;
fi.shoot(pact, DTILE_RPG, nullptr);
shoot(pact, DTILE_RPG, nullptr);
p->ammo_amount[DEVISTATOR_WEAPON]--;
checkavailweapon(p);
if (p->ammo_amount[DEVISTATOR_WEAPON] <= 0) p->okickback_pic = p->kickback_pic = 0;
@ -1485,7 +1440,7 @@ static void operateweapon(int snum, ESyncBits actions)
p->visibility = 0;
lastvisinc = PlayClock + 32;
fi.shoot(pact, DTILE_FREEZEBLAST, nullptr);
shoot(pact, DTILE_FREEZEBLAST, nullptr);
checkavailweapon(p);
}
if (pact->spr.scale.X < 0.5)
@ -1513,7 +1468,7 @@ static void operateweapon(int snum, ESyncBits actions)
if (p->cursector->lotag != 2)
{
p->ammo_amount[FLAMETHROWER_WEAPON]--;
fi.shoot(pact, DTILE_FIREBALL, nullptr);
shoot(pact, DTILE_FIREBALL, nullptr);
}
checkavailweapon(p);
}
@ -1535,7 +1490,7 @@ static void operateweapon(int snum, ESyncBits actions)
p->GetActor()->restorez();
p->vel.Z = 0;
if (p->kickback_pic == 3)
fi.shoot(pact, DTILE_HANDHOLDINGLASER, nullptr);
shoot(pact, DTILE_HANDHOLDINGLASER, nullptr);
}
if (p->kickback_pic == 16)
{
@ -1548,7 +1503,7 @@ static void operateweapon(int snum, ESyncBits actions)
case KNEE_WEAPON:
p->kickback_pic++;
if (p->kickback_pic == 7) fi.shoot(pact, DTILE_KNEE, nullptr);
if (p->kickback_pic == 7) shoot(pact, DTILE_KNEE, nullptr);
else if (p->kickback_pic == 14)
{
if (actions & SB_FIRE)
@ -1567,7 +1522,7 @@ static void operateweapon(int snum, ESyncBits actions)
p->ammo_amount[RPG_WEAPON]--;
lastvisinc = PlayClock + 32;
p->visibility = 0;
fi.shoot(pact, DTILE_RPG, nullptr);
shoot(pact, DTILE_RPG, nullptr);
checkavailweapon(p);
}
else if (p->kickback_pic == 20)

View file

@ -77,47 +77,6 @@ void incur_damage_r(player_struct* p)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void shoot_r(DDukeActor* actor, int atwith, PClass* cls)
{
int p;
DVector3 spos;
DAngle sang;
auto const sect = actor->sector();
sang = actor->spr.Angles.Yaw;
if (actor->isPlayer())
{
p = actor->PlayerIndex();
spos = actor->getPosWithOffsetZ().plusZ(ps[p].pyoff + 4);
if (isRRRA()) ps[p].crack_time = CRACK_TIME;
}
else
{
p = -1;
auto tex = TexMan.GetGameTexture(actor->spr.spritetexture());
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tex->GetDisplayHeight() * 0.5) - 3);
if (badguy(actor))
{
spos.X -= (sang + DAngle22_5 * 0.75).Sin() * 8;
spos.Y += (sang + DAngle22_5 * 0.75).Cos() * 8;
}
}
if (cls == nullptr)
cls = GetSpawnType(atwith);
CallShootThis(static_cast<DDukeActor*>(GetDefaultByType(cls)), actor, p, spos, sang);
}
//---------------------------------------------------------------------------
//
// this is one lousy hack job...
@ -1844,7 +1803,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
case PISTOL_WEAPON:
if (p->kickback_pic == 1)
{
fi.shoot(pact, RTILE_SHOTSPARK1, nullptr);
shoot(pact, RTILE_SHOTSPARK1, nullptr);
S_PlayActorSound(PISTOL_FIRE, pact);
p->noise_radius = 512;
madenoise(snum);
@ -1910,7 +1869,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (p->kickback_pic == 4)
{
for (int ii = 0; ii < 10; ii++)
fi.shoot(pact, RTILE_SHOTGUN, nullptr);
shoot(pact, RTILE_SHOTGUN, nullptr);
p->ammo_amount[SHOTGUN_WEAPON]--;
@ -1928,7 +1887,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (p->shotgun_state[1])
{
for (int ii = 0; ii < 10; ii++)
fi.shoot(pact, RTILE_SHOTGUN, nullptr);
shoot(pact, RTILE_SHOTGUN, nullptr);
p->ammo_amount[SHOTGUN_WEAPON]--;
@ -2019,7 +1978,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
}
S_PlayActorSound(CHAINGUN_FIRE, pact);
fi.shoot(pact, RTILE_CHAINGUN, nullptr);
shoot(pact, RTILE_CHAINGUN, nullptr);
p->noise_radius = 512;
madenoise(snum);
lastvisinc = PlayClock + 32;
@ -2051,7 +2010,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (p->kickback_pic > 3)
{
p->okickback_pic = p->kickback_pic = 0;
fi.shoot(pact, RTILE_GROWSPARK, nullptr);
shoot(pact, RTILE_GROWSPARK, nullptr);
p->noise_radius = 64;
madenoise(snum);
checkavailweapon(p);
@ -2064,7 +2023,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (p->kickback_pic == 1)
{
p->ammo_amount[THROWSAW_WEAPON]--;
fi.shoot(pact, RTILE_SAWBLADE, nullptr);
shoot(pact, RTILE_SAWBLADE, nullptr);
checkavailweapon(p);
}
p->kickback_pic++;
@ -2079,7 +2038,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
p->visibility = 0;
lastvisinc = PlayClock + 32;
S_PlayActorSound(CHAINGUN_FIRE, pact);
fi.shoot(pact, RTILE_SHOTSPARK1, nullptr);
shoot(pact, RTILE_SHOTSPARK1, nullptr);
p->noise_radius = 1024;
madenoise(snum);
p->ammo_amount[TIT_WEAPON]--;
@ -2106,7 +2065,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
p->visibility = 0;
lastvisinc = PlayClock + 32;
S_PlayActorSound(CHAINGUN_FIRE, pact);
fi.shoot(pact, RTILE_CHAINGUN, nullptr);
shoot(pact, RTILE_CHAINGUN, nullptr);
p->noise_radius = 1024;
madenoise(snum);
p->ammo_amount[MOTORCYCLE_WEAPON]--;
@ -2133,7 +2092,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
{
p->MotoSpeed -= 20;
p->ammo_amount[BOAT_WEAPON]--;
fi.shoot(pact, RTILE_BOATGRENADE, nullptr);
shoot(pact, RTILE_BOATGRENADE, nullptr);
}
p->kickback_pic++;
if (p->kickback_pic > 20)
@ -2150,7 +2109,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
case ALIENBLASTER_WEAPON:
p->kickback_pic++;
if (p->kickback_pic >= 7 && p->kickback_pic <= 11)
fi.shoot(pact, RTILE_FIRELASER, nullptr);
shoot(pact, RTILE_FIRELASER, nullptr);
if (p->kickback_pic == 5)
{
@ -2208,7 +2167,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
{
p->ammo_amount[BOWLING_WEAPON]--;
S_PlayActorSound(354, pact);
fi.shoot(pact, RTILE_BOWLINGBALL, nullptr);
shoot(pact, RTILE_BOWLINGBALL, nullptr);
p->noise_radius = 64;
madenoise(snum);
}
@ -2231,7 +2190,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
S_PlayActorSound(426, pact);
if (p->kickback_pic == 12)
{
fi.shoot(pact, RTILE_KNEE, nullptr);
shoot(pact, RTILE_KNEE, nullptr);
p->noise_radius = 64;
madenoise(snum);
}
@ -2249,7 +2208,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
S_PlayActorSound(252, pact);
if (p->kickback_pic == 8)
{
fi.shoot(pact, RTILE_SLINGBLADE, nullptr);
shoot(pact, RTILE_SLINGBLADE, nullptr);
p->noise_radius = 64;
madenoise(snum);
}
@ -2269,7 +2228,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
p->ammo_amount[DYNAMITE_WEAPON]--;
lastvisinc = PlayClock + 32;
p->visibility = 0;
fi.shoot(pact, RTILE_RPG, nullptr);
shoot(pact, RTILE_RPG, nullptr);
p->noise_radius = 2048;
madenoise(snum);
checkavailweapon(p);
@ -2287,7 +2246,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
p->ammo_amount[CHICKEN_WEAPON]--;
lastvisinc = PlayClock + 32;
p->visibility = 0;
fi.shoot(pact, RTILE_RPG2, nullptr);
shoot(pact, RTILE_RPG2, nullptr);
p->noise_radius = 2048;
madenoise(snum);
checkavailweapon(p);

View file

@ -65,10 +65,10 @@ void DoFire(player_struct* p, int snum)
SetGameVarID(g_iWeaponVarID, p->curr_weapon, p->GetActor(), snum);
SetGameVarID(g_iWorksLikeVarID, aplWeaponWorksLike(p->curr_weapon, snum), p->GetActor(), snum);
fi.shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
for (i = 1; i < aplWeaponShotsPerBurst(p->curr_weapon, snum); i++)
{
fi.shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_AMMOPERSHOT)
{
p->ammo_amount[p->curr_weapon]--;
@ -405,7 +405,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
}
SetGameVarID(g_iWeaponVarID, p->curr_weapon, p->GetActor(), snum);
SetGameVarID(g_iWorksLikeVarID, aplWeaponWorksLike(p->curr_weapon, snum), p->GetActor(), snum);
fi.shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
shoot(p->GetActor(), aplWeaponShoots(p->curr_weapon, snum), nullptr);
}
}

View file

@ -194,10 +194,10 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
if (Owner && Owner->isPlayer() && targ->spr.picnum != DTILE_ROTATEGUN && targ->spr.picnum != DTILE_DRONE)
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
{
fi.shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat3));
fi.shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat1));
fi.shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat2));
fi.shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat4));
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat3));
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat1));
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat2));
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat4));
}
if (!(targ->flags2 & SFLAG2_NODAMAGEPUSH)) // RR does not have this.

View file

@ -192,10 +192,10 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
if (Owner && Owner->isPlayer() && targ->spr.picnum != RTILE_DRONE)
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
{
fi.shoot(targ, -1, PClass::FindActor("DukeBloodSplat3"));
fi.shoot(targ, -1, PClass::FindActor("DukeBloodSplat1"));
fi.shoot(targ, -1, PClass::FindActor("DukeBloodSplat2"));
fi.shoot(targ, -1, PClass::FindActor("DukeBloodSplat4"));
shoot(targ, -1, PClass::FindActor("DukeBloodSplat3"));
shoot(targ, -1, PClass::FindActor("DukeBloodSplat1"));
shoot(targ, -1, PClass::FindActor("DukeBloodSplat2"));
shoot(targ, -1, PClass::FindActor("DukeBloodSplat4"));
}
if (targ->spr.statnum == STAT_ZOMBIEACTOR)

View file

@ -648,7 +648,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, spriteheight, duke_sph)
void DukeActor_shoot(DDukeActor* act, PClassActor* intname)
{
fi.shoot(act, -1, intname);
shoot(act, -1, intname);
}
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, shoot, DukeActor_shoot)

View file

@ -7,6 +7,7 @@ class DukeCommander : DukeActor
+KILLCOUNT;
+NOWATERDIP;
+FLOATING;
+SHOOTCENTERED;
gutsoffset -24;
falladjustz 0;
}

View file

@ -46,8 +46,10 @@ class DukeRotateGun : DukeActor
+KILLCOUNT;
+NODAMAGEPUSH;
+NORADIUSPUSH;
+SHOOTCENTERED;
sparkoffset -8;
aimoffset 32;
shootzoffset 0;
}
override void Initialize()

View file

@ -87,7 +87,7 @@ class DukeActor : CoreActor native
{
default
{
lookallarounddefault;
setgamedefaults;
falladjustz 24;
autoaimangle 8.4375;
projectilespread 5.625;
@ -151,6 +151,7 @@ class DukeActor : CoreActor native
meta double autoaimangle;
meta double sparkoffset;
meta double projectilespread;
meta double shootzoffset;
property prefix: none;
property gutsoffset: gutsoffset;
@ -160,6 +161,7 @@ class DukeActor : CoreActor native
property autoaimangle: autoaimangle;
property sparkoffset: sparkoffset;
property projectilespread: projectilespread;
property shootzoffset: shootzoffset;
native void SetSpritesetImage(int index);
native int GetSpritesetSize();