| 1913 | } |
| 1914 | |
| 1915 | bool Game_Interpreter::CommandSimulatedAttack(lcf::rpg::EventCommand const& com) { // code 10500 |
| 1916 | int atk = com.parameters[2]; |
| 1917 | int def = com.parameters[3]; |
| 1918 | int spi = com.parameters[4]; |
| 1919 | int var = com.parameters[5]; |
| 1920 | |
| 1921 | for (const auto& actor : GetActors(com.parameters[0], com.parameters[1])) { |
| 1922 | int result = atk; |
| 1923 | result -= (actor->GetDef() * def) / 400; |
| 1924 | result -= (actor->GetSpi() * spi) / 800; |
| 1925 | result = std::max(result, 0); |
| 1926 | result = Algo::VarianceAdjustEffect(result, var); |
| 1927 | |
| 1928 | result = std::max(0, result); |
| 1929 | actor->ChangeHp(-result, true); |
| 1930 | |
| 1931 | if (com.parameters[6] != 0) { |
| 1932 | Main_Data::game_variables->Set(com.parameters[7], result); |
| 1933 | Game_Map::SetNeedRefresh(true); |
| 1934 | } |
| 1935 | } |
| 1936 | |
| 1937 | CheckGameOver(); |
| 1938 | return true; |
| 1939 | } |
| 1940 | |
| 1941 | bool Game_Interpreter::CommandWait(lcf::rpg::EventCommand const& com) { // code 11410 |
| 1942 | auto& index = GetFrame().current_command; |