| 1860 | } |
| 1861 | |
| 1862 | bool 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 | |
| 1880 | bool Game_Interpreter::CommandChangeCondition(lcf::rpg::EventCommand const& com) { // Code 10480 |
| 1881 | bool remove = com.parameters[2] != 0; |