- add 'FriendlySeeBlocks' actor property that allows a modder to expand the maximum radius that a friendly monster can see enemies.

This commit is contained in:
Rachael Alexanderson 2018-01-09 12:34:01 -05:00
parent f68d90accb
commit 7416f42b47
4 changed files with 7 additions and 1 deletions

View file

@ -1169,6 +1169,7 @@ public:
int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything. int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything.
FString * Tag; // Strife's tag name. FString * Tag; // Strife's tag name.
int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players. int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players.
int friendlyseeblocks; // allow to override friendly search distance calculation
AActor *BlockingMobj; // Actor that blocked the last move AActor *BlockingMobj; // Actor that blocked the last move
line_t *BlockingLine; // Line that blocked the last move line_t *BlockingLine; // Line that blocked the last move

View file

@ -1704,7 +1704,7 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params)
{ {
AActor *other; AActor *other;
other = P_BlockmapSearch (actor, 10, LookForEnemiesInBlock, params); other = P_BlockmapSearch (actor, actor->friendlyseeblocks, LookForEnemiesInBlock, params);
if (other != NULL) if (other != NULL)
{ {

View file

@ -355,6 +355,7 @@ DEFINE_FIELD(AActor, BloodColor)
DEFINE_FIELD(AActor, BloodTranslation) DEFINE_FIELD(AActor, BloodTranslation)
DEFINE_FIELD(AActor, RenderHidden) DEFINE_FIELD(AActor, RenderHidden)
DEFINE_FIELD(AActor, RenderRequired) DEFINE_FIELD(AActor, RenderRequired)
DEFINE_FIELD(AActor, friendlyseeblocks)
//========================================================================== //==========================================================================
// //
@ -533,6 +534,7 @@ void AActor::Serialize(FSerializer &arc)
A("stealthalpha", StealthAlpha) A("stealthalpha", StealthAlpha)
A("renderhidden", RenderHidden) A("renderhidden", RenderHidden)
A("renderrequired", RenderRequired); A("renderrequired", RenderRequired);
A("friendlyseeblocks", friendlyseeblocks);
} }
#undef A #undef A

View file

@ -203,6 +203,7 @@ class Actor : Thinker native
native readonly int BloodTranslation; native readonly int BloodTranslation;
native int RenderHidden; native int RenderHidden;
native int RenderRequired; native int RenderRequired;
native readonly int FriendlySeeBlocks;
meta String Obituary; // Player was killed by this actor meta String Obituary; // Player was killed by this actor
meta String HitObituary; // Player was killed by this actor in melee meta String HitObituary; // Player was killed by this actor in melee
@ -292,6 +293,7 @@ class Actor : Thinker native
property RipLevelMax: RipLevelMax; property RipLevelMax: RipLevelMax;
property RenderHidden: RenderHidden; property RenderHidden: RenderHidden;
property RenderRequired: RenderRequired; property RenderRequired: RenderRequired;
property FriendlySeeBlocks: FriendlySeeBlocks;
// need some definition work first // need some definition work first
//FRenderStyle RenderStyle; //FRenderStyle RenderStyle;
@ -372,6 +374,7 @@ class Actor : Thinker native
BurnHeight -1; BurnHeight -1;
RenderHidden 0; RenderHidden 0;
RenderRequired 0; RenderRequired 0;
FriendlySeeBlocks 10; // 10 (blocks) * 128 (one map unit block)
} }
// Functions // Functions