add SpawnMultiCoopOnly mapinfo flag to spawn **only** coop spawns in single-player

This commit is contained in:
Ricardo Luís Vaz Silva 2024-09-08 17:01:51 -03:00
parent 5895f9b1b1
commit afcd38907c
4 changed files with 17 additions and 3 deletions

View file

@ -510,6 +510,7 @@ enum ESkillProperty
SKILLP_PlayerRespawn,
SKILLP_SpawnMulti,
SKILLP_InstantReaction,
SKILLP_SpawnMultiCoopOnly,
};
enum EFSkillProperty // floating point properties
{
@ -555,6 +556,7 @@ struct FSkillInfo
int SpawnFilter;
bool SpawnMulti;
bool InstantReaction;
bool SpawnMultiCoopOnly;
int ACSReturn;
FString MenuName;
FString PicName;

View file

@ -77,6 +77,7 @@ void FMapInfoParser::ParseSkill ()
skill.Aggressiveness = 1.;
skill.SpawnFilter = 0;
skill.SpawnMulti = false;
skill.SpawnMultiCoopOnly = false;
skill.InstantReaction = false;
skill.ACSReturn = 0;
skill.MustConfirm = false;
@ -198,6 +199,10 @@ void FMapInfoParser::ParseSkill ()
{
skill.SpawnMulti = true;
}
else if (sc.Compare ("spawnmulticooponly"))
{
skill.SpawnMultiCoopOnly = true;
}
else if (sc.Compare ("InstantReaction"))
{
skill.InstantReaction = true;
@ -408,9 +413,13 @@ int G_SkillProperty(ESkillProperty prop)
case SKILLP_SpawnMulti:
return AllSkills[gameskill].SpawnMulti;
case SKILLP_InstantReaction:
return AllSkills[gameskill].InstantReaction;
case SKILLP_SpawnMultiCoopOnly:
return AllSkills[gameskill].SpawnMultiCoopOnly;
}
}
return 0;
@ -550,6 +559,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
SpawnFilter = other.SpawnFilter;
SpawnMulti = other.SpawnMulti;
InstantReaction = other.InstantReaction;
SpawnMultiCoopOnly = other.SpawnMultiCoopOnly;
ACSReturn = other.ACSReturn;
MenuName = other.MenuName;
PicName = other.PicName;

View file

@ -5757,6 +5757,7 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
AActor *mobj;
bool spawnmulti = G_SkillProperty(SKILLP_SpawnMulti) || !!(dmflags2 & DF2_ALWAYS_SPAWN_MULTI);
bool spawnmulti_cooponly = G_SkillProperty(SKILLP_SpawnMultiCoopOnly);
if (mthing->EdNum == 0 || mthing->EdNum == -1)
return NULL;
@ -5837,9 +5838,9 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
{
mask = MTF_COOPERATIVE;
}
else if (spawnmulti)
else if (spawnmulti || spawnmulti_cooponly)
{
mask = MTF_COOPERATIVE|MTF_SINGLE;
mask = spawnmulti_cooponly ? MTF_COOPERATIVE : (MTF_COOPERATIVE|MTF_SINGLE);
}
else
{

View file

@ -1024,6 +1024,7 @@ enum ESkillProperty
SKILLP_PlayerRespawn,
SKILLP_SpawnMulti,
SKILLP_InstantReaction,
SKILLP_SpawnMultiCoopOnly,
};
enum EFSkillProperty // floating point properties
{