Cavestory Mod API
CSMAPI_functions.h
Go to the documentation of this file.
1 /*
2  Cavestory Multiplayer API
3  Copyright (C) 2021 Johnny Ledger
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
26 #pragma once
27 #include <CSMAPI_begincode.h>
28 
29 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
30 // Logging
31 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
32 
36 
43 (
44  bool bEnable
45 );
46 
51 extern CAVESTORY_MOD_API void CSM_Log
52 (
53  const char* pFormat,
54  ...
55 );
56 
63 (
64  const char* pCategory,
65  const char* pFormat,
66  ...
67 );
68 
73 (
74  unsigned int iColor = 0xFFFFFFFF
75 );
76 
83 (
84  const char* pSourceFile,
85  int iSourceLineNo,
86  const char* pCategory,
87  const char* pFormat,
88  ...
89 );
90 
97 (
98  const char* pSourceFile,
99  int iSourceLineNo,
100  const char* pCategory,
101  const char* pFormat,
102  ...
103 );
104 
110 #define CSM_LogError(pCategory, pFormat, ...) CSM_LogInfo(pCategory, "\v08" pFormat, __VA_ARGS__)
111 
117 #define CSM_LogWarn(pCategory, pFormat, ...) CSM_LogInfo(pCategory, "\v0B" pFormat, __VA_ARGS__)
118 
124 #define CSM_LogErrorWithInfo(pCategory, pFormat, ...) __CSM__LogError(__FILE__, __LINE__, pCategory, pFormat, __VA_ARGS__)
125 
131 #define CSM_LogWarnWithInfo(pCategory, pFormat, ...) __CSM__LogWarn(__FILE__, __LINE__, pCategory, pFormat, __VA_ARGS__)
132 
139 (
140  const char* pCategory,
141  const char* pFormat,
142  ...
143 );
144 
154 extern CAVESTORY_MOD_API void CSM_Explode
155 (
156  int iErrorCode,
157  const char* pErrorName,
158  const char* pTitle = "\\a{0} crashed!",
159  const char* pMessage = "The mod's DLL has crashed!",
160  bool bGenerateCrashLog = true
161 );
162 
165 
166 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
167 // Dedicated Server Commands
168 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
169 
173 
184 (
185  const char* pFormat,
186  ...
187 );
188 
191 
192 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
193 // Platform Passthrough
194 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
195 
199 
221 (
222  const char* pDesiredSubpath,
223  const char* pFileName,
224  char* pOutputFilePath,
225  char* pOutputFileName,
226  const char* pFileNameFormat = "*.*",
227  void* pModPointer = NULL
228 );
229 
234 (
235  CSM_ProgramMode* eModePtr
236 );
237 
244 (
245  CSM_ProgramMode eMode
246 );
247 
250 
251 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
252 // Function Management
253 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
254 
258 
266 (
267  const char* pName,
269 );
270 
278 (
279  unsigned int iNameHash,
281 );
282 
295 (
296  const char* pName,
297  const char* pUIFormat,
298  const char* pUIDynamicFormat,
299  unsigned long long int iMaskBits = 0,
300  unsigned long long int iFlags = 0,
301  CSM_NetScore_GetScoreModifyAmount pModifyFunc = NULL
302 );
303 
313 (
314  const char* pWeaponName,
316 );
317 
327 (
328  int iWeaponIndex,
330 );
331 
341 (
342  int iBulletIndex,
343  CSM_Bullet_ActFunc pFunc
344 );
345 
353 (
354  int iNpcIndex,
355  CSM_Npc_ActFunc pFunc
356 );
357 
366 (
367  CSM_Caret_ActFunc pFunc,
368  int iWidth,
369  int iHeight
370 );
371 
384 (
385  const char* pStateName,
386  unsigned long long int iFlags,
387  unsigned int iTransmitFlags,
388  PlayerState_ActFuncType pActFunc,
389  PlayerState_AnimFuncType pAnimFunc,
390  PlayerState_DrawFuncType pDrawFunc = NULL,
391  int* pPlayerStateIndex = NULL,
392  unsigned int iIndexOverride = 0,
393  PlayerStateAnimator_OutputType iOutputType = PlayerStateAnimator_OutputType::PSAOT_PLAYER_FRAME
394 );
395 
406 (
407  const char* pCmdName,
408  const char* pShortDesc,
409  const char* pDesc,
410  const char* pArgs,
411  void(*pFuncPtr)(int&, int&, int&, int&, bool&, int&)
412 );
413 
417 (
418 );
419 
422 
423 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
424 // Config Functions
425 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
426 
430 
433 typedef void(*CSM_HOOK_OnPostDrawFunc)();
434 
439 (
440  CSM_HOOK_OnPostDrawFunc pFuncPtr
441 );
442 
443 //-------------
444 
448 typedef void(*CSM_HOOK_OnDrawHUDFunc)(BOOL bFlash);
449 
454 (
455  CSM_HOOK_OnDrawHUDFunc pFuncPtr
456 );
457 
458 //-------------
459 
462 typedef void(*CSM_HOOK_OnDrawMapBackFunc)();
463 
468 (
470 );
471 
472 //-------------
473 
477 
482 (
484 );
485 
486 //-------------
487 
490 typedef void(*CSM_HOOK_OnPreDrawHUDFunc)();
491 
496 (
498 );
499 
500 //-------------
501 
510 typedef BOOL(*CSM_HOOK_OnDrawItemFunc)(GUI_RECT pDrawRect, MYCHAR* pMC, ITEM* pItem, int iItemIndex);
511 
516 (
517  CSM_HOOK_OnDrawItemFunc pFuncPtr
518 );
519 
520 //-------------
521 
527 
532 (
534 );
535 
536 //-------------
537 
543 
548 (
550 );
551 
552 //-------------
553 
559 
564 (
566 );
567 
568 //-------------
569 
578 typedef BOOL(*CSM_HOOK_OnGetTeamSpawnPointFunc)(CaveNet::DataStructures::NetTeam* pTeam, int* pSpawnX, int* pSpawnY);
579 
584 (
586 );
587 
588 //-------------
589 
599 
604 (
605  CSM_HOOK_OnClientDieFunc pFuncPtr
606 );
607 
608 //-------------
609 
617 
622 (
624 );
625 
626 //-------------
627 
632 typedef void(*CSM_HOOK_OnStageChangeFunc)(const char* pStageName, int iAreaIndex);
633 
638 (
640 );
641 
642 //-------------
643 
652 typedef BOOL(*CSM_HOOK_OnPlayerPickupHeartFunc)(NPCHAR* pHeart, CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, int iHealth);
653 
658 (
660 );
661 
662 //-------------
663 
672 typedef BOOL(*CSM_HOOK_OnPlayerPickupMissileFunc)(NPCHAR* pMissile, CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, int iAmmo);
673 
678 (
680 );
681 
682 //-------------
683 
693 
698 (
700 );
701 
702 //-------------
703 
706 typedef void(*CSM_HOOK_OnServerTickFunc)();
707 
712 (
714 );
715 
716 //-------------
717 
720 typedef void(*CSM_HOOK_OnClientTickFunc)();
721 
726 (
728 );
729 
730 //-------------
731 
738 
743 (
745 );
746 
747 //-------------
748 
755 
760 (
762 );
763 
764 //-------------
765 
773 
778 (
780 );
781 
789 (
790  int iCodeChar,
791  bool bWhitelisted
792 );
793 
794 //-------------
795 
801 typedef BOOL(*CSM_HOOK_OnHitBulletMapFunc)(BULLET* pBullet);
802 
807 (
809 );
810 
811 //-------------
812 
820 typedef BOOL(*CSM_HOOK_OnHitMyCharNpCharFunc)(CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, bool bNoclip);
821 
826 (
828 );
829 
830 //-------------
831 
841 typedef BOOL(*CSM_HOOK_OnMyCharCollisionTest_NpChar)(CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, NPCHAR* pNpc, BOOL bNoclip, BOOL& bCallAgain);
842 
848 (
849  int iNpcId,
851 );
852 
853 //-------------
854 
865 typedef BOOL(*CSM_HOOK_OnHitMyCharMapTileFunc)(CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, int iTileX, int iTileY, int iTileAttrib, bool bNoclip);
866 
871 (
873 );
874 
875 //-------------
876 
884 typedef BOOL(*CSM_HOOK_OnHitMyCharMapFunc)(CaveNet::DataStructures::NetClient* pClient, MYCHAR* pMC, bool bNoclip);
885 
890 (
892 );
893 
894 //-------------
895 
904 
909 (
910  CSM_HOOK_OnProcessAIFunc pFuncPtr
911 );
912 
913 //-------------
914 
922 typedef BOOL(*CSM_HOOK_OnMessageSentFunc)(CaveNet::DataStructures::NetClient* pClient, const char* pMessage);
923 
928 (
930 );
931 
932 //-------------
933 
946 typedef void(*CSM_HOOK_OnReceiveUserCmdFromClientFunc)(CaveNet::DataStructures::NetClient* pClient, int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char* pString1);
947 
952 (
954 );
955 
956 //-------------
957 
969 typedef void(*CSM_HOOK_OnReceiveUserCmdFromServerFunc)(int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char* pString1);
970 
975 (
977 );
978 
979 //-------------
980 
983 
984 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
985 // Config Functions
986 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
987 
991 
998 (
999  const char* pCVarName
1000 );
1001 
1008 (
1009  const char* pCVarName
1010 );
1011 
1017 extern CAVESTORY_MOD_API const char* Config_GetString
1018 (
1019  const char* pCVarName
1020 );
1021 
1029 (
1030  const char* pCVarName,
1031  GUI_COLOR& pColor
1032 );
1033 
1042 (
1043  const char* pCVarName,
1044  const char* pValue,
1045  bool bUserInput = false
1046 );
1047 
1049 
1050 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1051 // Server Functions
1052 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1053 
1056 
1061 (
1062 );
1063 
1068 (
1069 );
1070 
1075 (
1076 );
1077 
1078 
1083 (
1084 );
1085 
1099 (
1101  int iArg1 = 0,
1102  int iArg2 = 0,
1103  int iArg3 = 0,
1104  int iArg4 = 0,
1105  int iArg5 = 0,
1106  int iArg6 = 0,
1107  const char* pString1 = NULL
1108 );
1109 
1122 (
1123  int iArg1 = 0,
1124  int iArg2 = 0,
1125  int iArg3 = 0,
1126  int iArg4 = 0,
1127  int iArg5 = 0,
1128  int iArg6 = 0,
1129  const char* pString1 = NULL
1130 );
1131 
1134 
1135 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1136 // Game Functions
1137 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1138 
1142 
1146 (
1147 );
1148 
1155 (
1156  int iIndex
1157 );
1158 
1163 (
1164 );
1165 
1171 (
1172 );
1173 
1179 (
1180  CSM_BossTypes iBossType,
1181  int iHealth
1182 );
1183 
1186 
1190 
1202 (
1203  GUI_POINT pPointStart,
1204  GUI_POINT pPointEnd,
1205  RAYCAST_QUERY* pInfo = NULL,
1206  bool bHitEndBlock = true,
1207  bool bHitStartBlock = true
1208 );
1209 
1225 (
1226  int iStartX,
1227  int iStartY,
1228  int iEndX,
1229  int iEndY,
1230  unsigned int iHitMask,
1231  RAYCAST_QUERY* pInfo = NULL,
1232  bool bHitEndBlock = true,
1233  bool bHitStartBlock = true
1234 );
1235 
1242 (
1243  GUI_RECT* pRect
1244 );
1245 
1248 
1249 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1250 // Game Functions
1251 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1252 
1256 
1263 (
1264  int iNewWidth,
1265  int iNewHeight,
1266  int iNewMagnification = -1
1267 );
1268 
1274 (
1275  int* iWidth,
1276  int* iHeight
1277 );
1278 
1281 
1282 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1283 // Game Functions
1284 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1285 
1289 
1295 (
1296  const char* pOutputImagePath,
1297  GUI_RECT* pSource = NULL
1298 );
1299 
1304 (
1305  BOOL bValue
1306 );
1307 
1312 (
1313 );
1314 
1322 (
1323  int iFrameX,
1324  int iFrameY,
1325  SafeClientInterface* pInterface,
1326  float fScale = 1.f
1327 );
1328 
1336 (
1337  int iFrameX,
1338  int iFrameY,
1339  SafeClientInterface* pInterface,
1340  float fScale = 1.f
1341 );
1342 
1349 (
1350  const char* pName
1351 );
1352 
1362 (
1363  CustomPlayer* pCharacter,
1364  int iFrame,
1365  int iX,
1366  int iY
1367 );
1368 
1375 (
1376  CustomPlayer* pCharacter
1377 );
1378 
1385 (
1386  CustomPlayer* pCharacter
1387 );
1388 
1395 (
1396  CustomPlayer* pCharacter
1397 );
1398 
1405 (
1406  CustomPlayer* pCharacter
1407 );
1408 
1412 (
1413 );
1414 
1421 (
1422  int* pX, int* pY, int iValue
1423 );
1424 
1428 (
1429 );
1430 
1436 (
1437  int iFrameX,
1438  int iFrameY
1439 );
1440 
1448 (
1449  NPCHAR* pNpc,
1450  NPCHAR* pOther
1451 );
1452 
1460 (
1461  MYCHAR* pMC,
1462  NPCHAR* pNpc
1463 );
1464 
1472 (
1473  NPCHAR* pNpc
1474 );
1475 
1483 (
1484  NPCHAR* pNpc
1485 );
1486 
1491 (
1492  int iTime
1493 );
1494 
1499 (
1500  int iTime
1501 );
1502 
1506 (
1507 );
1508 
1513 (
1514 );
1515 
1520 (
1521 );
1522 
1527 (
1528 );
1529 
1540 (
1541  int iBulNo,
1542  int iSpawnX,
1543  int iSpawnY,
1544  int iDirection,
1545  int iCodeArms,
1546  int iLevel,
1547  int iGhostId = 0
1548 );
1549 
1558 (
1559  int iSpawnX,
1560  int iSpawnY,
1561  int iCaretId,
1562  int iDirection,
1563  CARET** pOut = NULL
1564 );
1565 
1579 (
1580  int iNpcId,
1581  int iSpawnX,
1582  int iSpawnY,
1583  int iVelocityX,
1584  int iVelocityY,
1585  int iDirection,
1586  NPCHAR* pNpc,
1587  int iStartIndex,
1588  NPCHAR** iOutNPC = 0,
1589  bool bForceSpawn = false
1590 );
1591 
1597 (
1598  int iEventNo,
1599  BOOL bSetFlag = TRUE
1600 );
1601 
1607 (
1608  int iFlagNo,
1609  BOOL bSetFlag = FALSE
1610 );
1611 
1617 (
1618  int iCharCode,
1619  BOOL bSmoke,
1620  BOOL bSetFlag = TRUE
1621 );
1622 
1636  int iNpcId,
1637  int iSpawnX,
1638  int iSpawnY,
1639  int iVelocityX,
1640  int iVelocityY,
1641  int iDirection,
1642  NPCHAR* pNpc,
1643  int iStartIndex,
1644  NPCHAR** iOutNPC = 0,
1645  bool bForceSpawn = false
1646 );
1647 
1662 (
1663  int iNpcId,
1664  int iVelocityX,
1665  int iVelocityY,
1666  int iDirection,
1667  NPCHAR* pNpc,
1668  int iStartIndex,
1669  MYCHAR* pMC,
1670  CustomPlayer* pCustomChar,
1671  NPCHAR** iOutNPC = 0
1672 );
1673 
1680 (
1681  int iSubPixelX,
1682  int iSubPixelY,
1683  int iAmount
1684 );
1685 
1692 (
1693  int iSubPixelX,
1694  int iSubPixelY,
1695  int iAmount
1696 );
1697 
1704 (
1705  int iSubPixelX,
1706  int iSubPixelY,
1707  int iAmount
1708 );
1709 
1717 (
1718  int iArmsCode,
1719  int iGhostId = -1
1720 );
1721 
1729 (
1730  int iBulletCode,
1731  int iGhostId = -1
1732 );
1733 
1738 (
1739  int iArmsCode
1740 );
1741 
1745 (
1746 );
1747 
1751 (
1752 );
1753 
1760 (
1761  long iCode
1762 );
1763 
1771 (
1772  long iCode,
1773  long iNum,
1774  long iMaxNum,
1775  long iLevel
1776 );
1777 
1784 (
1785  long iNum,
1786  ARMS* pArmsTable,
1787  int iSelectedIdx
1788 );
1789 
1793 (
1794 );
1795 
1800 (
1801 );
1802 
1811 (
1812  long iChargeAmt,
1813  ARMS* pArmsTable,
1814  int iSelectedWeapon
1815 );
1816 
1824 (
1825  int iSpawnX,
1826  int iSpawnY,
1827  int iMaxRandomXOffset,
1828  int iSmokeAmt
1829 );
1830 
1840 (
1841  int iStageNo,
1842  int iEventNo,
1843  int iSpawnX,
1844  int iSpawnY
1845 );
1846 
1856 (
1857  int iStageNo,
1858  int iEventNo,
1859  int iSpawnX,
1860  int iSpawnY
1861 );
1862 
1870 (
1871  int iStageNo,
1872  int iEventNo
1873 );
1874 
1881 (
1882  const char* pFieldName
1883 );
1884 
1893 (
1894  NPCHAR* pNpc,
1895  unsigned int iFieldCrc
1896 );
1897 
1905 (
1906  NPCHAR* pNpc,
1907  const char* pFieldName
1908 );
1909 
1919 (
1920  NPCHAR* pNpc,
1921  int iFieldIndex,
1922  const char* pFormat,
1923  ...
1924 );
1925 
1935 (
1936  NPCHAR* pNpc,
1937  int iFieldIndex,
1938  char* pOutBuffer,
1939  int iOutBufferSize,
1940  const char* pDefaultValue = ""
1941 );
1942 
1951 (
1952  NPCHAR* pNpc,
1953  int iFieldIndex,
1954  int iDefaultValue = 0
1955 );
1956 
1965 (
1966  NPCHAR* pNpc,
1967  int iFieldIndex,
1968  float fDefaultValue = 0.0f
1969 );
1970 
1979 (
1980  NPCHAR* pNpc,
1981  int iFieldIndex,
1982  BOOL bDefaultValue = FALSE
1983 );
1984 
1994 (
1995  NPCHAR* pNpc,
1996  int iFieldIndex,
1997  GUI_COLOR* pColorPtr,
1998  GUI_COLOR pDefaultValue = GUI_COLOR(0, 0, 0, 0)
1999 );
2000 
2010 (
2011  NPCHAR* pNpc,
2012  int iFieldIndex,
2013  GUI_POINT* pPointPtr,
2014  GUI_POINT pDefaultValue = GUI_POINT(0, 0)
2015 );
2016 
2026 (
2027  NPCHAR* pNpc,
2028  int iFieldIndex,
2029  GUI_RECT* pRectPtr,
2030  GUI_RECT pDefaultValue = GUI_RECT(0, 0, 0, 0)
2031 );
2032 
2039 (
2040  int iX,
2041  int iY,
2042  bool bRecordChange = true
2043 );
2044 
2051 (
2052  int iX,
2053  int iY,
2054  bool bRecordChange = true
2055 );
2056 
2065 (
2066  int iX,
2067  int iY,
2068  unsigned short iTileIndex,
2069  bool bCreateSmoke = true,
2070  bool bRecordChange = true
2071 );
2072 
2076 (
2077 );
2078 
2083 (
2084  bool bForeground
2085 );
2086 
2093 (
2094  bool bForeground,
2095  unsigned int iX,
2096  unsigned int iY
2097 );
2098 
2109 (
2110  bool bForeground,
2111  unsigned int iX,
2112  unsigned int iY,
2113  RECT* pRectList,
2114  unsigned char iRectCount,
2115  unsigned short iWait,
2117 );
2118 
2123 (
2124 );
2125 
2130 (
2131  char* pPath
2132 );
2133 
2138 (
2139  TEXT_SCRIPT_PTR_DATA* pData = &default_TextScriptPtrData
2140 );
2141 
2152 (
2153  int iEventNo,
2154  bool bTransmit = true,
2155  TEXT_SCRIPT_PTR_DATA* pData = &default_TextScriptPtrData,
2156  bool bUseRestrictionLevel = false,
2158  NPCHAR* pSourceNpc = NULL
2159 );
2160 
2164 (
2165 );
2166 
2173 (
2174  const char* pFileName = "290.rec"
2175 );
2176 
2181 (
2182 );
2183 
2188 (
2189  unsigned long long int iOffset
2190 );
2191 
2197 (
2198  int iFrameCount
2199 );
2200 
2205 (
2206 );
2207 
2213 (
2214  int iTimeInMS
2215 );
2216 
2221 (
2222 );
2223 
2228 (
2229 );
2230 
2239 (
2240  const char* pFileName,
2241  MYCHAR* pMC = NULL
2242 );
2243 
2251 (
2252  const char* pFileName,
2253  BOOL bDoGameFuncs = TRUE
2254 );
2255 
2262 (
2263  PROFILE* pProfile
2264 );
2265 
2272 (
2273  PROFILE* pProfile
2274 );
2275 
2285 (
2286  const char* pName,
2287  PROFILE* pProfile,
2288  unsigned long long* pModifyTime = NULL
2289 );
2290 
2299 (
2300  int iX,
2301  int iY,
2302  unsigned int iTileTypes
2303 );
2304 
2312 (
2313  NPCHAR* pNpc,
2314  unsigned int iTileTypes
2315 );
2316 
2324 (
2325  unsigned int iTileTypes,
2326  unsigned int iOtherTileTypes
2327 );
2328 
2336 (
2337  int iX,
2338  int iY
2339 );
2340 
2348 (
2349  NPCHAR* pNpc
2350 );
2351 
2357 (
2358  int* iX,
2359  int* iY
2360 );
2361 
2367 (
2368  int iX,
2369  int iY
2370 );
2371 
2375 (
2376 );
2377 
2381 (
2382 );
2383 
2390 (
2391  signed char iDirect
2392 );
2393 
2400 (
2401  signed char iDirect
2402 );
2403 
2407 (
2408 );
2409 
2413 (
2414 );
2415 
2420 (
2421 );
2422 
2427 (
2428 );
2429 
2432 
2433 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2434 // Extended input
2435 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2436 
2440 
2448 (
2449  CSM_SDL_Scancode iScanCode,
2450  BOOL bPressed
2451 );
2452 
2461 (
2462  CSM_SDL_Scancode iScanCode
2463 );
2464 
2473 (
2474  CSM_SDL_Scancode iScanCode
2475 );
2476 
2485 (
2486  CSM_SDL_Scancode iScanCode
2487 );
2488 
2497 (
2498  CSM_SDL_Scancode iScanCode
2499 );
2500 
2504 (
2505 );
2506 
2510 (
2511 );
2512 
2515 
2516 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2517 // Input
2518 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2519 
2523 
2528 (
2529 );
2530 
2534 (
2535 );
2536 
2537 
2543 extern CAVESTORY_MOD_API int GetKeybind
2544 (
2545  CSM_KEYBIND_DESC iType
2546 );
2547 
2553 extern CAVESTORY_MOD_API int GetInput
2554 (
2555  CSM_KEY_DESC iType
2556 );
2557 
2560 
2561 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2562 // Time
2563 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2564 
2568 
2572 extern CAVESTORY_MOD_API unsigned int GetTicks
2573 (
2574 );
2575 
2579 extern CAVESTORY_MOD_API unsigned long long int CSM_GetFrameCount
2580 (
2581 );
2582 
2585 
2586 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2587 // Math
2588 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2589 
2593 
2594 #ifndef NO_WINDOWS
2602 (
2603  int iMin,
2604  int iMax
2605 );
2606 #endif
2607 
2614 (
2615  unsigned char iDeg
2616 );
2617 
2624 (
2625  unsigned char iDeg
2626 );
2627 
2634 extern CAVESTORY_MOD_API unsigned char GetArktan
2635 (
2636  int iX,
2637  int iY
2638 );
2639 
2646 (
2647  NPCHAR* pNpc
2648 );
2649 
2659 (
2660  NPCHAR* pNpc,
2661  NpcPositionType iType = NpcPositionType::NPT_DRAW_POSITION,
2662  int* iOutX = NULL,
2663  int* iOutY = NULL,
2664  int iFrameX = -1,
2665  int iFrameY = -1
2666 );
2667 
2674 (
2675  NPCHAR* pNpc
2676 );
2677 
2684 extern CAVESTORY_MOD_API unsigned long long int CSM_Npc_GetTransmitNodes
2685 (
2686  unsigned int iCodeChar,
2687  int iActNo
2688 );
2689 
2696 extern CAVESTORY_MOD_API unsigned long long int CSM_Npc_GetUpdateNodes
2697 (
2698  unsigned int iCodeChar,
2699  int iActNo
2700 );
2701 
2709 (
2710  MYCHAR* pMC,
2711  GUI_RECT* pOut
2712 );
2713 
2723 (
2724  MYCHAR* pMC,
2725  int iWeaponCode,
2726  GUI_POINT* pOut
2727 );
2728 
2737 (
2738  MYCHAR* pMC,
2739  GUI_POINT* pOut
2740 );
2741 
2750 (
2751  MYCHAR* pMC,
2752  GUI_POINT* pOut
2753 );
2754 
2761  int iCoord
2762 )
2763 {
2764  return iCoord * magnification / 0x200;
2765 }
2766 
2773  int iCoord
2774 )
2775 {
2776  return iCoord * magnification;
2777 }
2778 
2785  int iCoord
2786 )
2787 {
2788  return iCoord / magnification;
2789 }
2790 
2791 
2798  int iCoord
2799 )
2800 {
2801  return 0x200 * iCoord / magnification;
2802 }
2803 
2808 (
2809 );
2810 
2815 (
2816 );
2817 
2822 (
2823  int iMagnification
2824 );
2825 
2828 
2829 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2830 // Misc
2831 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2832 
2836 
2841 (
2842 );
2843 
2852 (
2853  const char** pCategoryList = NULL,
2854  int iCategoryCount = 0
2855 );
2856 
2859 
2860 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2861 // PlayerStates
2862 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2863 
2867 
2874 (
2875  SafeClientInterface* pInterface,
2876  int iStateType = -1,
2877  bool bForce = false
2878 );
2879 
2886 (
2887  SafeClientInterface* pInterface
2888 );
2889 
2896 inline bool IsPlayerState(MYCHAR* pChar, int iStateType) { return pChar->netanim == iStateType; }
2897 
2904 (
2905  MYCHAR* pChar
2906 );
2907 
2914 (
2915  MYCHAR* pChar
2916 );
2917 
2924 (
2925  MYCHAR* pChar
2926 );
2927 
2934 (
2935  const char* pName
2936 );
2937 
2944 (
2945  int iUnitIndex
2946 );
2947 
2954 (
2955  int iPlayerState
2956 );
2957 
2960 
2961 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2962 // Text Script
2963 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
2964 
2968 
2972 (
2973 );
2974 
2979 (
2980  int iIndex
2981 );
2982 
2986 (
2987 );
2988 
2992 (
2993 );
2994 
2998 (
2999 );
3000 
3004 (
3005 );
3006 
3013 (
3014  int a
3015 );
3016 
3021 (
3022 );
3023 
3031 (
3032  int no,
3033  BOOL call = FALSE
3034 );
3035 
3043 (
3044  const char* pLine4,
3045  const char* pLine3,
3046  const char* pLine2,
3047  const char* pLine1
3048 );
3049 
3055 (
3056  const char* pString,
3057  bool bSanitize = false
3058 );
3059 
3060 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
3061 // Flags
3062 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
3063 
3067 
3073 (
3074  long iFlagNo,
3075  bool bTransmit = true
3076 );
3077 
3083 (
3084  long iFlagNo,
3085  bool bTransmit = true
3086 );
3087 
3094 (
3095  long iFlagNo
3096 );
3097 
3103 (
3104  long iFlagNo,
3105  bool bTransmit = true
3106 );
3107 
3113 (
3114  long iFlagNo,
3115  bool bTransmit = true
3116 );
3117 
3124 (
3125  long iFlagNo
3126 );
3127 
3130 
3131 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
3132 // Sound
3133 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
3134 
3138 
3142 typedef int CSM_CustomSoundId;
3143 
3150 (
3151  const char* pPath
3152 );
3153 
3159 extern CAVESTORY_MOD_API CSM_CustomSoundId CSM_LoadCustomSound
3160 (
3161  const char* pPath
3162 );
3163 
3169 (
3170  CSM_CustomSoundId iSoundId,
3171  unsigned char iPanAmount = 50
3172 );
3173 
3179 (
3180  CSM_CustomSoundId iSoundId,
3181  unsigned char iVolume
3182 );
3183 
3190 (
3191  CSM_CustomPixToneId iSoundId
3192 );
3193 
3200 (
3201  CSM_CustomSoundId iSoundId
3202 );
3203 
3207 (
3208 );
3209 
3223 (
3224  int iSubpixelX,
3225  int iSubpixelY,
3226  int iRadius,
3227  bool bAlwaysOnScreen,
3228  int iSoundIndex,
3229  int iPlayMode = SOUND_MODE_STOP_THEN_PLAY,
3230  unsigned int iPlayVolume = 0x100,
3231  unsigned int iFalloffRadius = 0x7FFFFFFE
3232 );
3233 
3239 (
3240  int iSoundIndex,
3241  unsigned short iPitch
3242 );
3243 
3249 (
3250  int iSoundIndex,
3251  char iPan
3252 );
3253 
3259 (
3260  int iSoundIndex,
3261  unsigned char iVolume
3262 );
3263 
3270 (
3271  int iSoundIndex,
3272  int iPlayMode = SOUND_MODE_STOP_THEN_PLAY,
3273  unsigned int iPlayVolume = 0x100
3274 );
3275 
3282 (
3283  int iSoundId
3284 );
3285 
3290 (
3291  int iMusicIndex
3292 );
3293 
3298 (
3299  const char* pFileName
3300 );
3301 
3306 (
3307  unsigned char iVolume
3308 );
3309 
3314 (
3315 );
3316 
3319 
3320 #include <CSMAPI_endcode.h>
CSM_BossTypes
Boss types.
Definition: CSMAPI_enums.h:1336
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
@ SURFACE_ID_LEVEL_TILESET
Current level tileset.
Definition: CSMAPI_enums.h:722
CSM_ProgramMode
The program mode.
Definition: CSMAPI_enums.h:1414
CSM_KEY_DESC
A table of input descriptors.
Definition: CSMAPI_enums.h:116
PlayerDeathType
A list of possible player death types.
Definition: CSMAPI_enums.h:1215
PlayerStateAnimator_OutputType
A list of output types for a player state's "ANIMATE" function.
Definition: CSMAPI_enums.h:1203
TextScriptTarget
The TextScript's target.
Definition: CSMAPI_enums.h:1045
@ TS_TARGET_EVERYONE
Target everyone in the server.
Definition: CSMAPI_enums.h:1047
CSM_SDL_Scancode
SDL2's scancode enum, exposed for CSM.
Definition: CSMAPI_enums.h:1757
CSM_KEYBIND_DESC
A table of keybind descriptors.
Definition: CSMAPI_enums.h:83
NpcPositionType
A list of position types for CSM_Npc_GetPosition .
Definition: CSMAPI_enums.h:1241
float(* CSM_NetScore_GetScoreModifyAmount)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetScoreInstance *pInstance)
Determine the amount of score to be modified for a client.
Definition: CSMAPI_types.h:7384
void(* PlayerState_DrawFuncType)(int iFrameX, int iFrameY, MYCHAR *pMC, SafeClientInterface *pInterface)
The draw function for this player state.
Definition: CSMAPI_types.h:7157
void(* CSM_Npc_ActFunc)(NPCHAR *pNpc)
Called every frame an NPC is active.
Definition: CSMAPI_types.h:7413
void(* PlayerState_ActFuncType)(BOOL bKey, SafeClientInterface *pInterface, MYCHAR *pMC, const MYCHAR_PHYSICS *pPhysics)
The act function for this player state.
Definition: CSMAPI_types.h:7140
void(* CSM_Caret_ActFunc)(CARET *caret)
Called every frame a caret is active.
Definition: CSMAPI_types.h:7421
unsigned int(* PlayerState_AnimFuncType)(BOOL bKey, MYCHAR *pMC, SafeClientInterface *pInterface)
The animation function for this player state.
Definition: CSMAPI_types.h:7149
void(* CSM_Bullet_ActFunc)(BULLET *pBul, int iLevel)
Called every frame a bullet is active.
Definition: CSMAPI_types.h:7404
void(* CSM_Weapon_ShootFunc)(ShootInfo *sData, int iLevel)
Called every frame a weapon is equipped, for every client.
Definition: CSMAPI_types.h:7394
Networking client.
Definition: CaveNet_ExportedTypes.h:1825
A networking player.
Definition: CaveNet_ExportedTypes.h:3560
Score type.
Definition: CaveNet_ExportedTypes.h:553
Player teams.
Definition: CaveNet_ExportedTypes.h:860
CAVESTORY_MOD_API int CSM_Boss_GetBossCount()
Get the number of valid boss functions.
CAVESTORY_MOD_API void CSM_Boss_ResetAllBossesHealth()
Reset all bosses' health back to their initial health amounts.
CAVESTORY_MOD_API void CSM_Boss_SetInitHealth(CSM_BossTypes iBossType, int iHealth)
Set the initializer health for a boss.
CAVESTORY_MOD_API NPCHAR * CSM_Boss_GetBossNpc(int iIndex)
Get a boss NPC by index.
CAVESTORY_MOD_API int CSM_Boss_GetCurrentBossDefaultHealth()
Get the current boss' init health.
CAVESTORY_MOD_API int CSM_CaveNet_GetClientCount()
Get how many clients are currently connected to the server.
Definition: CavestoryModAPI.cpp:160
CAVESTORY_MOD_API int CSM_CaveNet_GetRealClientCount()
Get how many clients are currently connected to the server, excluding AI players.
Definition: CavestoryModAPI.cpp:165
CAVESTORY_MOD_API bool CSM_CaveNet_ConnectedAsClient()
Check to see whether we're connected to a server or not.
Definition: CavestoryModAPI.cpp:150
CAVESTORY_MOD_API BOOL CSM_CaveNet_SendUserCmdToClient(CaveNet::DataStructures::NetClient *pClient, int iArg1=0, int iArg2=0, int iArg3=0, int iArg4=0, int iArg5=0, int iArg6=0, const char *pString1=NULL)
Send a user command to a connected client.
CAVESTORY_MOD_API bool CSM_CaveNet_IsHosting()
Check to see whether we're hosting a server.
Definition: CavestoryModAPI.cpp:155
CAVESTORY_MOD_API BOOL CSM_CaveNet_SendUserCmdToServer(int iArg1=0, int iArg2=0, int iArg3=0, int iArg4=0, int iArg5=0, int iArg6=0, const char *pString1=NULL)
Send a user command to the server we're connected to.
CAVESTORY_MOD_API bool Config_GetBool(const char *pCVarName)
Get a boolean value from a configuration variable.
Definition: CavestoryModAPI.cpp:172
CAVESTORY_MOD_API bool Config_SetValue(const char *pCVarName, const char *pValue, bool bUserInput=false)
Set the value of a configuration variable.
Definition: CavestoryModAPI.cpp:202
CAVESTORY_MOD_API const char * Config_GetString(const char *pCVarName)
Get a string value from a configuration variable.
Definition: CavestoryModAPI.cpp:184
CAVESTORY_MOD_API int Config_GetInt(const char *pCVarName)
Get an integer value from a configuration variable.
Definition: CavestoryModAPI.cpp:178
CAVESTORY_MOD_API void Config_GetColor(const char *pCVarName, GUI_COLOR &pColor)
Get a color value from a configuration variable.
Definition: CavestoryModAPI.cpp:190
CAVESTORY_MOD_API int CSM_DediServer_RunCommand(const char *pFormat,...)
Run a console command for the server.
CAVESTORY_MOD_API BOOL CSM_ExtendedInput_GetKeyDown(CSM_SDL_Scancode iScanCode)
Check to see if a key was depressed on this frame.
CAVESTORY_MOD_API void CSM_ExtendedInput_SetKeyState(CSM_SDL_Scancode iScanCode, BOOL bPressed)
Set whether a key is being pressed or not.
CAVESTORY_MOD_API void CSM_ExtendedInput_ProcessShortcuts()
Process all registered keyshortcuts.
CAVESTORY_MOD_API void CSM_ExtendedInput_ProcessFrame()
Process an input frame.
CAVESTORY_MOD_API BOOL CSM_ExtendedInput_GetKey(CSM_SDL_Scancode iScanCode)
Check to see if a key is being held down.
CAVESTORY_MOD_API BOOL CSM_ExtendedInput_GetKeyRepeated(CSM_SDL_Scancode iScanCode)
Check to see if a key was repeated on this frame.
CAVESTORY_MOD_API BOOL CSM_ExtendedInput_GetKeyUp(CSM_SDL_Scancode iScanCode)
Check to see if a key was released on this frame.
CAVESTORY_MOD_API BOOL GetNPCFlag(long iFlagNo)
Check if an NPC flag is set.
CAVESTORY_MOD_API void SetNPCFlag(long iFlagNo, bool bTransmit=true)
Set an NPC flag to 'true'.
CAVESTORY_MOD_API void CutSkipFlag(long iFlagNo, bool bTransmit=true)
Set a skip flag to 'true'.
CAVESTORY_MOD_API BOOL GetSkipFlag(long iFlagNo)
Check if a skip flag is set.
CAVESTORY_MOD_API void CutNPCFlag(long iFlagNo, bool bTransmit=true)
Set an NPC flag to 'false'.
CAVESTORY_MOD_API void SetSkipFlag(long iFlagNo, bool bTransmit=true)
Set a skip flag to 'true'.
CAVESTORY_MOD_API BOOL CSM_FindNetScoreType(const char *pName, CaveNet::DataStructures::NetScoreType **pOut)
Fetch a NetScoreType by name.
CAVESTORY_MOD_API BOOL CSM_RegisterNetScoreType(const char *pName, const char *pUIFormat, const char *pUIDynamicFormat, unsigned long long int iMaskBits=0, unsigned long long int iFlags=0, CSM_NetScore_GetScoreModifyAmount pModifyFunc=NULL)
Register a NetScoreType by name.
CAVESTORY_MOD_API BOOL CSM_FindNetScoreTypeByHash(unsigned int iNameHash, CaveNet::DataStructures::NetScoreType **pOut)
Fetch a NetScoreType by name hash.
CAVESTORY_MOD_API BOOL CSM_RegisterTextScriptCommand(const char *pCmdName, const char *pShortDesc, const char *pDesc, const char *pArgs, void(*pFuncPtr)(int &, int &, int &, int &, bool &, int &))
Register a textscript command.
CAVESTORY_MOD_API bool CSM_RegisterWeaponByName(const char *pWeaponName, CSM_Weapon_ShootFunc pFunc)
Register a weapon by name.
CAVESTORY_MOD_API int CSM_RegisterCaret(CSM_Caret_ActFunc pFunc, int iWidth, int iHeight)
Register a caret.
CAVESTORY_MOD_API bool CSM_RegisterWeapon(int iWeaponIndex, CSM_Weapon_ShootFunc pFunc)
Register a weapon.
CAVESTORY_MOD_API void CSM_ResetNetScoreTypes()
Reset all NetScore types.
CAVESTORY_MOD_API bool CSM_RegisterNpc(int iNpcIndex, CSM_Npc_ActFunc pFunc)
Register an NPC.
CAVESTORY_MOD_API bool CSM_RegisterBullet(int iBulletIndex, CSM_Bullet_ActFunc pFunc)
Register a bullet.
CAVESTORY_MOD_API BOOL CSM_RegisterPlayerState(const char *pStateName, unsigned long long int iFlags, unsigned int iTransmitFlags, PlayerState_ActFuncType pActFunc, PlayerState_AnimFuncType pAnimFunc, PlayerState_DrawFuncType pDrawFunc=NULL, int *pPlayerStateIndex=NULL, unsigned int iIndexOverride=0, PlayerStateAnimator_OutputType iOutputType=PlayerStateAnimator_OutputType::PSAOT_PLAYER_FRAME)
Register a player state.
CAVESTORY_MOD_API void CSM_SpawnHeart(int iSubPixelX, int iSubPixelY, int iAmount)
Spawn a heart pickup that gives a certain amount of health.
CAVESTORY_MOD_API void StartFadeOut(signed char iDirect)
Fade the screen out.
CAVESTORY_MOD_API void CSM_Map_ClearAllTileAnimations(bool bForeground)
Clear a specific map tile's animation.
CAVESTORY_MOD_API void ClearBullet()
Delete all bullets.
CAVESTORY_MOD_API void SetQuake2(int iTime)
Shake the screen for iTime ticks.
CAVESTORY_MOD_API void ActValueView()
Process all view values.
CAVESTORY_MOD_API void SetHellTimerMS(int iTimeInMS)
Set the current hell timer time in milliseconds.
CAVESTORY_MOD_API void ResetQuake()
Stop shaking the screen.
CAVESTORY_MOD_API BOOL TransferStage2(int iStageNo, int iEventNo)
Transfer over to a new map without moving characters.
CAVESTORY_MOD_API int CSM_EntProp_GetFieldValue_Int(NPCHAR *pNpc, int iFieldIndex, int iDefaultValue=0)
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API Surface_Ids CSM_CustomPlayer_GetFaceMaskSurfaceId(CustomPlayer *pCharacter)
Get the surface ID for a character's face mask plane.
CAVESTORY_MOD_API BOOL LoadProfileIntoMem(const char *pName, PROFILE *pProfile, unsigned long long *pModifyTime=NULL)
Load a profile into a PROFILE* struct.
CAVESTORY_MOD_API void StartFadeIn(signed char iDirect)
Fade the screen in.
CAVESTORY_MOD_API void SetQuake(int iTime)
Shake the screen for iTime ticks.
CAVESTORY_MOD_API void ChangeToFirstArms()
Switch to this client's first weapon.
CAVESTORY_MOD_API GUI_COLOR * CSM_EntProp_GetFieldValue_Color(NPCHAR *pNpc, int iFieldIndex, GUI_COLOR *pColorPtr, GUI_COLOR pDefaultValue=GUI_COLOR(0, 0, 0, 0))
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API BOOL AddArmsData2(long iCode, long iNum, long iMaxNum, long iLevel)
Add arms data to the singleplayer character.
CAVESTORY_MOD_API MYCHAR * GetLocalPlayerCharacter()
Get the local player.
Definition: CavestoryModAPI.cpp:219
CAVESTORY_MOD_API void SetDestroyNpCharUp(int iSpawnX, int iSpawnY, int iMaxRandomXOffset, int iSmokeAmt)
Spawns smoke at the given coordinates & flashes the screen.
CAVESTORY_MOD_API BOOL TransferStage(int iStageNo, int iEventNo, int iSpawnX, int iSpawnY)
Transfer over to a new map.
CAVESTORY_MOD_API char * CSM_EntProp_GetFieldValue_String(NPCHAR *pNpc, int iFieldIndex, char *pOutBuffer, int iOutBufferSize, const char *pDefaultValue="")
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API int CountArmsBullet(int iArmsCode, int iGhostId=-1)
Get the number of bullets matching the given description onscreen.
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
CAVESTORY_MOD_API bool IsPlayerInsideNpChar(NPCHAR *pNpc)
Check to see if an NPC is clipping bounds with the player.
CAVESTORY_MOD_API TEXT_SCRIPT_PTR_DATA * GetCurrentTextScriptConfig()
Get the current text script context.
CAVESTORY_MOD_API BOOL IsFadedOut()
Check to see if the screen is blacked out.
CAVESTORY_MOD_API bool IsActiveSomeBullet()
Check if some bullet is active.
CAVESTORY_MOD_API Surface_Ids CSM_CustomPlayer_GetNormalMaskSurfaceId(CustomPlayer *pCharacter)
Get the surface ID for a character's normal mask plane.
CAVESTORY_MOD_API unsigned long long int GetHellTimerGlobalTimerOffset()
Get the global timer offset at which the hell counter started at.
CAVESTORY_MOD_API void ProcFade()
Process the fade.
CAVESTORY_MOD_API int CSM_EntProp_GetFieldIndexByCrc(NPCHAR *pNpc, unsigned int iFieldCrc)
Lookup the index of an NPC's property field.
CAVESTORY_MOD_API GUI_POINT * CSM_EntProp_GetFieldValue_Point(NPCHAR *pNpc, int iFieldIndex, GUI_POINT *pPointPtr, GUI_POINT pDefaultValue=GUI_POINT(0, 0))
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API int CSM_FindPlayerAnimFrameByName(const char *pName)
Find a player animation frame's index by its name.
CAVESTORY_MOD_API void DeleteNpCharCode(int iCharCode, BOOL bSmoke, BOOL bSetFlag=TRUE)
Delete all NPCs with a specific character code.
CAVESTORY_MOD_API unsigned int CSM_EntProp_GetFieldNameCRC(const char *pFieldName)
Get the CRC value of a property field's name.
CAVESTORY_MOD_API int CountBulletNum(int iBulletCode, int iGhostId=-1)
Get the number of bullets matching the given description onscreen.
CAVESTORY_MOD_API BOOL SaveProfile(const char *pFileName, MYCHAR *pMC=NULL)
Save the current gamestate to a profile.
CAVESTORY_MOD_API void GetTextScriptPath(char *pPath)
Get the text script path.
CAVESTORY_MOD_API unsigned int CompareTileTypeXY(int iX, int iY, unsigned int iTileTypes)
Compare tile types for tile at X, Y.
CAVESTORY_MOD_API void PutFade()
Draw the fade.
CAVESTORY_MOD_API void DeleteArmBullets(int iArmsCode)
Delete all bullets matching the arms ID.
CAVESTORY_MOD_API void CSM_SetFramerateVisible(BOOL bValue)
Set the visibility of the FPS counter.
CAVESTORY_MOD_API Surface_Ids CSM_CustomPlayer_GetFaceSurfaceId(CustomPlayer *pCharacter)
Get the surface ID for a character's face plane.
CAVESTORY_MOD_API BOOL GetFadeActive()
Check to see if the screen is being faded.
CAVESTORY_MOD_API bool IsSpecificPlayerInsideNpChar(MYCHAR *pMC, NPCHAR *pNpc)
Check to see if an NPC is clipping bounds with a player.
CAVESTORY_MOD_API void ClearFade()
Clear the current screen fade.
CAVESTORY_MOD_API void CSM_Map_DeleteTile(int iX, int iY, bool bRecordChange=true)
Delete a map tile at the specified coordinates.
CAVESTORY_MOD_API void DeleteNpCharEvent(int iEventNo, BOOL bSetFlag=TRUE)
Delete all NPCs with a specific event number.
CAVESTORY_MOD_API void PutValueView(int iFrameX, int iFrameY)
Draw all view values.
CAVESTORY_MOD_API BOOL LoadProfile(const char *pFileName, BOOL bDoGameFuncs=TRUE)
Load a profile into the current gamestate.
CAVESTORY_MOD_API void SetTextScriptContext(TEXT_SCRIPT_PTR_DATA *pData=&default_TextScriptPtrData)
Set the current text script context.
CAVESTORY_MOD_API void CSM_SpawnAmmo(int iSubPixelX, int iSubPixelY, int iAmount)
Spawn a missile pickup.
CAVESTORY_MOD_API void CSM_PlayerState_DrawWeapon(int iFrameX, int iFrameY, SafeClientInterface *pInterface, float fScale=1.f)
Draw the weapon.
CAVESTORY_MOD_API void GetFramePosition(int *iX, int *iY)
Get the current camera position.
CAVESTORY_MOD_API void ClearValueView()
Clear all view values.
CAVESTORY_MOD_API void SetBullet(int iBulNo, int iSpawnX, int iSpawnY, int iDirection, int iCodeArms, int iLevel, int iGhostId=0)
Spawn a bullet at the coordinates.
CAVESTORY_MOD_API bool IsCarryingAllowed()
Check whether the current mod allows carrying other players.
CAVESTORY_MOD_API void SetNpChar(int iNpcId, int iSpawnX, int iSpawnY, int iVelocityX, int iVelocityY, int iDirection, NPCHAR *pNpc, int iStartIndex, NPCHAR **iOutNPC=0, bool bForceSpawn=false)
Spawn an NPC at the coordinates.
CAVESTORY_MOD_API int CSM_EntProp_GetFieldValue_ScanString(NPCHAR *pNpc, int iFieldIndex, const char *pFormat,...)
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API bool IsAgilityAllowed()
Check whether the current mod allows agility.
CAVESTORY_MOD_API BOOL UseArmsEnergy(long iNum, ARMS *pArmsTable, int iSelectedIdx)
Use some arms energy from the selected arm.
CAVESTORY_MOD_API unsigned int GetTileFlagsNPC(NPCHAR *pNpc)
Fetch the tile type flags for a map tile.
CAVESTORY_MOD_API int LoadTimeCounter(const char *pFileName="290.rec")
Load the time counter's total time.
CAVESTORY_MOD_API BOOL IsNpCharInsideNpChar(NPCHAR *pNpc, NPCHAR *pOther)
Check to see if an NPC is clipping bounds with another NPC.
CAVESTORY_MOD_API BOOL CSM_EntProp_GetFieldValue_Boolean(NPCHAR *pNpc, int iFieldIndex, BOOL bDefaultValue=FALSE)
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API void SetValueView(int *pX, int *pY, int iValue)
Create a new view value.
CAVESTORY_MOD_API void StopTextScript()
Stop text script.
CAVESTORY_MOD_API GUI_RECT * CSM_EntProp_GetFieldValue_Rect(NPCHAR *pNpc, int iFieldIndex, GUI_RECT *pRectPtr, GUI_RECT pDefaultValue=GUI_RECT(0, 0, 0, 0))
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API BOOL CSM_IsFramerateVisible()
Set the visibility of the FPS counter.
CAVESTORY_MOD_API void CSM_Map_ShiftTileIndex(int iX, int iY, bool bRecordChange=true)
Shift a map tile to the left one tile index.
CAVESTORY_MOD_API BOOL IsProfile()
Check if there is a profile.
CAVESTORY_MOD_API void CSM_Map_ClearTileAnimation(bool bForeground, unsigned int iX, unsigned int iY)
Clear a specific map tile's animation.
CAVESTORY_MOD_API void DeleteNpCharFlag(int iFlagNo, BOOL bSetFlag=FALSE)
Delete all NPCs with a specific flag number.
CAVESTORY_MOD_API bool SetAnimNpChar(int iNpcId, int iVelocityX, int iVelocityY, int iDirection, NPCHAR *pNpc, int iStartIndex, MYCHAR *pMC, CustomPlayer *pCustomChar, NPCHAR **iOutNPC=0)
Spawn an animation NPC at the coordinates.
CAVESTORY_MOD_API float CSM_EntProp_GetFieldValue_Float(NPCHAR *pNpc, int iFieldIndex, float fDefaultValue=0.0f)
Fetch the value of a field for a specific NPC.
CAVESTORY_MOD_API unsigned int CompareTileType(unsigned int iTileTypes, unsigned int iOtherTileTypes)
Compare two tile types against each other.
CAVESTORY_MOD_API void SetHellTimerGlobalTimerOffset(unsigned long long int iOffset)
Set the global timer offset at which the hell counter started at.
CAVESTORY_MOD_API bool IsFishingAllowed()
Check whether the current mod allows fishing.
CAVESTORY_MOD_API BOOL CSM_Map_SetTileIndex(int iX, int iY, unsigned short iTileIndex, bool bCreateSmoke=true, bool bRecordChange=true)
Set the map tile index for a specified tile.
CAVESTORY_MOD_API bool IsFocusInsideNpChar(NPCHAR *pNpc)
Check to see if an NPC is clipping bounds with the NPC's focus object.
CAVESTORY_MOD_API BOOL ChargeArmsEnergy(long iChargeAmt, ARMS *pArmsTable, int iSelectedWeapon)
Charge the selected weapon in pArmsTable.
CAVESTORY_MOD_API int CSM_EntProp_GetFieldIndex(NPCHAR *pNpc, const char *pFieldName)
Lookup the index of an NPC's property field.
CAVESTORY_MOD_API void CSM_SpawnEXP(int iSubPixelX, int iSubPixelY, int iAmount)
Spawn a certain amount of EXP pellets.
CAVESTORY_MOD_API unsigned int GetTileFlagsXY(int iX, int iY)
Fetch the tile type flags for a map tile.
CAVESTORY_MOD_API void CSM_PlayerState_DrawCharacter(int iFrameX, int iFrameY, SafeClientInterface *pInterface, float fScale=1.f)
Draw the character.
CAVESTORY_MOD_API void SetCaret(int iSpawnX, int iSpawnY, int iCaretId, int iDirection, CARET **pOut=NULL)
Spawn a caret at the coordinates.
CAVESTORY_MOD_API BOOL CSM_CustomPlayer_IsPixelSolid(CustomPlayer *pCharacter, int iFrame, int iX, int iY)
Determine if a pixel on a specific frame of animation is opaque or not.
CAVESTORY_MOD_API unsigned int CompareTileTypeNPC(NPCHAR *pNpc, unsigned int iTileTypes)
Compare tile types for the map tile that npc is on.
CAVESTORY_MOD_API void CSM_Map_ActAnimatedTiles()
Act animated tiles.
CAVESTORY_MOD_API BOOL LoadProfileFromMem(PROFILE *pProfile)
Load the gamestate from a PROFILE* struct.
CAVESTORY_MOD_API void CSM_SaveScreenshot(const char *pOutputImagePath, GUI_RECT *pSource=NULL)
Take an unmagnified screenshot and save it at a path.
CAVESTORY_MOD_API BOOL SaveProfileIntoMem(PROFILE *pProfile)
Save the current gamestate to a PROFILE* struct.
CAVESTORY_MOD_API BOOL StartTextScript(int iEventNo, bool bTransmit=true, TEXT_SCRIPT_PTR_DATA *pData=&default_TextScriptPtrData, bool bUseRestrictionLevel=false, TextScriptTarget iTargetType=TextScriptTarget::TS_TARGET_EVERYONE, NPCHAR *pSourceNpc=NULL)
Start a text script event.
CAVESTORY_MOD_API void SetHellTimerFrameCount(int iFrameCount)
Set the current hell timer frame count.
CAVESTORY_MOD_API void SetFramePosition(int iX, int iY)
Set frame position.
CAVESTORY_MOD_API int GetHellTimerFrameCount()
Get the current hell timer frame count.
void CAVESTORY_MOD_API SetNpChar_Backwards(int iNpcId, int iSpawnX, int iSpawnY, int iVelocityX, int iVelocityY, int iDirection, NPCHAR *pNpc, int iStartIndex, NPCHAR **iOutNPC=0, bool bForceSpawn=false)
Spawn an NPC at the coordinates.
CAVESTORY_MOD_API int GetHellTimerMS()
Get the current hell timer time in milliseconds.
CAVESTORY_MOD_API void CSM_Map_SetTileAnimation(bool bForeground, unsigned int iX, unsigned int iY, RECT *pRectList, unsigned char iRectCount, unsigned short iWait, Surface_Ids iSurfaceId=SURFACE_ID_LEVEL_TILESET)
Set a map tile's animation.
CAVESTORY_MOD_API BOOL HasArmsData(long iCode)
Check to see if the singleplayer character has a weapon.
CAVESTORY_MOD_API BOOL TransferDataStage(int iStageNo, int iEventNo, int iSpawnX, int iSpawnY)
Transfer over to a vanilla map.
CAVESTORY_MOD_API Surface_Ids CSM_CustomPlayer_GetNormalSurfaceId(CustomPlayer *pCharacter)
Get the surface ID for a character's normal plane.
CAVESTORY_MOD_API void SetFadeMask()
Completely fade the screen out.
BOOL(* CSM_HOOK_OnMessageSentFunc)(CaveNet::DataStructures::NetClient *pClient, const char *pMessage)
Called when a client says something.
Definition: CSMAPI_functions.h:922
CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromServer(CSM_HOOK_OnReceiveUserCmdFromServerFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
BOOL(* CSM_HOOK_OnPlayerPickupHeartFunc)(NPCHAR *pHeart, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iHealth)
Called every time a player picks up a heart.
Definition: CSMAPI_functions.h:652
CAVESTORY_MOD_API void CSM_SetHook_OnTeamAddMember(CSM_HOOK_OnTeamAddMemberFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnDrawHUD(CSM_HOOK_OnDrawHUDFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnClientConnectedFunc)(CaveNet::DataStructures::NetClient *pClient)
Called when a client has connected to the server.
Definition: CSMAPI_functions.h:542
void(* CSM_HOOK_OnReceiveUserCmdFromClientFunc)(CaveNet::DataStructures::NetClient *pClient, int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)
Called when a mod user command is received from a client.
Definition: CSMAPI_functions.h:946
void(* CSM_HOOK_OnClientReviveFunc)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pSavior)
Called every time a client is revived.
Definition: CSMAPI_functions.h:616
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupNpc(CSM_HOOK_OnPlayerPickupNpcFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
BOOL(* CSM_HOOK_OnPlayerPickupMissileFunc)(NPCHAR *pMissile, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iAmmo)
Called every time a player picks up a missile.
Definition: CSMAPI_functions.h:672
CAVESTORY_MOD_API void CSM_SetHook_OnClientDisconnected(CSM_HOOK_OnClientDisconnectedFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnTeamRemoveMemberFunc)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)
Called when a client is removed from a team.
Definition: CSMAPI_functions.h:754
CAVESTORY_MOD_API void CSM_SetHook_OnStageChange(CSM_HOOK_OnStageChangeFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnTeamAddMemberFunc)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetClient *pServerClient, CaveNet::DataStructures::NetTeam *pTeam)
Called when a client is added to a team.
Definition: CSMAPI_functions.h:737
CAVESTORY_MOD_API void CSM_SetHook_OnClientConnected(CSM_HOOK_OnClientConnectedFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
BOOL(* CSM_HOOK_OnPlayerPickupExperienceFunc)(NPCHAR *pExp, CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iExp)
Called every time a player picks up experience.
Definition: CSMAPI_functions.h:692
CAVESTORY_MOD_API void CSM_SetHook_OnPreDrawHUD(CSM_HOOK_OnPreDrawHUDFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnServerTick(CSM_HOOK_OnServerTickFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnClientTickFunc)()
Called every time the client ticks.
Definition: CSMAPI_functions.h:720
BOOL(* CSM_HOOK_OnHitBulletMapFunc)(BULLET *pBullet)
Called when a bullet is tested for collision against the map.
Definition: CSMAPI_functions.h:801
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupHeart(CSM_HOOK_OnPlayerPickupHeartFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
BOOL(* CSM_HOOK_OnDrawItemFunc)(GUI_RECT pDrawRect, MYCHAR *pMC, ITEM *pItem, int iItemIndex)
Called when an item is drawn in the inventory menu.
Definition: CSMAPI_functions.h:510
CAVESTORY_MOD_API void CSM_SetHook_OnClientDie(CSM_HOOK_OnClientDieFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnServerTickFunc)()
Called every time the server ticks.
Definition: CSMAPI_functions.h:706
BOOL(* CSM_HOOK_OnHitMyCharMapFunc)(CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)
Called when a player is being checked for map collision.
Definition: CSMAPI_functions.h:884
CAVESTORY_MOD_API void CSM_SetHook_OnTeamRemoveMember(CSM_HOOK_OnTeamRemoveMemberFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupExperience(CSM_HOOK_OnPlayerPickupExperienceFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnClientDisconnectedFunc)(CaveNet::DataStructures::NetClient *pClient)
Called before a client is deleted after leaving.
Definition: CSMAPI_functions.h:526
BOOL(* CSM_HOOK_OnGetTeamSpawnPointFunc)(CaveNet::DataStructures::NetTeam *pTeam, int *pSpawnX, int *pSpawnY)
Called every time a team tries to find a valid player spawn point.
Definition: CSMAPI_functions.h:578
BOOL(* CSM_HOOK_OnHitMyCharMapTileFunc)(CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, int iTileX, int iTileY, int iTileAttrib, bool bNoclip)
Called when a player is being checked for map collision against a specific map tile.
Definition: CSMAPI_functions.h:865
CAVESTORY_MOD_API void CSM_SetHook_OnClientSpawn(CSM_HOOK_OnClientSpawnFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapFront(CSM_HOOK_OnDrawMapFrontFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnStageChangeFunc)(const char *pStageName, int iAreaIndex)
Called every time the stage changes.
Definition: CSMAPI_functions.h:632
CAVESTORY_MOD_API void CSM_SetHook_OnProcessAI(CSM_HOOK_OnProcessAIFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnClientRevive(CSM_HOOK_OnClientReviveFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnPlayerPickupMissile(CSM_HOOK_OnPlayerPickupMissileFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnPreDrawHUDFunc)()
Called after all gameplay elements are drawn, but before the HUD is drawn.
Definition: CSMAPI_functions.h:490
void(* CSM_HOOK_OnDrawMapBackFunc)()
Called before the map's background tiles are rendered.
Definition: CSMAPI_functions.h:462
BOOL(* CSM_HOOK_OnHitMyCharNpCharFunc)(CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, bool bNoclip)
Called when a player is being checked for collision with NPCs.
Definition: CSMAPI_functions.h:820
CAVESTORY_MOD_API void CSM_SetNpcCodeCharWhitelisted(int iCodeChar, bool bWhitelisted)
Set whether a specific code_char is whitelisted or not.
void(* CSM_HOOK_OnPlayerPickupNpcFunc)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, MYCHAR *pMC, NPCHAR *pNpc)
Called when an NPCHAR with a whitelisted code_char can be picked up by the player.
Definition: CSMAPI_functions.h:772
CAVESTORY_MOD_API void CSM_SetHook_OnDrawMapBack(CSM_HOOK_OnDrawMapBackFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnGetTeamSpawnPoint(CSM_HOOK_OnGetTeamSpawnPointFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMap(CSM_HOOK_OnHitMyCharMapFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnMessageSent(CSM_HOOK_OnMessageSentFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnPostDraw(CSM_HOOK_OnPostDrawFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
BOOL(* CSM_HOOK_OnMyCharCollisionTest_NpChar)(CaveNet::DataStructures::NetClient *pClient, MYCHAR *pMC, NPCHAR *pNpc, BOOL bNoclip, BOOL &bCallAgain)
Called when a player needs to test collision against a whitelisted NPC.
Definition: CSMAPI_functions.h:841
void(* CSM_HOOK_OnDrawHUDFunc)(BOOL bFlash)
Called after the game is finished drawing everything.
Definition: CSMAPI_functions.h:448
CAVESTORY_MOD_API void CSM_SetHook_OnClientTick(CSM_HOOK_OnClientTickFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnHitBulletMap(CSM_HOOK_OnHitBulletMapFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharMapTile(CSM_HOOK_OnHitMyCharMapTileFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnReceiveUserCmdFromClient(CSM_HOOK_OnReceiveUserCmdFromClientFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnClientSpawnFunc)(CaveNet::DataStructures::NetClient *pClient)
Called every time a client spawns.
Definition: CSMAPI_functions.h:558
void(* CSM_HOOK_OnPostDrawFunc)()
Called after the game is finished drawing gameplay elements to the screen, but before it draws GUI el...
Definition: CSMAPI_functions.h:433
void(* CSM_HOOK_OnDrawMapFrontFunc)()
Called before the map's foreground tiles are rendered.
Definition: CSMAPI_functions.h:476
void(* CSM_HOOK_OnProcessAIFunc)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetPlayer *pPlayer, CaveNet::DataStructures::NetTeam *pTeam)
Called when an AI-controlled player is thinking.
Definition: CSMAPI_functions.h:903
void(* CSM_HOOK_OnReceiveUserCmdFromServerFunc)(int iArg1, int iArg2, int iArg3, int iArg4, int iArg5, int iArg6, const char *pString1)
Called when a mod user command is received from the server we're connected to.
Definition: CSMAPI_functions.h:969
CAVESTORY_MOD_API void CSM_SetHook_OnDrawItem(CSM_HOOK_OnDrawItemFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
void(* CSM_HOOK_OnClientDieFunc)(CaveNet::DataStructures::NetClient *pClient, PlayerDeathType iDeathType, NPCHAR *pKillerNpc, CaveNet::DataStructures::NetClient *pKillerClient)
Called every time a client dies.
Definition: CSMAPI_functions.h:598
CAVESTORY_MOD_API void CSM_SetHook_OnMyCharCollisionTest_NpChar(int iNpcId, CSM_HOOK_OnMyCharCollisionTest_NpChar pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API void CSM_SetHook_OnHitMyCharNpChar(CSM_HOOK_OnHitMyCharNpCharFunc pFuncPtr)
Hook up a function to make custom code run during a game event.
CAVESTORY_MOD_API int GetKeybind(CSM_KEYBIND_DESC iType)
Get the input flags for a keybind.
Definition: CavestoryModAPI.cpp:226
CAVESTORY_MOD_API void PutTextScript()
Put text script on the screen.
CAVESTORY_MOD_API int GetInput(CSM_KEY_DESC iType)
Get the current input flags from a store.
Definition: CavestoryModAPI.cpp:233
CAVESTORY_MOD_API int TextScriptProc()
Process text scripts.
CAVESTORY_MOD_API void CSM_Log(const char *pFormat,...)
Log a message to the console.
Definition: CavestoryModAPI.cpp:50
CAVESTORY_MOD_API void CSM_LogColor(unsigned int iColor=0xFFFFFFFF)
Set the color of the console.
Definition: CavestoryModAPI.cpp:58
CAVESTORY_MOD_API void CSM_LogInfo(const char *pCategory, const char *pFormat,...)
Log a message to the console & to the log file (if one is open).
Definition: CavestoryModAPI.cpp:63
CAVESTORY_MOD_API void CSM_Explode(int iErrorCode, const char *pErrorName, const char *pTitle="\\a{0} crashed!", const char *pMessage="The mod's DLL has crashed!", bool bGenerateCrashLog=true)
Display a crash screen.
Definition: CavestoryModAPI.cpp:115
CAVESTORY_MOD_API void __CSM__LogWarn(const char *pSourceFile, int iSourceLineNo, const char *pCategory, const char *pFormat,...)
Log a warning message to the console & to the log file (if one is open).
Definition: CavestoryModAPI.cpp:89
CAVESTORY_MOD_API void __CSM__LogError(const char *pSourceFile, int iSourceLineNo, const char *pCategory, const char *pFormat,...)
Log an error message to the console & to the log file (if one is open).
Definition: CavestoryModAPI.cpp:75
CAVESTORY_MOD_API void CSM_LogInfoNoNL(const char *pCategory, const char *pFormat,...)
Log a message to the console & to the log file (if one is open).
Definition: CavestoryModAPI.cpp:103
CAVESTORY_MOD_API void CSM_Log_EnableStackLines(bool bEnable)
Enable or disable StackLines.
Definition: CavestoryModAPI.cpp:45
CAVESTORY_MOD_API int GetCos(unsigned char iDeg)
Calculate cos.
CAVESTORY_MOD_API int CSM_GetWindowHeight()
Get the current window height.
CAVESTORY_MOD_API void CSM_Puppy_GetDrawOffset(MYCHAR *pMC, GUI_POINT *pOut)
Get the held entity offset of a player's current frame.
CAVESTORY_MOD_API void CSM_Npc_SkipUpdate(NPCHAR *pNpc)
Skip one NPC update for a specific NPC.
CAVESTORY_MOD_API unsigned char GetArktan(int iX, int iY)
Get arktan from x and y.
CAVESTORY_MOD_API void CSM_SetBitmapLoadMagnification(int iMagnification)
Set the magnification of all loaded bitmaps beyond this point.
int ScreenCoordToPixel(int iCoord)
Convert a screen cordinate to a pixel.
Definition: CSMAPI_functions.h:2784
CAVESTORY_MOD_API int GetSin(unsigned char iDeg)
Calculate sin.
int SubpixelToScreenCoord(int iCoord)
Convert a subpixel coordinate to screen coordinate.
Definition: CSMAPI_functions.h:2760
CAVESTORY_MOD_API void GetMyCharDrawRectangle(MYCHAR *pMC, GUI_RECT *pOut)
Get the draw rectangle of a MYCHAR.
CAVESTORY_MOD_API void CSM_Carry_GetDrawOffset(MYCHAR *pMC, GUI_POINT *pOut)
Get the carried player offset of a player's current frame.
CAVESTORY_MOD_API unsigned long long int CSM_Npc_GetUpdateNodes(unsigned int iCodeChar, int iActNo)
Get the update nodes for a specific NPC type.
CAVESTORY_MOD_API unsigned long long int CSM_Npc_GetTransmitNodes(unsigned int iCodeChar, int iActNo)
Get the transmit nodes for a specific NPC type.
CAVESTORY_MOD_API void CSM_Npc_GetPosition(NPCHAR *pNpc, NpcPositionType iType=NpcPositionType::NPT_DRAW_POSITION, int *iOutX=NULL, int *iOutY=NULL, int iFrameX=-1, int iFrameY=-1)
Get the draw position of an NPC.
CAVESTORY_MOD_API int CSM_GetWindowWidth()
Get the current window width.
CAVESTORY_MOD_API void CSM_Weapon_GetDrawOffset(MYCHAR *pMC, int iWeaponCode, GUI_POINT *pOut)
Get the draw offset of a player's weapon.
int PixelToScreenCoord(int iCoord)
Convert a pixel to a screen cordinate.
Definition: CSMAPI_functions.h:2772
CAVESTORY_MOD_API bool IsNpcOnScreen(NPCHAR *pNpc)
Check if an NPC is on screen.
int ScreenCoordToSubPixel(int iCoord)
Convert a screen cordinate to a subpixel.
Definition: CSMAPI_functions.h:2797
CAVESTORY_MOD_API int Random(int iMin, int iMax)
Get a random value.
CAVESTORY_MOD_API int OpenOptionsMenu(const char **pCategoryList=NULL, int iCategoryCount=0)
Open the options menu.
CAVESTORY_MOD_API int OpenEscapeMenu()
Open the escape menu.
CAVESTORY_MOD_API BOOL CSM_Platform_IsProgramMode(CSM_ProgramMode eMode)
Check the current program mode.
CAVESTORY_MOD_API bool CSM_Platform_GetGameFilePath(const char *pDesiredSubpath, const char *pFileName, char *pOutputFilePath, char *pOutputFileName, const char *pFileNameFormat="*.*", void *pModPointer=NULL)
Convert a file path into a mod file path.
CAVESTORY_MOD_API void CSM_Platform_GetProgramMode(CSM_ProgramMode *eModePtr)
Get the current program mode.
CAVESTORY_MOD_API unsigned int GetPlayerStateFlags(MYCHAR *pChar)
Get the flags for a player's state.
CAVESTORY_MOD_API PlayerStateAnimator_OutputType GetPlayerStateAnimatorType(MYCHAR *pChar)
Get the return type of a player's state's animate function.
CAVESTORY_MOD_API int GetStateByUnitIndex(int iUnitIndex)
Transform a unit index into a player state index.
CAVESTORY_MOD_API void SetPlayerState(SafeClientInterface *pInterface, int iStateType=-1, bool bForce=false)
Set the state of an interface.
CAVESTORY_MOD_API unsigned int GetPlayerStateFlagsFromCarrier(MYCHAR *pChar)
Get the flags from a player's carrier's playerstate.
CAVESTORY_MOD_API int FindPlayerStateByName(const char *pName)
Find a player state by its name.
CAVESTORY_MOD_API int GetUnitIndexByState(int iPlayerState)
Transform a player state index into a unit index.
bool IsPlayerState(MYCHAR *pChar, int iStateType)
Check to see if a player is in the specified state.
Definition: CSMAPI_functions.h:2896
CAVESTORY_MOD_API int GetPlayerState(SafeClientInterface *pInterface)
Get the current playerstate of an interface.
CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay(GUI_POINT pPointStart, GUI_POINT pPointEnd, RAYCAST_QUERY *pInfo=NULL, bool bHitEndBlock=true, bool bHitStartBlock=true)
Cast a ray in the game world.
CAVESTORY_MOD_API void CSM_Raycasting_SetBounds(GUI_RECT *pRect)
Setup raycasting bounds.
CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay_Quick(int iStartX, int iStartY, int iEndX, int iEndY, unsigned int iHitMask, RAYCAST_QUERY *pInfo=NULL, bool bHitEndBlock=true, bool bHitStartBlock=true)
Cast a ray in the game world, but faster.
CAVESTORY_MOD_API void CSM_Sound_Process2D()
Process the 2D soundscape.
int CSM_CustomPixToneId
A custom sound ID.
Definition: CSMAPI_functions.h:3141
CAVESTORY_MOD_API void CSM_Sound_SetPitch(int iSoundIndex, unsigned short iPitch)
Set the pitch of a sound.
CAVESTORY_MOD_API void ChangeMusic(int iMusicIndex)
Set the current music track.
CAVESTORY_MOD_API BOOL CSM_UnloadCustomSound(CSM_CustomSoundId iSoundId)
Unload a custom sound file.
CAVESTORY_MOD_API BOOL CSM_UnloadPixTone(CSM_CustomPixToneId iSoundId)
Unload a custom sound file.
CAVESTORY_MOD_API void CSM_Music_SetVolume(unsigned char iVolume)
Set the volume of music.
#define SOUND_MODE_STOP_THEN_PLAY
Stop and then play a sound.
Definition: CSMAPI_defines.h:31
CAVESTORY_MOD_API void PlaySoundObject(int iSoundIndex, int iPlayMode=SOUND_MODE_STOP_THEN_PLAY, unsigned int iPlayVolume=0x100)
Play a sound by index.
CAVESTORY_MOD_API void CSM_SetCustomSoundVolume(CSM_CustomSoundId iSoundId, unsigned char iVolume)
Set the volume of a custom sound.
CAVESTORY_MOD_API BOOL IsSoundPlaying(int iSoundId)
Check if a sound is playing.
CAVESTORY_MOD_API void PlayCustomMusic(const char *pFileName)
Play custom music.
CAVESTORY_MOD_API CSM_CustomSoundId CSM_LoadCustomSound(const char *pPath)
Load a custom sound file.
CAVESTORY_MOD_API void CSM_SetCustomSoundPan(CSM_CustomSoundId iSoundId, unsigned char iPanAmount=50)
Set the pan amount of a custom sound.
CAVESTORY_MOD_API CSM_CustomPixToneId CSM_LoadPixTone(const char *pPath)
Load a custom pixtone file.
CAVESTORY_MOD_API void PlaySoundObject2D(int iSubpixelX, int iSubpixelY, int iRadius, bool bAlwaysOnScreen, int iSoundIndex, int iPlayMode=SOUND_MODE_STOP_THEN_PLAY, unsigned int iPlayVolume=0x100, unsigned int iFalloffRadius=0x7FFFFFFE)
Play a sound by index at a specific place in the game.
CAVESTORY_MOD_API void CSM_Sound_SetPan(int iSoundIndex, char iPan)
Set the panning of a sound.
CAVESTORY_MOD_API void ReCallMusic()
Recall the last played music.
CAVESTORY_MOD_API void CSM_Sound_SetVolume(int iSoundIndex, unsigned char iVolume)
Set the volume of a sound.
CAVESTORY_MOD_API void SetCharacterNameTextScript()
Append the character's name into the messagebox.
CAVESTORY_MOD_API void DisplayCustomTextToScript(const char *pString, bool bSanitize=false)
Appends text to the current messagebox text.
CAVESTORY_MOD_API void ClearTextLine()
Clear the messagebox.
CAVESTORY_MOD_API bool JumpTextScript(int no, BOOL call=FALSE)
Jump to another event.
CAVESTORY_MOD_API int GetTextScriptNo(int a)
Get a number argument from the script.
CAVESTORY_MOD_API void Server_ClearFocusFromPlayer()
Stop focusing on the event executor.
CAVESTORY_MOD_API bool ReturnTextScript()
Return execution to last call command.
CAVESTORY_MOD_API void CheckNewLine()
Check if a new messagebox line needs to be created.
CAVESTORY_MOD_API void Server_FocusOnCurrentPlayer()
Focus on the player that started the event.
CAVESTORY_MOD_API void ShowTextLines(const char *pLine4, const char *pLine3, const char *pLine2, const char *pLine1)
Display a custom message in the message box.
CAVESTORY_MOD_API void SetNumberTextScript(int iIndex)
Type a specific number into the message box.
CAVESTORY_MOD_API unsigned long long int CSM_GetFrameCount()
Get the number of frames that have passed since CSMP started.
CAVESTORY_MOD_API unsigned int GetTicks()
Get the current ticks since the program started.
CAVESTORY_MOD_API void CSM_Video_GetResolution(int *iWidth, int *iHeight)
Get the game's window resolution.
CAVESTORY_MOD_API void CSM_Video_SetResolution(int iNewWidth, int iNewHeight, int iNewMagnification=-1)
Set the game's window resolution.
Weapon object.
Definition: CSMAPI_types.h:1264
Bullet object.
Definition: CSMAPI_types.h:1128
Stores particle information.
Definition: CSMAPI_types.h:1298
Manages colors.
Definition: CSMAPI_types.h:497
Manages points.
Definition: CSMAPI_types.h:546
Definition: CSMAPI_types.h:842
Item object.
Definition: CSMAPI_types.h:1289
Player character object.
Definition: CSMAPI_types.h:1470
int netanim
Animation index.
Definition: CSMAPI_types.h:1514
NPC object.
Definition: CSMAPI_types.h:2021
Stores information for save files.
Definition: CSMAPI_types.h:2404
Stores information from CSM_CastRay().
Definition: CSMAPI_types.h:6801
Rect structure.
Definition: CSMAPI_types.h:125
SafeClientInterface.
Definition: CSMAPI_types.h:1775
Text script pointer data.
Definition: CSMAPI_types.h:2528