| 1834 | } |
| 1835 | |
| 1836 | bool Game_Interpreter::CommandChangeHP(lcf::rpg::EventCommand const& com) { // Code 10460 |
| 1837 | bool remove = com.parameters[2] != 0; |
| 1838 | int amount = ValueOrVariable(com.parameters[3], |
| 1839 | com.parameters[4]); |
| 1840 | bool lethal = com.parameters[5] != 0; |
| 1841 | |
| 1842 | if (remove) |
| 1843 | amount = -amount; |
| 1844 | |
| 1845 | for (const auto& actor : GetActors(com.parameters[0], com.parameters[1])) { |
| 1846 | actor->ChangeHp(amount, lethal); |
| 1847 | |
| 1848 | auto& scene = Scene::instance; |
| 1849 | if (scene) { |
| 1850 | scene->OnEventHpChanged(actor, amount); |
| 1851 | } |
| 1852 | |
| 1853 | if (actor->IsDead() && actor->GetActorBattleSprite()) { |
| 1854 | actor->GetActorBattleSprite()->DetectStateChange(); |
| 1855 | } |
| 1856 | } |
| 1857 | |
| 1858 | CheckGameOver(); |
| 1859 | return true; |
| 1860 | } |
| 1861 | |
| 1862 | bool Game_Interpreter::CommandChangeSP(lcf::rpg::EventCommand const& com) { // Code 10470 |
| 1863 | bool remove = com.parameters[2] != 0; |
nothing calls this directly
no test coverage detected