diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8cd1a04ac..4961e1902 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,13 @@ -June 5, 2009 +June 6, 2009 (Changes by Graf Zahl) +- Added a 'resetinventory' MAPINFO option. +- Added MF6_NOFEAR flag. +- Added A_MonsterRefire(probability, jumptarget). +- Added A_JumpIfTargetInSight(state) action function. +- Changed: Puffs set their angle to face the originator of the attack. +- Strife's burning hands originally make the level view fullbright. + changed in ZDoom to do partial brightening. + +June 5, 2009 - Added support for horizontal mouse wheels, and set invprev/invnext as default bindings for it. This is Vista only. DirectInput mouse (in_mouse 2) does not support it, because the DirectInput mouse device does not expose diff --git a/src/actor.h b/src/actor.h index 61c45c6fd..62851f7f4 100644 --- a/src/actor.h +++ b/src/actor.h @@ -308,6 +308,7 @@ enum MF6_THRUSPECIES = 0x00000002, // Actors passes through other of the same species. MF6_MTHRUSPECIES = 0x00000004, // Missile passes through actors of its shooter's species. MF6_FORCEPAIN = 0x00000008, // forces target into painstate (unless it has the NOPAIN flag) + MF6_NOFEAR = 0x00000010, // Not scared of frightening players // --- mobj.renderflags --- diff --git a/src/g_level.cpp b/src/g_level.cpp index f55bd9454..efba61cbd 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -549,6 +549,8 @@ static bool g_nomonsters; void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nextSkill, bool nointermission, bool resetinv, bool nomonsters) { + level_info_t *nextinfo = NULL; + if (unloading) { Printf (TEXTCOLOR_RED "Unloading scripts cannot exit the level again.\n"); @@ -559,7 +561,7 @@ void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nex if (strncmp(levelname, "enDSeQ", 6)) { - level_info_t *nextinfo = FindLevelInfo (nextlevel)->CheckLevelRedirect (); + nextinfo = FindLevelInfo (nextlevel)->CheckLevelRedirect (); if (nextinfo) { nextlevel = nextinfo->mapname; @@ -573,12 +575,20 @@ void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nex if (nointermission) level.flags |= LEVEL_NOINTERMISSION; cluster_info_t *thiscluster = FindClusterInfo (level.cluster); - cluster_info_t *nextcluster = FindClusterInfo (FindLevelInfo (nextlevel)->cluster); + cluster_info_t *nextcluster = nextinfo? FindClusterInfo (nextinfo->cluster) : NULL; startpos = position; startkeepfacing = keepFacing; gameaction = ga_completed; resetinventory = resetinv; + + if (nextinfo != NULL) + { + if (thiscluster != nextcluster || (thiscluster && !(thiscluster->flags & CLUSTER_HUB))) + { + resetinventory |= !!(nextinfo->flags2 & LEVEL2_RESETINVENTORY); + } + } bglobal.End(); //Added by MC: diff --git a/src/g_level.h b/src/g_level.h index 850b59220..2b82f8495 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -198,6 +198,7 @@ enum ELevelFlags LEVEL2_SMOOTHLIGHTING = 0x01000000, // Level uses the smooth lighting feature. LEVEL2_POLYGRIND = 0x02000000, // Polyobjects grind corpses to gibs. + LEVEL2_RESETINVENTORY = 0x04000000, // Resets player inventory when starting this level (unless in a hub) }; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index d0237cfc0..1a57c8c30 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1316,6 +1316,7 @@ MapFlagHandlers[] = { "nocheckswitchrange", MITYPE_CLRFLAG2, LEVEL2_CHECKSWITCHRANGE, 0 }, { "grinding_polyobj", MITYPE_SETFLAG2, LEVEL2_POLYGRIND, 0 }, { "no_grinding_polyobj", MITYPE_CLRFLAG2, LEVEL2_POLYGRIND, 0 }, + { "resetinventory", MITYPE_SETFLAG2, LEVEL2_RESETINVENTORY, 0 }, { "unfreezesingleplayerconversations",MITYPE_SETFLAG2, LEVEL2_CONV_SINGLE_UNFREEZE, 0 }, { "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes { "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX}, diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 36a1e3ec9..5f7de6519 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -674,6 +674,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns) self->player->ReadyWeapon = NULL; self->player->PendingWeapon = WP_NOCHANGE; self->player->playerstate = PST_LIVE; + self->player->extralight = 3; } } @@ -705,6 +706,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower) { P_SetPsprite (self->player, ps_weapon, NULL); } + if (self->player->extralight > 0) self->player->extralight--; } } diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 7cc0ef059..f8433acde 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -724,11 +724,14 @@ void P_NewChaseDir(AActor * actor) deltax = actor->target->x - actor->x; deltay = actor->target->y - actor->y; - if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) || - (actor->flags4 & MF4_FRIGHTENED)) + if (!(actor->flags6 & MF6_NOFEAR)) { - deltax = -deltax; - deltay = -deltay; + if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) || + (actor->flags4 & MF4_FRIGHTENED)) + { + deltax = -deltax; + deltay = -deltay; + } } } else diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 941b0a1a7..6b8d0d8ce 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4272,6 +4272,7 @@ AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t puff = Spawn (pufftype, x, y, z, ALLOW_REPLACE); if (puff == NULL) return NULL; + if (source != NULL) puff->angle = R_PointToAngle2(x, y, source->x, source->y); // If a puff has a crash state and an actor was not hit, // it will enter the crash state. This is used by the StrifeSpark diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 157dcde53..ef43feac0 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -80,6 +80,7 @@ static FRandom pr_crailgun ("CustomRailgun"); static FRandom pr_spawndebris ("SpawnDebris"); static FRandom pr_spawnitemex ("SpawnItemEx"); static FRandom pr_burst ("Burst"); +static FRandom pr_monsterrefire ("MonsterRefire"); //========================================================================== @@ -1772,6 +1773,24 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSight) } +//=========================================================================== +// +// A_JumpIfTargetInSight +// jumps if monster can see its target +// +//=========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInSight) +{ + ACTION_PARAM_START(1); + ACTION_PARAM_STATE(jump, 0); + + ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains! + if (self->target == NULL || !P_CheckSight(self, self->target,4)) return; + ACTION_JUMP(jump); + +} + + //=========================================================================== // // Inventory drop @@ -2455,4 +2474,31 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren) P_RemoveThing(mo); } } -} \ No newline at end of file +} + +//=========================================================================== +// +// keep firing unless target got out of sight +// +//=========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire) +{ + ACTION_PARAM_START(2); + ACTION_PARAM_INT(prob, 0); + ACTION_PARAM_STATE(jump, 1); + + ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains! + A_FaceTarget (self); + + if (pr_monsterrefire() < prob) + return; + + if (!self->target + || P_HitFriend (self) + || self->target->health <= 0 + || !P_CheckSight (self, self->target, 0) ) + { + ACTION_JUMP(jump); + } +} + diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index e65d0ea01..9585af9eb 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -213,6 +213,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, THRUSPECIES, AActor, flags6), DEFINE_FLAG(MF6, MTHRUSPECIES, AActor, flags6), DEFINE_FLAG(MF6, FORCEPAIN, AActor, flags6), + DEFINE_FLAG(MF6, NOFEAR, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index c0f7b2740..907c1d618 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -236,6 +236,9 @@ ACTOR Actor native //: Thinker action native A_RemoveForcefield(); action native A_DropWeaponPieces(class p1, class p2, class p3); action native A_PigPain (); + + action native A_JumpIfTargetInSight(state label); + action native A_MonsterRefire(int chance, state label); States {