Cavestory Mod API
CSMAPI_BaseModInterface.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 
28 #include <CSMAPI_begincode.h>
29 
36 {
37 public: // Private stuff!
38 
42 
43 public: // C++ garbage
44 
49 
54 
55 public: // Mod functions
56 
60  virtual int OnInit() { return 0; }
61 
64  virtual void OnShutdown() {}
65 
71  virtual int OnEnterTitleScreen(bool& bImmediateReturn, unsigned char& pAction) { return 0; }
72 
76  virtual bool IsMultiplayer() { return false; }
77 
81  virtual bool IsSingleplayer() { return true; }
82 
86  virtual bool HasIntroSequence() { return true; }
87 
91  virtual int GetIntroSequenceLength() { return 500; }
92 
96  virtual bool IsRevivingPlayersAllowed() { return true; }
97 
101  virtual bool DisableEveryoneDiedEvent() { return false; }
102 };
103 
104 #include <CSMAPI_endcode.h>
The base mod interface.
Definition: CSMAPI_BaseModInterface.h:36
virtual int GetIntroSequenceLength()
Define the length of the intro sequence in ticks.
Definition: CSMAPI_BaseModInterface.h:91
~BaseModInterface()
Default deconstructor.
static BaseModInterface * gsModInterface
The current mod interface.
Definition: CSMAPI_BaseModInterface.h:41
BaseModInterface()
Default constructor.
virtual void OnShutdown()
Called when the mod is exiting.
Definition: CSMAPI_BaseModInterface.h:64
virtual int OnInit()
Called when the mod is initialized.
Definition: CSMAPI_BaseModInterface.h:60
virtual bool DisableEveryoneDiedEvent()
Defines whether this mod should force the 'TestEveryoneDied()' to always return 'false'.
Definition: CSMAPI_BaseModInterface.h:101
virtual bool IsMultiplayer()
Defines whether this mod supports multiplayer or not.
Definition: CSMAPI_BaseModInterface.h:76
virtual bool IsSingleplayer()
Defines whether this mod supports singleplayer or not.
Definition: CSMAPI_BaseModInterface.h:81
virtual bool IsRevivingPlayersAllowed()
Define whether this mod allows reviving players.
Definition: CSMAPI_BaseModInterface.h:96
virtual bool HasIntroSequence()
Define whether this mod has an intro sequence or not.
Definition: CSMAPI_BaseModInterface.h:86
virtual int OnEnterTitleScreen(bool &bImmediateReturn, unsigned char &pAction)
Called when the titlescreen is initialized.
Definition: CSMAPI_BaseModInterface.h:71
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30