//These can get saved

SetCommonData("StageUnlocked",0); //Stage cleared = unlock
SetCommonData("ExtraUnlocked",false);
SetCommonData("NightmareUnlocked",false);
SetCommonData("TrumpCardsUnlocked",false);
SetCommonData("Highscore",0);
SetCommonData("HighScoreExtra",0);
SetCommonData("HighScoreNightmare",0);
SetCommonData("SpellcardPoints",0);
SetCommonData("ReachedNightmareBattle",0);

//============================================================================

LoadCommonData;

if(GetCommonDataDefault("NewGame",true)==true){
//These are only made at the beginning of the first game

	#include_function "script/Functions/SetSpellcardCommonData.txt"; //"SpellcardData"

	SetCommonData("Difficulty",2); //1=easy, 2=normal, 3=hard, 4=lunatic, 5=extra, 6=nightmare, 7=trump cards
	SetCommonData("PlayerType",1); //1=fire, 2=water, 3=earth, 4=wood, 5=metal
	SetCommonData("Points",0);
	SetCommonData("Power",0);
	SetCommonData("Lives",0);
	SetCommonData("Bombs",0);
	SetCommonData("Graze",0);
	SetCommonData("Score",0);

	SetCommonData("SavedGame",false); // one time saved data to prevent cheating
	SetCommonData("Stage",0); // current stage

	SetCommonData("StageUnlocked",0); //Stage cleared = unlock
	SetCommonData("ExtraUnlocked",false);
	SetCommonData("NightmareUnlocked",false);
	SetCommonData("TrumpCardsUnlocked",false);
	SetCommonData("Highscore",0);
	SetCommonData("HighScoreExtra",0);
	SetCommonData("HighScoreNightmare",0);

SetCommonData("NewGame",false);
}

//============================================================================

//These always reset

SetCommonData("EndGame",0);

SetCommonData("Difficulty",2); //1=easy, 2=normal, 3=hard, 4=lunatic, 5=extra, 6=nightmare, 7=trump cards
SetCommonData("PlayerType",1); //1=fire, 2=water, 3=earth, 4=wood, 5=metal
SetCommonData("Stage",0); // current stage
SetCommonData("Power",0);
SetCommonData("Points",0);
SetCommonData("Lives",0);
SetCommonData("Bombs",0);
SetCommonData("Graze",0);
SetCommonData("Score",0);

SetCommonData("InEvent",1); // no enemies are appearing, no shooting is allowed, etc.
SetCommonData("BombOn",0); // no bombing allowed.
SetCommonData("BackgroundStop",0); // background stops when in some events.

SetCommonData("ItemCollect",0); // collect all items, used when a boss appears.
SetCommonData("ItemCollectLine",0); // because SetItemCollectLine sucks
SetCommonData("MaxPower",0); //maximum power items for the player.
SetCommonData("MaxPoints",0); // number of points for the next life.
 
SetCommonData("NextStage",0); // called in stageclear.txt to move on to the following stage.
SetCommonData("FreezeTime",0); // stops time and frame in stages during the continue screen.

SetCommonData("PlayMusic",0); // remote music player.
SetCommonData("FadeOut",0); // remote music fader.

SetCommonData("IncreasePhase",0); // manually increase the phase of the stage (regardless of the number of enemies that appeared)
SetCommonData("StageLoaded",0); // used only when loading a new stage
SetCommonData("ItemSpawn",0); // spawn reward items

SetCommonData("SpellcardPractise",0); // in spellcard practise mode
SetCommonData("LastTrumpCard",0); // the previous cleared trump card, so it can add to the total score in spellcard practise
SetCommonData("TrumpCardScreenWait",0);
SetCommonData("PauseSpellcardPractise",0); // pauses input during trump card unlock requirements.
SetCommonData("RetrySpellcard",0);

SetCommonData("InSpellcardPractise",0);
SetCommonData("InStagePractise",0);

SetCommonData("NotSwitchedElements",0);
SetCommonData("SpellcardsCaptured",0);
SetCommonData("TotalTime",0);
SetCommonData("FocusTime",0);

SetCommonData("Conversation",0); // 1=from spellcards to conversations. 2=end of conversations/spellcards.

SetCommonData("Boss1Move",0); // each stage has its own number for each movement pattern the (fake) boss makes outside of battles
SetCommonData("Boss2Move",0); // same, but for the secondary boss
SetCommonData("Boss1Vanish",0); // makes the fake boss vanish from the screen and saves its last location in the Boss1X and Boss1Y common data
SetCommonData("Boss2Vanish",0); // same, but with boss 2
SetCommonData("BlackScreenFade",255); //overlays a black screen to cover everything. 255 = black, 0 = normal

SetCommonData("Boss1X",0); //first boss' X position
SetCommonData("Boss1Y",0); //first boss' Y position
SetCommonData("Boss2X",0); //second boss' X position
SetCommonData("Boss2Y",0); //second boss' Y position
SetCommonData("UseSpell1",0); //shows boss 1 spell pose, positive is 1 hand, negative is 2 hands
SetCommonData("UseSpell2",0); //same, but for boss 2

SetCommonData("BlackScreenFade",0); //255 is black screen over everything except loading screen

SetCommonData("SkipSave",false); //decides to skip the save-screen when loading a previous game

SaveCommonData;