Skip to content

Commit 75ebf85

Browse files
Add Playable column for City-States in XML
1 parent 0262701 commit 75ebf85

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
-- Toggles whether the minor civ can appear at all (without needing to delete it from the database)
2+
ALTER TABLE MinorCivilizations ADD Playable boolean DEFAULT 1;
3+
14
-- This minor civ always has this personality instead of picking a random one
25
-- Overrides the BALANCE_CITY_STATE_PERSONALITIES option
36
ALTER TABLE MinorCivilizations ADD FixedPersonality text REFERENCES MinorCivPersonalityTypes (Type);
47

58
-- The unit class given to the bully when this minor civ is heavy tributed
69
-- Overridden by the BALANCE_CORE_MINOR_VARIABLE_BULLYING option, which does not give units
7-
ALTER TABLE MinorCivilizations ADD BullyUnitClass text REFERENCES UnitClasses (Type) DEFAULT 'UNITCLASS_WORKER';
10+
ALTER TABLE MinorCivilizations ADD BullyUnitClass text REFERENCES UnitClasses (Type) DEFAULT 'UNITCLASS_WORKER';

CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18968,13 +18968,12 @@ void CvMinorCivAI::SetDisableNotifications(bool bDisableNotifications)
1896818968
// CvMinorCivInfo
1896918969
//======================================================================================================
1897018970
CvMinorCivInfo::CvMinorCivInfo() :
18971+
m_bPlayable(false),
1897118972
m_iDefaultPlayerColor(NO_PLAYERCOLOR),
1897218973
m_iArtStyleType(NO_ARTSTYLE),
1897318974
m_iMinorCivTrait(NO_MINOR_CIV_TRAIT_TYPE),
1897418975
m_eFixedPersonality(NO_MINOR_CIV_PERSONALITY_TYPE),
18975-
#if defined(MOD_BALANCE_CORE)
1897618976
m_iBullyUnit(NO_UNITCLASS),
18977-
#endif
1897818977
m_piFlavorValue(NULL)
1897918978
{
1898018979
}
@@ -18984,6 +18983,11 @@ CvMinorCivInfo::~CvMinorCivInfo()
1898418983
SAFE_DELETE_ARRAY(m_piFlavorValue);
1898518984
}
1898618985
//------------------------------------------------------------------------------
18986+
int CvMinorCivInfo::IsPlayable() const
18987+
{
18988+
return m_bPlayable;
18989+
}
18990+
//------------------------------------------------------------------------------
1898718991
int CvMinorCivInfo::getDefaultPlayerColor() const
1898818992
{
1898918993
return m_iDefaultPlayerColor;
@@ -19102,12 +19106,10 @@ MinorCivPersonalityTypes CvMinorCivInfo::MinorCivPersonalityFromString(const cha
1910219106
return NO_MINOR_CIV_PERSONALITY_TYPE;
1910319107
}
1910419108
//------------------------------------------------------------------------------
19105-
#if defined(MOD_BALANCE_CORE)
1910619109
int CvMinorCivInfo::GetBullyUnit() const
1910719110
{
1910819111
return m_iBullyUnit;
1910919112
}
19110-
#endif
1911119113
//------------------------------------------------------------------------------
1911219114
int CvMinorCivInfo::getFlavorValue(int i) const
1911319115
{
@@ -19137,6 +19139,7 @@ bool CvMinorCivInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility
1913719139
return false;
1913819140

1913919141
//Basic Properties
19142+
m_bPlayable = kResults.GetBool("Playable");
1914019143
const char* szTextVal = NULL;
1914119144

1914219145
szTextVal = kResults.GetText("ShortDescription");
@@ -19167,10 +19170,8 @@ bool CvMinorCivInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility
1916719170
szTextVal = kResults.GetText("FixedPersonality");
1916819171
m_eFixedPersonality = MinorCivPersonalityFromString(szTextVal);
1916919172

19170-
#if defined(MOD_BALANCE_CORE)
1917119173
szTextVal = kResults.GetText("BullyUnitClass");
1917219174
m_iBullyUnit = GC.getInfoTypeForString(szTextVal, true);
19173-
#endif
1917419175

1917519176
//Arrays
1917619177
const char* szType = GetType();

CvGameCoreDLL_Expansion2/CvMinorCivAI.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -994,17 +994,13 @@ class CvMinorCivInfo : public CvBaseInfo
994994
virtual bool CacheResults(Database::Results& kResults, CvDatabaseUtility& kUtility);
995995

996996
protected:
997+
bool m_bPlayable;
997998
int m_iDefaultPlayerColor;
998999
int m_iArtStyleType;
9991000
int m_iNumLeaders; // the number of leaders the Civ has, this is needed so that random leaders can be generated easily
10001001
int m_iMinorCivTrait;
10011002
MinorCivPersonalityTypes m_eFixedPersonality;
1002-
#if defined(MOD_BALANCE_CORE)
10031003
int m_iBullyUnit;
1004-
#endif
1005-
1006-
bool m_bAIPlayable;
1007-
bool m_bPlayable;
10081004

10091005
CvString m_strArtDefineTag;
10101006
CvString m_strArtStylePrefix;

CvGameCoreDLL_Expansion2/CvPreGame.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,6 +2876,11 @@ vector<MinorCivTypes> GetAvailableMinorCivTypes(vector<MinorCivTypes>& vCultured
28762876
if (pkCityState == NULL)
28772877
continue;
28782878

2879+
// Turned off in XML?
2880+
if (!pkCityState->IsPlayable())
2881+
continue;
2882+
2883+
// Blocked by game options?
28792884
MinorCivTraitTypes eTrait = (MinorCivTraitTypes)pkCityState->GetMinorCivTrait();
28802885
if (eTrait == MINOR_CIV_TRAIT_RELIGIOUS && bNoReligion)
28812886
continue;

0 commit comments

Comments
 (0)