26 #if defined(_CAVESTORY_MULTIPLAYER) || !defined(_CAVEEDITOR)
36 static const char* g_PXMOD_MUSIC_TYPE_EXTENSION_LIST[] = {
"",
"org",
"ptcop",
"wav",
"mp3",
"ogg" };
40 #define PXMOD_HEADER_STRING "PXMOD"
41 #define PXMOD_VERSION 22
45 enum PXMOD_BUILD_TYPE :
unsigned char
47 PXMOD_BUILD_DEBUG = 0,
48 PXMOD_BUILD_RELEASE = 1,
53 enum PXMOD_DIRECTIONS :
unsigned char
55 PXMOD_DIRECT_LEFT = 0,
57 PXMOD_DIRECT_RIGHT = 2,
58 PXMOD_DIRECT_DOWN = 3,
59 PXMOD_DIRECT_CENTER = 4,
60 PXMOD_DIRECT_RIGHT_UP = 5,
61 PXMOD_DIRECT_DOWN_RIGHT = 6,
67 enum PXMOD_BK_TYPE :
unsigned char
70 PXMOD_BK_MOVE_SLOW = 1,
71 PXMOD_BK_FOLLOW_FOREGROUND = 2,
73 PXMOD_BK_SCROLL_FAST = 5,
74 PXMOD_BK_SCROLL_GRAVITY = 6,
75 PXMOD_BK_SCROLL_LAYERED = 7,
80 enum PXMOD_BOSS_TYPE :
unsigned char
84 PXMOD_BOSS_BALFROG = 2,
85 PXMOD_BOSS_WEAPON_X = 3,
87 PXMOD_BOSS_IRONHEAD = 5,
88 PXMOD_BOSS_DRAGON_SISTERS = 6,
89 PXMOD_BOSS_UNDEAD_CORE = 7,
90 PXMOD_BOSS_HEAVY_PRESS = 8,
91 PXMOD_BOSS_BALLOS = 9,
96 enum PXMOD_BULLET_FLAGS :
unsigned short
98 PXMOD_BULLET_FLAG_IGNORE_SOLID = 0x004,
99 PXMOD_BULLET_FLAG_DONT_DESTROY_SOLID = 0x008,
100 PXMOD_BULLET_FLAG_PROJECTILE = 0x010,
101 PXMOD_BULLET_FLAG_BREAK_BLOCKS = 0x020,
102 PXMOD_BULLET_FLAG_PIERCE_BLOCKS = 0x040
105 enum PXMOD_MUSIC_TYPE :
unsigned char
107 PXMOD_MUSIC_TYPE_INVALID = 0,
108 PXMOD_MUSIC_TYPE_ORGANYA = 1,
109 PXMOD_MUSIC_TYPE_PTCOP = 2,
110 PXMOD_MUSIC_TYPE_WAV = 3,
111 PXMOD_MUSIC_TYPE_MP3 = 4,
112 PXMOD_MUSIC_TYPE_OGG = 5,
114 PXMOD_MUSIC_TYPE_COUNT = 6
117 enum PXMOD_WEAPON_TYPE :
unsigned char
119 PXMOD_WEAPON_CUSTOM = 0,
120 PXMOD_WEAPON_AGILITY = 1,
121 PXMOD_WEAPON_NOTHING = 2,
122 PXMOD_WEAPON_RESERVED_3 = 3,
123 PXMOD_WEAPON_RESERVED_4 = 4,
124 PXMOD_WEAPON_RESERVED_5 = 5,
125 PXMOD_WEAPON_RESERVED_6 = 6,
126 PXMOD_WEAPON_RESERVED_7 = 7,
127 PXMOD_WEAPON_RESERVED_8 = 8,
128 PXMOD_WEAPON_RESERVED_9 = 9,
129 PXMOD_WEAPON_RESERVED_10 = 10,
131 PXMOD_WEAPON_COUNT = 10
192 unsigned char data[4];
194 inline int operator[](
int idx) {
return (
int)data[idx %
sizeof(data)]; }
325 unsigned long long int nodes;
326 unsigned long long int transmit_nodes;
332 char default_value[256];
339 unsigned long long int nodes;
340 unsigned long long int transmit_nodes;
344 unsigned char hit_voice;
345 unsigned char destroy_voice;
355 unsigned char bottom;
363 unsigned char bottom;
374 int spritesheet_index;
376 bool useNewColMethod;
391 unsigned int highest_act_no;
398 } default_properties;
407 int set_flag_list[8];
417 PXMOD_BUILD_TYPE build_type;
418 unsigned short max_save_files;
422 bool allow_carrying_players;
452 unsigned short drown_core_flag;
453 unsigned short drown_core;
454 unsigned short everyone_died;
455 unsigned short drown;
456 unsigned short death;
462 unsigned int netmenu;
471 unsigned short event;
473 unsigned char max_hp;
474 PXMOD_DIRECTIONS direct;
481 unsigned short event;
507 unsigned short count;
525 unsigned short count;
545 #if defined(_CAVESTORY_MULTIPLAYER) || defined(CAVESTORYMULTIPLAYERBASEDLL_EXPORTS)
637 bool Load(
const char* pModPath,
bool bOnlyValidate =
false,
bool bForceRelease =
false,
bool bShowError =
true);
644 bool Save(
bool bRelease =
false);
678 const char* GetTitle();
688 const char* GetAuthor();
778 int AddStage(
const char* pFileName,
const char* pMapName,
const char* pTileset,
const char* pNpcSheet,
const char* pBossSheet,
const char* pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType,
unsigned int iInsertIndex = 0xFFFFFFFF);
792 int SetStage(
int iIndex,
const char* pFileName,
const char* pMapName,
const char* pTileset,
const char* pNpcSheet,
const char* pBossSheet,
const char* pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType);
839 int AddMusic(
const char* pMusicName, PXMOD_MUSIC_TYPE eMusicType = PXMOD_MUSIC_TYPE::PXMOD_MUSIC_TYPE_INVALID);
943 int AddNpcAct(
int iNpcIndex,
int iActNo,
const char* pActName,
unsigned long long int iNodeFlags,
unsigned long long int iTransmitNodeFlags);
1009 #if defined(_CAVESTORY_MULTIPLAYER) || !defined(_CAVEEDITOR)
An interface for the 'PXMOD' file format.
Definition: ModConfigResource.h:550
PXMOD_AREA_CHUNK mAreas
Stores all the map area information.
Definition: ModConfigResource.h:587
int AddBullet(const char *pBulletNmae)
Add a bullet.
void SetAuthor(const char *author)
Set the author of the mod.
PXMOD_HEADER_STRUCT mHeader
The header for this mod.
Definition: ModConfigResource.h:559
PXMOD_START_CHUNK mStart
Game start chunk.
Definition: ModConfigResource.h:563
const char * GetTitle()
Get the title of the mod.
Definition: ModConfigResource.h:992
static const PXMOD_WEAPON_STRUCT * GetDefaultTemplateWeapon(PXMOD_WEAPON_TYPE eType)
Get default weapon info for a template.
bool RemoveArea(const char *pAreaName)
Remove an area.
PXMOD_WEAPON_CHUNK mWeapons
Stores all the weapon information.
Definition: ModConfigResource.h:595
PXMOD_TILESET_CHUNK mTilesets
Stores all the tilesets.
Definition: ModConfigResource.h:579
PXMOD_TITLE_CHUNK mTitle
Titlescreen intro chunk.
Definition: ModConfigResource.h:567
bool Load(const char *pModPath, bool bOnlyValidate=false, bool bForceRelease=false, bool bShowError=true)
Load a mod from a file on the disc.
PXMOD_STAGE_CHUNK mStages
Stores all the stage information.
Definition: ModConfigResource.h:583
PXMOD_SPRITESHEET_CHUNK mSpritesheets
Stores all the spritesheets.
Definition: ModConfigResource.h:575
int FindBackground(const char *pFileName)
Find the index of a background.
bool RemoveTileset(const char *pFileName)
Remove a tileset.
int FindWeapon(const char *pWeaponName)
Find the index of a weapon.
void SetTitle(const char *title)
Set the title of the mod.
int AddWeapon(const char *pWeaponName)
Add a weapon.
PXMOD_MUSIC_CHUNK mMusic
Stores all the music.
Definition: ModConfigResource.h:591
PXMOD_BACKGROUND_CHUNK mBackgrounds
Stores all the backgrounds.
Definition: ModConfigResource.h:571
int AddTileset(const char *pFileName)
Add a tileset.
const char * GetAuthor()
Get the author of the mod.
Definition: ModConfigResource.h:997
int AddArea(const char *pAreaName)
Add an area.
int FindArea(const char *pAreaName)
Find the index of an area.
ModConfigResource()
Constructor.
bool RemoveMusic(const char *pMusicName)
Remove music.
static const PXMOD_NPC_STRUCT * GetDefaultNpc(int iIndex)
Get the default NPC for slot iIndex.
bool Save(bool bRelease=false)
Save the mod.
int FindTileset(const char *pFileName)
Find the index of a tileset.
bool RemoveStage(const char *pFileName)
Remove a stage.
~ModConfigResource()
Deconstructor.
int AddSpritesheet(const char *pFileName)
Add a spritesheet.
int FindSpritesheet(const char *pFileName)
Find the index of a spritesheet.
int AddNpcAct(int iNpcIndex, int iActNo, const char *pActName, unsigned long long int iNodeFlags, unsigned long long int iTransmitNodeFlags)
Add an NPC act.
int AddStage(const char *pFileName, const char *pMapName, const char *pTileset, const char *pNpcSheet, const char *pBossSheet, const char *pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType, unsigned int iInsertIndex=0xFFFFFFFF)
Add a stage.
bool RemoveNPC(const char *pNpcName)
Remove an NPC.
bool RemoveBullet(const char *pBulletName)
Remove a bullet.
bool RemoveNpcAct(int iNpcIndex, int iActNo)
Remove an NPC act.
void Reset()
Clear & free all buffers.
const char * GetInternalName()
Get the mod's path name.
bool RemoveSpritesheet(const char *pFileName)
Remove a spritesheet.
int FindBullet(const char *pBulletName)
Find the index of a bullet.
int FindNPC(const char *pNpcName)
Find the index of an NPC.
int AddNPC(const char *pNpcName)
Add an NPC.
bool CreateFromMod(const char *pModPath)
Create a pxmod file from external formats.
int FindMusic(const char *pMusicName)
Find the index of music.
int AddMusic(const char *pMusicName, PXMOD_MUSIC_TYPE eMusicType=PXMOD_MUSIC_TYPE::PXMOD_MUSIC_TYPE_INVALID)
Add music.
bool RemoveWeapon(const char *pWeaponName)
Remove a weapon.
PXMOD_VERSION_STRUCT GetVersion()
Get the version of the mod.
Definition: ModConfigResource.h:1002
void DefaultWeapons()
Reset weapons for this mod to the default Cavestory weapons.
static const PXMOD_WEAPON_STRUCT * GetDefaultWeapon(int iIndex)
Get the default weapon for slot iIndex.
bool CreateMod(const char *pModPath, bool bAutoScan=true, const char *pModTitle="My Mod", const char *pModAuthor="Me", PXMOD_VERSION_STRUCT pVersion=PXMOD_VERSION_STRUCT(), bool bUseDefaultAssets=false)
Create a mod out of a data path.
PXMOD_NPC_CHUNK mNpcs
Stores all the NPC information.
Definition: ModConfigResource.h:603
int AddBackground(const char *pFileName)
Add a background.
bool MoveMusic(const char *pMusicName, bool bMoveUp)
Move music around in the music list.
int FindStage(const char *pFileName)
Find the index of a stage.
PXMOD_BULLET_CHUNK mBullets
Stores all the bullet information.
Definition: ModConfigResource.h:599
int SetStage(int iIndex, const char *pFileName, const char *pMapName, const char *pTileset, const char *pNpcSheet, const char *pBossSheet, const char *pBackground, PXMOD_BK_TYPE iBkType, PXMOD_BOSS_TYPE iBossType)
Set a stage at an index.
bool RemoveBackground(const char *pFileName)
Remove a background.
static const PXMOD_BULLET_STRUCT * GetDefaultBullet(int iIndex)
Get the default bullet for slot iIndex.
void SetVersion(const PXMOD_VERSION_STRUCT &pNewVersion)
Set the version of the mod.
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
Definition: ModConfigResource.h:511
Definition: ModConfigResource.h:214
bool keep_on_release
Whether this area will be kept when compiling mod for release.
Definition: ModConfigResource.h:225
int stage_idx
Which stage index will be shown in the background of the lobby.
Definition: ModConfigResource.h:219
bool singleplayer_only
If true, then the server will NOT send any of the maps under this area to clients.
Definition: ModConfigResource.h:222
char name[32]
Area name.
Definition: ModConfigResource.h:216
bool allow_downloading
Whether this area allows for downloading over the network or not.
Definition: ModConfigResource.h:228
Definition: ModConfigResource.h:487
Definition: ModConfigResource.h:137
Definition: ModConfigResource.h:523
Definition: ModConfigResource.h:241
struct PXMOD_BULLET_STRUCT::@21 collision_size
The size of this bullet's collision.
struct PXMOD_BULLET_STRUCT::@20 bullet_size
The size of this bullet's bounding box.
int range
How far this bullet can go before it despawns, in ticks.
Definition: ModConfigResource.h:252
int damage
The damage this bullet deals.
Definition: ModConfigResource.h:246
char name[64]
The name of this bullet. This is not saved in the release build.
Definition: ModConfigResource.h:278
int hit_life
How many times this bullet can hit something before it despawns.
Definition: ModConfigResource.h:249
unsigned short flags
Flags for this bullet.
Definition: ModConfigResource.h:243
struct PXMOD_BULLET_STRUCT::@22 sprite
The sprite location for this bullet.
Definition: ModConfigResource.h:413
Definition: ModConfigResource.h:402
Definition: ModConfigResource.h:517
Definition: ModConfigResource.h:232
PXMOD_MUSIC_TYPE type
The type of music.
Definition: ModConfigResource.h:237
char name[16]
File name.
Definition: ModConfigResource.h:234
Definition: ModConfigResource.h:321
Definition: ModConfigResource.h:535
Definition: ModConfigResource.h:330
Definition: ModConfigResource.h:336
Definition: ModConfigResource.h:493
Definition: ModConfigResource.h:142
Definition: ModConfigResource.h:505
Definition: ModConfigResource.h:152
int background
Background.
Definition: ModConfigResource.h:163
int area_index
Area index.
Definition: ModConfigResource.h:172
int boss_sheet
Boss Spritesheet file.
Definition: ModConfigResource.h:169
PXMOD_BOSS_TYPE boss_no
Boss number.
Definition: ModConfigResource.h:175
PXMOD_BK_TYPE bkType
Background type.
Definition: ModConfigResource.h:160
bool share_pickups
Force all EXP, missile & life pickups to be shared across all clients.
Definition: ModConfigResource.h:187
bool focus_center_x
Force camera to lock onto the horizontal center of this stage.
Definition: ModConfigResource.h:181
char name[34]
Map name.
Definition: ModConfigResource.h:178
bool focus_center_y
Force camera to lock onto the vertical center of this stage.
Definition: ModConfigResource.h:184
int tileset
Tileset.
Definition: ModConfigResource.h:157
char file[32]
Map file name.
Definition: ModConfigResource.h:154
int npc_sheet
NPC Spritesheet file.
Definition: ModConfigResource.h:166
Definition: ModConfigResource.h:467
Definition: ModConfigResource.h:499
Definition: ModConfigResource.h:147
Definition: ModConfigResource.h:479
Definition: ModConfigResource.h:191
Definition: ModConfigResource.h:529
Definition: ModConfigResource.h:303
Bullet info for every level.
Definition: ModConfigResource.h:285
struct PXMOD_WEAPON_STRUCT::WEAPON_LEVEL_INFO::@23 view
The gun's view.
int exp
How much EXP is required to go to the next level.
Definition: ModConfigResource.h:290
int bullet_index
The index of the bullet to use for this gun.
Definition: ModConfigResource.h:287
Definition: ModConfigResource.h:282
PXMOD_WEAPON_TYPE type
The type of weapon this is.
Definition: ModConfigResource.h:317
char name[64]
Name of the weapon.
Definition: ModConfigResource.h:314