Skip to content

Commit

Permalink
Convert all files to space-based indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluenaxela committed Sep 13, 2018
1 parent a749cd8 commit 3ad29d3
Show file tree
Hide file tree
Showing 133 changed files with 9,508 additions and 9,505 deletions.
2,026 changes: 1,013 additions & 1,013 deletions LunaDll/Autocode/Autocode.cpp

Large diffs are not rendered by default.

382 changes: 191 additions & 191 deletions LunaDll/Autocode/Autocode.h

Large diffs are not rendered by default.

634 changes: 317 additions & 317 deletions LunaDll/Autocode/AutocodeManager.cpp

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions LunaDll/Autocode/AutocodeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@

struct AutocodeManager {

AutocodeManager();

// File funcs
void ReadFile(std::wstring dir_path); // Load level codes from dir_path
void ReadWorld(std::wstring dir_path); // Load worldwide codes from dir_path
void ReadGlobals(std::wstring dir_path); // Load global codes from dir_path
void Parse(std::wifstream* open_file, bool add_to_globals);

// Management funcs
void Clear(bool clear_global_codes);
void ForceExpire(int section);
void ClearExpired();
void DeleteEvent(std::wstring event_reference_name); // Look up event with given name and expire it
void DoEvents(bool init);
void ActivateCustomEvents(int new_section, int eventcode);
Autocode* GetEventByRef(std::wstring event_reference_name); // Return ptr to event with the given ref, or NULL if it fails
Autocode* FindMatching(int section, std::wstring string);

// Variable bank funcs
double GetVar(std::wstring var_name); // returns 0 if var doesn't exist in bank
bool VarExists(std::wstring var_name);
bool VarOperation(std::wstring var_name, double value, OPTYPE operation_to_do);

// Members
bool m_Enabled; // Whether or not individual level scripts enabled
bool m_GlobalEnabled; // Whether or not global game scripts enabled
std::list<Autocode*> m_Autocodes;
std::list<Autocode*> m_InitAutocodes;
std::list<Autocode*> m_CustomCodes;
std::list<Autocode*> m_GlobalCodes;

std::map<std::wstring, double> m_UserVars;

// Hearts manager stuff
int m_Hearts;
AutocodeManager();

// File funcs
void ReadFile(std::wstring dir_path); // Load level codes from dir_path
void ReadWorld(std::wstring dir_path); // Load worldwide codes from dir_path
void ReadGlobals(std::wstring dir_path); // Load global codes from dir_path
void Parse(std::wifstream* open_file, bool add_to_globals);

// Management funcs
void Clear(bool clear_global_codes);
void ForceExpire(int section);
void ClearExpired();
void DeleteEvent(std::wstring event_reference_name); // Look up event with given name and expire it
void DoEvents(bool init);
void ActivateCustomEvents(int new_section, int eventcode);
Autocode* GetEventByRef(std::wstring event_reference_name); // Return ptr to event with the given ref, or NULL if it fails
Autocode* FindMatching(int section, std::wstring string);

// Variable bank funcs
double GetVar(std::wstring var_name); // returns 0 if var doesn't exist in bank
bool VarExists(std::wstring var_name);
bool VarOperation(std::wstring var_name, double value, OPTYPE operation_to_do);

// Members
bool m_Enabled; // Whether or not individual level scripts enabled
bool m_GlobalEnabled; // Whether or not global game scripts enabled
std::list<Autocode*> m_Autocodes;
std::list<Autocode*> m_InitAutocodes;
std::list<Autocode*> m_CustomCodes;
std::list<Autocode*> m_GlobalCodes;

std::map<std::wstring, double> m_UserVars;

// Hearts manager stuff
int m_Hearts;
};

#endif
70 changes: 35 additions & 35 deletions LunaDll/Autocode/Commands/AC_HeartSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@

void Autocode::HeartSystem() {

PlayerMOB* sheath = Player::Get(1);
if(sheath != 0) {

// Don't run for demo or iris
if(!Player::UsesHearts(sheath))
return;

// Detect extra heart pickup and hold displayed hearts at 2
if(sheath->Hearts > 2) {
gAutoMan.m_Hearts++;
sheath->Hearts = 2;
sheath->CurrentPowerup = (sheath->CurrentPowerup > 2 ? sheath->CurrentPowerup : 2);
}
if(sheath->Hearts == 2 && gAutoMan.m_Hearts < 2)
gAutoMan.m_Hearts = 2;

// Limit tracked max hearts
if(gAutoMan.m_Hearts > Param2)
gAutoMan.m_Hearts = (int)Param2;

// If damaged, take hearts from extra hearts
if(sheath->Hearts == 1 && gAutoMan.m_Hearts > 2) {
PlayerMOB* sheath = Player::Get(1);
if(sheath != 0) {

// Don't run for demo or iris
if(!Player::UsesHearts(sheath))
return;

// Detect extra heart pickup and hold displayed hearts at 2
if(sheath->Hearts > 2) {
gAutoMan.m_Hearts++;
sheath->Hearts = 2;
sheath->CurrentPowerup = (sheath->CurrentPowerup > 2 ? sheath->CurrentPowerup : 2);
}
if(sheath->Hearts == 2 && gAutoMan.m_Hearts < 2)
gAutoMan.m_Hearts = 2;

// Limit tracked max hearts
if(gAutoMan.m_Hearts > Param2)
gAutoMan.m_Hearts = (int)Param2;

// If damaged, take hearts from extra hearts
if(sheath->Hearts == 1 && gAutoMan.m_Hearts > 2) {
//char* dbg = "HEART SET";
sheath->Hearts = 2;
sheath->CurrentPowerup = (sheath->CurrentPowerup > 2 ? sheath->CurrentPowerup : 2);
gAutoMan.m_Hearts--;
}
else if(sheath->Hearts == 1) {
sheath->CurrentPowerup = 1;
gAutoMan.m_Hearts = 1;
}
else if(sheath->Hearts == 0) {
gAutoMan.m_Hearts = 0;
}
sheath->Hearts = 2;
sheath->CurrentPowerup = (sheath->CurrentPowerup > 2 ? sheath->CurrentPowerup : 2);
gAutoMan.m_Hearts--;
}
else if(sheath->Hearts == 1) {
sheath->CurrentPowerup = 1;
gAutoMan.m_Hearts = 1;
}
else if(sheath->Hearts == 0) {
gAutoMan.m_Hearts = 0;
}

std::wstringstream gAutoMan_m_Hearts;
gAutoMan_m_Hearts<<(long long)gAutoMan.m_Hearts;
// Display life stuff on screen
// Display life stuff on screen
Renderer::Get().AddOp(new RenderStringOp(std::wstring(
std::wstring(L"HP: ")+std::wstring(gAutoMan_m_Hearts.str())
)
,3, (float)Target, (float)Param1));

}//if heartuser
}//if heartuser

}
28 changes: 14 additions & 14 deletions LunaDll/Autocode/Commands/AC_LunaControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
#include "../../Globals.h"

void Autocode::LunaControl(LunaControlAct act, int val) {
switch(act) {
switch(act) {

case LCA_DemoCounter:
break;
case LCA_DemoCounter:
break;

case LCA_SMBXHUD:
if(val == 1)
gSMBXHUDSettings.skip = true;
else
gSMBXHUDSettings.skip = false;
break;
case LCA_Invalid:
default:
return;
}
case LCA_SMBXHUD:
if(val == 1)
gSMBXHUDSettings.skip = true;
else
gSMBXHUDSettings.skip = false;
break;
case LCA_Invalid:
default:
return;
}
}
Loading

1 comment on commit 3ad29d3

@Wohlstand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must be done long time ago, and I though to make this myself, but... Perfect! 🦊 👍

Please sign in to comment.