From 68728b5587617e1cc934ef6af6a69c1abc1a0056 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 1 Feb 2017 22:46:11 +0100 Subject: [PATCH] Devtools: Fix scaling issue with creature type change Now the `wolfie` command and the [Ctrl+]Alt+Shift+T command behave similarly by making wolves 15% bigger than rabbits. The duplicate `wolfieisgod` command was dropped, and the logic for the hotkey was simplified (it was bogus). --- Docs/DEVTOOLS.txt | 2 +- Source/Devtools/ConsoleCmds.cpp | 6 +----- Source/Devtools/ConsoleCmds.def | 1 - Source/GameTick.cpp | 37 ++++----------------------------- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/Docs/DEVTOOLS.txt b/Docs/DEVTOOLS.txt index 46916a0..db82aac 100644 --- a/Docs/DEVTOOLS.txt +++ b/Docs/DEVTOOLS.txt @@ -87,7 +87,7 @@ save (string) - saves the state of the current map. Character attributes ~~~~~~~~~~~~~~~~~~~~ -wolfieisgod - sets the player to a wolf. You gain all of the speed, strength, +wolfie - sets the player to a wolf. You gain all of the speed, strength, durability, and attacks of a wolf. funnybunny - sets the player to a rabbit. size (float) - changes the overall size of your character. diff --git a/Source/Devtools/ConsoleCmds.cpp b/Source/Devtools/ConsoleCmds.cpp index 7e95bf4..49ff375 100644 --- a/Source/Devtools/ConsoleCmds.cpp +++ b/Source/Devtools/ConsoleCmds.cpp @@ -496,15 +496,11 @@ void ch_wolfie(const char*) { Person::players[0]->creature = wolftype; Person::players[0]->skeletonLoad(); + Person::players[0]->scale = .23; Person::players[0]->damagetolerance = 300; set_proportion(0, "1 1 1 1"); } -void ch_wolfieisgod(const char* args) -{ - ch_wolfie(args); -} - void ch_wolf(const char*) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Wolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); diff --git a/Source/Devtools/ConsoleCmds.def b/Source/Devtools/ConsoleCmds.def index 0c058c4..162636e 100644 --- a/Source/Devtools/ConsoleCmds.def +++ b/Source/Devtools/ConsoleCmds.def @@ -48,7 +48,6 @@ DECLARE_COMMAND(belt) DECLARE_COMMAND(cellophane) DECLARE_COMMAND(funnybunny) DECLARE_COMMAND(wolfie) -DECLARE_COMMAND(wolfieisgod) DECLARE_COMMAND(wolf) DECLARE_COMMAND(snowwolf) DECLARE_COMMAND(darkwolf) diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 827f82b..a9cf0bf 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -1240,20 +1240,7 @@ void Game::ProcessDevInput() closest = findClosestPlayer(); } - // FIXME: Those proportions are buggy if (closest >= 0) { - if (Person::players[closest]->creature == wolftype) { - headprop = Person::players[closest]->proportionhead.x / 1.1; - bodyprop = Person::players[closest]->proportionbody.x / 1.1; - armprop = Person::players[closest]->proportionarms.x / 1.1; - legprop = Person::players[closest]->proportionlegs.x / 1.1; - } else { // rabbittype - headprop = Person::players[closest]->proportionhead.x / 1.2; - bodyprop = Person::players[closest]->proportionbody.x / 1.05; - armprop = Person::players[closest]->proportionarms.x / 1.00; - legprop = Person::players[closest]->proportionlegs.x / 1.1; - } - if (Person::players[closest]->creature == rabbittype) { Person::players[closest]->creature = wolftype; Person::players[closest]->whichskin = 0; @@ -1263,11 +1250,10 @@ void Game::ProcessDevInput() Person::players[closest]->proportionbody = 1.1; Person::players[closest]->proportionarms = 1.1; Person::players[closest]->proportionlegs = 1.1; - Person::players[closest]->proportionlegs.y = 1.1; - Person::players[closest]->scale = .23 * 5 * Person::players[0]->scale; + Person::players[closest]->scale *= 1.15; Person::players[closest]->damagetolerance = 300; - } else { + } else { // wolftype Person::players[closest]->creature = rabbittype; Person::players[closest]->whichskin = 0; Person::players[closest]->skeletonLoad(true); @@ -1275,27 +1261,12 @@ void Game::ProcessDevInput() Person::players[closest]->proportionhead = 1.2; Person::players[closest]->proportionbody = 1.05; Person::players[closest]->proportionarms = 1.00; - Person::players[closest]->proportionlegs = 1.1; + Person::players[closest]->proportionlegs.x = 1.1; Person::players[closest]->proportionlegs.y = 1.05; - Person::players[closest]->scale = .2 * 5 * Person::players[0]->scale; + Person::players[closest]->scale /= 1.15; Person::players[closest]->damagetolerance = 200; } - - if (Person::players[closest]->creature == wolftype) { - Person::players[closest]->proportionhead = 1.1 * headprop; - Person::players[closest]->proportionbody = 1.1 * bodyprop; - Person::players[closest]->proportionarms = 1.1 * armprop; - Person::players[closest]->proportionlegs = 1.1 * legprop; - } - - if (Person::players[closest]->creature == rabbittype) { - Person::players[closest]->proportionhead = 1.2 * headprop; - Person::players[closest]->proportionbody = 1.05 * bodyprop; - Person::players[closest]->proportionarms = 1.00 * armprop; - Person::players[closest]->proportionlegs = 1.1 * legprop; - Person::players[closest]->proportionlegs.y = 1.05 * legprop; - } } } -- 2.39.5