95 static bool FnIncinerateLandscape(
C4PropList * _this,
long x,
long y,
long caused_by_plr)
101 static void FnSetGravity(
C4PropList * _this,
long gravity)
121 static long FnGetPlayerType(
C4PropList * _this,
long player_nr)
131 static long FnGetPlayerColor(
C4PropList * _this,
long player_nr)
143 return player->PrefClonkSkin;
228 long completion,
bool adjust_terrain,
bool check_site)
231 if (!PropList || !PropList->
GetDef())
260 if (!(def = PropList->
GetDef()))
276 array->SetItem(0,
C4VInt(abs_x));
277 array->SetItem(1,
C4VInt(abs_y));
281 static bool FnCheckConstructionSite(
C4PropList * _this,
C4PropList * PropList, int32_t x, int32_t y)
284 if (!PropList || !PropList->
GetDef())
300 bool has_layer_check =
false;
304 C4Value Data = *(parameters++);
321 pSOs[sort_count++] = pSO;
327 for (
int i = 0; i < sort_count; ++i)
334 if (context && !has_layer_check)
376 throw C4AulExecError(
"ObjectCount: No valid search criterions supplied");
395 throw C4AulExecError(
"FindObject: No valid search criterions supplied");
414 throw C4AulExecError(
"FindObjects: No valid search criterions supplied");
424 static bool FnInsertMaterial(
C4PropList * _this,
long mat,
long x,
long y,
long vx,
long vy,
C4PropList *insert_position)
427 int32_t insert_x = x;
428 int32_t insert_y = y;
435 if (insert_position && !insert_position->
IsFrozen())
443 static bool FnCanInsertMaterial(
C4PropList * _this,
long mat,
long x,
long y,
C4PropList *insert_position)
446 int32_t insert_x = x;
447 int32_t insert_y = y;
454 if (insert_position && !insert_position->
IsFrozen())
464 for (
long i = 0; i < frames; i++)
475 static long FnGetMaterialCount(
C4PropList * _this,
long material_nr,
bool real)
491 static long FnGetMaterial(
C4PropList * _this,
long x,
long y)
497 static long FnGetBackMaterial(
C4PropList * _this,
long x,
long y)
542 const char* pch = strchr(texture_name.
getData(),
'-');
545 size_t len = pch - texture_name.
getData();
557 static bool FnGBackSolid(
C4PropList * _this,
long x,
long y)
563 static bool FnGBackSemiSolid(
C4PropList * _this,
long x,
long y)
569 static bool FnGBackLiquid(
C4PropList * _this,
long x,
long y)
575 static bool FnGBackSky(
C4PropList * _this,
long x,
long y)
581 static long FnExtractMaterialAmount(
C4PropList * _this,
long x,
long y,
long mat,
long amount,
bool distant_first)
585 for (; extracted<amount; extracted++)
605 if (max_density.
IsNil())
616 if (!at_player_nr.
IsNil())
627 if (!
player->LocalControl)
638 if (level.
IsNil() || level > 100)
654 StartSoundEffectAt(FnStringPar(szSound), x, y, level, custom_falloff_distance, pitch, modifier);
662 if (!at_player_nr.
IsNil())
673 if (!
player->LocalControl)
679 if (level < 0)
return true;
681 if (level.
IsNil() || level>100)
714 StartSoundEffect(FnStringPar(sound), !!loop_count, level, obj, custom_falloff_distance, pitch, modifier);
750 if (at_player.
IsNil())
763 player->SetSoundModifier(modifier_props);
769 static bool FnMusic(
C4PropList * _this,
C4String *song_name,
bool loop,
long fade_time_ms,
long max_resume_time_ms)
771 if (max_resume_time_ms < 0)
791 static long FnMusicLevel(
C4PropList * _this,
long iLevel)
796 static long FnSetPlayList(
C4PropList * _this,
const C4Value & playlist_data,
Nillable<long> at_player_nr,
bool force_switch,
long fade_time_ms,
long max_resume_time_ms)
799 if (max_resume_time_ms < 0)
840 return files_in_playlist;
843 static bool FnGameOver(
C4PropList * _this,
long iGameOverValue )
864 int player_nr = parameters[0].
getInt();
874 bool is_spoken =
false;
887 const char * dollar = strchr(buf.
getData(),
'$');
901 if (!szMessage)
return C4VBool(
false);
915 const char * dollar = strchr(buf.
getData(),
'$');
969 static bool FnHostile(
C4PropList * _this,
long player_nr1,
long player_nr2,
bool check_one_way_only)
971 if (check_one_way_only)
977 return !!
Hostile(player_nr1, player_nr2);
981 static bool FnSetHostility(
C4PropList * _this,
long player_nr1,
long player_nr2,
bool hostile,
bool silent,
bool no_calls)
998 if (!
player->SetHostility(player_nr2, hostile, silent))
1007 static bool FnSetPlrView(
C4PropList * _this,
long player_nr,
C4Object *target,
bool immediate_position)
1017 static long FnGetPlrViewMode(
C4PropList * _this,
long player_nr)
1030 static void FnResetCursorView(
C4PropList * _this,
long player_nr,
bool immediate_position)
1035 player->ResetCursorView(immediate_position);
1046 return player->ViewTarget;
1050 static const int PLRZOOM_Direct = 0x01,
1051 PLRZOOM_NoIncrease = 0x04,
1052 PLRZOOM_NoDecrease = 0x08,
1053 PLRZOOM_LimitMin = 0x10,
1054 PLRZOOM_LimitMax = 0x20,
1057 static bool FnSetPlayerZoomByViewRange(
C4PropList * _this,
long player_nr,
long range_wdt,
long range_hgt,
long flags)
1060 if (range_wdt < 0 || range_hgt < 0)
1071 FnSetPlayerZoomByViewRange(_this,
player->Number, range_wdt, range_hgt, flags);
1085 if (flags & PLRZOOM_LimitMin)
player->SetMinZoomByViewRange(range_wdt, range_hgt, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1086 if (flags & PLRZOOM_LimitMax)
player->SetMaxZoomByViewRange(range_wdt, range_hgt, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1088 if ((flags & PLRZOOM_Set) || !(flags & (PLRZOOM_LimitMin | PLRZOOM_LimitMax)))
1090 player->SetZoomByViewRange(range_wdt, range_hgt, !!(flags & PLRZOOM_Direct), !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1121 static bool FnSetPlayerZoom(
C4PropList * _this,
long player_nr,
long zoom,
long precision,
long flags)
1124 if (zoom < 0 || precision < 0)
1135 FnSetPlayerZoom(_this,
player->Number, zoom, precision, flags);
1155 if (flags & PLRZOOM_LimitMin)
player->SetMinZoom(fZoom, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1156 if (flags & PLRZOOM_LimitMax)
player->SetMaxZoom(fZoom, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1157 if ((flags & PLRZOOM_Set) || !(flags & (PLRZOOM_LimitMin | PLRZOOM_LimitMax)))
1159 player->SetZoom(fZoom, !!(flags & PLRZOOM_Direct), !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease));
1166 static bool FnSetPlayerViewLock(
C4PropList * _this,
long player_nr,
bool is_locked)
1175 FnSetPlayerViewLock(_this,
player->Number, is_locked);
1185 player->SetViewLocked(is_locked);
1189 static bool FnDoBaseMaterial(
C4PropList * _this,
long player_nr,
C4ID id,
long change)
1206 static bool FnDoBaseProduction(
C4PropList * _this,
long player_nr,
C4ID id,
long change)
1225 bool success =
false;
1227 if (player_nr.
IsNil())
1231 if (
player->SetKnowledge(
id, remove))
1243 success =
player->SetKnowledge(
id, remove);
1249 static C4Value FnGetPlrKnowledge(
C4PropList * _this,
int player_nr,
C4ID id,
int index,
int category)
1285 static C4Value FnGetBaseMaterial(
C4PropList * _this,
int player_nr,
C4ID id,
int index,
int category)
1300 static C4Value FnGetBaseProduction(
C4PropList * _this,
int player_nr,
C4ID id,
int index,
int category)
1315 static long FnGetWealth(
C4PropList * _this,
long player_nr)
1317 if (!
ValidPlr(player_nr))
return 0;
1321 static bool FnSetWealth(
C4PropList * _this,
long player_nr,
long value)
1323 if (!
ValidPlr(player_nr))
return false;
1328 static long FnDoPlayerScore(
C4PropList * _this,
long player_nr,
long change)
1330 if (!
ValidPlr(player_nr))
return false;
1334 static long FnGetPlayerScore(
C4PropList * _this,
long player_nr)
1336 if (!
ValidPlr(player_nr))
return 0;
1340 static long FnGetPlayerScoreGain(
C4PropList * _this,
long player_nr)
1342 if (!
ValidPlr(player_nr))
return 0;
1348 if (!
ValidPlr(player_nr))
return nullptr;
1354 if (!
ValidPlr(player_nr))
return nullptr;
1358 static long FnGetCrewCount(
C4PropList * _this,
long player_nr)
1360 if (!
ValidPlr(player_nr))
return 0;
1376 static long FnGetPlayerByIndex(
C4PropList * _this,
long index,
long type)
1391 static long FnEliminatePlayer(
C4PropList * _this,
long player_nr,
bool remove_direct)
1421 static bool FnSurrenderPlayer(
C4PropList * _this,
long player_nr)
1437 static bool FnSetLeaguePerformance(
C4PropList * _this,
long iScore,
long player_id)
1452 static const int32_t CSPF_FixedAttributes = 1 << 0,
1453 CSPF_NoScenarioInit = 1 << 1,
1454 CSPF_NoEliminationCheck = 1 << 2,
1455 CSPF_Invisible = 1 << 3,
1456 CSPF_NoScenarioSave = 1 << 4;
1459 static bool FnCreateScriptPlayer(
C4PropList * _this,
C4String *name,
long dwColor,
long team_id,
long dwFlags,
C4ID idExtra)
1474 uint32_t dwInfoFlags = 0u;
1481 pScriptPlrInfo->
SetTeam(team_id);
1510 static bool FnSetCursor(
C4PropList * _this,
long player_nr,
C4Object *obj,
bool no_select_arrow)
1514 player->SetCursor(obj, !no_select_arrow);
1529 player->ViewCursor = obj;
1533 static long FnGetWind(
C4PropList * _this,
long x,
long y,
bool global)
1545 static void FnSetWind(
C4PropList * _this,
long wind)
1550 static void FnSetTemperature(
C4PropList * _this,
long temperature)
1555 static long FnGetTemperature(
C4PropList * _this)
1560 static void FnSetAmbientBrightness(
C4PropList * _this,
long brightness)
1568 static long FnGetAmbientBrightness(
C4PropList * _this)
1577 static void FnSetSeason(
C4PropList * _this,
long season)
1587 static void FnSetClimate(
C4PropList * _this,
long climate)
1597 static long FnLandscapeWidth(
C4PropList * _this)
1602 static long FnLandscapeHeight(
C4PropList * _this)
1607 static void FnShakeFree(
C4PropList * _this,
long x,
long y,
long radius)
1612 static long FnDigFree(
C4PropList * _this,
long x,
long y,
long radius,
bool no_dig2objects,
bool no_instability_check)
1617 static long FnDigFreeRect(
C4PropList * _this,
long x,
long y,
long wdt,
long hgt,
bool no_dig2objects,
bool no_instability_check)
1622 static void FnClearFreeRect(
C4PropList * _this,
long x,
long y,
long wdt,
long hgt)
1627 static bool FnPathFree(
C4PropList * _this,
long x1,
long y1,
long x2,
long y2)
1635 int32_t x = -1, y = -1;
1636 if (!
PathFree(x1, y1, x2, y2, &x, &y))
1659 ParSet.
Copy(¶meters[1], 9);
1686 static int32_t FnGetLeagueScore(
C4PropList * _this,
long player_id)
1703 static bool FnSetLeagueProgressData(
C4PropList * _this,
C4String *pNewData,
long player_id)
1733 static bool FnTestMessageBoard(
C4PropList * _this,
long player_nr,
bool test_if_in_use)
1738 if (!
player)
return false;
1739 if (!test_if_in_use)
return true;
1741 return player->HasMessageBoardQuery();
1762 player->CallMessageBoard(obj,
StdStrBuf(FnStringPar(query_string)), !!upper_case);
1782 return player->RemoveMessageBoardQuery(obj);
1785 static void FnSetFoW(
C4PropList * _this,
bool enabled,
long player_nr)
1796 static long FnSetMaxPlayer(
C4PropList * _this,
long player_count)
1799 if (player_count < 0)
1812 if (!password)
return false;
1817 Log(
"Warning: using GetScenarioAccess may cause desyncs when playing records!");
1828 : pszNames(pszNames), iNameCnt(iNameCnt), iEntryNr(iEntryNr)
1835 bool Name(
const char *szName)
override
1838 if (!iMatchStart || haveCurrentMatch())
1840 if (!haveCompleteMatch())
1842 if (
SEqual(pszNames[iMatchCount], szName))
1845 if (!iMatchCount) iMatchStart = iDepth + 1;
1861 if (haveCurrentMatch())
1864 if (!iMatchCount) iMatchStart = 0;
1872 iDepth = iMatchStart = iMatchCount = 0;
1887 void MaybeProcessInt(T &t)
1889 if (haveCompleteMatch() && !iEntryNr--)
1897 void DWord(int32_t &rInt)
override { MaybeProcessInt(rInt); }
1898 void DWord(uint32_t &rInt)
override { MaybeProcessInt(rInt); }
1899 void Word(int16_t &rShort)
override { MaybeProcessInt(rShort); }
1900 void Word(uint16_t &rShort)
override { MaybeProcessInt(rShort); }
1901 void Byte(int8_t &rByte)
override { MaybeProcessInt(rByte); }
1902 void Byte(uint8_t &rByte)
override { MaybeProcessInt(rByte); }
1919 const char **pszNames;
1928 int iMatchStart, iMatchCount;
1932 bool haveCurrentMatch()
const {
return iDepth + 1 == iMatchStart + iMatchCount; }
1934 bool haveCompleteMatch()
const {
return haveCurrentMatch() && iMatchCount == iNameCnt; }
1969 const char *szNames[2] = { strSection ? strSection : strEntry, strSection ? strEntry :
nullptr };
1987 if (!_this || !_this->
GetDef())
2010 if (!pObjInfo)
return C4VNull;
2030 if (!pPlayer)
return C4Value();
2045 if (!pPlayer)
return C4Value();
2052 iEntryNr, *pPlayerInfoCore);
2072 if (!
MatValid(iMat))
return nullptr;
2079 if (!name)
return false;
2088 const bool result = sky.Init(
false, name->
GetCStr());
2096 static bool FnSetSkyAdjust(
C4PropList * _this,
long dwAdjust,
long dwBackClr)
2104 static bool FnSetMatAdjust(
C4PropList * _this,
long dwAdjust)
2112 static long FnGetSkyAdjust(
C4PropList * _this,
bool fBackColor)
2118 static long FnGetMatAdjust(
C4PropList * _this)
2133 const char * strDataName = FnStringPar(DataName);
2140 if (!pPlayer)
return C4Value();
2163 const char *strDataName = FnStringPar(DataName);
2165 if (!pPlayer)
return C4Value();
2175 static long FnDrawMatChunks(
C4PropList * _this,
long tx,
long ty,
long twdt,
long thgt,
long icntx,
long icnty,
C4String *strMaterial,
C4String *strTexture,
bool bIFT)
2180 static long FnDrawMap(
C4PropList * _this,
long iX,
long iY,
long iWdt,
long iHgt,
C4String *szMapDef)
2187 static long FnDrawDefMap(
C4PropList * _this,
long iX,
long iY,
long iWdt,
long iHgt,
C4String *szMapDef)
2198 if (obj && !_this->
Status)
return false;
2200 if (amount <= 0) amount = 1;
2204 if (!pDef)
return false;
2209 valueSpeedX.
Set(speedX);
2210 valueSpeedY.
Set(speedY);
2211 valueLifetime.
Set(lifetime);
2213 ::Particles.
Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, obj);
2219 static bool FnClearParticles(
C4PropList * _this)
2223 if ((obj =
Object(_this)))
2244 array->
SetItem(1, startValue);
2253 array->
SetItem(1, startValue);
2255 array->
SetItem(3, rerollInterval);
2273 array->
SetItem(2, startValue);
2275 array->
SetItem(4, maximumValue);
2283 const int offset = 1;
2293 array->
SetItem(offset + i, Data);
2324 array->
SetItem(2, startValue);
2333 array->
SetItem(2, startValue);
2342 array->
SetItem(2, startValue);
2383 static long FnReloadDef(
C4PropList * _this,
C4ID idDef,
long iReloadWhat)
2386 C4Def *pDef=
nullptr;
2396 if (!pDef)
return false;
2409 static bool FnSetGamma(
C4PropList * _this,
long iRed,
long iGreen,
long iBlue,
long iRampIndex)
2412 float(iGreen) / 100,
2418 static bool FnResetGamma(
C4PropList * _this,
long iRampIndex)
2426 if (!name || !shader)
return C4Void();
2430 static bool FnRemoveShader(
C4PropList * _this,
long id)
2450 pPathInfo->
ilx = iX;
2451 pPathInfo->
ily = iY;
2459 static Nillable<long> FnGetPathLength(
C4PropList * _this,
long iFromX,
long iFromY,
long iToX,
long iToY,
long iLevel)
2474 static long FnSetTextureIndex(
C4PropList * _this,
C4String *psMatTex,
long iNewIndex,
bool fInsert)
2476 if (!
Inside(iNewIndex, 0l, 255l))
return false;
2481 static long FnRemoveUnusedTexMapEntries(
C4PropList * _this)
2487 static const int32_t DMQ_Sky = 0,
2491 static bool FnDrawMaterialQuad(
C4PropList * _this,
C4String *szMaterial,
long iX1,
long iY1,
long iX2,
long iY2,
long iX3,
long iY3,
long iX4,
long iY4,
const C4Value& draw_mode)
2493 const char *szMat = FnStringPar(szMaterial);
2495 const char *szBackMat =
nullptr;
2496 bool fBridge =
false;
2500 const int draw_mode_value = draw_mode.
getInt();
2501 switch(draw_mode_value)
2503 case DMQ_Sky:
break;
2504 case DMQ_Sub: szBackMat =
"Tunnel";
break;
2505 case DMQ_Bridge: fBridge =
true;
break;
2510 szBackMat = FnStringPar(draw_mode.
getStr());
2513 return !!
::Landscape.
DrawQuad(iX1, iY1, iX2, iY2, iX3, iY3, iX4, iY4, szMat, szBackMat, fBridge);
2516 static bool FnSetFilmView(
C4PropList * _this,
long iToPlr)
2531 if (!pstrCommand || !pstrScript)
return false;
2537 static bool FnSetGameSpeed(
C4PropList * _this,
long iSpeed)
2540 if (iSpeed)
if (!Inside<long>(iSpeed, 0, 1000))
return false;
2541 if (!iSpeed) iSpeed = 38;
2551 if (!precision) precision = 10;
2554 int XDir = pvrXDir.
IsNil() &&
Object(_this) ?
fixtoi(
Object(_this)->xdir, precision) : static_cast<int>(pvrXDir);
2555 int YDir = pvrXDir.
IsNil() &&
Object(_this) ?
fixtoi(
Object(_this)->ydir, precision) : static_cast<int>(pvrYDir);
2557 int iDensityMin = pviDensityMin.
IsNil() ?
C4M_Solid :
static_cast<int>(pviDensityMin);
2558 int iDensityMax = pviDensityMax.
IsNil() ? 100 :
static_cast<int>(pviDensityMax);
2559 int iIter = pviIter.
IsNil() ? -1 :
static_cast<int>(pviIter);
2563 xdir =
itofix(XDir, precision), ydir =
itofix(YDir, precision);
2566 if (!
SimFlight(x, y, xdir, ydir, iDensityMin, iDensityMax, iIter))
2582 static long FnLoadScenarioSection(
C4PropList * _this,
C4String *pstrSection,
long dwFlags)
2585 const char *szSection;
2586 if (!pstrSection || !*(szSection=FnStringPar(pstrSection)))
return false;
2591 static bool FnSetViewOffset(
C4PropList * _this,
long player_nr,
long iX,
long iY)
2593 if (!
ValidPlr(player_nr))
return false;
2596 if (!pView)
return true;
2608 const char *szClient = FnStringPar(pNewName);
2617 static long FnGetPlayerID(
C4PropList * _this,
long player_nr)
2623 static long FnGetPlayerTeam(
C4PropList * _this,
long player_nr)
2630 if (pTeam)
return pTeam->
GetID();
2632 if (
player->IsChosingTeam())
return -1;
2637 static bool FnSetPlayerTeam(
C4PropList * _this,
long player_nr,
long idNewTeam,
bool fNoCalls)
2643 if (!
player)
return false;
2645 if (!pPlrInfo)
return false;
2647 if (
player->Team == idNewTeam)
return true;
2658 int32_t idOldTeam = 0;
2661 idOldTeam = pOldTeam->
GetID();
2671 idNewTeam = pNewTeam->
GetID();
2676 player->Team = idNewTeam = 0;
2682 player->SetTeamHostility();
2694 if (!plr)
return nullptr;
2696 if (!info)
return nullptr;
2701 static long FnGetTeamConfig(
C4PropList * _this,
long iConfigValue)
2704 switch (iConfigValue)
2715 DebugLogF(
"GetTeamConfig: Unknown config value: %ld", iConfigValue);
2722 if (!pTeam)
return nullptr;
2726 static long FnGetTeamColor(
C4PropList * _this,
long iTeam)
2729 return pTeam ? pTeam->
GetColor() : 0u;
2732 static long FnGetTeamByIndex(
C4PropList * _this,
long iIndex)
2735 return pTeam ? pTeam->
GetID() : 0;
2738 static long FnGetTeamCount(
C4PropList * _this)
2744 static bool FnInitScenarioPlayer(
C4PropList * _this,
long player_nr,
long team_id)
2747 if (!
player)
return false;
2748 return player->ScenarioAndTeamInit(team_id);
2751 static bool FnSetScoreboardData(
C4PropList * _this,
long iRowID,
long iColID,
C4String *pText,
long iData)
2764 static int32_t FnGetScoreboardData(
C4PropList * _this,
long iRowID,
long iColID)
2769 static bool FnDoScoreboardShow(
C4PropList * _this,
long change,
long iForPlr)
2777 if (!
player->LocalControl)
return true;
2783 static bool FnSortScoreboard(
C4PropList * _this,
long iByColID,
bool fReverse)
2792 if (!pText)
return false;
2793 if (!pText->
GetCStr())
return false;
2801 static void FnHideSettlementScoreInEvaluation(
C4PropList * _this,
bool fHide)
2806 static bool FnCustomMessage(
C4PropList * _this,
C4String *pMsg,
C4Object *pObj,
Nillable<long> iOwner,
long iOffX,
long iOffY,
long dwClr,
C4ID idDeco,
C4PropList *pSrc,
long dwFlags,
long iHSize)
2811 if (!pMsg)
return false;
2812 if (pObj && !pObj->
Status)
return false;
2813 const char *szMsg = pMsg->
GetCStr();
2814 if (!szMsg)
return false;
2815 if (idDeco && !
C4Id2Def(idDeco))
return false;
2820 if (((hpos | (hpos-1)) + 1)>>1 != hpos)
2822 throw C4AulExecError(
"CustomMessage: Only one horizontal positioning flag allowed");
2824 if (((vpos | (vpos-1)) + 1)>>1 != vpos)
2826 throw C4AulExecError(
"CustomMessage: Only one vertical positioning flag allowed");
2829 if (!dwClr) dwClr = 0xffffffff;
2830 else dwClr = (dwClr&0xffffff) | (0xff000000u - uint32_t(dwClr|0xff000000));
2847 return ::Messages.
New(iType, sMsg, pObj, iOwner, iOffX, iOffY, (uint32_t)dwClr, idDeco, pSrc, dwFlags, iHSize);
2862 return window->
GetID();
2868 if (!window)
return false;
2872 if (!subwindow)
return false;
2880 static bool FnGuiClose(
C4PropList *_this, int32_t guiID, int32_t childID,
C4Object *target)
2883 if (!window)
return false;
2887 if (!subwindow)
return false;
2897 if (!update)
return false;
2899 if (!window)
return false;
2903 if (!subwindow)
return false;
2912 static bool FnPauseGame(
C4PropList * _this,
bool fToggle)
2936 if (szNextMissionText && szNextMissionText->
GetCStr())
2944 if (szNextMissionDesc && szNextMissionDesc->
GetCStr())
2956 static long FnGetPlayerControlState(
C4PropList * _this,
long player_nr,
long iControl,
bool fMovedState)
2965 pCheckCtrl = &(
player->Control);
2969 if (!pCheckCtrl)
return 0;
2973 if (!pControlState)
return 0;
2979 static bool FnSetPlayerControlEnabled(
C4PropList * _this,
long iplr,
long ctrl,
bool is_enabled)
2992 if (!plrctrl)
return false;
3000 static bool FnGetPlayerControlEnabled(
C4PropList * _this,
long iplr,
long ctrl)
3013 if (!plrctrl)
return false;
3018 static C4String *FnGetPlayerControlAssignment(
C4PropList * _this,
long player,
long control,
bool human_readable,
bool short_name)
3024 if (!plr)
return nullptr;
3027 if (!assignment)
return String(
"");
3033 static bool FnPlayRumble(
C4PropList * _this,
long player,
long strength,
long length)
3036 if (strength <= 0 || strength > 1000)
return false;
3037 if (length <= 0)
return false;
3043 FnPlayRumble(_this, plr->
Number, strength, length);
3047 if (!plr)
return false;
3049 plr->
pGamepad->PlayRumble(strength / 1000.f, length);
3062 FnStopRumble(_this, plr->
Number);
3066 if (!plr)
return false;
3072 static int32_t FnGetStartupPlayerCount(
C4PropList * _this)
3078 static int32_t FnGetStartupTeamCount(
C4PropList * _this)
3087 if (!achievement_name || !achievement_name->
GetData().
getLength())
return false;
3089 long value = avalue.
IsNil() ? 1 : (long)avalue;
3095 if (!plr)
return false;
3120 int32_t x = iX0, y = iY0;
3140 assert(pCDef->ValType ==
C4V_Int);
3147 #define F(f) ::AddFunc(p, #f, Fn##f)
3151 F(GetDefinitionGroupPath);
3157 F(CreateObjectAbove);
3158 F(CreateConstruction);
3159 F(FindConstructionSite);
3160 F(CheckConstructionSite);
3163 F(ChangeSoundModifier);
3164 F(SetGlobalSoundModifier);
3177 F(GetPlayerScoreGain);
3195 F(GetPlayerByIndex);
3199 F(SetLeaguePerformance);
3200 F(SetLeagueProgressData);
3201 F(GetLeagueProgressData);
3202 F(CreateScriptPlayer);
3211 F(GetAverageTextureColor);
3212 F(GetMaterialCount);
3220 F(CanInsertMaterial);
3224 F(SetAmbientBrightness);
3225 F(GetAmbientBrightness);
3230 F(SetPlayerZoomByViewRange);
3231 F(GetPlayerZoomLimits);
3233 F(SetPlayerViewLock);
3235 F(DoBaseProduction);
3236 F(GainScenarioAccess);
3240 ::AddFunc(p,
"TestMessageBoard", FnTestMessageBoard,
false);
3241 ::AddFunc(p,
"CallMessageBoard", FnCallMessageBoard,
false);
3242 ::AddFunc(p,
"AbortMessageBoard", FnAbortMessageBoard,
false);
3247 F(GetScenarioAccess);
3263 F(AddFragmentShader);
3266 F(DrawMaterialQuad);
3269 ::AddFunc(p,
"SetGameSpeed", FnSetGameSpeed,
false);
3270 ::AddFunc(p,
"DrawMatChunks", FnDrawMatChunks,
false);
3273 F(RemoveUnusedTexMapEntries);
3275 F(LoadScenarioSection);
3277 ::AddFunc(p,
"SetPreSend", FnSetPreSend,
false);
3281 F(GetScriptPlayerExtraID);
3287 ::AddFunc(p,
"InitScenarioPlayer", FnInitScenarioPlayer,
false);
3288 F(SetScoreboardData);
3289 ::AddFunc(p,
"GetScoreboardString", FnGetScoreboardString,
false);
3290 ::AddFunc(p,
"GetScoreboardData", FnGetScoreboardData,
false);
3291 F(DoScoreboardShow);
3293 F(AddEvaluationData);
3294 F(HideSettlementScoreInEvaluation);
3295 F(ExtractMaterialAmount);
3301 ::AddFunc(p,
"PauseGame", FnPauseGame,
false);
3305 F(GetPlayerControlState);
3306 F(SetPlayerControlEnabled);
3307 F(GetPlayerControlEnabled);
3308 F(GetPlayerControlAssignment);
3311 F(GetStartupPlayerCount);
3312 F(GetStartupTeamCount);
3314 F(GainScenarioAchievement);
3318 F(GetBaseProduction);
3321 F(GetObjectInfoCoreVal);
3324 F(GetPlayerInfoCoreVal);
3341 F(IncinerateLandscape);
3344 F(GetTranslatedString);
3434 {
"CSPF_FixedAttributes" ,
C4V_Int, CSPF_FixedAttributes },
3435 {
"CSPF_NoScenarioInit" ,
C4V_Int, CSPF_NoScenarioInit },
3436 {
"CSPF_NoEliminationCheck" ,
C4V_Int, CSPF_NoEliminationCheck },
3437 {
"CSPF_Invisible" ,
C4V_Int, CSPF_Invisible },
3438 {
"CSPF_NoScenarioSave" ,
C4V_Int, CSPF_NoScenarioSave },
3440 {
"DMQ_Sky" ,
C4V_Int, DMQ_Sky },
3441 {
"DMQ_Sub" ,
C4V_Int, DMQ_Sub },
3442 {
"DMQ_Bridge" ,
C4V_Int, DMQ_Bridge },
3444 {
"PLRZOOM_Direct" ,
C4V_Int, PLRZOOM_Direct },
3445 {
"PLRZOOM_NoIncrease" ,
C4V_Int, PLRZOOM_NoIncrease },
3446 {
"PLRZOOM_NoDecrease" ,
C4V_Int, PLRZOOM_NoDecrease },
3447 {
"PLRZOOM_LimitMin" ,
C4V_Int, PLRZOOM_LimitMin },
3448 {
"PLRZOOM_LimitMax" ,
C4V_Int, PLRZOOM_LimitMax },
3449 {
"PLRZOOM_Set" ,
C4V_Int, PLRZOOM_Set },
3488 {
"FindObject",
true,
C4V_Object, {
C4V_Array ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnFindObject },
3489 {
"FindObjects",
true,
C4V_Array, {
C4V_Array ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnFindObjects },
3490 {
"ObjectCount",
true,
C4V_Int, {
C4V_Array ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnObjectCount },
3491 {
"GameCallEx",
true,
C4V_Any, {
C4V_String ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnGameCallEx },
3492 {
"PlayerMessage",
true,
C4V_Int, {
C4V_Int ,
C4V_String ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnPlayerMessage },
3493 {
"Message",
true,
C4V_Bool, {
C4V_String ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnMessage },
3494 {
"AddMessage",
true,
C4V_Bool, {
C4V_String ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnAddMessage },
3495 {
"PV_KeyFrames",
true,
C4V_Array, {
C4V_Int ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any ,
C4V_Any}, FnPV_KeyFrames },
3497 {
nullptr,
false,
C4V_Nil, {
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil ,
C4V_Nil},
nullptr }
C4Object * Object(C4PropList *_this)
StdStrBuf FnStringFormat(C4PropList *_this, C4String *szFormatPar, C4Value *Pars, int ParCount)
C4String * String(const char *str)
void AddFunc(C4PropListStatic *Parent, const char *Name, RType(*pFunc)(ThisType *, ParTypes...), bool Public=true)
const int32_t C4M_Background
const int32_t C4M_Vehicle
const int32_t C4M_SemiSolid
C4Def * C4Id2Def(C4ID id)
C4GameMessageList Messages
const int32_t C4GM_Bottom
const int32_t C4GM_NoBreak
const int32_t C4GM_DropSpeech
const int32_t C4GM_Multiple
const int32_t C4GM_HCenter
const int32_t C4GM_VCenter
const int32_t C4GM_GlobalPlayer
void GameMsgObjectPlayer(const char *szText, C4Object *pTarget, int32_t iPlayer)
const int32_t C4GM_TargetPlayer
const int32_t C4GM_WidthRel
const int32_t C4GM_Target
void GameMsgObject(const char *szText, C4Object *pTarget)
const int32_t C4GM_Global
bool SimFlight(C4Real &x, C4Real &y, C4Real &xdir, C4Real &ydir, int32_t iDensityMin, int32_t iDensityMax, int32_t &iIter)
long GetValidOwner(C4PropList *_this, Nillable< long > owner)
C4FindObject * CreateCriterionsFromPars(C4Value *parameters, C4FindObject **pFOs, C4SortObject **pSOs, const C4Object *context)
C4String * GetTextureName(int32_t texture_nr)
void MakeAbsCoordinates(C4PropList *_this, int32_t &x, int32_t &y)
C4ScriptConstDef C4ScriptGameConstMap[]
C4Object * FnPlaceVegetation(C4PropList *_this, C4PropList *Def, long x, long y, long wdt, long hgt, long growth, C4PropList *shape)
C4Object * FnPlaceAnimal(C4PropList *_this, C4PropList *Def)
C4Effect ** FnGetEffectsFor(C4PropList *target)
void AssignController(C4PropList *_this, C4Object *obj)
C4Object * FnObject(C4PropList *_this, long iNumber)
void InitGameFunctionMap(C4AulScriptEngine *pEngine)
C4Value GetValByStdCompiler(const char *strEntry, const char *strSection, int iEntryNr, const T &rFrom)
C4ScriptFnDef C4ScriptGameFnMap[]
#define PSF_OnHostilityChange
#define PSF_RejectHostilityChange
#define PSF_RejectTeamSwitch
C4AulScriptEngine ScriptEngine
C4Application Application
C4GraphicsSystem GraphicsSystem
C4GraphicsResource GraphicsResource
bool PathFree(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
bool FindConSiteSpot(int32_t &rx, int32_t &ry, int32_t wdt, int32_t hgt, int32_t hrange)
bool ConstructionCheck(C4PropList *PropList, int32_t iX, int32_t iY, C4Object *pByObj)
bool GBackLiquid(int32_t x, int32_t y)
int32_t PixCol2Tex(BYTE pixc)
bool GBackSemiSolid(int32_t x, int32_t y)
int32_t GBackMat(int32_t x, int32_t y)
bool GBackSolid(int32_t x, int32_t y)
const char * LoadResStr(const char *id)
bool Log(const char *szMessage)
bool DebugLogF(const char *strMessage ...)
C4MaterialMap MaterialMap
bool MatValid(int32_t mat)
const int32_t C4MC_MD_DragSource
const int32_t C4MC_MD_NoClick
const int32_t C4MC_MD_DropTarget
C4ParticleSystem Particles
const int32_t C4PVM_Target
int32_t Hostile(int32_t plr1, int32_t plr2)
int32_t ValidPlr(int32_t plr)
C4Fixed itofix(int32_t x)
int fixtoi(const C4Fixed &x)
#define C4S_REINIT_SCENARIO
#define C4S_SAVE_LANDSCAPE
C4GameScriptHost GameScript
C4ScriptShader ScriptShader
void SoundUpdate(C4SoundInstance *pInst, int32_t iLevel, int32_t iPitch)
void StopSoundEffect(const char *szSndName, C4Object *pObj)
C4SoundInstance * GetSoundInstance(const char *szSndName, C4Object *pObj)
C4SoundInstance * StartSoundEffect(const char *szSndName, bool fLoop, int32_t iVolume, C4Object *pObj, int32_t iCustomFalloffDistance, int32_t iPitch, C4SoundModifier *modifier)
@ P_MusicMaxPositionMemory
C4Value C4VObj(C4Object *pObj)
C4Value C4VArray(C4ValueArray *pArray)
C4Value C4VInt(int32_t i)
C4Value C4VPropList(C4PropList *p)
C4Value C4VString(C4String *pStr)
bool SIsModule(const char *szList, const char *szString, int *ipIndex, bool fCaseSensitive)
bool SCopySegment(const char *szString, int iSegment, char *sTarget, char cSeparator, int iMaxL, bool fSkipWhitespace)
int32_t Distance(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2)
bool SAddModule(char *szList, const char *szModule, bool fCaseSensitive)
bool SEqual(const char *szStr1, const char *szStr2)
bool Inside(T ival, U lbound, V rbound)
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
StdStrBuf FormatString(const char *szFmt,...)
bool WildcardMatch(const char *szWildcard, const char *szString)
C4MusicSystem MusicSystem
void SetGameTickDelay(int iDelay)
C4SoundSystem SoundSystem
C4PropListStatic * GetPropList()
C4Effect * pGlobalEffects
void RegisterGlobalConstant(const char *szName, const C4Value &rValue)
const char * getLocalName() const
char MissionAccess[CFG_MaxString+1]
void EnsureDefinitionListInitialized()
StdCopyStrBuf ConsoleGroupPath
C4Def * GetDef(int32_t Index)
void SetGamma(float r, float g, float b, int32_t iRampIndex)
C4ValueArray * FindMany(const C4ObjectList &Objs)
C4Object * Find(const C4ObjectList &Objs)
int32_t Count(const C4ObjectList &Objs)
static C4FindObject * CreateByValue(const C4Value &Data, C4SortObject **ppSortObj=nullptr, const C4Object *context=nullptr, bool *has_layer_check=nullptr)
void SetSort(C4SortObject *pToSort)
void SetBrightness(double brightness)
double GetBrightness() const
C4GameControlNetwork Network
void setTargetFPS(int32_t iToVal)
C4RoundResults & RoundResults
bool LoadScenarioSection(const char *section_name, DWORD flags)
C4String * GetTranslatedString(const class C4Value &input_string, C4Value *selected_language, bool fail_silently) const
C4Object * PlaceVegetation(C4PropList *def, int32_t x, int32_t y, int32_t wdt, int32_t hgt, int32_t growth, C4PropList *shape_proplist, C4PropList *out_pos_proplist)
std::unique_ptr< C4ScriptGuiWindow > ScriptGuiRoot
C4Object * PlaceAnimal(C4PropList *def)
StdCopyStrBuf NextMissionText
StdCopyStrBuf NextMissionDesc
C4PlayerInfoList & PlayerInfos
int32_t StartupPlayerCount
C4GameParameters & Parameters
C4Object * CreateObjectConstruction(C4PropList *type, C4Object *creator, int32_t owner, int32_t center_x=0, int32_t bottom_y=0, int32_t con=1, bool adjust_terrain=false)
void SetGlobalSoundModifier(C4PropList *modifier_props)
C4PlayerControlDefs PlayerControlDefs
C4Value GRBroadcast(const char *function, C4AulParSet *pars=nullptr, bool pass_error=false, bool reject_test=false)
C4Object * CreateObject(C4PropList *type, C4Object *creator, int32_t owner=NO_OWNER, int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false, C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t controller=NO_OWNER)
bool ReloadParticle(const char *name)
StdCopyStrBuf NextMission
bool Append(int32_t iType, const char *szText, C4Object *pTarget, int32_t iPlayer, int32_t iX, int32_t iY, uint32_t bCol, bool fNoDuplicates=false)
bool New(int32_t iType, const StdStrBuf &Text, C4Object *pTarget, int32_t iPlayer, int32_t iX=-1, int32_t iY=-1, uint32_t dwClr=0xffFFFFFF, C4ID idDecoID=C4ID::None, C4PropList *pSrc=nullptr, uint32_t dwFlags=0u, int32_t width=0)
C4Object * SafeObjectPointer(int32_t object_number)
static const int32_t MaxStrength
C4Effect * pScenarioEffects
bool RegisterGlobalGraphics()
bool RegisterMainGroups()
void FlashMessage(const char *message)
bool SetIDCount(C4ID c_id, int32_t iCount, bool fAddNewID=false)
C4ID GetID(size_t index, int32_t *ipCount=nullptr) const
int32_t GetIDCount(C4ID c_id, int32_t iZeroDefVal=0) const
C4Real GetGravity() const
bool DrawMap(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, const char *szMapDef, bool ignoreSky=false)
int32_t GetEffectiveMatCount(int material) const
int32_t DigFreeRect(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, C4Object *by_object=nullptr, bool no_dig2objects=false, bool no_instability_check=false)
BYTE GetPix(int32_t x, int32_t y) const
int32_t ExtractMaterial(int32_t fx, int32_t fy, bool distant_first)
BYTE GetBackPix(int32_t x, int32_t y) const
bool DrawQuad(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2, int32_t iX3, int32_t iY3, int32_t iX4, int32_t iY4, const char *szMaterial, const char *szBackMaterial, bool fDrawBridge)
void ClearFreeRect(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt)
void SetGravity(C4Real g)
bool DrawChunks(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, int32_t icntx, int32_t icnty, const char *szMaterial, const char *szTexture, bool bIFT)
int32_t GetBackMat(int32_t x, int32_t y) const
int32_t GetHeight() const
bool InsertMaterial(int32_t mat, int32_t *tx, int32_t *ty, int32_t vx=0, int32_t vy=0, bool query_only=false)
bool SetTextureIndex(const char *szMatTex, BYTE iNewIndex, bool fInsert)
int32_t DigFree(int32_t tx, int32_t ty, int32_t rad, C4Object *by_object=nullptr, bool no_dig2objects=false, bool no_instability_check=false)
void ShakeFree(int32_t tx, int32_t ty, int32_t rad)
DWORD GetModulation() const
int32_t GetMatCount(int material) const
bool DrawDefMap(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, const char *szMapDef, bool ignoreSky=false)
void RemoveUnusedTexMapEntries()
bool Incinerate(int32_t x, int32_t y, int32_t cause_player)
void BlastFree(int32_t tx, int32_t ty, int32_t rad, int32_t caused_by=NO_OWNER, C4Object *by_object=nullptr, int32_t iMaxDensity=C4M_Vehicle)
bool SetModulation(DWORD dwWithClr)
int32_t Get(const char *szMaterial)
bool Play(const char *szSongname=nullptr, bool fLoop=false, int fadetime_ms=0, double max_resume_time=0.0, bool allow_break=false)
void SetMusicBreakChance(int32_t val)
void SetMusicMaxPositionMemory(int32_t val)
void SetMusicBreakMax(int32_t val)
int SetPlayList(const char *szPlayList, bool fForceSwitch=false, int fadetime_ms=0, double max_resume_time=0.0)
int32_t SetGameMusicLevel(int32_t val)
void SetMusicBreakMin(int32_t val)
class C4ParticleList * BackParticles
class C4ParticleList * FrontParticles
int ObjectCount(C4ID id=C4ID::None) const
C4Object * GetObject(int index=0) const
C4ParticleDef * GetDef(const char *name, C4ParticleDef *exclude=nullptr)
C4ParticleSystemDefinitionList definitions
C4ParticleList * GetGlobalParticles()
void Create(C4ParticleDef *of_def, C4ParticleValueProvider &x, C4ParticleValueProvider &y, C4ParticleValueProvider &speedX, C4ParticleValueProvider &speedY, C4ParticleValueProvider &lifetime, C4PropList *properties, int amount=1, C4Object *object=nullptr)
void Set(const C4Value &value)
void SetLevel(int iLevel)
bool Find(int32_t iFromX, int32_t iFromY, int32_t iToX, int32_t iToY, SetWaypointFn fnSetWaypoint)
StdStrBuf GetKeysAsString(bool human_readable, bool short_name) const
C4PlayerControlAssignment * GetAssignmentByControl(int32_t control)
bool SetControlDisabled(int ctrl, bool is_disabled)
const CSync::ControlDownState * GetControlDownState(int32_t iControl) const
bool IsControlDisabled(int ctrl) const
void SetFoW(bool fEnable)
bool GainScenarioAchievement(const char *achievement_id, int32_t value, const char *scen_name_override=nullptr)
const char * GetName() const
bool SetWealth(int32_t val)
void SetViewMode(int32_t iMode, C4Object *pTarget=nullptr, bool immediate_position=false)
class C4PlayerControlAssignmentSet * ControlSet
C4Object * GetHiRankActiveCrew()
std::shared_ptr< class C4GamePadOpener > pGamepad
class C4PlayerInfo * GetInfo()
bool DoScore(int32_t iChange)
C4ID GetScriptPlayerExtraID() const
int32_t getLeagueScore() const
void SetTeam(int32_t idToTeam)
const char * GetLeagueProgressData() const
C4PlayerType GetType() const
bool SetAsScriptPlayer(const char *szName, uint32_t dwColor, uint32_t dwFlags, C4ID idExtra)
void SetLeagueProgressData(const char *szNewProgressData)
bool DoPlayerInfoUpdate(C4ClientPlayerInfos *pUpdate)
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
C4Player * GetByIndex(int iIndex) const
C4Player * Get(int iPlayer) const
bool HostilityDeclared(int iPlayer1, int iPlayer2) const
bool CtrlRemove(int iPlayer, bool fDisonnected)
virtual C4Object * GetObject()
C4PropList * GetPropertyPropList(C4PropertyName k) const
C4String * GetPropertyStr(C4PropertyName k) const
virtual C4Def const * GetDef() const
C4Value Call(C4PropertyName k, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
virtual void SetPropertyByS(C4String *k, const C4Value &to)
static C4PropList * New(C4PropList *prototype=nullptr)
bool GetProperty(C4PropertyName k, C4Value *pResult) const
void SetProperty(C4PropertyName k, const C4Value &to)
void HideSettlementScore(bool fHide=true)
void AddCustomEvaluationString(const char *szCustomString, int32_t idPlayer)
void SetLeaguePerformance(int32_t iNewPerf, int32_t idPlayer=0)
bool SortBy(int32_t iColKey, bool fReverse)
void DoDlgShow(int32_t iChange, bool fUserToggle)
int32_t GetCellData(int32_t iColKey, int32_t iRowKey)
void SetCell(int32_t iColKey, int32_t iRowKey, const char *szValue, int32_t iValue)
const char * GetCellString(int32_t iColKey, int32_t iRowKey)
bool CreateFromPropList(C4PropList *proplist, bool resetStdTag=false, bool isUpdate=false, bool isLoading=false)
C4ScriptGuiWindow * GetSubWindow(int32_t childID, C4Object *childTarget)
void SetTag(C4String *tag)
int Add(const std::string &shaderName, ShaderType type, const std::string &source)
DWORD GetModulation(bool fBackClr)
bool SetModulation(DWORD dwWithClr, DWORD dwBackClr)
C4SoundModifier * Get(class C4PropList *props, bool create_if_not_found)
C4SoundModifierList Modifiers
StdStrBuf GetData() const
const char * GetCStr() const
C4String * RegString(StdStrBuf String)
void AddPlayer(class C4PlayerInfo &rInfo, bool fAdjustPlayer)
uint32_t GetColor() const
void RemovePlayerByID(int32_t iID)
const char * GetName() const
C4Team * GetTeamByIndex(int32_t iIndex) const
C4Team * GetTeamByPlayerID(int32_t iID) const
bool IsMultiTeams() const
C4Team * GetTeamByID(int32_t iID) const
@ TEAM_AllowHostilityChange
bool IsHostilityChangeAllowed() const
bool IsAutoGenerateTeams() const
bool IsTeamColors() const
TeamDist GetTeamDist() const
bool IsJoin2TeamAllowed(int32_t idTeam, C4PlayerType plrType)
int32_t GetTeamCount() const
C4Team * GetGenerateTeamByID(int32_t iID)
bool IsTeamSwitchAllowed() const
const char * GetTextureName() const
uint32_t GetAverageColor() const
const char * GetTexture(int32_t iIndex)
const C4TexMapEntry * GetEntry(int32_t iIndex) const
static C4TimeMilliseconds Now()
void SetSize(int32_t inSize)
void SetItem(int32_t iElemNr, const C4Value &Value)
bool isDeserializer() override
bool isVerbose() override
virtual void ProcessString(std::string &str, bool isID)=0
void Boolean(bool &rBool) override
void DWord(uint32_t &rInt) override
void NameEnd(bool fBreak=false) override
void Word(int16_t &rShort) override
bool Name(const char *szName) override
void Word(uint16_t &rShort) override
virtual void ProcessChar(char &rChar)=0
void Byte(int8_t &rByte) override
void Byte(uint8_t &rByte) override
void String(char **pszString, RawCompileType eType) override
bool Default(const char *szName) override
void DWord(int32_t &rInt) override
bool hasNaming() override
void String(char *szString, size_t iMaxLength, RawCompileType eType) override
virtual void ProcessBool(bool &rBool)=0
void Character(char &rChar) override
void String(std::string &str, RawCompileType type) override
void Raw(void *pData, size_t iSize, RawCompileType eType=RCT_Escaped) override
virtual void ProcessString(char **pszString, bool fIsID)=0
C4ValueCompiler(const char **pszNames, int iNameCnt, int iEntryNr)
virtual void ProcessInt(int32_t &rInt)=0
virtual void ProcessString(char *szString, size_t iMaxLength, bool fIsID)=0
C4ValueGetCompiler(const char **pszNames, int iNameCnt, int iEntryNr)
void ProcessChar(char &rChar) override
void ProcessString(char **pszString, bool fIsID) override
void ProcessBool(bool &rBool) override
void ProcessString(char *szString, size_t iMaxLength, bool fIsID) override
void ProcessInt(int32_t &rInt) override
void ProcessString(std::string &str, bool fIsID) override
const C4Value & getResult() const
C4String * getStr() const
C4PropList * getPropList() const
void Denumerate(C4ValueNumbers *)
C4ValueMapNames * CreateTempNameList()
int32_t AddName(const char *pnName)
int32_t GetItemNr(const char *strName) const
void SetViewOffset(int32_t x, int32_t y)
C4Viewport * GetFirstViewport()
C4Viewport * GetViewport(int32_t player_nr, C4Viewport *prev=nullptr)
void SetClimate(int32_t iClimate)
int32_t GetWind(int32_t x, int32_t y)
void SetTemperature(int32_t iTemperature)
void SetWind(int32_t iWind)
void SetSeason(int32_t iSeason)
void Decompile(const T &rStruct)
void SetLength(size_t iLength)
void Ref(const char *pnData)
void Shrink(size_t iShrink)
const char * getData() const
bool SplitAtChar(char cSplit, StdStrBuf *psSplit)
bool GetSection(size_t idx, StdStrBuf *psOutSection, char cSeparator=';') const
void Copy(const C4Value *Pars, int ParCount)
C4KeyEventData MovedState
SumPathLength(PathInfo *info)
bool operator()(int32_t iX, int32_t iY, C4Object *TransferTarget)
class C4SoundInstance * StartSoundEffectAt(const char *, int32_t, int32_t, int32_t, int32_t, int32_t, class C4SoundModifier *)