mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- Fixed: The deprecated flag handler for the old bounce flags needs to clear
BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags. - Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that friendly monsters could no longer acquire targets by themselves. - Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag. - Added MBF's monster_backing feature as an actor flag: AVOIDMELEE. SVN r1848 (trunk)
This commit is contained in:
parent
a6d9a37ef7
commit
5822729943
13 changed files with 38 additions and 22 deletions
|
@ -1,4 +1,10 @@
|
|||
September 16, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: The deprecated flag handler for the old bounce flags needs to clear
|
||||
BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags.
|
||||
- Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that
|
||||
friendly monsters could no longer acquire targets by themselves.
|
||||
- Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag.
|
||||
- Added MBF's monster_backing feature as an actor flag: AVOIDMELEE.
|
||||
- Gez's misc. bugs patch:
|
||||
* Moves the dog sound out of the Doom-specific sounds in SNDINFO to address this,
|
||||
* Renames the dog actor to MBFHelperDog to prevent name conflicts,
|
||||
|
|
|
@ -399,7 +399,7 @@ enum EBounceFlags
|
|||
// for them that are not present in ZDoom, so it is necessary to identify it properly.
|
||||
BOUNCE_MBF = 1<<12, // This in itself is not a valid mode, but replaces MBF's MF_BOUNCE flag.
|
||||
|
||||
BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType,
|
||||
BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF,
|
||||
|
||||
// The three "standard" types of bounciness are:
|
||||
// HERETIC - Missile will only bounce off the floor once and then enter
|
||||
|
@ -760,6 +760,7 @@ public:
|
|||
BYTE movedir; // 0-7
|
||||
SBYTE visdir;
|
||||
SWORD movecount; // when 0, select a new dir
|
||||
SWORD strafecount; // for MF3_AVOIDMELEE
|
||||
TObjPtr<AActor> target; // thing being chased/attacked (or NULL)
|
||||
// also the originator for missiles
|
||||
TObjPtr<AActor> lastenemy; // Last known enemy -- killough 2/15/98
|
||||
|
|
|
@ -136,7 +136,6 @@ void InitBotStuff()
|
|||
{ "SkullRod", 27000000, 0, "HornRodFX1" },
|
||||
{ "SkullRodPowered", 27000000, 0, "HornRodFX2" },
|
||||
{ "PhoenixRod", 18350080, WIF_BOT_REACTION_SKILL_THING|WIF_BOT_EXPLOSIVE, "PhoenixFX1" },
|
||||
{ "PhoenixRodPowered", 0, WIF_BOT_MELEE, "PhoenixFX2" },
|
||||
{ "Mace", 27000000, WIF_BOT_REACTION_SKILL_THING, "MaceFX2" },
|
||||
{ "MacePowered", 27000000, WIF_BOT_REACTION_SKILL_THING|WIF_BOT_EXPLOSIVE, "MaceFX4" },
|
||||
{ "FWeapHammer", 22000000, 0, "HammerMissile" },
|
||||
|
|
|
@ -175,7 +175,7 @@ void FCajunMaster::Dofire (AActor *actor, ticcmd_t *cmd)
|
|||
(actor->y + actor->vely) - (enemy->y + enemy->vely));
|
||||
|
||||
//FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go.
|
||||
if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE)
|
||||
if (actor->player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON)
|
||||
{
|
||||
if ((actor->player->ReadyWeapon->ProjectileType != NULL))
|
||||
{
|
||||
|
|
|
@ -342,7 +342,7 @@ void FCajunMaster::TurnToAng (AActor *actor)
|
|||
|
||||
if(actor->player->enemy)
|
||||
if(!actor->player->dest) //happens when running after item in combat situations, or normal, prevents weak turns
|
||||
if(actor->player->ReadyWeapon->ProjectileType == NULL && !(actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE))
|
||||
if(actor->player->ReadyWeapon->ProjectileType == NULL && !(actor->player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON))
|
||||
if(Check_LOS(actor, actor->player->enemy, SHOOTFOV+5*ANGLE_1))
|
||||
maxturn = 3;
|
||||
}
|
||||
|
|
|
@ -322,6 +322,7 @@ enum
|
|||
WIF_NO_AUTO_SWITCH = 0x00001000, // never switch to this weapon when it's picked up
|
||||
WIF_STAFF2_KICKBACK = 0x00002000, // the powered-up Heretic staff has special kickback
|
||||
WIF_NOAUTOAIM = 0x00004000, // this weapon never uses autoaim (useful for ballistic projectiles)
|
||||
WIF_MELEEWEAPON = 0x00008000, // melee weapon. Used by bots and monster AI.
|
||||
|
||||
WIF_CHEATNOTWEAPON = 0x08000000, // Give cheat considers this not a weapon (used by Sigil)
|
||||
|
||||
|
@ -329,7 +330,6 @@ enum
|
|||
|
||||
WIF_BOT_REACTION_SKILL_THING = 1<<31, // I don't understand this
|
||||
WIF_BOT_EXPLOSIVE = 1<<30, // weapon fires an explosive
|
||||
WIF_BOT_MELEE = 1<<29, // melee weapon
|
||||
WIF_BOT_BFG = 1<<28, // this is a BFG
|
||||
};
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ static FRandom pr_dropoff ("Dropoff");
|
|||
static FRandom pr_defect ("Defect");
|
||||
|
||||
static FRandom pr_skiptarget("SkipTarget");
|
||||
static FRandom pr_enemystrafe("EnemyStrafe");
|
||||
|
||||
// movement interpolation is fine for objects that are moved by their own
|
||||
// velocity. But for monsters it is problematic.
|
||||
|
@ -772,9 +773,7 @@ void P_NewChaseDir(AActor * actor)
|
|||
fixed_t deltax;
|
||||
fixed_t deltay;
|
||||
|
||||
#ifdef MBF_STUFF
|
||||
actor->strafecount = 0;
|
||||
#endif
|
||||
|
||||
if ((actor->flags5&MF5_CHASEGOAL || actor->goal == actor->target) && actor->goal!=NULL)
|
||||
{
|
||||
|
@ -882,15 +881,16 @@ void P_NewChaseDir(AActor * actor)
|
|||
else
|
||||
#endif
|
||||
|
||||
#ifdef MBF_STUFF
|
||||
// MBF's monster_backing option. Made an actor flag instead. Also cleaned the code up to make it readable.
|
||||
// Todo: implement the movement logic
|
||||
AActor *target = actor->target;
|
||||
if (target->health > 0 && !actor->IsFriend(target))
|
||||
{ // Live enemy target
|
||||
|
||||
if (actor->flags3 & MF3_AVOIDMELEE)
|
||||
{
|
||||
bool ismeleeattacker = false;
|
||||
fixed_t dist = P_AproxDistance(actor->x-target->x, actor->y-target->y);
|
||||
if (target->player == NULL)
|
||||
{
|
||||
ismeleeattacker = (target->MissileState == NULL && dist < (target->meleerange + target->radius)*2);
|
||||
|
@ -899,7 +899,7 @@ void P_NewChaseDir(AActor * actor)
|
|||
{
|
||||
// melee range of player weapon is a parameter of the action function and cannot be checked here.
|
||||
// Add a new weapon property?
|
||||
ismeleeattacker = (target->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE && dist < MELEERANGE*3);
|
||||
ismeleeattacker = (target->player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON && dist < MELEERANGE*3);
|
||||
}
|
||||
if (ismeleeattacker)
|
||||
{
|
||||
|
@ -908,18 +908,14 @@ void P_NewChaseDir(AActor * actor)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
P_DoNewChaseDir(actor, deltax, deltay);
|
||||
|
||||
#ifdef MBF_STUFF
|
||||
// If strafing, set movecount to strafecount so that old Doom
|
||||
// logic still works the same, except in the strafing part
|
||||
|
||||
if (actor->strafecount)
|
||||
actor->movecount = actor->strafecount;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -1566,7 +1562,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
|||
}
|
||||
#endif
|
||||
// [SP] If you don't see any enemies in deathmatch, look for players (but only when friend to a specific player.)
|
||||
if (actor->FriendPlayer == 0) return false;
|
||||
if (actor->FriendPlayer == 0) return result;
|
||||
if (result || !deathmatch) return true;
|
||||
|
||||
|
||||
|
@ -2156,7 +2152,11 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
}
|
||||
|
||||
// turn towards movement direction if not there yet
|
||||
if (actor->movedir < 8)
|
||||
if (actor->strafecount)
|
||||
{
|
||||
A_FaceTarget(actor);
|
||||
}
|
||||
else if (actor->movedir < 8)
|
||||
{
|
||||
actor->angle &= (angle_t)(7<<29);
|
||||
delta = actor->angle - (actor->movedir << 29);
|
||||
|
@ -2404,6 +2404,9 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
// chase towards player
|
||||
//
|
||||
|
||||
if (actor->strafecount)
|
||||
actor->strafecount--;
|
||||
|
||||
// class bosses don't do this when strafing
|
||||
if ((!fastchase || !actor->FastChaseStrafeCount) && !dontmove)
|
||||
{
|
||||
|
|
|
@ -240,6 +240,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< movedir
|
||||
<< visdir
|
||||
<< movecount
|
||||
<< strafecount
|
||||
<< target
|
||||
<< lastenemy
|
||||
<< LastHeard
|
||||
|
|
|
@ -354,12 +354,14 @@ void FTGATexture::MakeTexture ()
|
|||
int step_x = (hdr.bpp>>3);
|
||||
int Pitch = Width * step_x;
|
||||
|
||||
/*
|
||||
if (hdr.img_desc&32)
|
||||
{
|
||||
ptr += (Width-1) * step_x;
|
||||
step_x =- step_x;
|
||||
}
|
||||
if (!(hdr.img_desc&64))
|
||||
*/
|
||||
if (!(hdr.img_desc&32))
|
||||
{
|
||||
ptr += (Height-1) * Pitch;
|
||||
Pitch = -Pitch;
|
||||
|
@ -557,12 +559,14 @@ int FTGATexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int w, int h, i
|
|||
int step_x = (hdr.bpp>>3);
|
||||
int Pitch = Width * step_x;
|
||||
|
||||
/*
|
||||
if (hdr.img_desc&32)
|
||||
{
|
||||
ptr += (Width-1) * step_x;
|
||||
step_x =- step_x;
|
||||
}
|
||||
if (!(hdr.img_desc&64))
|
||||
*/
|
||||
if (!(hdr.img_desc&32))
|
||||
{
|
||||
ptr += (Height-1) * Pitch;
|
||||
Pitch = -Pitch;
|
||||
|
|
|
@ -141,6 +141,7 @@ static FFlagDef ActorFlags[]=
|
|||
DEFINE_FLAG(MF3, NOTARGET, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, DONTGIB, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, NOBLOCKMONST, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, AVOIDMELEE, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, FULLVOLDEATH, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, FOILINVUL, AActor, flags3),
|
||||
DEFINE_FLAG(MF3, NOTELEOTHER, AActor, flags3),
|
||||
|
@ -295,7 +296,7 @@ static FFlagDef WeaponFlags[] =
|
|||
DEFINE_FLAG(WIF, POWERED_UP, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF, STAFF2_KICKBACK, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF_BOT, EXPLOSIVE, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG2(WIF_BOT_MELEE, MELEEWEAPON, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF, MELEEWEAPON, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF_BOT, BFG, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF, CHEATNOTWEAPON, AWeapon, WeaponFlags),
|
||||
DEFINE_FLAG(WIF, NO_AUTO_SWITCH, AWeapon, WeaponFlags),
|
||||
|
|
|
@ -130,15 +130,15 @@ void HandleDeprecatedFlags(AActor *defaults, FActorInfo *info, bool set, int ind
|
|||
break;
|
||||
// the bounce flags will set the compatibility bounce modes to remain compatible
|
||||
case DEPF_HERETICBOUNCE:
|
||||
defaults->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
||||
if (set) defaults->BounceFlags |= BOUNCE_HereticCompat;
|
||||
break;
|
||||
case DEPF_HEXENBOUNCE:
|
||||
defaults->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
||||
if (set) defaults->BounceFlags |= BOUNCE_HexenCompat;
|
||||
break;
|
||||
case DEPF_DOOMBOUNCE:
|
||||
defaults->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
defaults->BounceFlags &= ~(BOUNCE_TypeMask|BOUNCE_UseSeeSound);
|
||||
if (set) defaults->BounceFlags |= BOUNCE_DoomCompat;
|
||||
break;
|
||||
case DEPF_PICKUPFLASH:
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 1823
|
||||
#define MINSAVEVER 1848
|
||||
|
||||
#if SVN_REVISION_NUMBER < MINSAVEVER
|
||||
// Never write a savegame with a version lower than what we need
|
||||
|
|
|
@ -1034,6 +1034,7 @@ ACTOR PhoenixRodPowered : PhoenixRod native
|
|||
{
|
||||
Game Heretic
|
||||
+WEAPON.POWERED_UP
|
||||
+WEAPON.MELEEWEAPON
|
||||
Weapon.SisterWeapon "PhoenixRod"
|
||||
Weapon.AmmoGive 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue