X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=c7075da3fbb2cb6055c4ccfab697a9ad1709cef5;hb=bb302fb1d9936b1ab630a800698ab7b867472a7d;hp=c1b038671b454c23beb94698377197e455d84ca6;hpb=8139604f6d9f7014ef516371895c72fabd55f828;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index c1b0386..c7075da 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -840,13 +840,11 @@ bool Game::LoadLevel(const std::string& name, bool tutorial) } else { Person::players[i]->damagetolerance = 200; } - } - Game::LoadingScreen(); + Game::LoadingScreen(); - Person::players[i]->tempanimation = Animation("Tempanim", lowheight, neutral); + Person::players[i]->tempanimation = Animation("Tempanim", lowheight, neutral); - if (i == 0) { Person::players[i]->headmorphness = 0; Person::players[i]->targetheadmorphness = 1; Person::players[i]->headmorphstart = 0; @@ -1024,50 +1022,56 @@ void Game::ProcessInput() /* Devtools */ if (devtools && !mainmenu) { - ProcessDevInput(); + /* Console */ + if (Input::isKeyPressed(consolekey)) { + console = !console; + if (console) { + OPENAL_SetFrequency(OPENAL_ALL); + } else { + freeze = 0; + waiting = false; + } + } + + /* Other devtools, disabled when the console is shown */ + if (!console) { + ProcessDevInput(); + } } } void Game::ProcessDevInput() { - if (!devtools || mainmenu) { + if (!devtools || mainmenu || console) { return; } - /* Console */ - if (Input::isKeyPressed(consolekey)) { - console = !console; - if (console) { - OPENAL_SetFrequency(OPENAL_ALL); - } else { - freeze = 0; - waiting = false; - } - } - if (Input::isKeyDown(SDL_SCANCODE_LALT)) { /* Enable editor */ if (Input::isKeyPressed(SDL_SCANCODE_M) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) { editorenabled = !editorenabled; if (editorenabled) { Person::players[0]->damagetolerance = 100000; + Person::players[0]->damage = 0; + Person::players[0]->permanentdamage = 0; + Person::players[0]->superpermanentdamage = 0; + Person::players[0]->burnt = 0; + Person::players[0]->bloodloss = 0; + Person::players[0]->deathbleeding = 0; } else { Person::players[0]->damagetolerance = 200; } - Person::players[0]->damage = 0; // these lines were in both if and else, but I think they would better fit in the if - Person::players[0]->permanentdamage = 0; - Person::players[0]->superpermanentdamage = 0; - Person::players[0]->bloodloss = 0; - Person::players[0]->deathbleeding = 0; } /* Nullify damage and give 200000 health */ if (Input::isKeyPressed(SDL_SCANCODE_H)) { Person::players[0]->damagetolerance = 200000; Person::players[0]->damage = 0; - Person::players[0]->burnt = 0; Person::players[0]->permanentdamage = 0; Person::players[0]->superpermanentdamage = 0; + Person::players[0]->burnt = 0; + Person::players[0]->bloodloss = 0; + Person::players[0]->deathbleeding = 0; } /* Change environment */ @@ -1207,22 +1211,8 @@ void Game::ProcessDevInput() } if (closest >= 0) { - if (Person::players[closest]->creature == rabbittype) { - Person::players[closest]->creature = wolftype; - Person::players[closest]->whichskin = 0; - Person::players[closest]->skeletonLoad(); - Person::players[closest]->scale *= 1.15; - - Person::players[closest]->damagetolerance = 300; - } else { // wolftype - Person::players[closest]->creature = rabbittype; - Person::players[closest]->whichskin = 0; - Person::players[closest]->skeletonLoad(true); - - Person::players[closest]->scale /= 1.15; - - Person::players[closest]->damagetolerance = 200; - } + person_type nextType = static_cast((Person::players[closest]->creature + 1) % PersonType::types.size()); + Person::players[closest]->changeCreatureType(nextType); } } @@ -1442,7 +1432,7 @@ void Game::ProcessDevInput() Person::players.back()->howactive = editoractive; Person::players.back()->whichskin = (int)(abs(Random() % 3)); - Person::players.back()->skeletonLoad(true); + Person::players.back()->skeletonLoad(); Person::players.back()->skeleton.drawmodelclothes.textureptr.load("Textures/Belt.png", 1); Person::players.back()->speed = 1 + (float)(Random() % 100) / 1000; @@ -1456,8 +1446,6 @@ void Game::ProcessDevInput() Person::players.back()->setProportions(1, 1, 1, 1); - Person::players.back()->tempanimation = Animation("Tempanim", lowheight, neutral); - Person::players.back()->damagetolerance = 200; Person::players.back()->protectionhead = Person::players[0]->protectionhead;