MCPcopy Create free account
hub / github.com/EasyRPG/Player / CommandChangeSP

Method CommandChangeSP

src/game_interpreter.cpp:1862–1878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860}
1861
1862bool Game_Interpreter::CommandChangeSP(lcf::rpg::EventCommand const& com) { // Code 10470
1863 bool remove = com.parameters[2] != 0;
1864 int amount = ValueOrVariable(com.parameters[3], com.parameters[4]);
1865
1866 if (remove)
1867 amount = -amount;
1868
1869 for (const auto& actor : GetActors(com.parameters[0], com.parameters[1])) {
1870 int sp = actor->GetSp() + amount;
1871 if (sp < 0)
1872 sp = 0;
1873 actor->SetSp(sp);
1874 }
1875
1876 CheckGameOver();
1877 return true;
1878}
1879
1880bool Game_Interpreter::CommandChangeCondition(lcf::rpg::EventCommand const& com) { // Code 10480
1881 bool remove = com.parameters[2] != 0;

Callers

nothing calls this directly

Calls 2

GetSpMethod · 0.45
SetSpMethod · 0.45

Tested by

no test coverage detected