diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..b9b95c137 --- /dev/null +++ b/.gitignore @@ -0,0 +1,57 @@ +# Do not track these files. + +# Node artifact files +node_modules/ +dist/ + +# Compiled Java class files +*.class + +# Compiled Python bytecode +*.py[cod] +__pycache__ + +# Log files +log/ +*.log + +# Package files +*.jar +/*egg-info/ + +# Maven +target/ + +# JetBrains IDE +.idea/ +venv/ + +# Visual Studio +.vs* + +# Unit test reports +TEST*.xml + +# Generated by MacOS +.DS_Store + +# Generated by Windows +Thumbs.db + +# Applications +*.app +*.exe +*.war + +# Large media files +*.mp4 +*.tiff +*.avi +*.flv +*.mov +*.wmv + +# Temporary files +~$*.doc* +~$*.xls* +~$*.ppt* diff --git a/CMakeSettings.json b/CMakeSettings.json index 05fd6da9f..c0fecbfe1 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -2,7 +2,7 @@ "configurations": [ { "name": "x86-Release", - "generator": "Visual Studio 15 2017", + "generator": "Visual Studio 17 2022", "configurationType": "Release", "inheritEnvironments": [ "msvc_x86" diff --git a/INSTALL b/INSTALL index 2be834c2c..7efa2c813 100644 --- a/INSTALL +++ b/INSTALL @@ -19,7 +19,8 @@ cd build cmake .. # ".." refers to the parent directory of "build" make make install -Note: This will make changes to /usr/bin, and you have to either run "sudo make install" instead, or log in as root. + +Note: This will make changes to /usr/bin, and you have to either run "sudo make install" instead, or log in as root. Note: Wizard Mode is disabled by default. To enable it run: mkdir build @@ -40,19 +41,19 @@ like this: CMAKE_CXX_FLAGS="-DFELIST_WAITKEYUP" Under DOS: -If you have DJGPP 2.03+ and gcc 2.952+ -installed, type: +If you have DJGPP 2.03+ and gcc 2.952+ installed, type: make -f ivandj.mak -------------------------------------- -Under Windows - Microsoft Visual Studio 2017 (or better): +Under Windows - Microsoft Visual Studio 2022: -You will need to install the C++ tools with CMake support, along with Git integrations from the Visual Studio Installer. -We will not be using Visual Studio in the traditional way with everything squished into a solution file. -Instead we will use Visual Studio to open a repo folder with a top-level CMakeLists.txt, in conjunction with a CMakeSettings.json file to create the cmake build files. -Then we will use msvc to compile ivan.exe, with the help of libraries we install from vcpkg using Powershell (PS). +You will need to install the C++ tools with CMake support, along with Git integrations from the Visual Studio Installer. +We will not be using Visual Studio in the traditional way with everything squished into a solution file. +Instead we will use Visual Studio to open a repo folder with a top-level CMakeLists.txt, in conjunction with +a CMakeSettings.json file to create the cmake build files. +Then we will use msvc to compile ivan.exe, with the help of libraries we install from vcpkg using Powershell (PS). Install vcpkg and install the needed libraries using Powershell: Here is a condensed summary of applicable instructions from https://github.com/microsoft/vcpkg @@ -76,7 +77,7 @@ zlib:x86-windows 1.2.11-5 A compressio Clone attnam/ivan into a directory (for example C:\Users\yourname\source\repos\ivan) -Open Microsoft Visual Studio (2017) +Open Microsoft Visual Studio 2022 Go File->Open Folder @@ -84,7 +85,8 @@ Select C:\Users\yourname\source\repos\ivan Some stuff will happen automatically. The CMakeSettings.json file will be found, and the CMake cache will be generated. -Next to the green "play" button is some text (Select Startup Item...) in a gray dropdown menu. Select "ivan.exe (Install) (ivan\ivan.exe)". +Next to the green "play" button is some text (Select Startup Item...) in a gray dropdown menu. +Select "ivan.exe (Install) (ivan\ivan.exe)". "Build" will appear in the menu next to "CMake". Click Build->ivan.exe (Install) (ivan\ivan.exe) F7 @@ -93,6 +95,14 @@ This will build ivan.exe and install all the components, automatically copying t The build folder is located in C:\Users\yourname\CMakeBuilds\some-long-code-here-abcdef123456\install\x86-Release\ivan Go there and hit ivan.exe, and you're playing IVAN built using Microsoft Visual Studio!!! +-------------------------------------- + +Under Windows - Microsoft Visual Studio OTHER THAN 2022: + +Instructions are the same as for Microsoft Visual Studio 2022, except that you must open CMakeSettings.json +in the project folder and change the generator to your version of VS. For example: + + "generator": "Visual Studio 15 2017" -------------------------------------- @@ -136,11 +146,13 @@ Follow instructions on the page to install correctly. Run MSYS2.exe from either the "-msys64" or "-msys32" folder, depending on your system, and type these commands $ pacman -Syu -Proceed with installation (option Y), then exit by closing the terminal window. The terminal window will crash and burn eventually but may take some time to do so. +Proceed with installation (option Y), then exit by closing the terminal window. +The terminal window will crash and burn eventually but may take some time to do so. Run MSYS2.exe again: $ pacman -Su -proceed with installation (option Y). This will take a long time to download all the packages, depending on your download speed +Proceed with installation (option Y). +This will take a long time to download all the packages, depending on your download speed. $ pacman -S git Proceed with installation (option Y) etcetera @@ -159,10 +171,11 @@ $ pacman -S mingw-w64-i686-SDL2_mixer $ pacman -S mingw-w64-i686-pkg-config -Now the MSYS2 build system is installed, you only need to follow the instructions below to keep IVAN up to date +Now the MSYS2 build system is installed, you only need to follow the instructions below to keep IVAN up to date. Create an empty folder in \ivan\ called msys2 -run MinGW32.exe (from your "-msys64" or "-msys32" folder, whichever is applicable) and change directory to your newly created \ivan\msys2\ folder +Run MinGW32.exe (from your "-msys64" or "-msys32" folder, whichever is applicable) and change directory to your +newly created \ivan\msys2\ folder. In MinGW32.exe type the following commands, respecting the direction of the slashes: $ cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/ivan/inst_msys2 @@ -170,7 +183,8 @@ $ make -j4 install Navigate to \ivan\inst_msys2\ivan and you will find the ivan.exe executable! -You will probably need to copy a bunch of DLLs into the directory where ivan.exe is located. These may include the following, likely not an exhaustive list, but they can be found under for example C:\-msys64\mingw32\bin: +You will probably need to copy a bunch of DLLs into the directory where ivan.exe is located. These may include +the following, likely not an exhaustive list, but they can be found under for example C:\-msys64\mingw32\bin: libpng16-16.dll libstdc++-6.dll libwinpthread-1.dll @@ -180,7 +194,9 @@ libSDL2_mixer-2-0-0.dll libmad-0.dll -Use dependencywalker if you need to check for missing libraries, and if you get the message: "error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)" then you need to include zlib1.dll +Use dependencywalker if you need to check for missing libraries, and if you get the message: + "error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)" +then you need to include zlib1.dll -------------------------------------- diff --git a/Main/Source/cmdcraft.cpp b/Main/Source/cmdcraft.cpp index 5a5b0d5a0..d8deb6444 100644 --- a/Main/Source/cmdcraft.cpp +++ b/Main/Source/cmdcraft.cpp @@ -399,11 +399,6 @@ void recipedata::Load(inputfile& SaveFile) ; - if(game::GetCurrentSavefileVersion() >= 135){ - SaveFile >> bTailoringMode; - SaveFile >> v2TailoringWorkbenchLocation; - } - // if(otSpawnType!=CTT_NONE) // SaveFile >> otSpawn; rc.integrityCheck(); diff --git a/Main/Source/human.cpp b/Main/Source/human.cpp index de8f4088a..1a3ee9d5a 100644 --- a/Main/Source/human.cpp +++ b/Main/Source/human.cpp @@ -1889,7 +1889,7 @@ truth humanoid::SwitchToCraft(recipedata rpd) {DBGLN; craft* Craft = craft::Spawn(this);DBGLN; DBG4(rpd.GetTool(),rpd.GetTool2(),GetRightArm()?GetRightArm()->IsUsable():0,GetLeftArm()?GetLeftArm()->IsUsable():0); - + bool b1OK=false; bool b2OK=false; item* it; @@ -1901,7 +1901,7 @@ truth humanoid::SwitchToCraft(recipedata rpd) b1OK=true; Craft->SetMoveCraftTool(false); } - + if(!b1OK && GetRightArm() && GetRightArm()->IsUsable()){ if((it = GetRightWielded())){ Craft->SetRightBackupID(it->GetID()); @@ -1914,7 +1914,7 @@ truth humanoid::SwitchToCraft(recipedata rpd) b1OK=true; Craft->SetMoveCraftTool(true); } - + if(!b1OK && GetLeftArm() && GetLeftArm()->IsUsable()){ if((it = GetLeftWielded())){ Craft->SetLeftBackupID(it->GetID()); @@ -1927,11 +1927,11 @@ truth humanoid::SwitchToCraft(recipedata rpd) b1OK=true; Craft->SetMoveCraftTool(true); } - + }else{ b1OK=true; //can craft somethings w/o tools } - + //TODO let the GetTool2() be equipped too? if(b1OK){ @@ -1939,7 +1939,7 @@ truth humanoid::SwitchToCraft(recipedata rpd) SetAction(Craft);DBGLN; return true; } - + ADD_MESSAGE("You have no usable arm."); rpd.SetAlreadyExplained(); return false; @@ -5390,7 +5390,7 @@ void FixSumoWrestlerHouse(festring fsCmdParams) break; } } - + if(SM){ for(int d = 0; d < SM->GetNeighbourSquares(); ++d) { @@ -5412,7 +5412,7 @@ void sumowrestler::GetAICommand() devcons::AddDevCmd("FixSumoHouse",FixSumoWrestlerHouse, "BugFix sumo wrestler house in case banana growers over crowd it."); return true;}(); - + EditNP(-25); SeekLeader(GetLeader()); @@ -7227,7 +7227,7 @@ void aslonawizard::GetAICommand() } if(NearestEnemy && NearestEnemy->GetPos().IsAdjacent(Pos) && - (!(RAND() & 4) || StateIsActivated(PANIC))) + (!(RAND() % 4) || StateIsActivated(PANIC))) { if(CanBeSeenByPlayer()) ADD_MESSAGE("%s invokes a spell and disappears.", CHAR_NAME(DEFINITE)); diff --git a/Main/Source/nonhuman.cpp b/Main/Source/nonhuman.cpp index 326d97d51..0ffaaa4bc 100644 --- a/Main/Source/nonhuman.cpp +++ b/Main/Source/nonhuman.cpp @@ -164,9 +164,10 @@ truth feline::Catches(item* Thingy) if(CanBeSeenByPlayer()) ADD_MESSAGE("%s catches %s and eats it.", CHAR_NAME(DEFINITE), Thingy->CHAR_NAME(DEFINITE)); - if(PLAYER->GetRelativeDanger(this, true) > 0.1) + if(PLAYER->GetRelativeDanger(this, true) > 0.1) { ChangeTeam(PLAYER->GetTeam()); ADD_MESSAGE("%s seems to be much more friendly towards you.", CHAR_NAME(DEFINITE)); + } } } else if(IsPlayer())