# HG changeset patch # User koda # Date 1371155243 -7200 # Node ID bce8cf41d666080d139c416e43a9488cf12a6c59 # Parent 71fc5893071cdd9d87908e198d5d5904d296e955# Parent 11438c0bd46bf567ce71d057e899092025d6a376 merge cmake_pascal branch in default diff -r 11438c0bd46b -r bce8cf41d666 .hgignore --- a/.hgignore Tue Apr 30 01:47:30 2013 +0200 +++ b/.hgignore Thu Jun 13 22:27:23 2013 +0200 @@ -3,6 +3,7 @@ glob:moc_*.cxx glob:qrc_*.cxx glob:*.o +glob:*.a glob:*.qm glob:Makefile glob:bin @@ -54,8 +55,8 @@ glob:project_files/Android-build/SDL-android-project/.* glob:project_files/Android-build/out glob:project_files/Android-build/Makefile.android -glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug -glob:hedgewars-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release +glob:hedgewars-build-desktop-Qt* +glob:hedgewars-build-desktop-Qt* glob:*.depends glob:tools/build_windows_koda.bat glob:share/hedgewars/Data/misc/hwengine.desktop @@ -63,3 +64,5 @@ glob:_CPack_Packages/ glob:version_info.txt glob:*.tar.* +glob:*.or +glob:*.res \ No newline at end of file diff -r 11438c0bd46b -r bce8cf41d666 .hgtags --- a/.hgtags Tue Apr 30 01:47:30 2013 +0200 +++ b/.hgtags Thu Jun 13 22:27:23 2013 +0200 @@ -59,3 +59,4 @@ 0000000000000000000000000000000000000000 0.9.18-release 0000000000000000000000000000000000000000 0.9.18-release 2fc02902c7cbf3c29bfe08a50e5f37983582b251 0.9.18-release +1617149e01a4fa25637e2ab655d0287ef9c21b7c 0.9.19-release diff -r 11438c0bd46b -r bce8cf41d666 CMakeLists.txt --- a/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -1,15 +1,8 @@ project(hedgewars) #initialise cmake environment -cmake_minimum_required(VERSION 2.6.0) -if(CMAKE_VERSION VERSION_LESS "2.8") - set(WARNING "WARNING: ") - set(allow_parse_args FALSE) -else() - set(WARNING WARNING) - set(allow_parse_args TRUE) -endif() -foreach(hwpolicy CMP0003 CMP0012 CMP0017) +cmake_minimum_required(VERSION 2.6.4) +foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018) if(POLICY ${hwpolicy}) cmake_policy(SET ${hwpolicy} NEW) endif() @@ -23,14 +16,22 @@ option(NOPNG "Disable screenshoot compression (off)" OFF) option(NOVIDEOREC "Disable video recording (off)" OFF) +#libraries are built shared unless explicitly added as a static +option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON) #set this to ON when 2.1.0 becomes more widespread (and only for linux) -option(SYSTEM_PHYSFS "Use system physfs (off)" OFF) +option(PHYSFS_SYSTEM "Use system physfs (off)" OFF) + +if(WIN32 OR APPLE) + option(LUA_SYSTEM "Use system lua (off)" OFF) +else() + option(LUA_SYSTEM "Use system lua (on)" ON) +endif() option(BUILD_ENGINE_LIBRARY "Enable hwengine library (off)" OFF) option(ANDROID "Enable Android build (off)" OFF) if(UNIX AND NOT APPLE) - option(MINIMAL_CFLAGS "Respect system CFLAGS as much as possible (off)" OFF) + option(MINIMAL_FLAGS "Respect system flags as much as possible (off)" OFF) else() option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) endif() @@ -42,167 +43,21 @@ endif() -#detect Mercurial revision and init rev/hash information -find_program(HGCOMMAND hg) -if(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg)) - execute_process(COMMAND ${HGCOMMAND} identify -in - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE internal_version - ERROR_QUIET - ) - #check local repo status - string(REGEX REPLACE "[^+]" "" HGCHANGED ${internal_version}) - string(REGEX REPLACE "[0-9a-zA-Z]+(.*) ([0-9]+)(.*)" "\\2" HEDGEWARS_REVISION ${internal_version}) - string(REGEX REPLACE "([0-9a-zA-Z]+)(.*) [0-9]+(.*)" "\\1" HEDGEWARS_HASH ${internal_version}) - - if(HGCHANGED) - message(${WARNING} "You have uncommitted changes in your repository!") - endif() - #let's assume that if you have hg you might be interested in debugging - set(default_build_type "DEBUG") - #write down hash and rev for easy picking should hg be missing - file(WRITE "${CMAKE_SOURCE_DIR}/share/version_info.txt" "Hedgewars versioning information, do not modify\nrev ${HEDGEWARS_REVISION}\nhash ${HEDGEWARS_HASH}\n") -else() - set(default_build_type "RELEASE") - # when compiling outside rev control, fetch revision and hash information from version_info.txt - find_file(version_info version_info.txt PATH ${CMAKE_SOURCE_DIR}/share) - if(version_info) - file(STRINGS ${version_info} internal_version REGEX "rev") - string(REGEX REPLACE "rev ([0-9]*)" "\\1" HEDGEWARS_REVISION ${internal_version}) - file(STRINGS ${version_info} internal_version REGEX "hash") - string(REGEX REPLACE "hash ([a-zA-Z0-9]*)" "\\1" HEDGEWARS_HASH ${internal_version}) - else() - message(${WARNING} "${CMAKE_SOURCE_DIR}/share/version_info.txt not found, revision information " - "will be incorrect!!! Contact your source provider to fix this!") - set(HEDGEWARS_REVISION "0000") - set(HEDGEWARS_HASH "unknown") - endif() -endif() - - #versioning set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 9) -set(CPACK_PACKAGE_VERSION_PATCH 19) -set(HEDGEWARS_PROTO_VER 44) +set(CPACK_PACKAGE_VERSION_PATCH 20) +set(HEDGEWARS_PROTO_VER 46) set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +include(${CMAKE_MODULE_PATH}/revinfo.cmake) message(STATUS "Building ${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION} (${HEDGEWARS_HASH})") - -#where to build libs and bins -set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -#these variables are for non-makefile generators -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH}) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH}) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH}) - -#resource paths -if(UNIX AND NOT APPLE) - set(target_binary_install_dir "bin") - set(target_library_install_dir "lib") - - string(SUBSTRING "${DATA_INSTALL_DIR}" 0 1 sharepath_start) - if (NOT (${sharepath_start} MATCHES "/")) - set(HEDGEWARS_DATADIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/") - else() - set(HEDGEWARS_DATADIR "${DATA_INSTALL_DIR}/") - endif() - set(HEDGEWARS_FULL_DATADIR "${HEDGEWARS_DATADIR}") -else() - set(target_binary_install_dir "./") - - if(APPLE) - set(target_library_install_dir "../Frameworks/") - set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/") - set(HEDGEWARS_DATADIR "../Resources/") - set(HEDGEWARS_FULL_DATADIR "/Applications/${CMAKE_INSTALL_PREFIX}/${HEDGEWARS_DATADIR}") - elseif(WIN32) - set(target_library_install_dir "./") - set(HEDGEWARS_DATADIR "./") - set(HEDGEWARS_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/") - link_directories("${EXECUTABLE_OUTPUT_PATH}" "${CMAKE_SOURCE_DIR}/misc/winutils/bin") - endif() -endif() - - -if(APPLE) - set(CMAKE_FIND_FRAMEWORK "FIRST") - - #what system are we building for - set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET}) - - #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version - find_program(sw_vers sw_vers) - if(sw_vers) - execute_process(COMMAND ${sw_vers} "-productVersion" - OUTPUT_VARIABLE current_macosx_version - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version}) - else() - if(NOT minimum_macosx_version) - message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set") - else() - message(${WARNING} "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable") - set(current_macosx_version ${minimum_macosx_version}) - endif() - endif() - - #if nothing is set, we deploy only for the current system - if(NOT minimum_macosx_version) - set(minimum_macosx_version ${current_macosx_version}) - endif() - - #lower systems don't have enough processing power anyway - if (minimum_macosx_version VERSION_LESS "10.4") - message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4") - endif() - - #workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2) - if(current_macosx_version VERSION_EQUAL "10.4") - find_package(SDL_mixer REQUIRED) - set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg") - set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod") - add_flag_append(CMAKE_C_FLAGS "${DYLIB_SMPEG} ${DYLIB_MIKMOD}") - add_flag_append(CMAKE_Pascal_FLAGS "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}") - endif() - - #CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking - if(NOT CMAKE_OSX_ARCHITECTURES) - if(current_macosx_version VERSION_LESS "10.6") - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*") - set(CMAKE_OSX_ARCHITECTURES "ppc7400") - else() - set(CMAKE_OSX_ARCHITECTURES "i386") - endif() - else() - set(CMAKE_OSX_ARCHITECTURES "x86_64") - endif() - endif() - - #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on - #we need to provide the correct one when host and target differ - if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) - if(minimum_macosx_version VERSION_EQUAL "10.4") - set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/") - set(CMAKE_C_COMPILER "gcc-4.0") - set(CMAKE_CXX_COMPILER "g++-4.0") - else() - string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version}) - set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/") - endif() - endif() - - #set deployment target - add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version} ") -endif(APPLE) +#general utilities +include(${CMAKE_MODULE_PATH}/utils.cmake) +#platform specific init code +include(${CMAKE_MODULE_PATH}/platform.cmake) +include(${CMAKE_MODULE_PATH}/paths.cmake) #when build type is not specified, assume Debug/Release according to build version information @@ -217,34 +72,25 @@ endif (CMAKE_BUILD_TYPE) -#set default flags values for all projects (unless MINIMAL_CFLAGS is true) -if(NOT ${MINIMAL_CFLAGS}) - add_flag_append(CMAKE_C_FLAGS "-pipe") - add_flag_append(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer") - add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -DDEBUG") - add_flag_append(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) - add_flag_append(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) - add_flag_append(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) +#perform safe check that enable/disable compilation features +include(${CMAKE_MODULE_PATH}/compilerchecks.cmake) + +#set default flags values for all projects (unless MINIMAL_FLAGS is true) +if(NOT ${MINIMAL_FLAGS}) + set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}") + set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g ${CMAKE_C_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS "-pipe ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}") else() #CMake adds a lot of additional configuration flags, so let's clear them up set(CMAKE_C_FLAGS_RELEASE "") - set(CMAKE_C_FLAGS_DEBUG "-Wall -DDEBUG") + set(CMAKE_C_FLAGS_DEBUG "-Wall") set(CMAKE_CXX_FLAGS_RELEASE "") - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -DDEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall") endif() -#TODO: find out why we need this... -include(CheckCCompilerFlag) -set(CMAKE_REQUIRED_FLAGS "-Wl,-z -Wl,noexecstack") -check_c_compiler_flag("" HAVE_NOEXECSTACK) #empty because we are testing a linker flag -if(HAVE_NOEXECSTACK) - add_flag_append(CMAKE_Pascal_FLAGS "-k-z -knoexecstack") - if(NOT ${MINIMAL_CFLAGS}) - add_flag_append(CMAKE_C_FLAGS ${CMAKE_REQUIRED_FLAGS}) - endif() -endif() -unset(CMAKE_REQUIRED_FLAGS) - #parse additional parameters if(FPFLAGS) add_flag_prepend(CMAKE_Pascal_FLAGS ${FPFLAGS}) @@ -279,18 +125,30 @@ ) endif() + #lua discovery -find_package(Lua) -if(LUA_FOUND) - message(STATUS "Found LUA: ${LUA_DEFAULT}") +if (${LUA_SYSTEM}) + if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR) + find_package(Lua) + endif() + + if (LUA_LIBRARY AND LUA_INCLUDE_DIR) + set(LUA_FOUND TRUE) + else() + message(FATAL_ERROR "Missing Lua! Rerun cmake with -DLUA_SYSTEM=off to build the internal version") + endif() else() - message(STATUS "LUA will be provided by the bundled sources") + if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR) + message(STATUS "LUA will be provided by the bundled sources") + endif() + set(lua_output_name "hwlua") add_subdirectory(misc/liblua) + list(APPEND pascal_flags "-XLAlua=${lua_output_name}" "-dLUA_INTERNAL") endif() #physfs discovery -if (${SYSTEM_PHYSFS}) +if (${PHYSFS_SYSTEM}) if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR) find_package(PhysFS) endif() @@ -315,8 +173,10 @@ message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version") endif() else() - message(STATUS "PhysFS will be provided by the bundled sources") - set(physfs_output_name "hw_physfs") + if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR) + message(STATUS "PhysFS will be provided by the bundled sources") + endif() + set(physfs_output_name "hwphysfs") add_subdirectory(misc/libphysfs) endif() @@ -348,5 +208,5 @@ endif() -include(${CMAKE_MODULE_PATH}/CPackConfig.cmake) +include(${CMAKE_MODULE_PATH}/cpackvars.cmake) diff -r 11438c0bd46b -r bce8cf41d666 CREDITS --- a/CREDITS Tue Apr 30 01:47:30 2013 +0200 +++ b/CREDITS Thu Jun 13 22:27:23 2013 +0200 @@ -6,6 +6,13 @@ - see Fonts_LICENSE.txt ========== += FORTS +========== +- Carlos Vives -> Tank (2010) +- Dragonfly -> EvilChicken (2010) +- Randy Broda -> SteelTower (2013) + +========== = HATS ========== - Robinator -> Terminator (2010) @@ -66,4 +73,4 @@ http://www.freesound.org/people/Jovica/sounds/38317/ -ALL OTHER CONTENT IS PROPERTY OF Andrey Korotaev UNLESS OTHERWISE SPECIFIED \ No newline at end of file +ALL OTHER CONTENT IS PROPERTY OF Andrey Korotaev UNLESS OTHERWISE SPECIFIED diff -r 11438c0bd46b -r bce8cf41d666 ChangeLog.txt --- a/ChangeLog.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/ChangeLog.txt Thu Jun 13 22:27:23 2013 +0200 @@ -1,10 +1,48 @@ + features * bugfixes +0.9.19 -> ???: + * increase precision in damage calcs; extra damage affects fire properly now + +0.9.18 -> 0.9.19: + + New Freezer weapon - freezes terrain, water, hedgehogs, mines, cases, explosives + + Saucer can aim weapons and fire underwater + + Main graphical user interface overhaul + + Splashscreen on Windows *_* + + Up and down keys navigate in chat history + + Several commands from chat available + + Support hwplay:// scheme syntax + + Supply full revision and hash information in version tag + + Better set of options for driving engine + + Downloadable content can now be stored in packages for easy uninstall + + Lua scripts can load a sidecar overlay package of game resources + + Math improvements for better performance/reliability + + Smarter AI - now uses drill rocket accurately and is aware of barrels and dud mines. More aggressive in infinite attack, lua can tell to target specific hogs, such as in Mutant + + New fort, Steel Tower + + New theme, Fruit + + New hats - some national ones, Portal, harlequin, more animals... + + New maps based on StarBound. SB_Bones, SB_Crystal, SB_Grassy, SB_Grove, SB_Haunty, SB_Oaks, SB_Shrooms, SB_Tentacles + + Translation updates - Turkish, French, German, Japanese, Portuguese, Italian, Russian - Campaign french should work correctly now + + Theme object masks + + Easier weapon selection in shoppa. F1 will select from F5 if there are no weps in F1-F4 + + Cleaver radius shrunk to improve usability on horizontal throws + + Map hog limit is now just a suggestion, not enforced + + Static map theme is now just the default, can be changed + + Themeable static maps (provide a mask.png without a map.png) + + Split seed with '|' to keep the land shape but change the hog placement + * You can now move out of the way when throwing a sticky mine or cleaver straight up + * Rope sliding should behave more like pre-0.9.18 again + * Forbid kicking on 1v1 matches + * Desync fixes + * Fixed fort mode + * Making very large maps now works properly with targeted weapons + * ParseCommand should be safe to use in Lua now, at any time + * Fixes to many weapons. Mudball, blowtorch, explosives, cluster bomb spread, portal. + 0.9.17 -> 0.9.18: + 'A Classic Fairytale' Campaign - + Video recorder (requires ffmpeg) + + Video recorder (requires ffmpeg/libav) + Cleaver weapon + AI is now aware of drowning and fall damage + AI learned how to use Sniper Rifle and Cake @@ -24,6 +62,7 @@ + Reduce amount of memory needed for engine to store land data + Countless other small fixes and improvements + Detect desyncs early + + Mudball will not cause any direct damage anymore * Fix cake getting stuck in barrels, crates and hedgehogs * Fix all knowns bugs which caused network game hang when players close engine or quit * Fix drill strike bug when drill's timer gets ridiculously high value instead of explosion diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -189,10 +189,6 @@ ${hwfr_rez_src} ) -if((UNIX AND NOT APPLE) AND ${BUILD_ENGINE_LIBRARY}) - set_target_properties(hedgewars PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}") -endif() - list(APPEND HW_LINK_LIBS ${PHYSFS_LIBRARY} ${PHYSLAYER_LIBRARY} diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/HWApplication.cpp --- a/QTfrontend/HWApplication.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/HWApplication.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -18,15 +18,16 @@ #include "HWApplication.h" #include +#include #include "hwform.h" #include "MessageDialog.h" -#if !defined(Q_WS_WIN) +#if !defined(Q_OS_WIN) #include "signal.h" #endif -#if !defined(Q_WS_WIN) +#if !defined(Q_OS_WIN) void terminateFrontend(int signal) { Q_UNUSED(signal); @@ -34,10 +35,10 @@ } #endif -HWApplication::HWApplication(int &argc, char **argv): +HWApplication::HWApplication(int &argc, char **argv) : QApplication(argc, argv) { -#if !defined(Q_WS_WIN) +#if !defined(Q_OS_WIN) signal(SIGINT, &terminateFrontend); #endif #if 0 @@ -83,6 +84,8 @@ return true; } else if (scheme == "hwplay") { int port = openEvent->url().port(NETGAME_DEFAULT_PORT); + if (address == "") + address = NETGAME_DEFAULT_SERVER; form->NetConnectQuick(address, (quint16) port); return true; } else { diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/HWApplication.h --- a/QTfrontend/HWApplication.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/HWApplication.h Thu Jun 13 22:27:23 2013 +0200 @@ -20,10 +20,9 @@ #define HWAPP_H #include -#include -#include class HWForm; +class QEvent; /** * @brief Main class of the Qt application. diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/KB.h --- a/QTfrontend/KB.h Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* - * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifndef KB_H -#define KB_H - -#include - -const ulong KBmsgsCount = 1; - -const QString KBMessages[KBmsgsCount] = -{ - QT_TRANSLATE_NOOP("KB", "SDL_ttf returned error while rendering text, " - "most propably it is related to the bug " - "in freetype2. It's recommended to update your " - "freetype lib.") -}; - -#endif // KB_H diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/achievements.cpp --- a/QTfrontend/achievements.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/achievements.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/achievements.h --- a/QTfrontend/achievements.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/achievements.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/binds.cpp --- a/QTfrontend/binds.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/binds.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/binds.h --- a/QTfrontend/binds.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/binds.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/campaign.cpp --- a/QTfrontend/campaign.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/campaign.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,43 +16,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "campaign.h" + +#include "hwconsts.h" + #include -#include "campaign.h" -#include "gameuiconfig.h" -#include "hwconsts.h" -#include "gamecfgwidget.h" -#include "bgwidget.h" -#include "mouseoverfilter.h" -#include "tcpBase.h" - -#include "DataManager.h" - -extern QString campaign, campaignTeam; QStringList getCampMissionList(QString & campaign) { @@ -81,3 +50,14 @@ campfile.setIniCodec("UTF-8"); return campfile.value(QString("Mission %1/Script").arg(mNum)).toString(); } + +QString getCampaignImage(QString campaign, unsigned int mNum) +{ + return getCampaignScript(campaign,mNum).replace(QString(".lua"),QString(".png")); +} + +QString getCampaignMissionName(QString campaign, unsigned int mNum) +{ + return getCampaignScript(campaign,mNum).replace(QString(".lua"),QString("")); +} + diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/campaign.h --- a/QTfrontend/campaign.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/campaign.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,24 +19,13 @@ #ifndef CAMPAIGN_H #define CAMPAIGN_H -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "netserver.h" -#include "game.h" -#include "ui_hwform.h" -#include "SDLInteraction.h" -#include "bgwidget.h" +#include +#include QStringList getCampMissionList(QString & campaign); unsigned int getCampProgress(QString & teamName, QString & campName); QString getCampaignScript(QString campaign, unsigned int mNum); +QString getCampaignImage(QString campaign, unsigned int mNum); +QString getCampaignMissionName(QString campaign, unsigned int mNum); #endif diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/drawmapscene.cpp --- a/QTfrontend/drawmapscene.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/drawmapscene.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/drawmapscene.h --- a/QTfrontend/drawmapscene.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/drawmapscene.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/game.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,6 +38,13 @@ #include #include "ThemeModel.h" +// last game info +QList lastGameStartArgs = QList(); +GameType lastGameType = gtNone; +GameCFGWidget * lastGameCfg = NULL; +QString lastGameAmmo = NULL; +TeamSelWidget * lastGameTeamSel = NULL; + QString training, campaign, campaignScript, campaignTeam; // TODO: Cleaner solution? HWGame::HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget) : @@ -48,6 +55,10 @@ this->config = config; this->gamecfg = gamecfg; netSuspend = false; + + lastGameCfg = gamecfg; + lastGameAmmo = ammo; + lastGameTeamSel = pTeamSelWidget; } HWGame::~HWGame() @@ -142,7 +153,7 @@ HWProto::addStringToBuffer(teamscfg, "TL"); HWProto::addStringToBuffer(teamscfg, QString("etheme %1") - .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data().toString() : "steel")); + .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data(ThemeModel::ActualNameRole).toString() : "steel")); HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString()); HWProto::addStringToBuffer(teamscfg, "e$template_filter 2"); @@ -228,6 +239,7 @@ SendQuickConfig(); break; } + case gtNone: case gtSave: case gtDemo: break; @@ -306,8 +318,8 @@ int size = msg.size(); QString newResolution = QString().append(msg.mid(2)).left(size - 4); QStringList wh = newResolution.split('x'); - config->Form->ui.pageOptions->windowWidthEdit->setText(wh[0]); - config->Form->ui.pageOptions->windowHeightEdit->setText(wh[1]); + config->Form->ui.pageOptions->windowWidthEdit->setValue(wh[0].toInt()); + config->Form->ui.pageOptions->windowHeightEdit->setValue(wh[1].toInt()); break; } default: @@ -343,7 +355,7 @@ readbuffer.remove(0, msglen + 1); ParseMessage(msg); } - + flushNetBuffer(); } @@ -352,7 +364,7 @@ if(m_netSendBuffer.size()) { emit SendNet(m_netSendBuffer); - + m_netSendBuffer.clear(); } } @@ -435,6 +447,9 @@ void HWGame::StartLocal() { + lastGameStartArgs.clear(); + lastGameType = gtLocal; + gameType = gtLocal; demo.clear(); Start(false); @@ -443,6 +458,9 @@ void HWGame::StartQuick() { + lastGameStartArgs.clear(); + lastGameType = gtQLocal; + gameType = gtQLocal; demo.clear(); Start(false); @@ -451,6 +469,10 @@ void HWGame::StartTraining(const QString & file) { + lastGameStartArgs.clear(); + lastGameStartArgs.append(file); + lastGameType = gtTraining; + gameType = gtTraining; training = "Missions/Training/" + file + ".lua"; demo.clear(); @@ -460,6 +482,12 @@ void HWGame::StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam) { + lastGameStartArgs.clear(); + lastGameStartArgs.append(camp); + lastGameStartArgs.append(campScript); + lastGameStartArgs.append(campTeam); + lastGameType = gtCampaign; + gameType = gtCampaign; campaign = camp; campaignScript = "Missions/Campaign/" + camp + "/" + campScript; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/game.h --- a/QTfrontend/game.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/game.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,18 @@ class GameCFGWidget; class TeamSelWidget; +enum GameType +{ + gtNone = 0, + gtLocal = 1, + gtQLocal = 2, + gtDemo = 3, + gtNet = 4, + gtTraining = 5, + gtCampaign = 6, + gtSave = 7, +}; + enum GameState { gsNotStarted = 0, @@ -49,6 +61,13 @@ bool checkForDir(const QString & dir); +// last game info +extern QList lastGameStartArgs; +extern GameType lastGameType; +extern GameCFGWidget * lastGameCfg; +extern QString lastGameAmmo; +extern TeamSelWidget * lastGameTeamSel; + class HWGame : public TCPBase { Q_OBJECT @@ -86,16 +105,6 @@ void FromNetChat(const QString & msg); private: - enum GameType - { - gtLocal = 1, - gtQLocal = 2, - gtDemo = 3, - gtNet = 4, - gtTraining = 5, - gtCampaign = 6, - gtSave = 7, - }; char msgbuf[MAXMSGCHARS]; QString ammostr; GameUIConfig * config; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/gameuiconfig.cpp --- a/QTfrontend/gameuiconfig.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/gameuiconfig.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include #include #include +#include #include "gameuiconfig.h" #include "hwform.h" @@ -94,8 +95,8 @@ // If left blank reset the resolution to the default wWidth = (wWidth == "" ? widthStr : wWidth); wHeight = (wHeight == "" ? heightStr : wHeight); - Form->ui.pageOptions->windowWidthEdit->setText(wWidth); - Form->ui.pageOptions->windowHeightEdit->setText(wHeight); + Form->ui.pageOptions->windowWidthEdit->setValue(wWidth.toInt()); + Form->ui.pageOptions->windowHeightEdit->setValue(wHeight.toInt()); Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 1 : t); Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool()); @@ -111,7 +112,7 @@ Form->ui.pageOptions->CBFrontendMusic->setChecked(value("frontend/music", true).toBool()); Form->ui.pageOptions->SLVolume->setValue(value("audio/volume", 100).toUInt()); - QString netNick = value("net/nick", "").toString(); + QString netNick = value("net/nick", tr("Guest")+QString("%1").arg(rand())).toString(); Form->ui.pageOptions->editNetNick->setText(netNick); bool savePwd = value("net/savepassword",true).toBool(); Form->ui.pageOptions->CBSavePassword->setChecked(savePwd); @@ -156,7 +157,7 @@ { // load colors QStandardItemModel * model = DataManager::instance().colorsModel(); for(int i = model->rowCount() - 1; i >= 0; --i) - model->item(i)->setData(value(QString("colors/color%1").arg(i), model->item(i)->data())); + model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data()).toString())); } { // load binds @@ -217,12 +218,12 @@ void GameUIConfig::resizeToConfigValues() { // fill 2/3 of the screen desktop - const QRect deskSize = QApplication::desktop()->screenGeometry(-1); + const QRect deskSize = HWApplication::desktop()->screenGeometry(-1); Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(), value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt()); // move the window to the center of the screen - QPoint center = QApplication::desktop()->availableGeometry(-1).center(); + QPoint center = HWApplication::desktop()->availableGeometry(-1).center(); center.setX(center.x() - (Form->width()/2)); center.setY(center.y() - (Form->height()/2)); Form->move(center); @@ -319,7 +320,7 @@ { // save colors QStandardItemModel * model = DataManager::instance().colorsModel(); for(int i = model->rowCount() - 1; i >= 0; --i) - setValue(QString("colors/color%1").arg(i), model->item(i)->data()); + setValue(QString("colors/color%1").arg(i), model->item(i)->data().value().name()); } sync(); @@ -520,14 +521,28 @@ setValue("net/passwordhash", QString()); setValue("net/passwordlength", 0); setValue("net/savepassword", false); //changes the savepassword value to false in order to not let the user save an empty password in PAGE_SETUP - reloadValues(); //reloads the values of PAGE_SETUP + Form->ui.pageOptions->editNetPassword->setEnabled(false); + Form->ui.pageOptions->editNetPassword->setText(""); } void GameUIConfig::setPasswordHash(const QString & passwordhash) { setValue("net/passwordhash", passwordhash); - setValue("net/passwordlength", passwordhash.size()/4); - setNetPasswordLength(passwordhash.size()/4); //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW + if (passwordhash!=NULL && passwordhash.size() > 0) + { + // WTF - the whole point of "password length" was to have the dots match what they typed. This is totally pointless, and all hashes are the same length for a given hash so might as well hardcode it. + // setValue("net/passwordlength", passwordhash.size()/4); + setValue("net/passwordlength", 8); + + // More WTF + //setNetPasswordLength(passwordhash.size()/4); //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW + setNetPasswordLength(8); + } + else + { + setValue("net/passwordlength", 0); + setNetPasswordLength(0); + } } QString GameUIConfig::passwordHash() diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/gameuiconfig.h --- a/QTfrontend/gameuiconfig.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/gameuiconfig.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/hedgewars.qrc Thu Jun 13 22:27:23 2013 +0200 @@ -28,6 +28,16 @@ res/botlevels/net3.png res/botlevels/net4.png res/botlevels/net5.png + res/campaign/A Classic Fairytale/first_blood.png + res/campaign/A Classic Fairytale/shadow.png + res/campaign/A Classic Fairytale/journey.png + res/campaign/A Classic Fairytale/united.png + res/campaign/A Classic Fairytale/backstab.png + res/campaign/A Classic Fairytale/dragon.png + res/campaign/A Classic Fairytale/family.png + res/campaign/A Classic Fairytale/queen.png + res/campaign/A Classic Fairytale/enemy.png + res/campaign/A Classic Fairytale/epil.png res/bonus.png res/Hedgehog.png res/net.png @@ -133,6 +143,7 @@ res/StatsMostSelfDamage.png res/StatsSelfKilled.png res/StatsSkipped.png + res/StatsCustomAchievement.png res/Start.png res/mapRandom.png res/mapMaze.png diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/hwconsts.cpp.in Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/hwconsts.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +67,7 @@ #define SEASON_HWBDAY 4 #define SEASON_EASTER 8 +#define NETGAME_DEFAULT_SERVER "netserver.hedgewars.org" #define NETGAME_DEFAULT_PORT 46631 #define HEDGEHOGS_PER_TEAM 8 diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/hwform.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,6 +45,7 @@ #include #include #include +#include #if (QT_VERSION >= 0x040600) #include @@ -101,7 +102,7 @@ #include "DataManager.h" #include "AutoUpdater.h" -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN #define WINVER 0x0500 #include #else @@ -109,7 +110,7 @@ #include #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC #include #endif @@ -150,9 +151,9 @@ ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions()); - config = new GameUIConfig(this, "physfs://hedgewars.ini"); + config = new GameUIConfig(this, DataManager::instance().settingsFileName()); frontendEffects = config->value("frontend/effects", true).toBool(); - playerHash = QString(QCryptographicHash::hash(config->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex()); + playerHash = QString(QCryptographicHash::hash(config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(), QCryptographicHash::Md5).toHex()); ui.pageRoomsList->setSettings(config); ui.pageNetGame->setSettings(config); @@ -193,6 +194,8 @@ //connect (updateData, SIGNAL(activated()), &DataManager::instance(), SLOT(reload())); #endif + previousCampaignName = ""; + previousTeamName = ""; UpdateTeamsLists(); InitCampaignPage(); UpdateCampaignPage(0); @@ -285,6 +288,7 @@ connect(ui.pageInfo->BtnSnapshots, SIGNAL(clicked()), this, SLOT(OpenSnapshotFolder())); connect(ui.pageGameStats, SIGNAL(saveDemoRequested()), this, SLOT(saveDemoWithCustomName())); + connect(ui.pageGameStats, SIGNAL(restartGameRequested()), this, SLOT(restartGame())); connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame())); connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); @@ -304,7 +308,7 @@ connect(ui.pageCampaign->BtnStartCampaign, SIGNAL(clicked()), this, SLOT(StartCampaign())); connect(ui.pageCampaign->CBTeam, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int))); connect(ui.pageCampaign->CBCampaign, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int))); - + connect(ui.pageCampaign->CBMission, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPageMission(int))); connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()), ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first @@ -317,8 +321,6 @@ connect(ui.pageMain->BtnNetLocal, SIGNAL(clicked()), this, SLOT(GoToNet())); connect(ui.pageMain->BtnNetOfficial, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer())); - connect(ui.pageConnecting, SIGNAL(cancelConnection()), this, SLOT(GoBack())); - connect(ui.pageVideos, SIGNAL(goBack()), config, SLOT(SaveVideosOptions())); ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini"); @@ -361,7 +363,7 @@ { if(hwnet && (hwnet->clientState() != HWNewNet::Disconnected)) { - xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("netserver.hedgewars.org:%1").arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii()); + xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("%1:%2").arg(NETGAME_DEFAULT_SERVER).arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii()); switch(hwnet->clientState()) { case HWNewNet::Connecting: // Connecting @@ -470,7 +472,7 @@ if(teamslist.empty()) { - QString currentNickName = config->value("net/nick","").toString().toUtf8(); + QString currentNickName = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString().toUtf8(); QString teamName; if (currentNickName.isEmpty()) @@ -596,6 +598,10 @@ #endif qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id))); + if (lastid == ID_PAGE_MAIN) + { + ui.pageMain->resetNetworkChoice(); + } // pageEnter and pageLeave events ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave(); @@ -673,6 +679,21 @@ } } + if (id == ID_PAGE_GAMESTATS) + { + switch(lastGameType) { + case gtLocal: + case gtQLocal: + case gtTraining: + case gtCampaign: + ui.pageGameStats->restartBtnVisible(true); + break; + default: + ui.pageGameStats->restartBtnVisible(false); + break; + } + } + if (id == ID_PAGE_MAIN) { ui.pageOptions->setTeamOptionsEnabled(true); @@ -1014,7 +1035,7 @@ void HWForm::NetConnectOfficialServer() { - NetConnectServer("netserver.hedgewars.org", NETGAME_DEFAULT_PORT); + NetConnectServer(NETGAME_DEFAULT_SERVER, NETGAME_DEFAULT_PORT); } void HWForm::NetPassword(const QString & nick) @@ -1246,20 +1267,20 @@ // room status stuff connect(hwnet, SIGNAL(roomMaster(bool)), - this, SLOT(NetGameChangeStatus(bool)), Qt::QueuedConnection); + this, SLOT(NetGameChangeStatus(bool))); // net page stuff connect(hwnet, SIGNAL(roomNameUpdated(const QString &)), ui.pageNetGame, SLOT(setRoomName(const QString &)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(chatStringFromNet(const QString&)), - ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection); + connect(hwnet, SIGNAL(roomChatAction(const QString&, const QString&)), + ui.pageNetGame->chatWidget, SLOT(onChatAction(const QString&, const QString&)), Qt::QueuedConnection); + connect(hwnet, SIGNAL(roomChatMessage(const QString&, const QString&)), + ui.pageNetGame->chatWidget, SLOT(onChatMessage(const QString&, const QString&)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(chatStringFromMe(const QString&)), - ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection); connect(hwnet, SIGNAL(roomMaster(bool)), ui.pageNetGame->chatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection); connect(ui.pageNetGame->chatWidget, SIGNAL(chatLine(const QString&)), - hwnet, SLOT(chatLineToNet(const QString&))); + hwnet, SLOT(chatLineToNetWithEcho(const QString&))); connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady())); connect(hwnet, SIGNAL(setMyReadyStatus(bool)), ui.pageNetGame, SLOT(setReadyStatus(bool)), Qt::QueuedConnection); @@ -1286,25 +1307,38 @@ connect(ui.pageRoomsList->chatWidget, SIGNAL(consoleCommand(const QString&)), hwnet, SLOT(consoleCommand(const QString&))); +// player info + connect(hwnet, SIGNAL(playerInfo(const QString&, const QString&, const QString&, const QString&)), + ui.pageRoomsList->chatWidget, SLOT(onPlayerInfo(const QString&, const QString&, const QString&, const QString&)), Qt::QueuedConnection); + connect(hwnet, SIGNAL(playerInfo(const QString&, const QString&, const QString&, const QString&)), + ui.pageNetGame->chatWidget, SLOT(onPlayerInfo(const QString&, const QString&, const QString&, const QString&)), Qt::QueuedConnection); + // chatting connect(ui.pageRoomsList->chatWidget, SIGNAL(chatLine(const QString&)), hwnet, SLOT(chatLineToLobby(const QString&))); - connect(hwnet, SIGNAL(chatStringLobby(const QString&)), - ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(chatStringLobby(const QString&, const QString&)), - ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&, const QString&)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(chatStringFromMeLobby(const QString&)), - ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection); + connect(hwnet, SIGNAL(lobbyChatAction(const QString&,const QString&)), + ui.pageRoomsList->chatWidget, SLOT(onChatAction(const QString&,const QString&)), Qt::QueuedConnection); + connect(hwnet, SIGNAL(lobbyChatMessage(const QString&, const QString&)), + ui.pageRoomsList->chatWidget, SLOT(onChatMessage(const QString&, const QString&)), Qt::QueuedConnection); // nick list stuff - connect(hwnet, SIGNAL(nickAdded(const QString&, bool)), - ui.pageNetGame->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(nickRemoved(const QString&)), - ui.pageNetGame->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(nickAddedLobby(const QString&, bool)), - ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection); - connect(hwnet, SIGNAL(nickRemovedLobby(const QString&)), - ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection); + { + QSortFilterProxyModel * playersSortFilterModel = qobject_cast(hwnet->lobbyPlayersModel()); + if(playersSortFilterModel) + { + PlayersListModel * players = qobject_cast(playersSortFilterModel->sourceModel()); + connect(players, SIGNAL(nickAdded(const QString&, bool)), + ui.pageNetGame->chatWidget, SLOT(nickAdded(const QString&, bool))); + connect(players, SIGNAL(nickRemoved(const QString&)), + ui.pageNetGame->chatWidget, SLOT(nickRemoved(const QString&))); + connect(players, SIGNAL(nickAddedLobby(const QString&, bool)), + ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool))); + connect(players, SIGNAL(nickRemovedLobby(const QString&)), + ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&))); + connect(players, SIGNAL(nickRemovedLobby(const QString&, const QString&)), + ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&, const QString&))); + } + } // teams selecting stuff connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)), @@ -1342,14 +1376,15 @@ connect(ui.pageNetGame->pGameCFG, SIGNAL(paramChanged(const QString &, const QStringList &)), hwnet, SLOT(onParamChanged(const QString &, const QStringList &))); connect(hwnet, SIGNAL(configAsked()), ui.pageNetGame->pGameCFG, SLOT(fullNetConfig())); - //nick and pass stuff - QString nickname = config->value("net/nick", "").toString(); + // using proxy slot to prevent loss of game messages when they're sent to not yet connected slot of game object + connect(hwnet, SIGNAL(FromNet(const QByteArray &)), this, SLOT(FromNetProxySlot(const QByteArray &)), Qt::QueuedConnection); - hwnet->m_private_game = !(hostName == "netserver.hedgewars.org" && port == NETGAME_DEFAULT_PORT); - if (hwnet->m_private_game == false) - if (AskForNickAndPwd() != 0) - return; + //nick and pass stuff + hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT); + if (hwnet->m_private_game == false && AskForNickAndPwd() != 0) + return; + QString nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString(); ui.pageRoomsList->setUser(nickname); ui.pageNetGame->setUser(nickname); @@ -1362,16 +1397,18 @@ config->clearTempHash(); //initialize - QString hash = config->passwordHash(); - QString temphash = config->tempHash(); - QString nickname = config->value("net/nick", "").toString(); + QString hash; + QString temphash; + QString nickname; QString password; - //if something from login is missing, start dialog loop - if (nickname.isEmpty() || hash.isEmpty()) - { - while (nickname.isEmpty() || (hash.isEmpty() && temphash.isEmpty())) //while a nickname, or both hashes are missing - { + do { + nickname = config->value("net/nick",tr("Guest")+QString("%1").arg(rand())).toString(); + hash = config->passwordHash(); + temphash = config->tempHash(); + + //if something from login is missing, start dialog loop + if (nickname.isEmpty() || hash.isEmpty()) { //open dialog HWPasswordDialog * pwDialog = new HWPasswordDialog(this); // make the "new account" button dialog open a browser with the registration page @@ -1388,62 +1425,54 @@ if (pwDialog->exec() != QDialog::Accepted) { delete pwDialog; GoBack(); - return -1; + break; } //set nick and pass from the dialog nickname = pwDialog->leNickname->text(); password = pwDialog->lePassword->text(); + bool save = pwDialog->cbSave->isChecked(); + //clean up + delete pwDialog; //check the nickname variable if (nickname.isEmpty()) { int retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied.")); GoBack(); - delete pwDialog; if (retry) { if (hwnet->m_private_game) { QStringList list = hwnet->getHost().split(":"); NetConnectServer(list.at(0), list.at(1).toShort()); } else NetConnectOfficialServer(); - } - return -1; + } + break; //loop restart + } else { + //update nickname if it's fine + config->setValue("net/nick", nickname); + config->updNetNick(); } - if (!password.isEmpty()) { + //check the password variable + if (password.isEmpty()) { + config->clearPasswordHash(); + break; + } else { //calculate temphash and set it into config temphash = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Md5).toHex(); config->setTempHash(temphash); //if user wants to save password - bool save = pwDialog->cbSave->isChecked(); config->setValue("net/savepassword", save); - if (save) // user wants to save password - { + if (save) { + // user wants to save password ui.pageOptions->CBSavePassword->setChecked(true); config->setPasswordHash(temphash); } } - else { - delete pwDialog; - config->setValue("net/nick", nickname); - config->updNetNick(); - config->clearPasswordHash(); - break; - } - - delete pwDialog; + } + } while (nickname.isEmpty() || (hash.isEmpty() && temphash.isEmpty())); //while a nickname, or both hashes are missing - //update nickname - config->setValue("net/nick", nickname); - config->updNetNick(); - - //and all the variables - hash = config->passwordHash(); - temphash = config->tempHash(); - nickname = config->value("net/nick", "").toString(); - } - } return 0; } @@ -1516,7 +1545,7 @@ if (retry) { if (hwnet->m_private_game) { QStringList list = hwnet->getHost().split(":"); - NetConnectServer(list.at(0), list.at(1).toShort()); + NetConnectServer(list.at(0), list.at(1).toUInt()); } else NetConnectOfficialServer(); } @@ -1702,6 +1731,11 @@ void HWForm::CreateNetGame() { + // go back in pages to prevent user from being stuck on certain pages + if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS || + ui.Pages->currentIndex() == ID_PAGE_INGAME) + GoBack(); + QString ammo; ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData( ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() @@ -1712,7 +1746,6 @@ connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &))); - connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)), Qt::QueuedConnection); connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection); game->StartNet(); @@ -1740,9 +1773,6 @@ void HWForm::NetGameChangeStatus(bool isMaster) { - ui.pageNetGame->pGameCFG->setMaster(isMaster); - ui.pageNetGame->pNetTeamsWidget->setInteractivity(isMaster); - if (isMaster) NetGameMaster(); else @@ -1794,6 +1824,7 @@ { NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet); connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)), netAmmo, SLOT(setNetSchemeConfig(QStringList &))); + ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo); ui.pageNetGame->setRoomName(hwnet->getRoom()); @@ -1806,6 +1837,13 @@ ui.pageNetGame->setMasterMode(false); } +void HWForm::FromNetProxySlot(const QByteArray & msg) +{ + if(game) + game->FromNet(msg); + +} + void HWForm::selectFirstNetScheme() { ui.pageNetGame->pGameCFG->GameSchemes->setCurrentIndex(0); @@ -1866,10 +1904,72 @@ unsigned int n = missionEntries.count(); unsigned int m = getCampProgress(tName, campaignName); + // if the campaign name changes update the campaignMissionDescriptions list + // this will be used later in UpdateCampaignPageMission() to update + // the mission description in the campaign page + bool updateMissionList = false; + QSettings * m_info; + if(previousCampaignName.compare(campaignName)!=0 || + previousTeamName.compare(tName) != 0) + { + if (previousTeamName.compare(tName) != 0 && + previousTeamName.compare("") != 0) + index = qMin(m + 1, n); + previousCampaignName = campaignName; + previousTeamName = tName; + updateMissionList = true; + // the following code was based on pagetraining.cpp + DataManager & dataMgr = DataManager::instance(); + // get locale + QSettings settings(dataMgr.settingsFileName(), + QSettings::IniFormat); + QString loc = settings.value("misc/locale", "").toString(); + if (loc.isEmpty()) + loc = QLocale::system().name(); + QString campaignDescFile = QString("physfs://Locale/campaigns_" + loc + ".txt"); + // if file is non-existant try with language only + if (!QFile::exists(campaignDescFile)) + campaignDescFile = QString("physfs://Locale/campaigns_" + loc.remove(QRegExp("_.*$")) + ".txt"); + + // fallback if file for current locale is non-existant + if (!QFile::exists(campaignDescFile)) + campaignDescFile = QString("physfs://Locale/campaigns_en.txt"); + + m_info = new QSettings(campaignDescFile, QSettings::IniFormat, this); + m_info->setIniCodec("UTF-8"); + campaignMissionDescriptions.clear(); + ui.pageCampaign->CBMission->clear(); + } + for (unsigned int i = qMin(m + 1, n); i > 0; i--) { + if(updateMissionList) + { + campaignMissionDescriptions += m_info->value(campaignName+"-"+ getCampaignMissionName(campaignName,i) + ".desc", + tr("No description available")).toString(); + } ui.pageCampaign->CBMission->addItem(QString("Mission %1: ").arg(i) + QString(missionEntries[i-1]), QString(missionEntries[i-1])); } + if(updateMissionList) + delete m_info; + + UpdateCampaignPageMission(index); +} + +void HWForm::UpdateCampaignPageMission(int index) +{ + // update thumbnail + QString campaignName = ui.pageCampaign->CBCampaign->currentText(); + unsigned int mNum = ui.pageCampaign->CBMission->count() - ui.pageCampaign->CBMission->currentIndex(); + QString image = getCampaignImage(campaignName,mNum); + ui.pageCampaign->btnPreview->setIcon(QIcon((":/res/campaign/"+campaignName+"/"+image))); + // update description + // when campaign changes the UpdateCampaignPageMission is triggered with wrong values + // this will cause segfault. This check prevents illegal memory reads + if(index > -1 && index < campaignMissionDescriptions.count()) { + ui.pageCampaign->lbltitle->setText("

"+ui.pageCampaign->CBMission->currentText()+"

"); + ui.pageCampaign->lbldescription->setText(campaignMissionDescriptions[index]); + } } void HWForm::UpdateCampaignPageProgress(int index) @@ -1887,7 +1987,7 @@ QString prefix = "\"" + datadir->absolutePath() + "\""; QString userPrefix = "\"" + cfgdir->absolutePath() + "\""; -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN prefix = prefix.replace("/","\\"); userPrefix = userPrefix.replace("/","\\"); #endif @@ -1928,7 +2028,7 @@ registry_hkcr.setValue("Hedgewars.Save/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hwengine.exe\" " + arguments + " %1"); // custom url scheme(s) - registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Protocol\""); + registry_hkcr.setValue("hwplay/Default", "\"URL:Hedgewars ServerAccess Scheme\""); registry_hkcr.setValue("hwplay/URL Protocol", ""); registry_hkcr.setValue("hwplay/DefaultIcon/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\",0"); registry_hkcr.setValue("hwplay/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe\" %1"); @@ -1947,8 +2047,10 @@ if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share"); if (success) success = checkForDir(QDir::home().absolutePath() + "/.local/share/applications"); if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars-mimeinfo.xml "+QDir::home().absolutePath()+"/.local/share/mime/packages").toLocal8Bit().constData())==0; + if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hedgewars.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0; if (success) success = system(("cp "+datadir->absolutePath()+"/misc/hwengine.desktop "+QDir::home().absolutePath()+"/.local/share/applications").toLocal8Bit().constData())==0; if (success) success = system(("update-mime-database "+QDir::home().absolutePath()+"/.local/share/mime").toLocal8Bit().constData())==0; + if (success) success = system("xdg-mime default hedgewars.desktop x-scheme-handler/hwplay")==0; if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-demo")==0; if (success) success = system("xdg-mime default hwengine.desktop application/x-hedgewars-save")==0; // hack to add user's settings to hwengine. might be better at this point to read in the file, append it, and write it out to its new home. This assumes no spaces in the data dir path @@ -2000,6 +2102,31 @@ } } +void HWForm::restartGame() +{ + // get rid off old game stats page + if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS) + GoBack(); + + CreateGame(lastGameCfg, lastGameTeamSel, lastGameAmmo); + + switch(lastGameType) { + case gtTraining: + game->StartTraining(lastGameStartArgs.at(0).toString()); + break; + case gtQLocal: + game->StartQuick(); + break; + case gtCampaign: + game->StartCampaign(lastGameStartArgs.at(0).toString(), lastGameStartArgs.at(1).toString(), lastGameStartArgs.at(2).toString()); + break; + case gtLocal: + game->StartLocal(); + break; + default: + break; + } +} void HWForm::ShowErrorMessage(const QString & msg) { @@ -2008,8 +2135,22 @@ void HWForm::showFeedbackDialog() { - FeedbackDialog dialog(this); - dialog.exec(); + QNetworkRequest newRequest(QUrl("http://www.hedgewars.org")); + + QNetworkAccessManager *manager = new QNetworkAccessManager(this); + QNetworkReply *reply = manager->get(newRequest); + connect(reply, SIGNAL(finished()), this, SLOT(showFeedbackDialogNetChecked())); +} + +void HWForm::showFeedbackDialogNetChecked() +{ + QNetworkReply *reply = qobject_cast(sender()); + + if (reply && (reply->error() == QNetworkReply::NoError)) { + FeedbackDialog dialog(this); + dialog.exec(); + } else + MessageDialog::ShowErrorMessage(tr("This page requires an internet connection."), this); } void HWForm::startGame() diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/hwform.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,8 +127,10 @@ void Music(bool checked); void UpdateCampaignPage(int index); void UpdateCampaignPageProgress(int index); + void UpdateCampaignPageMission(int index); void InitCampaignPage(); void showFeedbackDialog(); + void showFeedbackDialogNetChecked(); void NetGameChangeStatus(bool isMaster); void NetGameMaster(); @@ -142,6 +144,9 @@ void openRegistrationPage(); void startGame(); + void restartGame(); + + void FromNetProxySlot(const QByteArray &); private: void _NetConnect(const QString & hostName, quint16 port, QString nick); @@ -188,6 +193,9 @@ HWNamegen * namegen; AmmoSchemeModel * ammoSchemeModel; QStack PagesStack; + QString previousCampaignName; + QString previousTeamName; + QStringList campaignMissionDescriptions; QTime eggTimer; BGWidget * wBackground; QSignalMapper * pageSwitchMapper; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/main.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -36,6 +35,7 @@ #include "DataManager.h" #include "FileEngine.h" +#include "MessageDialog.h" #ifdef _WIN32 #include @@ -99,12 +99,7 @@ if (!tmpdir.exists()) if (!tmpdir.mkpath(dir)) { - QMessageBox directoryMsg(QApplication::activeWindow()); - directoryMsg.setIcon(QMessageBox::Warning); - directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error")); - directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir)); - directoryMsg.setWindowModality(Qt::WindowModal); - directoryMsg.exec(); + MessageDialog::ShowErrorMessage(HWApplication::tr("Cannot create directory %1").arg(dir)); return false; } return true; @@ -140,11 +135,11 @@ HWApplication app(argc, argv); QLabel *splash = NULL; -#if defined Q_WS_WIN +#if defined Q_OS_WIN QPixmap pixmap(":res/splash.png"); splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); splash->setAttribute(Qt::WA_TranslucentBackground); - const QRect deskSize = QApplication::desktop()->screenGeometry(-1); + const QRect deskSize = HWApplication::desktop()->screenGeometry(-1); QPoint splashCenter = QPoint( (deskSize.width() - pixmap.width())/2, (deskSize.height() - pixmap.height())/2 ); splash->move(splashCenter); @@ -253,16 +248,9 @@ datadir->cd(bindir->absolutePath()); datadir->cd(*cDataDir); - if(!datadir->cd("Data")) + if (!datadir->cd("Data")) { - QMessageBox missingMsg(QApplication::activeWindow()); - missingMsg.setIcon(QMessageBox::Critical); - missingMsg.setWindowTitle(QMessageBox::tr("Main - Error")); - missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n" - "Please check your installation!"). - arg(datadir->absolutePath()+"/Data")); - missingMsg.setWindowModality(Qt::WindowModal); - missingMsg.exec(); + MessageDialog::ShowFatalMessage(HWApplication::tr("Failed to open data directory:\n%1\n\nPlease check your installation!").arg(datadir->absolutePath()+"/Data")); return 1; } @@ -273,18 +261,24 @@ engine->setWriteDir(cfgdir->absolutePath()); engine->mountPacks(); - DataManager::ensureFileExists("physfs://hedgewars.ini"); - QTranslator Translator; { - QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat); + QSettings settings(DataManager::instance().settingsFileName(), QSettings::IniFormat); + settings.setIniCodec("UTF-8"); + QString cc = settings.value("misc/locale", QString()).toString(); - if(cc.isEmpty()) + if (cc.isEmpty()) + { cc = QLocale::system().name(); + // Fallback to current input locale if "C" locale is returned + if(cc == "C") + cc = HWApplication::keyboardInputLocale().name(); + } + // load locale file into translator - if(!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) - qWarning("Failed to install translation"); + if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) + qWarning("Failed to install translation (%s)", qPrintable(cc)); app.installTranslator(&Translator); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/GameStyleModel.cpp --- a/QTfrontend/model/GameStyleModel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/GameStyleModel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/GameStyleModel.h --- a/QTfrontend/model/GameStyleModel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/GameStyleModel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/HatModel.cpp --- a/QTfrontend/model/HatModel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/HatModel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/HatModel.h --- a/QTfrontend/model/HatModel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/HatModel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/MapModel.cpp --- a/QTfrontend/model/MapModel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/MapModel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/MapModel.h --- a/QTfrontend/model/MapModel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/MapModel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ThemeModel.cpp --- a/QTfrontend/model/ThemeModel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/ThemeModel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ThemeModel.h --- a/QTfrontend/model/ThemeModel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/ThemeModel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ammoSchemeModel.cpp --- a/QTfrontend/model/ammoSchemeModel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/ammoSchemeModel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -194,7 +194,7 @@ << QVariant(false) // place hog 14 << QVariant(true) // shared ammo 15 << QVariant(true) // disable girders 16 - << QVariant(false) // disable land objects 17 + << QVariant(true) // disable land objects 17 << QVariant(false) // AI survival 18 << QVariant(false) // inf. attack 19 << QVariant(true) // reset weps 20 @@ -407,7 +407,7 @@ << QVariant(true) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 - << QVariant(true) // low gravity 5 + << QVariant(false) // low gravity 5 << QVariant(false) // laser sight 6 << QVariant(false) // invulnerable 7 << QVariant(false) // reset health 8 diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/ammoSchemeModel.h --- a/QTfrontend/model/ammoSchemeModel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/ammoSchemeModel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/netserverslist.cpp --- a/QTfrontend/model/netserverslist.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/netserverslist.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/netserverslist.h --- a/QTfrontend/model/netserverslist.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/netserverslist.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/playerslistmodel.cpp --- a/QTfrontend/model/playerslistmodel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/playerslistmodel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -84,7 +84,7 @@ } -void PlayersListModel::addPlayer(const QString & nickname) +void PlayersListModel::addPlayer(const QString & nickname, bool notify) { insertRow(rowCount()); @@ -92,11 +92,18 @@ setData(mi, nickname); checkFriendIgnore(mi); + + emit nickAddedLobby(nickname, notify); } -void PlayersListModel::removePlayer(const QString & nickname) +void PlayersListModel::removePlayer(const QString & nickname, const QString &msg) { + if(msg.isEmpty()) + emit nickRemovedLobby(nickname); + else + emit nickRemovedLobby(nickname, msg); + QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly); if(mil.size()) @@ -104,7 +111,7 @@ } -void PlayersListModel::playerJoinedRoom(const QString & nickname) +void PlayersListModel::playerJoinedRoom(const QString & nickname, bool notify) { QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly); @@ -114,11 +121,15 @@ updateIcon(mil[0]); updateSortData(mil[0]); } + + emit nickAdded(nickname, notify); } void PlayersListModel::playerLeftRoom(const QString & nickname) { + emit nickRemoved(nickname); + QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly); if(mil.size()) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/playerslistmodel.h --- a/QTfrontend/model/playerslistmodel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/playerslistmodel.h Thu Jun 13 22:27:23 2013 +0200 @@ -41,13 +41,20 @@ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); public slots: - void addPlayer(const QString & nickname); - void removePlayer(const QString & nickname); - void playerJoinedRoom(const QString & nickname); + void addPlayer(const QString & nickname, bool notify); + void removePlayer(const QString & nickname, const QString & msg = QString()); + void playerJoinedRoom(const QString & nickname, bool notify); void playerLeftRoom(const QString & nickname); void resetRoomFlags(); void setNickname(const QString & nickname); +signals: + void nickAdded(const QString& nick, bool notifyNick); + void nickRemoved(const QString& nick); + void nickAddedLobby(const QString& nick, bool notifyNick); + void nickRemovedLobby(const QString& nick); + void nickRemovedLobby(const QString& nick, const QString& message); + private: QHash & m_icons(); typedef QHash DataEntry; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/roomslistmodel.cpp --- a/QTfrontend/model/roomslistmodel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/roomslistmodel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/model/roomslistmodel.h --- a/QTfrontend/model/roomslistmodel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/model/roomslistmodel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/hwmap.cpp --- a/QTfrontend/net/hwmap.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/hwmap.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Ulyanov Igor - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/hwmap.h --- a/QTfrontend/net/hwmap.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/hwmap.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netregister.cpp --- a/QTfrontend/net/netregister.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netregister.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netregister.h --- a/QTfrontend/net/netregister.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netregister.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netserver.cpp --- a/QTfrontend/net/netserver.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netserver.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netserver.h --- a/QTfrontend/net/netserver.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netserver.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpserver.cpp --- a/QTfrontend/net/netudpserver.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netudpserver.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpserver.h --- a/QTfrontend/net/netudpserver.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netudpserver.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpwidget.cpp --- a/QTfrontend/net/netudpwidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netudpwidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/netudpwidget.h --- a/QTfrontend/net/netudpwidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/netudpwidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/newnetclient.cpp --- a/QTfrontend/net/newnetclient.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/newnetclient.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -336,10 +336,24 @@ qWarning("Net: Empty CHAT message"); return; } + + QString action = HWProto::chatStringToAction(lst[2]); + if (netClientState == InLobby) - emit chatStringLobby(lst[1], HWProto::formatChatMsgForFrontend(lst[2])); + { + if (action != NULL) + emit lobbyChatAction(lst[1], action); + else + emit lobbyChatMessage(lst[1], lst[2]); + } else + { emit chatStringFromNet(HWProto::formatChatMsg(lst[1], lst[2])); + if (action != NULL) + emit roomChatAction(lst[1], action); + else + emit roomChatMessage(lst[1], lst[2]); + } return; } @@ -350,12 +364,13 @@ qWarning("Net: Malformed INFO message"); return; } - QStringList tmp = lst; - tmp.removeFirst(); - if (netClientState == InLobby) - emit chatStringLobby(tmp.join("\n").prepend('\x01')); - else - emit chatStringFromNet(tmp.join("\n").prepend('\x01')); + emit playerInfo(lst[1], lst[2], lst[3], lst[4]); + if (netClientState != InLobby) + { + QStringList tmp = lst; + tmp.removeFirst(); + emit chatStringFromNet(tmp.join(" ").prepend('\x01')); + } return; } @@ -410,8 +425,7 @@ { if (nick == mynick) { - if (isChief && !setFlag) ToggleReady(); - else emit setMyReadyStatus(setFlag); + emit setMyReadyStatus(setFlag); } m_playersModel->setFlag(nick, PlayersListModel::Ready, setFlag); } @@ -490,9 +504,7 @@ emit connected(); } - m_playersModel->addPlayer(lst[i]); - emit nickAddedLobby(lst[i], false); - emit chatStringLobby(lst[i], tr("%1 *** %2 has joined").arg('\x03').arg("|nick|")); + m_playersModel->addPlayer(lst[i], false); } return; } @@ -539,13 +551,11 @@ qWarning("Net: Bad LOBBY:LEFT message"); return; } - emit nickRemovedLobby(lst[1]); + if (lst.size() < 3) - emit chatStringLobby(tr("%1 *** %2 has left").arg('\x03').arg(lst[1])); + m_playersModel->removePlayer(lst[1]); else - emit chatStringLobby(lst[1], tr("%1 *** %2 has left (%3)").arg('\x03').arg("|nick|", lst[2])); - - m_playersModel->removePlayer(lst[1]); + m_playersModel->removePlayer(lst[1], lst[2]); return; } @@ -636,8 +646,8 @@ emit configAsked(); } - m_playersModel->playerJoinedRoom(lst[i]); - emit nickAdded(lst[i], isChief && (lst[i] != mynick)); + m_playersModel->playerJoinedRoom(lst[i], isChief && (lst[i] != mynick)); + emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i])); } return; @@ -769,9 +779,8 @@ for(int i = 1; i < lst.size(); ++i) { - emit nickAdded(lst[i], isChief && (lst[i] != mynick)); emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i])); - m_playersModel->playerJoinedRoom(lst[i]); + m_playersModel->playerJoinedRoom(lst[i], isChief && (lst[i] != mynick)); } return; } @@ -783,7 +792,7 @@ qWarning("Net: Bad LEFT message"); return; } - emit nickRemoved(lst[1]); + if (lst.size() < 3) emit chatStringFromNet(tr("%1 *** %2 has left").arg('\x03').arg(lst[1])); else @@ -836,12 +845,25 @@ ); } +void HWNewNet::chatLineToNetWithEcho(const QString& str) +{ + if(str != "") + { + emit chatStringFromNet(HWProto::formatChatMsg(mynick, str)); + chatLineToNet(str); + } +} + void HWNewNet::chatLineToNet(const QString& str) { if(str != "") { RawSendNet(QString("CHAT") + delimeter + str); - emit(chatStringFromMe(HWProto::formatChatMsg(mynick, str))); + QString action = HWProto::chatStringToAction(str); + if (action != NULL) + emit(roomChatAction(mynick, action)); + else + emit(roomChatMessage(mynick, str)); } } @@ -850,7 +872,11 @@ if(str != "") { RawSendNet(QString("CHAT") + delimeter + str); - emit chatStringLobby(mynick, HWProto::formatChatMsgForFrontend(str)); + QString action = HWProto::chatStringToAction(str); + if (action != NULL) + emit(lobbyChatAction(mynick, action)); + else + emit(lobbyChatMessage(mynick, str)); } } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/newnetclient.h --- a/QTfrontend/net/newnetclient.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/newnetclient.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,10 +99,6 @@ void AuthFailed(); void EnteredGame(); void LeftRoom(const QString & reason); - void nickAdded(const QString& nick, bool notifyNick); - void nickRemoved(const QString& nick); - void nickAddedLobby(const QString& nick, bool notifyNick); - void nickRemovedLobby(const QString& nick); void FromNet(const QByteArray & buf); void adminAccess(bool); void roomMaster(bool); @@ -117,11 +113,16 @@ void RemoveNetTeam(const HWTeam&); void hhnumChanged(const HWTeam&); void teamColorChanged(const HWTeam&); - void chatStringLobby(const QString&); - void chatStringLobby(const QString&, const QString&); + void playerInfo( + const QString & nick, + const QString & ip, + const QString & version, + const QString & roomInfo); + void lobbyChatMessage(const QString & nick, const QString & message); + void lobbyChatAction(const QString & nick, const QString & action); + void roomChatMessage(const QString & nick, const QString & message); + void roomChatAction(const QString & nick, const QString & action); void chatStringFromNet(const QString&); - void chatStringFromMe(const QString&); - void chatStringFromMeLobby(const QString&); void roomsList(const QStringList&); void serverMessage(const QString &); @@ -137,6 +138,7 @@ public slots: void ToggleReady(); void chatLineToNet(const QString& str); + void chatLineToNetWithEcho(const QString&); void chatLineToLobby(const QString& str); void SendTeamMessage(const QString& str); void SendNet(const QByteArray & buf); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/proto.cpp --- a/QTfrontend/net/proto.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/proto.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,11 +45,6 @@ return buf; } -QString HWProto::formatChatMsgForFrontend(const QString & msg) -{ - return formatChatMsg("|nick|", msg); -} - QString HWProto::formatChatMsg(const QString & nick, const QString & msg) { if(msg.left(4) == "/me ") @@ -57,3 +52,11 @@ else return QString("\x01%1: %2").arg(nick).arg(msg); } + +QString HWProto::chatStringToAction(const QString & string) +{ + if(string.left(4) == "/me ") + return string.mid(4); + else + return NULL; +} diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/proto.h --- a/QTfrontend/net/proto.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/proto.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,12 @@ static QByteArray & addStringListToBuffer(QByteArray & buf, const QStringList & strList); static QString formatChatMsg(const QString & nick, const QString & msg); static QString formatChatMsgForFrontend(const QString & msg); + /** + * @brief Determines if a chat string represents a chat action and returns the action. + * @param string chat string + * @return the action-message or NULL if message is no action + */ + static QString chatStringToAction(const QString & string); }; #endif // _PROTO_H diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/recorder.cpp --- a/QTfrontend/net/recorder.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/recorder.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/recorder.h --- a/QTfrontend/net/recorder.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/recorder.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/tcpBase.cpp --- a/QTfrontend/net/tcpBase.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/tcpBase.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,13 +19,12 @@ #include "tcpBase.h" -#include #include -#include #include #include #include "hwconsts.h" +#include "MessageDialog.h" #ifdef HWLIBRARY extern "C" void Game(char**arguments); @@ -89,13 +88,7 @@ IPCServer->setMaxPendingConnections(1); if (!IPCServer->listen(QHostAddress::LocalHost)) { - QMessageBox deniedMsg(QApplication::activeWindow()); - deniedMsg.setIcon(QMessageBox::Critical); - deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error")); - deniedMsg.setText(QMessageBox::tr("Unable to start the server: %1.").arg(IPCServer->errorString())); - deniedMsg.setWindowModality(Qt::WindowModal); - deniedMsg.exec(); - + MessageDialog::ShowFatalMessage(tr("Unable to start server at %1.").arg(IPCServer->errorString())); exit(0); // FIXME - should be graceful exit here (lower Critical -> Warning above when implemented) } } @@ -141,7 +134,7 @@ connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError))); QStringList arguments=getArguments(); -#ifdef DEBUG +#ifdef QT_DEBUG // redirect everything written on stdout/stderr process->setProcessChannelMode(QProcess::ForwardedChannels); #endif @@ -172,14 +165,7 @@ void TCPBase::StartProcessError(QProcess::ProcessError error) { - QMessageBox deniedMsg(QApplication::activeWindow()); - deniedMsg.setIcon(QMessageBox::Critical); - deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error")); - deniedMsg.setText(QMessageBox::tr("Unable to run engine at ") + bindir->absolutePath() + "/hwengine\n" + - QMessageBox::tr("Error code: %1").arg(error)); - deniedMsg.setWindowModality(Qt::WindowModal); - deniedMsg.exec(); - + MessageDialog::ShowFatalMessage(tr("Unable to run engine at %1\nError code: %2").arg(bindir->absolutePath() + "/hwengine").arg(error)); ClientDisconnect(); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/net/tcpBase.h --- a/QTfrontend/net/tcpBase.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/net/tcpBase.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/Hedgehog.png Binary file QTfrontend/res/Hedgehog.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/StatsCustomAchievement.png Binary file QTfrontend/res/StatsCustomAchievement.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/backstab.png Binary file QTfrontend/res/campaign/A Classic Fairytale/backstab.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/dragon.png Binary file QTfrontend/res/campaign/A Classic Fairytale/dragon.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/enemy.png Binary file QTfrontend/res/campaign/A Classic Fairytale/enemy.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/epil.png Binary file QTfrontend/res/campaign/A Classic Fairytale/epil.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/family.png Binary file QTfrontend/res/campaign/A Classic Fairytale/family.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/first_blood.png Binary file QTfrontend/res/campaign/A Classic Fairytale/first_blood.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/journey.png Binary file QTfrontend/res/campaign/A Classic Fairytale/journey.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/queen.png Binary file QTfrontend/res/campaign/A Classic Fairytale/queen.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/shadow.png Binary file QTfrontend/res/campaign/A Classic Fairytale/shadow.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/campaign/A Classic Fairytale/united.png Binary file QTfrontend/res/campaign/A Classic Fairytale/united.png has changed diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/css/chat.css --- a/QTfrontend/res/css/chat.css Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/res/css/chat.css Thu Jun 13 22:27:23 2013 +0200 @@ -61,15 +61,20 @@ .msg_FriendChat .nick { color: #30ff30; } .msg_UserJoin { color: #c0c0c0; } .msg_UserJoin .nick { color: #d0d0d0; } +.msg_UserLeave { color: #b8b8b8; } +.msg_UserLeave .nick { color: #c8c8c8; } .msg_FriendJoin { font-weight: bold; color: #c0f0c0; } .msg_FriendJoin .nick { color: #d8f0d8; } +.msg_FriendLeave { font-weight: bold; color: #ffe090; } +.msg_FriendLeave .nick { color: #f8e878; } .msg_UserAction { color: #ff80ff; } .msg_UserAction .nick { color: #ffa0ff;} .msg_FriendAction { color: #ff00ff; } .msg_FriendAction .nick { color: #ff30ff; } -/* uncomment next line to disable join and leave messages of non-friends */ +/* uncomment next lines to disable join and leave messages of non-friends */ /* .msg_UserJoin { display:none; } */ +/* .msg_UserLeave { display:none; } */ /* timestamps */ .timestamp { diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/css/qt.css --- a/QTfrontend/res/css/qt.css Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/res/css/qt.css Thu Jun 13 22:27:23 2013 +0200 @@ -179,6 +179,7 @@ QComboBox { border-radius: 10px; padding: 3px; +height: 18px; } QComboBox:pressed{ border-color: white; @@ -326,4 +327,8 @@ TeamSelWidget, #gameStackContainer, #GBoxOptions { border-radius: 10px; -} \ No newline at end of file +} + +PageMultiplayer TeamSelWidget { +min-height: 500px; +} diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/html/about.html --- a/QTfrontend/res/html/about.html Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/res/html/about.html Thu Jun 13 22:27:23 2013 +0200 @@ -34,6 +34,7 @@ Campaign support, first campaign: Szabolcs Orbàn <szabibibi@gmail.com>
Keybinds, feedback, maps and hats interfaces: Drew Gottlieb <gottlieb.drew@gmail.com>
Login dialogs, frontend improvements: Ondrej Skopek <skopekondrej@gmail.com>
+ Icegun weapon: Julia Struchenko <urbertar@gmail.com>

Art:

@@ -72,11 +73,11 @@ Chinese: Jie Luo <lililjlj@gmail.com>
English: Andrey Korotaev <unC0Rr@gmail.com>
Finnish: Nina Kuisma <ninnnu@gmail.com>
- French: Antoine Turmel <geekshadow@gmail.com>, Clement Woitrain <sphrixclement@gmail.com>
+ French: Antoine Turmel <geekshadow@gmail.com>, Clement Woitrain <sphrixclement@gmail.com>, Matisumi
German: Peter Hüwe <PeterHuewe@gmx.de>, Mario Liebisch <mario.liebisch@gmail.com>, Richard Karolyi <sheepluva@ercatec.net>
Greek: <talos_kriti@yahoo.gr>
- Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani
- Japanese: ADAM Etienne <etienne.adam@gmail.com>
+ Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani <m.bresciani@email.it>
+ Japanese: ADAM Etienne <etienne.adam@gmail.com>, Marco Bresciani <m.bresciani@email.it>, 梅津洋恵
Korean: Anthony Bellew <anthonyreflected@gmail.com>
Lithuanian: Lukas Urbonas <lukasu08@gmail.com>
Polish: Maciej Mroziński <mynick2@o2.pl>, Wojciech Latkowski <magik17l@gmail.com>, Piotr Mitana, Maciej Górny
diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/res/xml/tips.xml --- a/QTfrontend/res/xml/tips.xml Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/res/xml/tips.xml Thu Jun 13 22:27:23 2013 +0200 @@ -46,6 +46,7 @@ Like Hedgewars? Become a fan on Facebook or follow us on Twitter Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online. Keep your video card drivers up to date to avoid issues playing the game. + Heads or tails? Type '/rnd' in lobby and you'll find out. Also '/rnd rock paper scissors' works! You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser. The version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing. diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/sdlkeys.h --- a/QTfrontend/sdlkeys.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/sdlkeys.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/team.cpp --- a/QTfrontend/team.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/team.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/team.h --- a/QTfrontend/team.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/team.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * Copyright (c) 2007 Igor Ulyanov * * This program is free software; you can redistribute it and/or modify diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/ask_quit.cpp --- a/QTfrontend/ui/dialog/ask_quit.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/ask_quit.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/ask_quit.h --- a/QTfrontend/ui/dialog/ask_quit.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/ask_quit.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_ip.cpp --- a/QTfrontend/ui/dialog/input_ip.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/input_ip.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_ip.h --- a/QTfrontend/ui/dialog/input_ip.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/input_ip.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_password.cpp --- a/QTfrontend/ui/dialog/input_password.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/input_password.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,18 +29,14 @@ { setWindowTitle(tr("Login")); - QString titleLabelText = "To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname."; - QString nickLabelText = "Nickname:"; - QString passLabelText = "Password:"; - QGridLayout * layout = new QGridLayout(this); QLabel * titleLabel = new QLabel(this); - titleLabel->setText(titleLabelText); + titleLabel->setText(tr("To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname.")); layout->addWidget(titleLabel, 0, 0); QLabel * nickLabel = new QLabel(this); - nickLabel->setText(nickLabelText); + nickLabel->setText(tr("Nickname:")); layout->addWidget(nickLabel, 1, 0); leNickname = new QLineEdit(this); @@ -48,7 +44,7 @@ layout->addWidget(leNickname, 2, 0); QLabel * passLabel = new QLabel(this); - passLabel->setText(passLabelText); + passLabel->setText(tr("Password:")); layout->addWidget(passLabel, 3, 0); lePassword = new QLineEdit(this); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/input_password.h --- a/QTfrontend/ui/dialog/input_password.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/input_password.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/upload_video.cpp --- a/QTfrontend/ui/dialog/upload_video.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/upload_video.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/dialog/upload_video.h --- a/QTfrontend/ui/dialog/upload_video.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/dialog/upload_video.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/mouseoverfilter.cpp --- a/QTfrontend/ui/mouseoverfilter.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/mouseoverfilter.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -35,7 +35,6 @@ } else if (event->type() == QEvent::FocusIn) { - QWidget * widget = dynamic_cast(dist); abstractpage = qobject_cast(ui->Pages->currentWidget()); // play a sound when mouse hovers certain ui elements diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/AbstractPage.cpp --- a/QTfrontend/ui/page/AbstractPage.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/AbstractPage.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/AbstractPage.h --- a/QTfrontend/ui/page/AbstractPage.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/AbstractPage.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageadmin.cpp --- a/QTfrontend/ui/page/pageadmin.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageadmin.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageadmin.h --- a/QTfrontend/ui/page/pageadmin.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageadmin.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagecampaign.cpp --- a/QTfrontend/ui/page/pagecampaign.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagecampaign.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ #include #include #include +#include #include "pagecampaign.h" @@ -31,18 +32,43 @@ pageLayout->setRowStretch(0, 1); pageLayout->setRowStretch(3, 1); + QGridLayout * infoLayout = new QGridLayout(); + infoLayout->setColumnStretch(0, 1); + infoLayout->setColumnStretch(1, 1); + infoLayout->setColumnStretch(2, 1); + infoLayout->setColumnStretch(3, 1); + infoLayout->setColumnStretch(4, 1); + infoLayout->setRowStretch(0, 1); + infoLayout->setRowStretch(1, 1); + + // set this as default image first time page is created, this will change in hwform.cpp + btnPreview = formattedButton(":/res/campaign/A Classic Fairytale/first_blood.png", true); + infoLayout->setAlignment(btnPreview, Qt::AlignHCenter | Qt::AlignVCenter); + + lbldescription = new QLabel(); + lbldescription->setAlignment(Qt::AlignHCenter| Qt::AlignTop); + lbldescription->setWordWrap(true); + + lbltitle = new QLabel(); + lbltitle->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); + CBTeam = new QComboBox(this); CBMission = new QComboBox(this); CBCampaign = new QComboBox(this); - pageLayout->addWidget(CBTeam, 1, 1); - pageLayout->addWidget(CBCampaign, 2, 1); - pageLayout->addWidget(CBMission, 3, 1); + infoLayout->addWidget(btnPreview,0,1,2,1); + infoLayout->addWidget(lbltitle,0,2,1,2); + infoLayout->addWidget(lbldescription,1,2,1,2); + + pageLayout->addLayout(infoLayout, 0, 0, 2, 3); + pageLayout->addWidget(CBTeam, 2, 1); + pageLayout->addWidget(CBCampaign, 3, 1); + pageLayout->addWidget(CBMission, 4, 1); BtnStartCampaign = new QPushButton(this); BtnStartCampaign->setFont(*font14); BtnStartCampaign->setText(QPushButton::tr("Go!")); - pageLayout->addWidget(BtnStartCampaign, 2, 2); + pageLayout->addWidget(BtnStartCampaign, 3, 2); return pageLayout; } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagecampaign.h --- a/QTfrontend/ui/page/pagecampaign.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagecampaign.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,10 @@ public: PageCampaign(QWidget* parent = 0); + QPushButton *btnPreview; QPushButton *BtnStartCampaign; + QLabel *lbldescription; + QLabel *lbltitle; QComboBox *CBMission; QComboBox *CBCampaign; QComboBox *CBTeam; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageconnecting.cpp --- a/QTfrontend/ui/page/pageconnecting.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageconnecting.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageconnecting.h --- a/QTfrontend/ui/page/pageconnecting.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageconnecting.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagedata.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,7 +60,10 @@ web->setOpenLinks(false); // fetchList(); - + web->setHtml(QString( + "

Hedgewars Downloadable Content



" + "%1
") + .arg(tr("Loading, please wait."))); m_contentDownloaded = false; } @@ -106,8 +109,7 @@ { QNetworkReply * reply = qobject_cast(sender()); - if(reply) - { + if (reply && (reply->error() == QNetworkReply::NoError)) { QString html = QString::fromUtf8(reply->readAll()); int begin = html.indexOf(""); int end = html.indexOf(""); @@ -117,7 +119,11 @@ html.remove(0, begin); } web->setHtml(html); - } + } else + web->setHtml(QString( + "

Hedgewars Downloadable Content



" + "

%1

") + .arg(tr("This page requires an internet connection."))); } void PageDataDownload::fileDownloaded() diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedata.h --- a/QTfrontend/ui/page/pagedata.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagedata.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedrawmap.cpp --- a/QTfrontend/ui/page/pagedrawmap.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagedrawmap.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagedrawmap.h --- a/QTfrontend/ui/page/pagedrawmap.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagedrawmap.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageeditteam.cpp --- a/QTfrontend/ui/page/pageeditteam.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageeditteam.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -320,7 +320,7 @@ ); if (!list.isEmpty()) - SDLInteraction::instance().playSoundFile("physfs://" + voiceDir + "/" + + SDLInteraction::instance().playSoundFile("/" + voiceDir + "/" + list[rand() % list.size()]); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageeditteam.h --- a/QTfrontend/ui/page/pageeditteam.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageeditteam.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagegamestats.cpp --- a/QTfrontend/ui/page/pagegamestats.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagegamestats.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,10 +40,15 @@ QLayout * PageGameStats::bodyLayoutDefinition() { + kindOfPoints = QString(""); + defaultGraphTitle = true; QGridLayout * pageLayout = new QGridLayout(); pageLayout->setSpacing(20); pageLayout->setColumnStretch(0, 1); pageLayout->setColumnStretch(1, 1); + pageLayout->setRowStretch(0, 1); + pageLayout->setRowStretch(1, 20); + //pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used pageLayout->setContentsMargins(7, 7, 7, 0); QGroupBox * gb = new QGroupBox(this); @@ -61,15 +66,15 @@ gbl->addWidget(l); gbl->addWidget(labelGameStats); gb->setLayout(gbl); - pageLayout->addWidget(gb, 1, 1, 1, 2); + pageLayout->addWidget(gb, 1, 1); // graph graphic = new FitGraphicsView(gb); - l = new QLabel(this); - l->setTextFormat(Qt::RichText); - l->setText("

" + PageGameStats::tr("Health graph") + "

"); - l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - gbl->addWidget(l); + labelGraphTitle = new QLabel(this); + labelGraphTitle->setTextFormat(Qt::RichText); + labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); + labelGraphTitle->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + gbl->addWidget(labelGraphTitle); gbl->addWidget(graphic); graphic->scale(1.0, -1.0); graphic->setBackgroundBrush(QBrush(Qt::black)); @@ -97,13 +102,26 @@ return pageLayout; } +//TODO button placement, image etc QLayout * PageGameStats::footerLayoutDefinition() { QHBoxLayout * bottomLayout = new QHBoxLayout(); + + mainNote = new QLabel(this); + mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + mainNote->setWordWrap(true); + + bottomLayout->addWidget(mainNote, 0); + bottomLayout->setStretch(0,1); - btnSave = addButton(":/res/Save.png", bottomLayout, 0, true); + btnRestart = addButton(":/res/Start.png", bottomLayout, 1, true); + btnRestart->setWhatsThis(tr("Play again")); + btnRestart->setFixedWidth(58); + btnRestart->setFixedHeight(81); + btnRestart->setStyleSheet("QPushButton{margin-top:24px}"); + btnSave = addButton(":/res/Save.png", bottomLayout, 2, true); + btnSave->setWhatsThis(tr("Save")); btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}"); - bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom); return bottomLayout; } @@ -112,6 +130,7 @@ { connect(this, SIGNAL(pageEnter()), this, SLOT(renderStats())); connect(btnSave, SIGNAL(clicked()), this, SIGNAL(saveDemoRequested())); + connect(btnRestart, SIGNAL(clicked()), this, SIGNAL(restartGameRequested())); } PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent) @@ -133,30 +152,48 @@ lastColor = 0; } +void PageGameStats::restartBtnVisible(bool visible) +{ + btnRestart->setVisible(visible); +} + void PageGameStats::renderStats() { - QGraphicsScene * scene = new QGraphicsScene(); - - QMap >::const_iterator i = healthPoints.constBegin(); - while (i != healthPoints.constEnd()) - { - quint32 c = i.key(); - //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255)); - QVector hps = i.value(); + graphic->show(); + labelGraphTitle-> show(); + if(defaultGraphTitle) { + labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); + } else { + defaultGraphTitle = true; + } + // if not health data sent + if(healthPoints.size() == 0) { + labelGraphTitle->hide(); + graphic->hide(); + } else { + QGraphicsScene * scene = new QGraphicsScene(); - QPainterPath path; - if (hps.size()) - path.moveTo(0, hps[0]); + QMap >::const_iterator i = healthPoints.constBegin(); + while (i != healthPoints.constEnd()) + { + quint32 c = i.key(); + //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255)); + QVector hps = i.value(); - for(int t = 1; t < hps.size(); ++t) - path.lineTo(t, hps[t]); + QPainterPath path; + if (hps.size()) + path.moveTo(0, hps[0]); - scene->addPath(path, QPen(c)); - ++i; - } + for(int t = 1; t < hps.size(); ++t) + path.lineTo(t, hps[t]); - graphic->setScene(scene); - graphic->fitInView(graphic->sceneRect()); + scene->addPath(path, QPen(c)); + ++i; + } + + graphic->setScene(scene); + graphic->fitInView(graphic->sceneRect()); + } } void PageGameStats::GameStats(char type, const QString & info) @@ -198,6 +235,13 @@ healthPoints[clan].append(hp); break; } + case 'g' : + { + // TODO: change default picture or add change pic capability + defaultGraphTitle = false; + labelGraphTitle->setText("

" + info + "

"); + break; + } case 'T': // local team stats { //AddStatText("

local team: " + info + "

"); @@ -213,7 +257,11 @@ } break; } - + case 'p' : + { + kindOfPoints = info; + break; + } case 'P' : { int i = info.indexOf(' '); @@ -250,7 +298,13 @@ } QString message; - QString killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills); + QString killstring; + if(kindOfPoints.compare("") == 0) { + killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills); + } else { + killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints); + kindOfPoints = QString(""); + } message = QString("

%1 %2. %3 ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "

"; @@ -281,6 +335,12 @@ AddStatText(message); break; } + case 'c' : + { + QString message = "

"+info+"

"; + AddStatText(message); + break; + } } } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagegamestats.h --- a/QTfrontend/ui/page/pagegamestats.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagegamestats.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,18 +44,24 @@ PageGameStats(QWidget* parent = 0); QPushButton *btnSave; + QPushButton *btnRestart; + QLabel *mainNote; QLabel *labelGameStats; QLabel *labelGameWin; QLabel *labelGameRank; + QLabel *labelGraphTitle; + QString kindOfPoints; FitGraphicsView * graphic; public slots: void GameStats(char type, const QString & info); void clear(); void renderStats(); + void restartBtnVisible(bool visible); signals: void saveDemoRequested(); + void restartGameRequested(); private: void AddStatText(const QString & msg); @@ -63,6 +69,7 @@ QMap > healthPoints; unsigned int playerPosition; quint32 lastColor; + bool defaultGraphTitle; protected: QLayout * bodyLayoutDefinition(); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageinfo.cpp --- a/QTfrontend/ui/page/pageinfo.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageinfo.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageinfo.h --- a/QTfrontend/ui/page/pageinfo.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageinfo.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageingame.cpp --- a/QTfrontend/ui/page/pageingame.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageingame.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageingame.h --- a/QTfrontend/ui/page/pageingame.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageingame.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagemain.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -120,8 +120,8 @@ void PageMain::connectSignals() { connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); - connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); - connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); + //connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); + //connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); // TODO: add signal-forwarding required by (currently missing) encapsulation } @@ -133,10 +133,10 @@ setAttribute(Qt::WA_NoSystemBackground, true); mainNote->setOpenExternalLinks(true); -#ifdef DEBUG +#ifdef QT_DEBUG setDefaultDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!")); #else - setDefaultDescription(QLabel::tr("Tip: ") + randomTip()); + setDefaultDescription(QLabel::tr("Tip: %1").arg(randomTip())); #endif } @@ -189,3 +189,10 @@ if (visible) BtnNet->setIcon(originalNetworkIcon); else BtnNet->setIcon(disabledNetworkIcon); } + +void PageMain::resetNetworkChoice() +{ + BtnNetLocal->setVisible(false); + BtnNetOfficial->setVisible(false); + BtnNet->setIcon(originalNetworkIcon); +} diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemain.h --- a/QTfrontend/ui/page/pagemain.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagemain.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ public: PageMain(QWidget * parent = 0); + void resetNetworkChoice(); QPushButton * BtnSinglePlayer; QPushButton * BtnNet; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemultiplayer.cpp --- a/QTfrontend/ui/page/pagemultiplayer.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagemultiplayer.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,15 +31,13 @@ QLayout * PageMultiplayer::bodyLayoutDefinition() { - QGridLayout * pageLayout = new QGridLayout(); + QHBoxLayout * pageLayout = new QHBoxLayout(); gameCFG = new GameCFGWidget(this); - pageLayout->addWidget(gameCFG, 0, 0, 1, 2); - - pageLayout->setRowStretch(2, 1); + pageLayout->addWidget(gameCFG, 3, Qt::AlignTop); teamsSelect = new TeamSelWidget(this); - pageLayout->addWidget(teamsSelect, 0, 2, 3, 2); + pageLayout->addWidget(teamsSelect, 2, Qt::AlignTop); return pageLayout; } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagemultiplayer.h --- a/QTfrontend/ui/page/pagemultiplayer.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagemultiplayer.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenet.cpp --- a/QTfrontend/ui/page/pagenet.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenet.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,7 +73,7 @@ BtnNetSvrStart = formattedButton(QPushButton::tr("Start server")); BtnNetSvrStart->setMinimumWidth(180); QString serverPath = bindir->absolutePath() + "/hedgewars-server"; -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN serverPath += + ".exe"; #endif QFile server(serverPath); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenet.h --- a/QTfrontend/ui/page/pagenet.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenet.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetgame.cpp --- a/QTfrontend/ui/page/pagenetgame.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenetgame.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetgame.h --- a/QTfrontend/ui/page/pagenetgame.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenetgame.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetserver.cpp --- a/QTfrontend/ui/page/pagenetserver.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenetserver.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,6 +79,16 @@ BtnShare->setWhatsThis(QPushButton::tr("Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you.")); gbLayout->addWidget(BtnShare, 2, 1); + labelURL = new QLabel(gb); + labelURL->setText( + "" + ""); + labelURL->setOpenExternalLinks(true); + gbLayout->addWidget(labelURL, 3, 1); + return pageLayout; } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagenetserver.h --- a/QTfrontend/ui/page/pagenetserver.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagenetserver.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,8 +32,9 @@ QPushButton *BtnDefault; QPushButton *BtnShare; QLabel *labelSD; + QLabel *labelPort; + QLabel *labelURL; QLineEdit *leServerDescr; - QLabel *labelPort; QSpinBox *sbPort; protected: diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageoptions.cpp --- a/QTfrontend/ui/page/pageoptions.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageoptions.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -275,11 +275,13 @@ winLabelX->setFixedWidth(40); winLabelX->setAlignment(Qt::AlignCenter); - windowWidthEdit = new QLineEdit(groupGame); - windowWidthEdit->setValidator(new QIntValidator(this)); + // TODO: less random max. also: + // make some min/max-consts, shared with engine? + windowWidthEdit = new QSpinBox(groupGame); + windowWidthEdit->setRange(640, 102400); windowWidthEdit->setFixedSize(55, CBResolution->height()); - windowHeightEdit = new QLineEdit(groupGame); - windowHeightEdit->setValidator(new QIntValidator(this)); + windowHeightEdit = new QSpinBox(groupGame); + windowHeightEdit->setRange(480, 102400); windowHeightEdit->setFixedSize(55, CBResolution->height()); winResLayout->addWidget(windowWidthEdit, 0); @@ -585,13 +587,19 @@ CBLanguage = new QComboBox(groupMisc); groupMisc->layout()->addWidget(CBLanguage, 0, 1); QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm")); - CBLanguage->addItem(QComboBox::tr("(System default)"), QString("")); + CBLanguage->addItem(QComboBox::tr("(System default)"), QString()); for(int i = 0; i < locs.count(); i++) { - QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1")); - CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); + QString lname = locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"); + QLocale loc(lname); + CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", lname); } + QLabel *restartNoticeLabel = new QLabel(groupMisc); + restartNoticeLabel->setText(QLabel::tr("This setting will be effective at next restart.")); + groupMisc->layout()->addWidget(restartNoticeLabel, 1, 1); + + // Divider groupMisc->addDivider(); // row 1 @@ -600,14 +608,14 @@ CBNameWithDate = new QCheckBox(groupMisc); CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); - groupMisc->layout()->addWidget(CBNameWithDate, 2, 0, 1, 2); + groupMisc->layout()->addWidget(CBNameWithDate, 3, 0, 1, 2); // Associate file extensions BtnAssociateFiles = new QPushButton(groupMisc); BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); BtnAssociateFiles->setVisible(!custom_data && !custom_config); - groupMisc->layout()->addWidget(BtnAssociateFiles, 3, 0, 1, 2); + groupMisc->layout()->addWidget(BtnAssociateFiles, 4, 0, 1, 2); } #ifdef __APPLE__ diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageoptions.h --- a/QTfrontend/ui/page/pageoptions.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageoptions.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,8 +77,8 @@ QComboBox *CBTeamName; IconedGroupBox *AGGroupBox; QComboBox *CBResolution; - QLineEdit *windowWidthEdit; - QLineEdit *windowHeightEdit; + QSpinBox *windowWidthEdit; + QSpinBox *windowHeightEdit; QComboBox *CBStereoMode; QCheckBox *CBFrontendSound; QCheckBox *CBFrontendMusic; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageplayrecord.cpp --- a/QTfrontend/ui/page/pageplayrecord.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageplayrecord.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageplayrecord.h --- a/QTfrontend/ui/page/pageplayrecord.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageplayrecord.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageroomslist.cpp --- a/QTfrontend/ui/page/pageroomslist.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageroomslist.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -107,7 +108,18 @@ topLayout->setRowStretch(1, 0); topLayout->setColumnStretch(3, 1); + // Rooms list and chat with splitter + m_splitter = new QSplitter(); + m_splitter->setChildrenCollapsible(false); + pageLayout->addWidget(m_splitter, 100); + // Room list + QWidget * roomsListWidget = new QWidget(this); + m_splitter->setOrientation(Qt::Vertical); + m_splitter->addWidget(roomsListWidget); + + QVBoxLayout * roomsLayout = new QVBoxLayout(roomsListWidget); + roomsLayout->setMargin(0); roomsList = new RoomTableView(this); roomsList->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -118,7 +130,7 @@ roomsList->setSelectionMode(QAbstractItemView::SingleSelection); roomsList->setStyleSheet("QTableView { border-top-left-radius: 0px; }"); roomsList->setFocusPolicy(Qt::NoFocus); - pageLayout->addWidget(roomsList, 200); + roomsLayout->addWidget(roomsList, 200); // Room filters container @@ -126,9 +138,9 @@ filtersContainer->setMaximumWidth(800); filtersContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - pageLayout->addSpacing(7); - pageLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter); - pageLayout->addSpacing(7); + roomsLayout->addSpacing(7); + roomsLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter); + roomsLayout->addSpacing(7); QHBoxLayout * filterLayout = new QHBoxLayout(filtersContainer); filterLayout->setSpacing(0); @@ -194,7 +206,7 @@ // Lobby chat chatWidget = new HWChatWidget(this, false); - pageLayout->addWidget(chatWidget, 350); + m_splitter->addWidget(chatWidget); CBRules->addItem(QComboBox::tr("Any")); @@ -251,6 +263,8 @@ void PageRoomsList::roomSelectionChanged(const QModelIndex & current, const QModelIndex & previous) { + Q_UNUSED(previous); + BtnJoin->setEnabled(current.isValid()); } @@ -732,14 +746,24 @@ bool PageRoomsList::restoreHeaderState() { - if (!m_gameSettings->contains("frontend/roomslist_header")) - return false; - return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64( - (m_gameSettings->value("frontend/roomslist_header").toByteArray()))); + if (m_gameSettings->contains("frontend/roomslist_splitter")) + { + m_splitter->restoreState(QByteArray::fromBase64( + (m_gameSettings->value("frontend/roomslist_splitter").toByteArray()))); + } + + if (m_gameSettings->contains("frontend/roomslist_header")) + { + return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64( + (m_gameSettings->value("frontend/roomslist_header").toByteArray()))); + } else return false; } void PageRoomsList::saveHeaderState() { m_gameSettings->setValue("frontend/roomslist_header", QString(roomsList->horizontalHeader()->saveState().toBase64())); + + m_gameSettings->setValue("frontend/roomslist_splitter", + QString(m_splitter->saveState().toBase64())); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageroomslist.h --- a/QTfrontend/ui/page/pageroomslist.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageroomslist.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ class QTableView; class RoomsListModel; class QSortFilterProxyModel; +class QSplitter; class RoomTableView : public QTableView { @@ -101,6 +102,7 @@ QSortFilterProxyModel * weaponsFilteredModel; QAction * showGamesInLobby; QAction * showGamesInProgress; + QSplitter * m_splitter; AmmoSchemeModel * ammoSchemeModel; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagescheme.cpp --- a/QTfrontend/ui/page/pagescheme.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagescheme.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagescheme.h --- a/QTfrontend/ui/page/pagescheme.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagescheme.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageselectweapon.cpp --- a/QTfrontend/ui/page/pageselectweapon.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageselectweapon.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pageselectweapon.h --- a/QTfrontend/ui/page/pageselectweapon.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pageselectweapon.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagesingleplayer.cpp --- a/QTfrontend/ui/page/pagesingleplayer.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagesingleplayer.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagesingleplayer.h --- a/QTfrontend/ui/page/pagesingleplayer.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagesingleplayer.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagetraining.cpp --- a/QTfrontend/ui/page/pagetraining.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagetraining.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,7 +118,7 @@ DataManager & dataMgr = DataManager::instance(); // get locale - QSettings settings("physfs://hedgewars.ini", + QSettings settings(dataMgr.settingsFileName(), QSettings::IniFormat); QString loc = settings.value("misc/locale", "").toString(); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagetraining.h --- a/QTfrontend/ui/page/pagetraining.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagetraining.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagevideos.cpp --- a/QTfrontend/ui/page/pagevideos.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagevideos.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -414,7 +414,7 @@ setName(item, newName); } } -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN // there is a bug in qt, QDir::rename() doesn't fail on such names but damages files if (newName.contains(QRegExp("[\"*:<>?\\/|]"))) { @@ -508,8 +508,8 @@ else { QString path = item->path(); - desc += tr("Date: %1\n").arg(QFileInfo(path).created().toString(Qt::DefaultLocaleLongDate)); - desc += tr("Size: %1\n").arg(FileSizeStr(path)); + desc += tr("Date: %1").arg(QFileInfo(path).created().toString(Qt::DefaultLocaleLongDate)) + "\n"; + desc += tr("Size: %1").arg(FileSizeStr(path)) + "\n"; if (item->desc.isEmpty()) { // Extract description from file; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/page/pagevideos.h --- a/QTfrontend/ui/page/pagevideos.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/page/pagevideos.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/qaspectratiolayout.cpp --- a/QTfrontend/ui/qaspectratiolayout.cpp Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation. - */ - -#include "qaspectratiolayout.h" - -QAspectRatioLayout::QAspectRatioLayout(QWidget* parent, int spacing) : QLayout(parent) -{ - init(spacing); -} - -QAspectRatioLayout::QAspectRatioLayout(int spacing) -{ - init(spacing); -} - -QAspectRatioLayout::~QAspectRatioLayout() -{ - delete item; - delete lastReceivedRect; - delete _geometry; -} - -void QAspectRatioLayout::init(int spacing) -{ - item = 0; - lastReceivedRect = new QRect(0, 0, 0, 0); - _geometry = new QRect(0, 0, 0, 0); - setSpacing(spacing); -} - - -/* Adds item if place isn't already taken. */ -void QAspectRatioLayout::add(QLayoutItem* item) -{ - if(!hasItem()) - { - replaceItem(item); - } -} - -/* Adds item if place isn't already taken. */ -void QAspectRatioLayout::addItem(QLayoutItem* item) -{ - if(!hasItem()) - { - replaceItem(item); - } -} - -/* Adds widget if place isn't already taken. */ -void QAspectRatioLayout::addWidget(QWidget* widget) -{ - if(!hasItem()) - { - replaceItem(new QWidgetItem(widget)); - } -} - -/* Returns the item pointer and dereferences it here. */ -QLayoutItem* QAspectRatioLayout::take() -{ - QLayoutItem* item = 0; - if(this->hasItem()) - { - item = this->item; - this->item = 0; - } - return item; -} - -/* Returns the item pointer and dereferences it here. */ -QLayoutItem* QAspectRatioLayout::takeAt(int index) -{ - if(index != 0) - { - return 0; - } - return this->take(); -} - -/* Returns the item pointer. */ -QLayoutItem* QAspectRatioLayout::itemAt(int index) const -{ - if(index != 0) - { - return 0; - } - if(hasItem()) - { - return this->item; - } - return 0; -} - -/* Checks if we have an item. */ -bool QAspectRatioLayout::hasItem() const -{ - return this->item != 0; -} - -/* Returns the count of items which can be either 0 or 1. */ -int QAspectRatioLayout::count() const -{ - int returnValue = 0; - if(hasItem()) - { - returnValue = 1; - } - return returnValue; -} - -/* Replaces the item with the new and returns the old. */ -QLayoutItem* QAspectRatioLayout::replaceItem(QLayoutItem* item) -{ - QLayoutItem* old = 0; - if(this->hasItem()) - { - old = this->item; - } - this->item = item; - setGeometry(*this->_geometry); - return old; -} - -/* Tells which way layout expands. */ -Qt::Orientations QAspectRatioLayout::expandingDirections() const -{ - return Qt::Horizontal | Qt::Vertical; -} - -/* Tells which size is preferred. */ -QSize QAspectRatioLayout::sizeHint() const -{ - return this->item->minimumSize(); -} - -/* Tells minimum size. */ -QSize QAspectRatioLayout::minimumSize() const -{ - return this->item->minimumSize(); -} - -/* - * Tells if heightForWidth calculations is handled. - * It isn't since width isn't enough to calculate - * proper size. - */ -bool QAspectRatioLayout::hasHeightForWidth() const -{ - return false; -} - -/* Replaces lastReceivedRect. */ -void QAspectRatioLayout::setLastReceivedRect(const QRect& rect) -{ - QRect* oldRect = this->lastReceivedRect; - this->lastReceivedRect = new QRect(rect.topLeft(), rect.size()); - delete oldRect; -} - -/* Returns geometry */ -QRect QAspectRatioLayout::geometry() -{ - return QRect(*this->_geometry); -} - -/* Sets geometry to given size. */ -void QAspectRatioLayout::setGeometry(const QRect& rect) -{ - /* - * We check if the item is set and - * if size is the same previously received. - * If either is false nothing is done. - */ - if(!this->hasItem() || - areRectsEqual(*this->lastReceivedRect, rect)) - { - return; - } - /* Replace the last received rectangle. */ - setLastReceivedRect(rect); - /* Calculate proper size for the item relative to the received size. */ - QSize properSize = calculateProperSize(rect.size()); - /* Calculate center location in the rect and with item size. */ - QPoint properLocation = calculateCenterLocation(rect.size(), properSize); - /* Set items geometry */ - this->item->setGeometry(QRect(properLocation, properSize)); - QRect* oldRect = this->_geometry; - /* Cache the calculated geometry. */ - this->_geometry = new QRect(properLocation, properSize); - delete oldRect; - /* Super classes setGeometry */ - QLayout::setGeometry(*this->_geometry); -} - -/* Takes the shortest side and creates QSize - * with the shortest side as width and height. */ -QSize QAspectRatioLayout::calculateProperSize(QSize from) const -{ - QSize properSize; - if(from.height() * 2 < from.width()) - { - properSize.setHeight(from.height() - this->margin()); - properSize.setWidth(from.height() * 2 - this->margin()); - } - else - { - properSize.setWidth(from.width() - this->margin()); - properSize.setHeight(from.width() / 2 - this->margin()); - } - return properSize; -} - -/* Calculates center location from the given height and width for item size. */ -QPoint QAspectRatioLayout::calculateCenterLocation(QSize from, - QSize itemSize) const -{ - QPoint centerLocation; - if((from.width() - itemSize.width()) > 0) - { - centerLocation.setX((from.width() - itemSize.width())/2); - } - if((from.height() - itemSize.height()) > 0) - { - centerLocation.setY((from.height() - itemSize.height())/2); - } - return centerLocation; -} - -/* Compares if two QRects are equal. */ -bool QAspectRatioLayout::areRectsEqual(const QRect& a, - const QRect& b) const -{ - bool result = false; - if(a.x() == b.x() && - a.y() == b.y() && - a.height() == b.height() && - a.width() == b.width()) - { - result = true; - } - return result; -} diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/qaspectratiolayout.h --- a/QTfrontend/ui/qaspectratiolayout.h Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation. - */ - -#ifndef QASPECTRATIOLAYOUT_H_ -#define QASPECTRATIOLAYOUT_H_ - -#include -#include -#include -#include -#include - - -class QAspectRatioLayout : public QLayout -{ - Q_OBJECT - - public: - QAspectRatioLayout(QWidget* parent, int spacing =-1); - QAspectRatioLayout(int spacing = -1); - ~QAspectRatioLayout(); - - /* Convenience method */ - virtual void add(QLayoutItem* item); - - /* http://doc.trolltech.com/qlayout.html#addItem */ - virtual void addItem(QLayoutItem* item); - /* http://doc.trolltech.com/qlayout.html#addWidget */ - virtual void addWidget(QWidget* widget); - /* http://doc.trolltech.com/qlayout.html#takeAt */ - virtual QLayoutItem* takeAt(int index); - /* http://doc.trolltech.com/qlayout.html#itemAt */ - virtual QLayoutItem* itemAt(int index) const; - /* http://doc.trolltech.com/qlayout.html#count */ - virtual int count() const; - - /* - * These are ours since we do have only one item. - */ - virtual QLayoutItem* replaceItem(QLayoutItem* item); - virtual QLayoutItem* take(); - virtual bool hasItem() const; - - /* http://doc.trolltech.com/qlayout.html#expandingDirections */ - virtual Qt::Orientations expandingDirections() const; - - /* - * This method contains most of the juice of this article. - * http://doc.trolltech.com/qlayoutitem.html#setGeometry - */ - virtual void setGeometry(const QRect& rect); - /* http://doc.trolltech.com/qlayoutitem.html#geometry */ - virtual QRect geometry(); - - /* http://doc.trolltech.com/qlayoutitem.html#sizeHint */ - virtual QSize sizeHint() const; - /* http://doc.trolltech.com/qlayout.html#minimumSize */ - virtual QSize minimumSize() const; - /* http://doc.trolltech.com/qlayoutitem.html#hasHeightForWidth */ - virtual bool hasHeightForWidth() const; - - private: - /* Saves the last received rect. */ - void setLastReceivedRect(const QRect& rect); - /* Used to initialize the object. */ - void init(int spacing); - /* Calculates the maximum size for the item from the assigned size. */ - QSize calculateProperSize(QSize from) const; - /* Calculates the center location from the assigned size and - * the items size. */ - QPoint calculateCenterLocation(QSize from, QSize itemSize) const; - /* Check if two QRects are equal */ - bool areRectsEqual(const QRect& a, const QRect& b) const; - /* Contains item reference */ - QLayoutItem* item; - /* - * Used for caching so we won't do calculations every time - * setGeometry is called. - */ - QRect* lastReceivedRect; - /* Contains geometry */ - QRect* _geometry; - -}; - -#endif /* QASPECTRATIOLAYOUT_H_ */ diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/FreqSpinBox.cpp --- a/QTfrontend/ui/widget/FreqSpinBox.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/FreqSpinBox.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/FreqSpinBox.h --- a/QTfrontend/ui/widget/FreqSpinBox.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/FreqSpinBox.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/HistoryLineEdit.cpp --- a/QTfrontend/ui/widget/HistoryLineEdit.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/HistoryLineEdit.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/HistoryLineEdit.h --- a/QTfrontend/ui/widget/HistoryLineEdit.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/HistoryLineEdit.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SmartLineEdit.cpp --- a/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/SmartLineEdit.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SmartLineEdit.h --- a/QTfrontend/ui/widget/SmartLineEdit.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/SmartLineEdit.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SquareLabel.cpp --- a/QTfrontend/ui/widget/SquareLabel.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/SquareLabel.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/SquareLabel.h --- a/QTfrontend/ui/widget/SquareLabel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/SquareLabel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/about.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,11 +52,8 @@ QLabel *imageLabel = new QLabel; QImage image(":/res/Hedgehog.png"); imageLabel->setPixmap(QPixmap::fromImage(image)); - imageLabel->setScaledContents(true); - imageLabel->setMinimumWidth(2.8); - imageLabel->setMaximumWidth(280); - imageLabel->setMinimumHeight(30); - imageLabel->setMaximumHeight(300); + imageLabel->setFixedWidth(273); + imageLabel->setFixedHeight(300); leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); @@ -113,6 +110,7 @@ .arg(PHYSFS_VER_PATCH)); QLabel * lblLibInfo = new QLabel(); + lblLibInfo->setOpenExternalLinks(true); lblLibInfo->setText(libinfo); lblLibInfo->setWordWrap(true); lblLibInfo->setMaximumWidth(280); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/about.h --- a/QTfrontend/ui/widget/about.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/about.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/bgwidget.cpp --- a/QTfrontend/ui/widget/bgwidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/bgwidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Kristian Lehmann - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/bgwidget.h --- a/QTfrontend/ui/widget/bgwidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/bgwidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Kristian Lehmann - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/chatwidget.cpp --- a/QTfrontend/ui/widget/chatwidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/chatwidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #include "hwconsts.h" #include "gameuiconfig.h" #include "playerslistmodel.h" - +#include "HWApplication.h" #include "chatwidget.h" @@ -176,7 +176,7 @@ QWidget(parent), mainLayout(this) { - this->gameSettings = gameSettings; + this->gameSettings = NULL; this->notify = notify; m_isAdmin = false; @@ -295,9 +295,9 @@ void HWChatWidget::linkClicked(const QUrl & link) { - if (link.scheme() == "http") + if ((link.scheme() == "http") or (link.scheme() == "https")) QDesktopServices::openUrl(link); - if (link.scheme() == "hwnick") + else if (link.scheme() == "hwnick") { // decode nick QString nick = QString::fromUtf8(QByteArray::fromBase64(link.encodedQuery())); @@ -368,15 +368,43 @@ return QString("%1").arg(Qt::escape(nickname)); } +const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http(s)?://)?(www\\.)?((hedgewars\\.org|code\\.google\\.com|googlecode\\.com|hh\\.unit22\\.org)(/[^ ]*)?)"); -void HWChatWidget::onChatString(const QString& str) +bool HWChatWidget::containsHighlight(const QString & sender, const QString & message) { - onChatString("", str); + if ((sender != m_userNick) && (!m_userNick.isEmpty())) + { + QString lcStr = message.toLower(); + + foreach (const QRegExp & hl, m_highlights) + { + if (lcStr.contains(hl)) + return true; + } + } + return false; } -const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http://)?(www\\.)?(hedgewars\\.org(/[^ ]*)?)"); +QString HWChatWidget::messageToHTML(const QString & message) +{ + QString formattedStr = Qt::escape(message); + // link some urls + formattedStr = formattedStr.replace(URLREGEXP, "\\4"); + return formattedStr; +} -void HWChatWidget::onChatString(const QString& nick, const QString& str) +void HWChatWidget::onChatAction(const QString & nick, const QString & action) +{ + printChatString(nick, "* " + linkedNick(nick) + " " + messageToHTML(action), "Action", containsHighlight(nick, action)); +} + +void HWChatWidget::onChatMessage(const QString & nick, const QString & message) +{ + printChatString(nick, linkedNick(nick) + ": " + messageToHTML(message), "Chat", containsHighlight(nick, message)); +} + +void HWChatWidget::printChatString( + const QString & nick, const QString & str, const QString & cssClassPart, bool highlight) { QSortFilterProxyModel * playersSortFilterModel = qobject_cast(chatNicks->model()); if(!playersSortFilterModel) @@ -387,58 +415,15 @@ if(!players) return; - if (!nick.isEmpty()) - { - // don't show chat lines that are from ignored nicks - if (players->isFlagSet(nick, PlayersListModel::Ignore)) - return; - } + // don't show chat lines that are from ignored nicks + if (players->isFlagSet(nick, PlayersListModel::Ignore)) + return; bool isFriend = (!nick.isEmpty()) && players->isFlagSet(nick, PlayersListModel::Friend); - QString formattedStr = Qt::escape(str.mid(1)); - // make hedgewars.org urls actual links - formattedStr = formattedStr.replace(URLREGEXP, "\\3"); - - // link the nick - if(!nick.isEmpty()) - formattedStr.replace("|nick|", linkedNick(nick)); - - QString cssClass("msg_UserChat"); + QString cssClass = (isFriend ? "msg_Friend" : "msg_User") + cssClassPart; - // check first character for color code and set color properly - char c = str[0].toAscii(); - switch (c) - { - case 3: - cssClass = (isFriend ? "msg_FriendJoin" : "msg_UserJoin"); - break; - case 2: - cssClass = (isFriend ? "msg_FriendAction" : "msg_UserAction"); - break; - default: - if (isFriend) - cssClass = "msg_FriendChat"; - } - - bool isHL = false; - - if ((c != 3) && (!nick.isEmpty()) && - (nick != m_userNick) && (!m_userNick.isEmpty())) - { - QString lcStr = str.toLower(); - - foreach (const QRegExp & hl, m_highlights) - { - if (lcStr.contains(hl)) - { - isHL = true; - break; - } - } - } - - addLine(cssClass, formattedStr, isHL); + addLine(cssClass, str, highlight); } void HWChatWidget::addLine(const QString & cssClass, QString line, bool isHighlight) @@ -464,6 +449,7 @@ { line = QString("%1").arg(line); SDLInteraction::instance().playSoundFile(m_hilightSound); + HWApplication::alert(this, 800); } chatStrings.append(line); @@ -512,6 +498,9 @@ emit nickCountUpdate(chatNicks->model()->rowCount()); + if (!isIgnored) + printChatString(nick, QString("*** ") + tr("%1 has joined").arg(linkedNick(nick)), "Join", false); + if (notifyNick && notify && (m_helloSounds.size() > 0)) { SDLInteraction::instance().playSoundFile( @@ -521,9 +510,19 @@ void HWChatWidget::nickRemoved(const QString& nick) { + nickRemoved(nick, ""); +} + +void HWChatWidget::nickRemoved(const QString& nick, const QString & message) +{ chatEditLine->removeNickname(nick); emit nickCountUpdate(chatNicks->model()->rowCount()); + + if (message.isEmpty()) + printChatString(nick, QString("*** ") + tr("%1 has left").arg(linkedNick(nick)), "Leave", false); + else + printChatString(nick, QString("*** ") + tr("%1 has left (%2)").arg(linkedNick(nick)).arg(messageToHTML(message)), "Leave", false); } void HWChatWidget::clear() @@ -582,6 +581,19 @@ } } +void HWChatWidget::onPlayerInfo( + const QString & nick, + const QString & ip, + const QString & version, + const QString & roomInfo) +{ + addLine("msg_PlayerInfo", QString(" >>> %1 - %2 %3 %4") + .arg(linkedNick(nick)) + .arg(ip) + .arg(version) + .arg(roomInfo)); +} + void HWChatWidget::onKick() { QModelIndexList mil = chatNicks->selectionModel()->selectedRows(); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/chatwidget.h --- a/QTfrontend/ui/widget/chatwidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/chatwidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,14 +86,39 @@ void beforeContentAdd(); void afterContentAdd(); + /** + * @brief Checks whether the message contains a highlight. + * @param sender the sender of the message + * @param message the message + * @return true if the sender is somebody else and the message contains a highlight, otherwise false + */ + bool containsHighlight(const QString & sender, const QString & message); + /** + * @brief Escapes HTML chars in the message and converts URls to HTML links. + * @param message the message to be converted to HTML + * @return the HTML message + */ + QString messageToHTML(const QString & message); + void printChatString( + const QString & nick, + const QString & str, + const QString & cssClassPart, + bool highlight); + public slots: - void onChatString(const QString& str); - void onChatString(const QString& nick, const QString& str); + void onChatAction(const QString & nick, const QString & str); + void onChatMessage(const QString & nick, const QString & str); void onServerMessage(const QString& str); void nickAdded(const QString& nick, bool notifyNick); void nickRemoved(const QString& nick); + void nickRemoved(const QString& nick, const QString& message); void clear(); void adminAccess(bool); + void onPlayerInfo( + const QString & nick, + const QString & ip, + const QString & version, + const QString & roomInfo); signals: void chatLine(const QString& str); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/databrowser.cpp --- a/QTfrontend/ui/widget/databrowser.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/databrowser.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/databrowser.h --- a/QTfrontend/ui/widget/databrowser.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/databrowser.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/drawmapwidget.cpp --- a/QTfrontend/ui/widget/drawmapwidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/drawmapwidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,8 +62,43 @@ { Q_UNUSED(event); + int height = this->height(); + int width = this->width(); + + if ((m_scene->height() > 0) && (m_scene->width() > 0) && (height > 0)) + { + qreal saspect = m_scene->width() / m_scene->height(); + + qreal h = height; + qreal w = width; + qreal waspect = w / h; + + if (waspect < saspect) + { + h = w / saspect; + } + else if (waspect > saspect) + { + w = saspect * h; + } + + int fixedh = (int)h; + int fixedw = (int)w; + + if (ui->graphicsView->width() != fixedw) + { + ui->graphicsView->setFixedWidth(fixedw); + } + + if (ui->graphicsView->height() != fixedh) + { + ui->graphicsView->setFixedHeight(fixedh); + } + + } + if(ui->graphicsView && ui->graphicsView->scene()) - ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio); + ui->graphicsView->fitInView(m_scene->sceneRect(), Qt::KeepAspectRatio); } void DrawMapWidget::showEvent(QShowEvent * event) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/drawmapwidget.h --- a/QTfrontend/ui/widget/drawmapwidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/drawmapwidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,6 @@ #include #include -#include "qaspectratiolayout.h" #include "drawmapscene.h" @@ -61,12 +60,13 @@ QVBoxLayout * vbox = new QVBoxLayout(drawMapWidget); vbox->setMargin(0); lblPoints = new QLabel("0", drawMapWidget); - vbox->addWidget(lblPoints); - QAspectRatioLayout * arLayout = new QAspectRatioLayout(); - arLayout->setMargin(0); + QLayout * arLayout = new QVBoxLayout(); + arLayout->setAlignment(Qt::AlignCenter); vbox->addLayout(arLayout); graphicsView = new DrawMapView(drawMapWidget); + graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); arLayout->addWidget(graphicsView); retranslateUi(drawMapWidget); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/feedbackdialog.cpp --- a/QTfrontend/ui/widget/feedbackdialog.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/feedbackdialog.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ #include -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN #define WINVER 0x0500 #include #else @@ -42,8 +42,11 @@ #include #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC #include +#ifndef _SC_NPROCESSORS_ONLN +#define _SC_NPROCESSORS_ONLN 58 +#endif #endif #include @@ -74,16 +77,22 @@ QHBoxLayout * systemLayout = new QHBoxLayout(); info = new QLabel(); - info->setText( + info->setText(QString( "" - "

Please give us feedback!

" - "

We are always happy about suggestions, ideas, or bug reports.

" - "

Your email address is optional, but we may want to contact you.

" - "

" + "

%1

" + "

%2

" + "

%3 known bugs

" + "

%4

" + "

") + .arg(tr("Send us feedback!")) + .arg(tr("We are always happy about suggestions, ideas, or bug reports.")) + .arg(tr("If you found a bug, you can see if it's already been reported here: ")) + .arg(tr("Your email address is optional, but necessary if you want us to get back at you.")) ); + info->setOpenExternalLinks(true); pageLayout->addWidget(info); QVBoxLayout * summaryEmailLayout = new QVBoxLayout(); @@ -198,7 +207,7 @@ QString processor_name = "Processor: "; // platform specific code -#ifdef Q_WS_MACX +#ifdef Q_OS_MACX number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n"; uint64_t memsize; @@ -231,19 +240,21 @@ default: os_version += "\"Unknown version\"\n"; break; } #endif -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); number_of_cores += QString::number(sysinfo.dwNumberOfProcessors) + "\n"; MEMORYSTATUSEX status; status.dwLength = sizeof(status); GlobalMemoryStatusEx(&status); - total_ram += QString::number(status.ullTotalPhys) + "\n"; + total_ram += QString::number(status.ullTotalPhys/1024/1024) + " MB\n"; - switch(QSysInfo::WinVersion()) + switch(QSysInfo::windowsVersion()) { + case QSysInfo::WV_NT: os_version += "Windows NT\n"; break; case QSysInfo::WV_2000: os_version += "Windows 2000\n"; break; case QSysInfo::WV_XP: os_version += "Windows XP\n"; break; + case QSysInfo::WV_2003: os_version += "Windows Server 2003\n"; break; case QSysInfo::WV_VISTA: os_version += "Windows Vista\n"; break; case QSysInfo::WV_WINDOWS7: os_version += "Windows 7\n"; break; //case QSysInfo::WV_WINDOWS8: os_version += "Windows 8\n"; break; //QT 5+ @@ -251,7 +262,7 @@ } kernel_line += "Windows kernel\n"; #endif -#ifdef Q_WS_X11 +#ifdef Q_OS_X11 number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n"; long pages = sysconf(_SC_PHYS_PAGES), /* @@ -260,13 +271,13 @@ #else available_pages = 0, #endif*/ - page_size = sysconf(_SC_PAGE_SIZE); - total_ram += QString::number(pages * page_size) + "\n"; + page_size = sysconf(_SC_PAGE_SIZE); + total_ram += QString::number(pages*page_size/1024/1024) + " MB\n"; os_version += "GNU/Linux or BSD\n"; #endif // uname -a -#if defined(Q_WS_X11) || defined(Q_WS_MACX) +#if defined(Q_OS_X11) || defined(Q_OS_MAC) QProcess *process = new QProcess(); QStringList arguments = QStringList("-a"); process->start("uname", arguments); @@ -275,7 +286,7 @@ delete process; #endif -#if defined(__i386__) || defined(__x86_64__) +#if (!defined(Q_OS_MAC) && defined(__i386__)) || defined(__x86_64__) // cpu info quint32 registers[4]; quint32 i; @@ -450,7 +461,7 @@ QString email = this->email->text(); QString captchaCode = this->captcha_code->text(); QString captchaID = QString::number(this->captchaID); - QString version = "HedgewarsFoundation-Hedgewars-v" + *cVersionString + "_r" + + QString version = "HedgewarsFoundation-Hedgewars-v" + *cVersionString + "_r" + *cRevisionString + "|" + *cHashString; if (summary.isEmpty() || description.isEmpty()) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/feedbackdialog.h --- a/QTfrontend/ui/widget/feedbackdialog.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/feedbackdialog.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/fpsedit.cpp --- a/QTfrontend/ui/widget/fpsedit.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/fpsedit.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/fpsedit.h --- a/QTfrontend/ui/widget/fpsedit.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/fpsedit.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/frameTeam.cpp --- a/QTfrontend/ui/widget/frameTeam.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/frameTeam.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/frameTeam.h --- a/QTfrontend/ui/widget/frameTeam.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/frameTeam.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/gamecfgwidget.cpp --- a/QTfrontend/ui/widget/gamecfgwidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/gamecfgwidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -599,7 +599,7 @@ GameSchemes->setEnabled(false); GameSchemes->setCurrentIndex(GameSchemes->findText("Default")); } - else + else if (m_master) { GameSchemes->setEnabled(true); int num = GameSchemes->findText(scheme); @@ -614,7 +614,7 @@ WeaponsName->setEnabled(false); WeaponsName->setCurrentIndex(WeaponsName->findText("Default")); } - else + else if (m_master) { WeaponsName->setEnabled(true); int num = WeaponsName->findText(weapons); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/gamecfgwidget.h --- a/QTfrontend/ui/widget/gamecfgwidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/gamecfgwidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatbutton.cpp --- a/QTfrontend/ui/widget/hatbutton.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hatbutton.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatbutton.h --- a/QTfrontend/ui/widget/hatbutton.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hatbutton.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatprompt.cpp --- a/QTfrontend/ui/widget/hatprompt.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hatprompt.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hatprompt.h --- a/QTfrontend/ui/widget/hatprompt.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hatprompt.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hedgehogerWidget.cpp --- a/QTfrontend/ui/widget/hedgehogerWidget.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Ulyanov Igor - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/hedgehogerWidget.h --- a/QTfrontend/ui/widget/hedgehogerWidget.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/hedgehogerWidget.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Ulyanov Igor - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/igbox.cpp --- a/QTfrontend/ui/widget/igbox.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/igbox.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/igbox.h --- a/QTfrontend/ui/widget/igbox.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/igbox.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/keybinder.cpp --- a/QTfrontend/ui/widget/keybinder.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/keybinder.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/keybinder.h --- a/QTfrontend/ui/widget/keybinder.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/keybinder.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/lineeditcursor.cpp --- a/QTfrontend/ui/widget/lineeditcursor.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/lineeditcursor.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/lineeditcursor.h --- a/QTfrontend/ui/widget/lineeditcursor.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/lineeditcursor.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/mapContainer.cpp --- a/QTfrontend/ui/widget/mapContainer.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/mapContainer.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -75,8 +75,11 @@ /* Layouts */ - QHBoxLayout * typeLayout = new QHBoxLayout(); - QHBoxLayout * seedLayout = new QHBoxLayout(); + QWidget * topWidget = new QWidget(); + QHBoxLayout * topLayout = new QHBoxLayout(topWidget); + topWidget->setContentsMargins(0, 0, 0, 0); + topLayout->setContentsMargins(0, 0, 0, 0); + QHBoxLayout * twoColumnLayout = new QHBoxLayout(); QVBoxLayout * leftLayout = new QVBoxLayout(); QVBoxLayout * rightLayout = new QVBoxLayout(); @@ -84,15 +87,13 @@ twoColumnLayout->addStretch(1); twoColumnLayout->addLayout(rightLayout, 0); QVBoxLayout * drawnControls = new QVBoxLayout(); - leftLayout->addLayout(typeLayout, 0); - rightLayout->addLayout(seedLayout, 0); /* Map type combobox */ - typeLayout->setSpacing(10); - typeLayout->addWidget(new QLabel(tr("Map type:")), 0); + topLayout->setSpacing(10); + topLayout->addWidget(new QLabel(tr("Map type:")), 0); cType = new QComboBox(this); - typeLayout->addWidget(cType, 1); + topLayout->addWidget(cType, 1); cType->insertItem(0, tr("Image map"), MapModel::StaticMap); cType->insertItem(1, tr("Mission map"), MapModel::MissionMap); cType->insertItem(2, tr("Hand-drawn"), MapModel::HandDrawnMap); @@ -103,7 +104,7 @@ /* Randomize button */ - seedLayout->addStretch(1); + topLayout->addStretch(1); const QIcon& lp = QIcon(":/res/dice.png"); QSize sz = lp.actualSize(QSize(65535, 65535)); btnRandomize = new QPushButton(); @@ -117,15 +118,16 @@ m_childWidgets << btnRandomize; btnRandomize->setStyleSheet("padding: 5px;"); btnRandomize->setFixedHeight(cType->height()); - seedLayout->addWidget(btnRandomize, 1); + topLayout->addWidget(btnRandomize, 1); /* Seed button */ + btnSeed = new QPushButton(parentWidget()->parentWidget()); btnSeed->setText(tr("Seed")); btnSeed->setStyleSheet("padding: 5px;"); btnSeed->setFixedHeight(cType->height()); connect(btnSeed, SIGNAL(clicked()), this, SLOT(showSeedPrompt())); - seedLayout->addWidget(btnSeed, 0); + topLayout->addWidget(btnSeed, 0); /* Map preview label */ @@ -137,6 +139,7 @@ mapPreview = new QPushButton(this); mapPreview->setObjectName("mapPreview"); + mapPreview->setFlat(true); mapPreview->setFixedSize(256, 128); mapPreview->setContentsMargins(0, 0, 0, 0); leftLayout->addWidget(mapPreview, 0); @@ -240,13 +243,15 @@ /* Theme chooser */ btnTheme = new QPushButton(); + btnTheme->setFlat(true); connect(btnTheme, SIGNAL(clicked()), this, SLOT(showThemePrompt())); m_childWidgets << btnTheme; bottomLeftLayout->addWidget(btnTheme, 0); /* Add everything to main layout */ - mainLayout.addLayout(twoColumnLayout, 0); + mainLayout.addWidget(topWidget, 0); + mainLayout.addLayout(twoColumnLayout, 1); /* Set defaults */ @@ -463,7 +468,7 @@ void HWMapContainer::setRandomMap() { if (!m_master) return; - + setRandomSeed(); switch(m_mapInfo.type) { @@ -796,7 +801,7 @@ btnTheme->setFixedHeight(64); btnTheme->setIconSize(iconSize); btnTheme->setIcon(icon); - btnTheme->setText(tr("Theme: ") + current.data(Qt::DisplayRole).toString()); + btnTheme->setText(tr("Theme: %1").arg(current.data(Qt::DisplayRole).toString())); updateThemeButtonSize(); } @@ -927,5 +932,5 @@ m_theme = name; btnTheme->setIcon(QIcon()); - btnTheme->setText(tr("Theme: ") + name); + btnTheme->setText(tr("Theme: %1").arg(name)); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/mapContainer.h --- a/QTfrontend/ui/widget/mapContainer.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/mapContainer.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/qpushbuttonwithsound.cpp --- a/QTfrontend/ui/widget/qpushbuttonwithsound.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/qpushbuttonwithsound.h --- a/QTfrontend/ui/widget/qpushbuttonwithsound.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/qpushbuttonwithsound.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/roomnameprompt.cpp --- a/QTfrontend/ui/widget/roomnameprompt.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/roomnameprompt.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ QPushButton * btnOkay = new QPushButton(tr("Create room")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC buttonLayout->addWidget(btnCancel); buttonLayout->addWidget(btnOkay); #else diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/roomnameprompt.h --- a/QTfrontend/ui/widget/roomnameprompt.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/roomnameprompt.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/seedprompt.cpp --- a/QTfrontend/ui/widget/seedprompt.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/seedprompt.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ QPushButton * btnOkay = new QPushButton(tr("Set seed")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC buttonLayout->addWidget(btnCancel); buttonLayout->addWidget(btnOkay); #else diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/seedprompt.h --- a/QTfrontend/ui/widget/seedprompt.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/seedprompt.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/selectWeapon.cpp --- a/QTfrontend/ui/widget/selectWeapon.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/selectWeapon.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/selectWeapon.h --- a/QTfrontend/ui/widget/selectWeapon.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/selectWeapon.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/teamselect.cpp --- a/QTfrontend/ui/widget/teamselect.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/teamselect.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,9 @@ curPlayingTeams.push_back(team); connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), this, SLOT(hhNumChanged(const HWTeam&))); + blockSignals(true); dynamic_cast(framePlaying->getTeamWidget(team))->hhNumChanged(); + blockSignals(false); connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), this, SLOT(proxyTeamColorChanged(const HWTeam&))); } @@ -210,7 +212,9 @@ { connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)), this, SLOT(hhNumChanged(const HWTeam&))); + blockSignals(true); dynamic_cast(framePlaying->getTeamWidget(team))->hhNumChanged(); + blockSignals(false); connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), this, SLOT(proxyTeamColorChanged(const HWTeam&))); emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam()); @@ -258,12 +262,16 @@ // Add notice about number of required teams. numTeamNotice = new QLabel(tr("At least two teams are required to play!")); + numTeamNotice->setWordWrap(true); mainLayout.addWidget(numTeamNotice); QPalette p; p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); addScrArea(framePlaying, p.color(QPalette::Window).light(105), 150); addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); + + this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + this->setMinimumWidth(200); } void TeamSelWidget::setAcceptOuter(bool acceptOuter) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/teamselect.h --- a/QTfrontend/ui/widget/teamselect.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/teamselect.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/teamselhelper.cpp --- a/QTfrontend/ui/widget/teamselhelper.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/teamselhelper.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/teamselhelper.h --- a/QTfrontend/ui/widget/teamselhelper.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/teamselhelper.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2007 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/themeprompt.cpp --- a/QTfrontend/ui/widget/themeprompt.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/themeprompt.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/themeprompt.h --- a/QTfrontend/ui/widget/themeprompt.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/themeprompt.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/togglebutton.cpp --- a/QTfrontend/ui/widget/togglebutton.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/togglebutton.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Kristian Lehmann - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/togglebutton.h --- a/QTfrontend/ui/widget/togglebutton.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/togglebutton.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Kristian Lehmann - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/vertScrollArea.cpp --- a/QTfrontend/ui/widget/vertScrollArea.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/vertScrollArea.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/vertScrollArea.h --- a/QTfrontend/ui/widget/vertScrollArea.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/vertScrollArea.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/weaponItem.cpp --- a/QTfrontend/ui/widget/weaponItem.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/weaponItem.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui/widget/weaponItem.h --- a/QTfrontend/ui/widget/weaponItem.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui/widget/weaponItem.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui_hwform.cpp --- a/QTfrontend/ui_hwform.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui_hwform.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,8 +55,8 @@ HWForm->resize(QSize(640, 480).expandedTo(HWForm->minimumSizeHint())); HWForm->setMinimumSize(QSize(720, 450)); QString title = QMainWindow::tr("Hedgewars %1").arg(*cVersionString); -#ifdef DEBUG - title += QMainWindow::tr("-r%1 (%2)").arg(*cRevisionString, *cHashString); +#ifdef QT_DEBUG + title += QString("-r%1 (%2)").arg(*cRevisionString, *cHashString); #endif HWForm->setWindowTitle(title); centralWidget = new QWidget(HWForm); diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/ui_hwform.h --- a/QTfrontend/ui_hwform.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/ui_hwform.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/DataManager.cpp --- a/QTfrontend/util/DataManager.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/DataManager.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include "hwconsts.h" #include "HWApplication.h" @@ -162,6 +164,41 @@ return m_bindsModel; } +QString DataManager::settingsFileName() +{ + if(m_settingsFileName.isEmpty()) + { + QFile settingsFile("physfs://settings.ini"); + + if(!settingsFile.exists()) + { + QFile oldSettingsFile("physfs://hedgewars.ini"); + + settingsFile.open(QFile::WriteOnly); + settingsFile.close(); + + if(oldSettingsFile.exists()) + { + QSettings sOld(oldSettingsFile.fileName(), QSettings::IniFormat); + QSettings sNew(settingsFile.fileName(), QSettings::IniFormat); + sNew.setIniCodec("UTF-8"); + + foreach(const QString & key, sOld.allKeys()) + { + if(key.startsWith("colors/color")) + sNew.setValue(key, sOld.value(key).value().name()); + else + sNew.setValue(key, sOld.value(key)); + } + } + } + + m_settingsFileName = settingsFile.fileName(); + } + + return m_settingsFileName; +} + void DataManager::reload() { // removed for now (also code was a bit unclean, could lead to segfault if diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/DataManager.h --- a/QTfrontend/util/DataManager.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/DataManager.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,6 +117,8 @@ QStandardItemModel * colorsModel(); QStandardItemModel * bindsModel(); + QString settingsFileName(); + static bool ensureFileExists(const QString & fileName); public slots: @@ -148,6 +150,7 @@ ThemeModel * m_themeModel; ///< theme model instance QStandardItemModel * m_colorsModel; QStandardItemModel * m_bindsModel; + QString m_settingsFileName; }; #endif // HEDGEWARS_DATAMANAGER_H diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/FileEngine.cpp --- a/QTfrontend/util/FileEngine.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/FileEngine.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -54,7 +54,7 @@ } if (!m_handle) { - qWarning("[PHYSFS] Failed to open %s, reason: %s", m_fileName.toUtf8().constData(), PHYSFS_getLastError()); + qWarning(QString("[PHYSFS] Failed to open %1, reason: %2").arg(m_fileName).arg(FileEngineHandler::errorStr()).toLocal8Bit().constData()); return false; } @@ -310,6 +310,8 @@ FileEngineHandler::FileEngineHandler(char *argv0) { PHYSFS_init(argv0); + + qDebug(QString("[PHYSFS] Init: %1").arg(errorStr()).toLocal8Bit().constData()); } FileEngineHandler::~FileEngineHandler() @@ -328,16 +330,19 @@ void FileEngineHandler::mount(const QString &path) { PHYSFS_mount(path.toUtf8().constData(), NULL, 0); + qDebug(QString("[PHYSFS] Mounting '%1' to '/': %2").arg(path).arg(errorStr()).toLocal8Bit().constData()); } void FileEngineHandler::mount(const QString & path, const QString & mountPoint) { PHYSFS_mount(path.toUtf8().constData(), mountPoint.toUtf8().constData(), 0); + qDebug(QString("[PHYSFS] Mounting '%1' to '%2': %3").arg(path).arg(mountPoint).arg(errorStr()).toLocal8Bit().data()); } void FileEngineHandler::setWriteDir(const QString &path) { PHYSFS_setWriteDir(path.toUtf8().constData()); + qDebug(QString("[PHYSFS] Setting write dir to '%1': %2").arg(path).arg(errorStr()).toLocal8Bit().data()); } void FileEngineHandler::mountPacks() @@ -345,6 +350,12 @@ hedgewarsMountPackages(); } +QString FileEngineHandler::errorStr() +{ + QString s = QString::fromUtf8(PHYSFS_getLastError()); + return s.isEmpty() ? "ok" : s; +} + FileEngineIterator::FileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, const QStringList &entries) : QAbstractFileEngineIterator(filters, nameFilters) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/FileEngine.h --- a/QTfrontend/util/FileEngine.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/FileEngine.h Thu Jun 13 22:27:23 2013 +0200 @@ -71,6 +71,7 @@ static void mount(const QString & path, const QString & mountPoint); static void setWriteDir(const QString & path); static void mountPacks(); + static QString errorStr(); // private: static const QString scheme; diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/LibavInteraction.cpp --- a/QTfrontend/util/LibavInteraction.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/LibavInteraction.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -278,7 +278,7 @@ return ""; int s = float(pContext->duration)/AV_TIME_BASE; - QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60); + QString desc = tr("Duration: %1m %2s").arg(s/60).arg(s%60) + "\n"; for (int i = 0; i < (int)pContext->nb_streams; i++) { AVStream* pStream = pContext->streams[i]; @@ -290,11 +290,11 @@ if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO) { - desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height); + desc += QString(tr("Video: %1x%2")).arg(pCodec->width).arg(pCodec->height) + ", "; if (pStream->avg_frame_rate.den) { float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den; - desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2); + desc += QString(tr("%1 fps")).arg(fps, 0, 'f', 2) + ", "; } } else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO) diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/LibavInteraction.h --- a/QTfrontend/util/LibavInteraction.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/LibavInteraction.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/MessageDialog.cpp --- a/QTfrontend/util/MessageDialog.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/MessageDialog.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,23 +17,39 @@ */ #include "MessageDialog.h" +#include "HWApplication.h" + +int MessageDialog::ShowFatalMessage(const QString & msg, QWidget * parent) +{ + return ShowMessage(QMessageBox::tr("Hedgewars - Error"), + msg, + QMessageBox::Critical, + parent); +} int MessageDialog::ShowErrorMessage(const QString & msg, QWidget * parent) { - return ShowMessage(msg, QMessageBox::tr("Hedgewars - Warning"), QMessageBox::Warning, parent); + return ShowMessage(QMessageBox::tr("Hedgewars - Warning"), + msg, + QMessageBox::Warning, + parent); } int MessageDialog::ShowInfoMessage(const QString & msg, QWidget * parent) { - return ShowMessage(msg, QMessageBox::tr("Hedgewars - Information"), QMessageBox::Information, parent); + return ShowMessage(QMessageBox::tr("Hedgewars - Information"), + msg, + QMessageBox::Information, + parent); } -int MessageDialog::ShowMessage(const QString & msg, const QString & title, QMessageBox::Icon icon, QWidget * parent) +int MessageDialog::ShowMessage(const QString & title, const QString & msg, QMessageBox::Icon icon, QWidget * parent) { - QMessageBox msgMsg(parent); + QMessageBox msgMsg(parent ? parent : HWApplication::activeWindow()); + msgMsg.setWindowTitle(title != NULL ? title : "Hedgewars"); + msgMsg.setText(msg); msgMsg.setIcon(icon); - msgMsg.setWindowTitle(title.isEmpty() ? QMessageBox::tr("Hedgewars") : title); - msgMsg.setText(msg); msgMsg.setWindowModality(Qt::WindowModal); + return msgMsg.exec(); } diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/MessageDialog.h --- a/QTfrontend/util/MessageDialog.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/MessageDialog.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ #ifndef MESSAGEDIALOG_H #define MESSAGEDIALOG_H -#include #include class QWidget; @@ -27,9 +26,18 @@ class MessageDialog { public: + static int ShowFatalMessage(const QString & msg, QWidget * parent = 0); static int ShowErrorMessage(const QString & msg, QWidget * parent = 0); static int ShowInfoMessage(const QString & msg, QWidget * parent = 0); - static int ShowMessage(const QString & msg, const QString & title = QString(), QMessageBox::Icon icon = QMessageBox::NoIcon, QWidget * parent = 0); + /** + * @brief Displays a message. + * @param title message title or NULL if no/default title + * @param msg message to display + * @param icon (optional) icon to be displayed next to the message + * @param parent parent Widget + * @return a QMessageBox::StandardButton value indicating which button was clicked + */ + static int ShowMessage(const QString & title, const QString & msg, QMessageBox::Icon icon = QMessageBox::NoIcon, QWidget * parent = 0); }; #endif diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/SDLInteraction.cpp --- a/QTfrontend/util/SDLInteraction.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/SDLInteraction.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/SDLInteraction.h --- a/QTfrontend/util/SDLInteraction.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/SDLInteraction.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/namegen.cpp --- a/QTfrontend/util/namegen.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/namegen.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Martin Minarik - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/namegen.h --- a/QTfrontend/util/namegen.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/namegen.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2009 Martin Minarik - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/CocoaInitializer.h --- a/QTfrontend/util/platform/CocoaInitializer.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/CocoaInitializer.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/CocoaInitializer.mm --- a/QTfrontend/util/platform/CocoaInitializer.mm Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/CocoaInitializer.mm Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/InstallController.cpp --- a/QTfrontend/util/platform/InstallController.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/InstallController.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/InstallController.h --- a/QTfrontend/util/platform/InstallController.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/InstallController.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/M3InstallController.m --- a/QTfrontend/util/platform/M3InstallController.m Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/M3InstallController.m Thu Jun 13 22:27:23 2013 +0200 @@ -35,8 +35,8 @@ @implementation M3InstallController -- (id) init { - if ((self = [super init])) { +-(id) init { + if ((self = [super init])) { NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName]; NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName]; @@ -50,70 +50,91 @@ return self; } -- (void)displayInstaller { +-(void) displayInstaller { NSString *imageFilePath = [[[NSWorkspace sharedWorkspace] propertiesForPath:[[NSBundle mainBundle] bundlePath]] objectForKey:NSWorkspace_RBimagefilepath]; if (imageFilePath && ![imageFilePath isEqualToString:[NSString stringWithFormat:@"/Users/.%@/%@.sparseimage", NSUserName(), NSUserName()]] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"M3DontAskInstallAgain"]) { NSInteger returnValue = [alert runModal]; if (returnValue == NSAlertDefaultReturn) { [self installApp]; } - if ([[alert suppressionButton] state] == NSOnState) { - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"]; + if ([NSAlert instancesRespondToSelector:@selector(suppressionButton)]) + if ([[alert performSelector:@selector(suppressionButton)] state] == NSOnState) + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"]; } - } } -- (void)installApp { +-(void) installApp { NSString *appsPath = [[NSString stringWithString:@"/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]]; NSString *userAppsPath = [[[NSString stringWithString:@"~/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]] stringByExpandingTildeInPath]; NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; + NSString *currentPath = [[NSBundle mainBundle] bundlePath]; + NSString *finalPath; + NSError *error = nil; + BOOL success; - //Delete the app that is installed + // Prepare the remove invocation + SEL removeSelector; + if ([NSFileManager instancesRespondToSelector:@selector(removeItemAtPath:error:)]) + removeSelector = @selector(removeItemAtPath:error:); + else + removeSelector = @selector(removeFileAtPath:handler:); + + NSMethodSignature *removeSignature = [NSFileManager instanceMethodSignatureForSelector:removeSelector]; + NSInvocation *removeInvocation = [NSInvocation invocationWithMethodSignature:removeSignature]; + [removeInvocation setTarget:[NSFileManager defaultManager]]; + [removeInvocation setSelector:removeSelector]; + + // Delete the app if already installed if ([[NSFileManager defaultManager] fileExistsAtPath:appsPath]) { - if ([NSFileManager instancesRespondToSelector:@selector(removeItemAtPath:error:)]) - [[NSFileManager defaultManager] removeItemAtPath:appsPath error:nil]; - else - //casting hides the deprecation warning - [(id)[NSFileManager defaultManager] removeFileAtPath:appsPath handler:nil]; + [removeInvocation setArgument:&appsPath atIndex:2]; + [removeInvocation setArgument:&error atIndex:3]; + [removeInvocation invoke]; } - //Delete the app that is installed - BOOL success = NO; + + // Prepare the copy invocation + SEL copySelector; if ([NSFileManager instancesRespondToSelector:@selector(copyItemAtPath:toPath:error:)]) - success = [[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] bundlePath] - toPath:appsPath - error:nil]; + copySelector = @selector(copyItemAtPath:toPath:error:); else - success = [(id)[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] - toPath:appsPath - handler:nil]; - if (success) { - NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"App Name installed successfully"), appName], - [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in /Applications", @"App Name was installed in /Applications"), appName], - NSLocalizedString(@"Quit", @"Quit"), nil, nil); - } else { + copySelector = @selector(copyPath:toPath:handler:); + + NSMethodSignature *copySignature = [NSFileManager instanceMethodSignatureForSelector:copySelector]; + NSInvocation *copyInvocation = [NSInvocation invocationWithMethodSignature:copySignature]; + + [copyInvocation setTarget:[NSFileManager defaultManager]]; + [copyInvocation setSelector:copySelector]; + + // Copy the app in /Applications + [copyInvocation setArgument:¤tPath atIndex:2]; + [copyInvocation setArgument:&appsPath atIndex:3]; + [copyInvocation setArgument:&error atIndex:4]; + [copyInvocation invoke]; + [copyInvocation getReturnValue:&success]; + finalPath = @"/Applications"; + + // In case something went wrong, let's try again somewhere else + if (success == NO) { + // Delete the app if already installed if ([[NSFileManager defaultManager] fileExistsAtPath:userAppsPath]) { - if ([NSFileManager instancesRespondToSelector:@selector(removeItemAtPath:error:)]) - [[NSFileManager defaultManager] removeItemAtPath:userAppsPath error:nil]; - else - [(id)[NSFileManager defaultManager] removeFileAtPath:userAppsPath handler:nil]; + [removeInvocation setArgument:&userAppsPath atIndex:2]; + [removeInvocation invoke]; } - if ([NSFileManager instancesRespondToSelector:@selector(copyItemAtPath:toPath:error:)]) - success = [[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] bundlePath] - toPath:userAppsPath - error:nil]; - else - success = [(id)[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] - toPath:userAppsPath - handler:nil]; - if (success) { - NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"AppName installed successfully"), appName], - [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"App Name was installed in %@"), appName, [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]], - NSLocalizedString(@"Quit", @"Quit"), nil, nil); - } else { - NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"Could not install App Name"), appName], - NSLocalizedString(@"An error occurred when installing", @"An error occurred when installing"), NSLocalizedString(@"Quit", @"Quit"), nil, nil); - } + + // Copy the app in ~/Applications + [copyInvocation setArgument:&userAppsPath atIndex:3]; + [copyInvocation invoke]; + [copyInvocation getReturnValue:&success]; + finalPath = [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]; } + + if (success) + NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"successful installation title"), appName], + [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"successfull installation text"), appName, finalPath], + NSLocalizedString(@"Ok", @"ok message"), nil, nil); + else + NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"installation failure title"), appName], + NSLocalizedString(@"An error occurred when installing", @"installation failure text"), + NSLocalizedString(@"Quit", @"exit message"), nil, nil); } @end diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/M3Panel.h --- a/QTfrontend/util/platform/M3Panel.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/M3Panel.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/M3Panel.mm --- a/QTfrontend/util/platform/M3Panel.mm Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/M3Panel.mm Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/SparkleAutoUpdater.mm --- a/QTfrontend/util/platform/SparkleAutoUpdater.mm Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/SparkleAutoUpdater.mm Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/xfire.cpp --- a/QTfrontend/util/platform/xfire.cpp Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/xfire.cpp Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/util/platform/xfire.h --- a/QTfrontend/util/platform/xfire.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/util/platform/xfire.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 QTfrontend/weapons.h --- a/QTfrontend/weapons.h Tue Apr 30 01:47:30 2013 +0200 +++ b/QTfrontend/weapons.h Thu Jun 13 22:27:23 2013 +0200 @@ -58,9 +58,9 @@ #define AMMOLINE_ONEEVERY_QT "1111119111111111111111111111111111111111111111111111111" #define AMMOLINE_ONEEVERY_PROB "1111110111111111111111111111111111111111111111111111111" -#define AMMOLINE_ONEEVERY_DELAY "0000000000000205500000040007004000000000220000000600020" +#define AMMOLINE_ONEEVERY_DELAY "0000000000000000000000000000000000000000000000000000000" #define AMMOLINE_ONEEVERY_CRATE "1111110111111111111111111111111111111111111111111111111" -//When adding new weapons also inster one element in cDefaultAmmos list (hwconsts.cpp.in) +//When adding new weapons also insert one element in cDefaultAmmos list (hwconsts.cpp.in) diff -r 11438c0bd46b -r bce8cf41d666 README --- a/README Tue Apr 30 01:47:30 2013 +0200 +++ b/README Thu Jun 13 22:27:23 2013 +0200 @@ -3,7 +3,7 @@ Images and sounds are distributed under the terms of the GNU FDL licence. Source: -Copyright 2004-2011 Andrey Korotaev +Copyright 2004-2013 Andrey Korotaev Portions copyright 2006-2008 Igor Ulyanov aka Displacer Instructions: diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/CPackConfig.cmake --- a/cmake_modules/CPackConfig.cmake Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ - -# revision information in cpack-generated names -if(CMAKE_BUILD_TYPE MATCHES DEBUG) - set(full_suffix "${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION}") -else() - set(full_suffix "${HEDGEWARS_VERSION}") -endif() - -# CPack variables -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a free turn-based strategy game") -set(CPACK_PACKAGE_VENDOR "Hedgewars Project") -set(CPACK_PACKAGE_FILE_NAME "Hedgewars-${full_suffix}") -set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${full_suffix}") -set(CPACK_SOURCE_GENERATOR "TBZ2") -set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "Hedgewars") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${full_suffix}") -set(CPACK_STRIP_FILES true) - -if(WIN32 AND NOT UNIX) - set(CPACK_NSIS_DISPLAY_NAME "Hedgewars") - set(CPACK_NSIS_HELP_LINK "http://www.hedgewars.org/") - set(CPACK_NSIS_URL_INFO_ABOUT "http://www.hedgewars.org/") - set(CPACK_NSIS_CONTACT "unC0Rr@gmail.com") - set(CPACK_NSIS_MODIFY_PATH OFF) - set(CPACK_NSIS_EXECUTABLES_DIRECTORY "${target_binary_install_dir}") - set(CPACK_NSIS_MUI_FINISHPAGE_RUN "hedgewars${CMAKE_EXECUTABLE_SUFFIX}") - set(CPACK_GENERATOR "ZIP;NSIS") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "hedgewars") -endif(WIN32 AND NOT UNIX) - -set(CPACK_SOURCE_IGNORE_FILES - #temporary files - "~" - ".swp" - #version control - "\\\\.hg" - #output binary/library - "\\\\.exe$" - "\\\\.a$" - "\\\\.so$" - "\\\\.dylib$" - "\\\\.dll$" - "\\\\.ppu$" - "\\\\.o$" - "\\\\.cxx$" - #graphics - "\\\\.xcf$" - "\\\\.svg$" - "\\\\.svgz$" - "\\\\.psd$" - "\\\\.sifz$" - #misc - "\\\\.core$" - "\\\\.sh$" - "\\\\.orig$" - "\\\\.layout$" - "\\\\.db$" - "\\\\.dof$" - #archives - "\\\\.zip$" - "\\\\.gz$" - "\\\\.bz2$" - "\\\\.tmp$" - #cmake-configured files - "hwconsts\\\\.cpp$" - "config\\\\.inc$" - "hwengine\\\\.desktop$" - "Info\\\\.plist$" - #other cmake generated files - "Makefile" - "Doxyfile" - "CMakeFiles" - "[dD]ebug$" - "[rR]elease$" - "CPack" - "cmake_install\\\\.cmake$" - "CMakeCache\\\\.txt$" -# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libtremor" -# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libfreetype" -# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/liblua" - "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libopenalbridge" - "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/frontlib" - "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/promotional_art" - "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/cmdlineClient" - "^${CMAKE_CURRENT_SOURCE_DIR}/tools/templates" - "^${CMAKE_CURRENT_SOURCE_DIR}/bin/checkstack*" - "^${CMAKE_CURRENT_SOURCE_DIR}/doc" - "^${CMAKE_CURRENT_SOURCE_DIR}/templates" - "^${CMAKE_CURRENT_SOURCE_DIR}/tmp" - "^${CMAKE_CURRENT_SOURCE_DIR}/utils" - "^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Maps/test" - "^${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.txt" - "^${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt" - "^${CMAKE_CURRENT_SOURCE_DIR}/hedgewars\\\\." -) - -include(CPack) - diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/FindLua.cmake --- a/cmake_modules/FindLua.cmake Tue Apr 30 01:47:30 2013 +0200 +++ b/cmake_modules/FindLua.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -1,37 +1,26 @@ -# Find the Lua library -# -------------------- -# On Android/Windows/OSX this just defines the name of the library that -# will be compiled from our bundled sources -# On Linux it will try to load the system library and fallback to compiling -# the bundled one when nothing is found - -set(LUA_FOUND false) -set(LUA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/liblua) +# Find liblua +# +# Once done this will define +# LUA_FOUND - system has Lua +# LUA_INCLUDE_DIR - the Lua include directory +# LUA_LIBRARY - The library needed to use Lua +# Copyright (c) 2013, Vittorio Giovara +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. -if (ANDROID) - SET(LUA_DEFAULT "liblua5.1.so") -else (ANDROID) - IF(WIN32) - SET(LUA_DEFAULT lua.dll) - ELSE(WIN32) - IF(APPLE) - SET(LUA_DEFAULT lua) - ELSE(APPLE) - #locate the system's lua library - FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib) - IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND") - set(LUA_DEFAULT lua) - ELSE() - set(LUA_FOUND true) - message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}") - find_path(LUA_INCLUDE_DIR lua.h) - #remove the path (fpc doesn't like it - why?) - GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME) - ENDIF() - ENDIF(APPLE) - ENDIF(WIN32) -ENDIF(ANDROID) +include(FindPackageHandleStandardArgs) -SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!") +find_path(LUA_INCLUDE_DIR lua.h + PATHS /usr/include /usr/local/include /usr/pkg/include + PATH_SUFFIXES lua5.1 lua51) +find_library(LUA_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua + PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib) +find_package_handle_standard_args(Lua DEFAULT_MSG LUA_LIBRARY LUA_INCLUDE_DIR) +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY) diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/compilerchecks.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/compilerchecks.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,77 @@ + +#TESTING TIME +include(CheckCCompilerFlag) +#when you need to check for a linker flag, just leave the argument of "check_c_compiler_flag" empty + +# CMAKE_C{XX}_FLAGS is for compiler flags (c and c++) +# CMAKE_EXE_LINKER_FLAGS is for linker flags (also add them to pascal_flags and haskell_flags) +# CMAKE_SHARED_LIBRARY__FLAGS same but for shared libraries + +#TODO: should there be two different checks for C and CXX? + +#stack protection, when found it needs to go in the linker flags too +#it is disabled on win32 because it adds a dll and messes with linker +#(see 822312 654424 on bugzilla.redhat.com) +check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) +if(HAVE_STACKPROTECTOR AND (NOT WIN32)) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -fstack-protector-all -fstack-protector") +endif() + +#symbol visibility, not supported on Windows +check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITY) +if(HAVE_VISIBILITY AND (NOT WIN32)) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +endif() + + +#check for noexecstack on ELF, Gentoo security +set(CMAKE_REQUIRED_FLAGS "-Wl,-z,noexecstack") +check_c_compiler_flag("" HAVE_NOEXECSTACK) +if(HAVE_NOEXECSTACK) + append_linker_flag("-znoexecstack") +endif() + +#check for full relro on ELF, Debian security +set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro,-znow") +check_c_compiler_flag("" HAVE_RELROFULL) +if(HAVE_RELROFULL) + append_linker_flag("-zrelro") + append_linker_flag("-znow") +else() + #if full relro is not available, try partial relro + set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro") + check_c_compiler_flag("" HAVE_RELROPARTIAL) + if(HAVE_RELROPARTIAL) + append_linker_flag("-zrelro") + endif() +endif() + +#check for ASLR on Windows Vista or later, requires binutils >= 2.20 +set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat") +check_c_compiler_flag("" HAVE_WINASLR) +if(HAVE_WINASLR) + append_linker_flag("--nxcompat") +endif() + +#check for DEP on Windows XP SP2 or later, requires binutils >= 2.20 +set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase") +check_c_compiler_flag("" HAVE_WINDEP) +if(HAVE_WINDEP) + append_linker_flag("--dynamicbase") +endif() + +#this is actually an optimisation +set(CMAKE_REQUIRED_FLAGS "-Wl,--as-needed") +check_c_compiler_flag("" HAVE_ASNEEDED) +if(HAVE_ASNEEDED) + append_linker_flag("--as-needed") +endif() + +#always unset or these flags will be spread everywhere +unset(CMAKE_REQUIRED_FLAGS) + diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/cpackvars.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/cpackvars.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,106 @@ + +# revision information in cpack-generated names +if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(full_suffix "${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION}") +else() + set(full_suffix "${HEDGEWARS_VERSION}") +endif() + +# CPack variables +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a free turn-based strategy game") +set(CPACK_PACKAGE_VENDOR "Hedgewars Project") +set(CPACK_PACKAGE_FILE_NAME "Hedgewars-${full_suffix}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${full_suffix}") +set(CPACK_SOURCE_GENERATOR "TBZ2") +set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "Hedgewars") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${full_suffix}") +set(CPACK_STRIP_FILES true) + +if(WIN32 AND NOT UNIX) + set(CPACK_NSIS_DISPLAY_NAME "Hedgewars") + set(CPACK_NSIS_HELP_LINK "http://www.hedgewars.org/") + set(CPACK_NSIS_URL_INFO_ABOUT "http://www.hedgewars.org/") + set(CPACK_NSIS_CONTACT "unC0Rr@gmail.com") + set(CPACK_NSIS_MODIFY_PATH OFF) + set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") + set(CPACK_NSIS_MUI_FINISHPAGE_RUN "hedgewars${CMAKE_EXECUTABLE_SUFFIX}") + set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hedgewars.lnk' '$INSTDIR\\\\hedgewars.exe'") + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "hedgewars") +endif(WIN32 AND NOT UNIX) + +set(CPACK_SOURCE_IGNORE_FILES + #temporary files + "~" + ".swp" + #version control + "\\\\.hg" + "\\\\.orig$" + #output binary/library + "\\\\.exe$" + "\\\\.a$" + "\\\\.so$" + "\\\\.dylib$" + "\\\\.dll$" + "\\\\.ppu$" + "\\\\.o$" + "\\\\.cxx$" + "\\\\.hi$" + #graphics + "\\\\.xcf$" + "\\\\.svg$" + "\\\\.svgz$" + "\\\\.psd$" + "\\\\.sifz$" + #misc + "\\\\.core$" + "\\\\.layout$" + "\\\\.db$" + "\\\\.dof$" + "\\\\.or$" + "\\\\.stackdump$" + #archives + "\\\\.zip$" + "\\\\.gz$" + "\\\\.bz2$" + "\\\\.tmp$" + #cmake-configured files + "hwconsts\\\\.cpp$" + "config\\\\.inc$" + "hwengine\\\\.desktop$" + "Info\\\\.plist$" + #qt extra files + "moc_.*\\\\.cxx_parameters" + "\\\\.qrc.depends$" + "\\\\.qm$" + #other cmake generated files + "Makefile$" + "Doxyfile" + "CMakeFiles" + "[dD]ebug$" + "[rR]elease$" + "CPack" + "cmake_install\\\\.cmake$" + "cmake_uninstall\\\\.cmake$" + "CMakeCache\\\\.txt$" + "build_windows_.*\\\\.bat$" +# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libtremor" +# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libfreetype" +# "^${CMAKE_CURRENT_SOURCE_DIR}/misc/liblua" +# "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/frontlib" +# "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/cmdlineClient" + "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libopenalbridge" + "^${CMAKE_CURRENT_SOURCE_DIR}/misc/winutils/bin" + "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/promotional_art" + "^${CMAKE_CURRENT_SOURCE_DIR}/tools/templates" + "^${CMAKE_CURRENT_SOURCE_DIR}/tools/drawMapTest" + "^${CMAKE_CURRENT_SOURCE_DIR}/doc" + "^${CMAKE_CURRENT_SOURCE_DIR}/tmp" + "^${CMAKE_CURRENT_SOURCE_DIR}/utils" + "^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Maps/test" + "^${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.txt" + "^${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt" + "^${CMAKE_CURRENT_SOURCE_DIR}/hedgewars\\\\." +) + +include(CPack) diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/paths.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/paths.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,77 @@ +#where to build libs and bins +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +#these variables are for non-makefile generators +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${LIBRARY_OUTPUT_PATH}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${LIBRARY_OUTPUT_PATH}) + +#resource paths +if(UNIX AND NOT APPLE) + set(target_binary_install_dir "bin") + set(target_library_install_dir "lib") + + string(SUBSTRING "${DATA_INSTALL_DIR}" 0 1 sharepath_start) + if (NOT (${sharepath_start} MATCHES "/")) + set(HEDGEWARS_DATADIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/") + else() + set(HEDGEWARS_DATADIR "${DATA_INSTALL_DIR}/") + endif() + set(HEDGEWARS_FULL_DATADIR "${HEDGEWARS_DATADIR}") +else() + set(target_binary_install_dir "./") + + if(APPLE) + set(target_library_install_dir "../Frameworks/") + set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/") + set(HEDGEWARS_DATADIR "../Resources/") + set(HEDGEWARS_FULL_DATADIR "/Applications/${CMAKE_INSTALL_PREFIX}/${HEDGEWARS_DATADIR}") + elseif(WIN32) + set(target_library_install_dir "./") + set(HEDGEWARS_DATADIR "./") + set(HEDGEWARS_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/") + link_directories("${EXECUTABLE_OUTPUT_PATH}" "${CMAKE_SOURCE_DIR}/misc/winutils/bin") + endif() +endif() + + +#RPATH SETTINGS +#necessary for dynamic libraries on UNIX, ignored elsewhere + +#use, i.e. don't skip the full RPATH for the build tree +set(CMAKE_SKIP_BUILD_RPATH FALSE) +set(CMAKE_SKIP_INSTALL_RPATH FALSE) + +#it's safe to use our RPATH because it is relative +set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + +#paths where to find libraries (final slash not optional): +# - the first is relative to the executable +# - the second is the same directory of the executable (so it runs in bin/) +# - the third one is the full path of the system dir +#source http://www.cmake.org/pipermail/cmake/2008-January/019290.html +set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") +set(CMAKE_INSTALL_RPATH_ESCAPED "$$ORIGIN/../${target_library_install_dir}/:$$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/") + +if(UNIX AND NOT APPLE) + #make sure $ORIGIN is respected + append_linker_flag("-zorigin") + #apply RPATH settings to pascal and haskell executables + list(APPEND pascal_flags "-k-rpath" "-k'${CMAKE_INSTALL_RPATH_ESCAPED}'") + list(APPEND haskell_flags "-optl" "-Wl,-rpath,'${CMAKE_INSTALL_RPATH_ESCAPED}'") +endif() + +#add the automatically determined parts of the RPATH +#which point to directories outside the build tree to the install RPATH +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + + +#install_name_tool magic for OS X +set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks") + diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/platform.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/platform.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,87 @@ + +if(APPLE) + set(CMAKE_FIND_FRAMEWORK "FIRST") + +#what system are we building for + set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET}) + +#detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version + find_program(sw_vers sw_vers) + if(sw_vers) + execute_process(COMMAND ${sw_vers} "-productVersion" + OUTPUT_VARIABLE current_macosx_version + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version}) + else() + if(NOT minimum_macosx_version) + message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set") + else() + message("*** sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable ***") + set(current_macosx_version ${minimum_macosx_version}) + endif() + endif() + +#if nothing is set, we deploy only for the current system + if(NOT minimum_macosx_version) + set(minimum_macosx_version ${current_macosx_version}) + endif() + +#lower systems don't have enough processing power anyway + if (minimum_macosx_version VERSION_LESS "10.4") + message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4") + endif() + +#workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2) + if(current_macosx_version VERSION_EQUAL "10.4") + find_package(SDL_mixer REQUIRED) + set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg") + set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DYLIB_SMPEG} ${DYLIB_MIKMOD}") + set(CMAKE_CX_FLAGS "${CMAKE_CX_FLAGS} ${DYLIB_SMPEG} ${DYLIB_MIKMOD}") + list(APPEND pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}") + endif() + +#CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking + if(NOT CMAKE_OSX_ARCHITECTURES) + if(current_macosx_version VERSION_LESS "10.6") + if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*") + set(CMAKE_OSX_ARCHITECTURES "ppc7400") + else() + set(CMAKE_OSX_ARCHITECTURES "i386") + endif() + else() + set(CMAKE_OSX_ARCHITECTURES "x86_64") + endif() + endif() + +#CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on +#we need to provide the correct one when host and target differ + if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) + if(minimum_macosx_version VERSION_EQUAL "10.4") + set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/") + set(CMAKE_C_COMPILER "/Developer/usr/bin/gcc-4.0") + set(CMAKE_CXX_COMPILER "/Developer/usr/bin/g++-4.0") + else() + string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version}) + set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/") + endif() + endif() + +#add user framework directory, other paths can be passed via FPFLAGS + list(APPEND pascal_flags "-Ff~/Library/Frameworks") +#set deployment target + list(APPEND pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}") + +endif(APPLE) + +if(MINGW) + #this flags prevents a few dll hell problems + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc ") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc ") +endif(MINGW) + +if(WIN32) + if(NOT ${BUILD_SHARED_LIB}) + message(FATAL_ERROR "Static linking is not supported on Windows") + endif() +endif(WIN32) diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/revinfo.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/revinfo.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,38 @@ +#detect Mercurial revision and init rev/hash information +find_program(HGCOMMAND hg) +if(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg)) + execute_process(COMMAND ${HGCOMMAND} identify -in + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE internal_version + ERROR_QUIET + ) + #check local repo status + string(REGEX REPLACE "[^+]" "" HGCHANGED ${internal_version}) + string(REGEX REPLACE "[0-9a-zA-Z]+(.*) ([0-9]+)(.*)" "\\2" HEDGEWARS_REVISION ${internal_version}) + string(REGEX REPLACE "([0-9a-zA-Z]+)(.*) [0-9]+(.*)" "\\1" HEDGEWARS_HASH ${internal_version}) + + if(HGCHANGED) + message("*** You have uncommitted changes in your repository ***") + endif() + #let's assume that if you have hg you might be interested in debugging + set(default_build_type "DEBUG") + #write down hash and rev for easy picking should hg be missing + file(WRITE "${CMAKE_SOURCE_DIR}/share/version_info.txt" "Hedgewars versioning information, do not modify\nrev ${HEDGEWARS_REVISION}\nhash ${HEDGEWARS_HASH}\n") +else() + set(default_build_type "RELEASE") + # when compiling outside rev control, fetch revision and hash information from version_info.txt + find_file(version_info version_info.txt PATH ${CMAKE_SOURCE_DIR}/share) + if(version_info) + file(STRINGS ${version_info} internal_version REGEX "rev") + string(REGEX REPLACE "rev ([0-9]*)" "\\1" HEDGEWARS_REVISION ${internal_version}) + file(STRINGS ${version_info} internal_version REGEX "hash") + string(REGEX REPLACE "hash ([a-zA-Z0-9]*)" "\\1" HEDGEWARS_HASH ${internal_version}) + else() + message(WARNING "${CMAKE_SOURCE_DIR}/share/version_info.txt not found, revision information " + "will be incorrect!!! Contact your source provider to fix this!") + set(HEDGEWARS_REVISION "0000") + set(HEDGEWARS_HASH "unknown") + endif() +endif() + + diff -r 11438c0bd46b -r bce8cf41d666 cmake_modules/utils.cmake --- a/cmake_modules/utils.cmake Tue Apr 30 01:47:30 2013 +0200 +++ b/cmake_modules/utils.cmake Thu Jun 13 22:27:23 2013 +0200 @@ -25,6 +25,13 @@ endif(NOT ${_VAR_NAME}) endmacro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG) +macro(append_linker_flag _FLAG) + list(APPEND pascal_flags "-k${_FLAG}") + list(APPEND haskell_flags "-optl" "${_FLAG}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,${_FLAG}") + set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -Wl,${_FLAG}") + set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -Wl,${_FLAG}") +endmacro(append_linker_flag _FLAG) #TODO: find_package_or_bundle diff -r 11438c0bd46b -r bce8cf41d666 gameServer/Actions.hs --- a/gameServer/Actions.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/Actions.hs Thu Jun 13 22:27:23 2013 +0200 @@ -20,6 +20,7 @@ import Control.Exception import System.Process import Network.Socket +import System.Random ----------------------------- #if defined(OFFICIAL_SERVER) import OfficialServer.GameReplayStore @@ -161,7 +162,13 @@ rnc <- gets roomsClients io $ do - modifyClient rnc (\cl -> cl{teamsInGame = 0, isReady = False, isMaster = False, isInGame = False, clientClan = Nothing}) ci + modifyClient rnc ( + \cl -> cl{teamsInGame = 0 + , isReady = False + , isMaster = False + , isInGame = False + , isJoinedMidGame = False + , clientClan = Nothing}) ci modifyRoom rnc (\r -> r{playersIn = playersIn r + 1}) ri moveClientToRoom rnc ri ci @@ -206,8 +213,9 @@ rnc <- gets roomsClients newMasterId <- liftM (\ids -> fromMaybe (last . filter (/= ci) $ ids) delegateId) . io $ roomClientsIndicesM rnc ri newMaster <- io $ client'sM rnc id newMasterId + oldMasterId <- io $ room'sM rnc masterID ri + oldMaster <- io $ client'sM rnc id oldMasterId oldRoomName <- io $ room'sM rnc name ri - oldMaster <- client's nick kicked <- client's isKickedFromServer thisRoomChans <- liftM (map sendChan) $ roomClientsS ri let newRoomName = if (proto < 42) || kicked then nick newMaster else oldRoomName @@ -216,12 +224,13 @@ , name = newRoomName , isRestrictedJoins = False , isRestrictedTeams = False - , isRegisteredOnly = False - , readyPlayers = if isReady newMaster then readyPlayers r else readyPlayers r + 1}) - , ModifyClient2 newMasterId (\c -> c{isMaster = True, isReady = True}) + , isRegisteredOnly = False} + ) + , ModifyClient2 newMasterId (\c -> c{isMaster = True}) + , ModifyClient2 oldMasterId (\c -> c{isMaster = False}) , AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"] - , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", oldMaster] - , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+hr", nick newMaster] + , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", nick oldMaster] + , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+h", nick newMaster] ] newRoom' <- io $ room'sM rnc id ri @@ -287,7 +296,7 @@ pr <- client's clientProto mapM_ processAction [ AnswerClients (map sendChan roomPlayers) $ notReadyMessage pr . map nick . filter (not . isMaster) $ roomPlayers - , ModifyRoomClients (\cl -> cl{isReady = isMaster cl}) + , ModifyRoomClients (\cl -> cl{isReady = isMaster cl, isJoinedMidGame = False}) , ModifyRoom (\r -> r{readyPlayers = 1}) ] where @@ -298,10 +307,17 @@ rnc <- gets roomsClients ri <- clientRoomA thisRoomChans <- liftM (map sendChan) $ roomClientsS ri + joinedMidGame <- liftM (filter isJoinedMidGame) $ roomClientsS ri answerRemovedTeams <- io $ - room'sM rnc (map (\t -> AnswerClients thisRoomChans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo) ri + room'sM rnc (\r -> let gi = fromJust $ gameInfo r in + concatMap (\c -> + (answerFullConfigParams c (mapParams r) (params r)) + ++ + (map (\t -> AnswerClients [sendChan c] ["REMOVE_TEAM", t]) $ leftTeams gi) + ) joinedMidGame + ) ri - mapM_ processAction $ + mapM_ processAction $ ( SaveReplay : ModifyRoom (\r -> r{ @@ -309,10 +325,11 @@ readyPlayers = 0 } ) - : UnreadyRoomClients : SendUpdateOnThisRoom : AnswerClients thisRoomChans ["ROUND_FINISHED"] : answerRemovedTeams + ) + ++ [UnreadyRoomClients] processAction (SendTeamRemovalMessage teamName) = do @@ -381,7 +398,7 @@ if p < 38 then processAction $ ByeClient $ loc "Nickname is already in use" else - processAction $ NoticeMessage NickAlreadyInUse + mapM_ processAction [NoticeMessage NickAlreadyInUse, ModifyClient $ \c -> c{nick = B.empty}] else do db <- gets (dbQueries . serverInfo) @@ -615,6 +632,12 @@ processAction $ Warning versionsStats +processAction (Random chans items) = do + let i = if null items then ["heads", "tails"] else items + n <- io $ randomRIO (0, length i - 1) + processAction $ AnswerClients chans ["CHAT", "[random]", i !! n] + + #if defined(OFFICIAL_SERVER) processAction SaveReplay = do ri <- clientRoomA diff -r 11438c0bd46b -r bce8cf41d666 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/CoreTypes.hs Thu Jun 13 22:27:23 2013 +0200 @@ -75,6 +75,7 @@ | CheckRecord | CheckFailed B.ByteString | CheckSuccess [B.ByteString] + | Random [ClientChan] [B.ByteString] type ClientChan = Chan [B.ByteString] @@ -106,10 +107,10 @@ isAdministrator :: Bool, isChecker :: Bool, isKickedFromServer :: Bool, + isJoinedMidGame :: Bool, clientClan :: !(Maybe B.ByteString), checkInfo :: Maybe CheckInfo, - teamsInGame :: Word, - actionsPending :: [Action] + teamsInGame :: Word } instance Eq ClientInfo where @@ -238,8 +239,8 @@ ServerInfo True "

http://www.hedgewars.org/

" - "

Hedgewars 0.9.18 is out! Please update.

Download page here" - 43 -- latestReleaseVersion + "

Hedgewars 0.9.19 is out! Please update.

Download page here" + 45 -- latestReleaseVersion 41 -- earliestCompatibleVersion 46631 "" diff -r 11438c0bd46b -r bce8cf41d666 gameServer/HWProtoChecker.hs --- a/gameServer/HWProtoChecker.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/HWProtoChecker.hs Thu Jun 13 22:27:23 2013 +0200 @@ -1,17 +1,12 @@ {-# LANGUAGE OverloadedStrings #-} module HWProtoChecker where -import qualified Data.Map as Map import Data.Maybe -import Data.List import Control.Monad.Reader -------------------------------------- import CoreTypes import Actions -import Utils import HandlerUtils -import RoomsAndClients -import EngineInteraction handleCmd_checker :: CmdHandler diff -r 11438c0bd46b -r bce8cf41d666 gameServer/HWProtoCore.hs --- a/gameServer/HWProtoCore.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/HWProtoCore.hs Thu Jun 13 22:27:23 2013 +0200 @@ -4,7 +4,6 @@ import Control.Monad.Reader import Data.Maybe import qualified Data.ByteString.Char8 as B -import qualified Data.List as L -------------------------------------- import CoreTypes import Actions @@ -30,26 +29,28 @@ handleCmd ["PONG"] = do cl <- thisClient if pingsQueue cl == 0 then - return $ actionsPending cl ++ [ModifyClient (\c -> c{actionsPending = []})] + return [ProtocolError "Protocol violation"] else return [ModifyClient (\c -> c{pingsQueue = pingsQueue c - 1})] -handleCmd ("CMD" : parameters) = - let c = concatMap B.words parameters in - if not $ null c then - h $ (upperCase . head $ c) : tail c - else - return [] +handleCmd ["CMD", parameters] = do + let (cmd, plist) = B.break (== ' ') parameters + let param = B.dropWhile (== ' ') plist + h (upperCase cmd) param where - h ["DELEGATE", n] = handleCmd ["DELEGATE", n] - h ["STATS"] = handleCmd ["STATS"] - h ["PART", msg] = handleCmd ["PART", msg] - h ["QUIT", msg] = handleCmd ["QUIT", msg] - h ["GLOBAL", msg] = do + h "DELEGATE" n | not $ B.null n = handleCmd ["DELEGATE", n] + h "STATS" _ = handleCmd ["STATS"] + h "PART" m | not $ B.null m = handleCmd ["PART", m] + | otherwise = handleCmd ["PART"] + h "QUIT" m | not $ B.null m = handleCmd ["QUIT", m] + | otherwise = handleCmd ["QUIT"] + h "RND" p = handleCmd ("RND" : B.words p) + h "GLOBAL" p = do + cl <- thisClient rnc <- liftM snd ask let chans = map (sendChan . client rnc) $ allClients rnc - return [AnswerClients chans ["CHAT", "[global notice]", msg]] - h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c] + return [AnswerClients chans ["CHAT", "[global notice]", p] | isAdministrator cl] + h c p = return [Warning $ B.concat ["Unknown cmd: /", c, p]] handleCmd cmd = do (ci, irnc) <- ask @@ -72,9 +73,9 @@ let cl = rnc `client` fromJust maybeClientId let roomId = clientRoom rnc clientId let clRoom = room rnc roomId - let roomMasterSign = if isMaster cl then "@" else "" + let roomMasterSign = if isMaster cl then "+" else "" let adminSign = if isAdministrator cl then "@" else "" - let rInfo = if roomId /= lobbyId then B.concat [roomMasterSign, "room ", name clRoom] else adminSign `B.append` "lobby" + let rInfo = if roomId /= lobbyId then B.concat [adminSign, roomMasterSign, "room ", name clRoom] else adminSign `B.append` "lobby" let roomStatus = if isJust $ gameInfo clRoom then if teamsInGame cl > 0 then "(playing)" else "(spectating)" else diff -r 11438c0bd46b -r bce8cf41d666 gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/HWProtoInRoomState.hs Thu Jun 13 22:27:23 2013 +0200 @@ -54,12 +54,12 @@ roomChans <- roomClientsChans cl <- thisClient teamColor <- - if clientProto cl < 42 then + if clientProto cl < 42 then return color else liftM (head . (L.\\) (map B.singleton ['0'..]) . map teamcolor . teams) thisRoom let roomTeams = teams rm - let hhNum = let p = if not $ null roomTeams then hhnum $ head roomTeams else 4 in newTeamHHNum roomTeams p + let hhNum = let p = if not $ null roomTeams then minimum [hhnum $ head roomTeams, canAddNumber roomTeams] else 4 in newTeamHHNum roomTeams p let newTeam = clNick `seq` TeamInfo ci clNick tName teamColor grave fort voicepack flag dif hhNum (hhsList hhsInfo) return $ if not . null . drop (maxTeams rm - 1) $ roomTeams then @@ -79,10 +79,7 @@ AnswerClients clChan ["TEAM_ACCEPTED", tName], AnswerClients othChans $ teamToNet $ newTeam, AnswerClients roomChans ["TEAM_COLOR", tName, teamColor], - ModifyClient $ \c -> c{actionsPending = actionsPending cl - ++ [AnswerClients clChan ["HH_NUM", tName, showB $ hhnum newTeam]] - }, - AnswerClients [sendChan cl] ["PING"] + AnswerClients roomChans ["HH_NUM", tName, showB $ hhnum newTeam] ] where canAddNumber rt = (48::Int) - (sum $ map hhnum rt) @@ -172,17 +169,15 @@ handleCmd_inRoom ["TOGGLE_READY"] = do cl <- thisClient chans <- roomClientsChans - if isMaster cl then - return [] - else - return [ - ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), - ModifyClient (\c -> c{isReady = not $ isReady cl}), - AnswerClients chans $ if clientProto cl < 38 then - [if isReady cl then "NOT_READY" else "READY", nick cl] - else - ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl] - ] + + return [ + ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}), + ModifyClient (\c -> c{isReady = not $ isReady cl}), + AnswerClients chans $ if clientProto cl < 38 then + [if isReady cl then "NOT_READY" else "READY", nick cl] + else + ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl] + ] handleCmd_inRoom ["START_GAME"] = do @@ -336,7 +331,7 @@ chans <- roomSameClanChans return [AnswerClients chans ["EM", engineMsg cl]] where - engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"] + engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, " (team): ", msg, "\x20\x20"] handleCmd_inRoom ["BAN", banNick] = do @@ -353,6 +348,10 @@ else return [] +handleCmd_inRoom ("RND":rs) = do + n <- clientNick + s <- roomClientsChans + return [AnswerClients s ["CHAT", n, B.unwords $ "/rnd" : rs], Random s rs] handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17) diff -r 11438c0bd46b -r bce8cf41d666 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/HWProtoLobbyState.hs Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} module HWProtoLobbyState where -import qualified Data.Map as Map import Data.Maybe import Data.List import Control.Monad.Reader @@ -51,7 +50,7 @@ [ AddRoom rName roomPassword , AnswerClients [sendChan cl] ["CLIENT_FLAGS", "+hr", nick cl] - , ModifyClient (\c -> c{isMaster = True, isReady = True}) + , ModifyClient (\c -> c{isMaster = True, isReady = True, isJoinedMidGame = False}) , ModifyRoom (\r -> r{readyPlayers = 1}) ] @@ -87,17 +86,15 @@ else [ MoveToRoom jRI + , ModifyClient (\c -> c{isJoinedMidGame = isJust $ gameInfo jRoom}) , AnswerClients [sendChan cl] $ "JOINED" : nicks , AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl] , AnswerClients [sendChan cl] $ ["CLIENT_FLAGS", "+h", ownerNick] ] ++ (if clientProto cl < 38 then map (readynessMessage cl) jRoomClients else [sendStateFlags cl jRoomClients]) - ++ [AnswerClients [sendChan cl] ["PING"] - , ModifyClient $ \c -> c{actionsPending = actionsPending cl - ++ answerFullConfig cl (mapParams jRoom) (params jRoom) - ++ answerTeams cl jRoom - ++ watchRound cl jRoom chans} - ] + ++ answerFullConfig cl jRoom + ++ answerTeams cl jRoom + ++ watchRound cl jRoom chans where readynessMessage cl c = AnswerClients [sendChan cl] [if isReady c then "READY" else "NOT_READY", nick c] @@ -108,18 +105,9 @@ (ingame, inroomlobby) = partition isInGame clients f fl lst = ["CLIENT_FLAGS" : fl : map nick lst | not $ null lst] - toAnswer cl (paramName, paramStrs) = AnswerClients [sendChan cl] $ "CFG" : paramName : paramStrs - - answerFullConfig cl mpr pr - | clientProto cl < 38 = map (toAnswer cl) $ - (reverse . map (\(a, b) -> (a, [b])) $ Map.toList mpr) - ++ (("SCHEME", pr Map.! "SCHEME") - : (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr)) - - | otherwise = map (toAnswer cl) $ - ("FULLMAPCONFIG", Map.elems mpr) - : ("SCHEME", pr Map.! "SCHEME") - : (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr) + -- get config from gameInfo if possible, otherwise from room + answerFullConfig cl jRoom = let f r g = (if isJust $ gameInfo jRoom then g . fromJust . gameInfo else r) jRoom + in answerFullConfigParams cl (f mapParams giMapParams) (f params giParams) answerTeams cl jRoom = let f = if isJust $ gameInfo jRoom then teamsAtStart . fromJust . gameInfo else teams in answerAllTeams cl $ f jRoom @@ -147,6 +135,11 @@ else liftM ((:) (AnswerClients [clChan] ["JOINING", roomName])) $ handleCmd_lobby ["JOIN_ROOM", roomName] + +handleCmd_lobby ("RND":rs) = do + c <- liftM sendChan thisClient + return [Random [c] rs] + --------------------------- -- Administrator's stuff -- diff -r 11438c0bd46b -r bce8cf41d666 gameServer/HandlerUtils.hs --- a/gameServer/HandlerUtils.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/HandlerUtils.hs Thu Jun 13 22:27:23 2013 +0200 @@ -6,7 +6,7 @@ import RoomsAndClients import CoreTypes -import Actions + thisClient :: Reader (ClientIndex, IRnC) ClientInfo thisClient = do diff -r 11438c0bd46b -r bce8cf41d666 gameServer/NetRoutines.hs --- a/gameServer/NetRoutines.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/NetRoutines.hs Thu Jun 13 22:27:23 2013 +0200 @@ -44,10 +44,10 @@ False False False + False Nothing Nothing 0 - [] ) writeChan chan $ Accept newClient diff -r 11438c0bd46b -r bce8cf41d666 gameServer/OfficialServer/extdbinterface.hs --- a/gameServer/OfficialServer/extdbinterface.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/OfficialServer/extdbinterface.hs Thu Jun 13 22:27:23 2013 +0200 @@ -14,7 +14,7 @@ dbQueryAccount = - "SELECT users.pass, users_roles.rid FROM users LEFT JOIN users_roles ON users.uid = users_roles.uid WHERE users.name = ?" + "SELECT users.pass, users_roles.rid FROM users LEFT JOIN users_roles ON (users.uid = users_roles.uid AND users_roles.rid = 3) WHERE users.name = ?" dbQueryStats = "INSERT INTO gameserver_stats (players, rooms, last_update) VALUES (?, ?, UNIX_TIMESTAMP())" @@ -29,7 +29,7 @@ execute statement [SqlByteString clNick] passAndRole <- fetchRow statement finish statement - let response = + let response = if isJust passAndRole then ( clId, diff -r 11438c0bd46b -r bce8cf41d666 gameServer/Utils.hs --- a/gameServer/Utils.hs Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/Utils.hs Thu Jun 13 22:27:23 2013 +0200 @@ -56,7 +56,7 @@ t : replaceTeam tm ts illegalName :: B.ByteString -> Bool -illegalName s = B.null s || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s +illegalName s = B.null s || B.length s > 40 || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s where isIllegalChar c = c `List.elem` "$()*+?[]^{|}" @@ -90,6 +90,8 @@ , (42, "0.9.18-dev") , (43, "0.9.18") , (44, "0.9.19-dev") + , (45, "0.9.19") + , (46, "0.9.20-dev") ] askFromConsole :: B.ByteString -> IO B.ByteString @@ -135,5 +137,25 @@ head (Map.findWithDefault ["Default"] "AMMO" (params r)) ] + +answerFullConfigParams :: + ClientInfo + -> Map.Map B.ByteString B.ByteString + -> Map.Map B.ByteString [B.ByteString] + -> [Action] +answerFullConfigParams cl mpr pr + | clientProto cl < 38 = map (toAnswer cl) $ + (reverse . map (\(a, b) -> (a, [b])) $ Map.toList mpr) + ++ (("SCHEME", pr Map.! "SCHEME") + : (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr)) + + | otherwise = map (toAnswer cl) $ + ("FULLMAPCONFIG", Map.elems mpr) + : ("SCHEME", pr Map.! "SCHEME") + : (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr) + where + toAnswer cl (paramName, paramStrs) = AnswerClients [sendChan cl] $ "CFG" : paramName : paramStrs + + loc :: B.ByteString -> B.ByteString loc = id diff -r 11438c0bd46b -r bce8cf41d666 gameServer/hedgewars-server.cabal --- a/gameServer/hedgewars-server.cabal Tue Apr 30 01:47:30 2013 +0200 +++ b/gameServer/hedgewars-server.cabal Thu Jun 13 22:27:23 2013 +0200 @@ -22,6 +22,7 @@ bytestring, bytestring-show, network >= 2.3, + random, time, mtl >= 2, dataenc, diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/ArgParsers.inc --- a/hedgewars/ArgParsers.inc Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/ArgParsers.inc Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -170,9 +170,9 @@ mediaArray: Array [1..10] of String = ('--fullscreen-width', '--fullscreen-height', '--width', '--height', '--depth', '--volume','--nomusic','--nosound','--locale','--fullscreen'); allArray: Array [1..14] of String = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth','--volume','--nomusic','--nosound','--locale','--fullscreen','--showfps','--altdmg','--frame-interval','--low-quality'); reallyAll: array[0..30] of shortstring = ( - '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width', + '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width', '--height', '--frame-interval', '--volume','--nomusic', '--nosound', - '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick', + '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick', {deprecated} '--depth', '--set-video', '--set-audio', '--set-other', '--set-multimedia', '--set-everything', {internal} '--internal', '--port', '--recorder', '--landpreview', {misc} '--stats-only', '--gci', '--help'); @@ -189,12 +189,12 @@ {--prefix} 0 : PathPrefix := getStringParameter (arg, paramIndex, parseParameter); {--user-prefix} 1 : UserPathPrefix := getStringParameter (arg, paramIndex, parseParameter); {--locale} 2 : cLocaleFName := getStringParameter (arg, paramIndex, parseParameter); - {--fullscreen-width} 3 : cFullscreenWidth := getLongIntParameter(arg, paramIndex, parseParameter); - {--fullscreen-height} 4 : cFullscreenHeight := getLongIntParameter(arg, paramIndex, parseParameter); - {--width} 5 : cWindowedWidth := getLongIntParameter(arg, paramIndex, parseParameter); - {--height} 6 : cWindowedHeight := getLongIntParameter(arg, paramIndex, parseParameter); + {--fullscreen-width} 3 : cFullscreenWidth := max(getLongIntParameter(arg, paramIndex, parseParameter), cMinScreenWidth); + {--fullscreen-height} 4 : cFullscreenHeight := max(getLongIntParameter(arg, paramIndex, parseParameter), cMinScreenHeight); + {--width} 5 : cWindowedWidth := max(2 * (getLongIntParameter(arg, paramIndex, parseParameter) div 2), cMinScreenWidth); + {--height} 6 : cWindowedHeight := max(2 * (getLongIntParameter(arg, paramIndex, parseParameter) div 2), cMinScreenHeight); {--frame-interval} 7 : cTimerInterval := getLongIntParameter(arg, paramIndex, parseParameter); - {--volume} 8 : SetVolume ( getLongIntParameter(arg, paramIndex, parseParameter) ); + {--volume} 8 : SetVolume ( max(getLongIntParameter(arg, paramIndex, parseParameter), 0) ); {--nomusic} 9 : SetMusic ( false ); {--nosound} 10 : SetSound ( false ); {--fullscreen} 11 : cFullScreen := true; @@ -270,7 +270,7 @@ end; inc(index); end; - + WriteLn(stdout, 'Attempted to automatically convert to the new syntax:'); WriteLn(stdout, newSyntax); WriteLn(stdout, ''); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -5,10 +5,7 @@ find_package(SDL_mixer) include (CheckLibraryExists) -#Mix_Init/Mix_Quit from SDL_mixer 1.2.10 -check_library_exists(${SDLMIXER_LIBRARY} Mix_Init "" HAVE_MIXINIT) -#IMG_Init/IMG_Quit from SDL_image 1.2.8 -check_library_exists(${SDLIMAGE_LIBRARY} IMG_Init "" HAVE_IMGINIT) + enable_language(Pascal) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) @@ -84,6 +81,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/config.inc ) +if(${BUILD_ENGINE_LIBRARY}) + message("*** Engine will be built as library (experimental) ***") + list(APPEND pascal_flags "-dHWLIBRARY") +endif() include(${CMAKE_MODULE_PATH}/utils.cmake) @@ -143,20 +144,23 @@ find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP") if(PNG_FOUND) - get_filename_component(PNG_LIB_DIR ${PNG_LIBRARY} PATH) - add_definitions(-dPNG_SCREENSHOTS) - add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIB_DIR}) + list(REMOVE_AT PNG_LIBRARIES 1) #removing the zlib library path + get_filename_component(PNG_LIBRARY_DIR ${PNG_LIBRARIES} PATH) + list(APPEND pascal_flags "-dPNG_SCREENSHOTS" "-Fl${PNG_LIBRARY_DIR}" "-k-L${PNG_LIBRARY_DIR}") endif() -if(NOT LUA_FOUND) - list(APPEND HW_LINK_LIBS lua) - add_flag_append(CMAKE_Pascal_FLAGS -k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a) - #linking with liblua.a requires system readline - if(UNIX) - add_flag_append(CMAKE_Pascal_FLAGS -k-lreadline) - endif(UNIX) +if(LUA_FOUND AND LUA_SYSTEM) + get_filename_component(LUA_LIBRARY_DIR ${LUA_LIBRARY} PATH) + get_filename_component(LUA_LIBRARY_NAME ${LUA_LIBRARY} NAME) + #NAME_WE would strip the .1 (or .2) next to the ".so" + string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_PREFIX}(.*)${CMAKE_SHARED_LIBRARY_SUFFIX}" "\\1" LUA_LIBRARY_NAME "${LUA_LIBRARY_NAME}") + list(APPEND pascal_flags ) + list(APPEND pascal_flags "-Fl${LUA_LIBRARY_DIR}" + "-k-L${LUA_LIBRARY_DIR}" + "-XLAlua=${LUA_LIBRARY_NAME}") endif() + if(NOT PHYSFS_FOUND) add_definitions(-dPHYSFS_INTERNAL) list(APPEND HW_LINK_LIBS physfs) @@ -167,14 +171,19 @@ endif() list(APPEND HW_LINK_LIBS physlayer) +#Mix_Init/Mix_Quit from SDL_mixer 1.2.10 +check_library_exists(${SDLMIXER_LIBRARY} Mix_Init "" HAVE_MIXINIT) if(HAVE_MIXINIT) add_definitions(-dSDL_MIXER_NEWER) endif(HAVE_MIXINIT) +#IMG_Init/IMG_Quit from SDL_image 1.2.8 +check_library_exists(${SDLIMAGE_LIBRARY} IMG_Init "" HAVE_IMGINIT) if(HAVE_IMGINIT) add_definitions(-dSDL_IMAGE_NEWER) endif(HAVE_IMGINIT) +#needs to be last add_definitions(-dDEBUGFILE) #SOURCE AND PROGRAMS SECTION diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/GL.h --- a/hedgewars/GL.h Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#include diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/GSHandlers.inc Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ sX:= dX / steps; sY:= dY / steps; end - + else begin sX:= dX; @@ -75,7 +75,7 @@ end; procedure makeHogsWorry(x, y: hwFloat; r: LongInt); -var +var gi: PGear; d: LongInt; begin @@ -89,7 +89,7 @@ begin if (CurrentHedgehog^.Gear = gi) then PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack) - + else begin if ((gi^.State and gstMoving) = 0) and (gi^.Hedgehog^.Effects[heFrozen] = 0) then @@ -97,15 +97,15 @@ gi^.dX.isNegative:= X r div 2 then - PlaySoundV(sndNooo, gi^.Hedgehog^.Team^.voicepack) + PlaySoundV(sndNooo, gi^.Hedgehog^.Team^.voicepack) else PlaySoundV(sndUhOh, gi^.Hedgehog^.Team^.voicepack); end; end; end; - + gi := gi^.NextGear end; end; @@ -116,10 +116,10 @@ DeleteCI(HH^.Gear); if FollowGear = HH^.Gear then FollowGear:= nil; - + if lastGearByUID = HH^.Gear then lastGearByUID := nil; - + HH^.Gear^.Message:= HH^.Gear^.Message or gmRemoveFromList; with HH^.Gear^ do begin @@ -154,7 +154,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepFallingGear(Gear: PGear); -var +var isFalling: boolean; //tmp: QWord; tdX, tdY: hwFloat; @@ -162,23 +162,17 @@ land: word; begin // clip velocity at 2 - over 1 per pixel, but really shouldn't cause many actual problems. -{$IFNDEF WEB} if Gear^.dX.Round > 2 then Gear^.dX.QWordValue:= 8589934592; if Gear^.dY.Round > 2 then Gear^.dY.QWordValue:= 8589934592; -{$ELSE} - if Gear^.dX.Round > 2 then - begin - Gear^.dX.Round:= 2; - Gear^.dX.Frac:= 0 + + if (Gear^.State and gstSubmersible <> 0) and (hwRound(Gear^.Y) > cWaterLine) then + begin + Gear^.dX:= Gear^.dX * _0_999; + Gear^.dY:= Gear^.dY * _0_999 end; - if Gear^.dY.QWordValue > 2 then - begin - Gear^.dY.Round:= 2; - Gear^.dY.Frac:= 0 - end; -{$ENDIF} + Gear^.State := Gear^.State and (not gstCollision); collV := 0; collH := 0; @@ -186,6 +180,7 @@ tdY := Gear^.dY; + // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) if (hwRound(Gear^.X) < min(LAND_WIDTH div -2, -2048)) or (hwRound(Gear^.X) > max(LAND_WIDTH * 3 div 2, 6144)) then @@ -209,16 +204,16 @@ else if (Gear^.AdvBounce=1) and (TestCollisionYwithGear(Gear, 1) <> 0) then collV := 1; end - else + else begin // Gear^.dY.isNegative is false land:= TestCollisionYwithGear(Gear, 1); if land <> 0 then begin collV := 1; isFalling := false; - if land and lfIce <> 0 then + if land and lfIce <> 0 then Gear^.dX := Gear^.dX * (_0_9 + Gear^.Friction * _0_1) - else + else Gear^.dX := Gear^.dX * Gear^.Friction; Gear^.dY := - Gear^.dY * Gear^.Elasticity; @@ -241,7 +236,7 @@ Gear^.State := Gear^.State or gstCollision end else if (Gear^.AdvBounce=1) and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then - collH := -hwSign(Gear^.dX); + collH := -hwSign(Gear^.dX); //if Gear^.AdvBounce and (collV <>0) and (collH <> 0) and (hwSqr(tdX) + hwSqr(tdY) > _0_08) then if (Gear^.AdvBounce=1) and (collV <>0) and (collH <> 0) and ((collV=-1) or ((tdX.QWordValue + tdY.QWordValue) > _0_2.QWordValue)) then @@ -274,18 +269,18 @@ else Gear^.State := Gear^.State or gstMoving; - if (Gear^.nImpactSounds > 0) and + if (Gear^.nImpactSounds > 0) and (Gear^.State and gstCollision <> 0) and (((Gear^.Kind <> gtMine) and (Gear^.Damage <> 0)) or (Gear^.State and gstMoving <> 0)) and (((Gear^.Radius < 3) and (Gear^.dY < -_0_1)) or - ((Gear^.Radius >= 3) and + ((Gear^.Radius >= 3) and ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)))) then PlaySound(TSound(ord(Gear^.ImpactSound) + LongInt(GetRandom(Gear^.nImpactSounds))), true); end; //////////////////////////////////////////////////////////////////////////////// procedure doStepBomb(Gear: PGear); -var +var i, x, y: LongInt; dX, dY, gdX: hwFloat; vg: PVisualGear; @@ -296,7 +291,7 @@ dec(Gear^.Timer); if Gear^.Timer = 1000 then // might need adjustments - case Gear^.Kind of + case Gear^.Kind of gtGrenade: makeHogsWorry(Gear^.X, Gear^.Y, 50); gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20); gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75); @@ -320,10 +315,10 @@ if Gear^.Timer = 0 then begin - case Gear^.Kind of + case Gear^.Kind of gtGrenade: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, Gear^.Hedgehog, EXPLAutoSound); - gtClusterBomb: + gtClusterBomb: begin x := hwRound(Gear^.X); y := hwRound(Gear^.Y); @@ -336,7 +331,7 @@ FollowGear := AddGear(x, y, gtCluster, 0, dX, dY, 25) end end; - gtWatermelon: + gtWatermelon: begin x := hwRound(Gear^.X); y := hwRound(Gear^.Y); @@ -350,7 +345,7 @@ FollowGear^.DirAngle := i * 60 end end; - gtHellishBomb: + gtHellishBomb: begin x := hwRound(Gear^.X); y := hwRound(Gear^.Y); @@ -366,7 +361,7 @@ AddGear(x, y, gtFlame, 0, dX, -dY, 0) end else - begin + begin AddGear(x, y, gtFlame, 0, dX, dY, 0); AddGear(x, y, gtFlame, gstTmpFlag, dX, -dY, 0) end; @@ -406,7 +401,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepMolotov(Gear: PGear); -var +var s: Longword; i, gX, gY: LongInt; dX, dY: hwFloat; @@ -418,15 +413,14 @@ CalcRotationDirAngle(Gear); // let's add some smoke depending on speed - s:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10); + s:= max(32,152 - round((abs(hwFloat2FLoat(Gear^.dX))+abs(hwFloat2Float(Gear^.dY)))*120))+random(10); if (GameTicks mod s) = 0 then begin // adjust angle to match the texture if Gear^.dX.isNegative then - i:= 130 - else - i:= 50; - + i:= 130 + else i:= 50; + smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+i) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+i) * pi / 180)*20), vgtSmoke); if smoke <> nil then smoke^.Scale:= 0.75; @@ -493,7 +487,11 @@ or (Gear^.Kind = gtBall) then CalcRotationDirAngle(Gear) else if (GameTicks and $1F) = 0 then - AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + begin + if hwRound(Gear^.Y) > cWaterLine then + AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble) + else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + end end; //////////////////////////////////////////////////////////////////////////////// @@ -510,24 +508,31 @@ exit end; if (GameTicks and $3F) = 0 then - AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); + begin + if hwRound(Gear^.Y) > cWaterLine then + AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble) + else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + end end; //////////////////////////////////////////////////////////////////////////////// procedure doStepSnowball(Gear: PGear); var kick, i: LongInt; particle: PVisualGear; + gdX, gdY: hwFloat; begin AllInactive := false; if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; + gdX := Gear^.dX; + gdY := Gear^.dY; doStepFallingGear(Gear); CalcRotationDirAngle(Gear); if (Gear^.State and gstCollision) <> 0 then begin - kick:= hwRound((hwAbs(Gear^.dX)+hwAbs(Gear^.dY)) * _20); - Gear^.dY.isNegative:= not Gear^.dY.isNegative; - Gear^.dX.isNegative:= not Gear^.dX.isNegative; + kick:= hwRound((hwAbs(gdX)+hwAbs(gdY)) * _20); + Gear^.dX:= gdX; + Gear^.dY:= gdY; AmmoShove(Gear, 0, kick); for i:= 15 + kick div 10 downto 0 do begin @@ -669,7 +674,7 @@ begin rx:= rx div 2;ry:= ry div 2; end; - if Land[yy + py, xx + px] and $FF00 = 0 then + if Land[yy + py, xx + px] <= lfAllObjMask then if gun then begin LandDirty[yy div 32, xx div 32]:= 1; @@ -686,10 +691,10 @@ end; p:= @(p^[s^.pitch shr 2]) end; - - // Why is this here. For one thing, there's no test on +1 being safe. + + // Why is this here. For one thing, there's no test on +1 being safe. //Land[py, px+1]:= lfBasic; - + if allpx then UpdateLandTexture(xx, Pred(s^.h), yy, Pred(s^.w), true) else @@ -754,7 +759,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepBeeWork(Gear: PGear); -var +var t: hwFloat; gX,gY,i: LongInt; uw, nuw: boolean; @@ -869,7 +874,7 @@ Gear^.Hedgehog^.Gear^.Message:= Gear^.Hedgehog^.Gear^.Message and (not gmAttack); Gear^.Hedgehog^.Gear^.State:= Gear^.Hedgehog^.Gear^.State and (not gstAttacking); AttackBar:= 0; - + Gear^.SoundChannel := LoopSound(sndBee); Gear^.Timer := 5000; // save initial speed in otherwise unused Friction variable @@ -891,7 +896,7 @@ end; procedure doStepShotgunShot(Gear: PGear); -var +var i: LongWord; shell: PVisualGear; begin @@ -967,7 +972,7 @@ // Bullet trail VGear := AddVisualGear(hwRound(ox), hwRound(oy), vgtLineTrail); - + if VGear <> nil then begin VGear^.X:= hwFloat2Float(ox); @@ -990,7 +995,7 @@ end; procedure doStepBulletWork(Gear: PGear); -var +var i, x, y: LongWord; oX, oY: hwFloat; VGear: PVisualGear; @@ -1005,11 +1010,11 @@ Gear^.Y := Gear^.Y + Gear^.dY; x := hwRound(Gear^.X); y := hwRound(Gear^.Y); - + if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] <> 0) then inc(Gear^.Damage); // let's interrupt before a collision to give portals a chance to catch the bullet - if (Gear^.Damage = 1) and (Gear^.Tag = 0) and not(CheckLandValue(x, y, $FF00)) then + if (Gear^.Damage = 1) and (Gear^.Tag = 0) and not(CheckLandValue(x, y, lfLandMask)) then begin Gear^.Tag := 1; Gear^.Damage := 0; @@ -1027,7 +1032,7 @@ else AmmoShove(Gear, Gear^.Timer, 20); CheckGearDrowning(Gear); - dec(i) + dec(i) until (i = 0) or (Gear^.Damage > Gear^.Health) or ((Gear^.State and gstDrowning) <> 0); if Gear^.Damage > 0 then @@ -1055,7 +1060,7 @@ cLaserSighting := false; if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and ((GameFlags and gfArtillery) = 0) then cArtillery := false; - + // Bullet Hit if (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then begin @@ -1065,7 +1070,7 @@ VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY); end; end; - + spawnBulletTrail(Gear); Gear^.doStep := @doStepShotIdle end; @@ -1081,7 +1086,7 @@ end; procedure doStepSniperRifleShot(Gear: PGear); -var +var HHGear: PGear; shell: PVisualGear; begin @@ -1112,7 +1117,7 @@ Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5; PlaySound(sndGun); // add 3 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths, and also just weird angles - Gear^.X := Gear^.X + Gear^.dX * 3; + Gear^.X := Gear^.X + Gear^.dX * 3; Gear^.Y := Gear^.Y + Gear^.dY * 3; Gear^.doStep := @doStepBulletWork; end @@ -1141,7 +1146,7 @@ begin dec(Gear^.Timer); case Gear^.Kind of - gtATStartGame: + gtATStartGame: begin AllInactive := false; if Gear^.Timer = 0 then @@ -1149,7 +1154,7 @@ AddCaption(trmsg[sidStartFight], cWhiteColor, capgrpGameState); end end; - gtATFinishGame: + gtATFinishGame: begin AllInactive := false; if Gear^.Timer = 1000 then @@ -1172,7 +1177,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepPickHammerWork(Gear: PGear); -var +var i, ei, x, y: LongInt; HHGear: PGear; begin @@ -1231,7 +1236,7 @@ end else begin - if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y + Gear^.dY + cGravity), $FF00) then + if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y + Gear^.dY + cGravity), lfLandMask) then begin Gear^.dY := Gear^.dY + cGravity; Gear^.Y := Gear^.Y + Gear^.dY @@ -1241,7 +1246,7 @@ end; Gear^.X := Gear^.X + HHGear^.dX; - if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)-cHHRadius, $FF00) then + if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)-cHHRadius, lfLandMask) then begin HHGear^.X := Gear^.X; HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius) @@ -1263,7 +1268,7 @@ end; procedure doStepPickHammer(Gear: PGear); -var +var i, y: LongInt; ar: TRangeArray; HHGear: PGear; @@ -1290,11 +1295,11 @@ end; //////////////////////////////////////////////////////////////////////////////// -var +var BTPrevAngle, BTSteps: LongInt; procedure doStepBlowTorchWork(Gear: PGear); -var +var HHGear: PGear; b: boolean; prevX: LongInt; @@ -1303,7 +1308,7 @@ dec(Gear^.Timer); if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then dec(TurnTimeLeft); - + HHGear := Gear^.Hedgehog^.Gear; HedgehogChAngle(HHGear); @@ -1384,7 +1389,7 @@ end; procedure doStepBlowTorch(Gear: PGear); -var +var HHGear: PGear; begin BTPrevAngle := High(LongInt); @@ -1406,7 +1411,9 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepMine(Gear: PGear); var vg: PVisualGear; + dxdy: hwFloat; begin + if Gear^.Health = 0 then dxdy:= hwAbs(Gear^.dX)+hwAbs(Gear^.dY); if (Gear^.State and gstMoving) <> 0 then begin DeleteCI(Gear); @@ -1424,15 +1431,9 @@ doStepFallingGear(Gear); if (Gear^.Health = 0) then begin - if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and (TestCollisionYwithGear(Gear, 1) <> 0) then - inc(Gear^.Damage, hwRound(Gear^.dY * _70)) - else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then - inc(Gear^.Damage, hwRound(Gear^.dX * _70)) - else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0) then - inc(Gear^.Damage, hwRound(Gear^.dY * -_70)) - else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then - inc(Gear^.Damage, hwRound(Gear^.dX * -_70)); - + if (dxdy > _0_4) and (Gear^.State and gstCollision <> 0) then + inc(Gear^.Damage, hwRound(dxdy * _50)); + if ((GameTicks and $FF) = 0) and (Gear^.Damage > random(30)) then begin vg:= AddVisualGear(hwRound(Gear^.X) - 4 + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke); @@ -1494,9 +1495,9 @@ procedure doStepSMine(Gear: PGear); begin // TODO: do real calculation? - if TestCollisionXwithGear(Gear, 2) - or (TestCollisionYwithGear(Gear, -2) <> 0) - or TestCollisionXwithGear(Gear, -2) + if TestCollisionXwithGear(Gear, 2) + or (TestCollisionYwithGear(Gear, -2) <> 0) + or TestCollisionXwithGear(Gear, -2) or (TestCollisionYwithGear(Gear, 2) <> 0) then begin if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then @@ -1565,46 +1566,38 @@ /////////////////////////////////////////////////////////////////////////////// -(* -TODO -Increase damage as barrel smokes? -Try tweaking friction some more -*) procedure doStepRollingBarrel(Gear: PGear); -var +var i: LongInt; particle: PVisualGear; + dxdy: hwFloat; begin if (Gear^.dY.QWordValue = 0) and (Gear^.dY.QWordValue = 0) and (TestCollisionYwithGear(Gear, 1) = 0) then SetLittle(Gear^.dY); Gear^.State := Gear^.State or gstAnimation; - + if Gear^.Health < cBarrelHealth then Gear^.State:= Gear^.State and not gstFrozen; + if ((Gear^.dX.QWordValue <> 0) or (Gear^.dY.QWordValue <> 0)) then begin DeleteCI(Gear); AllInactive := false; - if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and (TestCollisionYwithGear(Gear, 1) <> 0) then + dxdy:= hwAbs(Gear^.dX)+hwAbs(Gear^.dY); + doStepFallingGear(Gear); + if (Gear^.State and gstCollision <> 0) and(dxdy > _0_4) then begin - Gear^.State := Gear^.State or gsttmpFlag; - inc(Gear^.Damage, hwRound(Gear^.dY * _70)); - for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do + if (TestCollisionYwithGear(Gear, 1) <> 0) then begin - particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12,vgtDust); - if particle <> nil then - particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480) - end - end - else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then - inc(Gear^.Damage, hwRound(Gear^.dX * _70)) - - else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0) then - inc(Gear^.Damage, hwRound(Gear^.dY * -_70)) - - else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then - inc(Gear^.Damage, hwRound(Gear^.dX * -_70)); - - doStepFallingGear(Gear); + Gear^.State := Gear^.State or gsttmpFlag; + for i:= min(12, hwRound(dxdy*_10)) downto 0 do + begin + particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12,vgtDust); + if particle <> nil then + particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480) + end + end; + inc(Gear^.Damage, hwRound(dxdy * _50)) + end; CalcRotationDirAngle(Gear); //CheckGearDrowning(Gear) end @@ -1643,23 +1636,19 @@ dec(Gear^.Health, Gear^.Damage); Gear^.Damage := 0; if Gear^.Health <= 0 then - Gear^.doStep := @doStepCase; - // Hand off to doStepCase for the explosion - + doStepCase(Gear); end; procedure doStepCase(Gear: PGear); -var +var i, x, y: LongInt; k: TGearType; - exBoom: boolean; dX, dY: HWFloat; hog: PHedgehog; sparkles: PVisualGear; gi: PGear; begin k := Gear^.Kind; - exBoom := false; if (Gear^.Message and gmDestroy) > 0 then begin @@ -1672,25 +1661,57 @@ Gear^.Message := Gear^.Message and (not (gmLJump or gmHJump)); exit end; + if (k = gtExplosives) and (Gear^.Health < cBarrelHealth) then Gear^.State:= Gear^.State and not gstFrozen; + + if ((k <> gtExplosives) and (Gear^.Damage > 0)) or ((k = gtExplosives) and (Gear^.Health<=0)) then + begin + x := hwRound(Gear^.X); + y := hwRound(Gear^.Y); + hog:= Gear^.Hedgehog; + + DeleteGear(Gear); + // <-- delete gear! + + if k = gtCase then + begin + doMakeExplosion(x, y, 25, hog, EXPLAutoSound); + for i:= 0 to 63 do + AddGear(x, y, gtFlame, 0, _0, _0, 0); + end + else if k = gtExplosives then + begin + doMakeExplosion(x, y, 75, hog, EXPLAutoSound); + for i:= 0 to 31 do + begin + dX := AngleCos(i * 64) * _0_5 * (getrandomf + _1); + dY := AngleSin(i * 64) * _0_5 * (getrandomf + _1); + AddGear(x, y, gtFlame, 0, dX, dY, 0); + AddGear(x, y, gtFlame, gstTmpFlag, -dX, -dY, 0); + end + end; + exit + end; if k = gtExplosives then begin //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation; if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02)) then + begin Gear^.doStep := @doStepRollingBarrel; - - if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then + exit; + end + else Gear^.dX:= _0; + + if ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then if (cBarrelHealth div Gear^.Health) > 2 then AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke) - else - AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite); + else + AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite); dec(Gear^.Health, Gear^.Damage); Gear^.Damage := 0; - if Gear^.Health <= 0 then - exBoom := true; end else - begin + begin if (Gear^.Pos <> posCaseHealth) and (GameTicks and $1FFF = 0) then // stir 'em up periodically begin gi := GearsList; @@ -1727,46 +1748,18 @@ sparkles^.dX:= 0; sparkles^.dY:= 0; sparkles^.Angle:= 270; - if Gear^.Tag = 1 then + if Gear^.Tag = 1 then sparkles^.Tint:= $3744D7FF else sparkles^.Tint:= $FAB22CFF end; end; - if Gear^.Timer < 1000 then + if Gear^.Timer < 1000 then begin AllInactive:= false; exit end end; - if (Gear^.Damage > 0) or exBoom then - begin - x := hwRound(Gear^.X); - y := hwRound(Gear^.Y); - hog:= Gear^.Hedgehog; - - DeleteGear(Gear); - // <-- delete gear! - - if k = gtCase then - begin - doMakeExplosion(x, y, 25, hog, EXPLAutoSound); - for i:= 0 to 63 do - AddGear(x, y, gtFlame, 0, _0, _0, 0); - end - else if k = gtExplosives then - begin - doMakeExplosion(x, y, 75, hog, EXPLAutoSound); - for i:= 0 to 31 do - begin - dX := AngleCos(i * 64) * _0_5 * (getrandomf + _1); - dY := AngleSin(i * 64) * _0_5 * (getrandomf + _1); - AddGear(x, y, gtFlame, 0, dX, dY, 0); - AddGear(x, y, gtFlame, gstTmpFlag, -dX, -dY, 0); - end - end; - exit - end; if (Gear^.dY.QWordValue <> 0) or (TestCollisionYwithGear(Gear, 1) = 0) then @@ -1791,7 +1784,7 @@ if Gear^.dY > _0_2 then for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); - + Gear^.dY := - Gear^.dY * Gear^.Elasticity; if Gear^.dY > - _0_001 then Gear^.dY := _0 @@ -1845,7 +1838,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepShover(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -1861,7 +1854,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepWhip(Gear: PGear); -var +var HHGear: PGear; i: LongInt; begin @@ -1883,7 +1876,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepFlame(Gear: PGear); -var +var gX,gY,i: LongInt; sticky: Boolean; vgt: PVisualGear; @@ -1910,10 +1903,10 @@ if Gear^.dX.QWordValue > _0_01.QWordValue then Gear^.dX := Gear^.dX * _0_995; - + Gear^.dY := Gear^.dY + cGravity; // if sticky then Gear^.dY := Gear^.dY + cGravity; - + if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; @@ -1974,13 +1967,13 @@ Gear^.Radius := 1; end else if ((GameTicks and $3) = 3) then - doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); + doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); //DrawExplosion(gX, gY, 4); - + if ((GameTicks and $7) = 0) and (Random(2) = 0) then for i:= Random(2) downto 0 do AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke); - + if Gear^.Health > 0 then dec(Gear^.Health); Gear^.Timer := 450 - Gear^.Tag * 8 @@ -2023,7 +2016,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepFirePunchWork(Gear: PGear); -var +var HHGear: PGear; begin AllInactive := false; @@ -2060,7 +2053,7 @@ end; procedure doStepFirePunch(Gear: PGear); -var +var HHGear: PGear; begin AllInactive := false; @@ -2083,7 +2076,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepParachuteWork(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -2112,13 +2105,13 @@ if (Gear^.Message and gmLeft) <> 0 then HHGear^.X := HHGear^.X - cMaxWindSpeed * 80 - + else if (Gear^.Message and gmRight) <> 0 then HHGear^.X := HHGear^.X + cMaxWindSpeed * 80; - + if (Gear^.Message and gmUp) <> 0 then HHGear^.Y := HHGear^.Y - cGravity * 40 - + else if (Gear^.Message and gmDown) <> 0 then HHGear^.Y := HHGear^.Y + cGravity * 40; @@ -2131,7 +2124,7 @@ end; procedure doStepParachute(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -2158,7 +2151,7 @@ if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then begin dec(Gear^.Health); - case Gear^.State of + case Gear^.State of 0: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); 1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0); 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); @@ -2201,7 +2194,7 @@ // calcs for Napalm Strike, so that it will hit the target (without wind at least :P) if (Gear^.State = 2) then - Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900 + Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900 // calcs for regular falling gears else if (int2hwFloat(Gear^.Target.Y) - Gear^.Y > _0) then Gear^.dX := Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(Gear^.Target.Y) - Gear^.Y) * 2 / @@ -2235,7 +2228,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepGirder(Gear: PGear); -var +var HHGear: PGear; x, y, tx, ty: hwFloat; begin @@ -2257,7 +2250,7 @@ isCursorVisible := true; DeleteGear(Gear) end - else + else begin PlaySound(sndPlaced); DeleteGear(Gear); @@ -2270,7 +2263,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepTeleportAfter(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -2304,7 +2297,7 @@ end; procedure doStepTeleport(Gear: PGear); -var +var HHGear: PGear; begin AllInactive := false; @@ -2345,7 +2338,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepSwitcherWork(Gear: PGear); -var +var HHGear: PGear; hedgehog: PHedgehog; State: Longword; @@ -2380,12 +2373,12 @@ repeat CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber); - until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and - (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and + until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and + (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen]=0); SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]); - AmmoMenuInvalidated:= true; + AmmoMenuInvalidated:= true; HHGear := CurrentHedgehog^.Gear; HHGear^.State := State; @@ -2399,7 +2392,7 @@ end; procedure doStepSwitcher(Gear: PGear); -var +var HHGear: PGear; begin Gear^.doStep := @doStepSwitcherWork; @@ -2415,28 +2408,27 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepMortar(Gear: PGear); -var +var dX, dY, gdX, gdY: hwFloat; i: LongInt; - dxn, dyn: boolean; begin AllInactive := false; - dxn := Gear^.dX.isNegative; - dyn := Gear^.dY.isNegative; + gdX := Gear^.dX; + gdY := Gear^.dY; doStepFallingGear(Gear); if (Gear^.State and gstCollision) <> 0 then begin - gdX := Gear^.dX; - gdY := Gear^.dY; doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLAutoSound); - - gdX.isNegative := not dxn; - gdY.isNegative := not dyn; + gdX.isNegative := not gdX.isNegative; + gdY.isNegative := not gdY.isNegative; + gdX:= gdX*_0_2; + gdY:= gdY*_0_2; + for i:= 0 to 4 do begin - dX := gdX + (GetRandomf - _0_5) * _0_03; - dY := gdY + (GetRandomf - _0_5) * _0_03; + dX := gdX + rndSign(GetRandomf) * _0_03; + dY := gdY + rndSign(GetRandomf) * _0_03; AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25); end; @@ -2445,12 +2437,16 @@ end; if (GameTicks and $3F) = 0 then - AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + begin + if hwRound(Gear^.Y) > cWaterLine then + AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble) + else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + end end; //////////////////////////////////////////////////////////////////////////////// procedure doStepKamikazeWork(Gear: PGear); -var +var i: LongWord; HHGear: PGear; sparkles: PVisualGear; @@ -2485,7 +2481,7 @@ i := 2; repeat - + Gear^.X := Gear^.X + HHGear^.dX; Gear^.Y := Gear^.Y + HHGear^.dY; HHGear^.X := Gear^.X; @@ -2568,7 +2564,7 @@ end; procedure doStepKamikaze(Gear: PGear); -var +var HHGear: PGear; begin AllInactive := false; @@ -2589,7 +2585,7 @@ //////////////////////////////////////////////////////////////////////////////// const cakeh = 27; -var +var CakePoints: array[0..Pred(cakeh)] of record x, y: hwFloat; end; @@ -2609,7 +2605,7 @@ end; procedure doStepCakeDown(Gear: PGear); -var +var gi: PGear; dmg, dmgBase: LongInt; fX, fY, tdX, tdY: hwFloat; @@ -2695,7 +2691,7 @@ end; procedure doStepCakeUp(Gear: PGear); -var +var i: Longword; begin AllInactive := false; @@ -2735,14 +2731,14 @@ end; procedure doStepCake(Gear: PGear); -var +var HHGear: PGear; begin AllInactive := false; HHGear := Gear^.Hedgehog^.Gear; HHGear^.Message := HHGear^.Message and (not gmAttack); - Gear^.CollisionMask:= lfCurrentMask; + Gear^.CollisionMask:= lfNotCurrentMask; FollowGear := Gear; @@ -2839,7 +2835,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepWaterUp(Gear: PGear); -var +var i: LongWord; begin if (Gear^.Tag = 0) @@ -2873,28 +2869,28 @@ forward; procedure doStepDrillDrilling(Gear: PGear); -var +var t: PGearArray; - ox, oy: hwFloat; - tempColl: Word; + tempColl: Word; begin AllInactive := false; - - if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then - begin - ox := Gear^.X; - oy := Gear^.Y; - Gear^.X := Gear^.X + Gear^.dX; - Gear^.Y := Gear^.Y + Gear^.dY; - DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6); - if (Gear^.Timer mod 30) = 0 then - AddVisualGear(hwRound(Gear^.X + _20 * Gear^.dX), hwRound(Gear^.Y + _20 * Gear^.dY), vgtDust); - if (CheckGearDrowning(Gear)) then - begin - StopSoundChan(Gear^.SoundChannel); - exit - end + if (Gear^.Timer > 0) and (Gear^.Timer mod 10 <> 0) then + begin + dec(Gear^.Timer); + exit; + end; + + DrawTunnel(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 2, 6); + Gear^.X := Gear^.X + Gear^.dX; + Gear^.Y := Gear^.Y + Gear^.dY; + if (Gear^.Timer mod 30) = 0 then + AddVisualGear(hwRound(Gear^.X + _20 * Gear^.dX), hwRound(Gear^.Y + _20 * Gear^.dY), vgtDust); + if (CheckGearDrowning(Gear)) then + begin + StopSoundChan(Gear^.SoundChannel); + exit end; + tempColl:= Gear^.CollisionMask; Gear^.CollisionMask:= $007F; if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) <> 0) or TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) or (GameTicks > Gear^.FlightTime) then @@ -2902,7 +2898,7 @@ else t := nil; Gear^.CollisionMask:= tempColl; //fixes drill not exploding when touching HH bug - + if (Gear^.Timer = 0) or ((t <> nil) and (t^.Count <> 0)) or ( ((Gear^.State and gsttmpFlag) = 0) and (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)))) // CheckLandValue returns true if the type isn't matched @@ -2917,7 +2913,7 @@ DeleteGear(Gear); exit end - + else if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) then begin StopSoundChan(Gear^.SoundChannel); @@ -2929,7 +2925,7 @@ end; procedure doStepDrill(Gear: PGear); -var +var t: PGearArray; oldDx, oldDy: hwFloat; t2: hwFloat; @@ -2945,7 +2941,11 @@ doStepFallingGear(Gear); if (GameTicks and $3F) = 0 then - AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); + begin + if hwRound(Gear^.Y) > cWaterLine then + AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble) + else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace) + end; if ((Gear^.State and gstCollision) <> 0) then begin @@ -2953,7 +2953,7 @@ Gear^.dX := oldDx; Gear^.dY := oldDy; - if GameTicks > Gear^.FlightTime then + if GameTicks > Gear^.FlightTime then t := CheckGearsCollision(Gear) else t := nil; @@ -2964,7 +2964,7 @@ Gear^.dX := Gear^.dX * t2; Gear^.dY := Gear^.dY * t2; end - + else if (t <> nil) then begin //explode right on contact with HH @@ -2978,14 +2978,14 @@ Gear^.SoundChannel := LoopSound(sndDrillRocket); Gear^.doStep := @doStepDrillDrilling; - + if (Gear^.State and gsttmpFlag) <> 0 then gear^.RenderTimer:= true; if Gear^.Timer > 0 then dec(Gear^.Timer) end else if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Tag <> 0) then begin - if Gear^.Timer > 0 then + if Gear^.Timer > 0 then dec(Gear^.Timer) else begin @@ -2997,7 +2997,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepBallgunWork(Gear: PGear); -var +var HHGear, ball: PGear; rx, ry: hwFloat; gX, gY: LongInt; @@ -3014,7 +3014,7 @@ ry := rndSign(getRandomf * _0_1); ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0); - ball^.CollisionMask:= lfCurrentMask; + ball^.CollisionMask:= lfNotCurrentMask; PlaySound(sndGun); end; @@ -3027,7 +3027,7 @@ end; procedure doStepBallgun(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -3040,7 +3040,7 @@ procedure doStepRCPlaneWork(Gear: PGear); const cAngleSpeed = 3; -var +var HHGear: PGear; i: LongInt; dX, dY: hwFloat; @@ -3149,7 +3149,7 @@ begin if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft; - + TurnTimeLeft:= 14 * 125; end; @@ -3159,7 +3159,7 @@ end; procedure doStepRCPlane(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -3167,7 +3167,7 @@ HHGear^.State := HHGear^.State or gstNotKickable; Gear^.Angle := HHGear^.Angle; Gear^.Tag := hwSign(HHGear^.dX); - + if HHGear^.dX.isNegative then Gear^.Angle := 4096 - Gear^.Angle; Gear^.doStep := @doStepRCPlaneWork @@ -3175,7 +3175,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepJetpackWork(Gear: PGear); -var +var HHGear: PGear; fuel, i: LongInt; move: hwFloat; @@ -3195,10 +3195,11 @@ move:= _0_02; fuel:= 5; end;*) - - if Gear^.Health > 0 then - begin - if (HHGear^.Message and gmUp) <> 0 then + if HHGear^.Message and gmPrecise <> 0 then + HedgehogChAngle(HHGear) + else if Gear^.Health > 0 then + begin + if HHGear^.Message and gmUp <> 0 then begin if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then begin @@ -3254,9 +3255,9 @@ if Gear^.Health < 0 then Gear^.Health := 0; - + i:= Gear^.Health div 20; - + if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then begin Gear^.Damage:= i; @@ -3265,10 +3266,12 @@ Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) + '%', cWhiteColor, fntSmall) end; - if HHGear^.Message and (gmAttack or gmUp or gmPrecise or gmLeft or gmRight) <> 0 then + if (HHGear^.Message and (gmAttack or gmUp or gmLeft or gmRight) <> 0) and + (HHGear^.Message and gmPrecise = 0) then Gear^.State := Gear^.State and (not gsttmpFlag); - - HHGear^.Message := HHGear^.Message and (not (gmUp or gmPrecise or gmLeft or gmRight)); + + if HHGear^.Message and gmPrecise = 0 then + HHGear^.Message := HHGear^.Message and (not (gmUp or gmLeft or gmRight)); HHGear^.State := HHGear^.State or gstMoving; Gear^.X := HHGear^.X; @@ -3277,7 +3280,7 @@ if not isUnderWater and hasBorder and ((HHGear^.X < _0) or (hwRound(HHGear^.X) > LAND_WIDTH)) then HHGear^.dY.isNegative:= false; - + if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear); @@ -3285,7 +3288,7 @@ if // (Gear^.Health = 0) (HHGear^.Damage <> 0) //or CheckGearDrowning(HHGear) - or (cWaterLine + 512 < hwRound(HHGear^.Y)) + or (cWaterLine + cVisibleWater * 4 < hwRound(HHGear^.Y)) or (TurnTimeLeft = 0) // allow brief ground touches - to be fair on this, might need another counter or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and (TestCollisionYwithGear(HHGear, 1) <> 0)) @@ -3309,7 +3312,7 @@ end; procedure doStepJetpack(Gear: PGear); -var +var HHGear: PGear; begin Gear^.Pos:= 0; @@ -3322,7 +3325,7 @@ begin State := State and (not gstAttacking); Message := Message and (not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight)); - + if (dY < _0_1) and (dY > -_0_1) then begin Gear^.State := Gear^.State or gsttmpFlag; @@ -3345,13 +3348,13 @@ end; procedure doStepBirdyFly(Gear: PGear); -var +var HHGear: PGear; fuel, i: LongInt; move: hwFloat; begin HHGear := Gear^.Hedgehog^.Gear; - if HHGear = nil then + if HHGear = nil then begin DeleteGear(Gear); exit @@ -3375,11 +3378,11 @@ if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then HHGear^.dY := HHGear^.dY - move; - + dec(Gear^.Health, fuel); Gear^.MsgParam := Gear^.MsgParam or gmUp; end; - + if (HHGear^.Message and gmLeft) <> 0 then move.isNegative := true; if (HHGear^.Message and (gmLeft or gmRight)) <> 0 then begin @@ -3390,7 +3393,7 @@ if Gear^.Health < 0 then Gear^.Health := 0; - + if ((GameTicks and $FF) = 0) and (Gear^.Health < 500) then for i:= ((500-Gear^.Health) div 250) downto 0 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather); @@ -3408,7 +3411,7 @@ if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then Gear^.State := Gear^.State and (not gsttmpFlag); - + HHGear^.Message := HHGear^.Message and (not (gmUp or gmPrecise or gmLeft or gmRight)); HHGear^.State := HHGear^.State or gstMoving; @@ -3451,7 +3454,7 @@ end; procedure doStepBirdyDescend(Gear: PGear); -var +var HHGear: PGear; begin if Gear^.Timer > 0 then @@ -3492,12 +3495,12 @@ end; procedure doStepBirdy(Gear: PGear); -var +var HHGear: PGear; begin gear^.State := gear^.State or gstAnimation and (not gstTmpFlag); Gear^.doStep := @doStepBirdyAppear; - + if CurrentHedgehog = nil then begin DeleteGear(Gear); @@ -3522,7 +3525,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepEggWork(Gear: PGear); -var +var vg: PVisualGear; i: LongInt; begin @@ -3563,18 +3566,18 @@ if (CurAmmoType = amPortalGun) then begin CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSwitch); - + CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^); if CurWeapon^.Pos <> 0 then CurWeapon^.Pos := 0 - + else CurWeapon^.Pos := 1; end; end; procedure doStepPortal(Gear: PGear); -var +var iterator, conPortal: PGear; s, r, nx, ny, ox, oy, poffs, noffs, pspeed, nspeed, resetx, resety, resetdx, resetdy: hwFloat; @@ -3584,7 +3587,7 @@ doPortalColorSwitch(); // destroy portal if ground it was attached too is gone - if ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0) + if (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] <= lfAllObjMask) or (Gear^.Timer < 1) or (Gear^.Hedgehog^.Team <> CurrentHedgehog^.Team) or (hwRound(Gear^.Y) > cWaterLine) then @@ -3684,7 +3687,11 @@ // wow! good candidate there, let's see if the distance and direction is okay! if hasdxy then begin - s := r / Distance(iterator^.dX, iterator^.dY); + s := Distance(iterator^.dX, iterator^.dY); + // if the resulting distance is 0 skip this gear + if s.QWordValue = 0 then + continue; + s := r / s; ox:= iterator^.X + s * iterator^.dX; oy:= iterator^.Y + s * iterator^.dY; end @@ -3875,7 +3882,7 @@ resetx.QWordValue:= 4294967296 * 35; resetdx.isNegative:= false; resetdx.QWordValue:= 4294967296 * 1152; - + resetdy:=hwAbs(iterator^.dX*4); resetdy:= resetdy + hwPow(resetdy,3)/_6 + _3 * hwPow(resetdy,5) / _40 + _5 * hwPow(resetdy,7) / resety + resetx * hwPow(resetdy,9) / resetdx; iterator^.Angle:= hwRound(resetdy*_2048 / _PI); @@ -3896,7 +3903,7 @@ and (CurAmmoGear^.Kind =gtRope) then CurAmmoGear^.PortalCounter:= 1; - if not isbullet and (iterator^.State and gstInvisible = 0) + if not isbullet and (iterator^.State and gstInvisible = 0) and (iterator^.Kind <> gtFlake) then FollowGear := iterator; @@ -3942,7 +3949,7 @@ end; procedure doStepMovingPortal_real(Gear: PGear); -var +var x, y, tx, ty: LongInt; s: hwFloat; begin @@ -3956,7 +3963,7 @@ begin Gear^.State := Gear^.State or gstCollision; Gear^.State := Gear^.State and (not gstMoving); - + if (Land[y, x] and lfBouncy <> 0) or (not CalcSlopeTangent(Gear, x, y, tx, ty, 255)) or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain @@ -3984,7 +3991,7 @@ else loadNewPortalBall(Gear, true); end - + else if (y > cWaterLine) or (y < -max(LAND_WIDTH,4096)) or (x > 2*max(LAND_WIDTH,4096)) @@ -3996,13 +4003,13 @@ begin doPortalColorSwitch(); doStepPerPixel(Gear, @doStepMovingPortal_real, true); - if (Gear^.Timer < 1) + if (Gear^.Timer < 1) or (Gear^.Hedgehog^.Team <> CurrentHedgehog^.Team) then deleteGear(Gear); end; procedure doStepPortalShot(newPortal: PGear); -var +var iterator: PGear; s: hwFloat; CurWeapon: PAmmo; @@ -4082,15 +4089,15 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepPiano(Gear: PGear); -var +var r0, r1: LongInt; odY: hwFloat; begin AllInactive := false; - if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and + if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then begin - case CurrentHedgehog^.Gear^.MsgParam of + case CurrentHedgehog^.Gear^.MsgParam of 0: PlaySound(sndPiano0); 1: PlaySound(sndPiano1); 2: PlaySound(sndPiano2); @@ -4170,7 +4177,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepSineGunShotWork(Gear: PGear); -var +var x, y, rX, rY, t, tmp, initHealth: LongInt; oX, oY, ldX, ldY, sdX, sdY, sine, lx, ly, amp: hwFloat; justCollided: boolean; @@ -4265,7 +4272,7 @@ end; if random(100) = 0 then - AddVisualGear(x, y, vgtSmokeTrace); + AddVisualGear(x, y, vgtSmokeTrace); end else dec(Gear^.Health, 5); // if underwater get additional damage end; @@ -4303,7 +4310,7 @@ var HHGear: PGear; begin - PlaySound(sndSineGun); + PlaySound(sndSineGun); // push the shooting Hedgehog back HHGear := CurrentHedgehog^.Gear; @@ -4323,7 +4330,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepFlamethrowerWork(Gear: PGear); -var +var HHGear, flame: PGear; rx, ry, speed: hwFloat; i, gX, gY: LongInt; @@ -4333,7 +4340,7 @@ HedgehogChAngle(HHGear); gX := hwRound(Gear^.X) + GetLaunchX(amBallgun, hwSign(HHGear^.dX), HHGear^.Angle); gY := hwRound(Gear^.Y) + GetLaunchY(amBallgun, HHGear^.Angle); - + if (GameTicks and $FF) = 0 then begin if (HHGear^.Message and gmRight) <> 0 then @@ -4347,11 +4354,11 @@ begin if HHGear^.dX.isNegative and (Gear^.Tag > 5) then dec(Gear^.Tag) - else if Gear^.Tag < 20 then + else if Gear^.Tag < 20 then inc(Gear^.Tag); end end; - + dec(Gear^.Timer); if Gear^.Timer = 0 then begin @@ -4361,18 +4368,18 @@ rx := rndSign(getRandomf * _0_1); ry := rndSign(getRandomf * _0_1); speed := _0_5 * (_10 / Gear^.Tag); - + flame:= AddGear(gx, gy, gtFlame, gstTmpFlag, SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); - flame^.CollisionMask:= lfCurrentMask; - + flame^.CollisionMask:= lfNotCurrentMask; + if (Gear^.Health mod 30) = 0 then begin flame:= AddGear(gx, gy, gtFlame, 0, SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); - flame^.CollisionMask:= lfCurrentMask; + flame^.CollisionMask:= lfNotCurrentMask; end end; Gear^.Timer:= Gear^.Tag @@ -4397,7 +4404,7 @@ end; procedure doStepFlamethrower(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -4408,7 +4415,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepLandGunWork(Gear: PGear); -var +var HHGear, land: PGear; rx, ry, speed: hwFloat; i, gX, gY: LongInt; @@ -4418,7 +4425,7 @@ HedgehogChAngle(HHGear); gX := hwRound(Gear^.X) + GetLaunchX(amBallgun, hwSign(HHGear^.dX), HHGear^.Angle); gY := hwRound(Gear^.Y) + GetLaunchY(amBallgun, HHGear^.Angle); - + if (GameTicks and $FF) = 0 then begin if (HHGear^.Message and gmRight) <> 0 then @@ -4436,7 +4443,7 @@ inc(Gear^.Tag); end end; - + dec(Gear^.Timer); if Gear^.Timer = 0 then begin @@ -4446,11 +4453,11 @@ ry := rndSign(getRandomf * _0_1); speed := (_3 / Gear^.Tag); - land:= AddGear(gx, gy, gtFlake, gstTmpFlag, - SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, + land:= AddGear(gx, gy, gtFlake, gstTmpFlag, + SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - speed) + ry, 0); - land^.CollisionMask:= lfCurrentMask; - + land^.CollisionMask:= lfNotCurrentMask; + Gear^.Timer:= Gear^.Tag end; @@ -4474,7 +4481,7 @@ end; procedure doStepLandGun(Gear: PGear); -var +var HHGear: PGear; begin HHGear := Gear^.Hedgehog^.Gear; @@ -4543,7 +4550,7 @@ end; procedure doStepHammerHitWork(Gear: PGear); -var +var i, j, ei: LongInt; HitGear: PGear; begin @@ -4599,7 +4606,7 @@ end; procedure doStepHammerHit(Gear: PGear); -var +var i, y: LongInt; ar: TRangeArray; HHGear: PGear; @@ -4649,7 +4656,7 @@ begin if (GameTicks and $F) <> 0 then exit; - end + end else if (GameTicks and $1FF) <> 0 then exit; @@ -4686,8 +4693,8 @@ inc(graves[i]^.Health); end; end; -} - end - else + end + else begin // now really resurrect the hogs with the hp saved in the graves for i:= 0 to graves.size - 1 do @@ -4746,9 +4753,9 @@ RecountTeamHealth(hh^.Team); inc(graves.ar^[Gear^.Tag]^.Health); inc(Gear^.Tag) - end - end - else + end + end + else begin StopSoundChan(Gear^.SoundChannel); Gear^.Timer := 250; @@ -4768,7 +4775,7 @@ begin doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLAutoSound); gX := hwRound(Gear^.X); - gY := hwRound(Gear^.Y); + gY := hwRound(Gear^.Y); for i:= 0 to 10 do begin dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandomf + _1); @@ -4796,7 +4803,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepStructure(Gear: PGear); -var +var x, y: LongInt; HH: PHedgehog; t: PGear; @@ -4813,7 +4820,7 @@ dec(Gear^.Health, Gear^.Damage); Gear^.Damage:= 0; - + if Gear^.Pos = 1 then begin AddGearCI(Gear); @@ -4824,7 +4831,7 @@ HideHog(HH); Gear^.Pos:= 2 end; - + if Gear^.Pos = 2 then begin if ((GameTicks mod 100) = 0) and (Gear^.Timer < 1000) then @@ -4840,7 +4847,7 @@ if Gear^.Tag <= TotalRounds then Gear^.Pos:= 3; end; - + if Gear^.Pos = 3 then if Gear^.Timer < 1000 then begin @@ -4858,7 +4865,7 @@ RestoreHog(HH); Gear^.Pos:= 4; end; - + if Gear^.Pos = 4 then if ((GameTicks mod 1000) = 0) and ((GameFlags and gfInvulnerable) = 0) then begin @@ -4870,12 +4877,12 @@ t:= t^.NextGear; end; end; - + if Gear^.Health <= 0 then begin if HH^.GearHidden <> nil then RestoreHog(HH); - + x := hwRound(Gear^.X); y := hwRound(Gear^.Y); @@ -4888,7 +4895,7 @@ //////////////////////////////////////////////////////////////////////////////// (* - TARDIS needs + TARDIS needs Warp in. Pos = 1 Pause. Pos = 2 Hide gear (TARDIS hedgehog was nil) @@ -4914,7 +4921,7 @@ begin AfterAttack; if Gear = CurAmmoGear then CurAmmoGear := nil; - if (HH^.Gear^.Damage = 0) and (HH^.Gear^.Health > 0) and + if (HH^.Gear^.Damage = 0) and (HH^.Gear^.Health > 0) and ((Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then HideHog(HH) end @@ -4934,7 +4941,7 @@ if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then begin inc(Gear^.Power); - if (Gear^.Power = 172) and (HH^.Gear <> nil) and + if (Gear^.Power = 172) and (HH^.Gear <> nil) and (HH^.Gear^.Damage = 0) and (HH^.Gear^.Health > 0) and ((HH^.Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then with HH^.Gear^ do @@ -4975,7 +4982,7 @@ begin if HH^.GearHidden <> nil then FindPlace(HH^.GearHidden, false, 0, LAND_WIDTH,true); - + if HH^.GearHidden <> nil then begin Gear^.X:= HH^.GearHidden^.X; @@ -5051,9 +5058,9 @@ WIP. The ice gun will have the following effects. It has been proposed by sheepluva that it take the appearance of a large freezer spewing ice cubes. The cubes will be visual gears only. The scatter from them and the impact snow dust should help hide imprecisions in things like the GearsNear effect. For now we assume a "ray" like a deagle projected out from the gun. -All these effects assume the ray's angle is not changed and that the target type was unchanged over a number of ticks. This is a simplifying assumption for "gun was applying freezing effect to the same target". +All these effects assume the ray's angle is not changed and that the target type was unchanged over a number of ticks. This is a simplifying assumption for "gun was applying freezing effect to the same target". * When fired at water a layer of ice textured land is added above the water. - * When fired at non-ice land (land and $FF00 and not lfIce) the land is overlaid with a thin layer of ice textured land around that point (say, 1 or 2px into land, 1px above). For attractiveness, a slope would probably be needed. + * When fired at non-ice land (land and lfLandMask and not lfIce) the land is overlaid with a thin layer of ice textured land around that point (say, 1 or 2px into land, 1px above). For attractiveness, a slope would probably be needed. * When fired at a hog (land and $00FF <> 0), while the hog is targetted, the hog's state is set to frozen. As long as the gun is on the hog, a frozen hog sprite creeps up from the feet to the head. If the effect is interrupted before reaching the top, the freezing state is cleared. A frozen hog will animate differently. To be decided, but possibly in a similar fashion to a grave when it comes to explosions. The hog might (possibly) not be damaged by explosions. This might make freezing potentially useful for friendlies in a bad position. It might be better to allow damage though. A frozen hog stays frozen for a certain number of turns. Each turn the frozen overlay becomes fainter, until it fades and the hog animates normally again. @@ -5061,7 +5068,7 @@ procedure updateFuel(Gear: PGear); -var +var t:LongInt; begin t:= Gear^.Health div 10; @@ -5072,13 +5079,24 @@ Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(t) + '%', cWhiteColor, fntSmall) end; - if GameTicks mod 10 = 0 then dec(Gear^.Health); + if Gear^.Message and (gmUp or gmDown) <> 0 then + begin + StopSoundChan(Gear^.SoundChannel); + Gear^.SoundChannel:= -1; + if GameTicks mod 40 = 0 then dec(Gear^.Health) + end + else + begin + if Gear^.SoundChannel = -1 then + Gear^.SoundChannel := LoopSound(sndIceBeam); + if GameTicks mod 10 = 0 then dec(Gear^.Health) + end end; procedure updateTarget(Gear:PGear; newX, newY:HWFloat); - var - iter:PGear; +// var +// iter:PGear; begin with Gear^ do begin @@ -5089,86 +5107,74 @@ LastDamage:= nil; X:= Hedgehog^.Gear^.X; Y:= Hedgehog^.Gear^.Y; - //unfreeze all semifrozen hogs - make this generic hog cleanup -(* - iter := GearsList; - while iter <> nil do - begin - if (iter^.Kind = gtHedgehog) and - (iter^.Hedgehog^.Effects[heFrozen] and $FF = 0) then - iter^.Hedgehog^.Effects[heFrozen]:= 0; - iter:= iter^.NextGear - end -*) end; end; - procedure doStepIceGun(Gear: PGear); -const iceWaitCollision:Longint = 0; -const iceCollideWithGround:Longint = 1; -const iceWaitNextTarget:Longint = 2; -const iceCollideWithHog:Longint = 4; -const iceCollideWithWater:Longint = 5; -const waterFreezingTime:Longint = 500; -const groundFreezingTime:Longint = 1000; +const iceWaitCollision = 0; +const iceCollideWithGround = 1; +//const iceWaitNextTarget:Longint = 2; +//const iceCollideWithHog:Longint = 4; +const iceCollideWithWater = 5; +//const waterFreezingTime:Longint = 500; +const groundFreezingTime = 1000; const iceRadius = 32; const iceHeight = 40; var - HHGear: PGear; + HHGear, iter: PGear; + landRect: TSDL_Rect; ndX, ndY: hwFloat; i, t, gX, gY: LongInt; hogs: PGearArrayS; + vg: PVisualGear; begin HHGear := Gear^.Hedgehog^.Gear; - if (Gear^.Message and gmAttack <> 0) or (Gear^.Health = 0) or (HHGear = nil) or (HHGear^.Damage <> 0) then - begin + if (Gear^.Message and gmAttack <> 0) or (Gear^.Health = 0) or (HHGear = nil) or (HHGear^.Damage <> 0) or (HHGear^.dX.QWordValue > 4294967) then + begin + StopSoundChan(Gear^.SoundChannel); DeleteGear(Gear); AfterAttack; exit - end - else if Gear^.Message and (gmUp or gmDown) = 0 then updateFuel(Gear); + end; + updateFuel(Gear); with Gear^ do begin HedgehogChAngle(HHGear); ndX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _4; ndY:= -AngleCos(HHGear^.Angle) * _4; - if (ndX <> dX) or (ndY <> dY) or - ((Target.X <> NoPointX) and (Target.X and LAND_WIDTH_MASK = 0) and + if (ndX <> dX) or (ndY <> dY) or + ((Target.X <> NoPointX) and (Target.X and LAND_WIDTH_MASK = 0) and (Target.Y and LAND_HEIGHT_MASK = 0) and ((Land[Target.Y, Target.X] = 0))) then begin - updateTarget(Gear, ndX, ndY); - IceState := iceWaitCollision; + updateTarget(Gear, ndX, ndY); + Timer := iceWaitCollision; end else begin X:= X + dX; Y:= Y + dY; gX:= hwRound(X); - gY:= hwRound(Y); - if Target.X = NoPointX then - begin - t:= hwRound(hwSqr(X-HHGear^.X)+hwSqr(Y-HHGear^.Y)); - end; + gY:= hwRound(Y); + if Target.X = NoPointX then t:= hwRound(hwSqr(X-HHGear^.X)+hwSqr(Y-HHGear^.Y)); if Target.X <> NoPointX then - begin - CheckCollisionWithLand(Gear); + begin + CheckCollision(Gear); if (State and gstCollision) <> 0 then - begin - if IceState = iceWaitCollision then begin - IceState := iceCollideWithGround; - IceTime := GameTicks; - end - end + if Timer = iceWaitCollision then + begin + Timer := iceCollideWithGround; + Power := GameTicks; + end + end else if (target.y >= cWaterLine) then begin - if IceState = iceWaitCollision then + if Timer = iceWaitCollision then begin - IceState := iceCollideWithWater; - IceTime := GameTicks; + Timer := iceCollideWithWater; + Power := GameTicks; end; end; @@ -5178,52 +5184,123 @@ Y:= HHGear^.Y end; - if (IceState = iceCollideWithGround) and ((GameTicks - IceTime) > groundFreezingTime) then - begin - FillRoundInLandWithIce(Target.X, Target.Y, iceRadius); - SetAllHHToActive; - IceState := iceWaitCollision; + if (Timer = iceCollideWithGround) and ((GameTicks - Power) > groundFreezingTime) then + begin + FillRoundInLand(target.x, target.y, iceRadius, icePixel); + landRect.x := min(max(target.x - iceRadius, 0), LAND_WIDTH - 1); + landRect.y := min(max(target.y - iceRadius, 0), LAND_HEIGHT - 1); + landRect.w := min(2*iceRadius, LAND_WIDTH - landRect.x - 1); + landRect.h := min(2*iceRadius, LAND_HEIGHT - landRect.y - 1); + UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); + + // Freeze nearby mines/explosives/cases too + iter := GearsList; + while iter <> nil do + begin + if (iter^.State and gstFrozen = 0) and + ((iter^.Kind = gtExplosives) or (iter^.Kind = gtCase) or (iter^.Kind = gtMine)) and + (abs(iter^.X.Round-target.x)+abs(iter^.Y.Round-target.y)+2<2*iceRadius) and (Distance(iter^.X-int2hwFloat(target.x),iter^.Y-int2hwFloat(target.y)) nil then + begin + i:= random(100) + 155; + vg^.Tint:= (i shl 24) or (i shl 16) or ($FF shl 8) or (random(200) + 55); + vg^.Angle:= random(360); + vg^.dx:= 0.001 * random(80); + vg^.dy:= 0.001 * random(80) + end + end; + PlaySound(sndHogFreeze); + iter^.State:= iter^.State or gstFrozen; + if iter^.Kind = gtMine then // dud mine block + begin + vg:= AddVisualGear(hwRound(iter^.X) - 4 + Random(8), hwRound(iter^.Y) - 4 - Random(4), vgtSmoke); + if vg <> nil then + vg^.Scale:= 0.5; + PlaySound(sndVaporize); + iter^.Health := 0; + iter^.Damage := 0; + iter^.State := iter^.State and (not gstAttacking) + end + else if iter^.Kind = gtCase then + begin + DeleteCI(iter); + AddGearCI(iter) + end + else // gtExplosives + iter^.Health:= iter^.Health + cBarrelHealth + end; + iter:= iter^.NextGear + end; + + // FillRoundInLandWithIce(Target.X, Target.Y, iceRadius); + SetAllHHToActive; + Timer := iceWaitCollision; end; - if (IceState = iceCollideWithWater) and ((GameTicks - IceTime) > groundFreezingTime) then - begin + if (Timer = iceCollideWithWater) and ((GameTicks - Power) > groundFreezingTime) then + begin + PlaySound(sndHogFreeze); DrawIceBreak(Target.X, cWaterLine - iceHeight, iceRadius, iceHeight); - SetAllHHToActive; - IceState := iceWaitCollision; + SetAllHHToActive; + Timer := iceWaitCollision; end; +(* + Any ideas for something that would look good here? + if (Target.X <> NoPointX) and ((Timer = iceCollideWithGround) or (Timer = iceCollideWithWater)) and (GameTicks mod max((groundFreezingTime-((GameTicks - Power)*2)),2) = 0) then //and CheckLandValue(Target.X, Target.Y, lfIce) then + begin + vg:= AddVisualGear(Target.X+random(20)-10, Target.Y+random(40)-10, vgtDust, 1); + if vg <> nil then + begin + i:= random(100) + 155; + vg^.Tint:= IceColor or $FF; + vg^.Angle:= random(360); + vg^.dx:= 0.001 * random(80); + vg^.dy:= 0.001 * random(80) + end + end; +*) // freeze nearby hogs hogs := GearsNear(int2hwFloat(Target.X), int2hwFloat(Target.Y), gtHedgehog, Gear^.Radius*2); if hogs.size > 0 then for i:= 0 to hogs.size - 1 do if hogs.ar^[i] <> HHGear then - if GameTicks mod 5 = 0 then + if GameTicks mod 5 = 0 then begin hogs.ar^[i]^.Active:= true; if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] < 256 then hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] := hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] + 1 else if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] = 256 then - hogs.ar^[i]^.Hedgehog^.Effects[heFrozen]:= 200000;//cHedgehogTurnTime + cReadyDelay + begin + hogs.ar^[i]^.Hedgehog^.Effects[heFrozen]:= 200000-1;//cHedgehogTurnTime + cReadyDelay + PlaySound(sndHogFreeze); + end; end; inc(Pos) - end + end else if (t > 400) and ((gY > cWaterLine) or (((gX and LAND_WIDTH_MASK = 0) and (gY and LAND_HEIGHT_MASK = 0)) and (Land[gY, gX] <> 0))) then - begin + begin Target.X:= gX; Target.Y:= gY; X:= HHGear^.X; Y:= HHGear^.Y - end; - {if (gX > max(LAND_WIDTH,4096)*2) or + end; + if (gX > max(LAND_WIDTH,4096)*2) or (gX < -max(LAND_WIDTH,4096)) or (gY < -max(LAND_HEIGHT,4096)) or (gY > max(LAND_HEIGHT,4096)+512) then - begin - X:= HHGear^.X; - Y:= HHGear^.Y - end} + begin + //X:= HHGear^.X; + //Y:= HHGear^.Y + Target.X:= gX; + Target.Y:= gY; + end end end; end; @@ -5299,7 +5376,7 @@ DeleteGear(Gear) end; // ssssss he essssscaped - if (Gear^.Timer > 250) and ((HHGear = nil) or + if (Gear^.Timer > 250) and ((HHGear = nil) or (((abs(HHGear^.X.Round-Gear^.X.Round) + abs(HHGear^.Y.Round-Gear^.Y.Round) + 2) > 180) and (Distance(HHGear^.X-Gear^.X,HHGear^.Y-Gear^.Y) > _180))) then begin @@ -5310,7 +5387,7 @@ end; // Search out a new target, as target seek time has expired, target is dead, target is out of range, or we did not have a target -if (HHGear = nil) or (Gear^.Timer = 0) or +if (HHGear = nil) or (Gear^.Timer = 0) or (((abs(HHGear^.X.Round-Gear^.X.Round) + abs(HHGear^.Y.Round-Gear^.Y.Round) + 2) > Gear^.Angle) and (Distance(HHGear^.X-Gear^.X,HHGear^.Y-Gear^.Y) > int2hwFloat(Gear^.Angle))) then @@ -5427,7 +5504,7 @@ This didn't end up getting used, but, who knows, might be reasonable for javellin or something // Make the knife initial angle based on the hog attack angle, or is that too hard? procedure doStepKnife(Gear: PGear); -var t, +var t, gx, gy, ga, // gear x,y,angle lx, ly, la, // land x,y,angle ox, oy, // x,y offset @@ -5449,9 +5526,9 @@ if Gear^.State and gstDrowning <> 0 then exit; with Gear^ do begin - if CheckLandValue(gx, gy, $FF00) then + if CheckLandValue(gx, gy, lfLandMask) then begin - t:= Angle + hwRound((hwAbs(dX)+hwAbs(dY)) * _10); + t:= Angle + hwRound((hwAbs(dX)+hwAbs(dY)) * _10); if t < 0 then inc(t, 4096) else if 4095 < t then dec(t, 4096); @@ -5488,7 +5565,7 @@ 4: begin ox:= 29; oy:= 8; w:= 19; h:= 19; - tx:= 0; ty:= 17 + tx:= 0; ty:= 17 end; 5: begin ox:= 29; oy:= 32; @@ -5498,7 +5575,7 @@ 6: begin ox:= 51; oy:= 3; w:= 11; h:= 23; - tx:= 0; ty:= 22 + tx:= 0; ty:= 22 end; 7: begin ox:= 51; oy:= 34; @@ -5506,7 +5583,7 @@ tx:= 0; ty:= 23 end end; - + surf:= SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMask, GMask, BMask, AMask); copyToXYFromRect(SpritesData[sprKnife].Surface, surf, ox, oy, w, h, 0, 0); // try to make the knife hit point first @@ -5528,7 +5605,7 @@ AddFileLog('la: '+inttostr(la)+' ga: '+inttostr(ga)+' Angle: '+inttostr(Angle)) end; case Angle div 1024 of - 0: begin + 0: begin flipSurface(surf, true); flipSurface(surf, true); BlitImageAndGenerateCollisionInfo(gx-(w-tx), gy-(h-ty), w, surf) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/LuaPas.pas --- a/hedgewars/LuaPas.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/LuaPas.pas Thu Jun 13 22:27:23 2013 +0200 @@ -14,19 +14,20 @@ uses uConsts; {.$DEFINE LUA_GETHOOK} +const LuaLibName = {$IFDEF LUA_INTERNAL}'libhwlua'{$ELSE}'liblua'{$ENDIF}; + +{$IFNDEF WIN32} + {$linklib lua} +{$ENDIF} + type -{$IFNDEF PAS2C} size_t = Cardinal; -{$ENDIF} Psize_t = ^size_t; PPointer = ^Pointer; lua_State = record end; Plua_State = ^lua_State; -{$DEFINE LuaLibName:= cLuaLibrary} - - (*****************************************************************************) (* luaconfig.h *) (*****************************************************************************) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/Math.h --- a/hedgewars/Math.h Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#pragma once - diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/PNGh.pas --- a/hedgewars/PNGh.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/PNGh.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/SDLh.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -933,12 +933,11 @@ procedure SDL_StartTextInput; cdecl; external SDLLibName; function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName; -function SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName; {$ELSE} -function SDL_CreateThread(fn: Pointer; data: Pointer): PSDL_Thread; cdecl; external SDLLibName; function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName; {$ENDIF} + function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; function SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName; function SDL_GetScancodeName(key: LongWord): PChar; cdecl; external SDLLibName; @@ -956,7 +955,13 @@ procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; function SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; + +// remember to mark the threaded functions as 'cdecl; export;' +// (or have fun debugging nil arguments) +function SDL_CreateThread(fn: Pointer; {$IFDEF SDL13}name: PChar;{$ENDIF} data: Pointer): PSDL_Thread; cdecl; external SDLLibName; procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName; +procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName; + function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/SysUtils.h diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/Types.h diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/VGSHandlers.inc --- a/hedgewars/VGSHandlers.inc Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/VGSHandlers.inc Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/avwrapper/CMakeLists.txt --- a/hedgewars/avwrapper/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/avwrapper/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -4,17 +4,12 @@ # fpc will take care of linking but we need to have this library installed find_package(GLUT REQUIRED) -#TODO: convert avwrapper to .pas unit so we can skip this step include_directories(${FFMPEG_INCLUDE_DIR}) -if(WIN32) - # it's not possible to statically link libraries on windows, so let's build a shared version here - add_library(avwrapper SHARED avwrapper.c) - - target_link_libraries(avwrapper ${FFMPEG_LIBRARIES}) +add_library(avwrapper avwrapper.c) +#TODO: find good VERSION and SOVERSION values +target_link_libraries(avwrapper ${FFMPEG_LIBRARIES}) +install(TARGETS avwrapper RUNTIME DESTINATION ${target_binary_install_dir} + LIBRARY DESTINATION ${target_library_install_dir} + ARCHIVE DESTINATION ${target_library_install_dir}) - install(PROGRAMS "${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}avwrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION ${target_library_install_dir}) -else() - add_library(avwrapper STATIC avwrapper.c) -endif() - diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/avwrapper/avwrapper.c --- a/hedgewars/avwrapper/avwrapper.c Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/avwrapper/avwrapper.c Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,14 @@ #define AVIO_FLAG_WRITE AVIO_WRONLY #endif +#if (defined _MSC_VER) +#define AVWRAP_DECL __declspec(dllexport) +#elif ((__GNUC__ >= 3) && (!__EMX__) && (!sun)) +#define AVWRAP_DECL __attribute__((visibility("default"))) +#else +#define AVWRAP_DECL +#endif + static AVFormatContext* g_pContainer; static AVOutputFormat* g_pFormat; static AVStream* g_pAStream; @@ -371,7 +379,7 @@ } } -void AVWrapper_WriteFrame(uint8_t* pY, uint8_t* pCb, uint8_t* pCr) +AVWRAP_DECL void AVWrapper_WriteFrame(uint8_t* pY, uint8_t* pCb, uint8_t* pCr) { g_pVFrame->data[0] = pY; g_pVFrame->data[1] = pCb; @@ -379,7 +387,7 @@ WriteFrame(g_pVFrame); } -void AVWrapper_Init( +AVWRAP_DECL void AVWrapper_Init( void (*pAddFileLogRaw)(const char*), const char* pFilename, const char* pDesc, @@ -472,7 +480,7 @@ g_pVFrame->pts = -1; } -void AVWrapper_Close() +AVWRAP_DECL void AVWrapper_Close() { // output buffered frames if (g_pVCodec->capabilities & CODEC_CAP_DELAY) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/config.inc.in --- a/hedgewars/config.inc.in Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/config.inc.in Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,5 +25,4 @@ cVersionString = '${HEDGEWARS_VERSION}'; cRevisionString = '${HEDGEWARS_REVISION}'; cHashString = '${HEDGEWARS_HASH}'; - cLuaLibrary = '${LUA_LIBRARY}'; cDefaultPathPrefix = '${HEDGEWARS_FULL_DATADIR}/Data'; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/hwLibrary.pas --- a/hedgewars/hwLibrary.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/hwLibrary.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/hwengine.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted - , uPhysFSLayer, uCursor + , uPhysFSLayer, uCursor, uRandom {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF} {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF} {$IFDEF ANDROID}, GLUnit{$ENDIF} @@ -79,6 +79,7 @@ DisableSomeWeapons; AddClouds; AddFlakes; + SetRandomSeed(cSeed, false); AssignHHCoords; AddMiscGears; StoreLoad(false); @@ -92,13 +93,7 @@ ScriptCall('onGameStart'); GameState:= gsGame; end; - gsConfirm, gsGame: - begin - if not cOnlyStats then DrawWorld(Lag); - DoGameTick(Lag); - if not cOnlyStats then ProcessVisualGears(Lag); - end; - gsChat: + gsConfirm, gsGame, gsChat: begin if not cOnlyStats then DrawWorld(Lag); DoGameTick(Lag); @@ -122,11 +117,7 @@ if flagMakeCapture then begin flagMakeCapture:= false; - {$IFDEF PAS2C} - s:= '/Screenshots/hw'; - {$ELSE} s:= '/Screenshots/hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks); - {$ENDIF} // flash playSound(sndShutter); @@ -160,7 +151,7 @@ while isTerminated = false do begin SDL_PumpEvents(); - + while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}SDL_ALLEVENTS{$ENDIF}) > 0 do begin case event.type_ of @@ -169,14 +160,14 @@ if GameState = gsChat then begin // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3 - KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym, event.key.keysym.sym)//TODO correct for keymodifiers + KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym), event.key.keysym.sym); //TODO correct for keymodifiers end - else + else + if GameState >= gsGame then ProcessKey(event.key); + SDL_KEYUP: + if (GameState <> gsChat) and (GameState >= gsGame) then ProcessKey(event.key); - SDL_KEYUP: - if GameState <> gsChat then - ProcessKey(event.key); - + SDL_WINDOWEVENT: if event.window.event = SDL_WINDOWEVENT_SHOWN then begin @@ -202,13 +193,13 @@ cNewScreenHeight:= max(2 * (event.window.data2 div 2), cMinScreenHeight); cScreenResizeDelay:= RealTicks + 500{$IFDEF IPHONEOS}div 2{$ENDIF}; end; - + SDL_FINGERMOTION: onTouchMotion(event.tfinger.x, event.tfinger.y,event.tfinger.dx, event.tfinger.dy, event.tfinger.fingerId); - + SDL_FINGERDOWN: onTouchDown(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId); - + SDL_FINGERUP: onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId); {$ELSE} @@ -216,23 +207,20 @@ if GameState = gsChat then KeyPressChat(event.key.keysym.unicode, event.key.keysym.sym) else - ProcessKey(event.key); + if GameState >= gsGame then ProcessKey(event.key); SDL_KEYUP: - if GameState <> gsChat then + if (GameState <> gsChat) and (GameState >= gsGame) then ProcessKey(event.key); - + SDL_MOUSEBUTTONDOWN: if GameState = gsConfirm then - begin - resetPosition(); - ParseCommand('quit', true); - end + ParseCommand('quit', true) else - ProcessMouse(event.button, true); - + if (GameState >= gsGame) then ProcessMouse(event.button, true); + SDL_MOUSEBUTTONUP: - ProcessMouse(event.button, false); - + if (GameState >= gsGame) then ProcessMouse(event.button, false); + SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then begin @@ -241,7 +229,7 @@ if prevFocusState xor cHasFocus then onFocusStateChanged() end; - + SDL_VIDEORESIZE: begin // using lower values than cMinScreenWidth or cMinScreenHeight causes widget overlap and off-screen widget parts @@ -345,7 +333,7 @@ ' (' + cHashString + ') with protocol #' + inttostr(cNetProtoVersion)); AddFileLog('Prefix: "' + PathPrefix +'"'); AddFileLog('UserPrefix: "' + UserPathPrefix +'"'); - + for i:= 0 to ParamCount do AddFileLog(inttostr(i) + ': ' + ParamStr(i)); @@ -365,7 +353,7 @@ InitOffscreenOpenGL() else {$ENDIF} - begin + begin // show main window if cFullScreen then ParseCommand('fullscr 1', true) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/options.inc --- a/hedgewars/options.inc Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/options.inc Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,10 +29,8 @@ {$DEFINE USE_LUA_SCRIPT} - {$IFDEF ANDROID} {$DEFINE MOBILE} - {$DEFINE USE_SDLTHREADS} {$DEFINE USE_CONTEXT_RESTORE} {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'} {$ENDIF} @@ -66,14 +64,12 @@ {$DEFINE SDL13} {$ENDIF} -{$IFDEF PAS2C} - {$DEFINE NOCONSOLE} - {$DEFINE USE_SDLTHREADS} -{$ENDIF} +//TODO: cruft to be removed {$DEFINE _S:=} {$DEFINE _P:=} + //{$DEFINE TRACEAIACTIONS} //{$DEFINE COUNTTICKS} diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/pas2c.h --- a/hedgewars/pas2c.h Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -typedef union string255_ - { - struct { - char s[256]; - }; - struct { - char len; - char str[255]; - }; - } string255; -typedef struct string192_ - { - char s[193]; - } string192; -typedef struct string31_ - { - char s[32]; - } string31; -typedef struct string15_ - { - char s[16]; - } string15; - -typedef string255 shortstring; -typedef string255 ansistring; - -typedef uint8_t Byte; -typedef int8_t ShortInt; -typedef uint16_t Word; -typedef int16_t SmallInt; -typedef uint32_t LongWord; -typedef int32_t LongInt; -typedef uint64_t QWord; -typedef int64_t Int64; -typedef LongWord Cardinal; - -typedef LongInt Integer; -typedef float extended; -typedef float real; -typedef float single; - -typedef bool boolean; -typedef int LongBool; - -typedef void * pointer; -typedef Byte * PByte; -typedef char * PChar; -typedef LongInt * PLongInt; -typedef LongWord * PLongWord; -typedef Integer * PInteger; -typedef int PtrInt; -typedef wchar_t widechar; - -#define new(a) __new((void **)&a, sizeof(*(a))) -void __new(void ** p, int size); -#define dispose(a) __dispose(a, sizeof(*(a))) -void __dispose(pointer p, int size); - -void * GetMem(int size); -void FreeMem(void * p, int size); - -#define FillChar(a, b, c) __FillChar(&(a), b, c) - -void __FillChar(pointer p, int size, char fill); -string255 _strconcat(string255 a, string255 b); -string255 _strappend(string255 s, char c); -string255 _strprepend(char c, string255 s); -string255 _chrconcat(char a, char b); -bool _strcompare(string255 a, string255 b); -bool _strcomparec(string255 a, char b); -bool _strncompare(string255 a, string255 b); -char * _pchar(string255 s); -string255 pchar2str(char * s); - -int Length(string255 a); -string255 copy(string255 a, int s, int l); -string255 delete(string255 a, int s, int l); -string255 trim(string255 a); - -#define STRINIT(a) {.len = sizeof(a) - 1, .str = a} - - -int length_ar(void * a); - -typedef int file; -typedef int TextFile; -extern int FileMode; -extern int IOResult; -extern int stdout; -extern int stderr; - -#define assign(a, b) assign_(&(a), b) -void assign_(int * f, string255 fileName); -void reset_1(int f, int size); -void reset_2(int f, int size); -#define BlockRead(a, b, c, d) BlockRead_(a, &(b), c, &(d)) -void BlockRead_(int f, void * p, int size, int * sizeRead); -#define BlockWrite(a, b, c) BlockWrite_(a, &(b), c) -void BlockWrite_(int f, void * p, int size); -void close(int f); - -void write(int f, string255 s); -void writeLn(int f, string255 s); - -bool DirectoryExists(string255 dir); -bool FileExists(string255 filename); - -bool odd(int i); - - -typedef int TThreadId; -void ThreadSwitch(); -#define InterlockedIncrement(a) __InterlockedIncrement(&(a)) -#define InterlockedDecrement(a) __InterlockedDecrement(&(a)) -void __InterlockedIncrement(int * a); -void __InterlockedDecrement(int * a); - -bool Assigned(void * a); - -void randomize(); -int random(int max); -int abs(int i); -double sqr(double n); -double sqrt(double n); -int trunc(double n); -int round(double n); - -string255 ParamStr(int n); -int ParamCount(); - -#define val(a, b, c) _val(a, (LongInt*)&(b), (LongInt*)&(c)) -void _val(string255 str, LongInt * a, LongInt * c); - -extern double pi; - -string255 EnumToStr(int a); -string255 ExtractFileName(string255 f); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/pas2cSystem.pas --- a/hedgewars/pas2cSystem.pas Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -system; - -type - Integer = integer; - LongInt = integer; - LongWord = integer; - Cardinal = integer; - PtrInt = integer; - Word = integer; - Byte = integer; - SmallInt = integer; - ShortInt = integer; - QWord = integer; - GLint = integer; - GLuint = integer; - int = integer; - size_t = integer; - - pointer = pointer; - - float = float; - single = float; - double = float; - real = float; - extended = float; - GLfloat = float; - - boolean = boolean; - LongBool = boolean; - - string = string; - shortstring = string; - ansistring = string; - widechar = string; - - char = char; - PChar = ^char; - PPChar = ^Pchar; - - PByte = ^Byte; - PWord = ^Word; - PLongInt = ^LongInt; - PLongWord = ^LongWord; - PInteger = ^Integer; - - Handle = integer; - - png_structp = pointer; - png_size_t = integer; - -var - false, true: boolean; - - write, writeLn, read, readLn: procedure; - - StrLen, ord, Succ, Pred : function : integer; - inc, dec, Low, High, Lo, Hi : function : integer; - odd, even : function : boolean; - - Now : function : integer; - - new, dispose, FillChar, Move : procedure; - - trunc, round : function : integer; - abs, sqr : function : integer; - - StrPas, FormatDateTime, copy, delete, str, pos, trim, LowerCase : function : shortstring; - Length, StrToInt : function : integer; - SetLength, val : procedure; - _pchar : function : PChar; - pchar2str : function : string; - memcpy : procedure; - - assign, rewrite, reset, flush, BlockWrite, BlockRead, close : procedure; - IOResult : integer; - exit, break, halt, continue : procedure; - TextFile, file : Handle; - FileMode : integer; - FileExists, DirectoryExists, eof : function : boolean; - ExtractFileName : function : string; - exitcode : integer; - stdout, stderr : Handle; - - ParamCount : function : integer; - ParamStr : function : string; - - sqrt, arctan2, cos, sin, power : function : float; - pi : float; - - TypeInfo, GetEnumName : function : shortstring; - - UTF8ToUnicode, WrapText: function : shortstring; - - sizeof : function : integer; - - GetMem : function : pointer; - FreeMem : procedure; - - glGetString : function : pchar; - - glBegin, glBindTexture, glBlendFunc, glClear, glClearColor, - glColor4ub, glColorMask, glColorPointer, glDeleteTextures, - glDisable, glDisableClientState, glDrawArrays, glEnable, - glEnableClientState, glEnd, glGenTextures, glGetIntegerv, - glHint, glLineWidth, glLoadIdentity, glMatrixMode, glPopMatrix, - glPushMatrix, glReadPixels, glRotatef, glScalef, glTexCoord2f, - glTexCoordPointer, glTexImage2D, glTexParameterf, - glTexParameteri, glTranslatef, glVertex2d, glVertexPointer, - glViewport, glext_LoadExtension, glDeleteRenderbuffersEXT, - glDeleteFramebuffersEXT, glGenFramebuffersEXT, - glGenRenderbuffersEXT, glBindFramebufferEXT, - glBindRenderbufferEXT, glRenderbufferStorageEXT, - glFramebufferRenderbufferEXT, glFramebufferTexture2DEXT : procedure; - - GL_BGRA, GL_BLEND, GL_CLAMP_TO_EDGE, GL_COLOR_ARRAY, - GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_DEPTH_COMPONENT, - GL_DITHER, GL_EXTENSIONS, GL_FALSE, GL_FASTEST, GL_LINEAR, - GL_LINE_LOOP, GL_LINES, GL_LINE_SMOOTH, GL_LINE_STRIP, - GL_MAX_TEXTURE_SIZE, GL_MODELVIEW, GL_ONE_MINUS_SRC_ALPHA, - GL_PERSPECTIVE_CORRECTION_HINT, GL_PROJECTION, GL_QUADS, - GL_RENDERER, GL_RGBA, GL_RGBA8, GL_SRC_ALPHA, GL_TEXTURE_2D, - GL_TEXTURE_COORD_ARRAY, GL_TEXTURE_MAG_FILTER, - GL_TEXTURE_MIN_FILTER, GL_TEXTURE_PRIORITY, GL_TEXTURE_WRAP_S, - GL_TEXTURE_WRAP_T, GL_TRIANGLE_FAN, GL_TRUE, GL_VENDOR, - GL_VERSION, GL_VERTEX_ARRAY, GLenum, GL_FRAMEBUFFER_EXT, - GL_RENDERBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_COLOR_ATTACHMENT0_EXT, GL_FLOAT, GL_UNSIGNED_BYTE : integer; - - TThreadId : function : integer; - BeginThread, ThreadSwitch : procedure; - InterlockedIncrement, InterlockedDecrement : procedure; - - random : function : integer; - randomize : procedure; - - Assigned : function : boolean; - - _strconcat, _strappend, _strprepend, _chrconcat : function : string; - _strcompare, _strncompare, _strcomparec : function : boolean; - - png_structp, png_set_write_fn, png_get_io_ptr, - png_get_libpng_ver, png_create_write_struct, - png_create_info_struct, png_destroy_write_struct, - png_write_row, png_set_ihdr, png_write_info, - png_write_end : procedure; - - EnumToStr : function : string; - diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uAI.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,31 +30,27 @@ implementation uses uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions, - uAmmos, SysUtils{$IFNDEF USE_SDLTHREADS} {$IFDEF UNIX}, cthreads{$ENDIF} {$ENDIF}, uTypes, + uAmmos, SysUtils, uTypes, uVariables, uCommands, uUtils, uDebug, uAILandMarks; var BestActions: TActions; CanUseAmmo: array [TAmmoType] of boolean; StopThinking: boolean; -{$IFDEF USE_SDLTHREADS} - ThinkThread: PSDL_Thread = nil; -{$ELSE} - ThinkThread: TThreadID; -{$ENDIF} - hasThread: LongInt; StartTicks: Longword; + ThinkThread: PSDL_Thread; + ThreadLock: PSDL_Mutex; procedure FreeActionsList; begin AddFileLog('FreeActionsList called'); - if hasThread <> 0 then - begin - AddFileLog('Waiting AI thread to finish'); + if (ThinkThread <> nil) then + begin StopThinking:= true; - repeat - SDL_Delay(10) - until hasThread = 0 - end; + SDL_WaitThread(ThinkThread, nil); + end; + SDL_LockMutex(ThreadLock); + ThinkThread:= nil; + SDL_UnlockMutex(ThreadLock); with CurrentHedgehog^ do if Gear <> nil then @@ -66,7 +62,6 @@ end; - const cBranchStackSize = 12; type TStackEntry = record WastedTicks: Longword; @@ -123,22 +118,18 @@ with Me^.Hedgehog^ do a:= CurAmmoType; aa:= a; -{$IFDEF USE_SDLTHREADS} - SDL_delay(0); //ThreadSwitch was only a hint -{$ELSE} - ThreadSwitch(); -{$ENDIF} + SDL_delay(0); // hint to let the context switch run repeat - if (CanUseAmmo[a]) - and ((not rareChecks) or ((AmmoTests[a].flags and amtest_Rare) = 0)) - and ((i = 0) or ((AmmoTests[a].flags and amtest_NoTarget) = 0)) + if (CanUseAmmo[a]) + and ((not rareChecks) or ((AmmoTests[a].flags and amtest_Rare) = 0)) + and ((i = 0) or ((AmmoTests[a].flags and amtest_NoTarget) = 0)) then begin {$HINTS OFF} - Score:= AmmoTests[a].proc(Me, Targets.ar[i].Point, BotLevel, ap); + Score:= AmmoTests[a].proc(Me, Targets.ar[i], BotLevel, ap); {$HINTS ON} if Actions.Score + Score > BestActions.Score then - if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then + if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel - 1) * 2048) then begin BestActions:= Actions; inc(BestActions.Score, Score); @@ -150,10 +141,10 @@ AddAction(BestActions, aia_LookRight, 0, 200, 0, 0) else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0); - + if (Ammoz[a].Ammo.Propz and ammoprop_Timerable) <> 0 then AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0); - + if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then begin dAngle:= LongInt(Me^.Angle) - Abs(ap.Angle); @@ -168,23 +159,23 @@ AddAction(BestActions, aia_Down, aim_release, -dAngle, 0, 0) end end; - + if (Ammoz[a].Ammo.Propz and ammoprop_NeedTarget) <> 0 then begin AddAction(BestActions, aia_Put, 0, 1, ap.AttackPutX, ap.AttackPutY) end; - + if (Ammoz[a].Ammo.Propz and ammoprop_OscAim) <> 0 then begin AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0); AddAction(BestActions, aia_attack, aim_release, 1, 0, 0); - + if abs(ap.Angle) > 32 then begin AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0); AddAction(BestActions, aia_Down, aim_release, 32, 0, 0); end; - + AddAction(BestActions, aia_waitAngle, ap.Angle, 250, 0, 0); AddAction(BestActions, aia_attack, aim_push, 1, 0, 0); AddAction(BestActions, aia_attack, aim_release, 1, 0, 0); @@ -243,21 +234,21 @@ if (Me^.State and gstAttacked) = 0 then TestAmmos(Actions, Me, false); - + BestRate:= RatePlace(Me); BaseRate:= Max(BestRate, 0); -// switch to 'skip' if we can't move because of mouse cursor being shown +// switch to 'skip' if we cannot move because of mouse cursor being shown if (Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then AddAction(Actions, aia_Weapon, Longword(amSkip), 100 + random(200), 0, 0); - -if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0)) + +if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0)) and (GameFlags and gfArtillery = 0) then begin tmp:= random(2) + 1; Push(0, Actions, Me^, tmp); Push(0, Actions, Me^, tmp xor 3); - + while (Stack.Count > 0) and (not StopThinking) do begin Pop(ticks, Actions, Me^); @@ -267,7 +258,7 @@ AddAction(Actions, aia_WaitXL, hwRound(Me^.X), 0, 0, 0) else AddAction(Actions, aia_WaitXR, hwRound(Me^.X), 0, 0, 0); - + steps:= 0; while (not StopThinking) do @@ -280,8 +271,8 @@ if ticks > maxticks then break; - if (BotLevel < 5) - and (GoInfo.JumpType = jmpHJump) + if (BotLevel < 5) + and (GoInfo.JumpType = jmpHJump) and (not checkMark(hwRound(Me^.X), hwRound(Me^.Y), markHJumped)) then // hjump support begin @@ -295,7 +286,7 @@ AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0) else AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0); - + AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0); AddAction(MadeActions, aia_HJump, 0, 350, 0, 0); end; @@ -303,8 +294,8 @@ Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message) end; end; - if (BotLevel < 3) - and (GoInfo.JumpType = jmpLJump) + if (BotLevel < 3) + and (GoInfo.JumpType = jmpLJump) and (not checkMark(hwRound(Me^.X), hwRound(Me^.Y), markLJumped)) then // ljump support begin @@ -323,7 +314,7 @@ // push current position so we proceed from it after checking jump+forward walk opportunities if CanGo then Push(ticks, Actions, Me^, Me^.Message); - + // first check where we go after jump walking forward if Push(ticks, Actions, AltMe, Me^.Message) then with Stack.States[Pred(Stack.Count)] do @@ -331,10 +322,10 @@ break end; - // 'not CanGO' means we can't go straight, possible jumps are checked above + // 'not CanGO' means we cannot go straight, possible jumps are checked above if not CanGo then break; - + inc(steps); Actions.actions[Pred(Actions.Count)].Param:= hwRound(Me^.X); Rate:= RatePlace(Me); @@ -347,17 +338,17 @@ end else if Rate < BestRate then break; - + if ((Me^.State and gstAttacked) = 0) and ((steps mod 4) = 0) then begin if (steps > 4) and checkMark(hwRound(Me^.X), hwRound(Me^.Y), markWalkedHere) then - break; + break; addMark(hwRound(Me^.X), hwRound(Me^.Y), markWalkedHere); TestAmmos(Actions, Me, ticks shr 12 = oldticks shr 12); - + end; - + if GoInfo.FallPix >= FallPixForBranching then Push(ticks, Actions, Me^, Me^.Message xor 3); // aia_Left xor 3 = aia_Right end {while}; @@ -368,25 +359,25 @@ end {if} end; -function Think(Me: Pointer): ptrint; +function Think(Me: PGear): LongInt; cdecl; export; var BackMe, WalkMe: TGear; switchCount: LongInt; StartTicks, currHedgehogIndex, itHedgehog, switchesNum, i: Longword; switchImmediatelyAvailable: boolean; Actions: TActions; begin -InterlockedIncrement(hasThread); +dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; StartTicks:= GameTicks; currHedgehogIndex:= CurrentTeam^.CurrHedgehog; itHedgehog:= currHedgehogIndex; switchesNum:= 0; switchImmediatelyAvailable:= (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtSwitcher); -if PGear(Me)^.Hedgehog^.BotLevel <> 5 then +if Me^.Hedgehog^.BotLevel <> 5 then switchCount:= HHHasAmmo(PGear(Me)^.Hedgehog^, amSwitch) else switchCount:= 0; -if (PGear(Me)^.State and gstAttacked) = 0 then +if ((Me^.State and gstAttacked) = 0) or isInMultiShoot then if Targets.Count > 0 then begin // iterate over current team hedgehogs @@ -402,7 +393,7 @@ begin // when AI has to use switcher, make it cost smth unless they have a lot of switches if (switchCount < 10) then Actions.Score:= (-27+switchCount*3)*4000; - AddAction(Actions, aia_Weapon, Longword(amSwitch), 300 + random(200), 0, 0); + AddAction(Actions, aia_Weapon, Longword(amSwitch), 300 + random(200), 0, 0); AddAction(Actions, aia_attack, aim_push, 300 + random(300), 0, 0); AddAction(Actions, aia_attack, aim_release, 1, 0, 0); end; @@ -416,10 +407,9 @@ itHedgehog:= Succ(itHedgehog) mod CurrentTeam^.HedgehogsNumber; until (itHedgehog = currHedgehogIndex) or ((CurrentTeam^.Hedgehogs[itHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[itHedgehog].Effects[heFrozen]=0)); - inc(switchesNum); until (not (switchImmediatelyAvailable or (switchCount > 0))) - or StopThinking + or StopThinking or (itHedgehog = currHedgehogIndex) or BestActions.isWalkingToABetterPlace; @@ -435,8 +425,9 @@ end else SDL_Delay(100) else begin - BackMe:= PGear(Me)^; - while (not StopThinking) and (BestActions.Count = 0) do + BackMe:= Me^; + i:= 12; + while (not StopThinking) and (BestActions.Count = 0) and (i > 0) do begin (* // Maybe this would get a bit of movement out of them? Hopefully not *toward* water. Need to check how often he'd choose that strategy @@ -449,14 +440,17 @@ Actions.Pos:= 0; Actions.Score:= 0; Walk(@WalkMe, Actions); + dec(i); if not StopThinking then SDL_Delay(100) end end; -PGear(Me)^.State:= PGear(Me)^.State and (not gstHHThinking); +Me^.State:= Me^.State and (not gstHHThinking); +SDL_LockMutex(ThreadLock); +ThinkThread:= nil; +SDL_UnlockMutex(ThreadLock); Think:= 0; -InterlockedDecrement(hasThread) end; procedure StartThink(Me: PGear); @@ -485,17 +479,16 @@ exit end; -FillBonuses((Me^.State and gstAttacked) <> 0); -AddFileLog('Enter Think Thread'); -{$IFDEF USE_SDLTHREADS} -ThinkThread := SDL_CreateThread(@Think{$IFDEF SDL13}, nil{$ENDIF}, Me); -{$ELSE} -BeginThread(@Think, Me, ThinkThread); -{$ENDIF} -AddFileLog('Thread started'); +FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot)); + +SDL_LockMutex(ThreadLock); +ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL13}, 'think'{$ENDIF}, Me); +SDL_UnlockMutex(ThreadLock); end; -//var scoreShown: boolean = false; +{$IFDEF DEBUGAI} +var scoreShown: boolean = false; +{$ENDIF} procedure ProcessBot; const cStopThinkTime = 40; @@ -513,21 +506,25 @@ StopMessages(Gear^.Message); TryDo((Gear^.Message and gmAllStoppable) = 0, 'Engine bug: AI may break demos playing', true); end; - + if Gear^.Message <> 0 then exit; - - //scoreShown:= false; + +{$IFDEF DEBUGAI} + scoreShown:= false; +{$ENDIF} StartThink(Gear); StartTicks:= GameTicks - + end else begin - {if not scoreShown then +{$IFDEF DEBUGAI} + if not scoreShown then begin if BestActions.Score > 0 then ParseCommand('/say Expected score = ' + inttostr(BestActions.Score div 1024), true); scoreShown:= true - end;} + end; +{$ENDIF} ProcessAction(BestActions, Gear) end else if ((GameTicks - StartTicks) > cMaxAIThinkTime) @@ -537,14 +534,15 @@ procedure initModule; begin - hasThread:= 0; StartTicks:= 0; - ThinkThread:= ThinkThread; + ThinkThread:= nil; + ThreadLock:= SDL_CreateMutex(); end; procedure freeModule; begin FreeActionsList(); + SDL_DestroyMutex(ThreadLock); end; end. diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uAIActions.pas --- a/hedgewars/uAIActions.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uAIActions.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uAIAmmoTests.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ unit uAIAmmoTests; interface -uses SDLh, uConsts, uFloat, uTypes; -const +uses uConsts, uFloat, uTypes, uAIMisc; +const amtest_Rare = $00000001; // check only several positions amtest_NoTarget = $00000002; // each pos, but no targetting @@ -34,27 +34,27 @@ AttackPutX, AttackPutY: LongInt; end; -function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestSnowball(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestGrenade(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestMolotov(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestClusterBomb(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestWatermelon(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestDrillRocket(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestMortar(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestSniperRifle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestWhip(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestKamikaze(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestTeleport(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestHammer(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -function TestCake(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestBazooka(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestSnowball(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestGrenade(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestMolotov(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestClusterBomb(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestWatermelon(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestDrillRocket(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestMortar(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestShotgun(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestDesertEagle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestSniperRifle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestBaseballBat(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestFirePunch(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestWhip(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestKamikaze(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestAirAttack(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestTeleport(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestHammer(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +function TestCake(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; -type TAmmoTestProc = function (Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +type TAmmoTestProc = function (Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; TAmmoTest = record proc: TAmmoTestProc; flags: Longword; @@ -123,14 +123,14 @@ ); implementation -uses uAIMisc, uVariables, uUtils, uGearsHandlers; +uses uVariables, uUtils, uGearsHandlers; function Metric(x1, y1, x2, y2: LongInt): LongInt; inline; begin Metric:= abs(x1 - x2) + abs(y1 - y2) end; -function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestBazooka(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var Vx, Vy, r, mX, mY: real; rTime: LongInt; EX, EY: LongInt; @@ -147,8 +147,8 @@ valueResult:= BadTurn; repeat rTime:= rTime + 300 + Level * 50 + random(300); - Vx:= - windSpeed * rTime * 0.5 + (Targ.X + AIrndSign(2) - mX) / rTime; - Vy:= cGravityf * rTime * 0.5 - (Targ.Y + 1 - mY) / rTime; + Vx:= - windSpeed * rTime * 0.5 + (Targ.Point.X + AIrndSign(2) - mX) / rTime; + Vy:= cGravityf * rTime * 0.5 - (Targ.Point.Y + 1 - mY) / rTime; r:= sqr(Vx) + sqr(Vy); if not (r > 1) then begin @@ -163,16 +163,16 @@ dX:= dX + windSpeed; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0); - + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 5))) or (t <= 0); + EX:= trunc(x); EY:= trunc(y); if Level = 1 then value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand) else value:= RateExplosion(Me, EX, EY, 101); - if value = 0 then - value:= 1024 - Metric(Targ.X, Targ.Y, EX, EY) div 64; + if (value = 0) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then + value:= 1024 - Metric(Targ.Point.X, Targ.Point.Y, EX, EY) div 64; if valueResult <= value then begin ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9)); @@ -184,12 +184,12 @@ end; end //until (value > 204800) or (rTime > 4250); not so useful since adding score to the drowning -until rTime > 4250; +until rTime > 5050 - Level * 800; TestBazooka:= valueResult end; -function TestDrillRocket(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestDrillRocket(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var Vx, Vy, r, mX, mY: real; rTime: LongInt; EX, EY: LongInt; @@ -197,7 +197,11 @@ x, y, dX, dY: real; t: LongInt; value: LongInt; + t2: real; + timer: Longint; begin + if (Level > 3) then exit(BadTurn); + mX:= hwFloat2Float(Me^.X); mY:= hwFloat2Float(Me^.Y); ap.Time:= 0; @@ -206,8 +210,8 @@ valueResult:= BadTurn; repeat rTime:= rTime + 300 + Level * 50 + random(300); - Vx:= - windSpeed * rTime * 0.5 + (Targ.X + AIrndSign(2) - mX) / rTime; - Vy:= cGravityf * rTime * 0.5 - (Targ.Y - 35 - mY) / rTime; + Vx:= - windSpeed * rTime * 0.5 + (Targ.Point.X + AIrndSign(2) - mX) / rTime; + Vy:= cGravityf * rTime * 0.5 - (Targ.Point.Y - 35 - mY) / rTime; r:= sqr(Vx) + sqr(Vy); if not (r > 1) then begin @@ -222,16 +226,34 @@ dX:= dX + windSpeed; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (y > cWaterLine); - + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 5))) or (y > cWaterLine); + + if TestCollExcludingObjects(trunc(x), trunc(y), 5) and (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) > 21) then + begin + timer := 500; + t2 := 0.5 / sqrt(sqr(dX) + sqr(dY)); + dX := dX * t2; + dY := dY * t2; + repeat + x:= x + dX; + y:= y + dY; + dec(timer); + until (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 22) + or (x < 0) + or (y < 0) + or (trunc(x) > LAND_WIDTH) + or (trunc(y) > LAND_HEIGHT) + or not TestCollExcludingObjects(trunc(x), trunc(y), 5) + or (timer = 0) + end; EX:= trunc(x); EY:= trunc(y); + // Try to prevent AI from thinking firing into water will cause a drowning + if (EY < cWaterLine-5) and (Timer > 0) and (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) > 21) then exit(BadTurn); if Level = 1 then value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand) else value:= RateExplosion(Me, EX, EY, 101); - if value = 0 then - value:= 1024 - Metric(Targ.X, Targ.Y, EX, EY) div 64; if valueResult <= value then begin ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9)); @@ -239,15 +261,15 @@ ap.ExplR:= 100; ap.ExplX:= EX; ap.ExplY:= EY; - valueResult:= value + valueResult:= value-2500 // trying to make it slightly less attractive than a bazooka, to prevent waste. AI could use awareness of weapon count end; end - until rTime > 4250; + until rTime > 5050 - Level * 800; TestDrillRocket:= valueResult end; -function TestSnowball(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestSnowball(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var Vx, Vy, r: real; rTime: LongInt; EX, EY: LongInt; @@ -265,8 +287,8 @@ valueResult:= BadTurn; repeat rTime:= rTime + 300 + Level * 50 + random(1000); - Vx:= - windSpeed * rTime * 0.5 + ((Targ.X + AIrndSign(2)) - meX) / rTime; - Vy:= cGravityf * rTime * 0.5 - (Targ.Y - meY) / rTime; + Vx:= - windSpeed * rTime * 0.5 + ((Targ.Point.X + AIrndSign(2)) - meX) / rTime; + Vy:= cGravityf * rTime * 0.5 - (Targ.Point.Y - meY) / rTime; r:= sqr(Vx) + sqr(Vy); if not (r > 1) then begin @@ -281,15 +303,15 @@ dX:= dX + windSpeed; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 5))) or (t <= 0); EX:= trunc(x); EY:= trunc(y); - value:= RateShove(trunc(x), trunc(y), 5, 1, trunc((abs(dX)+abs(dY))*20), -dX, -dY, afTrackFall); + value:= RateShove(Me, trunc(x), trunc(y), 5, 1, trunc((abs(dX)+abs(dY))*20), -dX, -dY, afTrackFall); // LOL copypasta: this is score for digging with... snowball //if value = 0 then - // value:= - Metric(Targ.X, Targ.Y, EX, EY) div 64; + // value:= - Metric(Targ.Point.X, Targ.Point.Y, EX, EY) div 64; if valueResult <= value then begin @@ -301,14 +323,14 @@ valueResult:= value end; end -until (rTime > 4250); +until (rTime > 5050 - Level * 800); TestSnowball:= valueResult end; -function TestMolotov(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestMolotov(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var Vx, Vy, r: real; Score, EX, EY, valueResult: LongInt; - TestTime: Longword; + TestTime: LongInt; x, y, dY, meX, meY: real; t: LongInt; begin @@ -319,8 +341,8 @@ ap.ExplR:= 0; repeat inc(TestTime, 300); - Vx:= (Targ.X - meX) / TestTime; - Vy:= cGravityf * (TestTime div 2) - Targ.Y - meY / TestTime; + Vx:= (Targ.Point.X - meX) / TestTime; + Vy:= cGravityf * (TestTime div 2) - Targ.Point.Y - meY / TestTime; r:= sqr(Vx) + sqr(Vy); if not (r > 1) then begin @@ -333,15 +355,15 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 6))) or (t = 0); EX:= trunc(x); EY:= trunc(y); if t < 50 then Score:= RateExplosion(Me, EX, EY, 97) // average of 17 attempts, most good, but some failing spectacularly else Score:= BadTurn; - + if valueResult < Score then begin ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level)); @@ -352,15 +374,15 @@ valueResult:= Score end; end -until (TestTime > 4250); +until (TestTime > 5050 - Level * 800); TestMolotov:= valueResult end; -function TestGrenade(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestGrenade(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const tDelta = 24; var Vx, Vy, r: real; Score, EX, EY, valueResult: LongInt; - TestTime: Longword; + TestTime: LongInt; x, y, meX, meY, dY: real; t: LongInt; begin @@ -371,13 +393,13 @@ meY:= hwFloat2Float(Me^.Y); repeat inc(TestTime, 1000); - Vx:= (Targ.X - meX) / (TestTime + tDelta); - Vy:= cGravityf * ((TestTime + tDelta) div 2) - (Targ.Y - meY) / (TestTime + tDelta); + Vx:= (Targ.Point.X - meX) / (TestTime + tDelta); + Vy:= cGravityf * ((TestTime + tDelta) div 2) - (Targ.Point.Y - meY) / (TestTime + tDelta); r:= sqr(Vx) + sqr(Vy); if not (r > 1) then begin x:= meX; - y:= meY; + y:= meY; dY:= -Vy; t:= TestTime; repeat @@ -385,21 +407,21 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 5))) or (t = 0); EX:= trunc(x); EY:= trunc(y); - if t < 50 then + if t < 50 then if Level = 1 then Score:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand) else Score:= RateExplosion(Me, EX, EY, 101) - else + else Score:= BadTurn; if (valueResult < Score) and (Score > 0) then begin - ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level)); - ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15); + ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level * 3)); + ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 20); ap.Time:= TestTime; ap.ExplR:= 100; ap.ExplX:= EX; @@ -408,11 +430,11 @@ end; end //until (Score > 204800) or (TestTime > 4000); -until TestTime > 4000; +until TestTime > 4500 - Level * 512; TestGrenade:= valueResult end; -function TestClusterBomb(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestClusterBomb(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const tDelta = 24; var Vx, Vy, r: real; Score, EX, EY, valueResult: LongInt; @@ -428,11 +450,11 @@ repeat inc(TestTime, 900); // Try to overshoot slightly, seems to pay slightly better dividends in terms of hitting cluster - if meX 1) then begin @@ -445,18 +467,18 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0); + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 5))) or (t = 0); EX:= trunc(x); EY:= trunc(y); - if t < 50 then + if t < 50 then Score:= RateExplosion(Me, EX, EY, 41) - else + else Score:= BadTurn; - if valueResult < Score then + if Score > 0 then begin - ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level)); + ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level * 2)); ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15); ap.Time:= TestTime div 1000 * 1000; ap.ExplR:= 90; @@ -469,7 +491,7 @@ TestClusterBomb:= valueResult end; -function TestWatermelon(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestWatermelon(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const tDelta = 24; var Vx, Vy, r: real; Score, EX, EY, valueResult: LongInt; @@ -484,8 +506,8 @@ meY:= hwFloat2Float(Me^.Y); repeat inc(TestTime, 900); - Vx:= (Targ.X - meX) / (TestTime + tDelta); - Vy:= cGravityf * ((TestTime + tDelta) div 2) - ((Targ.Y-50) - meY) / (TestTime + tDelta); + Vx:= (Targ.Point.X - meX) / (TestTime + tDelta); + Vy:= cGravityf * ((TestTime + tDelta) div 2) - ((Targ.Point.Y-50) - meY) / (TestTime + tDelta); r:= sqr(Vx)+sqr(Vy); if not (r > 1) then begin @@ -498,16 +520,16 @@ y:= y + dY; dY:= dY + cGravityf; dec(t) - until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0); - + until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, trunc(x), trunc(y), 6))) or (t = 0); + EX:= trunc(x); EY:= trunc(y); - if t < 50 then + if t < 50 then Score:= RateExplosion(Me, EX, EY, 200) + RateExplosion(Me, EX, EY + 120, 200) - else + else Score:= BadTurn; - + if valueResult < Score then begin ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level)); @@ -544,8 +566,8 @@ else Solve:= 0 end; - -function TestMortar(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; + +function TestMortar(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; //const tDelta = 24; var Vx, Vy: real; Score, EX, EY: LongInt; @@ -561,13 +583,13 @@ if (Level > 2) then exit(BadTurn); - TestTime:= Solve(Targ.X, Targ.Y, trunc(meX), trunc(meY)); + TestTime:= Solve(Targ.Point.X, Targ.Point.Y, trunc(meX), trunc(meY)); if TestTime = 0 then exit(BadTurn); - Vx:= (Targ.X - meX) / TestTime; - Vy:= cGravityf * (TestTime div 2) - (Targ.Y - meY) / TestTime; + Vx:= (Targ.Point.X - meX) / TestTime; + Vy:= cGravityf * (TestTime div 2) - (Targ.Point.Y - meY) / TestTime; x:= meX; y:= meY; @@ -579,15 +601,15 @@ dY:= dY + cGravityf; EX:= trunc(x); EY:= trunc(y); - until (((Me = CurrentHedgehog^.Gear) and TestColl(EX, EY, 4)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, EX, EY, 4))) or (EY > cWaterLine); + until (((Me = CurrentHedgehog^.Gear) and TestColl(EX, EY, 4)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, EX, EY, 4))) or (EY > cWaterLine); if (EY < cWaterLine) and (dY >= 0) then begin Score:= RateExplosion(Me, EX, EY, 91); if (Score = 0) then - if (dY > 0.15) then - Score:= - abs(Targ.Y - EY) div 32 + if (dY > 0.15) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then + Score:= - abs(Targ.Point.Y - EY) div 32 else Score:= BadTurn else if (Score < 0) then @@ -596,7 +618,7 @@ else Score:= BadTurn; - if BadTurn < Score then + if Score > 0 then begin ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level)); ap.Power:= 1; @@ -607,7 +629,7 @@ end; end; -function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestShotgun(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const MIN_RANGE = 80; MAX_RANGE = 400; @@ -621,33 +643,33 @@ ap.Power:= 1; x:= hwFloat2Float(Me^.X); y:= hwFloat2Float(Me^.Y); -range:= Metric(trunc(x), trunc(y), Targ.X, Targ.Y); +range:= Metric(trunc(x), trunc(y), Targ.Point.X, Targ.Point.Y); if ( range < MIN_RANGE ) or ( range > MAX_RANGE ) then exit(BadTurn); -Vx:= (Targ.X - x) * 1 / 1024; -Vy:= (Targ.Y - y) * 1 / 1024; +Vx:= (Targ.Point.X - x) * 1 / 1024; +Vy:= (Targ.Point.Y - y) * 1 / 1024; ap.Angle:= DxDy2AttackAnglef(Vx, -Vy); repeat x:= x + vX; y:= y + vY; rx:= trunc(x); ry:= trunc(y); - if ((Me = CurrentHedgehog^.Gear) and TestColl(rx, ry, 2)) or - ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, rx, ry, 2)) then + if ((Me = CurrentHedgehog^.Gear) and TestColl(rx, ry, 2)) or + ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, rx, ry, 2)) then begin x:= x + vX * 8; y:= y + vY * 8; valueResult:= RateShotgun(Me, vX, vY, rx, ry); - - if valueResult = 0 then - valueResult:= 1024 - Metric(Targ.X, Targ.Y, rx, ry) div 64 - else + + if (valueResult = 0) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then + valueResult:= 1024 - Metric(Targ.Point.X, Targ.Point.Y, rx, ry) div 64 + else dec(valueResult, Level * 4000); // 27/20 is reuse bonus exit(valueResult * 27 div 20) end -until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4) +until (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 4) or (x < 0) or (y < 0) or (trunc(x) > LAND_WIDTH) @@ -656,27 +678,26 @@ TestShotgun:= BadTurn end; -function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -var Vx, Vy, x, y, t, dmgMod: real; +function TestDesertEagle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +var Vx, Vy, x, y, t: real; d: Longword; - fallDmg, valueResult: LongInt; + {fallDmg, }valueResult: LongInt; begin -if Level > 4 then exit(BadTurn); -dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; +if (Level > 4) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn); Level:= Level; // avoid compiler hint -ap.ExplR:= 0; +ap.ExplR:= 1; ap.Time:= 0; ap.Power:= 1; x:= hwFloat2Float(Me^.X); y:= hwFloat2Float(Me^.Y); -if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 20 then +if Abs(trunc(x) - Targ.Point.X) + Abs(trunc(y) - Targ.Point.Y) < 20 then exit(BadTurn); -t:= 2 / sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y)); -Vx:= (Targ.X - x) * t; -Vy:= (Targ.Y - y) * t; +t:= 2 / sqrt(sqr(Targ.Point.X - x)+sqr(Targ.Point.Y-y)); +Vx:= (Targ.Point.X - x) * t; +Vy:= (Targ.Point.Y - y) * t; ap.Angle:= DxDy2AttackAnglef(Vx, -Vy); d:= 0; @@ -686,47 +707,40 @@ if ((trunc(x) and LAND_WIDTH_MASK) = 0)and((trunc(y) and LAND_HEIGHT_MASK) = 0) and (Land[trunc(y), trunc(x)] <> 0) then inc(d); -until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 5) +until (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 5) or (x < 0) or (y < 0) or (trunc(x) > LAND_WIDTH) or (trunc(y) > LAND_HEIGHT) or (d > 48); -if Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 5 then - begin - fallDmg:= TraceShoveFall(Targ.X, Targ.Y, vX * 0.00125 * 20, vY * 0.00125 * 20); - if fallDmg < 0 then - valueResult:= 204800 - else valueResult:= Max(0, (4 - d div 12) * trunc((7 + fallDmg) * dmgMod) * 1024) - end -else - valueResult:= BadTurn; +if Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 5 then + valueResult:= RateShove(Me, Targ.Point.X, Targ.Point.Y, 1, 7, 20, vX*0.125, vY*0.125, afTrackFall) +else valueResult:= BadTurn; TestDesertEagle:= valueResult end; -function TestSniperRifle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; -var Vx, Vy, x, y, t, dmg, dmgMod: real; +function TestSniperRifle(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; +var Vx, Vy, x, y, t, dmg: real; d: Longword; - fallDmg: LongInt; + //fallDmg: LongInt; begin -if Level > 3 then exit(BadTurn); -dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; +if (Level > 3) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn); Level:= Level; // avoid compiler hint ap.ExplR:= 0; ap.Time:= 0; ap.Power:= 1; x:= hwFloat2Float(Me^.X); y:= hwFloat2Float(Me^.Y); -if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 40 then +if Abs(trunc(x) - Targ.Point.X) + Abs(trunc(y) - Targ.Point.Y) < 40 then exit(BadTurn); -dmg:= sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y)); +dmg:= sqrt(sqr(Targ.Point.X - x)+sqr(Targ.Point.Y-y)); t:= 1.5 / dmg; dmg:= dmg * 0.025; // div 40 -Vx:= (Targ.X - x) * t; -Vy:= (Targ.Y - y) * t; +Vx:= (Targ.Point.X - x) * t; +Vy:= (Targ.Point.Y - y) * t; ap.Angle:= DxDy2AttackAnglef(Vx, -Vy); d:= 0; @@ -736,27 +750,20 @@ if ((trunc(x) and LAND_WIDTH_MASK) = 0)and((trunc(y) and LAND_HEIGHT_MASK) = 0) and (Land[trunc(y), trunc(x)] <> 0) then inc(d); -until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4) +until (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 4) or (x < 0) or (y < 0) or (trunc(x) > LAND_WIDTH) or (trunc(y) > LAND_HEIGHT) or (d > 22); -if Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4 then - begin - fallDmg:= TraceShoveFall(Targ.X, Targ.Y, vX * 0.00166 * dmg, vY * 0.00166 * dmg); - if fallDmg < 0 then - TestSniperRifle:= BadTurn - else - TestSniperRifle:= Max(0, trunc((dmg + fallDmg) * dmgMod) * 1024) - end -else - TestSniperRifle:= BadTurn +if Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) < 4 then + TestSniperRifle:= RateShove(Me, Targ.Point.X, Targ.Point.Y, 1, trunc(dmg), 20, vX*0.166, vY*0.166, afTrackFall) +else TestSniperRifle:= BadTurn; end; -function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestBaseballBat(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var valueResult, a, v1, v2: LongInt; x, y, trackFall: LongInt; dx, dy: real; @@ -780,20 +787,20 @@ dx:= sin(a / cMaxAngle * pi) * 0.5; dy:= cos(a / cMaxAngle * pi) * 0.5; - v1:= RateShove(x - 10, y + 2 + v1:= RateShove(Me, x - 10, y + 2 , 32, 30, 115 , -dx, -dy, trackFall); - v2:= RateShove(x + 10, y + 2 + v2:= RateShove(Me, x + 10, y + 2 , 32, 30, 115 , dx, -dy, trackFall); if (v1 > valueResult) or (v2 > valueResult) then - if (v2 > v1) + if (v2 > v1) or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then begin ap.Angle:= a; valueResult:= v2 end - else + else begin ap.Angle:= -a; valueResult:= v1 @@ -801,14 +808,14 @@ a:= a - 15 - random(cMaxAngle div 16) end; - + if valueResult <= 0 then valueResult:= BadTurn; TestBaseballBat:= valueResult; end; -function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestFirePunch(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var valueResult, v1, v2, i: LongInt; x, y, trackFall: LongInt; begin @@ -826,11 +833,11 @@ v1:= 0; for i:= 0 to 8 do begin - v1:= v1 + RateShove(x - 5, y - 10 * i + v1:= v1 + RateShove(Me, x - 5, y - 10 * i , 19, 30, 40 , -0.45, -0.9, trackFall or afSetSkip); end; - v1:= v1 + RateShove(x - 5, y - 90 + v1:= v1 + RateShove(Me, x - 5, y - 90 , 19, 30, 40 , -0.45, -0.9, trackFall); @@ -839,26 +846,26 @@ v2:= 0; for i:= 0 to 8 do begin - v2:= v2 + RateShove(x + 5, y - 10 * i + v2:= v2 + RateShove(Me, x + 5, y - 10 * i , 19, 30, 40 , 0.45, -0.9, trackFall or afSetSkip); end; - v2:= v2 + RateShove(x + 5, y - 90 + v2:= v2 + RateShove(Me, x + 5, y - 90 , 19, 30, 40 , 0.45, -0.9, trackFall); - if (v2 > v1) + if (v2 > v1) or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then begin ap.Angle:= 1; valueResult:= v2 end - else + else begin ap.Angle:= -1; valueResult:= v1 end; - + if valueResult <= 0 then valueResult:= BadTurn; @@ -866,7 +873,7 @@ end; -function TestWhip(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestWhip(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var valueResult, v1, v2: LongInt; x, y, trackFall: LongInt; begin @@ -882,37 +889,37 @@ y:= hwRound(Me^.Y); // check left direction - {first RateShove checks farthermost of two whip's AmmoShove attacks - to encourage distant attacks (damaged hog is excluded from view of second + {first RateShove checks farthermost of two whip's AmmoShove attacks + to encourage distant attacks (damaged hog is excluded from view of second RateShove call)} - v1:= RateShove(x - 13, y + v1:= RateShove(Me, x - 13, y , 30, 30, 25 , -1, -0.8, trackFall or afSetSkip); v1:= v1 + - RateShove(x - 2, y + RateShove(Me, x - 2, y , 30, 30, 25 , -1, -0.8, trackFall); // now try opposite direction - v2:= RateShove(x + 13, y + v2:= RateShove(Me, x + 13, y , 30, 30, 25 , 1, -0.8, trackFall or afSetSkip); v2:= v2 + - RateShove(x + 2, y + RateShove(Me, x + 2, y , 30, 30, 25 , 1, -0.8, trackFall); - if (v2 > v1) + if (v2 > v1) or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then begin ap.Angle:= 1; valueResult:= v2 end - else + else begin ap.Angle:= -1; valueResult:= v1 end; - + if valueResult <= 0 then valueResult:= BadTurn else @@ -921,7 +928,7 @@ TestWhip:= valueResult; end; -function TestKamikaze(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestKamikaze(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const step = 8; var valueResult, i, v, tx: LongInt; trackFall: LongInt; @@ -931,19 +938,19 @@ ap.Time:= 0; ap.Power:= 1; - if Level = 1 then + if Level = 1 then trackFall:= afTrackFall else if Level = 2 then trackFall:= 0 else exit(BadTurn); - + valueResult:= 0; v:= 0; x:= hwFloat2Float(Me^.X); y:= hwFloat2Float(Me^.Y); - d:= sqrt(sqr(Targ.X - x) + sqr(Targ.Y - y)); + d:= sqrt(sqr(Targ.Point.X - x) + sqr(Targ.Point.Y - y)); if d < 10 then begin dx:= 0; @@ -953,21 +960,21 @@ else begin t:= step / d; - dx:= (Targ.X - x) * t; - dy:= (Targ.Y - y) * t; + dx:= (Targ.Point.X - x) * t; + dy:= (Targ.Point.Y - y) * t; ap.Angle:= DxDy2AttackAnglef(dx, -dy) end; - + if dx >= 0 then cx:= 0.45 else cx:= -0.45; for i:= 0 to 512 div step - 2 do begin - valueResult:= valueResult + - RateShove(trunc(x), trunc(y) + valueResult:= valueResult + + RateShove(Me, trunc(x), trunc(y) , 30, 30, 25 , cx, -0.9, trackFall or afSetSkip); - + x:= x + dx; y:= y + dy; end; @@ -976,14 +983,14 @@ x:= hwFloat2Float(Me^.X); y:= hwFloat2Float(Me^.Y); tx:= trunc(x); - v:= RateShove(tx, trunc(y) + v:= RateShove(Me, tx, trunc(y) , 30, 30, 25 , -cx, -0.9, trackFall); for i:= 1 to 512 div step - 2 do begin y:= y + dy; - v:= v + - RateShove(tx, trunc(y) + v:= v + + RateShove(Me, tx, trunc(y) , 30, 30, 25 , -cx, -0.9, trackFall or afSetSkip); end @@ -994,7 +1001,7 @@ valueResult:= v end; - v:= RateShove(trunc(x), trunc(y) + v:= RateShove(Me, trunc(x), trunc(y) , 30, 30, 25 , cx, -0.9, trackFall); valueResult:= valueResult + v - KillScore * friendlyfactor div 100 * 1024; @@ -1005,7 +1012,7 @@ TestKamikaze:= valueResult; end; -function TestHammer(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestHammer(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var rate: LongInt; begin Level:= Level; // avoid compiler hint @@ -1015,14 +1022,14 @@ ap.Time:= 0; ap.Power:= 1; ap.Angle:= 0; - + rate:= RateHammer(Me); if rate = 0 then rate:= BadTurn; TestHammer:= rate; end; -function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestAirAttack(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; const cShift = 4; var bombsSpeed, X, Y, dY: real; b: array[0..9] of boolean; @@ -1036,12 +1043,12 @@ exit(BadTurn); ap.Angle:= 0; -ap.AttackPutX:= Targ.X; -ap.AttackPutY:= Targ.Y; +ap.AttackPutX:= Targ.Point.X; +ap.AttackPutY:= Targ.Point.Y; bombsSpeed:= hwFloat2Float(cBombsSpeed); -X:= Targ.X - 135 - cShift; // hh center - cShift -X:= X - bombsSpeed * sqrt(((Targ.Y + 128) * 2) / cGravityf); +X:= Targ.Point.X - 135 - cShift; // hh center - cShift +X:= X - bombsSpeed * sqrt(((Targ.Point.Y + 128) * 2) / cGravityf); Y:= -128; dY:= 0; @@ -1073,7 +1080,7 @@ for i:= 0 to 5 do inc(valueResult, dmg[i]); t:= valueResult; -ap.AttackPutX:= Targ.X - 60; +ap.AttackPutX:= Targ.Point.X - 60; for i:= 0 to 3 do begin @@ -1082,7 +1089,7 @@ if t > valueResult then begin valueResult:= t; - ap.AttackPutX:= Targ.X - 30 - cShift + i * 30 + ap.AttackPutX:= Targ.Point.X - 30 - cShift + i * 30 end end; @@ -1092,7 +1099,7 @@ end; -function TestTeleport(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestTeleport(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var i, failNum: longword; maxTop: longword; @@ -1105,15 +1112,15 @@ begin if Me^.Health <= 100 then begin - maxTop := Targ.Y - cHHRadius * 2; - - while not TestColl(Targ.X, maxTop, cHHRadius) and (maxTop > topY + cHHRadius * 2 + 1) do + maxTop := Targ.Point.Y - cHHRadius * 2; + + while not TestColl(Targ.Point.X, maxTop, cHHRadius) and (maxTop > topY + cHHRadius * 2 + 1) do dec(maxTop, cHHRadius*2); - if not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius) then + if not TestColl(Targ.Point.X, maxTop + cHHRadius, cHHRadius) then begin - ap.AttackPutX := Targ.X; + ap.AttackPutX := Targ.Point.X; ap.AttackPutY := maxTop + cHHRadius; - TestTeleport := Targ.Y - maxTop; + TestTeleport := Targ.Point.Y - maxTop; end; end; end @@ -1125,7 +1132,7 @@ inc(failNum); until not TestColl(bonuses.ar[i].X, bonuses.ar[i].Y - cHHRadius - bonuses.ar[i].Radius, cHHRadius) or (failNum = bonuses.Count*2); - + if failNum < bonuses.Count*2 then begin ap.AttackPutX := bonuses.ar[i].X; @@ -1147,7 +1154,7 @@ begin cakeStep(Gear); v:= RateExplosion(Me, hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg * 2, afTrackFall); - if v > ap.Power then + if v > ap.Power then begin ap.ExplX:= hwRound(Gear^.X); ap.ExplY:= hwRound(Gear^.Y); @@ -1156,7 +1163,7 @@ end; end; -function TestCake(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; +function TestCake(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams): LongInt; var valueResult, v1, v2: LongInt; cake: TGear; begin @@ -1171,7 +1178,7 @@ //FillChar(cake, sizeof(cake), 0); cake.Radius:= 7; - cake.CollisionMask:= lfCurrentMask; + cake.CollisionMask:= lfNotCurrentMask; cake.Hedgehog:= Me^.Hedgehog; // check left direction diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uAIMisc.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,14 +30,18 @@ BadTurn = Low(LongInt) div 4; -type TTarget = record +type TTarget = record // starting to look more and more like a gear Point: TPoint; - Score: LongInt; - skip, matters: boolean; + Score, Radius: LongInt; + State: LongWord; + Density: real; + skip, matters, dead: boolean; + Kind: TGearType; end; TTargets = record Count: Longword; - ar: array[0..Pred(cMaxHHs)] of TTarget; + ar: array[0..Pred(256)] of TTarget; + reset: boolean; end; TJumpType = (jmpNone, jmpHJump, jmpLJump); TGoInfo = record @@ -55,6 +59,7 @@ procedure freeModule; procedure FillTargets; +procedure ResetTargets; inline; procedure AddBonus(x, y: LongInt; r: Longword; s: LongInt); inline; procedure FillBonuses(isAfterAttack: boolean); procedure AwareOfExplosion(x, y, r: LongInt); inline; @@ -63,11 +68,11 @@ function TestColl(x, y, r: LongInt): boolean; inline; function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline; function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; -function TraceShoveFall(x, y, dX, dY: Real): LongInt; function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; inline; -function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; -function RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; +function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; inline; +function RealRateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; +function RateShove(Me: PGear; x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; function RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt; function RateHammer(Me: PGear): LongInt; @@ -89,52 +94,82 @@ const KillScore = 200; var friendlyfactor: LongInt = 300; +var dmgMod: real = 1.0; implementation uses uCollisions, uVariables, uUtils, uLandTexture, uGearsUtils; -var +var KnownExplosion: record X, Y, Radius: LongInt end = (X: 0; Y: 0; Radius: 0); +procedure ResetTargets; inline; +var i: LongWord; +begin +if Targets.reset then + for i:= 0 to Targets.Count do + Targets.ar[i].dead:= false; +Targets.reset:= false; +end; procedure FillTargets; -var i, t: Longword; +var //i, t: Longword; f, e: LongInt; + Gear: PGear; begin Targets.Count:= 0; +Targets.reset:= false; f:= 0; e:= 0; -for t:= 0 to Pred(TeamsCount) do - with TeamsArray[t]^ do - if not hasGone then +Gear:= GearsList; +while Gear <> nil do + begin + if (((Gear^.Kind = gtHedgehog) and + (Gear <> ThinkingHH) and + (Gear^.Health > Gear^.Damage) and + not(Gear^.Hedgehog^.Team^.hasgone)) or + ((Gear^.Kind = gtExplosives) and + (Gear^.Health > Gear^.Damage)) or + ((Gear^.Kind = gtMine) and + (Gear^.Health = 0) and + (Gear^.Damage < 35)) + ) and + (Targets.Count < 256) then + begin + with Targets.ar[Targets.Count] do begin - for i:= 0 to cMaxHHIndex do - if (Hedgehogs[i].Gear <> nil) - and (Hedgehogs[i].Gear <> ThinkingHH) - and (Hedgehogs[i].Gear^.Health > Hedgehogs[i].Gear^.Damage) - then + skip:= false; + dead:= false; + Kind:= Gear^.Kind; + Radius:= Gear^.Radius; + Density:= hwFloat2Float(Gear^.Density)/3; + State:= Gear^.State; + matters:= (Gear^.AIHints and aihDoesntMatter) = 0; + + Point.X:= hwRound(Gear^.X); + Point.Y:= hwRound(Gear^.Y); + if (Gear^.Kind = gtHedgehog) then + begin + if (Gear^.Hedgehog^.Team^.Clan = CurrentTeam^.Clan) then begin - with Targets.ar[Targets.Count], Hedgehogs[i] do - begin - skip:= false; - matters:= (Hedgehogs[i].Gear^.AIHints and aihDoesntMatter) = 0; - - Point.X:= hwRound(Gear^.X); - Point.Y:= hwRound(Gear^.Y); - if Clan <> CurrentTeam^.Clan then - begin - Score:= Gear^.Health - Gear^.Damage; - inc(e) - end else - begin - Score:= Gear^.Damage - Gear^.Health; - inc(f) - end - end; - inc(Targets.Count) + Score:= Gear^.Damage - Gear^.Health; + inc(f) + end + else + begin + Score:= Gear^.Health - Gear^.Damage; + inc(e) end; + end + else if Gear^.Kind = gtExplosives then + Score:= Gear^.Health - Gear^.Damage + else if Gear^.Kind = gtMine then + Score:= max(0,35-Gear^.Damage); end; + inc(Targets.Count) + end; + Gear:= Gear^.NextGear + end; if e > f then friendlyfactor:= 300 + (e - f) * 30 else friendlyfactor:= max(30, 300 - f * 80 div max(1,e)) @@ -180,24 +215,24 @@ gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 20, -50); -// avoid mines unless they are very likely to be duds, or are duds. also avoid if they are about to blow +// avoid mines unless they are very likely to be duds, or are duds. also avoid if they are about to blow gtMine: if ((Gear^.State and gstAttacking) = 0) and (((cMineDudPercent < 90) and (Gear^.Health <> 0)) or (isAfterAttack and (Gear^.Health = 0) and (Gear^.Damage > 30))) then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -50) else if (Gear^.State and gstAttacking) <> 0 then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, -50); // mine is on - + gtExplosives: if isAfterAttack then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 75, -60 + Gear^.Health); - + gtSMine: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -30); - + gtDynamite: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -75); - + gtHedgehog: begin if Gear^.Damage >= Gear^.Health then @@ -255,6 +290,58 @@ RatePlace:= rate; end; +function CheckBounds(x, y, r: Longint): boolean; inline; +begin + CheckBounds := (((x-r) and LAND_WIDTH_MASK) = 0) and + (((x+r) and LAND_WIDTH_MASK) = 0) and + (((y-r) and LAND_HEIGHT_MASK) = 0) and + (((y+r) and LAND_HEIGHT_MASK) = 0); +end; + + +function TestCollWithEverything(x, y, r: LongInt): boolean; inline; +begin + if not CheckBounds(x, y, r) then + exit(false); + + if (Land[y-r, x-r] <> 0) or + (Land[y+r, x-r] <> 0) or + (Land[y-r, x+r] <> 0) or + (Land[y+r, x+r] <> 0) then + exit(true); + + TestCollWithEverything := false; +end; + +function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline; +begin + if not CheckBounds(x, y, r) then + exit(false); + + if (Land[y-r, x-r] > lfAllObjMask) or + (Land[y+r, x-r] > lfAllObjMask) or + (Land[y-r, x-r] > lfAllObjMask) or + (Land[y+r, x+r] > lfAllObjMask) then + exit(true); + + TestCollExcludingObjects:= false; +end; + +function TestColl(x, y, r: LongInt): boolean; inline; +begin + if not CheckBounds(x, y, r) then + exit(false); + + if (Land[y-r, x-r] and lfNotCurrentMask <> 0) or + (Land[y+r, x-r] and lfNotCurrentMask <> 0) or + (Land[y+r, x-r] and lfNotCurrentMask <> 0) or + (Land[y+r, x+r] and lfNotCurrentMask <> 0) then + exit(true); + + TestColl:= false; +end; + + // Wrapper to test various approaches. If it works reasonably, will just replace. // Right now, converting to hwFloat is a tad inefficient since the x/y were hwFloat to begin with... function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; @@ -265,155 +352,134 @@ MeX:= hwRound(Me^.X); MeY:= hwRound(Me^.Y); // We are still inside the hog. Skip radius test - if ((((x-MeX)*(x-MeX)) + ((y-MeY)*(y-MeY))) < 256) and ((Land[y, x] and $FF00) = 0) then + if ((sqr(x-MeX) + sqr(y-MeY)) < 256) and (Land[y, x] and lfObjMask = 0) then exit(false); end; - TestCollExcludingMe:= TestColl(x, y, r) -end; - -function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline; -var b: boolean; -begin - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and $FF00 <> 0); - if b then - exit(true); - - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and $FF00 <> 0); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and $FF00 <> 0); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and $FF00 <> 0); - if b then - exit(true); - - TestCollExcludingObjects:= false; + TestCollExcludingMe:= TestCollWithEverything(x, y, r) end; -function TestColl(x, y, r: LongInt): boolean; inline; -var b: boolean; -begin - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and lfCurrentMask <> 0); - if b then - exit(true); - - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and lfCurrentMask <> 0); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and lfCurrentMask <> 0); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and lfCurrentMask <> 0); - if b then - exit(true); - - TestColl:= false; -end; + -function TestCollWithLand(x, y, r: LongInt): boolean; inline; -var b: boolean; -begin - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] > 255); - if b then - exit(true); - - b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] > 255); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] > 255); - if b then - exit(true); - - b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] > 255); - if b then - exit(true); - - TestCollWithLand:= false; -end; - -function TraceFall(eX, eY: LongInt; x, y, dX, dY: Real; r: LongWord): LongInt; +function TraceFall(eX, eY: LongInt; var x, y: Real; dX, dY: Real; r: LongWord; Target: TTarget): LongInt; var skipLandCheck: boolean; - rCorner: real; + rCorner, dxdy, odX, odY: real; dmg: LongInt; begin + odX:= dX; + odY:= dY; skipLandCheck:= true; - if x - eX < 0 then dX:= -dX; - if y - eY < 0 then dY:= -dY; // ok. attempt approximate search for an unbroken trajectory into water. if it continues far enough, assume out of map rCorner:= r * 0.75; while true do - begin + begin x:= x + dX; y:= y + dY; dY:= dY + cGravityf; skipLandCheck:= skipLandCheck and (r <> 0) and (abs(eX-x) + abs(eY-y) < r) and ((abs(eX-x) < rCorner) or (abs(eY-y) < rCorner)); - if not skipLandCheck and TestCollWithLand(trunc(x), trunc(y), cHHRadius) then - begin - if 0.4 < dY then - begin - dmg := 1 + trunc((abs(dY) - 0.4) * 70); - if dmg >= 1 then - exit(dmg); + if not skipLandCheck and TestCollExcludingObjects(trunc(x), trunc(y), Target.Radius) then + with Target do + begin + if (Kind = gtHedgehog) and (0.4 < dY) then + begin + dmg := 1 + trunc((dY - 0.4) * 70); + exit(dmg) + end + else + begin + dxdy:= abs(dX)+abs(dY); + if ((Kind = gtMine) and (dxdy > 0.35)) or + ((Kind = gtExplosives) and + (((State and gstTmpFlag <> 0) and (dxdy > 0.35)) or + ((State and gstTmpFlag = 0) and + ((abs(odX) > 0.15) or ((abs(odY) > 0.15) and + (abs(odX) > 0.02))) and (dxdy > 0.35)))) then + begin + dmg := trunc(dxdy * 25); + exit(dmg) + end + else if (Kind = gtExplosives) and not((abs(odX) > 0.15) or ((abs(odY) > 0.15) and (abs(odX) > 0.02))) and (dY > 0.2) then + begin + dmg := trunc(dy * 70); + exit(dmg) + end + end; + exit(0) end; - exit(0) - end; - if (y > cWaterLine) or (x > 4096) or (x < 0) then - exit(-1); - end; + if (y > cWaterLine) or (x > rightX) or (x < leftX) then exit(-1) + end end; -function TraceShoveFall(x, y, dX, dY: Real): LongInt; +function TraceShoveFall(var x, y: Real; dX, dY: Real; Target: TTarget): LongInt; var dmg: LongInt; + dxdy, odX, odY: real; begin + odX:= dX; + odY:= dY; //v:= random($FFFFFFFF); while true do - begin + begin x:= x + dX; y:= y + dY; dY:= dY + cGravityf; -{ if ((trunc(y) and LAND_HEIGHT_MASK) = 0) and ((trunc(x) and LAND_WIDTH_MASK) = 0) then +{ if ((trunc(y) and LAND_HEIGHT_MASK) = 0) and ((trunc(x) and LAND_WIDTH_MASK) = 0) then begin LandPixels[trunc(y), trunc(x)]:= v; UpdateLandTexture(trunc(X), 1, trunc(Y), 1, true); end;} - - // consider adding dX/dY calc here for fall damage - if TestCollExcludingObjects(trunc(x), trunc(y), cHHRadius) then - begin - if 0.4 < dY then - begin - dmg := 1 + trunc((abs(dY) - 0.4) * 70); - if dmg >= 1 then + if TestCollExcludingObjects(trunc(x), trunc(y), Target.Radius) then + with Target do + begin + if (Kind = gtHedgehog) and (0.4 < dY) then + begin + dmg := trunc((dY - 0.4) * 70); exit(dmg); - end; + end + else + begin + dxdy:= abs(dX)+abs(dY); + if ((Kind = gtMine) and (dxdy > 0.4)) or + ((Kind = gtExplosives) and + (((State and gstTmpFlag <> 0) and (dxdy > 0.4)) or + ((State and gstTmpFlag = 0) and + ((abs(odX) > 0.15) or ((abs(odY) > 0.15) and + (abs(odX) > 0.02))) and (dxdy > 0.35)))) then + begin + dmg := trunc(dxdy * 50); + exit(dmg) + end + else if (Kind = gtExplosives) and not((abs(odX) > 0.15) or ((abs(odY) > 0.15) and (abs(odX) > 0.02))) and (dY > 0.2) then + begin + dmg := trunc(dy * 70); + exit(dmg) + end + end; exit(0) end; - if (y > cWaterLine) or (x > 4096) or (x < 0) then + if (y > cWaterLine) or (x > rightX) or (x < leftX) then // returning -1 for drowning so it can be considered in the Rate routine exit(-1) end; end; -function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; +function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; inline; begin - RateExplosion:= RateExplosion(Me, x, y, r, 0); + RateExplosion:= RealRateExplosion(Me, x, y, r, 0); + ResetTargets; +end; +function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; inline; +begin + RateExplosion:= RealRateExplosion(Me, x, y, r, Flags); + ResetTargets; end; -function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; -var i, fallDmg, dmg, dmgBase, rate, erasure: LongInt; - dX, dY, dmgMod: real; +function RealRateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; +var i, fallDmg, dmg, dmgBase, rate, subrate, erasure: LongInt; + pX, pY, dX, dY: real; hadSkips: boolean; begin fallDmg:= 0; -dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; rate:= 0; // add our virtual position with Targets.ar[Targets.Count] do @@ -422,10 +488,12 @@ Point.y:= hwRound(Me^.Y); skip:= false; matters:= true; + Kind:= gtHedgehog; + Density:= 1; + Radius:= cHHRadius; Score:= - ThinkingHH^.Health end; // rate explosion -dmgBase:= r + cHHRadius div 2; if (Flags and afErasesLand <> 0) and (GameFlags and gfSolidLand = 0) then erasure:= r else erasure:= 0; @@ -433,98 +501,169 @@ hadSkips:= false; for i:= 0 to Targets.Count do - with Targets.ar[i] do - if not matters then hadSkips:= true - else - begin - dmg:= 0; - if abs(Point.x - x) + abs(Point.y - y) < dmgBase then - dmg:= trunc(dmgMod * min((dmgBase - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)))) div 2, r)); + if not Targets.ar[i].dead then + with Targets.ar[i] do + if not matters then hadSkips:= true + else + begin + dmg:= 0; + dmgBase:= r + Radius div 2; + if abs(Point.x - x) + abs(Point.y - y) < dmgBase then + dmg:= trunc(dmgMod * min((dmgBase - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)))) div 2, r)); - if dmg > 0 then - begin - if (Flags and afTrackFall <> 0) and (dmg < abs(Score)) then + if dmg > 0 then begin - dX:= 0.005 * dmg + 0.01; - dY:= dX; - if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and - (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then - fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod) - else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod) - end; - if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI - if Score > 0 then - inc(rate, (KillScore + Score div 10) * 1024) // Add a bit of a bonus for bigger hog drownings - else - dec(rate, (KillScore * friendlyfactor div 100 - Score div 10) * 1024) // and more of a punishment for drowning bigger friendly hogs - else if (dmg+fallDmg) >= abs(Score) then - if Score > 0 then - inc(rate, KillScore * 1024 + (dmg + fallDmg)) // tiny bonus for dealing more damage than needed to kill - else - dec(rate, KillScore * friendlyfactor div 100 * 1024) - else - if Score > 0 then - inc(rate, (dmg + fallDmg) * 1024) - else dec(rate, (dmg + fallDmg) * friendlyfactor div 100 * 1024) + pX:= Point.x; + pY:= Point.y; + fallDmg:= 0; + if (Flags and afTrackFall <> 0) and (Score > 0) and (dmg < Score) then + begin + dX:= (0.005 * dmg + 0.01) / Density; + dY:= dX; + if (Kind = gtExplosives) and (State and gstTmpFlag = 0) and + (((abs(dY) > 0.15) and (abs(dX) < 0.02)) or + ((abs(dY) < 0.15) and (abs(dX) < 0.15))) then + dX:= 0; + + if pX - x < 0 then dX:= -dX; + if pY - y < 0 then dY:= -dY; + + if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and + (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then + fallDmg:= trunc(TraceFall(x, y, pX, pY, dX, dY, 0, Targets.ar[i]) * dmgMod) + else fallDmg:= trunc(TraceFall(x, y, pX, pY, dX, dY, erasure, Targets.ar[i]) * dmgMod) + end; + if Kind = gtHedgehog then + begin + if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI + begin + if Score > 0 then + inc(rate, (KillScore + Score div 10) * 1024) // Add a bit of a bonus for bigger hog drownings + else + dec(rate, (KillScore * friendlyfactor div 100 - Score div 10) * 1024) // and more of a punishment for drowning bigger friendly hogs + end + else if (dmg+fallDmg) >= abs(Score) then + begin + dead:= true; + Targets.reset:= true; + if dX < 0.035 then + begin + subrate:= RealRateExplosion(Me, round(pX), round(pY), 61, afErasesLand or (Flags and afTrackFall)); + if abs(subrate) > 2000 then inc(Rate,subrate) + end; + if Score > 0 then + inc(rate, KillScore * 1024 + (dmg + fallDmg)) // tiny bonus for dealing more damage than needed to kill + else dec(rate, KillScore * friendlyfactor div 100 * 1024) + end + else + begin + if Score > 0 then + inc(rate, (dmg + fallDmg) * 1024) + else dec(rate, (dmg + fallDmg) * friendlyfactor div 100 * 1024) + end + end + else if (fallDmg >= 0) and ((dmg+fallDmg) >= Score) then + begin + dead:= true; + Targets.reset:= true; + if Kind = gtExplosives then + subrate:= RealRateExplosion(Me, round(pX), round(pY), 151, afErasesLand or (Flags and afTrackFall)) + else subrate:= RealRateExplosion(Me, round(pX), round(pY), 101, afErasesLand or (Flags and afTrackFall)); + if abs(subrate) > 2000 then inc(Rate,subrate); + end + end end; - end; if hadSkips and (rate = 0) then - RateExplosion:= BadTurn + RealRateExplosion:= BadTurn else - RateExplosion:= rate; + RealRateExplosion:= rate; end; -function RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; -var i, fallDmg, dmg, rate: LongInt; - dX, dY, dmgMod: real; +function RateShove(Me: PGear; x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; +var i, fallDmg, dmg, rate, subrate: LongInt; + dX, dY, pX, pY: real; begin fallDmg:= 0; dX:= gdX * 0.01 * kick; dY:= gdY * 0.01 * kick; -dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; rate:= 0; for i:= 0 to Pred(Targets.Count) do with Targets.ar[i] do - if skip then - if (Flags and afSetSkip = 0) then skip:= false else {still skip} - else if matters then - begin - dmg:= 0; - if abs(Point.x - x) + abs(Point.y - y) < r then - dmg:= r - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))); - - if dmg > 0 then + if skip then + begin + if Flags and afSetSkip = 0 then skip:= false + end + else if matters then begin - if (Flags and afSetSkip <> 0) then skip:= true; - if (Flags and afTrackFall <> 0) and (Score > 0) then - fallDmg:= trunc(TraceShoveFall(Point.x, Point.y - 2, dX, dY) * dmgMod); - if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI - if Score > 0 then - inc(rate, KillScore + Score div 10) // Add a bit of a bonus for bigger hog drownings - else - dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs - else if power+fallDmg >= abs(Score) then - if Score > 0 then - inc(rate, KillScore) - else - dec(rate, KillScore * friendlyfactor div 100) - else - if Score > 0 then - inc(rate, power+fallDmg) - else - dec(rate, (power+fallDmg) * friendlyfactor div 100) + dmg:= 0; + if abs(Point.x - x) + abs(Point.y - y) < r then + dmg:= r - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))); + + if dmg > 0 then + begin + pX:= Point.x; + pY:= Point.y-2; + fallDmg:= 0; + if (Flags and afSetSkip <> 0) then skip:= true; + if not(dead) and (Flags and afTrackFall <> 0) and (Score > 0) and (power < Score) then + if (Kind = gtExplosives) and (State and gstTmpFlag = 0) and + (((abs(dY) > 0.15) and (abs(dX) < 0.02)) or + ((abs(dY) < 0.15) and (abs(dX) < 0.15))) then + fallDmg:= trunc(TraceShoveFall(pX, pY, 0, dY, Targets.ar[i]) * dmgMod) + else + fallDmg:= trunc(TraceShoveFall(pX, pY, dX, dY, Targets.ar[i]) * dmgMod); + if Kind = gtHedgehog then + begin + if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI + begin + if Score > 0 then + inc(rate, KillScore + Score div 10) // Add a bit of a bonus for bigger hog drownings + else + dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs + end + else if power+fallDmg >= abs(Score) then + begin + dead:= true; + Targets.reset:= true; + if dX < 0.035 then + begin + subrate:= RealRateExplosion(Me, round(pX), round(pY), 61, afErasesLand or afTrackFall); + if abs(subrate) > 2000 then inc(Rate,subrate div 1024) + end; + if Score > 0 then + inc(rate, KillScore) + else + dec(rate, KillScore * friendlyfactor div 100) + end + else + begin + if Score > 0 then + inc(rate, power+fallDmg) + else + dec(rate, (power+fallDmg) * friendlyfactor div 100) + end + end + else if (fallDmg >= 0) and ((dmg+fallDmg) >= Score) then + begin + dead:= true; + Targets.reset:= true; + if Kind = gtExplosives then + subrate:= RealRateExplosion(Me, round(pX), round(pY), 151, afErasesLand or (Flags and afTrackFall)) + else subrate:= RealRateExplosion(Me, round(pX), round(pY), 101, afErasesLand or (Flags and afTrackFall)); + if abs(subrate) > 2000 then inc(Rate,subrate div 1024); + end + end end; - end; -RateShove:= rate * 1024 +RateShove:= rate * 1024; +ResetTargets end; function RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt; -var i, dmg, fallDmg, baseDmg, rate, erasure: LongInt; - dX, dY, dmgMod: real; +var i, dmg, fallDmg, baseDmg, rate, subrate, erasure: LongInt; + pX, pY, dX, dY: real; hadSkips: boolean; begin -dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent; rate:= 0; gdX:= gdX * 0.01; gdY:= gdX * 0.01; @@ -535,6 +674,9 @@ Point.y:= hwRound(Me^.Y); skip:= false; matters:= true; + Kind:= gtHedgehog; + Density:= 1; + Radius:= cHHRadius; Score:= - ThinkingHH^.Health end; // rate shot @@ -546,48 +688,80 @@ hadSkips:= false; for i:= 0 to Targets.Count do - with Targets.ar[i] do - if not matters then hadSkips:= true - else - begin - dmg:= 0; - if abs(Point.x - x) + abs(Point.y - y) < baseDmg then - begin - dmg:= min(baseDmg - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))), 25); - dmg:= trunc(dmg * dmgMod); - end; - if dmg > 0 then + if not Targets.ar[i].dead then + with Targets.ar[i] do + if not matters then hadSkips:= true + else begin - dX:= gdX * dmg; - dY:= gdY * dmg; - if dX < 0 then dX:= dX - 0.01 - else dX:= dX + 0.01; - if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and - (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then - fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod) - else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod); - if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI - if Score > 0 then - inc(rate, KillScore + Score div 10) // Add a bit of a bonus for bigger hog drownings - else - dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs - else if (dmg+fallDmg) >= abs(Score) then - if Score > 0 then - inc(rate, KillScore) - else - dec(rate, KillScore * friendlyfactor div 100) - else - if Score > 0 then - inc(rate, dmg+fallDmg) - else - dec(rate, (dmg+fallDmg) * friendlyfactor div 100) + dmg:= 0; + if abs(Point.x - x) + abs(Point.y - y) < baseDmg then + begin + dmg:= min(baseDmg - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))), 25); + dmg:= trunc(dmg * dmgMod); + end; + if dmg > 0 then + begin + if not(dead) and (Score > 0) and (dmg < Score) then + begin + pX:= Point.x; + pY:= Point.y; + dX:= gdX * dmg / Density; + dY:= gdY * dmg / Density; + if dX < 0 then dX:= dX - 0.01 + else dX:= dX + 0.01; + if (Kind = gtExplosives) and (State and gstTmpFlag = 0) and + (((abs(dY) > 0.15) and (abs(dX) < 0.02)) or + ((abs(dY) < 0.15) and (abs(dX) < 0.15))) then + dX:= 0; + if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and + (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then + fallDmg:= trunc(TraceFall(x, y, pX, pY, dX, dY, 0, Targets.ar[i]) * dmgMod) + else fallDmg:= trunc(TraceFall(x, y, pX, pY, dX, dY, erasure, Targets.ar[i]) * dmgMod) + end; + if Kind = gtHedgehog then + begin + if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI + begin + if Score > 0 then + inc(rate, KillScore + Score div 10) // Add a bit of a bonus for bigger hog drownings + else + dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs + end + else if (dmg+fallDmg) >= abs(Score) then + begin + dead:= true; + Targets.reset:= true; + if dX < 0.035 then + begin + subrate:= RealRateExplosion(Me, round(pX), round(pY), 61, afErasesLand or afTrackFall); + if abs(subrate) > 2000 then inc(Rate,subrate div 1024) + end; + if Score > 0 then + inc(rate, KillScore) + else + dec(rate, KillScore * friendlyfactor div 100) + end + else if Score > 0 then + inc(rate, dmg+fallDmg) + else dec(rate, (dmg+fallDmg) * friendlyfactor div 100) + end + else if (fallDmg >= 0) and ((dmg+fallDmg) >= Score) then + begin + dead:= true; + Targets.reset:= true; + if Kind = gtExplosives then + subrate:= RealRateExplosion(Me, round(pX), round(pY), 151, afErasesLand or afTrackFall) + else subrate:= RealRateExplosion(Me, round(pX), round(pY), 101, afErasesLand or afTrackFall); + if abs(subrate) > 2000 then inc(Rate,subrate div 1024); + end + end end; - end; if hadSkips and (rate = 0) then RateShotgun:= BadTurn else RateShotgun:= rate * 1024; + ResetTargets; end; function RateHammer(Me: PGear): LongInt; @@ -600,14 +774,13 @@ for i:= 0 to Pred(Targets.Count) do with Targets.ar[i] do - if matters then // hammer hit radius is 8, shift is 10 - if abs(Point.x - x) + abs(Point.y - y) < 18 then + if matters and (Kind = gtHedgehog) and (abs(Point.x - x) + abs(Point.y - y) < 18) then begin r:= trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))); if r <= 18 then - if Score > 0 then + if Score > 0 then inc(rate, Score div 3) else inc(rate, Score div 3 * friendlyfactor div 100) @@ -625,7 +798,7 @@ bY:= hwRound(Gear^.Y); case JumpType of jmpNone: exit(false); - + jmpHJump: if TestCollisionYwithGear(Gear, -1) = 0 then begin @@ -635,7 +808,7 @@ end else exit(false); - + jmpLJump: begin if TestCollisionYwithGear(Gear, -1) <> 0 then @@ -657,12 +830,12 @@ end; repeat - {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then + {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then begin LandPixels[hwRound(Gear^.Y), hwRound(Gear^.X)]:= Gear^.Hedgehog^.Team^.Clan^.Color; UpdateLandTexture(hwRound(Gear^.X), 1, hwRound(Gear^.Y), 1, true); end;} - + if not (hwRound(Gear^.Y) + cHHRadius < cWaterLine) then exit(false); if (Gear^.State and gstMoving) <> 0 then @@ -712,7 +885,7 @@ var pX, pY, tY: LongInt; begin HHGo:= false; -Gear^.CollisionMask:= lfCurrentMask; +Gear^.CollisionMask:= lfNotCurrentMask; AltGear^:= Gear^; GoInfo.Ticks:= 0; @@ -720,7 +893,7 @@ GoInfo.JumpType:= jmpNone; tY:= hwRound(Gear^.Y); repeat - {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then + {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then begin LandPixels[hwRound(Gear^.Y), hwRound(Gear^.X)]:= random($FFFFFFFF);//Gear^.Hedgehog^.Team^.Clan^.Color; UpdateLandTexture(hwRound(Gear^.X), 1, hwRound(Gear^.Y), 1, true); @@ -734,8 +907,8 @@ AddWalkBonus(pX, tY, 250, -40); exit(false) end; - - // hog is falling + + // hog is falling if (Gear^.State and gstMoving) <> 0 then begin inc(GoInfo.Ticks); @@ -744,7 +917,7 @@ begin GoInfo.FallPix:= 0; // try ljump instead of fall with damage - HHJump(AltGear, jmpLJump, GoInfo); + HHJump(AltGear, jmpLJump, GoInfo); if AltGear^.Hedgehog^.BotLevel < 4 then AddWalkBonus(pX, tY, 175, -20); exit(false) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uAmmos.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uCaptions.pas --- a/hedgewars/uCaptions.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uCaptions.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uChat.pas --- a/hedgewars/uChat.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uChat.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,8 +48,8 @@ LocalStrs: array[0 .. MaxStrIndex] of shortstring; missedCount: LongWord; lastStr: LongWord; - localLastStr: LongWord; - history: LongWord; + localLastStr: LongInt; + history: LongInt; visibleCount: LongWord; InputStr: TChatLine; InputStrL: array[0..260] of char; // for full str + 4-byte utf-8 char diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uCollisions.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,7 +83,7 @@ X:= hwRound(Gear^.X); Y:= hwRound(Gear^.Y); Radius:= Gear^.Radius; - ChangeRoundInLand(X, Y, Radius - 1, true, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase)); + ChangeRoundInLand(X, Y, Radius - 1, true, (Gear = CurrentHedgehog^.Gear) or ((Gear^.Kind = gtCase) and (Gear^.State and gstFrozen <> 0))); cGear:= Gear end; Gear^.CollisionIndex:= Count; @@ -104,7 +104,7 @@ if Gear^.CollisionIndex >= 0 then begin with cinfos[Gear^.CollisionIndex] do - ChangeRoundInLand(X, Y, Radius - 1, false, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase)); + ChangeRoundInLand(X, Y, Radius - 1, false, (Gear = CurrentHedgehog^.Gear) or ((Gear^.Kind = gtCase) and (Gear^.State and gstFrozen <> 0))); cinfos[Gear^.CollisionIndex]:= cinfos[Pred(Count)]; cinfos[Gear^.CollisionIndex].cGear^.CollisionIndex:= Gear^.CollisionIndex; Gear^.CollisionIndex:= -1; @@ -139,7 +139,7 @@ var x, y, i: LongInt; begin // Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap -if (Gear^.CollisionMask = lfCurrentMask) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and +if (Gear^.CollisionMask = lfNotCurrentMask) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and ((hwRound(Gear^.Hedgehog^.Gear^.X) + Gear^.Hedgehog^.Gear^.Radius + 16 < hwRound(Gear^.X) - Gear^.Radius) or (hwRound(Gear^.Hedgehog^.Gear^.X) - Gear^.Hedgehog^.Gear^.Radius - 16 > hwRound(Gear^.X) + Gear^.Radius)) then Gear^.CollisionMask:= $FFFF; @@ -169,7 +169,7 @@ var x, y, i: LongInt; begin // Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap -if (Gear^.CollisionMask = lfCurrentMask) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and +if (Gear^.CollisionMask = lfNotCurrentMask) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and ((hwRound(Gear^.Hedgehog^.Gear^.Y) + Gear^.Hedgehog^.Gear^.Radius + 16 < hwRound(Gear^.Y) - Gear^.Radius) or (hwRound(Gear^.Hedgehog^.Gear^.Y) - Gear^.Hedgehog^.Gear^.Radius - 16 > hwRound(Gear^.Y) + Gear^.Radius)) then Gear^.CollisionMask:= $FFFF; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uCommandHandlers.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ procedure chGenCmd(var s: shortstring); begin case s[1] of - 'R': if ReadyTimeLeft > 1 then + 'R': if ReadyTimeLeft > 1 then begin ReadyTimeLeft:= 1; if not isExternalSource then @@ -480,7 +480,7 @@ with CurrentHedgehog^.Gear^ do begin Message:= Message or (gmSlot and InputMask); - MsgParam:= slot; + MsgParam:= slot; ScriptCall('onSlot', MsgParam); end end; @@ -517,7 +517,7 @@ with CurrentHedgehog^.Gear^ do begin Message:= Message or (gmAnimate and InputMask); - MsgParam:= byte(s[1]) ; + MsgParam:= byte(s[1]) ; ScriptCall('onTaunt', MsgParam); end end; @@ -573,7 +573,7 @@ begin if isDeveloperMode then begin - SetRandomSeed(s); + SetRandomSeed(s, true); cSeed:= s; InitStepsFlags:= InitStepsFlags or cifRandomize end diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uCommands.pas --- a/hedgewars/uCommands.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uCommands.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uConsole.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uConsts.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,11 +97,16 @@ lfDamaged = $1000; // lfIce = $0800; // blue lfBouncy = $0400; // green + lfLandMask = $FF00; // upper byte is used for terrain, not objects. lfCurrentHog = $0080; // CurrentHog. It is also used to flag crates, for convenience of AI. Since an active hog would instantly collect the crate, this doesn't impact play - lfCurrentMask = $FF7F; // inverse of above. frequently used. + lfNotCurrentMask = $FF7F; // inverse of above. frequently used lfObjMask = $007F; // lower 7 bits used for hogs lfNotObjMask = $FF80; // inverse of above. + // lower byte is for objects. + // consists of 0-127 counted for object checkins and $80 as a bit flag for current hog. + lfAllObjMask = $00FF; // lfCurrentHog or lfObjMask + cMaxPower = 1500; cMaxAngle = 2048; @@ -110,13 +115,11 @@ MAXNAMELEN = 192; MAXROPEPOINTS = 3840; - {$IFNDEF PAS2C} // some opengl headers do not have these macros GL_BGR = $80E0; GL_BGRA = $80E1; GL_CLAMP_TO_EDGE = $812F; GL_TEXTURE_PRIORITY = $8066; - {$ENDIF} cVisibleWater : LongInt = 128; cTeamHealthWidth : LongInt = 128; @@ -209,6 +212,8 @@ gstLoser = $00080000; gstHHGone = $00100000; gstInvisible = $00200000; + gstSubmersible = $00400000; + gstFrozen = $00800000; // gear messages gmLeft = $00000001; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uDebug.pas --- a/hedgewars/uDebug.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uDebug.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uFloat.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,9 +63,7 @@ // The implemented operators operator = (const z1, z2: hwFloat) z : boolean; inline; -{$IFDEF PAS2C} -operator <> (const z1, z2: hwFloat) z : boolean; inline; -{$ENDIF} + operator + (const z1, z2: hwFloat) z : hwFloat; inline; operator - (const z1, z2: hwFloat) z : hwFloat; inline; operator - (const z1: hwFloat) z : hwFloat; inline; @@ -86,7 +84,8 @@ function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign. function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t. function hwPow(const t: hwFloat; p: LongWord): hwFloat; inline; // Returns the power of the value -function hwSqrt(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t. +function hwSqrt1(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t. +function hwSqrt(const x: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t. function Distance(const dx, dy: hwFloat): hwFloat; // Returns the distance between two points in 2-dimensional space, of which the parameters are the horizontal and vertical distance. function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters. function AngleSin(const Angle: Longword): hwFloat; @@ -221,19 +220,11 @@ hwFloat2Float:= -hwFloat2Float; end; -{$IFNDEF WEB} operator = (const z1, z2: hwFloat) z : boolean; inline; begin z:= (z1.isNegative = z2.isNegative) and (z1.QWordValue = z2.QWordValue); end; -{$IFDEF PAS2C} -operator <> (const z1, z2: hwFloat) z : boolean; inline; -begin - z:= (z1.isNegative <> z2.isNegative) or (z1.QWordValue <> z2.QWordValue); -end; -{$ENDIF} - operator + (const z1, z2: hwFloat) z : hwFloat; inline; begin if z1.isNegative = z2.isNegative then @@ -274,7 +265,7 @@ end end; -function isZero(const z: hwFloat): boolean; inline; +function isZero(const z: hwFloat): boolean; inline; begin isZero := z.QWordValue = 0; end; @@ -287,7 +278,7 @@ if z1.QWordValue = z2.QWordValue then b:= false else - b:= not((z1.QWordValue = z2.QWordValue) or ((z2.QWordValue < z1.QWordValue) <> z1.isNegative)) + b:= (z2.QWordValue < z1.QWordValue) = z1.isNegative end; operator > (const z1, z2: hwFloat) b : boolean; inline; @@ -300,102 +291,6 @@ else b:= (z1.QWordValue > z2.QWordValue) <> z2.isNegative end; -{$ENDIF} -{$IFDEF WEB} -(* - Mostly to be kind to JS as of 2012-08-27 where there is no int64/uint64. This may change though. -*) -operator = (const z1, z2: hwFloat) z : boolean; inline; -begin - z:= (z1.isNegative = z2.isNegative) and (z1.Frac = z2.Frac) and (z1.Round = z2.Round); -end; - -operator <> (const z1, z2: hwFloat) z : boolean; inline; -begin - z:= (z1.isNegative <> z2.isNegative) or (z1.Frac <> z2.Frac) or (z1.Round <> z2.Round); -end; - -operator + (const z1, z2: hwFloat) z : hwFloat; inline; -begin -if z1.isNegative = z2.isNegative then - begin - z:= z1; - z.Frac:= z.Frac + z2.Frac; - z.Round:= z.Round + z2.Round; - if z.Frac z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then - begin - z.isNegative:= z1.isNegative; - z.Round:= z1.Round - z2.Round; - z.Frac:= z1.Frac - z2.Frac; - if z2.Frac > z1.Frac then dec(z.Round) - end - else - begin - z.isNegative:= z2.isNegative; - z.Round:= z2.Round - z1.Round; - z.Frac:= z2.Frac-z1.Frac; - if z2.Frac < z1.Frac then dec(z.Round) - end -end; - -operator - (const z1, z2: hwFloat) z : hwFloat; inline; -begin -if z1.isNegative = z2.isNegative then - if (z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then - begin - z.isNegative:= z1.isNegative; - z.Round:= z1.Round - z2.Round; - z.Frac:= z1.Frac-z2.Frac; - if z2.Frac > z1.Frac then dec(z.Round) - end - else - begin - z.isNegative:= not z2.isNegative; - z.Round:= z2.Round - z1.Round; - z.Frac:= z2.Frac-z1.Frac; - if z2.Frac < z1.Frac then dec(z.Round) - end -else - begin - z:= z1; - z.Frac:= z.Frac + z2.Frac; - z.Round:= z.Round + z2.Round; - if z.Frac z1.isNegative -end; - -operator > (const z1, z2: hwFloat) b : boolean; inline; -begin -if z1.isNegative xor z2.isNegative then - b:= z2.isNegative -else -(* - if z1.QWordValue = z2.QWordValue then - b:= false - else*) - b:= ((z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac))) <> z1.isNegative -end; - -function isZero(const z: hwFloat): boolean; inline; -begin -isZero := (z.Round = 0) and (z.Frac = 0); -end; -{$ENDIF} operator - (const z1: hwFloat) z : hwFloat; inline; begin @@ -418,24 +313,23 @@ end; operator / (const z1: hwFloat; z2: hwFloat) z : hwFloat; inline; -var t: hwFloat; +var t: QWord; begin z.isNegative:= z1.isNegative xor z2.isNegative; z.Round:= z1.QWordValue div z2.QWordValue; -t:= z1 - z2 * z.Round; -if t.QWordValue = 0 then - z.Frac:= 0 -else +t:= z1.QWordValue - z2.QWordValue * z.Round; +z.Frac:= 0; + +if t <> 0 then begin - while ((t.QWordValue and $8000000000000000) = 0) and ((z2.QWordValue and $8000000000000000) = 0) do + while ((t and $FF00000000000000) = 0) and ((z2.QWordValue and $FF00000000000000) = 0) do begin - t.QWordValue:= t.QWordValue shl 1; - z2.QWordValue:= z2.QWordValue shl 1 + t:= t shl 8; + z2.QWordValue:= z2.QWordValue shl 8 end; + if z2.Round > 0 then - z.Frac:= (t.QWordValue) div (z2.Round) - else - z.Frac:= 0 + inc(z.QWordValue, t div z2.Round); end end; @@ -491,14 +385,14 @@ end end; -function hwSqrt(const t: hwFloat): hwFloat; +function hwSqrt1(const t: hwFloat): hwFloat; const pwr = 8; // even value, feel free to adjust rThreshold = 1 shl (pwr + 32); lThreshold = 1 shl (pwr div 2 + 32); var l, r: QWord; c: hwFloat; begin -hwSqrt.isNegative:= false; +hwSqrt1.isNegative:= false; if t.Round = 0 then begin @@ -531,12 +425,47 @@ l:= c.QWordValue until r - l <= 1; -hwSqrt.QWordValue:= l +hwSqrt1.QWordValue:= l end; -function Distance(const dx, dy: hwFloat): hwFloat; +function hwSqrt(const x: hwFloat): hwFloat; +var r, t, s, q: QWord; + i: integer; begin -Distance:= hwSqrt(hwSqr(dx) + hwSqr(dy)) +hwSqrt.isNegative:= false; + +t:= $4000000000000000; +r:= 0; +q:= x.QWordValue; + +for i:= 0 to 31 do + begin + s:= r + t; + r:= r shr 1; + if s <= q then + begin + dec(q, s); + inc(r, t); + end; + t:= t shr 2; + end; + +hwSqrt.QWordValue:= r shl 16 +end; + + + +function Distance(const dx, dy: hwFloat): hwFloat; +var r: QWord; +begin +r:= dx.QWordValue or dy.QWordValue; + +if r < $10000 then + begin + Distance.QWordValue:= r; + Distance.isNegative:= false + end else + Distance:= hwSqrt(hwSqr(dx) + hwSqr(dy)) end; function DistanceI(const dx, dy: LongInt): hwFloat; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGame.pas --- a/hedgewars/uGame.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGame.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGears.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -773,7 +773,8 @@ begin dec(i); Gear:= t^.ar[i]; - if (Ammo^.Kind = gtFlame) and (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then + if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and + (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000); tmpDmg:= ModifyDamage(Damage, Gear); if (Gear^.State and gstNoDamage) = 0 then diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsHandlers.pas --- a/hedgewars/uGearsHandlers.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsHandlers.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsHandlersRope.pas --- a/hedgewars/uGearsHandlersRope.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsHandlersRope.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -202,7 +202,7 @@ begin lx := hwRound(nx); ly := hwRound(ny); - if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and ((Land[ly, lx] and $FF00) <> 0) then + if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] > lfAllObjMask) then begin tx := _1 / Distance(ropeDx, ropeDy); // old rope pos @@ -425,7 +425,7 @@ ty := _0; while tt > _20 do begin - if ((hwRound(Gear^.Y+ty) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X+tx) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y+ty), hwRound(Gear^.X+tx)] and $FF00) <> 0) then + if ((hwRound(Gear^.Y+ty) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X+tx) and LAND_WIDTH_MASK) = 0) and (Land[hwRound(Gear^.Y+ty), hwRound(Gear^.X+tx)] > lfAllObjMask) then begin Gear^.X := Gear^.X + tx; Gear^.Y := Gear^.Y + ty; @@ -449,8 +449,8 @@ end; end; - if Gear^.Elasticity < _20 then Gear^.CollisionMask:= $FF00 - else Gear^.CollisionMask:= lfCurrentMask; + if Gear^.Elasticity < _20 then Gear^.CollisionMask:= lfLandMask + else Gear^.CollisionMask:= lfNotCurrentMask; CheckCollision(Gear); if (Gear^.State and gstCollision) <> 0 then diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsHedgehog.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,18 +23,18 @@ uses uTypes; procedure doStepHedgehog(Gear: PGear); -procedure AfterAttack; -procedure HedgehogStep(Gear: PGear); -procedure doStepHedgehogMoving(Gear: PGear); -procedure HedgehogChAngle(HHGear: PGear); +procedure AfterAttack; +procedure HedgehogStep(Gear: PGear); +procedure doStepHedgehogMoving(Gear: PGear); +procedure HedgehogChAngle(HHGear: PGear); procedure PickUp(HH, Gear: PGear); procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord); procedure CheckIce(Gear: PGear); inline; implementation -uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, +uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript, - uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, + uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, uGearsUtils; var GHStepTicks: LongWord = 0; @@ -75,7 +75,7 @@ MultiShootAttacks:= 0; HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump)); - + if Ammoz[CurAmmoType].Slot = slot then begin i:= 0; @@ -90,8 +90,8 @@ end; until (i = 1) or ((Ammo^[slot, ammoidx].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns)) - - end + + end else begin i:= 0; @@ -114,7 +114,7 @@ LoadHedgehogHat(HHGear^.Hedgehog^, Hat); end; // Try again in the next slot - if CurAmmoType = prevAmmo then + if CurAmmoType = prevAmmo then begin if slot >= cMaxSlotIndex then slot:= 0 else inc(slot); HHGear^.MsgParam:= slot; @@ -213,7 +213,7 @@ if ((State and gstHHDriven) <> 0) and ((State and (gstAttacked or gstHHChooseTarget)) = 0) and (((State and gstMoving) = 0) or (Power > 0) or (CurAmmoType = amTeleport) - or + or // Allow attacks while moving on ammo with AltAttack ((CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackInMove) <> 0)) @@ -257,8 +257,16 @@ and ((Gear^.Message and gmLJump) <> 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then begin - newDx:= dX; - newDy:= dY; + if (CurAmmoGear^.AmmoType = amJetpack) and (Gear^.Message and gmPrecise <> 0) then + begin + newDx:= xx*cMaxPower/cPowerDivisor; + newDy:= yy*cMaxPower/cPowerDivisor + end + else + begin + newDx:= dX; + newDy:= dY + end; altUse:= true end else @@ -285,15 +293,15 @@ amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0); amMine: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); - amKnife: begin + amKnife: begin newGear:= AddGear(hwRound(lx), hwRound(ly), gtKnife, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); - newGear^.State:= newGear^.State or gstMoving; + newGear^.State:= newGear^.State or gstMoving; newGear^.Radius:= 4 // temporarily shrink so it doesn't instantly embed in the ground end; amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); amPortalGun: begin - newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, + newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, // set selected color CurWeapon^.Pos); end; @@ -353,7 +361,7 @@ cGravity:= cMaxWindSpeed; cGravityf:= 0.00025 end; - amExtraDamage: begin + amExtraDamage: begin PlaySound(sndHellishImpact4); cDamageModifier:= _1_5 end; @@ -383,21 +391,22 @@ end; //amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000); amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000); - amIceGun: begin - newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0); - newGear^.radius := 8; - end; + amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0); end; - if altUse and (newGear <> nil) then + if altUse and (newGear <> nil) and + ((CurAmmoGear = nil) or (CurAmmoGear^.AmmoType <> amJetpack) or (Gear^.Message and gmPrecise = 0)) then begin newGear^.dX:= newDx / newGear^.Density; newGear^.dY:= newDY / newGear^.Density end; - + if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack) and + (Gear^.Message and gmPrecise <> 0) and (hwRound(Y) > cWaterLine) then + newGear^.State:= newGear^.State or gstSubmersible; + case CurAmmoType of - amGrenade, amMolotov, - amClusterBomb, amGasBomb, - amBazooka, amSnowball, + amGrenade, amMolotov, + amClusterBomb, amGasBomb, + amBazooka, amSnowball, amBee, amSMine, amMortar, amWatermelon, amHellishBomb, amDrill: FollowGear:= newGear; @@ -418,7 +427,7 @@ amTardis, amPiano, amIceGun: CurAmmoGear:= newGear; end; - + if ((CurAmmoType = amMine) or (CurAmmoType = amSMine)) and (GameFlags and gfInfAttack <> 0) then newGear^.FlightTime:= GameTicks + 1000 else if CurAmmoType = amDrill then @@ -442,7 +451,7 @@ newGear^.Elasticity:= newGear^.Elasticity * elastic else if elastic > _1 then newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic); - (* Experimented with friction modifier. Didn't seem helpful + (* Experimented with friction modifier. Didn't seem helpful fric:= int2hwfloat(CurWeapon^.Bounciness) / _250; if fric < _1 then newGear^.Friction:= newGear^.Friction * fric else if fric > _1 then newGear^.Friction:= _1 - ((_1-newGear^.Friction) / fric)*) @@ -478,7 +487,7 @@ AfterAttack; end end - else + else Message:= Message and (not gmAttack); end; TargetPoint.X := NoPointX; @@ -498,13 +507,13 @@ if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then begin Inc(MultiShootAttacks); - + if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then begin s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1); AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate); end; - + if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) or ((GameFlags and gfMultiWeapon) <> 0) then begin @@ -517,9 +526,11 @@ begin if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft; - TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100; + if (CurAmmoGear <> nil) and (CurAmmoGear^.State and gstSubmersible <> 0) and (hwRound(CurAmmoGear^.Y) > cWaterLine) then + TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 25 + else TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100; end; - if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then + if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then HHGear^.State:= HHGear^.State or gstAttacked; if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then ApplyAmmoChanges(CurrentHedgehog^) @@ -547,15 +558,16 @@ dec(Gear^.Timer); if (Gear^.Timer mod frametime) = 0 then inc(Gear^.Pos) - end + end else if Gear^.Timer = 1 then begin + Gear^.Hedgehog^.Effects[heFrozen]:= 0; Gear^.State:= Gear^.State or gstNoDamage; doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, CurrentHedgehog, EXPLAutoSound); AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtGrave, 0, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; DeleteGear(Gear); SetAllToActive - end + end else // Gear^.Timer = 0 begin AllInactive:= false; @@ -608,7 +620,7 @@ if cnt <> 0 then AddAmmo(HH, ammo, cnt) else AddAmmo(HH, ammo); - if (not (HH.Team^.ExtDriven + if (not (HH.Team^.ExtDriven or (HH.BotLevel > 0))) or (HH.Team^.Clan^.ClanIndex = LocalClan) or (GameType = gmtDemo) then @@ -646,7 +658,7 @@ posCaseUtility, posCaseAmmo: begin PlaySound(sndShotgunReload); - if Gear^.AmmoType <> amNothing then + if Gear^.AmmoType <> amNothing then begin AddPickup(HH^.Hedgehog^, Gear^.AmmoType, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y)); end @@ -654,7 +666,7 @@ begin // Add spawning here... AddRandomness(GameTicks); - + gi := GearsList; while gi <> nil do begin @@ -769,7 +781,7 @@ if (Gear^.Message and gmLeft )<>0 then Gear^.dX:= -cLittle else if (Gear^.Message and gmRight )<>0 then - Gear^.dX:= cLittle + Gear^.dX:= cLittle else exit; StepSoundTimer:= cHHStepTicks; @@ -796,12 +808,13 @@ var da: LongWord; begin with HHGear^.Hedgehog^ do - if ((CurAmmoType = amRope) and ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving)) + if (((CurAmmoType = amRope) or ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amRope))) and + ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving)) or ((CurAmmoType = amPortalGun) and ((HHGear^.State and gstMoving) <> 0)) then da:= 2 else da:= 1; -if (((HHGear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then +if ((HHGear^.Message and gmPrecise = 0) or ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack))) or (GameTicks mod 5 = 1) then if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then dec(HHGear^.Angle, da) else @@ -836,7 +849,7 @@ Gear^.dY:= _0; Gear^.State:= Gear^.State or gstMoving; if (CurrentHedgehog^.Gear = Gear) - and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then + and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then begin // TODO: why so aggressive at setting FollowGear when falling? FollowGear:= Gear; @@ -852,7 +865,7 @@ or ((Gear^.dY.QWordValue + Gear^.dX.QWordValue) > _0_55.QWordValue))) then Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density end - end + end else begin land:= TestCollisionYwithGear(Gear, 1); @@ -897,35 +910,40 @@ if TestCollisionXKick(Gear, hwSign(Gear^.dX)) then if not isFalling then if hwAbs(Gear^.dX) > _0_01 then - if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) then + if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) or + (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_96; Gear^.Y:= Gear^.Y - _1 end else - if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) then + if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) or + (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_93; Gear^.Y:= Gear^.Y - _2 - end + end else - if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) then + if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) or + (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_9 ; Gear^.Y:= Gear^.Y - _3 end else - if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) then + if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) or + (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_87; Gear^.Y:= Gear^.Y - _4 end else - if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) then + if not (TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) or + (TestCollisionYwithXYShift(Gear, hwSign(Gear^.dX) - hwRound(Gear^.dX), -1, -1))) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_84; @@ -959,8 +977,11 @@ begin Gear^.State:= Gear^.State and (not gstWinner); Gear^.State:= Gear^.State and (not gstMoving); - while (TestCollisionYWithGear(Gear,1) = 0) and (not CheckGearDrowning(Gear)) do - Gear^.Y:= Gear^.Y+_1; + while (TestCollisionYWithGear(Gear,1) = 0) and (not CheckGearDrowning(Gear)) and (Gear <> nil) do + Gear^.Y:= Gear^.Y + _1; + + // could become nil in CheckGearDrowning if ai's hog fails to respawn in ai survival + if Gear = nil then exit; SetLittle(Gear^.dX); Gear^.dY:= _0 end @@ -973,14 +994,17 @@ // ARTILLERY but not being moved by explosions Gear^.X:= Gear^.X + Gear^.dX; Gear^.Y:= Gear^.Y + Gear^.dY; - if (not Gear^.dY.isNegative) and (not TestCollisionYKick(Gear, 1)) + if (not Gear^.dY.isNegative) and (not TestCollisionYKick(Gear, 1)) and TestCollisionYwithXYShift(Gear, 0, 1, 1) then begin CheckHHDamage(Gear); Gear^.dY:= _0; Gear^.Y:= Gear^.Y + _1 end; + CheckGearDrowning(Gear); + // could become nil if ai's hog fails to respawn in ai survival + if Gear = nil then exit; // hide target cursor if current hog is drowning if (Gear^.State and gstDrowning) <> 0 then if (CurrentHedgehog^.Gear = Gear) then @@ -1057,7 +1081,7 @@ HHGear^.Message:= HHGear^.Message or gmAttack; // check for case with ammo t:= CheckGearNear(HHGear, gtCase, 36, 36); - if t <> nil then + if (t <> nil) and (t^.State and gstFrozen = 0) then PickUp(HHGear, t) end; @@ -1066,7 +1090,7 @@ or ((HHGear^.State and gstAttacking) <> 0)) then Attack(HHGear) // should be before others to avoid desync with '/put' msg and changing weapon msgs else -else +else with Hedgehog^ do if ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) and ((HHGear^.Message and gmLJump) <> 0) @@ -1171,7 +1195,7 @@ begin ResurrectHedgehog(Gear); end - else + else begin Gear^.State:= (Gear^.State or gstHHDeath) and (not gstAnimation); Gear^.doStep:= @doStepHedgehogDead; @@ -1215,9 +1239,9 @@ procedure CheckIce(Gear: PGear); inline; (* var x,y,tx,ty: LongInt; - tdX, tdY, slope: hwFloat; + tdX, tdY, slope: hwFloat; land: Word; *) -var slope: hwFloat; +var slope: hwFloat; begin if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0) and (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0) @@ -1258,7 +1282,7 @@ end; if GameTicks mod 100 = 0 then CheckIce(Gear); (* -if Gear^.Hedgehog^.Effects[heFrozen] > 0 then +if Gear^.Hedgehog^.Effects[heFrozen] > 0 then begin if (Gear^.Hedgehog^.Effects[heFrozen] > 256) and (CurrentHedgehog^.Team^.Clan <> Gear^.Hedgehog^.Team^.Clan) then dec(Gear^.Hedgehog^.Effects[heFrozen]) @@ -1266,7 +1290,7 @@ dec(Gear^.Hedgehog^.Effects[heFrozen]) end; *) -if (GameTicks mod 10 = 0) and (Gear^.Hedgehog^.Effects[heFrozen] > 0) and (Gear^.Hedgehog^.Effects[heFrozen] < 256) then +if (GameTicks mod 10 = 0) and (Gear^.Hedgehog^.Effects[heFrozen] > 0) and (Gear^.Hedgehog^.Effects[heFrozen] < 256) then dec(Gear^.Hedgehog^.Effects[heFrozen]); if (Gear^.State and gstHHDriven) = 0 then doStepHedgehogFree(Gear) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsList.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ uGearsRender, uGearsUtils, uDebug; const - GearKindAmmoTypeMap : array [TGearType] of TAmmoType = ( + GearKindAmmoTypeMap : array [TGearType] of TAmmoType = ( (* gtFlame *) amNothing (* gtHedgehog *) , amNothing (* gtMine *) , amMine @@ -181,18 +181,18 @@ gear^.AmmoType:= GearKindAmmoTypeMap[Kind]; gear^.CollisionMask:= $FFFF; -if CurrentHedgehog <> nil then +if CurrentHedgehog <> nil then begin gear^.Hedgehog:= CurrentHedgehog; if (CurrentHedgehog^.Gear <> nil) and (hwRound(CurrentHedgehog^.Gear^.X) = X) and (hwRound(CurrentHedgehog^.Gear^.Y) = Y) then - gear^.CollisionMask:= lfCurrentMask + gear^.CollisionMask:= lfNotCurrentMask end; if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then gear^.Z:= cHHZ+1 else gear^.Z:= cUsualZ; - + case Kind of gtGrenade, gtClusterBomb, @@ -469,7 +469,8 @@ end; gtJetpack: begin gear^.Health:= 2000; - gear^.Damage:= 100 + gear^.Damage:= 100; + gear^.State:= gstSubmersible end; gtMolotov: begin gear^.Radius:= 6; @@ -548,7 +549,10 @@ gear^.Pos:= 1; end; } - gtIceGun: gear^.Health:= 1000; + gtIceGun: begin + gear^.Health:= 1000; + gear^.Radius:= 8; + end; gtGenericFaller:begin gear^.AdvBounce:= 1; gear^.Radius:= 1; @@ -645,7 +649,7 @@ if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0) and //(Gear^.Hedgehog^.Effects[heResurrectable] = 0) then (Gear^.Hedgehog^.Team^.Clan <> CurrentHedgehog^.Team^.Clan) then - with CurrentHedgehog^ do + with CurrentHedgehog^ do begin inc(Team^.stats.AIKills); FreeTexture(Team^.AIKillsTex); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsRender.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -352,13 +352,7 @@ lx:= lx + ax; ly:= ly + ay; tx:= round(lx); - ty:= round(ly); - if (abs(tx-hx) > 1000) or (abs(hy-ty) > 1000) then - begin - DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); - hx:= tx; - hy:= ty - end + ty:= round(ly) end; // reached edge of land. assume infinite beam. Extend it way out past camera if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then @@ -368,7 +362,6 @@ end; //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then - if (tx <> hx) or (ty <> hy) then begin DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); end; @@ -986,6 +979,8 @@ aAngle: real; startX, endX, startY, endY: LongInt; begin + if Gear^.State and gstFrozen <> 0 then Tint($A0, $A0, $FF, $FF); + //if Gear^.State and gstFrozen <> 0 then Tint(IceColor or $FF); if Gear^.Target.X <> NoPointX then if Gear^.AmmoType = amBee then DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) @@ -1045,11 +1040,13 @@ gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); gtRope: DrawRope(Gear); - gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then + gtMine: begin + if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) - else if Gear^.Health <> 0 then - DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) - else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); + else if Gear^.Health <> 0 then + DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) + else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); + end; gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) @@ -1063,26 +1060,38 @@ begin if ((Gear^.Pos and posCaseAmmo) <> 0) then begin - i:= (GameTicks shr 6) mod 64; - if i > 18 then - i:= 0; - DrawSprite(sprCase, x - 24, y - 24, i); + if Gear^.State and gstFrozen <> 0 then + DrawSprite(sprCase, x - 24, y - 28, 0) + else + begin + i:= (GameTicks shr 6) mod 64; + if i > 18 then i:= 0; + DrawSprite(sprCase, x - 24, y - 24, i) + end end else if ((Gear^.Pos and posCaseHealth) <> 0) then begin - i:= ((GameTicks shr 6) + 38) mod 64; - if i > 13 then - i:= 0; - DrawSprite(sprFAid, x - 24, y - 24, i); + if Gear^.State and gstFrozen <> 0 then + DrawSprite(sprFAid, x - 24, y - 28, 0) + else + begin + i:= ((GameTicks shr 6) + 38) mod 64; + if i > 13 then i:= 0; + DrawSprite(sprFAid, x - 24, y - 24, i) + end end else if ((Gear^.Pos and posCaseUtility) <> 0) then begin - i:= (GameTicks shr 6) mod 70; - if i > 23 then - i:= 0; - i:= i mod 12; - DrawSprite(sprUtility, x - 24, y - 24, i); - end; + if Gear^.State and gstFrozen <> 0 then + DrawSprite(sprUtility, x - 24, y - 28, 0) + else + begin + i:= (GameTicks shr 6) mod 70; + if i > 23 then i:= 0; + i:= i mod 12; + DrawSprite(sprUtility, x - 24, y - 24, i) + end + end end; if Gear^.Timer < 1833 then begin @@ -1103,7 +1112,7 @@ else if Gear^.State and gsttmpFlag = 0 then DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) else - DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); + DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle) end; gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); @@ -1292,6 +1301,7 @@ end; if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawTextureCentered(x + 8, y + 8, Gear^.Tex); + if Gear^.State and gstFrozen <> 0 then Tint($FF, $FF, $FF, $FF) end; end. diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uGearsUtils.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,13 +31,13 @@ procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource); procedure CheckHHDamage(Gear: PGear); procedure CalcRotationDirAngle(Gear: PGear); -procedure ResurrectHedgehog(gear: PGear); +procedure ResurrectHedgehog(var gear: PGear); procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt); inline; procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt; skipProximity: boolean); function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; -function CheckGearDrowning(Gear: PGear): boolean; +function CheckGearDrowning(var Gear: PGear): boolean; procedure CheckCollision(Gear: PGear); inline; procedure CheckCollisionWithLand(Gear: PGear); inline; @@ -137,7 +137,7 @@ Gear^.Active:= true; if Gear^.Kind <> gtFlame then FollowGear:= Gear end; - if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) then + if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) and ((Gear^.State and gstHHDeath) = 0) then Gear^.Hedgehog^.Effects[hePoisoned] := 1; end; @@ -183,9 +183,9 @@ if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then i:= _1_5; if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then - ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5) + ModifyDamage:= hwRound(cDamageModifier * dmg * i * cDamagePercent * _0_5 * _0_01) else - ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent) + ModifyDamage:= hwRound(cDamageModifier * dmg * i * cDamagePercent * _0_01) end; procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource); @@ -263,6 +263,7 @@ procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource); begin +if Hedgehog^.Effects[heFrozen] <> 0 then exit; if (Source = dsFall) or (Source = dsExplosion) then case random(3) of 0: PlaySoundV(sndOoff1, Hedgehog^.Team^.voicepack); @@ -289,32 +290,34 @@ i: LongWord; particle: PVisualGear; begin - if _0_4 < Gear^.dY then - begin - dmg := ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear); - PlaySound(sndBump); - if dmg < 1 then - exit; +if _0_4 < Gear^.dY then + begin + dmg := ModifyDamage(1 + hwRound((Gear^.dY - _0_4) * 70), Gear); + if Gear^.Hedgehog^.Effects[heFrozen] = 0 then + PlaySound(sndBump) + else PlaySound(sndFrozenHogImpact); + if dmg < 1 then + exit; - for i:= min(12, (3 + dmg div 10)) downto 0 do - begin - particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); - if particle <> nil then - particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); - end; + for i:= min(12, (3 + dmg div 10)) downto 0 do + begin + particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); + if particle <> nil then + particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); + end; - if (Gear^.Invulnerable) then - exit; + if (Gear^.Invulnerable) then + exit; - //if _0_6 < Gear^.dY then - // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) - //else - // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); + //if _0_6 < Gear^.dY then + // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) + //else + // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); - if Gear^.LastDamage <> nil then - ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall) - else - ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); + if Gear^.LastDamage <> nil then + ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall) + else + ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); end end; @@ -337,7 +340,7 @@ Gear^.DirAngle := Gear^.DirAngle - 360 end; -function CheckGearDrowning(Gear: PGear): boolean; +function CheckGearDrowning(var Gear: PGear): boolean; var skipSpeed, skipAngle, skipDecay: hwFloat; i, maxDrops, X, Y: LongInt; @@ -361,7 +364,7 @@ else DeleteGear(Gear); exit end; - isSubmersible:= (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack); + isSubmersible:= ((Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.State and gstSubmersible <> 0)) or (Gear^.State and gstSubmersible <> 0); skipSpeed := _0_25; skipAngle := _1_9; skipDecay := _0_87; @@ -369,7 +372,7 @@ vdX:= hwFloat2Float(Gear^.dX); vdY:= hwFloat2Float(Gear^.dY); // this could perhaps be a tiny bit higher. - if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) + if (cWaterLine + 64 + Gear^.Radius > Y) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) and (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then begin Gear^.dY.isNegative := true; @@ -390,7 +393,11 @@ if Gear^.Kind = gtHedgehog then begin if Gear^.Hedgehog^.Effects[heResurrectable] <> 0 then - ResurrectHedgehog(Gear) + begin + // Gear could become nil after this, just exit to skip splashes + ResurrectHedgehog(Gear); + exit + end else begin Gear^.doStep := @doStepDrowningGear; @@ -402,9 +409,12 @@ Gear^.doStep := @doStepDrowningGear; if Gear^.Kind = gtFlake then exit // skip splashes - end; + end + else if (Y > cWaterLine + cVisibleWater*4) and + ((Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.State and gstSubmersible = 0)) then + Gear^.doStep:= @doStepDrowningGear; if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius)) - or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) + or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01))) then if Gear^.Density * Gear^.dY > _1 then PlaySound(sndSplash) @@ -416,7 +426,7 @@ if ((cReducedQuality and rqPlainSplash) = 0) and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius)) - or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) + or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01)))) then begin splash:= AddVisualGear(X, cWaterLine, vgtSplash); @@ -457,7 +467,7 @@ end end end; - if isSubmersible and (CurAmmoGear^.Pos = 0) then + if isSubmersible and (Gear = CurAmmoGear) and (CurAmmoGear^.Pos = 0) then CurAmmoGear^.Pos := 1000 end else @@ -465,7 +475,7 @@ end; -procedure ResurrectHedgehog(gear: PGear); +procedure ResurrectHedgehog(var gear: PGear); var tempTeam : PTeam; sparkles: PVisualGear; gX, gY: LongInt; @@ -507,7 +517,7 @@ RenderHealth(gear^.Hedgehog^); ScriptCall('onGearResurrect', gear^.uid); gear^.State := gstWait; - end; + end; RecountTeamHealth(tempTeam); end; @@ -580,7 +590,7 @@ inc(y, 2); until (y >= cWaterLine) or (not ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or - (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) = 0)); + (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) = 0)); sy:= y; @@ -588,7 +598,7 @@ inc(y); until (y >= cWaterLine) or (not ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or - (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) <> 0)); + (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) <> 0)); if (y - sy > Gear^.Radius * 2) and (((Gear^.Kind = gtExplosives) diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uIO.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -212,7 +212,7 @@ end; procedure SendStat(sit: TStatInfoType; s: shortstring); -const stc: array [TStatInfoType] of char = ('r', 'D', 'k', 'K', 'H', 'T', 'P', 's', 'S', 'B'); +const stc: array [TStatInfoType] of char = ('r', 'D', 'k', 'K', 'H', 'T', 'P', 's', 'S', 'B', 'c', 'g', 'p'); var buf: shortstring; begin buf:= 'i' + stc[sit] + s; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uInputHandler.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -289,8 +289,8 @@ DefaultBinds[KeyNameToCode(_S'y')]:= 'confirm'; DefaultBinds[KeyNameToCode('mousem')]:= 'zoomreset'; -DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomout'; -DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomin'; +DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomin'; +DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomout'; DefaultBinds[KeyNameToCode('f12')]:= 'fullscr'; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLand.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -483,28 +483,11 @@ p:= tmpsurf^.pixels; for y:= 0 to Pred(tmpsurf^.h) do - begin + begin for x:= 0 to Pred(tmpsurf^.w) do - begin - // this an if instead of masking colours to avoid confusing map creators - if ((AMask and p^[x]) = 0) then - Land[cpY + y, cpX + x]:= 0 - else if p^[x] = $FFFFFFFF then // white - Land[cpY + y, cpX + x]:= lfObject - else if p^[x] = AMask then // black - begin - Land[cpY + y, cpX + x]:= lfBasic; - disableLandBack:= false - end - else if p^[x] = (AMask or RMask) then // red - Land[cpY + y, cpX + x]:= lfIndestructible - else if p^[x] = (AMask or BMask) then // blue - Land[cpY + y, cpX + x]:= lfObject or lfIce - else if p^[x] = (AMask or GMask) then // green - Land[cpY + y, cpX + x]:= lfObject or lfBouncy + SetLand(Land[cpY + y, cpX + x], p^[x]); + p:= @(p^[tmpsurf^.pitch div 4]); end; - p:= @(p^[tmpsurf^.pitch div 4]); - end; if SDL_MustLock(tmpsurf) then SDL_UnlockSurface(tmpsurf); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandGenMaze.pas --- a/hedgewars/uLandGenMaze.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandGenMaze.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,3 +1,5 @@ +{$INCLUDE "options.inc"} + unit uLandGenMaze; interface diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandGraphics.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,10 +22,14 @@ interface uses uFloat, uConsts, uTypes; +type + fillType = (nullPixel, backgroundPixel, ebcPixel, icePixel, setNotCurrentMask, changePixelSetNotCurrent, setCurrentHog, changePixelNotSetNotCurrent); + type TRangeArray = array[0..31] of record Left, Right: LongInt; end; PRangeArray = ^TRangeArray; +TLandCircleProcedure = procedure (landX, landY, pixelX, pixelY: Longint); function addBgColor(OldColor, NewColor: LongWord): LongWord; function SweepDirty: boolean; @@ -36,7 +40,7 @@ procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt); procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); -procedure FillRoundInLandWithIce(X, Y, Radius: LongInt); +function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): LongWord; procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); function LandBackPixel(x, y: LongInt): LongWord; procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword); @@ -48,6 +52,218 @@ implementation uses SDLh, uLandTexture, uVariables, uUtils, uDebug; + +procedure calculatePixelsCoordinates(landX, landY: Longint; var pixelX, pixelY: Longint); inline; +begin +if (cReducedQuality and rqBlurryLand) = 0 then + begin + pixelX := landX; + pixelY := landY; + end +else + begin + pixelX := LandX div 2; + pixelY := LandY div 2; + end; +end; + +function drawPixelBG(landX, landY, pixelX, pixelY: Longint): Longword; inline; +begin +drawPixelBG := 0; +if (Land[LandY, landX] and lfIndestructible) = 0 then + begin + if ((Land[landY, landX] and lfBasic) <> 0) and (((LandPixels[pixelY, pixelX] and AMask) shr AShift) = 255) and (not disableLandBack) then + begin + LandPixels[pixelY, pixelX]:= LandBackPixel(landX, landY); + inc(drawPixelBG); + end + else if ((Land[landY, landX] and lfObject) <> 0) or (((LandPixels[pixelY, pixelX] and AMask) shr AShift) < 255) then + LandPixels[pixelY, pixelX]:= 0 + end; +end; + +procedure drawPixelEBC(landX, landY, pixelX, pixelY: Longint); inline; +begin +if ((Land[landY, landX] and lfBasic) <> 0) or ((Land[landY, landX] and lfObject) <> 0) then + begin + LandPixels[pixelY, pixelX]:= ExplosionBorderColor; + Land[landY, landX]:= (Land[landY, landX] or lfDamaged) and not lfIce; + LandDirty[landY div 32, landX div 32]:= 1; + end; +end; + +function isLandscapeEdge(weight:Longint):boolean; inline; +begin +result := (weight < 8) and (weight >= 2); +end; + +function getPixelWeight(x, y:Longint): Longint; +var + i, j:Longint; +begin +result := 0; +for i := x - 1 to x + 1 do + for j := y - 1 to y + 1 do + begin + if (i < 0) or + (i > LAND_WIDTH - 1) or + (j < 0) or + (j > LAND_HEIGHT -1) then + begin + result := 9; + exit; + end; + if Land[j, i] and lfLandMask and not lfIce = 0 then + result := result + 1; + end; +end; + + +procedure fillPixelFromIceSprite(pixelX, pixelY:Longint); inline; +var + iceSurface: PSDL_Surface; + icePixels: PLongwordArray; + w: LongWord; +begin + // So. 3 parameters here. Ice colour, Ice opacity, and a bias on the greyscaled pixel towards lightness + iceSurface:= SpritesData[sprIceTexture].Surface; + icePixels := iceSurface^.pixels; + w:= LandPixels[pixelY, pixelX]; + if w > 0 then + begin + w:= round(((w shr RShift and $FF) * RGB_LUMINANCE_RED + + (w shr BShift and $FF) * RGB_LUMINANCE_GREEN + + (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); + if w < 128 then w:= w+128; + if w > 255 then w:= 255; + w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[pixelY, pixelX] and AMask); + LandPixels[pixelY, pixelX]:= addBgColor(w, IceColor); + LandPixels[pixelY, pixelX]:= addBgColor(LandPixels[pixelY, pixelX], icePixels^[iceSurface^.w * (pixelY mod iceSurface^.h) + (pixelX mod iceSurface^.w)]) + end + else + begin + LandPixels[pixelY, pixelX]:= IceColor and not AMask or $E8 shl AShift; + LandPixels[pixelY, pixelX]:= addBgColor(LandPixels[pixelY, pixelX], icePixels^[iceSurface^.w * (pixelY mod iceSurface^.h) + (pixelX mod iceSurface^.w)]); + // silly workaround to avoid having to make background erasure a tadb it smarter about sea ice + if LandPixels[pixelY, pixelX] and AMask shr AShift = 255 then + LandPixels[pixelY, pixelX]:= LandPixels[pixelY, pixelX] and not AMask or 254 shl AShift; + end; +end; + + +procedure DrawPixelIce(landX, landY, pixelX, pixelY: Longint); inline; +begin +if ((Land[landY, landX] and lfIce) <> 0) then exit; +if isLandscapeEdge(getPixelWeight(landX, landY)) then + begin + if (LandPixels[pixelY, pixelX] and AMask < 255) and (LandPixels[pixelY, pixelX] and AMask > 0) then + LandPixels[pixelY, pixelX] := (IceEdgeColor and not AMask) or (LandPixels[pixelY, pixelX] and AMask) + else if (LandPixels[pixelY, pixelX] and AMask < 255) or (Land[landY, landX] > 255) then + LandPixels[pixelY, pixelX] := IceEdgeColor + end +else if Land[landY, landX] > 255 then + begin + fillPixelFromIceSprite(pixelX, pixelY); + end; +if Land[landY, landX] > 255 then Land[landY, landX] := Land[landY, landX] or lfIce and not lfDamaged; +end; + + +function FillLandCircleLine(y, fromPix, toPix: LongInt; fill : fillType): Longword; +var px, py, i: LongInt; +begin +//get rid of compiler warning + px := 0; + py := 0; + FillLandCircleLine := 0; + case fill of + backgroundPixel: + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + inc(FillLandCircleLine, drawPixelBG(i, y, px, py)); + end; + ebcPixel: + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + drawPixelEBC(i, y, px, py); + end; + nullPixel: + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255)) then + LandPixels[py, px]:= 0 + end; + icePixel: + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + DrawPixelIce(i, y, px, py); + end; + setNotCurrentMask: + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] and lfNotCurrentMask; + end; + changePixelSetNotCurrent: + for i:= fromPix to toPix do + begin + if Land[y, i] and lfObjMask > 0 then + Land[y, i]:= (Land[y, i] and lfNotObjMask) or ((Land[y, i] and lfObjMask) - 1); + end; + setCurrentHog: + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] or lfCurrentHog + end; + changePixelNotSetNotCurrent: + for i:= fromPix to toPix do + begin + if Land[y, i] and lfObjMask < lfObjMask then + Land[y, i]:= (Land[y, i] and lfNotObjMask) or ((Land[y, i] and lfObjMask) + 1) + end; + end; +end; + +function FillLandCircleSegment(x, y, dx, dy: LongInt; fill : fillType): Longword; inline; +begin + FillLandCircleSegment := 0; +if ((y + dy) and LAND_HEIGHT_MASK) = 0 then + inc(FillLandCircleSegment, FillLandCircleLine(y + dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); +if ((y - dy) and LAND_HEIGHT_MASK) = 0 then + inc(FillLandCircleSegment, FillLandCircleLine(y - dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); +if ((y + dx) and LAND_HEIGHT_MASK) = 0 then + inc(FillLandCircleSegment, FillLandCircleLine(y + dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); +if ((y - dx) and LAND_HEIGHT_MASK) = 0 then + inc(FillLandCircleSegment, FillLandCircleLine(y - dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); +end; + +function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): Longword; inline; +var dx, dy, d: LongInt; +begin +dx:= 0; +dy:= Radius; +d:= 3 - 2 * Radius; +FillRoundInLand := 0; +while (dx < dy) do + begin + inc(FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); + if (d < 0) then + d:= d + 4 * dx + 6 + else + begin + d:= d + 4 * (dx - dy) + 10; + dec(dy) + end; + inc(dx) + end; +if (dx = dy) then + inc (FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); +end; + + function addBgColor(OldColor, NewColor: LongWord): LongWord; // Factor ranges from 0 to 100% NewColor var @@ -100,67 +316,6 @@ Land[y - dx, i]:= Value; end; -procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean); -var i: LongInt; -begin -if not doSet then - begin - if ((y + dy) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if isCurrent then - Land[y + dy, i]:= Land[y + dy, i] and lfCurrentMask - else if Land[y + dy, i] and lfObjMask > 0 then - Land[y + dy, i]:= (Land[y + dy, i] and lfNotObjMask) or ((Land[y + dy, i] and lfObjMask) - 1); - if ((y - dy) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if isCurrent then - Land[y - dy, i]:= Land[y - dy, i] and lfCurrentMask - else if Land[y - dy, i] and lfObjMask > 0 then - Land[y - dy, i]:= (Land[y - dy, i] and lfNotObjMask) or ((Land[y - dy, i] and lfObjMask) - 1); - if ((y + dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if isCurrent then - Land[y + dx, i]:= Land[y + dx, i] and lfCurrentMask - else if Land[y + dx, i] and lfObjMask > 0 then - Land[y + dx, i]:= (Land[y + dx, i] and lfNotObjMask) or ((Land[y + dx, i] and lfObjMask) - 1); - if ((y - dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if isCurrent then - Land[y - dx, i]:= Land[y - dx, i] and lfCurrentMask - else if Land[y - dx, i] and lfObjMask > 0 then - Land[y - dx, i]:= (Land[y - dx, i] and lfNotObjMask) or ((Land[y - dx, i] and lfObjMask) - 1) - end -else - begin - if ((y + dy) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if isCurrent then - Land[y + dy, i]:= Land[y + dy, i] or lfCurrentHog - else if Land[y + dy, i] and lfObjMask < lfObjMask then - Land[y + dy, i]:= (Land[y + dy, i] and lfNotObjMask) or ((Land[y + dy, i] and lfObjMask) + 1); - if ((y - dy) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if isCurrent then - Land[y - dy, i]:= Land[y - dy, i] or lfCurrentHog - else if Land[y - dy, i] and lfObjMask < lfObjMask then - Land[y - dy, i]:= (Land[y - dy, i] and lfNotObjMask) or ((Land[y - dy, i] and lfObjMask) + 1); - if ((y + dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if isCurrent then - Land[y + dx, i]:= Land[y + dx, i] or lfCurrentHog - else if Land[y + dx, i] and lfObjMask < lfObjMask then - Land[y + dx, i]:= (Land[y + dx, i] and lfNotObjMask) or ((Land[y + dx, i] and lfObjMask) + 1); - if ((y - dx) and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if isCurrent then - Land[y - dx, i]:= Land[y - dx, i] or lfCurrentHog - else if Land[y - dx, i] and lfObjMask < lfObjMask then - Land[y - dx, i]:= (Land[y - dx, i] and lfNotObjMask) or ((Land[y - dx, i] and lfObjMask) + 1) - end -end; - - - procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); var dx, dy, d: LongInt; begin @@ -184,206 +339,17 @@ end; procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); -var dx, dy, d: LongInt; begin -dx:= 0; -dy:= Radius; -d:= 3 - 2 * Radius; -while (dx < dy) do - begin - ChangeCircleLines(x, y, dx, dy, doSet, isCurrent); - if (d < 0) then - d:= d + 4 * dx + 6 - else - begin - d:= d + 4 * (dx - dy) + 10; - dec(dy) - end; - inc(dx) - end; -if (dx = dy) then - ChangeCircleLines(x, y, dx, dy, doSet, isCurrent) -end; - -procedure FillLandCircleLines0(x, y, dx, dy: LongInt); -var i, t: LongInt; -begin -t:= y + dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= 0 - else - LandPixels[t div 2, i div 2]:= 0; - -t:= y - dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= 0 - else - LandPixels[t div 2, i div 2]:= 0; - -t:= y + dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= 0 - else - LandPixels[t div 2, i div 2]:= 0; - -t:= y - dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= 0 - else - LandPixels[t div 2, i div 2]:= 0; - -end; - - -function isLandscapeEdge(weight:Longint):boolean; inline; -begin - result := (weight < 8) and (weight >= 2); -end; - -function getPixelWeight(x, y:Longint): Longint; -var - i, j:Longint; -begin - result := 0; - for i := x - 1 to x + 1 do - for j := y - 1 to y + 1 do - begin - if (i < 0) or - (i > LAND_WIDTH - 1) or - (j < 0) or - (j > LAND_HEIGHT -1) then - begin - result := 9; - exit; - end; - - if Land[j, i] and $FF00 and not lfIce = 0 then - result := result + 1; - end; +if not doSet and isCurrent then + FillRoundInLand(X, Y, Radius, setNotCurrentMask) +else if not doSet and not IsCurrent then + FillRoundInLand(X, Y, Radius, changePixelSetNotCurrent) +else if doSet and IsCurrent then + FillRoundInLand(X, Y, Radius, setCurrentHog) +else if doSet and not IsCurrent then + FillRoundInLand(X, Y, Radius, changePixelNotSetNotCurrent); end; -procedure drawIcePixel(y, x:Longint); -var - iceSurface: PSDL_Surface; - icePixels: PLongwordArray; - pictureX, pictureY: LongInt; - w, c: LongWord; - weight: Longint; -begin - // So. 3 parameters here. Ice colour, Ice opacity, and a bias on the greyscaled pixel towards lightness - iceSurface:= SpritesData[sprIceTexture].Surface; - icePixels := iceSurface^.pixels; - w:= LandPixels[y, x]; - if w > 0 then - begin - w:= round(((w shr RShift and $FF) * RGB_LUMINANCE_RED + - (w shr BShift and $FF) * RGB_LUMINANCE_GREEN + - (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); - if w < 128 then w:= w+128; - if w > 255 then w:= 255; - w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask); - LandPixels[y, x]:= addBgColor(w, IceColor); - LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]) - end - else - begin - LandPixels[y, x]:= IceColor and not AMask or $E8 shl AShift; - LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]); - // silly workaround to avoid having to make background erasure a tadb it smarter about sea ice - if LandPixels[y, x] and AMask shr AShift = 255 then - LandPixels[y, x]:= LandPixels[y, x] and not AMask or 254 shl AShift; - end; -end; - -function getIncrementInquarter(dx, dy, quarter: Longint): Longint; inline; -const directionX : array [0..3] of Longint = (0, 0, 1, -1); -const directionY : array [0..3] of Longint = (1, -1, 0, 0); -begin - getIncrementInquarter := directionX[quarter] * dx + directionY[quarter] * dy; -end; - -function getIncrementInquarter2(dx, dy, quarter: Longint): Longint; inline; -const directionY : array [0..3] of Longint = (0, 0, 1, 1); -const directionX : array [0..3] of Longint = (1, 1, 0, 0); -begin - getIncrementInquarter2 := directionX[quarter] * dx + directionY[quarter] * dy; -end; - -procedure FillLandCircleLinesIce(x, y, dx, dy: LongInt); -var q, i, t, px, py: LongInt; -begin -for q := 0 to 3 do - begin - t:= y + getIncrementInquarter(dx, dy, q); - if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - getIncrementInquarter2(dx, dy, q), 0) to Min(x + getIncrementInquarter2(dx, dy, q), LAND_WIDTH - 1) do - if Land[t, i] and lfIce = 0 then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - begin - px:= i; py:= t - end - else - begin - px:= i div 2; py:= t div 2 - end; - if isLandscapeEdge(getPixelWeight(i, t)) then - begin - if (LandPixels[py, px] and AMask < 255) and (LandPixels[py, px] and AMask > 0) then - LandPixels[py, px] := (IceEdgeColor and not AMask) or (LandPixels[py, px] and AMask) - else if (LandPixels[py, px] and AMask < 255) or (Land[t, i] > 255) then - LandPixels[py, px] := IceEdgeColor - end - else if Land[t, i] > 255 then - begin - drawIcePixel(py, px) - end; - if Land[t, i] > 255 then Land[t, i] := Land[t, i] or lfIce and not lfDamaged; - end; - end -end; - -procedure FillRoundInLandWithIce(X, Y, Radius: LongInt); -var dx, dy, d: LongInt; - landRect: TSDL_Rect; -begin -dx:= 0; -dy:= Radius; -d:= 3 - 2 * Radius; -while (dx < dy) do - begin - FillLandCircleLinesIce(x, y, dx, dy); - if (d < 0) then - d:= d + 4 * dx + 6 - else - begin - d:= d + 4 * (dx - dy) + 10; - dec(dy) - end; - inc(dx) - end; -if (dx = dy) then - FillLandCircleLinesIce(x, y, dx, dy); -landRect.x := min(max(x - Radius, 0), LAND_WIDTH - 1); -landRect.y := min(max(y - Radius, 0), LAND_HEIGHT - 1); -landRect.w := min(2*Radius, LAND_WIDTH - landRect.x - 1); -landRect.h := min(2*Radius, LAND_HEIGHT - landRect.y - 1); -UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); -end; - - procedure DrawIceBreak(x, y, iceRadius, iceHeight: Longint); var i, j: integer; @@ -395,259 +361,32 @@ begin if Land[j, i] = 0 then begin - Land[j, i] := lfIce; - drawIcePixel(j, i); + Land[j, i] := lfIce; + fillPixelFromIceSprite(i, j); end; - end; + end; end; landRect.x := min(max(x - iceRadius, 0), LAND_WIDTH - 1); landRect.y := min(max(y, 0), LAND_HEIGHT - 1); landRect.w := min(2*iceRadius, LAND_WIDTH - landRect.x - 1); landRect.h := min(iceHeight, LAND_HEIGHT - landRect.y - 1); -UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); -end; - - - -function FillLandCircleLinesBG(x, y, dx, dy: LongInt): Longword; -var i, t, by, bx: LongInt; - cnt: Longword; -begin -cnt:= 0; -t:= y + dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[t, i] and lfIndestructible) = 0 then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - begin - by:= t; bx:= i; - end - else - begin - by:= t div 2; bx:= i div 2; - end; - if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then - begin - inc(cnt); - LandPixels[by, bx]:= LandBackPixel(i, t) - end - else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then - LandPixels[by, bx]:= 0 - end; - -t:= y - dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if (Land[t, i] and lfIndestructible) = 0 then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - begin - by:= t; bx:= i; - end - else - begin - by:= t div 2; bx:= i div 2; - end; - if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then - begin - inc(cnt); - LandPixels[by, bx]:= LandBackPixel(i, t) - end - else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then - LandPixels[by, bx]:= 0 - end; - -t:= y + dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[t, i] and lfIndestructible) = 0 then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - begin - by:= t; bx:= i; - end - else - begin - by:= t div 2; bx:= i div 2; - end; - if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then - begin - inc(cnt); - LandPixels[by, bx]:= LandBackPixel(i, t) - end - else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then - LandPixels[by, bx]:= 0 - end; -t:= y - dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if (Land[t, i] and lfIndestructible) = 0 then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - begin - by:= t; bx:= i; - end - else - begin - by:= t div 2; bx:= i div 2; - end; - if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then - begin - inc(cnt); - LandPixels[by, bx]:= LandBackPixel(i, t) - end - else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then - LandPixels[by, bx]:= 0 - end; -FillLandCircleLinesBG:= cnt; -end; - -procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); -var i, t: LongInt; -begin -t:= y + dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= ExplosionBorderColor - else - LandPixels[t div 2, i div 2]:= ExplosionBorderColor; - - Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce; - //Despeckle(i, t); - LandDirty[t div 32, i div 32]:= 1; - end; - -t:= y - dy; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do - if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= ExplosionBorderColor - else - LandPixels[t div 2, i div 2]:= ExplosionBorderColor; - Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce; - //Despeckle(i, t); - LandDirty[t div 32, i div 32]:= 1; - end; - -t:= y + dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= ExplosionBorderColor - else - LandPixels[t div 2, i div 2]:= ExplosionBorderColor; - - Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce; - //Despeckle(i, t); - LandDirty[t div 32, i div 32]:= 1; - end; - -t:= y - dx; -if (t and LAND_HEIGHT_MASK) = 0 then - for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do - if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then - begin - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[t, i]:= ExplosionBorderColor - else - LandPixels[t div 2, i div 2]:= ExplosionBorderColor; - - Land[t, i]:= (Land[t, i] or lfDamaged) and not lfIce; - //Despeckle(i, y - dy); - LandDirty[t div 32, i div 32]:= 1; - end; +UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); end; function DrawExplosion(X, Y, Radius: LongInt): Longword; -var dx, dy, ty, tx, d: LongInt; - cnt: Longword; +var + tx, ty, dx, dy: Longint; begin - -// draw background land texture - begin - cnt:= 0; - dx:= 0; - dy:= Radius; - d:= 3 - 2 * Radius; - - while (dx < dy) do - begin - inc(cnt, FillLandCircleLinesBG(x, y, dx, dy)); - if (d < 0) then - d:= d + 4 * dx + 6 - else - begin - d:= d + 4 * (dx - dy) + 10; - dec(dy) - end; - inc(dx) - end; - if (dx = dy) then - inc(cnt, FillLandCircleLinesBG(x, y, dx, dy)); - end; - -// draw a hole in land -if Radius > 20 then - begin - dx:= 0; - dy:= Radius - 15; - d:= 3 - 2 * dy; - - while (dx < dy) do - begin - FillLandCircleLines0(x, y, dx, dy); - if (d < 0) then - d:= d + 4 * dx + 6 - else - begin - d:= d + 4 * (dx - dy) + 10; - dec(dy) - end; - inc(dx) - end; - if (dx = dy) then - FillLandCircleLines0(x, y, dx, dy); - end; - - // FillRoundInLand after erasing land pixels to allow Land 0 check for mask.png to function + DrawExplosion := FillRoundInLand(x, y, Radius, backgroundPixel); + if Radius > 20 then + FillRoundInLand(x, y, Radius - 15, nullPixel); FillRoundInLand(X, Y, Radius, 0); - -// draw explosion border - begin - inc(Radius, 4); - dx:= 0; - dy:= Radius; - d:= 3 - 2 * Radius; - while (dx < dy) do - begin - FillLandCircleLinesEBC(x, y, dx, dy); - if (d < 0) then - d:= d + 4 * dx + 6 - else - begin - d:= d + 4 * (dx - dy) + 10; - dec(dy) - end; - inc(dx) - end; - if (dx = dy) then - FillLandCircleLinesEBC(x, y, dx, dy); - end; - -tx:= Max(X - Radius - 1, 0); -dx:= Min(X + Radius + 1, LAND_WIDTH) - tx; -ty:= Max(Y - Radius - 1, 0); -dy:= Min(Y + Radius + 1, LAND_HEIGHT) - ty; -UpdateLandTexture(tx, dx, ty, dy, false); -DrawExplosion:= cnt + FillRoundInLand(x, y, Radius + 4, ebcPixel); + tx:= Max(X - Radius - 5, 0); + dx:= Min(X + Radius + 5, LAND_WIDTH) - tx; + ty:= Max(Y - Radius - 5, 0); + dy:= Min(Y + Radius + 5, LAND_HEIGHT) - ty; + UpdateLandTexture(tx, dx, ty, dy, false); end; procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); @@ -701,6 +440,33 @@ UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false) end; + + +procedure DrawExplosionBorder(X, Y, dx, dy:hwFloat; despeckle : Boolean); +var + t, tx, ty :Longint; +begin +for t:= 0 to 7 do + begin + X:= X + dX; + Y:= Y + dY; + tx:= hwRound(X); + ty:= hwRound(Y); + if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0) + or ((Land[ty, tx] and lfObject) <> 0)) then + begin + Land[ty, tx]:= (Land[ty, tx] or lfDamaged) and not lfIce; + if despeckle then + LandDirty[ty div 32, tx div 32]:= 1; + if (cReducedQuality and rqBlurryLand) = 0 then + LandPixels[ty, tx]:= ExplosionBorderColor + else + LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor + end + end; +end; + + // // - (dX, dY) - direction, vector of length = 0.5 // @@ -753,24 +519,7 @@ begin X:= nx - dX8; Y:= ny - dY8; - for t:= 0 to 7 do - begin - X:= X + dX; - Y:= Y + dY; - tx:= hwRound(X); - ty:= hwRound(Y); - if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0) - or ((Land[ty, tx] and lfObject) <> 0)) then - begin - Land[ty, tx]:= (Land[ty, tx] or lfDamaged) and not lfIce; - if despeckle then - LandDirty[ty div 32, tx div 32]:= 1; - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[ty, tx]:= ExplosionBorderColor - else - LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor - end - end; + DrawExplosionBorder(X, Y, dx, dy, despeckle); X:= nx; Y:= ny; for t:= 0 to ticks do @@ -796,24 +545,7 @@ Land[ty, tx]:= 0; end end; - for t:= 0 to 7 do - begin - X:= X + dX; - Y:= Y + dY; - tx:= hwRound(X); - ty:= hwRound(Y); - if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0) - or ((Land[ty, tx] and lfObject) <> 0)) then - begin - Land[ty, tx]:=( Land[ty, tx] or lfDamaged) and not lfIce; - if despeckle then - LandDirty[ty div 32, tx div 32]:= 1; - if (cReducedQuality and rqBlurryLand) = 0 then - LandPixels[ty, tx]:= ExplosionBorderColor - else - LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor - end - end; + DrawExplosionBorder(X, Y, dx, dy, despeckle); nx:= nx - dY; ny:= ny + dX; end; @@ -957,7 +689,7 @@ yy:= Y div 2; end; - pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0); + pixelsweep:= (Land[Y, X] <= lfAllObjMask) and (LandPixels[yy, xx] <> 0); if (((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then begin c:= 0; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandObjects.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,9 @@ procedure LoadThemeConfig; procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline; procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word); +procedure BlitImageUsingMask(cpX, cpY: Longword; Image, Mask: PSDL_Surface); procedure AddOnLandObjects(Surface: PSDL_Surface); +procedure SetLand(var LandWord: Word; Pixel: LongWord); inline; implementation uses uStore, uConsts, uConsole, uRandom, uSound, GLunit @@ -42,7 +44,7 @@ type TRectsArray = array[0..MaxRects] of TSDL_Rect; PRectArray = ^TRectsArray; TThemeObject = record - Surf: PSDL_Surface; + Surf, Mask: PSDL_Surface; inland: TSDL_Rect; outland: array[0..Pred(MAXOBJECTRECTS)] of TSDL_Rect; rectcnt: Longword; @@ -68,6 +70,26 @@ ThemeObjects: TThemeObjects; SprayObjects: TSprayObjects; +procedure SetLand(var LandWord: Word; Pixel: LongWord); inline; +begin + // this an if instead of masking colours to avoid confusing map creators + if ((AMask and Pixel) = 0) then + LandWord:= 0 + else if Pixel = $FFFFFFFF then // white + LandWord:= lfObject + else if Pixel = AMask then // black + begin + LandWord:= lfBasic; + disableLandBack:= false + end + else if Pixel = (AMask or RMask) then // red + LandWord:= lfIndestructible + else if Pixel = (AMask or BMask) then // blue + LandWord:= lfObject or lfIce + else if Pixel = (AMask or GMask) then // green + LandWord:= lfObject or lfBouncy +end; + procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline; begin BlitImageAndGenerateCollisionInfo(cpX, cpY, Width, Image, 0); @@ -105,7 +127,7 @@ if LandPixels[(cpY + y) div 2, (cpX + x) div 2] = 0 then LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x]; - if ((Land[cpY + y, cpX + x] and $FF00) = 0) and ((p^[x] and AMask) <> 0) then + if (Land[cpY + y, cpX + x] <= lfAllObjMask) and ((p^[x] and AMask) <> 0) then begin Land[cpY + y, cpX + x]:= lfObject; Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or extraFlags @@ -119,6 +141,47 @@ WriteLnToConsole(msgOK) end; +procedure BlitImageUsingMask(cpX, cpY: Longword; Image, Mask: PSDL_Surface); +var p, mp: PLongwordArray; + x, y: Longword; + bpp: LongInt; +begin +WriteToConsole('Generating collision info... '); + +if SDL_MustLock(Image) then + SDLTry(SDL_LockSurface(Image) >= 0, true); + +bpp:= Image^.format^.BytesPerPixel; +TryDo(bpp = 4, 'Land object should be 32bit', true); + +p:= Image^.pixels; +mp:= Mask^.pixels; +for y:= 0 to Pred(Image^.h) do + begin + for x:= 0 to Pred(Image^.w) do + begin + if (cReducedQuality and rqBlurryLand) = 0 then + begin + if (LandPixels[cpY + y, cpX + x] = 0) + or (((p^[x] and AMask) <> 0) and (((LandPixels[cpY + y, cpX + x] and AMask) shr AShift) < 255)) then + LandPixels[cpY + y, cpX + x]:= p^[x]; + end + else + if LandPixels[(cpY + y) div 2, (cpX + x) div 2] = 0 then + LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x]; + + if (Land[cpY + y, cpX + x] <= lfAllObjMask) or (Land[cpY + y, cpX + x] and lfObject <> 0) then + SetLand(Land[cpY + y, cpX + x], mp^[x]); + end; + p:= @(p^[Image^.pitch shr 2]); + mp:= @(mp^[Mask^.pitch shr 2]) + end; + +if SDL_MustLock(Image) then + SDL_UnlockSurface(Image); +WriteLnToConsole(msgOK) +end; + procedure AddRect(x1, y1, w1, h1: LongInt); begin with Rects^[RectCount] do @@ -326,7 +389,9 @@ if bRes then begin i:= getrandom(cnt); - BlitImageAndGenerateCollisionInfo(ar[i].x, ar[i].y, 0, Obj.Surf); + if Obj.Mask <> nil then + BlitImageUsingMask(ar[i].x, ar[i].y, Obj.Surf, Obj.Mask) + else BlitImageAndGenerateCollisionInfo(ar[i].x, ar[i].y, 0, Obj.Surf); AddRect(ar[i].x, ar[i].y, Width, Height); dec(Maxcnt) end @@ -555,9 +620,10 @@ with ThemeObjects.objs[Pred(ThemeObjects.Count)] do begin i:= Pos(',', s); - Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps); + Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps or ifCritical); Width:= Surf^.w; Height:= Surf^.h; + Mask:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i)))+'_mask', ifTransparent or ifIgnoreCaps); Delete(s, 1, i); i:= Pos(',', s); Maxcnt:= StrToInt(Trim(Copy(s, 1, Pred(i)))); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandPainted.pas --- a/hedgewars/uLandPainted.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandPainted.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandTemplates.pas --- a/hedgewars/uLandTemplates.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandTemplates.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1815,7 +1815,7 @@ FillPointsCount: Succ(High(Template0FPoints)); BezierizeCount: 3; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1826,7 +1826,7 @@ FillPointsCount: Succ(High(Template1FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1837,7 +1837,7 @@ FillPointsCount: Succ(High(Template2FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1848,7 +1848,7 @@ FillPointsCount: Succ(High(Template3FPoints)); BezierizeCount: 3; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1859,7 +1859,7 @@ FillPointsCount: Succ(High(Template4FPoints)); BezierizeCount: 3; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1870,7 +1870,7 @@ FillPointsCount: Succ(High(Template5FPoints)); BezierizeCount: 2; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1881,7 +1881,7 @@ FillPointsCount: Succ(High(Template6FPoints)); BezierizeCount: 2; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1892,7 +1892,7 @@ FillPointsCount: Succ(High(Template7FPoints)); BezierizeCount: 4; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1903,7 +1903,7 @@ FillPointsCount: Succ(High(Template8FPoints)); BezierizeCount: 2; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1914,7 +1914,7 @@ FillPointsCount: Succ(High(Template9FPoints)); BezierizeCount: 1; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1925,7 +1925,7 @@ FillPointsCount: Succ(High(Template10FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1936,7 +1936,7 @@ FillPointsCount: Succ(High(Template11FPoints)); BezierizeCount: 1; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1947,7 +1947,7 @@ FillPointsCount: Succ(High(Template12FPoints)); BezierizeCount: 3; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1958,7 +1958,7 @@ FillPointsCount: Succ(High(Template13FPoints)); BezierizeCount: 3; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1969,7 +1969,7 @@ FillPointsCount: Succ(High(Template14FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1980,7 +1980,7 @@ FillPointsCount: Succ(High(Template15FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -1991,7 +1991,7 @@ FillPointsCount: Succ(High(Template16FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -2002,7 +2002,7 @@ FillPointsCount: Succ(High(Template17FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 2848; + TemplateHeight: 1424; TemplateWidth: 3072; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 18; @@ -2013,7 +2013,7 @@ FillPointsCount: Succ(High(Template18FPoints)); BezierizeCount: 3; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2024,7 +2024,7 @@ FillPointsCount: Succ(High(Template19FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2035,7 +2035,7 @@ FillPointsCount: Succ(High(Template20FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2046,7 +2046,7 @@ FillPointsCount: Succ(High(Template21FPoints)); BezierizeCount: 3; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2057,7 +2057,7 @@ FillPointsCount: Succ(High(Template22FPoints)); BezierizeCount: 3; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2068,7 +2068,7 @@ FillPointsCount: Succ(High(Template23FPoints)); BezierizeCount: 2; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2079,7 +2079,7 @@ FillPointsCount: Succ(High(Template24FPoints)); BezierizeCount: 2; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2090,7 +2090,7 @@ FillPointsCount: Succ(High(Template25FPoints)); BezierizeCount: 4; RandPassesCount: 4; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2101,7 +2101,7 @@ FillPointsCount: Succ(High(Template26FPoints)); BezierizeCount: 2; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2112,7 +2112,7 @@ FillPointsCount: Succ(High(Template27FPoints)); BezierizeCount: 1; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2123,7 +2123,7 @@ FillPointsCount: Succ(High(Template28FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2134,7 +2134,7 @@ FillPointsCount: Succ(High(Template29FPoints)); BezierizeCount: 1; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2145,7 +2145,7 @@ FillPointsCount: Succ(High(Template30FPoints)); BezierizeCount: 3; RandPassesCount: 8; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2156,7 +2156,7 @@ FillPointsCount: Succ(High(Template31FPoints)); BezierizeCount: 3; RandPassesCount: 5; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2167,7 +2167,7 @@ FillPointsCount: Succ(High(Template32FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2178,7 +2178,7 @@ FillPointsCount: Succ(High(Template33FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2189,7 +2189,7 @@ FillPointsCount: Succ(High(Template34FPoints)); BezierizeCount: 2; RandPassesCount: 6; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; @@ -2200,7 +2200,7 @@ FillPointsCount: Succ(High(Template35FPoints)); BezierizeCount: 3; RandPassesCount: 7; - TemplateHeight: 1424; TemplateWidth: 3900; + TemplateHeight: 1424; TemplateWidth: 4096; canMirror: true; canFlip: false; isNegative: false; canInvert: false; hasGirders: true; MaxHedgeHogs: 36; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLandTexture.pas --- a/hedgewars/uLandTexture.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLandTexture.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uLocale.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uMisc.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,8 +38,7 @@ implementation uses SysUtils, uVariables, uUtils - {$IFDEF PNG_SCREENSHOTS}, PNGh, png {$ENDIF} - {$IFNDEF USE_SDLTHREADS} {$IFDEF UNIX}, cthreads{$ENDIF} {$ENDIF}; + {$IFDEF PNG_SCREENSHOTS}, PNGh, png {$ENDIF}; type PScreenshot = ^TScreenshot; TScreenshot = record @@ -64,7 +63,7 @@ {$IFDEF PNG_SCREENSHOTS} // this funtion will be executed in separate thread -function SaveScreenshot(screenshot: pointer): PtrInt; +function SaveScreenshot(screenshot: pointer): LongInt; cdecl; export; var i: LongInt; png_ptr: ^png_struct; info_ptr: ^png_info; @@ -119,7 +118,7 @@ {$ELSE} // no PNG_SCREENSHOTS // this funtion will be executed in separate thread -function SaveScreenshot(screenshot: pointer): PtrInt; +function SaveScreenshot(screenshot: pointer): LongInt; cdecl; export; var f: file; // Windows Bitmap Header head: array[0..53] of Byte = ( @@ -262,11 +261,7 @@ image^.size:= size; image^.buffer:= p; -{$IFDEF USE_SDLTHREADS} -SDL_CreateThread(@SaveScreenshot{$IFDEF SDL13}, nil{$ENDIF}, image); -{$ELSE} -BeginThread(@SaveScreenshot, image); -{$ENDIF} +SDL_CreateThread(@SaveScreenshot{$IFDEF SDL13}, 'snapshot'{$ENDIF}, image); MakeScreenshot:= true; // possibly it is not true but we will not wait for thread to terminate end; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uPhysFSLayer.pas Thu Jun 13 22:27:23 2013 +0200 @@ -3,24 +3,12 @@ interface uses SDLh, LuaPas; -const PhysfsLibName = {$IFDEF PHYSFS_INTERNAL}'libhw_physfs'{$ELSE}'libphysfs'{$ENDIF}; +const PhysfsLibName = {$IFDEF PHYSFS_INTERNAL}'libhwphysfs'{$ELSE}'libphysfs'{$ENDIF}; const PhyslayerLibName = 'libphyslayer'; {$IFNDEF WIN32} {$linklib physfs} {$linklib physlayer} - - {statically linking physfs brings IOKit dependency on OSX and - stdc++ under linux 32 bit because divdi3 is not defined} - {$IFDEF PHYSFS_INTERNAL} - {$IFDEF DARWIN} - {$linkframework IOKit} - {$ELSE} - {$IFDEF CPU32} - {$linklib stdc++} - {$ENDIF} - {$ENDIF} - {$ENDIF} {$ENDIF} procedure initModule; @@ -43,6 +31,7 @@ function physfsReader(L: Plua_State; f: PFSFile; sz: Psize_t) : PChar; cdecl; external PhyslayerLibName; procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhyslayerLibName; +procedure hedgewarsMountPackage(filename: PChar); cdecl; external PhyslayerLibName; implementation uses uUtils, uVariables, sysutils; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uRandom.pas --- a/hedgewars/uRandom.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uRandom.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ interface uses uFloat; -procedure SetRandomSeed(Seed: shortstring); // Sets the seed that should be used for generating pseudo-random values. +procedure SetRandomSeed(Seed: shortstring; dropAdditionalPart: boolean); // Sets the seed that should be used for generating pseudo-random values. function GetRandomf: hwFloat; overload; // Returns a pseudo-random hwFloat. function GetRandom(m: LongWord): LongWord; overload; inline; // Returns a positive pseudo-random integer smaller than m. procedure AddRandomness(r: LongWord); inline; @@ -59,18 +59,24 @@ GetNext:= cirbuf[n] end; -procedure SetRandomSeed(Seed: shortstring); -var i: Longword; +procedure SetRandomSeed(Seed: shortstring; dropAdditionalPart: boolean); +var i, t, l: Longword; begin n:= 54; if Length(Seed) > 54 then Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf -for i:= 0 to Pred(Length(Seed)) do - cirbuf[i]:= byte(Seed[i + 1]); +t:= 0; +l:= Length(Seed); -for i:= Length(Seed) to 54 do +while (t < l) and ((not dropAdditionalPart) or (Seed[t + 1] <> '|')) do + begin + cirbuf[t]:= byte(Seed[t + 1]); + inc(t) + end; + +for i:= t to 54 do cirbuf[i]:= $A98765 + 68; // odd number for i:= 0 to 1023 do diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uRender.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uRenderUtils.pas --- a/hedgewars/uRenderUtils.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uRenderUtils.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uScript.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,6 +54,7 @@ implementation {$IFDEF USE_LUA_SCRIPT} + uses LuaPas, uConsole, uConsts, @@ -83,7 +84,8 @@ SDLh, SysUtils, uIO, - uPhysFSLayer + uPhysFSLayer, + typinfo ; var luaState : Plua_State; @@ -1285,6 +1287,64 @@ lc_endgame:= 0 end; +function lc_sendstat(L : Plua_State) : LongInt; Cdecl; +var statInfo : TStatInfoType; +var i : LongInt; +var color : shortstring; +begin + statInfo := TStatInfoType(GetEnumValue(TypeInfo(TStatInfoType),lua_tostring(L, 1))); + if (lua_gettop(L) <> 2) and ((statInfo <> siPlayerKills) + and (statInfo <> siClanHealth)) then + begin + LuaError('Lua: Wrong number of parameters passed to SendStat! Expected 2 parameters.'); + end + else if (lua_gettop(L) <> 3) and ((statInfo = siPlayerKills) + or (statInfo = siClanHealth)) then + begin + LuaError('Lua: Wrong number of parameters passed to SendStat! Expected 3 parameters.'); + end + else + begin + if ((statInfo = siPlayerKills) or (statInfo = siClanHealth)) then + begin + // 3: team name + for i:= 0 to Pred(TeamsCount) do + begin + with TeamsArray[i]^ do + begin + if TeamName = lua_tostring(L, 3) then + begin + color := uUtils.IntToStr(Clan^.Color); + Break; + end + end + end; + if (statInfo = siPlayerKills) then + begin + SendStat(siPlayerKills, color + ' ' + + lua_tostring(L, 2) + ' ' + TeamsArray[i]^.TeamName); + end + else if (statInfo = siClanHealth) then + begin + SendStat(siClanHealth, color + ' ' + + lua_tostring(L, 2)); + end + end + else + begin + SendStat(statInfo,lua_tostring(L, 2)); + end; + end; + lc_sendstat:= 0 +end; + +function lc_sendhealthstatsoff(L : Plua_State) : LongInt; Cdecl; +begin + L:= L; // avoid compiler hint + uStats.SendHealthStatsOn := false; + lc_sendhealthstatsoff:= 0 +end; + function lc_findplace(L : Plua_State) : LongInt; Cdecl; var gear: PGear; fall: boolean; @@ -2039,7 +2099,8 @@ // call the script file lua_pcall(luaState, 0, 0, 0); ScriptLoaded:= true - end + end; + hedgewarsMountPackage(Str2PChar(copy(s, 1, length(s)-4)+'.hwp')); end; procedure SetGlobals; @@ -2261,6 +2322,7 @@ ScriptSetInteger('gfMultiWeapon', gfMultiWeapon); ScriptSetInteger('gfSolidLand', gfSolidLand); ScriptSetInteger('gfBorder', gfBorder); +ScriptSetInteger('gfBottomBorder', gfBottomBorder); ScriptSetInteger('gfDivideTeams', gfDivideTeams); ScriptSetInteger('gfLowGravity', gfLowGravity); ScriptSetInteger('gfLaserSight', gfLaserSight); @@ -2380,6 +2442,8 @@ lua_register(luaState, _P'WriteLnToConsole', @lc_writelntoconsole); lua_register(luaState, _P'GetGearType', @lc_getgeartype); lua_register(luaState, _P'EndGame', @lc_endgame); +lua_register(luaState, _P'SendStat', @lc_sendstat); +lua_register(luaState, _P'SendHealthStatsOff', @lc_sendhealthstatsoff); lua_register(luaState, _P'FindPlace', @lc_findplace); lua_register(luaState, _P'SetGearPosition', @lc_setgearposition); lua_register(luaState, _P'GetGearPosition', @lc_getgearposition); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uSinTable.pas --- a/hedgewars/uSinTable.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uSinTable.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uSound.pas --- a/hedgewars/uSound.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uSound.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -155,7 +155,7 @@ (FileName: 'Yessir.ogg'; Path: ptVoices),// sndYesSir (FileName: 'Laugh.ogg'; Path: ptVoices),// sndLaugh (FileName: 'Illgetyou.ogg'; Path: ptVoices),// sndIllGetYou - (FileName: 'JustYouWait.ogg'; Path: ptVoices),// sndJustYouWait + (FileName: 'Justyouwait.ogg'; Path: ptVoices),// sndJustyouwait (FileName: 'Incoming.ogg'; Path: ptVoices),// sndIncoming (FileName: 'Missed.ogg'; Path: ptVoices),// sndMissed (FileName: 'Stupid.ogg'; Path: ptVoices),// sndStupid @@ -248,7 +248,10 @@ (FileName: 'bump.ogg'; Path: ptSounds),// sndBump (FileName: 'hogchant3.ogg'; Path: ptSounds),// sndResurrector (FileName: 'plane.ogg'; Path: ptSounds),// sndPlane - (FileName: 'TARDIS.ogg'; Path: ptSounds) // sndTardis + (FileName: 'TARDIS.ogg'; Path: ptSounds),// sndTardis + (FileName: 'frozen_hog_impact.ogg'; Path: ptSounds),// sndFrozenHogImpact + (FileName: 'ice_beam.ogg'; Path: ptSounds),// sndIceBeam + (FileName: 'hog_freeze.ogg'; Path: ptSounds) // sndHogFreeze ); diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uStats.pas --- a/hedgewars/uStats.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uStats.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,8 @@ var TotalRounds: LongInt; FinishedTurnsTotal: LongInt; - + SendHealthStatsOn : boolean = true; + procedure initModule; procedure freeModule; @@ -162,12 +163,13 @@ StepDamageRecv:= 0; StepDamageGiven:= 0 end; - -for t:= 0 to Pred(ClansCount) do - with ClansArray[t]^ do - begin - SendStat(siClanHealth, IntToStr(Color) + ' ' + IntToStr(ClanHealth)); - end; + +if SendHealthStatsOn then + for t:= 0 to Pred(ClansCount) do + with ClansArray[t]^ do + begin + SendStat(siClanHealth, IntToStr(Color) + ' ' + IntToStr(ClanHealth)); + end; Kills:= 0; KillsClan:= 0; @@ -207,103 +209,104 @@ maxTeamDamageName : shortstring; winnersClan : PClan; begin -msd:= 0; msdhh:= nil; -msk:= 0; mskhh:= nil; -mskcnt:= 0; -maxTeamKills := 0; -maxTurnSkips := 0; -maxTeamDamage := 0; -winnersClan:= nil; +if SendHealthStatsOn then + msd:= 0; msdhh:= nil; + msk:= 0; mskhh:= nil; + mskcnt:= 0; + maxTeamKills := 0; + maxTurnSkips := 0; + maxTeamDamage := 0; + winnersClan:= nil; -for t:= 0 to Pred(TeamsCount) do - with TeamsArray[t]^ do - begin - if not ExtDriven then - SendStat(siTeamStats, GetTeamStatString(TeamsArray[t])); - for i:= 0 to cMaxHHIndex do - begin - if Hedgehogs[i].stats.MaxStepDamageGiven > msd then - begin - msdhh:= @Hedgehogs[i]; - msd:= Hedgehogs[i].stats.MaxStepDamageGiven - end; - if Hedgehogs[i].stats.MaxStepKills >= msk then - if Hedgehogs[i].stats.MaxStepKills = msk then - inc(mskcnt) - else - begin - mskcnt:= 1; - mskhh:= @Hedgehogs[i]; - msk:= Hedgehogs[i].stats.MaxStepKills - end; - end; + for t:= 0 to Pred(TeamsCount) do + with TeamsArray[t]^ do + begin + if not ExtDriven then + SendStat(siTeamStats, GetTeamStatString(TeamsArray[t])); + for i:= 0 to cMaxHHIndex do + begin + if Hedgehogs[i].stats.MaxStepDamageGiven > msd then + begin + msdhh:= @Hedgehogs[i]; + msd:= Hedgehogs[i].stats.MaxStepDamageGiven + end; + if Hedgehogs[i].stats.MaxStepKills >= msk then + if Hedgehogs[i].stats.MaxStepKills = msk then + inc(mskcnt) + else + begin + mskcnt:= 1; + mskhh:= @Hedgehogs[i]; + msk:= Hedgehogs[i].stats.MaxStepKills + end; + end; - { send player stats for winner teams } - if Clan^.ClanHealth > 0 then - begin - winnersClan:= Clan; - SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' + - IntToStr(stats.Kills) + ' ' + TeamName); - end; + { send player stats for winner teams } + if Clan^.ClanHealth > 0 then + begin + winnersClan:= Clan; + SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' + + IntToStr(stats.Kills) + ' ' + TeamName); + end; - { determine maximum values of TeamKills, TurnSkips, TeamDamage } - if stats.TeamKills > maxTeamKills then - begin - maxTeamKills := stats.TeamKills; - maxTeamKillsName := TeamName; - end; - if stats.TurnSkips > maxTurnSkips then - begin - maxTurnSkips := stats.TurnSkips; - maxTurnSkipsName := TeamName; - end; - if stats.TeamDamage > maxTeamDamage then - begin - maxTeamDamage := stats.TeamDamage; - maxTeamDamageName := TeamName; - end; + { determine maximum values of TeamKills, TurnSkips, TeamDamage } + if stats.TeamKills > maxTeamKills then + begin + maxTeamKills := stats.TeamKills; + maxTeamKillsName := TeamName; + end; + if stats.TurnSkips > maxTurnSkips then + begin + maxTurnSkips := stats.TurnSkips; + maxTurnSkipsName := TeamName; + end; + if stats.TeamDamage > maxTeamDamage then + begin + maxTeamDamage := stats.TeamDamage; + maxTeamDamageName := TeamName; + end; - end; + end; -{ now send player stats for loser teams } -for t:= 0 to Pred(TeamsCount) do - begin - with TeamsArray[t]^ do - begin - if Clan^.ClanHealth = 0 then - begin - SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' + - IntToStr(stats.Kills) + ' ' + TeamName); - end; - end; -end; + { now send player stats for loser teams } + for t:= 0 to Pred(TeamsCount) do + begin + with TeamsArray[t]^ do + begin + if Clan^.ClanHealth = 0 then + begin + SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' + + IntToStr(stats.Kills) + ' ' + TeamName); + end; + end; + end; -if msdhh <> nil then - SendStat(siMaxStepDamage, IntToStr(msd) + ' ' + msdhh^.Name + ' (' + msdhh^.Team^.TeamName + ')'); -if mskcnt = 1 then - SendStat(siMaxStepKills, IntToStr(msk) + ' ' + mskhh^.Name + ' (' + mskhh^.Team^.TeamName + ')'); + if msdhh <> nil then + SendStat(siMaxStepDamage, IntToStr(msd) + ' ' + msdhh^.Name + ' (' + msdhh^.Team^.TeamName + ')'); + if mskcnt = 1 then + SendStat(siMaxStepKills, IntToStr(msk) + ' ' + mskhh^.Name + ' (' + mskhh^.Team^.TeamName + ')'); -if maxTeamKills > 1 then - SendStat(siMaxTeamKills, IntToStr(maxTeamKills) + ' ' + maxTeamKillsName); -if maxTurnSkips > 2 then - SendStat(siMaxTurnSkips, IntToStr(maxTurnSkips) + ' ' + maxTurnSkipsName); -if maxTeamDamage > 30 then - SendStat(siMaxTeamDamage, IntToStr(maxTeamDamage) + ' ' + maxTeamDamageName); + if maxTeamKills > 1 then + SendStat(siMaxTeamKills, IntToStr(maxTeamKills) + ' ' + maxTeamKillsName); + if maxTurnSkips > 2 then + SendStat(siMaxTurnSkips, IntToStr(maxTurnSkips) + ' ' + maxTurnSkipsName); + if maxTeamDamage > 30 then + SendStat(siMaxTeamDamage, IntToStr(maxTeamDamage) + ' ' + maxTeamDamageName); -if KilledHHs > 0 then - SendStat(siKilledHHs, IntToStr(KilledHHs)); + if KilledHHs > 0 then + SendStat(siKilledHHs, IntToStr(KilledHHs)); -// now to console -if winnersClan <> nil then - begin - WriteLnToConsole('WINNERS'); - for t:= 0 to winnersClan^.TeamsNumber - 1 do - WriteLnToConsole(winnersClan^.Teams[t]^.TeamName); - end -else - WriteLnToConsole('DRAW'); + // now to console + if winnersClan <> nil then + begin + WriteLnToConsole('WINNERS'); + for t:= 0 to winnersClan^.TeamsNumber - 1 do + WriteLnToConsole(winnersClan^.Teams[t]^.TeamName); + end + else + WriteLnToConsole('DRAW'); -WriteLnToConsole(''); + WriteLnToConsole(''); end; procedure initModule; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uStore.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ unit uStore; interface -uses {$IFNDEF PAS2C} StrUtils, {$ENDIF}SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat; +uses StrUtils, SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat; procedure initModule; procedure freeModule; @@ -575,19 +575,19 @@ tmpsurf:= IMG_Load_RW(rwopsOpenRead(s), true); if tmpsurf = nil then - begin + begin OutError(msgFailed, (imageFlags and ifCritical) <> 0); exit; - end; + end; if ((imageFlags and ifIgnoreCaps) = 0) and ((tmpsurf^.w > MaxTextureSize) or (tmpsurf^.h > MaxTextureSize)) then - begin + begin SDL_FreeSurface(tmpsurf); OutError(msgFailedSize, ((not cOnlyStats) and ((imageFlags and ifCritical) <> 0))); // dummy surface to replace non-critical textures that failed to load due to their size LoadImage:= SDL_CreateRGBSurface(SDL_SWSURFACE, 2, 2, 32, RMask, GMask, BMask, AMask); exit; - end; + end; tmpsurf:= doSurfaceConversion(tmpsurf); @@ -765,7 +765,7 @@ AddFileLog(' |----- Number of auxiliary buffers: ' + inttostr(AuxBufNum)); {$ENDIF} AddFileLog(' \----- Extensions: '); -{$IFNDEF PAS2C} + // fetch extentions and store them in string tmpstr := StrPas(PChar(glGetString(GL_EXTENSIONS))); tmpn := WordCount(tmpstr, [' ']); @@ -783,10 +783,6 @@ tmpint := tmpint + 3; end; until (tmpint > tmpn); -{$ELSE} - // doesn't seem to print >256 chars - AddFileLogRaw(PChar(glGetString(GL_EXTENSIONS))); -{$ENDIF} AddFileLog(''); defaultFrame:= 0; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uTeams.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,7 +98,7 @@ if (Gear <> nil) then Gear^.State:= gstWinner; if Flawless then - AddVoice(sndFlawless, Teams[0]^.voicepack) + AddVoice(sndFlawless, Teams[0]^.voicepack) else AddVoice(sndVictory, Teams[0]^.voicepack); @@ -112,7 +112,7 @@ end; procedure SwitchHedgehog; -var c, i, j: LongWord; +var c, i, t: LongWord; PrevHH, PrevTeam : LongWord; begin TargetPoint.X:= NoPointX; @@ -175,15 +175,7 @@ if c = ClansCount then begin if not PlacingHogs then - begin inc(TotalRounds); - for i:= 0 to Pred(TeamsCount) do - with TeamsArray[i]^ do - for j:= 0 to Pred(HedgehogsNumber) do - with Hedgehogs[j] do - if Effects[heFrozen] > 255 then - Effects[heFrozen]:= max(255,Effects[heFrozen]-50000) - end; c:= 0 end; @@ -198,11 +190,26 @@ PrevHH:= CurrHedgehog mod HedgehogsNumber; // prevent infinite loop when CurrHedgehog = 7, but HedgehogsNumber < 8 (team is destroyed before its first turn) repeat CurrHedgehog:= Succ(CurrHedgehog) mod HedgehogsNumber; - until ((Hedgehogs[CurrHedgehog].Gear <> nil) and (Hedgehogs[CurrHedgehog].Effects[heFrozen] = 0)) or (CurrHedgehog = PrevHH) + until ((Hedgehogs[CurrHedgehog].Gear <> nil) and (Hedgehogs[CurrHedgehog].Effects[heFrozen] < 256)) or (CurrHedgehog = PrevHH) end - until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (PrevTeam = CurrTeam) or ((CurrTeam = TagTeamIndex) and ((GameFlags and gfTagTeam) <> 0)); - end -until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] = 0); + until ((CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] < 256)) or (PrevTeam = CurrTeam) or ((CurrTeam = TagTeamIndex) and ((GameFlags and gfTagTeam) <> 0)) + end; + if (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear = nil) or (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] > 255) then + begin + with CurrentTeam^.Clan^ do + for t:= 0 to Pred(TeamsNumber) do + with Teams[t]^ do + for i:= 0 to Pred(HedgehogsNumber) do + with Hedgehogs[i] do + begin + if Effects[heFrozen] > 255 then Effects[heFrozen]:= max(255,Effects[heFrozen]-50000); + if (Gear <> nil) and (Effects[heFrozen] < 256) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] > 255) then + CurrHedgehog:= i + end; + if (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear = nil) or (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] > 255) then + inc(CurrentTeam^.Clan^.TurnNumber); + end +until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen] < 256); SwitchCurrentHedgehog(@(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog])); {$IFDEF USE_TOUCH_INTERFACE} @@ -249,6 +256,13 @@ end; inc(CurrentTeam^.Clan^.TurnNumber); +with CurrentTeam^.Clan^ do + for t:= 0 to Pred(TeamsNumber) do + with Teams[t]^ do + for i:= 0 to Pred(HedgehogsNumber) do + with Hedgehogs[i] do + if Effects[heFrozen] > 255 then + Effects[heFrozen]:= max(255,Effects[heFrozen]-50000); CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^); if CurWeapon^.Count = 0 then diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uTextures.pas --- a/hedgewars/uTextures.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uTextures.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uTypes.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -140,7 +140,8 @@ sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater, sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8, sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack, - sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis); + sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis, sndFrozenHogImpact, sndIceBeam, sndHogFreeze + ); // Available ammo types to be used by hedgehogs TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6 @@ -163,7 +164,8 @@ TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs, siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage, - siMaxTeamKills, siMaxTurnSkips ); + siMaxTeamKills, siMaxTurnSkips, siCustomAchievement, siGraphTitle, + siPointType); // Various "emote" animations a hedgehog can do TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle); @@ -220,48 +222,56 @@ PClan = ^TClan; TGearStepProcedure = procedure (Gear: PGear); +// So, you're here looking for variables you can (ab)use to store some gear state? +// Not all members of this structure are created equal. Comments below are my take on what can be used for what in the gear structure. TGear = record - NextGear, PrevGear: PGear; - Active: Boolean; - AdvBounce: Longword; - Invulnerable: Boolean; - RenderTimer: Boolean; - AmmoType : TAmmoType; - State : Longword; - X : hwFloat; +// Don't ever override these. + NextGear, PrevGear: PGear; // Linked list + Z: Longword; // Z index. For rendering. Sets order in list + Active: Boolean; // Is gear Active (running step code) + Kind: TGearType; + doStep: TGearStepProcedure; // Code the gear is running + AmmoType : TAmmoType; // Ammo type associated with this kind of gear + RenderTimer: Boolean; // Will visually display Timer if true + Target : TPoint; // Gear target. Will render in uGearsRender unless a special case is added + AIHints: LongWord; // hints for ai. + LastDamage: PHedgehog; // Used to track damage source for stats + CollisionIndex: LongInt; // Position in collision array + Message: LongWord; // Game messages are stored here. See gm bitmasks in uConsts + uid: Longword; // Lua use this to reference gears +// Strongly recommended not to override these. Will mess up generic operations like portaling + X : hwFloat; // X/Y/dX/dY are position/velocity. People count on these having semi-normal values Y : hwFloat; dX: hwFloat; dY: hwFloat; - Target : TPoint; - Kind: TGearType; - Pos: Longword; - doStep: TGearStepProcedure; - Radius: LongInt; - Angle, Power : Longword; - DirAngle: real; - Timer : LongWord; + State : Longword; // See gst bitmask values in uConsts + PortalCounter: LongWord; // Necessary to interrupt portal loops. Not possible to avoid infinite loops without it. +// Don't use these if you're using generic movement like doStepFallingGear and explosion shoves. Generally recommended not to use. + Radius: LongInt; // Radius. If not using uCollisions, is usually used to indicate area of effect + CollisionMask: Word; // Masking off Land impact FF7F for example ignores current hog and crates + AdvBounce: Longword; // Triggers 45° bounces. Is a counter to avoid edge cases Elasticity: hwFloat; Friction : hwFloat; - Density : hwFloat; - Message, MsgParam : Longword; - Hedgehog: PHedgehog; + Density : hwFloat; // Density is kind of a mix of size and density. Impacts distance thrown, wind. + ImpactSound: TSound; // first sound, others have to be after it in the sounds def. + nImpactSounds: Word; // count of ImpactSounds. +// Don't use these if you want to take damage normally, otherwise health/damage are commonly used for other purposes + Invulnerable: Boolean; Health, Damage, Karma: LongInt; - CollisionIndex: LongInt; - Tag: LongInt; - Tex: PTexture; - Z: Longword; - CollisionMask: Word; - LinkedGear: PGear; - FlightTime: Longword; - uid: Longword; - ImpactSound: TSound; // first sound, others have to be after it in the sounds def. - nImpactSounds: Word; // count of ImpactSounds - SoundChannel: LongInt; - PortalCounter: LongWord; // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion. - AIHints: LongWord; // hints for ai. haha ^^^^^^ temporary, sure - IceTime: Longint; //time of ice beam with object some interaction temporary - IceState: Longint; //state of ice gun temporary - LastDamage: PHedgehog; +// DirAngle is a "real" - if you don't need it for rotation of sprite in uGearsRender, you can use it for any visual-only value + DirAngle: real; +// These are frequently overridden to serve some other purpose + Pos: Longword; // Commonly overridden. Example use is posCase values in uConsts. + Angle, Power : Longword; // Used for hog aiming/firing. Angle is rarely used as an Angle otherwise. + Timer : LongWord; // Typically used for some sort of gear timer. Time to explosion, remaining fuel... + Tag: LongInt; // Quite generic. Variety of uses. + FlightTime: Longword; // Initially added for batting of hogs to determine homerun. Used for some firing delays + MsgParam: LongWord; // Initially stored a set of messages. So usually gm values like Message. Frequently overriden +// These are not used generically, but should probably be used for purpose intended. Definitely shouldn't override pointer type + Tex: PTexture; // A texture created by the gear. Shouldn't use for anything but textures + LinkedGear: PGear; // Used to track a related gear. Portal pairs for example. + Hedgehog: PHedgehog; // set to CurrentHedgehog on gear creation + SoundChannel: LongInt; // Used to track a sound the gear started end; TPGearArray = array of PGear; PGearArrayS = record @@ -429,7 +439,7 @@ TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused, sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync, - sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, + sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce, sidMute); @@ -440,8 +450,8 @@ TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable, gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, - gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, - gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, + gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, + gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam); TLandArray = packed array of array of LongWord; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uUtils.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,14 +27,12 @@ procedure SplitByChar(var a, b: shortstring; c: char); procedure SplitByChar(var a, b: ansistring; c: char); -{$IFNDEF PAS2C} function EnumToStr(const en : TGearType) : shortstring; overload; function EnumToStr(const en : TVisualGearType) : shortstring; overload; function EnumToStr(const en : TSound) : shortstring; overload; function EnumToStr(const en : TAmmoType) : shortstring; overload; function EnumToStr(const en : THogEffect) : shortstring; overload; function EnumToStr(const en : TCapGroup) : shortstring; overload; -{$ENDIF} function Min(a, b: LongInt): LongInt; inline; function Max(a, b: LongInt): LongInt; inline; @@ -68,10 +66,8 @@ function GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt; function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt; -{$IFNDEF PAS2C} procedure Write(var f: textfile; s: shortstring); procedure WriteLn(var f: textfile; s: shortstring); -{$ENDIF} function isPhone: Boolean; inline; function getScreenDPI: Double; inline; //cdecl; external; @@ -92,7 +88,7 @@ implementation -uses {$IFNDEF PAS2C}typinfo, {$ENDIF}Math, uConsts, uVariables, SysUtils; +uses typinfo, Math, uConsts, uVariables, SysUtils; {$IFDEF DEBUGFILE} var f: textfile; @@ -135,11 +131,11 @@ end else b:= ''; end; -{$IFNDEF PAS2C} function EnumToStr(const en : TGearType) : shortstring; overload; begin EnumToStr:= GetEnumName(TypeInfo(TGearType), ord(en)) end; + function EnumToStr(const en : TVisualGearType) : shortstring; overload; begin EnumToStr:= GetEnumName(TypeInfo(TVisualGearType), ord(en)) @@ -164,7 +160,7 @@ begin EnumToStr := GetEnumName(TypeInfo(TCapGroup), ord(en)) end; -{$ENDIF} + function Min(a, b: LongInt): LongInt; begin @@ -407,7 +403,6 @@ CheckNoTeamOrHH:= (CurrentTeam = nil) or (CurrentHedgehog^.Gear = nil); end; -{$IFNDEF PAS2C} procedure Write(var f: textfile; s: shortstring); begin system.write(f, s) @@ -417,7 +412,7 @@ begin system.writeln(f, s) end; -{$ENDIF} + // this function is just to determine whether we are running on a limited screen device function isPhone: Boolean; inline; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uVariables.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1765,7 +1765,6 @@ Ammo: (Propz: ammoprop_NoRoundEnd or ammoprop_ForwMsgs or ammoprop_AttackInMove or - ammoprop_NoCrosshair or ammoprop_DontHold or ammoprop_Utility or ammoprop_NeedUpDown or @@ -2100,7 +2099,7 @@ TimeAfterTurn: 3000; minAngle: 0; maxAngle: 0; - isDamaging: true; + isDamaging: false; SkipTurns: 0; PosCount: 1; PosSprite: sprWater; @@ -2177,7 +2176,7 @@ AmmoType: amLandGun; AttackVoice: sndNone; Bounciness: 1000); - Slot: 2; + Slot: 6; TimeAfterTurn: 0; minAngle: 0; maxAngle: 0; @@ -2202,11 +2201,11 @@ AmmoType: amIceGun; AttackVoice: sndNone; Bounciness: 1000); - Slot: 9; + Slot: 2; TimeAfterTurn: 0; minAngle: 0; maxAngle: 0; - isDamaging: true; + isDamaging: false; SkipTurns: 0; PosCount: 1; PosSprite: sprWater; diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uVideoRec.pas --- a/hedgewars/uVideoRec.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uVideoRec.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,9 +28,6 @@ {$ELSE} {$IFNDEF WIN32} - {$linklib avcodec} - {$linklib avformat} - {$linklib avutil} {$linklib avwrapper} {$ENDIF} diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uVisualGears.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 11438c0bd46b -r bce8cf41d666 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Tue Apr 30 01:47:30 2013 +0200 +++ b/hedgewars/uWorld.pas Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ (* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -74,7 +74,7 @@ timeTexture: PTexture; FPS: Longword; CountTicks: Longword; - prevPoint, prevTargetPoint: TPoint; + prevPoint{, prevTargetPoint}: TPoint; amSel: TAmmoType = amNothing; missionTex: PTexture; missionTimer: LongInt; @@ -221,8 +221,8 @@ uCursor.init(); prevPoint.X:= 0; prevPoint.Y:= cScreenHeight div 2; -prevTargetPoint.X:= 0; -prevTargetPoint.Y:= 0; +//prevTargetPoint.X:= 0; +//prevTargetPoint.Y:= 0; WorldDx:= -(LAND_WIDTH div 2) + cScreenWidth div 2; WorldDy:= -(LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2); @@ -642,7 +642,7 @@ AMShiftX:= AMShiftTargetX; AMShiftY:= AMShiftTargetY; prevPoint:= CursorPoint; - prevTargetPoint:= TargetCursorPoint; + //prevTargetPoint:= TargetCursorPoint; AMState:= AMHidden; end; end; @@ -1320,7 +1320,7 @@ // draw health bars right border inc(r.x, cTeamHealthWidth + 2); r.w:= 3; - DrawTextureFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); + DrawTextureFromRect(TeamHealthBarWidth + 15, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); if not highlight and (not hasGone) then for i:= 0 to cMaxHHIndex do @@ -1357,7 +1357,7 @@ // draw health bar r.w:= TeamHealthBarWidth + 1; r.h:= HealthTex^.h - 4; - DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex); + DrawTextureFromRect(15, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex); if not hasGone and (TeamHealth > 1) then begin Tint(Clan^.Color shl 8 or $FF); diff -r 11438c0bd46b -r bce8cf41d666 misc/hedgewars.desktop --- a/misc/hedgewars.desktop Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -[Desktop Entry] -Type=Application -Version=1.0 -Encoding=UTF-8 -Name=Hedgewars -GenericName=Fighting Hedgehogs -GenericName[de]=Kämpfende Igel -GenericName[es]=Batallas entre erizos -GenericName[fr]=Bataille de hérissons -GenericName[ko]=고슴도치 싸우기 -GenericName[ja]=ファイチングハリネズミ -GenericName[it]=Ricci combattenti -GenericName[pl]=Walczące jeże -GenericName[pt]=Batalhas entre ouriços -GenericName[ru]=Битвы ежей -GenericName[sk]=Bojujúci ježkovia -GenericName[cs]=Bojující ježci -GenericName[sv]=Stridande igelkottar -Icon=hedgewars.png -Exec=hedgewars -Terminal=false -StartupNotify=false -Categories=Application;Game;StrategyGame; diff -r 11438c0bd46b -r bce8cf41d666 misc/liblua/CMakeLists.txt --- a/misc/liblua/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/liblua/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -4,17 +4,23 @@ if(WIN32) add_definitions(-DLUA_BUILD_AS_DLL) - add_library(lua SHARED ${lua_src}) - - set(LUA_LIBRARY lua.dll) - - set_target_properties(lua PROPERTIES PREFIX "") - install(TARGETS lua RUNTIME DESTINATION ${target_library_install_dir}) else(WIN32) add_definitions(-DLUA_USE_LINUX) - add_library(lua STATIC ${lua_src}) - set(LUA_LIBRARY lua) + add_definitions(-fvisibility=default) #TODO: fixme endif(WIN32) +add_library(lua ${lua_src}) + +set_target_properties(lua PROPERTIES + VERSION "5.1.4" + SOVERSION 1 + OUTPUT_NAME ${lua_output_name}) +install(TARGETS lua RUNTIME DESTINATION ${target_binary_install_dir} + LIBRARY DESTINATION ${target_library_install_dir} + ARCHIVE DESTINATION ${target_library_install_dir}) +get_target_property(lua_fullpath lua LOCATION) + +set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Lua include dir" FORCE) +set(LUA_LIBRARY ${lua_fullpath} CACHE STRING "Lua library" FORCE) diff -r 11438c0bd46b -r bce8cf41d666 misc/libphysfs/CMakeLists.txt --- a/misc/libphysfs/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/libphysfs/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -39,42 +39,21 @@ # Fallback to older OS X on PowerPC to support wider range of systems... if(CMAKE_OSX_ARCHITECTURES MATCHES ppc) add_definitions(-DMAC_OS_X_VERSION_MIN_REQUIRED=1020) - set(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -mmacosx-version-min=10.2") + list(APPEND OTHER_LDFLAGS "-mmacosx-version-min=10.2") endif(CMAKE_OSX_ARCHITECTURES MATCHES ppc) # Need these everywhere... add_definitions(-fno-common) + find_library(foundation_framework NAMES Foundation) + list(APPEND OTHER_LDFLAGS ${foundation_framework}) find_library(iokit_framework NAMES IOKit) list(APPEND OTHER_LDFLAGS ${iokit_framework}) endif(MACOSX) # Add some gcc-specific command lines. if(CMAKE_COMPILER_IS_GNUCC) - # Always build with debug symbols...you can strip it later. - add_definitions(-g -pipe -fsigned-char) - - # Stupid BeOS generates warnings in the system headers. - if(NOT BEOS) - add_definitions(-Wall) - endif(NOT BEOS) - - CHECK_C_SOURCE_COMPILES(" - #if ((defined(__GNUC__)) && (__GNUC__ >= 4)) - int main(int argc, char **argv) { int is_gcc4 = 1; return 0; } - #else - #error This is not gcc4. - #endif - " PHYSFS_IS_GCC4) - - if(PHYSFS_IS_GCC4) - # Not supported on several operating systems at this time. - if(NOT SOLARIS AND NOT WINDOWS) - add_definitions(-fvisibility=hidden) - endif(NOT SOLARIS AND NOT WINDOWS) - endif(PHYSFS_IS_GCC4) - - # Don't use -rpath. - set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE) + # Always build with debug symbols... you can strip it later. + add_definitions(-g -fsigned-char) endif(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_C_COMPILER_ID STREQUAL "SunPro") @@ -169,6 +148,7 @@ if(WINDOWS) set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) set(PHYSFS_HAVE_THREAD_SUPPORT TRUE) + list(APPEND OTHER_LDFLAGS ${SDL_LIBRARY}) endif(WINDOWS) if(NOT PHYSFS_HAVE_CDROM_SUPPORT) @@ -241,50 +221,26 @@ #endif(PHYSFS_ARCHIVE_ISO9660) -##as needed by Hedgewars configuration -if(WINDOWS) - option(PHYSFS_BUILD_STATIC "Build static library" FALSE) - option(PHYSFS_BUILD_SHARED "Build shared library" TRUE) - list(APPEND OTHER_LDFLAGS ${SDL_LIBRARY}) -else(WINDOWS) - option(PHYSFS_BUILD_STATIC "Build static library" TRUE) - option(PHYSFS_BUILD_SHARED "Build shared library" FALSE) -endif(WINDOWS) - -if(PHYSFS_BUILD_STATIC) - add_library(physfs STATIC ${PHYSFS_SRCS}) - set_target_properties(physfs PROPERTIES OUTPUT_NAME ${physfs_output_name}) ## - set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX}) ## - set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX}) ## -endif(PHYSFS_BUILD_STATIC) - -if(PHYSFS_BUILD_SHARED) - add_library(physfs SHARED ${PHYSFS_SRCS}) - set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) - set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) - set_target_properties(physfs PROPERTIES OUTPUT_NAME ${physfs_output_name}) ## - target_link_libraries(physfs ${optional_library_libs} ${OTHER_LDFLAGS}) - install(TARGETS physfs RUNTIME DESTINATION ${target_library_install_dir}) ## - set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) ## - set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) ## -endif(PHYSFS_BUILD_SHARED) - -if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) - message(FATAL "Both shared and static libraries are disabled!") -endif(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) - -# CMake FAQ says I need this... -if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) - set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1) -endif(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) +##Hedgewars modifications +add_library(physfs ${PHYSFS_SRCS}) +set_target_properties(physfs PROPERTIES + VERSION ${PHYSFS_VERSION} + SOVERSION ${PHYSFS_SOVERSION} + OUTPUT_NAME ${physfs_output_name}) +target_link_libraries(physfs ${optional_library_libs} ${OTHER_LDFLAGS}) +install(TARGETS physfs RUNTIME DESTINATION ${target_binary_install_dir} + LIBRARY DESTINATION ${target_library_install_dir} + ARCHIVE DESTINATION ${target_library_install_dir}) +get_target_property(physfs_fullpath physfs LOCATION) ## added standard variables emulating the FindPhysFS.cmake ones (FORCE or cmake won't pick 'em) -set(PHYSFS_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphysfs/ CACHE STRING "" FORCE) -set(PHYSFS_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}${physfs_output_name}${lib_suffix} CACHE STRING "" FORCE) +set(PHYSFS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Physfs include dir" FORCE) +set(PHYSFS_LIBRARY ${physfs_fullpath} CACHE STRING "Physfs library path" FORCE) -## removed install, language bindings and test program +## removed language bindings and test program ## simplified configuration output +## merged shared and static library building #message(STATUS "PhysFS will be built with ${PHYSFS_FEATURES} support") diff -r 11438c0bd46b -r bce8cf41d666 misc/libphysfs/physfs_internal.h diff -r 11438c0bd46b -r bce8cf41d666 misc/libphysfs/platform_macosx.c --- a/misc/libphysfs/platform_macosx.c Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/libphysfs/platform_macosx.c Thu Jun 13 22:27:23 2013 +0200 @@ -29,6 +29,50 @@ #include "physfs_internal.h" +#if defined(__APPLE__) +#if defined(TARGET_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 +/* __eprintf shouldn't have been made visible from libstdc++, or anywhere, but + on Mac OS X 10.4 it was defined in libstdc++.6.0.3.dylib; so on that platform + we have to keep defining it to keep binary compatibility. + We can't just put the libgcc version in the export list, because that + doesn't work; once a symbol is marked as hidden, it stays that way. */ + +void __eprintf (const char *string, const char *expression, + unsigned int line, const char *filename) +{ + fprintf(stderr, string, expression, line, filename); + fflush(stderr); + abort(); +} + + +/* apparently libssp is missing from 10.4 SDK + code from http://wiki.osdev.org/GCC_Stack_Smashing_Protector */ +void * __stack_chk_guard = NULL; + +void __stack_chk_guard_setup() +{ + unsigned char * p; + p = (unsigned char *) &__stack_chk_guard; + + /* If you have the ability to generate random numbers in your kernel then use them, + otherwise for 32-bit code: *p = 0x00000aff; */ + *p = random(); +} + +void __attribute__((noreturn)) __stack_chk_fail() +{ + /* put your panic function or similar in here */ + unsigned char * vid = (unsigned char *)0xB8000; + vid[1] = 7; + for(;;) + vid[0]++; +} + +#endif +#endif /* __APPLE__ */ + + /* Wrap PHYSFS_Allocator in a CFAllocator... */ static CFAllocatorRef cfallocator = NULL; diff -r 11438c0bd46b -r bce8cf41d666 misc/libphyslayer/CMakeLists.txt --- a/misc/libphyslayer/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/libphyslayer/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -12,25 +12,17 @@ hwpacksmounter.c ) -set(build_type STATIC) -set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX}) -set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX}) +#compiles and links actual library +add_library (physlayer ${PHYSLAYER_SRCS}) +#TODO: find good VERSION and SOVERSION values +target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY}) +install(TARGETS physlayer RUNTIME DESTINATION ${target_binary_install_dir} + LIBRARY DESTINATION ${target_library_install_dir} + ARCHIVE DESTINATION ${target_library_install_dir}) +get_target_property(physlayer_fullpath physlayer LOCATION) -if(WIN32) - set(build_type SHARED) - set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) - set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) -endif(WIN32) - -#compiles and links actual library -add_library (physlayer ${build_type} ${PHYSLAYER_SRCS}) - -if(WIN32) - target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY}) - install(TARGETS physlayer RUNTIME DESTINATION ${target_library_install_dir}) -endif() ## added standard variables (FORCE or cmake won't pick 'em) -set(PHYSLAYER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphyslayer/ CACHE STRING "" FORCE) -set(PHYSLAYER_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}physlayer${lib_suffix} CACHE STRING "" FORCE) +set(PHYSLAYER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Physlayer include dir" FORCE) +set(PHYSLAYER_LIBRARY ${physlayer_fullpath} CACHE STRING "Physlayer library" FORCE) diff -r 11438c0bd46b -r bce8cf41d666 misc/libphyslayer/hwpacksmounter.c --- a/misc/libphyslayer/hwpacksmounter.c Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/libphyslayer/hwpacksmounter.c Thu Jun 13 22:27:23 2013 +0200 @@ -33,3 +33,24 @@ PHYSFS_freeList(filesList); } + +PHYSFS_DECL void hedgewarsMountPackage(char * fileName) +{ + int fileNameLength = strlen(fileName); + if (fileNameLength > 4) + if (strcmp(fileName + fileNameLength - 4, ".hwp") == 0) + { + const char * dir = PHYSFS_getRealDir(fileName); + if(dir) + { + char * fullPath = (char *)malloc(strlen(dir) + fileNameLength + 2); + strcpy(fullPath, dir); + strcat(fullPath, "/"); + strcat(fullPath, fileName); + + PHYSFS_mount(fullPath, NULL, 0); + + free(fullPath); + } + } +} diff -r 11438c0bd46b -r bce8cf41d666 misc/libphyslayer/hwpacksmounter.h --- a/misc/libphyslayer/hwpacksmounter.h Tue Apr 30 01:47:30 2013 +0200 +++ b/misc/libphyslayer/hwpacksmounter.h Thu Jun 13 22:27:23 2013 +0200 @@ -8,7 +8,7 @@ #endif PHYSFS_DECL void hedgewarsMountPackages(); - +PHYSFS_DECL void hedgewarsMountPackage(char * fileName); #ifdef __cplusplus } diff -r 11438c0bd46b -r bce8cf41d666 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java --- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java Thu Jun 13 22:27:23 2013 +0200 @@ -2,7 +2,7 @@ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game * Copyright (c) 2011-2012 Richard Deurwaarder * Copyright (C) 2012 Simeon Maxein - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -r 11438c0bd46b -r bce8cf41d666 project_files/HedgewarsMobile/Classes/CreationChamber.m --- a/project_files/HedgewarsMobile/Classes/CreationChamber.m Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m Thu Jun 13 22:27:23 2013 +0200 @@ -18,7 +18,7 @@ #import "CreationChamber.h" - +#import "weapons.h" @implementation CreationChamber diff -r 11438c0bd46b -r bce8cf41d666 project_files/HedgewarsMobile/Classes/HWUtils.m --- a/project_files/HedgewarsMobile/Classes/HWUtils.m Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/HedgewarsMobile/Classes/HWUtils.m Thu Jun 13 22:27:23 2013 +0200 @@ -22,7 +22,7 @@ #import #import #import - +#import "hwconsts.h" static NSString *cachedModel = nil; static NSArray *cachedColors = nil; diff -r 11438c0bd46b -r bce8cf41d666 project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m --- a/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Thu Jun 13 22:27:23 2013 +0200 @@ -18,7 +18,7 @@ #import "ServerProtocolNetwork.h" - +#import "hwconsts.h" #define BUFFER_SIZE 256 diff -r 11438c0bd46b -r bce8cf41d666 project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Thu Jun 13 22:27:23 2013 +0200 @@ -11,7 +11,8 @@ isa = PBXAggregateTarget; buildConfigurationList = 61799290114AE0CD00BA94A9 /* Build configuration list for PBXAggregateTarget "UpdateDataFolder" */; buildPhases = ( - 6179928A114AE0C800BA94A9 /* ShellScript */, + 61806B78170B83EA00C601BC /* config.inc */, + 6179928A114AE0C800BA94A9 /* data */, ); dependencies = ( ); @@ -629,6 +630,8 @@ 617BC23A1490211F00E1C294 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Locale/Italian.lproj/Scheme.strings; sourceTree = ""; }; 617D78D816D932310091D4D6 /* Physfs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Physfs.xcodeproj; path = ../../misc/libphysfs/Xcode/Physfs.xcodeproj; sourceTree = SOURCE_ROOT; }; 617D794316D933B00091D4D6 /* Physlayer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Physlayer.xcodeproj; path = ../../misc/libphyslayer/Xcode/Physlayer.xcodeproj; sourceTree = SOURCE_ROOT; }; + 61806BDA170B963800C601BC /* weapons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = weapons.h; path = ../../QTfrontend/weapons.h; sourceTree = SOURCE_ROOT; }; + 61806BE0170B969D00C601BC /* hwconsts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hwconsts.h; path = ../../QTfrontend/hwconsts.h; sourceTree = SOURCE_ROOT; }; 6183D83C11E2BCE200A88903 /* Default-ipad-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-ipad-Landscape.png"; path = "Resources/Icons/Default-ipad-Landscape.png"; sourceTree = ""; }; 6183D83D11E2BCE200A88903 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Icons/Default.png; sourceTree = ""; }; 618899811299516000D55FD6 /* title@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "title@2x~iphone.png"; path = "Resources/Frontend/title@2x~iphone.png"; sourceTree = ""; }; @@ -672,7 +675,6 @@ 61A4A39312A5CCC2004D81E6 /* uVariables.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uVariables.pas; path = ../../hedgewars/uVariables.pas; sourceTree = SOURCE_ROOT; }; 61A4A3A112A5CD56004D81E6 /* uCaptions.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uCaptions.pas; path = ../../hedgewars/uCaptions.pas; sourceTree = SOURCE_ROOT; }; 61A976B2136F668500DD9878 /* uCursor.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uCursor.pas; path = ../../hedgewars/uCursor.pas; sourceTree = SOURCE_ROOT; }; - 61A97F0E136F675A00DD9878 /* hwconsts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hwconsts.h; path = ../../QTfrontend/hwconsts.h; sourceTree = SOURCE_ROOT; }; 61AC067212B2E32D000B52A2 /* Appirater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Appirater.h; path = Classes/Appirater.h; sourceTree = ""; }; 61AC067312B2E32D000B52A2 /* Appirater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Appirater.m; path = Classes/Appirater.m; sourceTree = ""; }; 61B7A33612CC21080086B604 /* StatsPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatsPageViewController.h; sourceTree = ""; }; @@ -1023,9 +1025,10 @@ 61641FE21437CD8F006E049C /* Headers */ = { isa = PBXGroup; children = ( + 61806BE0170B969D00C601BC /* hwconsts.h */, + 61806BDA170B963800C601BC /* weapons.h */, 61641FE31437CDAA006E049C /* DefinesAndMacros.h */, 32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */, - 61A97F0E136F675A00DD9878 /* hwconsts.h */, 6165922911CA9BD500D6E256 /* PascalImports.h */, ); name = Headers; @@ -1629,19 +1632,34 @@ shellPath = /bin/sh; shellScript = "HEDGEWARS_REVISION=`/usr/local/bin/hg identify -n ${SOURCE_DIR}|sed -e 's/\\+//'`\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $HEDGEWARS_REVISION\" \"${TARGET_BUILD_DIR}\"/\"${INFOPLIST_PATH}\""; }; - 6179928A114AE0C800BA94A9 /* ShellScript */ = { + 6179928A114AE0C800BA94A9 /* data */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = data; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "SOURCE_DIR=${PROJECT_DIR}/../../\n\n#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\n#create config.inc\necho \"Updating config file...\"\nPROTO=`cat ${SOURCE_DIR}/CMakeLists.txt | grep HEDGEWARS_PROTO_VER | cut -d ' ' -f 2 | cut -d ')' -f 1`\nMAJN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MAJOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nMINN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_MINOR | xargs | cut -d ' ' -f 2 |cut -d ')' -f 1`\nPATN=`cat ${SOURCE_DIR}/CMakeLists.txt | grep CPACK_PACKAGE_VERSION_PATCH | xargs | cut -d ' ' -f 2 |cut -d '$' -f 1`\nREVN=-`/usr/local/bin/hg id -n ${SOURCE_DIR}`\necho \"const cNetProtoVersion = $PROTO; const cVersionString = '${MAJN}.${MINN}.${PATN}${REVN}'; const cLuaLibrary = '';\" > ${PROJECT_DIR}/config.inc\n\necho \"Copying Data...\"\ncp -R ${SOURCE_DIR}/share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some other files\necho \"Fetching additional graphics...\"\nmkdir -p ${PROJECT_DIR}/Data/Graphics/Icons\ncp ${SOURCE_DIR}/QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png ${PROJECT_DIR}/Data/Graphics/Icons/\ncp -R ${SOURCE_DIR}/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons ${PROJECT_DIR}/Data/Graphics/\n\necho \"Removing text and dummy files...\"\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg* -delete\nfind ${PROJECT_DIR}/Data -name *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#copy mono audio\ncp -R ${SOURCE_DIR}/project_files/AudioMono/* ${PROJECT_DIR}/Data/\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`;\ndo \n if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]];\n then\n mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/;\n fi;\ndone;\n\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\necho \"Done\""; - showEnvVarsInLog = 0; + shellScript = "SOURCE_DIR=${PROJECT_DIR}/../../\n\n#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\n\necho \"Copying Data...\"\ncp -R ${SOURCE_DIR}/share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some other files\necho \"Fetching additional graphics...\"\nmkdir -p ${PROJECT_DIR}/Data/Graphics/Icons\ncp ${SOURCE_DIR}/QTfrontend/res/{btn*,icon*,StatsMedal*,ammopic*}.png ${PROJECT_DIR}/Data/Graphics/Icons/\ncp -R ${SOURCE_DIR}/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons ${PROJECT_DIR}/Data/Graphics/\n\necho \"Removing text and dummy files...\"\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg* -delete\nfind ${PROJECT_DIR}/Data -name *.psd -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\nfind ${PROJECT_DIR}/Data -name *.ts -delete\n\n#delete dummy maps and hats, misc stuff\nrm -rf ${PROJECT_DIR}/Data/Maps/test*\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/{TeamCap,TeamHeadband,TeamHair}\nrm -rf ${PROJECT_DIR}/Data/misc/\n\n#delete forbidden maps and WIP themes (remember to check that no Map uses them)\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\nrm -rf ${PROJECT_DIR}/Data/Themes/{Beach,Digital}\n\n#delete all names, reserved hats and unused fonts\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\necho \"Handling audio files...\"\n#copy mono audio\ncp -R ${SOURCE_DIR}/project_files/AudioMono/* ${PROJECT_DIR}/Data/\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n#delete the main theme file\nrm -rf ${PROJECT_DIR}/Data/Music/main_theme.ogg\n\n#remove unused voices\nfor i in {Amazing,Brilliant,Bugger,Bungee,Cutitout,Drat,Excellent,Fire,FlawlessPossibility,Gonnagetyou,Grenade,Hmm,Justyouwait,Leavemealone,Ohdear,Ouch,Perfect,Revenge,Runaway,Solong,Thisoneismine,VictoryPossibility,Watchthis,Whatthe,Whoopsee}; do find Data/Sounds/voices/ -name $i.ogg -delete; done\n\necho \"Tweaking Data contents...\"\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nfor i in `ls ${PROJECT_DIR}/Data/Maps/`;\ndo \n if [[ `ls -f ${PROJECT_DIR}/Data/Maps/$i/map.lua 2> /dev/null` != '' ]];\n then\n mv ${PROJECT_DIR}/Data/Maps/$i ${PROJECT_DIR}/Data/Missions/Maps/;\n fi;\ndone;\n\n#workaround for missing map in CTF_Blizzard\nln -s ../../../Maps/Blizzard/map.png ${PROJECT_DIR}/Data/Missions/Maps/CTF_Blizzard/map.png\n\n#reduce the number of flakes for City\nsed -i -e 's/1500/50/' ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\necho \"Done\""; + }; + 61806B78170B83EA00C601BC /* config.inc */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = config.inc; + outputPaths = ( + "$(DERIVED_FILE_DIR)/myfile", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HG=/usr/local/bin/hg\nSOURCE_DIR=${PROJECT_DIR}/../../\n\n#create config.inc\necho \"Updating config file...\"\nPRON=`grep HEDGEWARS_PROTO_VER ${SOURCE_DIR}/CMakeLists.txt | grep -o -E [0-9]+`\nMAJN=`grep CPACK_PACKAGE_VERSION_MAJOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nMINN=`grep CPACK_PACKAGE_VERSION_MINOR ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nPATN=`grep CPACK_PACKAGE_VERSION_PATCH ${SOURCE_DIR}/CMakeLists.txt | grep -o -E \"[0-9]+\"`\nREVN=`$HG id -n ${SOURCE_DIR}`\nHASH=`$HG id -i ${SOURCE_DIR}`\n\necho \"{Do not change this file, use the project target to regenerate}\" > ${PROJECT_DIR}/config.inc\necho \"const cNetProtoVersion = $PRON;\" >> ${PROJECT_DIR}/config.inc\necho \"const cVersionString = '$MAJN.$MINN.$PATN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cRevisionString = '$REVN';\" >> ${PROJECT_DIR}/config.inc\necho \"const cHashString = '$HASH';\" >> ${PROJECT_DIR}/config.inc\necho \"const cLuaLibrary = '';\" >> ${PROJECT_DIR}/config.inc"; }; 9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = { isa = PBXShellScriptBuildPhase; diff -r 11438c0bd46b -r bce8cf41d666 project_files/HedgewarsMobile/Hedgewars_Prefix.pch --- a/project_files/HedgewarsMobile/Hedgewars_Prefix.pch Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/HedgewarsMobile/Hedgewars_Prefix.pch Thu Jun 13 22:27:23 2013 +0200 @@ -30,6 +30,5 @@ #import "EditableCellView.h" #import "CreationChamber.h" #import "HWUtils.h" -#import "hwconsts.h" #endif diff -r 11438c0bd46b -r bce8cf41d666 project_files/frontlib/hwconsts.h --- a/project_files/frontlib/hwconsts.h Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/frontlib/hwconsts.h Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * Copyright (c) 2012 Simeon Maxein * * This program is free software; you can redistribute it and/or modify diff -r 11438c0bd46b -r bce8cf41d666 project_files/frontlib/net/netconn.c --- a/project_files/frontlib/net/netconn.c Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/frontlib/net/netconn.c Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,7 @@ /* * Hedgewars, a free turn based strategy game * Copyright (c) 2006-2008 Igor Ulyanov - * Copyright (c) 2004-2012 Andrey Korotaev + * Copyright (c) 2004-2013 Andrey Korotaev * Copyright (c) 2012 Simeon Maxein * * This program is free software; you can redistribute it and/or modify diff -r 11438c0bd46b -r bce8cf41d666 project_files/hedgewars.pro --- a/project_files/hedgewars.pro Tue Apr 30 01:47:30 2013 +0200 +++ b/project_files/hedgewars.pro Thu Jun 13 22:27:23 2013 +0200 @@ -44,7 +44,6 @@ ../QTfrontend/ui/page/pagenetserver.h \ ../QTfrontend/ui/page/pagegamestats.h \ ../QTfrontend/ui/dialog/input_ip.h \ - ../QTfrontend/ui/qaspectratiolayout.h \ ../QTfrontend/ui/widget/bgwidget.h \ ../QTfrontend/ui/widget/fpsedit.h \ ../QTfrontend/ui/widget/FreqSpinBox.h \ @@ -123,7 +122,6 @@ ../QTfrontend/model/MapModel.cpp \ ../QTfrontend/model/ThemeModel.cpp \ ../QTfrontend/model/netserverslist.cpp \ - ../QTfrontend/ui/qaspectratiolayout.cpp \ ../QTfrontend/ui/page/pagemain.cpp \ ../QTfrontend/ui/page/pagetraining.cpp \ ../QTfrontend/ui/page/pageroomslist.cpp \ @@ -250,7 +248,7 @@ RESOURCES += ../QTfrontend/hedgewars.qrc -LIBS += -L../bin -lphysfs +LIBS += -L../bin -lhwphysfs -lphyslayer macx { QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTower-icon.png Binary file share/hedgewars/Data/Forts/SteelTower-icon.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTower-icon@2x.png Binary file share/hedgewars/Data/Forts/SteelTower-icon@2x.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTower-preview.png Binary file share/hedgewars/Data/Forts/SteelTower-preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTower-preview@2x.png Binary file share/hedgewars/Data/Forts/SteelTower-preview@2x.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTowerL.png Binary file share/hedgewars/Data/Forts/SteelTowerL.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Forts/SteelTowerR.png Binary file share/hedgewars/Data/Forts/SteelTowerR.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Dan.png Binary file share/hedgewars/Data/Graphics/Hats/Dan.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Dauber.png Binary file share/hedgewars/Data/Graphics/Hats/Dauber.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/DayAndNight.png Binary file share/hedgewars/Data/Graphics/Hats/DayAndNight.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Evil.png Binary file share/hedgewars/Data/Graphics/Hats/Evil.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Joker.png Binary file share/hedgewars/Data/Graphics/Hats/Joker.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Meteorhelmet.png Binary file share/hedgewars/Data/Graphics/Hats/Meteorhelmet.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Moustache.png Binary file share/hedgewars/Data/Graphics/Hats/Moustache.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/Moustache_glasses.png Binary file share/hedgewars/Data/Graphics/Hats/Moustache_glasses.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/SunWukong.png Binary file share/hedgewars/Data/Graphics/Hats/SunWukong.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/TeamWheatley.png Binary file share/hedgewars/Data/Graphics/Hats/TeamWheatley.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/bubble.png Binary file share/hedgewars/Data/Graphics/Hats/bubble.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/cap_thinking.png Binary file share/hedgewars/Data/Graphics/Hats/cap_thinking.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/car.png Binary file share/hedgewars/Data/Graphics/Hats/car.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/flag_french.png Binary file share/hedgewars/Data/Graphics/Hats/flag_french.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/flag_germany.png Binary file share/hedgewars/Data/Graphics/Hats/flag_germany.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/flag_italy.png Binary file share/hedgewars/Data/Graphics/Hats/flag_italy.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/flag_usa.png Binary file share/hedgewars/Data/Graphics/Hats/flag_usa.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/footballhelmet.png Binary file share/hedgewars/Data/Graphics/Hats/footballhelmet.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/lamp.png Binary file share/hedgewars/Data/Graphics/Hats/lamp.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/mechanicaltoy.png Binary file share/hedgewars/Data/Graphics/Hats/mechanicaltoy.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/noface.png Binary file share/hedgewars/Data/Graphics/Hats/noface.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_UNPeacekeeper01.png Binary file share/hedgewars/Data/Graphics/Hats/war_UNPeacekeeper01.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_UNPeacekeeper02.png Binary file share/hedgewars/Data/Graphics/Hats/war_UNPeacekeeper02.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_airwarden02.png Binary file share/hedgewars/Data/Graphics/Hats/war_airwarden02.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_airwarden03.png Binary file share/hedgewars/Data/Graphics/Hats/war_airwarden03.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_americanww2helmet.png Binary file share/hedgewars/Data/Graphics/Hats/war_americanww2helmet.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_trenchfrench01.png Binary file share/hedgewars/Data/Graphics/Hats/war_trenchfrench01.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/war_trenchfrench02.png Binary file share/hedgewars/Data/Graphics/Hats/war_trenchfrench02.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_chicken.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_chicken.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_elephant.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_elephant.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_fish.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_fish.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_frog.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_frog.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_snail.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_snail.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Hats/zoo_turtle.png Binary file share/hedgewars/Data/Graphics/Hats/zoo_turtle.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Nobody_Laugh.png Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Nobody_Laugh.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Nobody_Laugh@2x.png Binary file share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Nobody_Laugh@2x.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Graphics/hedgehog.svg --- a/share/hedgewars/Data/Graphics/hedgehog.svg Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Graphics/hedgehog.svg Thu Jun 13 22:27:23 2013 +0200 @@ -9,11 +9,11 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="800" + width="1600" height="800" id="svg2902" version="1.1" - inkscape:version="0.47 r22583" + inkscape:version="0.48.3.1 r9886" sodipodi:docname="hedgehog.svg"> Hedgehog @@ -76,17 +76,17 @@ borderopacity="1.0" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:zoom="0.49497475" - inkscape:cx="523.00419" - inkscape:cy="282.86638" + inkscape:zoom="0.45185547" + inkscape:cx="842.9141" + inkscape:cy="306.27016" inkscape:document-units="px" - inkscape:current-layer="g3598" + inkscape:current-layer="layer3" showgrid="false" - inkscape:window-width="1280" - inkscape:window-height="946" - inkscape:window-x="-4" - inkscape:window-y="-3" - inkscape:window-maximized="1" /> + inkscape:window-width="1250" + inkscape:window-height="852" + inkscape:window-x="170" + inkscape:window-y="184" + inkscape:window-maximized="0" /> @@ -112,17 +112,20 @@ style="color:#000000;fill:#2c78d2;fill-opacity:1;stroke:none;stroke-width:22;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="M 539.75014,184.97991 289.94272,20.934533 c -10.12171,-6.646795 -18.53237,-1.405552 -18.77514,8.934515 l -6.50762,277.176512" id="path3847" - sodipodi:nodetypes="cccc" /> + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + style="color:#000000;fill:none;stroke:#9f086e;stroke-width:22;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + inkscape:connector-curvature="0" /> + style="color:#000000;fill:#54a2fa;fill-opacity:1;stroke:none;stroke-width:22;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + inkscape:connector-curvature="0" /> + id="path3849" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> @@ -148,16 +154,19 @@ style="color:#000000;fill:#54a2fa;fill-opacity:1;stroke:none;stroke-width:22;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="M 305.99695,247.38296 28.159159,357.4774 c -11.257429,4.46082 -11.804016,14.3558 -3.482965,20.49879 L 247.73076,542.64501" id="path3827" - sodipodi:nodetypes="cccc" /> + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + id="path3854" + inkscape:connector-curvature="0" /> + style="color:#000000;fill:none;stroke:#9f086e;stroke-width:22;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + inkscape:connector-curvature="0" /> @@ -165,16 +174,19 @@ sodipodi:nodetypes="cccc" id="path3829" d="M 228.84636,338.65556 53.568239,580.71384 c -7.101908,9.80772 -2.250103,18.44887 8.068116,19.16343 l 276.590465,19.15401" - style="color:#000000;fill:#54a2fa;fill-opacity:1;stroke:none;stroke-width:22;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> + style="color:#000000;fill:#54a2fa;fill-opacity:1;stroke:none;stroke-width:22;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + inkscape:connector-curvature="0" /> + id="path3859" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + id="path3783" + inkscape:connector-curvature="0" /> + id="path3762" + inkscape:connector-curvature="0" /> + id="path3749" + inkscape:connector-curvature="0" /> + transform="translate(-5.6478893,85.928699)" + inkscape:connector-curvature="0" /> + id="path3736" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="csssss" + inkscape:connector-curvature="0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/ar.txt --- a/share/hedgewars/Data/Locale/ar.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/ar.txt Thu Jun 13 22:27:23 2013 +0200 @@ -152,7 +152,6 @@ 02:01=%1 wants to play Ecco the dolphin 02:01=%1 has gone to visit Aquaria 02:01=%1 has found the lost city of Atlantis -02:01=%1 aims for the lead role in Bioshock 3 02:01=Your doggy paddle could use a little work, %1 02:01=%1 should have brought a jet ski 02:01=%1 doesn't like watersports diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/campaigns_en.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Locale/campaigns_en.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,19 @@ +A Classic Fairytale-first_blood.desc="Help Leaks a lot to complete his training and become a proper hedgehog warrior. You will be trained in the art of rope, parachute, shoryuken and desert eagle." + +A Classic Fairytale-shadow.desc="Leaks a lot and Dense Cloud are going for hunting. Be prepared for the dangers awaiting you at the forest. Remember, make your choices wisely." + +A Classic Fairytale-journey.desc="Leaks a lot has to go to the other side of the island. Be fast and cautious." + +A Classic Fairytale-united.desc="After his long journey Leaks a lot is finally back to the village. However, there isn't time to rest. You have to defend the village from the rage of the cannibals." + +A Classic Fairytale-backstab.desc="The monstrous cannibals are hunting Leaks a lot and his friends. Defeat them once again and protect your allies. Use your resources accordingly to defeat the incoming enemies!" + +A Classic Fairytale-dragon.desc="Leaks a lot has to get to the other side of the lake. Become a rope master and avoid get hit by the enemy shots." + +A Classic Fairytale-family.desc="Leaks a lot has to save once more his allies. Eliminate the enemy hogs and free your comrades. Use your resources carefully as they are limited. Drill some holes in the right spot and go close to the princess." + +A Classic Fairytale-queen.desc="Leaks a lot has to fight once again. In order to win he'll have to fight the traitor and use all the resources available. Defeat the enemy!" + +A Classic Fairytale-enemy.desc="What a great twist! Leaks a lot has to fight side by side with the… “cannibals” against the common enemy. The evil cyborgs!" + +A Classic Fairytale-epil.desc="Congratulations! Leaks a lot can finally leave in peace and get praised by his new friends and his tribe. Be proud for what you succeed! You can play again previous missions and see the other possible endings." diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/cs.txt --- a/share/hedgewars/Data/Locale/cs.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/cs.txt Thu Jun 13 22:27:23 2013 +0200 @@ -175,7 +175,6 @@ 02:01=%1 chce hrát delfína Ecca 02:01=%1 odešel navštívit akvárium 02:01=%1 našel ztracené město Atlantidu -02:01=%1 míří na hlavní roli v Bioshocku 3 02:01=Na tvém stylu čubička by ještě chtělo zapracovat, %1 02:01=%1 si neměl vozit vodní lyže 02:01=%1 nemá rád vodní sporty @@ -447,8 +446,8 @@ 03:51=Nalezeno na zemi 03:52=NEPOUŽITO 03:53=Typ 40 -03:54=Vytvořit něco -03:55=Užitečnost +;03:54=Vytvořit něco +03:54=Užitečnost ; Weapon Descriptions (use | as line breaks) 04:00=Zaútoč na nepřítele pomocí obyčejného granátu.|Exploduje jakmile časovač dojde k nule.|1-5: Nastavuje časovač|Útok: Drž pro hození větší silou @@ -506,8 +505,8 @@ 04:51=Získat ve volném záběru vrhá kouli bláta.|Žihadla bit, a srazí prasata zpět. 04:52=NEPOUŽITO 04:53=Vydejte se na dobrodružství v čase a prostoru,|přičemž vaši kamarádi bojovat dál sám.|Být připraven vrátit kdykoliv,|nebo náhlé smrti nebo pokud jsou všichni poraženi.|Prohlášení. Nefunguje v náhlé smrti,|Pokud jste sami, nebo jste-li král. -04:54=NEÚPLNÝ -04:55=Sprej proud lepkavými vločkami.|Stavět mosty, pohřbít nepřátele, utěsnění tunely.|Buďte opatrní, nechcete dostat každý z vás! +;04:54=NEÚPLNÝ +04:54=Sprej proud lepkavými vločkami.|Stavět mosty, pohřbít nepřátele, utěsnění tunely.|Buďte opatrní, nechcete dostat každý z vás! ; Game goal strings 05:00=Herní módy diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/da.txt --- a/share/hedgewars/Data/Locale/da.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/da.txt Thu Jun 13 22:27:23 2013 +0200 @@ -175,7 +175,6 @@ 02:01=%1 leger delfin 02:01=%1 er taget til Lalandia 02:01=%1 har fundet den forsvundne by Atlantis -02:01=%1 håber på en hovedrolle i Bioshock 3 02:01=Du burde arbejde lidt med din hundesvømning, %1 02:01=%1 burde have medbragt jetski 02:01=%1 bryder sig ikke om vandsport @@ -447,8 +446,8 @@ 03:51=Lige til at samle op 03:52=UBRUGT 03:53=Årgang 40 -03:54=Byg noget -03:55=Værktøj +;03:54=Byg noget +03:54=Værktøj ; Weapon Descriptions (use |as line breaks) 04:00=Angrib dine fjender med en simpel granat.|Den eksploderer når uret når nul.|1-5: Indstil uret|Angrib: Hold knappen inde for at kaste hårdere @@ -505,8 +504,8 @@ 04:51=Få et skud lige ind med en Mudderklat.|Bider en smule og slår fjender omkuld. 04:52=UBRUGT 04:53=Tag på et eventyr gennem tid og rum,|mens du efterlader kampen til dine kammerater.|Vær klar til at vende tilbage når som helst,|eller hvis Pludselig Død indtræder|eller alle dine andre pindsvin dør.|Advarsel! Virker ikke under Pludselig Død,|hvis du er alene eller er Konge. -04:54=UFÆRDIG -04:55=Sprøjt rundt med klistrende flammer.|Byg broer, begrav fjender, luk tunneler af.|Pas på ikke selv at få noget på dig. +;04:54=UFÆRDIG +04:54=Sprøjt rundt med klistrende flammer.|Byg broer, begrav fjender, luk tunneler af.|Pas på ikke selv at få noget på dig. ; Game goal strings 05:00=Spilsystemer diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/de.txt --- a/share/hedgewars/Data/Locale/de.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/de.txt Thu Jun 13 22:27:23 2013 +0200 @@ -31,7 +31,7 @@ 00:28=Bohrkopfrakete 00:29=Ballpistole 00:30=Napalm-Luftangriff -00:31=RC-Flugzeug +00:31=Funkflugzeug 00:32=Schwerkraft verringern 00:33=Zusatzschaden 00:34=Unverwundbarkeit @@ -101,12 +101,10 @@ 02:00=Für %1 gehen alle Lichter aus! 02:00=%1 kommt wieder! 02:00=%1 ist urlaubsreif! -02:00=%1 trifft seine Ahnen. 02:00=%1 war nicht hartnäckig genug! 02:00=%1 war einmal 02:00=%1 hat wohl versagt 02:00=Mach’s gut, %1! -02:00=%1 hinterlässt Frau und Kind 02:00=%1 hat die letzte Bazooka gefeuert 02:00=%1 hat die letzte Granate geworfen 02:00=%1 hat den letzten Kuchen gebacken @@ -117,27 +115,27 @@ 02:00=%1 nahm einen Schuss zu viel 02:00=%1 hätte wirklich ein Erste-Hilfe-Kit gebrauchen können 02:00=%1 ist gegangen, um ein besseres Spiel zu spielen -02:00=%1 verlässt sein Leben aus Wut +02:00=%1 will nicht mehr 02:00=%1 scheitert 02:00=Schlecht, schlecht, %1 … 02:00=%1 sollte lieber WarMUX spielen -02:00=%1 hat versucht die Kugeln mit den Zähnen zu fangen -02:00=%1 findet seinen Platz in der Walhall +02:00=%1 hat versucht, die Kugeln mit den Zähnen zu fangen +02:00=%1 findet einen Platz in der Walhall 02:00=%1 geht den Weg der Dinosaurier 02:00=%1 bringt die Igelspezies einen Schritt näher zum Aussterben 02:00=%1 wird vermisst werden 02:00=%1 ist ab jetzt ein Ex-Igel 02:00=%1 sieht sich die Radieschen von unten an -02:00=%1 hat aufgehört, zu sein +02:00=%1 hat aufgehört zu existieren 02:00=Verabschieden Sie sich von %1 02:00=Für %1 gibt es keine Hoffnung mehr 02:00=%1 trat von der Lebensbühne ab 02:00=%1 erleidet ein spontanes multiples Organversagen 02:00=%1 ist mausetot -02:00=%1s Lebensuhr ist abgelaufen +02:00=Für %1 ist die Lebensuhr abgelaufen 02:00=Beraubt des Lebens, ruht %1 in Frieden 02:00=%1 hatte eine geringe Schadenstoleranz -02:00=%1 hat all seine Extraleben aufgebraucht +02:00=%1 hat alle Extraleben aufgebraucht 02:00=Ist ein Arzt im Haus?! 02:00=%1 ist tot 02:00=%1 ist hinüber @@ -145,6 +143,13 @@ 02:00=Schade um %1 02:00=Wir trauern um %1 02:00=%1 beißt ins Gras +02:00=%1 ist jetzt im Igel-Himmel +02:00=%1 spielt nicht mehr mit +02:00=%1 ist ausgeschieden +02:00=Hat %1 eigentlich ein Testament gemacht? +02:00=%1 spürt keinen Schmerz mehr +02:00=%1 muss nicht mehr leiden +02:00=%1 hat eine Abkürzung gefunden … ; Hog (%1) drowned 02:01=%1 geht auf Tauchstation! @@ -165,35 +170,33 @@ 02:01=%1 geht unter die Perlentaucher! 02:01=%1 über Bord! 02:01=%1 verlässt das sinkende Schiff -02:01=%1 überschätzt seinen Auftrieb! +02:01=%1 überschätzt den eigenen Auftrieb! 02:01=%1 erliegt dem Sog der Tiefe! 02:01=%1 geht der Sache auf den Grund! 02:01=%1 wäre fast verdurstet! 02:01=%1 macht »Gluck, gluck, gluck!« 02:01=%1 macht »Platsch!« -02:01=%1 vergaß seine Schwimmflügel +02:01=%1 hätte die Schwimmflügel diesmal nicht zu Hause lassen sollen 02:01=%1 hätte Schwimmunterricht nehmen sollen -02:01=%1 ließ sein Surfbrett zu Hause +02:01=%1 ließ das Surfbrett zu Hause 02:01=%1 wird gewaschen 02:01=%1 ist ein nasser Igel -02:01=%1 hat seine Schwimmweste vergessen +02:01=%1 hat die Schwimmweste vergessen 02:01=%1 macht »Plitsch-platsch!« 02:01=%1 sieht durstig aus 02:01=%1 ist auf dem Meer verschollen 02:01=%1 bekommt eine Seebestattung -02:01=%1 übt sein Rückenschwimmen -02:01=%1 geht auf der Suche nach der Titanic +02:01=%1 übt Rückenschwimmen 02:01=%1 ist nicht Jesus 02:01=%1 hat ein Leck 02:01=Wie viele Igel wohl da unten liegen? 02:01=%1 macht das Meer etwas höher 02:01=%1 ist absolut nicht Marinetauglich -02:01=%1 glaubt, er sei ein Fisch +02:01=%1 hält sich für einen Fisch 02:01=Wenigstens ging die Sache nicht ins Klo, %1! 02:01=Sonic konnte nicht schwimmen, %1 auch nicht 02:01=%1 spielt »Flipper der Delphin« 02:01=%1 ist von uns gegangen, um Aquaria zu besuchen -02:01=%1 strebt die Hauptrolle in Bioshock 3 an 02:01=%1 hasst Wassersport 02:01=%1 wird für immer Blasen machen 02:01=%1 war ganz, ganz knapp vor einem Floß @@ -206,6 +209,15 @@ 02:01=%1, Igel, der mit dem Blubb 02:01=Nächster Halt: Meeresgrund 02:01=%1 hätte den Schwimmkurs nicht schwänzen sollen +02:01=Fischers Fritze fischt frische ... Igel?! +02:01=Grüß die Fische von uns, %1! +02:01=%1 erkundet das Meer +02:01=%1 folgt dem Ruf der Meere +02:01=%1 ist jetzt ein Seeigel! +02:01=Igel haben keine Kiemen, %1! +02:01=%1 lässt sich diese einmalige Tauchgelegenheit nicht entgehen +02:01=Und wir dachten %1 könnte nicht noch tiefer sinken … +02:01=%1 zieht eine Etage tiefer ; Round starts 02:02=Auf in die Schlacht! @@ -275,6 +287,8 @@ 02:05=Vorräte! 02:05=Ein Erste-Hilfe-Koffer! 02:05=Ein Grund zur Hoffnung! +02:05=Frisch aus dem Jungbrunnen +02:05=Lebenszeit in Kisten ; New ammo crate 02:06=Nachschub! @@ -298,6 +312,10 @@ 02:06=Lassen Sie nicht zu, dass sich der Feind sie holt! 02:06=Schönes neues Spielzeug! 02:06=Eine geheimnisvolle Kiste! +02:06=Ein eckiges Ü-Ei! +02:06=Die Holzkiste der Pandora! +02:06=Willst du mit mir spielen? +02:06=Quadratisch, praktisch, … gefährlich? ; New utility crate 02:07=Nützliches? @@ -310,6 +328,7 @@ 02:07=Dies sollte gut sein! 02:07=Verwenden Sie diese mit Bedacht 02:07=Uff, diese Box ist schwer +02:07=Futter für Strategen ; Hog (%1) skips his turn 02:08=%1 ist so ein Langeweiler … @@ -325,19 +344,17 @@ 02:08=%1 braucht etwas Motivation 02:08=%1 ist ein Pazifist 02:08=%1 hat eine Verschnaufpause -02:08=%1 hat eine Pause -02:08=%1 ist dem Schüttelfrost ausgesetz -02:08=%1 hat kein Vertrauen in seine eigenen Fähigkeiten +02:08=%1 nimmt sich eine Auszeit +02:08=%1 hat kein Vertrauen in die eigenen Fähigkeiten 02:08=%1 beschließt, nichts zu tun 02:08=%1 lässt den Feind sich selbst vernichten 02:08=%1 wäre furchtbar auf Partys 02:08=%1 versteckt sich 02:08=%1 verpasst die Gelegenheit 02:08=%1 verschenkt die Chance -02:08=%1 meint, das Beste, was er tun kann, ist nichts … +02:08=%1 meint Nichtstun sei der beste Plan … 02:08=%1 ist ein großes Weichei -02:08=Gock, gock, gock, %1 ist ein Huhn -02:08=%1 sieht etwas gelblich aus +02:08=%1 hat Angst … 02:08=%1 ist ein Feigling! 02:08=%1 wartet auf Sudden Death 02:08=%1 ist nicht so der Kämpfertyp @@ -350,6 +367,16 @@ 02:08=%1 hat anscheinend Besseres zu tun 02:08=%1 hat sich fast zu Tode erschrocken 02:08=%1 ist eingeschlafen +02:08=%1 ist wohl nur aus Versehen hier +02:08=%1 steckt den Kopf in den Sand +02:08=%1 spielt lieber Skat +02:08=%1 guckt zu +02:08=%1 vertraut auf das Karma +02:08=%1 igelt sich ein +02:08=%1 zählt Schäfchen +02:08=%1 lässt sich die Sonne auf den Bauch scheinen +02:08=%1 genießt die Stille +02:08=%1 fragt sich ob es schon Zeit für den Winterschlaf ist ; Hog (%1) hurts himself only 02:09=%1 sollte lieber zielen üben! @@ -359,20 +386,17 @@ 02:09=%1 hat keinen Selbsterhaltungstrieb 02:09=%1 ist durcheinander 02:09=%1 vermasselt’s -02:09=Das war ein schlechter Schuss, %1 +02:09=Das hat wohl nicht ganz geklappt, %1 02:09=%1 geht ein wenig zu sorglos mit gefährlichen Waffen um 02:09=%1 sollte eine Änderung der Laufbahn betrachten -02:09=Das. War. Schlecht! 02:09=Nein, nein, nein, %1, Sie müssen auf den Feind schießen! 02:09=%1 bewegt sich einen Schritt näher zum Selbstmord 02:09=%1, Helfer des Feindes -02:09=Das war dumm, %1 +02:09=%1 hatte das anders geplant 02:09=%1 lebt nach dem Mantra des »Ohne Schmerz kein Sieg!« 02:09=%1 ist verwirrt -02:09=%1 ist geistig verwirrt 02:09=%1 verletzt sich selbst 02:09=%1 blamiert sich! -02:09=%1 ist ein Trottel! 02:09=%1 ist ungeschickt 02:09=%1 zeigt dem Feind, wozu er fähig ist 02:09=%1 ist nicht perfekt @@ -382,8 +406,15 @@ 02:09=Wie peinlich! 02:09=Ich hoffe, dass das niemand gesehen hat, %1 02:09=%1 sollte dringend die Gebrauchsanweisung noch einmal durchlesen -02:09=%1s hat eindeutig versagt 02:09=%1s Schuss ging nach hinten los! +02:09=%1 macht sich mit den Waffen vertraut +02:09=%1 schießt ein Eigentor +02:09=%1 kennt keinen Schmerz +02:09=%1 mag Bumerangs und Jo-Jos +02:09=Wer Anderen eine Grube gräbt … +02:09=%1 wird vom Pech verfolgt +02:09=Auch %1 macht mal Fehler +02:09=Hoppla?! ; Hog (%1) shot an home run (using the bat and another hog) 02:10=Home Run! @@ -393,6 +424,10 @@ 02:10=%1 vor, noch ein Tor! 02:10=Ausgezeichnet, %1! 02:10=Bravo, %1! +02:10=Sehr sportlich, %1! +02:10=Flieg, Iglein, flieg! +02:10=%1 lässt Igel fliegen +02:10=%1 ist Physikstudent ; Hog (%1) has to leave (team is gone) 02:11=%1 muss ins Bett! @@ -410,6 +445,10 @@ 02:11=%1 verschwindet 02:11=%1 ist futsch 02:11=%1 hat wohl besseres zu tun +02:11=%1 löst sich in Luft auf +02:11=%1 bringt den Müll raus +02:11=%1 flieht +02:11=%1 braucht Urlaub ; Weapon Categories 03:00=Zeitzünder-Granate @@ -467,8 +506,8 @@ 03:51=Am Boden gefunden 03:52=NICHT IN VERWENDUNG 03:53=Typ 40 -03:54=Baue etwas -03:55=Werkzeug +;03:54=Baue etwas +03:54=Werkzeug ; Weapon Descriptions (use | as line breaks) 04:00=Greife deine Feinde mit einfachen Granaten an.|Der Zeitzünder steuert den Explosionszeitpunkt.|1-5: Zeitzünder einstellen|Angriff: Halten, um mit mehr Kraft zu werfen @@ -502,7 +541,7 @@ 04:28=Kurz nach dem Start wird diese Rakete beginnen,|sich durch soliden Grund zu graben. Sobald sie|wieder austritt oder der Zeitzünder abläuft,|wird sie explodieren.|Angriff: Halten, um mit mehr Kraft zu feuern 04:29=Das ist nichts für kleine Kinder! Die Ballpistole|feuert Tonnen kleiner farbiger Bälle, die mit|Sprengstoff gefüllt sind.|Angriff: Mit voller Kraft feuern|Hoch/Runter: Im Feuern zielen 04:30=Rufe ein Flugzeug, um ein Areal gezielt mit|tödlichem Napalm einzudecken. Gut gezielt|lassen sich so große Teile der Karte auslöschen.|Links/Rechts: Angriffsrichtung wählen|Cursor: Zielgebiet wählen und Angriff starten -04:31=Das RC-Flugzeug kann Kisten einsammeln und weit|entfernte Igel angreifen. Steuere es direkt in|ein Opfer oder wirf erst einige Bomben ab.|Angriff: Flugzeug starten und Bomben abwerfen|Weiter Sprung: "Ritt der Walküren"|Hoch/Runter: Flugzeug lenken +04:31=Das Funkflugzeug kann Kisten einsammeln und weit|entfernte Igel angreifen. Steuere es direkt in|ein Opfer oder wirf erst einige Bomben ab.|Angriff: Flugzeug starten und Bomben abwerfen|Weiter Sprung: "Ritt der Walküren"|Hoch/Runter: Flugzeug lenken 04:32=Niedrige Schwerkraft ist effektiver als jede|Diät! Springe höher und weiter oder lass|einfach deine Gegner noch weiter fliegen.|Angriff: Aktivieren 04:33=Manchmal muss es eben doch ein bisschen|mehr sein …|Angreifen: Aktivieren 04:34=Can’t touch me!|Angreifen: Aktivieren @@ -525,8 +564,8 @@ 04:51=Wirf mit Dreck um dich!|Schmerzt ein wenig und schubst Igel weg. 04:52=NICHT IN VERWENDUNG 04:53=Unternimm eine Reise durch Zeit und Raum,|während du deine Kameraden alleine am Schlachtfeld zurücklässt.|Sei darauf vorbereitet jederzeit wieder zurückzukommen,|oder auf Sudden Death wenn sie alle besiegt wurden.|Disclaimer: Nicht funktionstüchtig wenn in Sudden Death,|wenn du alleine bist - oder der König. -04:54=IN ARBEIT -04:55=Versprühe einen Strahl klebriger Flocken.|Baue Brücken, begrabe Gegner, versiegle Tunnel.|Pass auf, dass du selbst nichts abbekommst! +;04:54=IN ARBEIT +04:54=Versprühe einen Strahl klebriger Flocken.|Baue Brücken, begrabe Gegner, versiegle Tunnel.|Pass auf, dass du selbst nichts abbekommst! ; Game goal strings 05:00=Spielmodifikationen diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/en.txt --- a/share/hedgewars/Data/Locale/en.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/en.txt Thu Jun 13 22:27:23 2013 +0200 @@ -45,7 +45,7 @@ 00:42=Portable Portal Device 00:43=Piano Strike 00:44=Old Limburger -00:45=Sine Gun (beta) +00:45=Sine Gun 00:46=Flamethrower 00:47=Sticky Mine 00:48=Hammer @@ -178,7 +178,6 @@ 02:01=%1 wants to play Ecco the dolphin 02:01=%1 has gone to visit Aquaria 02:01=%1 has found the lost city of Atlantis -02:01=%1 aims for the lead role in Bioshock 3 02:01=Your doggy paddle could use a little work, %1 02:01=%1 should have brought a jet ski 02:01=%1 doesn't like watersports @@ -445,13 +444,15 @@ 03:46=Hot Hot Hot! 03:47=Stick these somewhere useful! 03:48=It's Hammer time! -03:49=Does what you guess +03:49=Bring back the dead TO hell! 03:50=Moles fan 03:51=Found on the ground 03:52=UNUSED 03:53=Type 40 -03:54=Build something -03:55=Utility +;03:54=Build something +03:54=Utility +03:55=It doesn't get cooler than this! +03:56=Please use or misuse ; Weapon Descriptions (use | as line breaks) 04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power @@ -504,12 +505,13 @@ 04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice) 04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate 04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection -04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig. -04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back. +04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig.|Left/Right: Determine attack direction|Cursor: Select target region +04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back.|Attack: Hold to shoot with more power 04:52=UNUSED -04:53=Take a trip through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King. -04:54=INCOMPLETE -04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you! +04:53=Take a trip through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.|Attack: Activate +04:54=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power +04:55=Bring back the ice-age!|Freeze hedgehogs, make the floor slippery or|save yourself from drowning by freezing the water.|Attack: Shoot +04:56=You can throw two cleavers at your enemy,|block passages and tunnels and even use them for climbing!|Be careful! Playing with knifes is dangerous.|Attack: Hold to shoot with more power (twice) ; Game goal strings 05:00=Game Modes diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/es.txt --- a/share/hedgewars/Data/Locale/es.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/es.txt Thu Jun 13 22:27:23 2013 +0200 @@ -171,7 +171,6 @@ 02:01=%1 prefiere jugar a Ecco the dolphin 02:01=%1 ha ido a visitar Aquaria 02:01=%1 ha encontrado la ciudad perdida de la Atlántida -02:01=%1 hace audiciones para el personaje principal de Bioshock 3 02:01=Necesitas practicar más tu estilo perrito, %1 02:01=Necesitas practicar más tu brazada, %1 02:01=Necesitas practicar más tu estilo mariposa, %1 @@ -446,8 +445,8 @@ 03:51=Me la encontré por el suelo 03:52=SIN USAR 03:53=Tipo 40 -03:54=Construye algo -03:55=Herramienta +;03:54=Construye algo +03:54=Herramienta ; Descripciones de armamento ( líneas delimitadas con | ) 04:00=Ataca a tus enemigos usando una sencilla granada.|Explotará una vez el temporizador llegue a cero.|1-5: ajustar temporizador.|Atacar: mantener presionado para lanzar más lejos. @@ -504,8 +503,8 @@ 04:51=¿Qué hay más barato que el barro?|Un tiro gratis gracias a la bola de barro.|Hará que el enemigo salga volando|y escuece un poco si te entra en los ojos. 04:52=SIN USAR 04:53=Vive una trepidante aventura a través del|espacio y el tiempo mientras tus compañeros|siguen luchando en tu lugar.|Estate preparado para volver en cualquier momento,|o al llegar la Muerte súbita si te has quedado solo.|Aviso: no funciona durante la Muerte súbita,|si estás solo o si eres el rey. -04:54=INCOMPLETO -04:55=Esparce un chorro de pegajoso barro.|Construye puentes, entierra enemigos o cierra túneles.|¡Ten especial cuidado de no mancharte! +;04:54=INCOMPLETO +04:54=Esparce un chorro de pegajoso barro.|Construye puentes, entierra enemigos o cierra túneles.|¡Ten especial cuidado de no mancharte! ; Game goal strings 05:00=Modos de juego diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/fi.txt --- a/share/hedgewars/Data/Locale/fi.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/fi.txt Thu Jun 13 22:27:23 2013 +0200 @@ -159,7 +159,6 @@ 02:01=%1 haluaa näytellä Ecco-delfiiniä 02:01=%1 lähti käymään Aquariassa 02:01=%1 löysi Atlantiksen kadonneen kaupungin -02:01=%1 tähtää Bioshock 3:en päärooliin 02:01=%1:n olisi pitänyt ottaa vesiskootteri mukaan 02:01=%1 ei pidä vesiurheilusta 02:01=%1 puhaltaa ikuisesti kuplia diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/fr.txt --- a/share/hedgewars/Data/Locale/fr.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/fr.txt Thu Jun 13 22:27:23 2013 +0200 @@ -3,22 +3,22 @@ 00:00=Grenade 00:01=Grenade à fragmentation 00:02=Bazooka -00:03=Abeille Missile +00:03=Abeille à tête chercheuse 00:04=Fusil 00:05=Marteau-piqueur 00:06=Passer -00:07=Corde ninja +00:07=Grappin 00:08=Mine -00:09=Révolver +00:09=Pistolet 00:10=Dynamite 00:11=Batte de baseball 00:12=Shoryuken 00:13=sec 00:14=Parachute -00:15=Attaque aérienne -00:16=Lancer de mines +00:15=Frappe aérienne +00:16=Pluie de mines 00:17=Chalumeau -00:18=Poutre +00:18=Construction 00:19=Téléportation 00:20=Changer de hérisson 00:21=Mortier @@ -29,39 +29,44 @@ 00:26=Bombe pastèque 00:27=Grenade infernale 00:28=Roquette perforante -00:29=Canon à billes +00:29=Mitrailleuse à balles 00:30=Napalm 00:31=Avion télécommandé 00:32=Faible gravité -00:33=Plus de dégâts +00:33=Dégats supplémentaires 00:34=Invulnérable 00:35=Temps supplémentaire 00:36=Visée laser 00:37=Vampirisme -00:38=Fusil de sniper +00:38=Sniper 00:39=Soucoupe Volante 00:40=Cocktail Molotov 00:41=Piaf -00:42=Fusil à portails -00:43=Attaque du Piano +00:42=Générateur de portails +00:43=Chute de Piano 00:44=Vieux Limburger -00:45=Fusil Sinus (bêta) +00:45=Fusil Sinusoidale 00:46=Lance-flammes 00:47=Mines adhésives 00:48=Marteau 00:49=Resurrecteur 00:50=Attaque perforante 00:51=Boule de terre +00:52=Aucune arme sélectionnée +00:53=Boîte temporelle +00:54=Aéro-Sol +00:55=Congélateur +00:56=Hachoir 01:00=C'est parti ! 01:01=Round ex-aequo 01:02=%1 gagne ! 01:03=Volume %1% 01:04=Pause -01:05=Quitter (Y/Esc) ? +01:05=Quitter? (Y/Esc) (Clique pour reprendre) 01:06=Mort subite ! 01:07=%1 Restantes -01:08=Essence +01:08=Carburant ; Event messages ; Hog (%1) died @@ -78,41 +83,42 @@ 02:00=%1 fait l'ultime sacrifice ! 02:00=%1 sera profondément regretté ! 02:00=%1 a un anévrisme ! -02:00=%1 s'en va, laissant sa femme et ses enfants -02:00=%1 a lancé sa dernière roquette -02:00=%1 a jeté sa dernière grenade -02:00=%1 a fait cuire son dernier gâteau -02:00=%1 s'est balancé sur sa dernière corde -02:00=%1 a appelé son dernier raid aérien -02:00=%1 a rechargé son dernier fusil de chasse -02:00=%1 a envoyé son dernier melon -02:00=%1 a tiré sa dernière balle -02:00=%1 aurait vraiment dû utiliser une caisse de vie -02:00=%1 est parti pour jouer à un meilleur jeu +02:00=%1 s'en va, laissant sa femme et ses enfants ! +02:00=%1 a lancé sa dernière roquette ! +02:00=%1 a jeté sa dernière grenade ! +02:00=%1 a fait cuire son dernier gâteau ! +02:00=%1 s'est balancé sur sa dernière corde ! +02:00=%1 a appelé son dernier raid aérien ! +02:00=%1 a rechargé son dernier fusil de chasse ! +02:00=%1 a envoyé son dernier melon ! +02:00=%1 a tiré sa dernière balle ! +02:00=%1 aurait vraiment dû utiliser une caisse de vie ! +02:00=%1 est parti pour jouer à un meilleur jeu ! 02:00=%1 est mauvais joueur ! -02:00=%1 a échoué +02:00=%1 a échoué ! 02:00=Pauvre %1... -02:00=%1 préfère Warmux -02:00=%1 a bloqué les balles avec sa tête -02:00=%1 s'en va à la façon des dinosaures -02:00=%1 fait avancer les hérissons d'un pas vers l'extinction -02:00=%1 me fait pleurer une larme -02:00=%1 a cessé d'être -02:00=Dites au revoir à %1 -02:00=Plus d'espoir restant pour %1 -02:00=%1 ferme le rideau final -02:00=%1 souffre d'Échec Spontané et Massif d'Existence -02:00=%1 est mort -02:00=%1 est raide mort -02:00=%1 n'existe plus -02:00=%1 est périmé -02:00=Privé de la vie, %1, reste en paix -02:00=%1 rejoins le chœur invisible +02:00=%1 préfère Warmux ! +02:00=%1 a bloqué les balles avec sa tête ! +02:00=%1 s'en va à la façon des dinosaures ! +02:00=%1 fait avancer les hérissons d'un pas vers l'extinction ! +02:00=%1 me fait pleurer une larme ! +02:00=%1 a cessé d'être ! +02:00=Dites au revoir à %1 ! +02:00=Plus d'espoir restant pour %1 ! +02:00=%1 ferme le rideau final ! +02:00=%1 souffre d'Échec Spontané et Massif d'Existence ! +02:00=%1 est mort ! +02:00=%1 est raide mort ! +02:00=%1 n'existe plus ! +02:00=%1 est périmé ! +02:00=Privé de la vie, %1, reste en paix ! +02:00=%1 rejoins le chœur invisible ! 02:00=Adieu %1, nous tenions beaucoup a toi ! -02:00=%1 avait une faible tolérance aux coups à balles -02:00=%1 aurait dû utiliser une vie supplémentaire -02:00=%1 rejoint ses ancêtres +02:00=%1 avait une faible tolérance aux coups à balles ! +02:00=%1 aurait dû utiliser une vie supplémentaire ! +02:00=%1 rejoint ses ancêtres ! 02:00=%1 sera muet comme une tombe + ; Hog (%1) drowned 02:01=%1 joue au sous-marin ! 02:01=%1 imite le Titanic ! @@ -148,7 +154,6 @@ 02:01=%1 veut jouer à Ecco the Dolphin 02:01=%1 est parti visiter l'aquarium 02:01=%1 a trouvé la cité perdue d'Atlantide -02:01=%1 se propose pour le rôle principal de Bioshock 3 02:01=Ta pagaie pour chiens aurait pû servir, %1 02:01=%1 aurait dû acheter un jet ski 02:01=%1 n'aime pas les sports aquatiques @@ -162,6 +167,7 @@ 02:01=%1 flotte comme une enclume 02:01=%1 a oublié son masque et ses palmes 02:01=%1 a vu une sirène ! + ; Match starts 02:02=Aux armes ! 02:02=Prêts à combattre ! @@ -210,10 +216,13 @@ 02:02=Ave Caesar, Morituri te salutant ! 02:02=Combattez jusqu'à la fin ! 02:02=Que la force soit avec vous ! + ; Round ends (win; unused atm) 02:03=... + ; Round ends (draw; unused atm) 02:04=... + ; New health crate 02:05=Pharmacie ! 02:05=De l'aide ! @@ -232,6 +241,7 @@ 02:05=Voilà la Croix Rouge ! 02:05=Médecin Sans Frontière à votre service ! 02:05=Hausse de l'espérance de vie en vue + ; New ammo crate 02:06=Plus d'armes ! 02:06=Du renfort ! @@ -256,6 +266,7 @@ 02:06=L'espoir fait vivre 02:06=Surement quelquechose d'utile 02:06=Que la chance soit avec vous ! + ; New utility crate 02:07=Boite à outils ! 02:07=Ça peut être pratique... @@ -269,6 +280,7 @@ 02:07=Elle s'est peut être blessée en tombant, vous devriez aller la voir 02:07=Bob le bricoleur sait être généreux 02:07=Le moment donné par le hasard vaut mieux que le moment choisi + ; Hog (%1) skips his turn 02:08=%1 est une lopette... 02:08=%1 est trooooop rasant... @@ -310,6 +322,7 @@ 02:08=Les gens heureux n'ont pas besoin de se presser selon %1 02:08=Ne crains pas d'avancer lentement, crains seulement de t'arrêter %1 02:08=Patience ! Avec le temps, l'herbe devient du lait + ; Hog (%1) hurts himself only 02:09=%1 devrait apprendre à viser ! 02:09=%1 s'en veut @@ -345,43 +358,50 @@ 02:09=%1 ne peut pas échapper à son destin 02:09=%1 a pris son arme dans le mauvais sens 02:09=%1 est surement daltonien + ; Hog shot an home run (using the bat and another hog) 02:10=Home Run ! 02:10=C'est un oiseau ! C'est un avion ! ... 02:10=Hors du parc ! 02:10=Coup gagnant ! 02:10=I believe I can FLY ! I believe I can... *boum* + +; Hog (%1) Has to leave (team is gone) +02:11=%1 a du aller se coucher! +02:11=%1 est trop occupé pour jouer +02:11=%1 a du partir + ; Weapon Categories 03:00=Grenade à retardement 03:01=Grenade à retardement 03:02=Arme balistique 03:03=Arme téléguidée 03:04=Fusil (plusieurs coups) -03:05=Engin excavateur +03:05=Outil de creusage 03:06=Action -03:07=Véhicule utilitaire +03:07=Moyen de transport 03:08=Bombe de proximité 03:09=Révolver (à plusieurs coups) 03:10=BOUM! 03:11=Bonk! 03:12=Arts martiaux 03:13=Non Utilisé -03:14=Véhicule utilitaire +03:14=Moyen de transport 03:15=Attaque aéroportée 03:16=Attaque aéroportée -03:17=Engin excavateur +03:17=Outil de creusage 03:18=Utilitaire -03:19=Véhicule utilitaire +03:19=Moyen de transport 03:20=Action 03:21=Engin balistique 03:22=Appelez-moi Indiana ! 03:23=Arts (vraiment) martiaux ! 03:24=Le gâteau n'est PAS un mensonge ! 03:25=Déguisement -03:26=Grenade à fragmentation -03:27=Grenade infernale -03:28=Missile balistique -03:29=Missile balistique +03:26=Grenade juteuse +03:27=Grenade enflammée +03:28=Arme balistique +03:29=Arme balistique 03:30=Attaque aéroportée 03:31=Bombe à déclenchement télécommandé 03:32=Effet temporaire @@ -394,21 +414,37 @@ 03:39=Moyen de transport 03:40=Grenade incendiaire 03:41=Un supporter enragé de Squawks +; they wont get the original joke the song is in english so Ill use "for science" instead since its said a lot in the game +03:42=Pour la science ... +03:43=Joue la douloureuse sonate de Beethoven +03:44=A consommer de préference avant : 1923 +03:45=La puissance de la science +03:46=Chaud ! Chaud ! Chaud! +03:47=Colle ça là où ce sera utile! +03:48=C'est l'heure de marteler ! +03:49=Ramène les morts en ENFER !!! +03:50=Un fan de taupes +03:51=Trouvé par terre +03:52=UNUSED +03:53=Type 40 +03:54=Trace ta route +03:55=Qui a commandé un herisson-glacé? +03:56=Grand couteau, Multi-fonctions ! ; Weapon Descriptions (use | as line breaks) -04:00=Attaquez vos ennemis en utilisant une simple grenade.|Elle explosera une fois que le compte à rebours atteindra zéro.|1-5: Lancez le minuteur de la grenade|Attaque : maintenez pour la lancer avec plus de force -04:01=Attaquez vos ennemis en utilisant une bombe à retardement.|Elle se désintégrera en de multiples petites bombes |quand le compte à rebours atteindra zéro|1-5 : Lancez le minuteur de la grenade|Attaque : maintenez pour la lancer avec plus de force -04:02=Attaquez vos ennemis en utilisant un missile balistique|subissant l'influence du vent.|Attaque : maintenez pour tirer avec plus de force -04:03=Lancez une bombe téléguidée qui se verrouillera|sur la cible choisie. Ne tirez pas à pleine puissance|pour une meilleure précision.|Curseur : choix de la cible|Attaque : maintenez pour tirer avec plus de force +04:00=Attaquez vos ennemis en utilisant une simple grenade.|Elle explosera une fois que le compte à rebours atteindra zéro.|1-5: Réglez le minuteur de la grenade|Attaque : maintenez pour la lancer avec plus de force +04:01=Attaquez vos ennemis en utilisant une grenade a fragmentation.|Elle se désintégrera en de multiples petits fragements explosifs |quand le compte à rebours atteindra zéro|1-5 : Réglez le minuteur de la grenade|Attaque : maintenez pour la lancer avec plus de force +04:02=Attaquez vos ennemis en utilisant un bazooka dont la roquette|subira l'influence du vent.|Attaque : maintenez pour tirer avec plus de force +04:03=Lancez une abeille à tête chercheuse qui se verrouillera|sur la cible choisie. Ne tirez pas à pleine puissance|pour une meilleure précision.|Curseur : choix de la cible|Attaque : maintenez pour tirer avec plus de force 04:04=Attaquez votre ennemi en utilisant un fusil à deux coups.|Grâce à son pouvoir de dispersion vous n'avez pas besoin de frapper directement sur la cible|pour toucher votre ennemi.|Attaque : tirez (coups multiples) 04:05=Descendez sous terre ! Utilisez le marteau-piqueur pour creuser un trou|dans le sol et atteindre d'autres zones.|Attaque : commencez/achevez de creuser 04:06=Vous en avez marre ? Pas moyen d'attaquer ? Vous économisez vos munitions ?|Pas de problèmes ! Passez simplement votre tour, espèce de lâche !|Attaque : Passez votre tour sans combattre -04:07=Franchissez les grandes distances en utilisant par intervalles la |corde ninja. Utilisez votre élan pour vous lancer contre les autres hérissons,|balancez leurs des grenades ou d'autres armes explosives.|Attaque : Tirer ou lâchez la corde ninja|Saut longue distance : jetez des grenades ou des armes similaires +04:07=Franchissez les grandes distances en utilisant par intervalles le |Grappin. Utilisez votre élan pour vous lancer contre les autres hérissons,|leur balancer des grenades ou d'autres armes explosives.|Attaque : Tirer ou lâchez la corde ninja|Saut longue distance : jetez des grenades ou des armes similaires 04:08=Maintenez vos ennemis à distance en laissant une mine|dans les passages étroits ou juste sous leurs pieds. Assurez-vous|que vous pouvez vous sauver avant son déclenchement !|Attaque : lâchez la mine à vos pieds -04:09=Vous n'êtes pas sûr de ce que vous voulez ? Utilisez l'Aigle| du Désert pour attaquer en utilisant vos quatre coups. Poussez dans l'eau vos ennemis ou transpercez leur défense|Attaque : tirez (coups multiples) +04:09=Vous n'êtes pas sûr de ce que vous voulez ? Utilisez le| pistolet pour attaquer en utilisant vos quatre coups. Poussez dans l'eau vos ennemis ou transpercez leur défense|Attaque : tirez (coups multiples) 04:10=La force brute est toujours une possibilité. Lancez cet explosif|classique sur vos ennemis et prenez le temps de vous retirer.|Attaque : Lâchez la dynamite à vos pieds -04:11=Débarrassez-vous des hérissons ennemis en leur donnant des coups pour les chasser |vers d'autres horizons ou en les jetant à l'eau. Ou bien préférez-vous|envoyer quelques tonneaux ou mines sur vos ennemis ?|Attaque : frappez un bon coup sur tout ce qui bouge. -04:12=Allez au combat rapproché corps à corps pour utiliser toute la force presque mortelle de ces arts martiaux.|Attaque : lancez un coup de poing fulgurant +04:11=Débarrassez-vous des hérissons ennemis en leur donnant des coups pour les éjecter |vers d'autres horizons ou en les jetant à l'eau. Ou bien préférez-vous|envoyer quelques tonneaux ou mines sur vos ennemis ?|Attaque : frappez un bon coup sur tout ce qui bouge. +04:12=Allez au corps-à-corps pour utiliser toute la force presque mortelle de ces arts martiaux.|Attaque : lancez un coup de poing fulgurant 04:13=non-utilisé 04:14=Vous avez le vertige ? Prenez donc un parachute.|Il se déploiera lorsque|vous serez tombé trop loin|et épargnera le choc de la chute à votre hérisson.|Attaque: Dépliez le parachute 04:15=Appelez le 3615 BOMBE pour commander une frappe aérienne dévastatrice sur vos ennemis.|Gauche/Droite : Déterminez la direction de l'attaque|Curseur : Choisissez la zone cible @@ -416,36 +452,44 @@ 04:17=vous avez besoin d'un abri ? de pousser quelques ennemis dans l'eau ? Utilisez le chalumeau| pour creuser un tunnel dans le sol, vous protéger ou faire de nouvelles victimes.|Attaque : Commencez/cessez de creuser. 04:18=Vous avez besoin de vous protéger davantage ou de passer un |obstacle infranchissable ? Placez quelques poutrelles|où vous voulez .|Gauche/Droite : Choisissez la poutrelle à placer|Curseur : Placez la poutrelle dans la bonne position 04:19=La téléportation utilisée au bon moment|peut être bien plus efficace|que la plupart des autres armes|car elle vous permet de sauver des hérissons de situations dangereuses|en quelques secondes.|Curseur : Choisissez la zone cible -04:20=Vous permet de jouer la partie en cours avec|un hérisson différent.|Attaque : Activez le changement de hérisson +04:20=Vous permet de changer de herisson|pendant votre tour.|Attaque : Activez le changement de hérisson 04:21=Tirez un missile balistique qui va|envoyer de multiples bombes au point d'impact.|Attaque : Tirez à pleine puissance 04:22=Ce n'est pas réservé à Indiana Jones ! Le fouet est une|arme bien utile dans plusieurs situations. Particulièrement|quand vous devez hisser quelqu'un en haut d'une falaise.|Attaque : Frappez tout ce qui bouge devant vous -04:23=Si vous n'avez rien à perdre, voilà qui peut être |bien pratique. Sacrifiez votre hérisson en le lançant dans une direction| particulière. Il heurtera tout sur son passage avant |d'exploser finalement.|Attaque : Lancer l'attaque mortelle et dévastatrice -04:24=Joyeux anniversaire ! Lancez ce gâteau, faites-le atterrir|tout près de vos ennemis et offrez-leur une fête explosive.|Le gâteau peut franchir presque tous les environnements mais|il se peut qu'il explose à mi-chemin.|Attaque : Lancez le gâteau ou bien faites-le s'arrêter et exploser -04:25=Arme de séduction massive ! Utilisez le déguisement pour amener vos ennemis| à sauter vers votre hérisson (et donc vers un piège ou un trou).|Attaque : Utilisez le déguisement et tentez de séduire un autre hérisson -04:26=Envoyez cette pastèque explosive à la tête de vos ennemis. Une fois le compte-à-rebours achevé, elle se désintégrera en de multiples fragments explosifs|1-5 : Lancer le compte à rebours|Attaque : Maintenez pour tirer avec plus de puissance -04:27=Faites tomber un déluge de feu sur vos adversaires en utilisant|cet explosif dévastateur.|Ne vous tenez pas trop prêt|de l'impact car les flammes peuvent durer longtemps|Attaque : Maintenez pour tirer avec plus de puissance -04:28=Peu après le lancement de ce missile, il va se mettre|à creuser le sol le plus résistant et explosera|une fois son détonateur amorcé ou une fois atteint l'air libre.|Attaque : Maintenez pour tirer avec plus de puissance +04:23=Si vous n'avez rien à perdre, voilà qui peut être |bien pratique. Sacrifiez votre hérisson en le lançant dans une direction| particulière. Il heurtera tout sur son passage avant |d'exploser.|Attaque : Lancer l'attaque mortelle et dévastatrice +04:24=Joyeux anniversaire ! Lancez ce gâteau, et déposez-le|tout près de vos ennemis et offrez-leur une fête explosive.|Le gâteau peut franchir presque tous les environnements mais|il se peut qu'il explose à mi-chemin ou apès votre cible.|Attaque : Lancez le gâteau ou bien faites-le s'arrêter et exploser +04:25=Arme de séduction massive ! Utilisez le déguisement pour ammener vos ennemis| à sauter vers votre hérisson (et donc vers un piège ou un trou).|Attaque : Utilisez le déguisement et tentez de séduire un autre hérisson +04:26=Envoyez cette pastèque explosive à la tête de vos ennemis. Une fois le compte-à-rebours achevé, elle se désintégrera en de multiples tranches explosives|1-5 : Régler le compte à rebours|Attaque : Maintenez pour tirer avec plus de puissance +04:27=Faites tomber un déluge de feu sur vos adversaires en utilisant|cet explosif diabolique et dévastateur.|Ne vous tenez pas trop prêt|de l'impact car les flammes peuvent durer longtemps|Attaque : Maintenez pour tirer avec plus de puissance +04:28=Peu après le lancement de cette roquette, elle va se mettre|à creuser le sol le plus résistant et explosera|une fois son compte à rebours ou une fois atteint l'air libre.|Attaque : Maintenez pour tirer avec plus de puissance 04:29=Ce n'est pas un jouet pour les enfants ! La mitrailleuse envoie|des centaines de petites balles colorées explosives.|Attaque : Tirez à pleine puissance|Haut/Bas : Continuez à tirer -04:30=Appelez un avion pour larguer une puissante giclée de napalm.|En la menant correctement cette attaque peut éradiquer|des zones entières du paysage, et notamment les hérissons qui auraient la malchance de se trouver là.|Gauche/Droite: Déterminez la direction de l'attaque|Curseur : Choisissez la zone cible +04:30=Appelez un avion pour larguer une pluie de napalm soumise à la force du vent.|En la menant correctement cette attaque peut éradiquer|des zones entières du paysage, et notamment les hérissons qui auraient la malchance de se trouver là.|Gauche/Droite: Déterminez la direction de l'attaque|Curseur : Choisissez la zone cible 04:31=L'avion télécommandé est l'arme idéale pour récolter des boites ou|attaquer des hérissons très éloignés. Une fois vos ennemis bombardés, vous pourrez lancer votre avion sur l'ennemi dans une explosion incendiaire.|Attaque : Lancez l'avion ou larguez des bombes|Saut longue distance : laissez les valkyries entrer dans la danse guerrière|Haut/Bas : Pilotez l'avion -04:32=La fable gravité est plus efficace que n'importe quel régime ! Sautez|plus haut et franchissez de plus grandes distances ou bien faites voltiger vos ennemis |encore plus loin.|Attaque : Activez +04:32=La faible gravité est plus efficace que n'importe quel régime ! Sautez|plus haut et franchissez de plus grandes distances ou bien faites voltiger vos ennemis |encore plus loin.|Attaque : Activez 04:33=Parfois vous avez besoin d'un petit coup de pouce supplémentaire|pour gérer les dégâts.|Attaque : Activez 04:34=Personne ne peut me toucher !|Attaque : Activez 04:35=Parfois le temps passe trop vite. Grappillez quelques secondes de plus pour terminer votre attaque|Attaque : Activez -04:36=Eh bien, parfois vous ratez complètement la cible. Demandez plutôt de l'aide|à la technologie de pointe actuelle pour bien viser.|Attaque : Activez +04:36=Eh bien, parfois vous ratez complètement la cible. Demandez plutôt de l'aide|à la technologie de pointe pour bien viser.|Attaque : Activez 04:37=Ne craignez pas la lumière du jour. Rafraichissez vous |d'un peu de sang en récupérant des points de vie sur les dégats faits aux ennemis.|Attaque : Activez -04:38= Le fusil à lunette peut être une des armes les plus dévastatrices|de tout votre arsenal, toutefois il est totalement inefficace|en combat rapproché. Les dommages qu'il cause augmentent suivant|la distance de la cible.|Attaque : Tirez (deux fois) -04:39=Volez vers d'autres secteurs de la carte en utilisant une soucoupe|volante. Ce moyen de transport, pas facile à dompter, vous|emportera vers presque tous les horizons du champ de bataille|Attaque : Activer|Haut/Gauche/Droite : Prenez de l'altitude et controllez votre direction +04:38= Le sniper peut être une des armes les plus dévastatrices|de tout votre arsenal, toutefois il est totalement inefficace|en combat rapproché. Les dommages qu'il cause augmentent suivant|la distance de la cible.|Attaque : Tirez (deux fois) +04:39=Volez vers d'autres secteurs de la carte en utilisant une soucoupe|volante. Ce moyen de transport, pas facile à dompter, vous|emportera vers presque tous les horizons du champ de bataille mais attention au carburant!|Attaque : Activer|Haut/Gauche/Droite : Prenez de l'altitude et controllez votre direction 04:40=Mettez le feu à un territoire en utilisant cette bouteille remplie|de liquide inflammable.|Attaque : maintenez pour tirer avec plus de force 04:41=Une arme naturelle qui peut suffire à remplacer la soucoupe volante.|Cet oiseau a du manger un vieux fromage pourri (du Limburger vous dites ?)|car ses oeufs ont comme quelquechose de ... toxique.|Le piaf peut donc transporter votre hérisson et balancer des œufs|sur vos ennemis !|Attaque : Activez et larguez des œufs|Haut/Gauche/Droite: voltigez vers une direction. -04:42=Ce fusil à portails est capable de transporter instantanément hérissons,|tonneaux ou mines entre deux points du terrain. |Utilisez-le intelligemment et votre campagne sera un ... GRAND SUCCÈS !|Attaque : Crée un portail|Modificateur : Change la couleur du portail +04:42=Ce générateur de portails est capable de transporter instantanément hérissons,|tonneaux ou mines entre deux points du terrain. |Utilisez-le intelligemment et votre campagne sera un ... GRAND SUCCÈS !|Attaque : Crée un portail|Modificateur : Change la couleur du portail 04:43=Faites de vos débuts musicaux un succès explosif !| Lâchez un piano depuis les cieux, mais attention ... si quelqu'un doit|jouer dessus, cela pourrait lui coûter la vie !|Curseur : Choix de la cible|F1-F9 : Jouer du piano -04:44=Ce n'est pas juste un fromage, c'est une arme bactériologique !|Si il ne provoque que de faibles dommages, sa puissance se|trouve dans sa durée. Il empoisonnera tous les malchanceux|touchés par l'odeur et réduira leur vie à l'agonie !|1-5 : Lancez le minuteur de la grenade|Attaque : maintenez pour la lancer avec plus de force -04:45=Tous ces cours de physique ont finalement payé,|lancez une onde Sinus dévastatrice sur vos ennemis.|Attention au recul ! (cette arme est incomplète)|Attaque : Activez +04:44=Ce n'est pas juste un fromage, c'est une arme bactériologique !|Si il ne provoque que de faibles dommages, sa puissance se|trouve dans sa durée. Il empoisonnera tous les malchanceux|touchés par l'odeur et réduira leur vie à l'agonie !|1-5 : Réglez le minuteur de l'arme|Attaque : maintenez pour la lancer avec plus de force +04:45=Tous ces cours de physique ont finalement payé,|lancez une onde Sinusoidale dévastatrice sur vos ennemis.|Attention au recul ! |Attaque : Activez 04:46=Aspergez vos ennemis de flammes liquides ou creusez vous un passage dans le sol.|Hardi !|Attaque : Activez|Haut/Bas : Continuez à viser|Droite/Gauche : Changer la puissance de tir 04:47=Doublez le fun avec deux mines, piquantes, furtives et collantes.|Provoquez une réaction en chaine dévastatrice et/ou défendez-vous ! |Attaque : maintenez pour tirer avec plus de force (deux fois) 04:48=Outre une bonne bosse, un bon coup de ce marteau enlèvera un tiers de la santé |du hérisson ennemi et l'enfoncera dans le sol ou dans l'eau comme un vulgaire asticot !|Attaque : Activez 04:49=Ressuscite vos amis oubliés six pieds sous terre ! Mais méfiez-vous, ressuscite également vos ennemis. |Attaque : Maintenez attaque pressée pour ressusciter lentement|Haut : Accélérer la résurrection +04:50=Un ennemi se cache sous terre ?|Faîtes le sortir avec l'attaque perforante! |Un avion vous délivrera des roquettes perforantes qui creuseront vers le bas jusqu'a la fin du compte a rebours|ou du contact a l'air libre où elles exploseront|1-5 : Réglez le minuteur des roquettes|Gauche/Droite: Déterminez la direction de l'attaque|Curseur : Choisissez la zone cible +04:51=Gagnez un tir gratuit en lançant une boule de terre sur vos ennemis.|Elle poussera les herissons dans l'eau ou dans un trou afin d'utiliser votre deuxième arme pour l'achever|Attaque : Maintenez pour tirer avec plus de puissance +04:52=UNUSED +04:53=Faîtes un voyage dans le temps et l'espace en|laissant vos camarades se battre seuls!|Soyez préparé à revenir a n'importequel moment|ou lors d'une mort subite ou encore si tout vos camarades sont morts|Attention ne marche pas pendant la mort subite, si vous êtes le dernier survivant ou le roi.|Attaque : Activer +04:54=Et voici le nouveau sol en bouteille! Ce spray produit des flocon collants sur lesquels vous pouvez marchez!|Construisez des pont,enterrez vos ennemis, scellez des tunnels.|Attention à ne pas en mettre sur vous!|Attaque : Activez|Haut/Bas : Continuez à viser|Droite/Gauche : Changer la puissance de tir +04:55=Apportez l'ère glacière sur vos ennemis!|Avec le congélateur gelez les herissons rendez le sol glissant|et sauvez vous de la noyade en gelant l'eau!!|Attaque : Tirez +04:56=Un couteau mais bien plus,|ce hachoir se lance sur les ennemis, bloc les passages et tunnels et|peut même servir d'appui pour gravir une montagne!|Mais attention à ne pas vous blesser.|Attaque : maintenez pour la lancer avec plus de force (deux fois) + ; Game goal strings 05:00=Modes de jeu @@ -461,7 +505,13 @@ 05:10=Terrain indestructible : La plupart des armes sont incapables de modifier le terrain 05:11=Munitions partagées : Toutes les équipes de la même couleur partagent leurs munitions 05:12=Mines à retardement : Les mines exploseront après %1 seconde(s) -05:13=Mines à retardement : Les mines explosent immédiatement +05:13=Mines à retardement : Les mines explosent instentanément 05:14=Mines à retardement : Les mines exploseront dans un délai compris entre 0 et 3 secondes 05:15=Modificateur de dégâts : Toutes les armes feront %1% de dégâts +05:16=La vie de tout les hérissons est restaurée à la fin du tour +05:17=Les hérissons IA réapparaissent lorsqu'ils meurent +05:18=Attaques illimitées +05:19=Les armes sont réinitialisées à la fin du tour +05:20=Les armes ne sont pas partagées entre les hérissons +05:21=Relais: Des équipes sous la même couleur partagent le tour|Temps partagé: Dès que l'un à fini son action il passe la main à sont camarade pour qu'il agisse|avant la fin du tour diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ar.ts --- a/share/hedgewars/Data/Locale/hedgewars_ar.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ar.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -174,6 +190,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Cannot create directory %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -224,6 +255,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -323,6 +366,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -442,10 +489,6 @@ - Theme: - - - Load drawn map @@ -461,6 +504,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -505,7 +552,7 @@ %1 *** %2 has joined - %1 *** %2 انضم + %1 *** %2 انضم %1 *** %2 has left (%3) @@ -534,6 +581,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -684,6 +746,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -825,6 +898,14 @@ + + Play again + + + + Save + + PageInGame @@ -934,6 +1015,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1901,6 +1993,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1989,35 +2085,12 @@ - Main - Error - - - Cannot create directory %1 - Cannot create directory %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Cannot create directory %1 Unable to start the server: %1. - Unable to start the server: %1. - - - Unable to run engine at - - - - Error code: %1 - + Unable to start the server: %1. Video upload - Error @@ -2164,10 +2237,6 @@ - Hedgewars - - - Not all players are ready @@ -2279,6 +2348,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2389,6 +2478,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2990,119 +3098,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_bg.ts --- a/share/hedgewars/Data/Locale/hedgewars_bg.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_bg.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Не може да се създаде папка %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -441,10 +488,6 @@ - Theme: - - - Load drawn map Зареждане на начертана карта @@ -460,6 +503,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -504,7 +551,7 @@ %1 *** %2 has joined - %1 *** %2 се присъедини + %1 *** %2 се присъедини %1 *** %2 has left (%3) @@ -533,6 +580,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -683,6 +745,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -824,6 +897,14 @@ + + Play again + + + + Save + Запазване + PageInGame @@ -933,6 +1014,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1916,6 +2008,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2004,35 +2100,12 @@ - Main - Error - - - Cannot create directory %1 - Не може да се създаде папка %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Не може да се създаде папка %1 Unable to start the server: %1. - Грешка при стартиране на сървъра: %1. - - - Unable to run engine at - - - - Error code: %1 - + Грешка при стартиране на сървъра: %1. Video upload - Error @@ -2180,10 +2253,6 @@ - Hedgewars - - - Not all players are ready @@ -2295,6 +2364,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2405,6 +2494,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3006,119 +3114,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_cs.ts --- a/share/hedgewars/Data/Locale/hedgewars_cs.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_cs.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -179,6 +195,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Nemohu vytvořit adresář %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -229,6 +260,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -328,6 +371,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -447,10 +494,6 @@ - Theme: - - - Load drawn map Nahrát nakreslenou mapu @@ -466,6 +509,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -510,7 +557,7 @@ %1 *** %2 has joined - %1 *** %2 se připojil + %1 *** %2 se připojil %1 *** %2 has left (%3) @@ -539,6 +586,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -689,6 +751,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -836,6 +909,14 @@ <b>%1</b> byl vystrašený a přeskočil tah <b>%2</b> krát. + + Play again + + + + Save + Uložit + PageInGame @@ -945,6 +1026,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1930,6 +2022,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2018,35 +2114,12 @@ - Main - Error - - - Cannot create directory %1 - Nemohu vytvořit adresář %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Nemohu vytvořit adresář %1 Unable to start the server: %1. - Nemohu spustit server: %1. - - - Unable to run engine at - - - - Error code: %1 - + Nemohu spustit server: %1. Video upload - Error @@ -2195,10 +2268,6 @@ - Hedgewars - - - Not all players are ready @@ -2310,6 +2379,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2420,6 +2509,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3021,119 +3129,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_da.ts --- a/share/hedgewars/Data/Locale/hedgewars_da.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_da.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -177,6 +193,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Kan ikke oprette mappe %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -227,6 +258,18 @@ Failed to save StyleSheet to %1 Mislykkedes at gemme typografiark til %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -326,6 +369,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -445,10 +492,6 @@ - Theme: - - - Load drawn map Indlæs tegnet bane @@ -464,6 +507,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -508,7 +555,7 @@ %1 *** %2 has joined - %1 *** %2 har tilsluttet sig + %1 *** %2 har tilsluttet sig %1 *** %2 has left (%3) @@ -537,6 +584,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -687,6 +749,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -828,6 +901,14 @@ <b>%1</b> blev bange og sprang over sin tur <b>%2</b> gange. + + Play again + + + + Save + Gem + PageInGame @@ -937,6 +1018,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1924,6 +2016,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1998,35 +2094,12 @@ - Main - Error - - - Cannot create directory %1 - Kan ikke oprette mappe %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Kan ikke oprette mappe %1 Unable to start the server: %1. - Ude af stand til at starte serveren: %1. - - - Unable to run engine at - - - - Error code: %1 - + Ude af stand til at starte serveren: %1. Error while authenticating at google.com: @@ -2188,10 +2261,6 @@ - Hedgewars - - - Not all players are ready @@ -2303,6 +2372,26 @@ Cancel uploading + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2413,6 +2502,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3014,119 +3122,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_de.ts --- a/share/hedgewars/Data/Locale/hedgewars_de.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_de.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -177,6 +193,24 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Verzeichnis %1 konnte nicht angelegt werden + + + Failed to open data directory: +%1 + +Please check your installation! + Konnte Daten-Verzeichnis nicht öffnen: +%1 + +Bitte überprüfe deine Installation! + HWAskQuitDialog @@ -227,6 +261,18 @@ Failed to save StyleSheet to %1 Style-Sheet konnte nich nach %1 gesichert werden + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -326,6 +372,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -445,10 +495,6 @@ - Theme: - - - Load drawn map Gezeichnete Karte laden @@ -464,6 +510,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -508,7 +558,7 @@ %1 *** %2 has joined - %1 *** %2 ist beigetreten + %1 *** %2 ist beigetreten %1 *** %2 has left (%3) @@ -537,6 +587,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -687,6 +752,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -828,6 +904,14 @@ <b>%1</b> hatte Angst und übersprang <b>%2</b> Runden. + + Play again + + + + Save + Sichern + PageInGame @@ -855,7 +939,7 @@ Play a game across a network - Spiele über ein Netwerk + Spiele über ein Netzwerk Read about who is behind the Hedgewars Project @@ -937,6 +1021,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1926,6 +2021,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2017,37 +2116,37 @@ Main - Error - Hedgewars - Fehler + Hedgewars - Fehler Cannot create directory %1 - Verzeichnis %1 konnte nicht angelegt werden + Verzeichnis %1 konnte nicht angelegt werden Failed to open data directory: %1 Please check your installation! - Konnte Daten-Verzeichnis nicht öffnen: + Konnte Daten-Verzeichnis nicht öffnen: %1 Bitte überprüfe deine Installation! TCP - Error - TCP - Fehler + TCP - Fehler Unable to start the server: %1. - Server %1 konnte nicht gestartet werden. + Server %1 konnte nicht gestartet werden. Unable to run engine at - Konnte Engine nicht starten: + Konnte Engine nicht starten: Error code: %1 - Fehler-Code: %1 + Fehler-Code: %1 Video upload - Error @@ -2055,7 +2154,7 @@ Netgame - Error - Netwerkspiel - Fehler + Netzwerkspiel - Fehler Please select a server from the list @@ -2195,10 +2294,6 @@ - Hedgewars - - - Not all players are ready @@ -2310,6 +2405,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2420,6 +2535,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3021,119 +3155,4 @@ Steuerkreuz - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_el.ts --- a/share/hedgewars/Data/Locale/hedgewars_el.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_el.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Δεν μπορεί να δημιουργηθεί ο κατάλογος %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -324,6 +367,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -443,10 +490,6 @@ - Theme: - - - Load drawn map @@ -462,6 +505,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -506,7 +553,7 @@ %1 *** %2 has joined - %1 *** %2 εισήλθε + %1 *** %2 εισήλθε %1 *** %2 has left (%3) @@ -535,6 +582,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -685,6 +747,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Eraser @@ -826,6 +899,14 @@ Ο <b>%1</b> φοβήθηκε και παραχώρησε τη σειρά του <b>%2</b> φορές. + + Play again + + + + Save + + PageInGame @@ -935,6 +1016,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1918,6 +2010,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1992,35 +2088,12 @@ - Main - Error - - - Cannot create directory %1 - Δεν μπορεί να δημιουργηθεί ο κατάλογος %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Δεν μπορεί να δημιουργηθεί ο κατάλογος %1 Unable to start the server: %1. - Δεν είναι δυνατόν να ξεκινήσει ο εξυπηρετητής : %1. - - - Unable to run engine at - - - - Error code: %1 - + Δεν είναι δυνατόν να ξεκινήσει ο εξυπηρετητής : %1. Error while authenticating at google.com: @@ -2182,10 +2255,6 @@ - Hedgewars - - - Not all players are ready @@ -2297,6 +2366,26 @@ Cancel uploading + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2407,6 +2496,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3008,119 +3116,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_en.ts --- a/share/hedgewars/Data/Locale/hedgewars_en.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_en.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Cannot create directory %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -441,10 +488,6 @@ - Theme: - - - Load drawn map @@ -460,6 +503,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -504,7 +551,7 @@ %1 *** %2 has joined - %1 *** %2 has joined + %1 *** %2 has joined %1 *** %2 has left (%3) @@ -533,6 +580,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -683,6 +745,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -824,6 +897,14 @@ <b>%1</b> was scared and skipped turn <b>%2</b> times. + + Play again + + + + Save + + PageInGame @@ -933,6 +1014,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1900,6 +1992,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1988,35 +2084,12 @@ - Main - Error - - - Cannot create directory %1 - Cannot create directory %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Cannot create directory %1 Unable to start the server: %1. - Unable to start the server: %1. - - - Unable to run engine at - - - - Error code: %1 - + Unable to start the server: %1. Video upload - Error @@ -2164,10 +2237,6 @@ - Hedgewars - - - Not all players are ready @@ -2279,6 +2348,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2389,6 +2478,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2990,119 +3098,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_es.ts --- a/share/hedgewars/Data/Locale/hedgewars_es.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_es.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -177,6 +193,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + No se pudo crear el directorio %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -227,6 +258,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -326,6 +369,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -445,10 +492,6 @@ - Theme: - - - Load drawn map Cargar mapa @@ -464,6 +507,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -508,7 +555,7 @@ %1 *** %2 has joined - %1 *** %2 ha entrado + %1 *** %2 ha entrado %1 *** %2 has left (%3) @@ -537,6 +584,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -687,6 +749,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -828,6 +901,14 @@ <b>%1</b> tenía demasiado miedo y pasó <b>%2</b> turnos. + + Play again + + + + Save + Guardar + PageInGame @@ -937,6 +1018,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1920,6 +2012,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2008,35 +2104,12 @@ - Main - Error - - - Cannot create directory %1 - No se pudo crear el directorio %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + No se pudo crear el directorio %1 Unable to start the server: %1. - No se pudo iniciar el servidor: %1. - - - Unable to run engine at - - - - Error code: %1 - + No se pudo iniciar el servidor: %1. Video upload - Error @@ -2184,10 +2257,6 @@ - Hedgewars - - - Not all players are ready @@ -2299,6 +2368,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2409,6 +2498,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3010,119 +3118,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_fi.ts --- a/share/hedgewars/Data/Locale/hedgewars_fi.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_fi.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Hakemiston %1 luonti epäonnistui + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -441,10 +488,6 @@ - Theme: - - - Load drawn map @@ -460,6 +503,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -504,7 +551,7 @@ %1 *** %2 has joined - %1 *** %2 liittyi + %1 *** %2 liittyi %1 *** %2 has left @@ -533,6 +580,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -683,6 +745,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -824,6 +897,14 @@ + + Play again + + + + Save + + PageInGame @@ -933,6 +1014,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1916,6 +2008,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2004,35 +2100,12 @@ - Main - Error - - - Cannot create directory %1 - Hakemiston %1 luonti epäonnistui - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Hakemiston %1 luonti epäonnistui Unable to start the server: %1. - Palvelinta ei pystytty käynnistämään: %1. - - - Unable to run engine at - - - - Error code: %1 - + Palvelinta ei pystytty käynnistämään: %1. Video upload - Error @@ -2180,10 +2253,6 @@ - Hedgewars - - - Not all players are ready @@ -2295,6 +2364,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2405,6 +2494,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3006,119 +3114,4 @@ Hiiri: Vasen nappi - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_fr.ts --- a/share/hedgewars/Data/Locale/hedgewars_fr.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_fr.ts Thu Jun 13 22:27:23 2013 +0200 @@ -5,14 +5,14 @@ About Unknown Compiler - + Compilateur inconnu AbstractPage Go back - + Retour @@ -30,72 +30,100 @@ BanDialog IP - IP + IP Nick - + Pseudo IP/Nick - + IP/Pseudo Reason - + Raison Duration - + Durée Ok - + Ok Cancel - Annuler + Annuler you know why - + Tu sait très bien pourquoi Warning - + Attention Please, specify %1 - + Veuillez spécifier %1 nickname - + Pseudo permanent - + Permanent DataManager Use Default - + Par défaut FeedbackDialog View - + Voir Cancel - Annuler + Annuler Send Feedback + Envoyez + + + Please give us feedback! + Nous avons besoin de votre avis! + + + We are always happy about suggestions, ideas, or bug reports. + Toutes suggestions, idées ou rapport de bug sont les bienvenus + + + If you found a bug, you can see if it's already known here (english): + Si vous trouvez un bug, vous pouvez vérifier si il est déjà connu ici (anglais): + + + Your email address is optional, but we may want to contact you. + Votre adresse email est optionelle, mais il est possible que nous essayons de vous contacter. + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. @@ -121,106 +149,136 @@ Edit schemes - Éditer les paramètres + Éditer les règles Game scheme will auto-select a weapon - + La règle choisis va choisir automatiquement les armes Map - Carte + Carte Game options - + Option de jeu HWApplication %1 minutes - - - + + %1 minute + %1 minutes %1 hour - - - + + %1 heure + %1 heures %1 hours - - - + + %1 heure + %1 heures %1 day - - - + + %1 jour + %1 jours %1 days - - - + + %1 jour + %1 jours + + Scheme '%1' not supported + Règle incomprise + + + Cannot create directory %1 + Impossible de créer le dossier %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Impossible de trouver les fichiers: +%1 + +Veuillez verifier que votre jeu est installé correctement! + HWAskQuitDialog Do you really want to quit? - + Êtes-vous sûr de vouloir quitter ? HWChatWidget %1 has been removed from your ignore list - + %1 a été retiré de votre liste noire %1 has been added to your ignore list - + %1 a été ajouté à votre liste noire %1 has been removed from your friends list - + %1 a été retiré de votre liste d'amis %1 has been added to your friends list - + %1 a été ajouté à votre liste d'amis Stylesheet imported from %1 - + Feuille de style (Stylesheet) importée de %1 Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - + Entrez %1 si vous voulez utiliser cette Feuille de style (Stylesheet) à l'avenir, entrez %2 pour rétablir l'ancienne apparence! Couldn't read %1 - + Impossible de lire %1 StyleSheet discarded - + Feuille de style (Stylesheet) effacée StyleSheet saved to %1 - + Feuille de style (Stylesheet) enregistrée dans %1 Failed to save StyleSheet to %1 + Impossible d'enregistrer la feuille de style (Stylesheet) dans %1 + + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) @@ -228,7 +286,7 @@ HWForm Cannot save record to file %1 - Impossible de sauvegarder la partie dans le fichier %1 + Impossible de sauvegarder l'enregistrement dans le fichier %1 DefaultTeam @@ -237,7 +295,7 @@ Hedgewars Demo File File Types - Fichier de démonstration d'Hedgewars + Fichier de demo d'Hedgewars Hedgewars Save File @@ -246,36 +304,37 @@ Demo name - + Nom de la Demo Demo name: - + Nom de la Demo: Game aborted - + Abandon de la partie Nickname - Pseudo + Pseudo No nickname supplied. - + Aucun pseudo renseigné. Someone already uses your nickname %1 on the server. Please pick another nickname: - + Quelqu'un utilise déjà le pseudo %1 sur le serveur +Veuillez choisir un autre pseudo: %1's Team - + Equipe de %1 Hedgewars - Nick registered - + Hedgewars - Pseudo enregistré This nick is registered, and you haven't specified a password. @@ -283,43 +342,56 @@ If this nick isn't yours, please register your own nick at www.hedgewars.org Password: - + Ce pseudo est enregistré, vous n'avez spécifié aucun mot de passe. + +Si ce pseudo n'est pas le votre, veuillez enregistrer votre propre pseudo sur www.hedgewars.org + +Mot de passe: Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + Votre pseudo n'est pas enregistré. +Pour éviter que d'autre joueurs l'utilisent, +veuillez l'enregistrer sur www.hedgewars.org Your password wasn't saved either. - + + +Votre mot de passe non plus n'a pas été sauvegardé. Hedgewars - Empty nickname - + Hedgewars - Pseudo vide Hedgewars - Wrong password - + Hedgewars - Mauvais mot de passe You entered a wrong password. - + Le mot de passe que vous avez entré est incorrect Try Again - + Réessayez Hedgewars - Connection error - + Hedgewars - Erreur de connexion You reconnected too fast. Please wait a few seconds and try again. + Vous vous êtes reconnecté trop rapidement. +Attendez quelques secondes et réessayez. + + + This page requires an internet connection. @@ -331,7 +403,7 @@ Cannot open demofile %1 - Erreur lors de l'ouverture du fichier de démonstration %1 + Erreur lors de l'ouverture du fichier de demo %1 @@ -374,90 +446,94 @@ Map type: - + Type de carte: Image map - + Image de la carte Mission map - + Carte avec mission Hand-drawn - + Dessinée Randomly generated - + Générée aléatoirement Random maze - + Labyrinthe généré aléatoirement Random - Aléatoire + Aléatoire Map preview: - + Apperçu de la carte Load map drawing - + Charger un dessin Edit map drawing - + Editer un dessin Small islands - + Petites îles Medium islands - + Moyennes îles Large islands - + Grandes îles Map size: - + Taille de la carte Maze style: - + Style du labyrinthe Mission: - + Mission Map: - + Carte: Theme: - + Theme: Load drawn map - Charger une carte dessinée + Charger une carte dessinée Drawn Maps - + Cartes dessinées All files - + Tout les fichiers Large tunnels + Grands tunnels + + + Theme: %1 @@ -492,7 +568,7 @@ Room destroyed - Salon fermé + Room fermée You got kicked @@ -500,11 +576,11 @@ %1 *** %2 has joined the room - %1 *** %2 a rejoint la salle + %1 *** %2 a rejoint la room %1 *** %2 has joined - %1 *** %2 vient d'arriver + %1 *** %2 vient d'arriver %1 *** %2 has left (%3) @@ -516,69 +592,86 @@ User quit - + S'est déconnecté Remote host has closed connection - + Le serveur à fermé la connection The server is too old. Disconnecting now. - + La version du serveur n'est pas à jour. Déconnexion. HWPasswordDialog Login - + Connexion + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + Pour vous connecter sur le serveur, veuillez entrer vos identifiants. +Si vous n'avez pas de compte sur www.hedgewars.org, +entrez juste votre pseudo. + + + Nickname: + Pseudo + + + Password: + Mot de passe HWUploadVideoDialog Upload video - + Importer une vidéo Upload - + Importer HatButton Change hat (%1) - + Changer de chapeau (%1) HatPrompt Cancel - Annuler + Annuler Use selected hat - + Mettre le chapeau sélectionné Search for a hat: - + Chercher un chapeau: KB SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib. - SDL_ttf a retourné une erreur pendant l'affichage du texte, cela est sûrement causé par le bogue de freetype2. Il est recommandé de mettre à jour la librairie freetype. + SDL_ttf a renvoyé une erreur pendant l'affichage du texte, cela est sûrement causé par le bug de freetype2. Il est recommandé de mettre à jour la librairie freetype. KeyBinder Category - + Catégorie @@ -586,30 +679,30 @@ Duration: %1m %2s - + Durée: %1m %2s Video: %1x%2, - + Vidéo: %1x%2 %1 fps, - + %1 fps, Audio: - + Audio: unknown - + inconnu MapModel No description available. - + Aucune description disponible. @@ -644,42 +737,53 @@ General - Général + Général Bans - + Bans IP/Nick - + IP/Pseudo Expiration - + Durée Reason - + Raison Refresh - + Rafraichir Add - + Ajouter Remove - + Supprimer PageConnecting Connecting... - En connexion... + Connexion... + + + + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + @@ -710,15 +814,15 @@ Drawn Maps - + Cartes dessinées All files - + Tout les fichiers Eraser - + Gomme @@ -729,39 +833,39 @@ Select an action to choose a custom key bind for this team - + Choisissez une action afin d'y attribuer une touche pour cette équipe Use my default - + Touche par defaut Reset all binds - + Reinitialiser toutes les touches Custom Controls - + Préferences de commandes Hat - Chapeau + Chapeau Name - Nom + Nom This hedgehog's name - + Le nom de ce herisson Randomize this hedgehog's name - + Choisis un nom aléatoire pour ce herisson Random Team - Équipes aléatoires + Équipes aléatoires @@ -772,7 +876,7 @@ Health graph - Courbes de santé- + Courbes de santé: Ranking @@ -798,8 +902,8 @@ (%1 kill) - - (%1 tue) + + (%1 tué) @@ -824,78 +928,86 @@ + + Play again + + + + Save + Enregistrer + PageInGame In game... - + En jeu... PageInfo Open the snapshot folder - + Ouvrir le dossier de captures d'écran PageMain Downloadable Content - + Contenu téléchargeable Play a game on a single computer - + Jouer une partie en solo Play a game across a network - + Jouer en ligne Read about who is behind the Hedgewars Project - + A propos de ceux qui sont derrière le projet Hedgewars Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars - + Donnez-nous votre avis, signalez un bug, déposez vos idées, ou dites nous juste à quel point vous aimez Hedgewars Access the user created content downloadable from our website - + Acces au contenu téléchargeable créé par les joueurs, disponible sur notre site Exit game - + Quitter le jeu Manage videos recorded from game - + Gérer les vidéos de parties enregistrées Edit game preferences - + Editer vos préférences de jeu Play a game across a local area network - + Jouer une partie en réseau local Play a game on an official server - + Jouer une partie sur un serveur officiel Feedback - + Contact Play local network game - + Jouer en réseau local Play official network game - + Jouer sur le réseau officiel @@ -906,7 +1018,7 @@ Edit game preferences - + Editer les préférences de jeu @@ -917,19 +1029,30 @@ Edit game preferences - + Editer les préférences de jeu Start - Démarrer + Démarrer Update - Mise à jour + Mise à jour Room controls - + Contrôle de la room + + + + PageNetServer + + Click here for details + Clique pour plus de détails + + + Insert your address here + Insert ton adresse ici @@ -948,19 +1071,19 @@ You can't edit teams from team selection. Go back to main menu to add, edit or delete teams. - Vous ne pouvez pas modifier d'équipe depuis la sélection d'équipes. Retournez au manu principal pour ajouter, modifier ou supprimer des équipes. + Vous ne pouvez pas modifier d'équipe depuis la sélection d'équipes. Retournez au menu principal pour ajouter, modifier ou supprimer des équipes. New scheme - Nouveaux paramètres + Nouvelle règle Edit scheme - Modifier paramètres + Modifier règles Delete scheme - Supprimer paramètres + Supprimer règles New weapon set @@ -976,11 +1099,11 @@ Advanced - Avancé + Avancé Reset to default colors - + Remettre les couleurs de départ Proxy host @@ -1000,7 +1123,7 @@ No proxy - + Pas de proxy Socks5 proxy @@ -1016,71 +1139,71 @@ Select an action to change what key controls it - + Choisissez une action afin d'y attribuer une touche Reset to default - + Par défaut Reset all binds - + Remettre les touches par défaut Game - + Jeu Graphics - + Graphismes Audio - + Audio Controls - + Contrôles Video Recording - + Enregistrement vidéo Network - + Réseau Teams - Équipes + Équipes Schemes - + Règles Weapons - Armes + Armes Frontend - + Interface Custom colors - + Couleurs personalisées Game audio - + Son du jeu Frontend audio - + Son de l'interface Account - + Compte Proxy settings @@ -1088,26 +1211,26 @@ Miscellaneous - + Autre Updates - + Mises à jour Check for updates - + Vérifier les mises à jours Video recording options - + Option d'enregistrement vidéo PagePlayDemo Rename dialog - Boîte de dialogue de renommage + Renommer Enter new file name: @@ -1130,7 +1253,7 @@ Room Name: - Nom du salon: + Nom de la room: Rules: @@ -1150,34 +1273,34 @@ %1 players online - - - + + %1 joueur en ligne + %1 joueurs en ligne Search for a room: - + Chercher une room Create room - + Créer une room Join room - + Rejoindre Room state - + Etat de la room Clear filters - + Enlever les filtres Open server administration page - + Ouvre la page d'administration du serveur @@ -1236,7 +1359,7 @@ Order of play is random instead of in room order. - Ordre de jeu aléatoire plutôt que par ordre dans la salle. + Ordre de jeu aléatoire plutôt que par ordre dans la room. Play with a King. If he dies, your side dies. @@ -1256,7 +1379,7 @@ Disable land objects when generating random maps. - Désactiver les objets de terrain lorsque des cartes aléatoires sont générées. + Désactiver les objets de terrain lorsque des cartes aléatoires sont générées. AI respawns on death. @@ -1292,7 +1415,7 @@ Teams in each clan take successive turns sharing their turn time. - + Les équipes de chaque clans jouent successivement, partageant le temps de leur tour. Add an indestructible border around the terrain @@ -1300,7 +1423,7 @@ Add an indestructible border along the bottom - + Ajouter une bordure indestructible en bas @@ -1326,86 +1449,86 @@ PageSinglePlayer Play a quick game against the computer with random settings - + Jouer une partie rapide contre l'ordinateur avec des règles aléatoires Play a hotseat game against your friends, or AI teams - + Jouer une partie sur cet ordinateur contre vos amis ou l'IA Campaign Mode - + Campagne Practice your skills in a range of training missions - + Améliorez vos competences avec un large choix de missions Watch recorded demos - + Regarder les parties enregistrées Load a previously saved game - + Charger une partie PageTraining No description available - + Aucune description disponible Select a mission! - + Choisis une mission! Pick the mission or training to play - + Choisis une mission ou entraine-toi à jouer Start fighting - + Commencer le combat PageVideos Name - Nom + Nom Size - + Taille %1 bytes - - - + + %1 octet + %1 octets (in progress...) - + (en cours ...) encoding - + encodage uploading - + importation Date: %1 - + Date: %1 Size: %1 - + Taille: %1 @@ -1456,15 +1579,15 @@ Restrict Unregistered Players Join - + Bloquer l'acces au joueurs non-enregistrés Show games in lobby - + Parties en attentes Show games in-progress - + Parties en cours @@ -1491,55 +1614,55 @@ Show ammo menu tooltips - Montrer les astuces du menu des armes. + Montrer les astuces du menu des armes. Save password - + Enregistrer le mot de passe Save account name and password - + Enregistrer le nom de compte et mot de passe Video is private - + Vidéo privée Record audio - + Enregistrer le son Use game resolution - + Utiliser la résolution du jeu Visual effects - + Effets visuels Sound - + Son In-game sound effects - + Effets sonores en jeu Music - + Musique In-game music - + Musique en jeu Frontend sound effects - + Effet sonores de l'interface Frontend music - + Musique de l'interface @@ -1554,15 +1677,15 @@ (System default) - Réglage du système + Automatique (systeme) Community - Communauté + Communauté Any - Aucun + Tout In lobby @@ -1574,63 +1697,63 @@ Disabled - + Aucun Red/Cyan - Rouge/Cyan + Rouge/Cyan Cyan/Red - Cyan/Rouge + Cyan/Rouge Red/Blue - Rouge/Bleu + Rouge/Bleu Blue/Red - Bleu/Rouge + Bleu/Rouge Red/Green - Rouge/Vert + Rouge/Vert Green/Red - Vert/Rouge + Vert/Rouge Side-by-side - + Côte-à-côte Top-Bottom - + Dessus-dessous Red/Cyan grayscale - + Rouge/Cyan niveaux de gris Cyan/Red grayscale - + Cyan/Rouge niveaux de gris Red/Blue grayscale - + Rouge/Bleu niveaux de gris Blue/Red grayscale - + Bleu/Rouge niveaux de gris Red/Green grayscale - + Rouge/Vert niveaux de gris Green/Red grayscale - + Vert/Rouge niveaux de gris @@ -1665,11 +1788,11 @@ Videos - + Vidéos Description - + Description @@ -1736,7 +1859,7 @@ Scheme Name: - Nom de la Configuration: + Nom de la règle: Crate Drops @@ -1752,7 +1875,7 @@ Type - Type + Type Grave @@ -1768,7 +1891,7 @@ Locale - Langue + Langue Explosives @@ -1776,7 +1899,7 @@ Tip: - Conseil : + Conseil: Quality @@ -1800,120 +1923,126 @@ % Rope Length - % longueur de la Corde Ninja + % longueur du grappin Stereo rendering - Rendu stéréo + Rendu stéréo Style - + Style Scheme - + Règles % Get Away Time - + % de temp de fuite There are videos that are currently being processed. Exiting now will abort them. Do you really want to quit? - + Il y a des vidéos actuellement en cours de traitement. +Quitter maintenant arretera le processus +Voulez-vous vraiment quitter? Please provide either the YouTube account name or the email address associated with the Google Account. - + Veuillez indiquer votre email et mot de passe de conexion à youtube Account name (or email): - + Email du compte: Password: - + Mot de passe: Video title: - + Titre de la video: Video description: - + Description de la vidéo: Tags (comma separated): - + Tags (séparer avec une virgule): Description - + Description Nickname - Pseudo + Pseudo Format - + Format Audio codec - + Codecs audio Video codec - + Codecs vidéo Framerate - + Images/secondes Bitrate (Kbps) - + Bitrate(Kb/s) This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Cette version est "en cours de développement" il est possible qu'elle ne soit pas compatible avec les autres versions du jeu, des parties peuvent ne pas fonctionner ou être incompletes! Fullscreen - Plein écran + Plein écran Fullscreen Resolution - + Résolution en plein écran Windowed Resolution - + Résolution fenêtrée Your Email - + Votre email Summary - + Sujet Send system information - + Envoyer des informations système Type the security code: - + Entrez le code de sécurité Revision - + Version de développement This program is distributed under the %1 + Ce programme est distribué par %1 + + + This setting will be effective at next restart. @@ -1925,11 +2054,11 @@ hedgehog %1 - + Hérisson %1 anonymous - + anonyme @@ -1940,7 +2069,7 @@ -r%1 (%2) - + -r%1 (%2) @@ -1960,236 +2089,213 @@ Error while authenticating at google.com: - + Erreur lors de l'authentification à google.com: + Login or password is incorrect - + Identifiant ou mot de passe incorrecte Error while sending metadata to youtube.com: - + Erreur lors de l'envoi des metadata à youtube.com: + Teams - Are you sure? - + Equipes - Etes-vous sûr? Do you really want to delete the team '%1'? - + Voulez-vous vraiment supprimer l'équipe "%1" Cannot delete default scheme '%1'! - + Impossible de retirer la règle par défaut "%1" Please select a record from the list - + Veuillez choisir un enregistrement dans la liste Unable to start server - + Impossible de démarrer le serveur Hedgewars - Error - + Hedgewars - Erreur Hedgewars - Success - + Hedgewars - Succès All file associations have been set - - - - Main - Error - + Les associations d'extensions de fichiers ont été effectuées Cannot create directory %1 - Impossible de créer le dossier %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Impossible de créer le dossier %1 Unable to start the server: %1. - Impossible de démarrer le serveur: %1. - - - Unable to run engine at - - - - Error code: %1 - + Impossible de démarrer le serveur: %1. Video upload - Error - + Importation de vidéo - Erreur Netgame - Error - + Partie en ligne - Erreur Please select a server from the list - + Veuillez choisir un serveur dans la liste Please enter room name - Veuillez saisir le nom du salon + Veuillez saisir le nom d'une room Record Play - Error - + Jouer l'enregistrement - Erreur Please select record from the list - Veuillez sélectionner une partie dans cette liste + Veuillez choisir un enregistrement dans liste Cannot rename to - + Impossible de renommer en Cannot delete file - + Impossible de supprimer le fichier Room Name - Error - + Nom de la room - Erreur Please select room from the list - Veuillez sélectionner un salon dans la liste + Veuillez choisir une room dans la liste Room Name - Are you sure? - + Nom de la room - Etes-vous sûr? The game you are trying to join has started. Do you still want to join the room? - Vous voulez rejoindre une partie qui a déjà commencée. Voulez-vous tout de même rejoindre la salle ? + Vous essayez de rejoindre une partie qui a déjà commencée. +Voulez-vous tout de même rejoindre la room? Schemes - Warning - + Règles - Attention Schemes - Are you sure? - + Règles - Etes-vous sûr? Do you really want to delete the game scheme '%1'? - + Etes-vous sûr de vouloir supprimer cette règle : "%1" ? Videos - Are you sure? - + Vidéos - Etes-vous sûr? Do you really want to delete the video '%1'? - + Etes-vous sûr de vouloir supprimer cette vidéo : "%1" ? Do you really want to remove %1 file(s)? - - - + + Etes-vous sûr de vouloir supprimer %1 fichier? + Etes-vous sûr de vouloir supprimer %1 fichiers? Do you really want to cancel uploading %1? - + Voulez-vous arreter l'importation de %1? File error - + Erreur de fichier Cannot open '%1' for writing - + Impossible d'écrire le fichier %1 Cannot open '%1' for reading - + Impossible de lire le fichier %1 Cannot use the ammo '%1'! - + Impossible d'utiliser cette arme : "%1" Weapons - Warning - + Armes - Attention Cannot overwrite default weapon set '%1'! - + Impossible de remplacer le set d'arme "%1" Cannot delete default weapon set '%1'! - + Impossible de supprimer le set d'arme par défaut "%1" Weapons - Are you sure? - + Armes - Etes-vous sûr? Do you really want to delete the weapon set '%1'? - + Etes-vous sûr de vouloir supprimer le set d'arme "%1"? Hedgewars - Nick not registered - + Hedgewars - Pseudo non-enregistré System Information Preview - + Apreçu des informations système Failed to generate captcha - + Echec de la génération du Captcha Failed to download captcha - + Echec du téléchargement du Captcha Please fill out all fields. Email is optional. - + Veuillez remplir tout les champs. Email optionel. Hedgewars - Warning - + Hedgewars - Attention Hedgewars - Information - - - - Hedgewars - + Hedgewars - Information Not all players are ready - + Les joueurs ne sont pas tous prêts Are you sure you want to start this game? Not all players are ready. - + Etes-vous sûr de vouloir lancer cette partie? +Les joueurs ne sont pas tous prêts. @@ -2204,7 +2310,7 @@ Go! - C'est parti ! + C'est parti! Start @@ -2252,128 +2358,148 @@ More info - + Plus d'info Set default options - + Mettre les options par défaut Open videos directory - + Ouvrir le répertoire Vidéos Play - + Jouer Upload to YouTube - + Importer vers Youtube Cancel uploading - + Annuler l'importation Restore default coding parameters - + Remettre les paramètres de codage par défaut Open the video directory in your system - + Ouvrir le répertoire vidéo dans votre système Play this video - + Lancer cette vidéo Delete this video - + Supprimer cette vidéo Upload this video to your Youtube account - + Importer cette vidéo sur votre compte Youtube + + + Reset + Réinitialiser + + + Set the default server port for Hedgewars + Mettre le port serveur par défaut pour Hedgewars + + + Invite your friends to your server in just 1 click! + Invitez vos amis sur votre serveur en 1 clique! + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + Cliquez pour copier votre URL serveur unique. Envoyez ce lien a vos amis et il pourront vous rejoindre. + + + Start private server + Démarrer un serveur privé RoomNamePrompt Enter a name for your room. - + Entrez un nom pour votre room. Cancel - Annuler + Annuler Create room - + Créer une room RoomsListModel In progress - En cours + En cours Room Name - Nom de la salle + Nom de la room C - C + J T - É + É Owner - Propriétaire + Propriétaire Map - Carte + Carte Rules - Règles + Règles Weapons - Armes + Armes Random Map - Carte Aléatoire + Carte Aléatoire Random Maze - Labyrinthe aléatoire + Labyrinthe aléatoire Hand-drawn - + Dessinée SeedPrompt The map seed is the basis for all random values generated by the game. - + Cette carte est la base pour toutes valeurs aléatoire générées par le jeu. Cancel - Annuler + Annuler Set seed - + Générer une base (graine) Close - + Fermer @@ -2404,25 +2530,44 @@ + TCPBase + + Unable to start server at %1. + Impossible de démarrer un serveur sur %1. + + + Unable to run engine at %1 +Error code: %2 + Impossible de lancer le jeu sur %1 + + + + TeamSelWidget + + At least two teams are required to play! + Il doit y avoir deux équipes minimum pour jouer! + + + TeamShowWidget %1's team - + Equipe de %1 ThemePrompt Cancel - Annuler + Annuler Search for a theme: - + Chercher un thème Use selected theme - + Utiliser le thème séléctionné @@ -2582,38 +2727,38 @@ slot 10 - slot 10 + slot 10 mute audio - + couper le son record - + enregistrer hedgehog info - + Info hérisson binds (categories) Movement - + Mouvements Weapons - Armes + Armes Camera - + Caméra Miscellaneous - + Autre @@ -2624,7 +2769,7 @@ Fire your selected weapon or trigger an utility item: - Tirez avec l'arme sélectionnée et activez un objet utilitaire: + Tirez avec l'arme sélectionnée ou activez un objet: Pick a weapon or a target location under the cursor: @@ -2636,7 +2781,7 @@ Pick a weapon or utility item: - Sélectionnez une arme ou un objet utilitaire: + Sélectionnez une arme ou un objet: Set the timer on bombs and timed weapons: @@ -2660,7 +2805,7 @@ Pause, continue or leave your game: - Stoppez, continuez ou quittez votre partie: + Pause, continuez ou quittez votre partie: Modify the game's volume while playing: @@ -2680,11 +2825,11 @@ Record video: - + Enregistrer la vidéo Hedgehog movement - + Déplacement du herisson @@ -2703,7 +2848,7 @@ Hat - Chapeau + Chapeau (Left) @@ -2743,11 +2888,11 @@ Backspace - Backspace + Retour/Effacer Tab - Tabulation + Tab Return @@ -3009,116 +3154,112 @@ server + Authentication failed + Echec d'authentification + + + 60 seconds cooldown after kick + Bannis pour 60 sec après un kick + + + kicked + Exclus (kick) + + + Ping timeout + Met trop de temps à répondre + + + bye + Aurevoir + + + Empty config entry + Configuration vide + + Not room master - + Vous n'êtes pas le propriétaire de la room Corrupted hedgehogs info - + Info hérisson corrompus too many teams - + trop d'équipes too many hedgehogs - + trop de hérissons There's already a team with same name in the list - + Il y a déja une équipe avec le même nom dans la liste round in progress - + La partie est en cour restricted - + Ajout interdis REMOVE_TEAM: no such team - + REMOVE_TEAM: aucune équipe de ce nom Not team owner! - + Vous n'êtes pas le propriétaire de cette équipe! Less than two clans! - + Il faut 2 clans minimum! Room with such name already exists - + Ce nom de room existe déjà + + + Illegal room name + Nom de room invalide + + + No such room + Cette room n'existe pas + + + Joining restricted + Accès interdis + + + Registered users only + Accès réservé aux utilisateurs enregistré + + + You are banned in this room + Vous avez été bannis de cette room Nickname already chosen - + Pseudo déjà choisis Illegal nickname - + Pseudo invalide Protocol already known - + Protocole déjà connu Bad number - + Mauvais numéro Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - + Ce pseudo est actuellement utilisé sur le serveur diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_gl.ts --- a/share/hedgewars/Data/Locale/hedgewars_gl.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_gl.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Non se puido crear o directorio %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -441,10 +488,6 @@ - Theme: - - - Load drawn map @@ -460,6 +503,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -504,7 +551,7 @@ %1 *** %2 has joined - %1 *** %2 uniuse + %1 *** %2 uniuse %1 *** %2 has left (%3) @@ -533,6 +580,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -683,6 +745,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Eraser @@ -824,6 +897,14 @@ + + Play again + + + + Save + + PageInGame @@ -933,6 +1014,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1904,6 +1996,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1978,35 +2074,12 @@ - Main - Error - - - Cannot create directory %1 - Non se puido crear o directorio %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Non se puido crear o directorio %1 Unable to start the server: %1. - Non se puido iniciar o servidor: %1. - - - Unable to run engine at - - - - Error code: %1 - + Non se puido iniciar o servidor: %1. Error while authenticating at google.com: @@ -2167,10 +2240,6 @@ - Hedgewars - - - Not all players are ready @@ -2282,6 +2351,26 @@ Cancel uploading + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2392,6 +2481,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2993,119 +3101,4 @@ Mando - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_hu.ts --- a/share/hedgewars/Data/Locale/hedgewars_hu.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_hu.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -167,6 +183,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Nem sikerült létrehozni %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,6 +248,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -316,6 +359,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -435,10 +482,6 @@ - Theme: - - - Load drawn map @@ -454,6 +497,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -498,7 +545,7 @@ %1 *** %2 has joined - %1 *** %2 csatlakozott + %1 *** %2 csatlakozott %1 *** %2 has left (%3) @@ -527,6 +574,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -677,6 +739,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -812,6 +885,14 @@ + + Play again + + + + Save + + PageInGame @@ -921,6 +1002,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1890,6 +1982,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1978,35 +2074,12 @@ - Main - Error - - - Cannot create directory %1 - Nem sikerült létrehozni %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Nem sikerült létrehozni %1 Unable to start the server: %1. - Nem sikerült a szerverhez csatlakozni: %1. - - - Unable to run engine at - - - - Error code: %1 - + Nem sikerült a szerverhez csatlakozni: %1. Video upload - Error @@ -2152,10 +2225,6 @@ - Hedgewars - - - Not all players are ready @@ -2267,6 +2336,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2377,6 +2466,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2978,119 +3086,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_it.ts --- a/share/hedgewars/Data/Locale/hedgewars_it.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_it.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,34 @@ Send Feedback Invia Commento + + Please give us feedback! + Per favore, inviaci un commento! + + + We are always happy about suggestions, ideas, or bug reports. + Siamo sempre felici di ricevere suggerimenti, idee o segnalazioni di bachi. + + + If you found a bug, you can see if it's already known here (english): + Se torvi u nbaco, puoi vedere se è già conosciuto qui (in inglese): + + + Your email address is optional, but we may want to contact you. + Il tuo indirizzo di posta elettronica è opzionale, ma potremmo volerti contattare. + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -177,6 +205,24 @@ %1 giorni + + Scheme '%1' not supported + + + + Cannot create directory %1 + Impossibile creare la directory %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Impossibile creare la directory dati: +%1 + +Per favore controlla l'installazione! + HWAskQuitDialog @@ -227,6 +273,18 @@ Failed to save StyleSheet to %1 Impossibile salvare la StyleSheet in %1! Errore interno! + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -336,6 +394,10 @@ Ti sei ricollegato troppo velocemente. Per favore aspetta qualche secondo e prova di nuovo. + + This page requires an internet connection. + + HWGame @@ -456,7 +518,7 @@ Theme: - Tema: + Tema: Load drawn map @@ -474,6 +536,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -518,7 +584,7 @@ %1 *** %2 has joined - %1 *** %2 è entrato + %1 *** %2 è entrato %1 *** %2 has left (%3) @@ -547,6 +613,24 @@ Login Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + Per collegarsi al server, per favore accedi. + +Se non possiedi un account su www.hedgewars.org, +inserisci solo il tuo soprannome. + + + Nickname: + Soprannome: + + + Password: + Password: + HWUploadVideoDialog @@ -697,6 +781,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -838,6 +933,14 @@ <b>%1</b> aveva paura e ha passato il turno <b>%2</b> volte. + + Play again + + + + Save + Salva + PageInGame @@ -905,11 +1008,11 @@ Play local network game - + Gioca una partita in rete locale Play official network game - + Gioca una partita sul server ufficiale @@ -947,6 +1050,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + Inserisci il tuo indirizzo + + + PageOptions New team @@ -1938,6 +2052,10 @@ This program is distributed under the %1 Questo programma è distribuito secondo i termini di %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2027,37 +2145,37 @@ Main - Error - Main - Errore + Main - Errore Cannot create directory %1 - Impossibile creare la directory %1 + Impossibile creare la directory %1 Failed to open data directory: %1 Please check your installation! - Impossibile creare la directory dati: + Impossibile creare la directory dati: %1 Per favore controlla l'installazione! TCP - Error - TCP - Errore + TCP - Errore Unable to start the server: %1. - Impossibile avviare il server: %1. + Impossibile avviare il server: %1. Unable to run engine at - Impossibile avviare il motore a + Impossibile avviare il motore a Error code: %1 - Codice di errore: %1 + Codice di errore: %1 Video upload - Error @@ -2206,7 +2324,7 @@ Hedgewars - Hedgewars + Hedgewars Not all players are ready @@ -2321,6 +2439,26 @@ Upload this video to your Youtube account Cariva questo video nel tuo account Youtube + + Reset + Ripristina + + + Set the default server port for Hedgewars + Seleziona la porta di configurazione del server di Hedgewars + + + Invite your friends to your server in just 1 click! + Invita i tuoi amici sul tuo serve con 1 solo clic! + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + Clicca per copiare il tuo URL univoco del serve negli appunti. Invia questo collegamento ai tuoi amici e potranno unirsi a te. + + + Start private server + Avvia un server privato + RoomNamePrompt @@ -2431,6 +2569,26 @@ + TCPBase + + Unable to start server at %1. + Impossibile avviare il server a %1. + + + Unable to run engine at %1 +Error code: %2 + Impossibile eseguire il motore a %1 +Codice di errore: %2 + + + + TeamSelWidget + + At least two teams are required to play! + Servono almeno due squadre per giocare! + + + TeamShowWidget %1's team @@ -3036,115 +3194,111 @@ server Not room master - Non proprietario della stanza + Non proprietario della stanza Corrupted hedgehogs info - Informazioni ricci corrotte + Informazioni ricci corrotte too many teams - troppe squadre + troppe squadre too many hedgehogs - troppi ricci + troppi ricci There's already a team with same name in the list - C'è già una quadra collo stesso nome in lista + C'è già una quadra collo stesso nome in lista round in progress - turno in corso + turno in corso restricted - proibito + proibito REMOVE_TEAM: no such team - CANCELLA_SQUADRA: squadra non presente + CANCELLA_SQUADRA: squadra non presente Not team owner! - Non proprietario della squadra! + Non proprietario della squadra! Less than two clans! - Meno di due clan! + Meno di due clan! Room with such name already exists - Esiste già una stanza con questo nome + Esiste già una stanza con questo nome Nickname already chosen - Nome già scelto + Nome già scelto Illegal nickname - Nome non valido + Nome non valido Protocol already known - Protocollo già conosciuto + Protocollo già conosciuto Bad number - Numero non valido + Numero non valido Nickname is already in use - Nome già in uso - - - No checker rights - + Nome già in uso Authentication failed - Autenticazione fallita + Autenticazione fallita 60 seconds cooldown after kick - 60 secondi di raffreddamento prima dell'espulsione + 60 secondi di raffreddamento prima dell'espulsione kicked - espulso + espulso Ping timeout - Scadenza ping + Scadenza ping bye - ciao + ciao Illegal room name - Nome stanza non valido + Nome stanza non valido No such room - Stanza non esistente + Stanza non esistente Joining restricted - Ingresso riservato + Ingresso riservato Registered users only - Solo utenti registrati + Solo utenti registrati You are banned in this room - Sei stato espulso dalla stanza + Sei stato espulso dalla stanza Empty config entry - Configurazione vuota + Configurazione vuota diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ja.ts --- a/share/hedgewars/Data/Locale/hedgewars_ja.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ja.ts Thu Jun 13 22:27:23 2013 +0200 @@ -34,11 +34,11 @@ Nick - + ニックネーム IP/Nick - + IP/ニックネーム Reason @@ -50,11 +50,11 @@ Ok - + オッケー Cancel - キャンセル + キャンセル you know why @@ -62,7 +62,7 @@ Warning - + 警報メッセージ Please, specify %1 @@ -70,7 +70,7 @@ nickname - + ニックネーム permanent @@ -92,12 +92,28 @@ Cancel - キャンセル + キャンセル Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -128,7 +144,7 @@ Map - 地図 + 地図 Game options @@ -139,34 +155,49 @@ HWApplication %1 minutes - - + + %1分 %1 hour - - + + %1時 %1 hours - - + + %1時 %1 day - + %1日 %1 days - - + + %1日 + + Scheme '%1' not supported + + + + Cannot create directory %1 + フォルダー%1作成拒否 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,6 +248,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -252,7 +295,7 @@ Nickname - + ニックネーム No nickname supplied. @@ -265,7 +308,7 @@ %1's Team - + %1のチーム Hedgewars - Nick registered @@ -316,6 +359,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -435,10 +482,6 @@ - Theme: - - - Load drawn map @@ -454,6 +497,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -498,7 +545,7 @@ %1 *** %2 has joined - %1 *** %2 さんは参加 + %1 *** %2 さんは参加 %1 *** %2 has left (%3) @@ -525,6 +572,21 @@ HWPasswordDialog Login + ログイン + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: @@ -536,7 +598,7 @@ Upload - + アップロード @@ -550,7 +612,7 @@ HatPrompt Cancel - キャンセル + キャンセル Use selected hat @@ -638,7 +700,7 @@ General - 一般 + 一般 Bans @@ -646,7 +708,7 @@ IP/Nick - + IP/ニックネーム Expiration @@ -677,6 +739,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -688,11 +761,11 @@ Load - ロード + ロード Save - + セーブ Load drawn map @@ -812,6 +885,14 @@ + + Play again + + + + Save + セーブ + PageInGame @@ -909,11 +990,11 @@ Start - スタート + スタート Update - 更新 + 更新 Room controls @@ -921,6 +1002,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -964,7 +1056,7 @@ Advanced - 高級 + 高級 Reset to default colors @@ -1016,7 +1108,7 @@ Game - + ゲーム Graphics @@ -1824,7 +1916,7 @@ Nickname - + ニックネーム Format @@ -1886,6 +1978,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1974,35 +2070,12 @@ - Main - Error - - - Cannot create directory %1 - フォルダー%1作成拒否 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + フォルダー%1作成拒否 Unable to start the server: %1. - サーバー%1の起動は出来なかった - - - Unable to run engine at - - - - Error code: %1 - + サーバー%1の起動は出来なかった Video upload - Error @@ -2148,10 +2221,6 @@ - Hedgewars - - - Not all players are ready @@ -2263,6 +2332,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2272,7 +2361,7 @@ Cancel - キャンセル + キャンセル Create room @@ -2334,7 +2423,7 @@ Cancel - キャンセル + キャンセル Set seed @@ -2373,6 +2462,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2383,7 +2491,7 @@ ThemePrompt Cancel - キャンセル + キャンセル Search for a theme: @@ -2974,119 +3082,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ko.ts --- a/share/hedgewars/Data/Locale/hedgewars_ko.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ko.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -167,6 +183,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,6 +248,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -316,6 +359,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -435,10 +482,6 @@ - Theme: - - - Load drawn map @@ -454,6 +497,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -497,10 +544,6 @@ - %1 *** %2 has joined - - - %1 *** %2 has left (%3) @@ -527,6 +570,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -677,6 +735,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -812,6 +881,14 @@ + + Play again + + + + Save + + PageInGame @@ -917,6 +994,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1862,6 +1950,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1950,37 +2042,6 @@ - Main - Error - - - - Cannot create directory %1 - - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - - - - Unable to start the server: %1. - - - - Unable to run engine at - - - - Error code: %1 - - - Video upload - Error @@ -2124,10 +2185,6 @@ - Hedgewars - - - Not all players are ready @@ -2239,6 +2296,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2349,6 +2426,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2950,119 +3046,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_lt.ts --- a/share/hedgewars/Data/Locale/hedgewars_lt.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_lt.ts Thu Jun 13 22:27:23 2013 +0200 @@ -97,7 +97,7 @@ DataManager - + Use Default @@ -105,17 +105,37 @@ FeedbackDialog - + + We are always happy about suggestions, ideas, or bug reports. + + + + + Send us feedback! + + + + + If you found a bug, you can see if it's already been reported here: + + + + + Your email address is optional, but necessary if you want us to get back at you. + + + + View - + Cancel - + Send Feedback @@ -217,6 +237,24 @@ + + + Scheme '%1' not supported + + + + + Cannot create directory %1 + + + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -229,52 +267,67 @@ HWChatWidget - + + %1 has joined + + + + + %1 has left + + + + + %1 has left (%2) + + + + %1 has been removed from your ignore list - + %1 has been added to your ignore list - + %1 has been removed from your friends list - + %1 has been added to your friends list - + Stylesheet imported from %1 - + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - + Couldn't read %1 - + StyleSheet discarded - + StyleSheet saved to %1 - + Failed to save StyleSheet to %1 @@ -287,23 +340,23 @@ - + Game aborted - + Nickname - - + + No nickname supplied. - + Someone already uses your nickname %1 on the server. Please pick another nickname: @@ -314,12 +367,12 @@ - + Hedgewars - Nick registered - + This nick is registered, and you haven't specified a password. If this nick isn't yours, please register your own nick at www.hedgewars.org @@ -328,90 +381,95 @@ - + Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + Your password wasn't saved either. - - + + Hedgewars - Empty nickname - + Hedgewars - Wrong password - + You entered a wrong password. - + Try Again - + Hedgewars - Connection error - + You reconnected too fast. Please wait a few seconds and try again. - - + + Cannot save record to file %1 - + Hedgewars Demo File File Types - + Hedgewars Save File File Types - + Demo name - + Demo name: + + + This page requires an internet connection. + + HWGame - + en.txt lt.txt - + Cannot open demofile %1 @@ -419,158 +477,158 @@ HWMapContainer - + Map type: - - Image map - - - - Mission map + Image map - Hand-drawn + Mission map - Randomly generated + Hand-drawn + Randomly generated + + + + Random maze - + Random - + Map preview: - + Load map drawing - + Edit map drawing - - All - - - - - Small - - - - - Medium - - - - Large + All - Cavern + Small + Medium + + + + + Large + + + + + Cavern + + + + Wacky - - Large tunnels - - - - - Small islands - - - - - Medium islands - - - + Large tunnels + + + + + Small islands + + + + + Medium islands + + + + Large islands - + Map size: - + Maze style: - + Mission: - + Map: - - - Theme: - - - - + + + Theme: %1 + + + + Load drawn map - + Drawn Maps - + All files - + Small tunnels - + Medium tunnels - + Seed @@ -621,40 +679,33 @@ - + Room destroyed - + You got kicked - - + + %1 *** %2 has joined the room - - %1 *** %2 has joined - - - - - + %1 *** %2 has left - - + %1 *** %2 has left (%3) - + Quit reason: @@ -666,6 +717,24 @@ Login + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + + Nickname: + + + + + Password: + + HWUploadVideoDialog @@ -691,17 +760,17 @@ HatPrompt - + Search for a hat: - + Cancel - + Use selected hat @@ -846,6 +915,19 @@ + PageDataDownload + + + Loading, please wait. + + + + + This page requires an internet connection. + + + + PageDrawMap @@ -966,12 +1048,22 @@ - + + Play again + + + + + Save + + + + The best shot award was won by <b>%1</b> with <b>%2</b> pts. - + The best killer is <b>%1</b> with <b>%2</b> kills in a turn. @@ -980,7 +1072,7 @@ - + A total of <b>%1</b> hedgehog(s) were killed during this round. @@ -989,7 +1081,7 @@ - + (%1 kill) @@ -998,7 +1090,7 @@ - + <b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts. @@ -1007,7 +1099,7 @@ - + <b>%1</b> killed <b>%2</b> of his own hedgehogs. @@ -1016,7 +1108,7 @@ - + <b>%1</b> was scared and skipped turn <b>%2</b> times. @@ -1117,12 +1209,12 @@ PageMultiplayer - + Edit game preferences - + Start @@ -1151,6 +1243,19 @@ + PageNetServer + + + Click here for details + + + + + Insert your address here + + + + PageOptions @@ -1269,97 +1374,97 @@ - + Frontend - + Custom colors - + Reset to default colors - + Game audio - + Frontend audio - + Account - + Proxy settings - - Proxy host - - - - - Proxy port - - - - Proxy login + Proxy host + Proxy port + + + + + Proxy login + + + + Proxy password - - No proxy - - - - - System proxy settings - - - - Socks5 proxy + No proxy + System proxy settings + + + + + Socks5 proxy + + + + HTTP proxy - + Miscellaneous - + Updates - + Check for updates - + Video recording options @@ -1380,52 +1485,52 @@ PageRoomsList - + Search for a room: - + Create room - + Join room - + Room state - + Rules: - + Weapons: - + Clear filters - + Admin features - + Open server administration page - + %1 players online @@ -1739,23 +1844,23 @@ - + Ignore - + Add friend - - Unignore - - - + Unignore + + + + Remove friend @@ -1775,12 +1880,12 @@ - + Show games in lobby - + Show games in-progress @@ -1788,75 +1893,75 @@ QCheckBox - + Show ammo menu tooltips - + Alternative damage show - + Visual effects - - + + Sound - + In-game sound effects - - + + Music - + In-game music - + Frontend sound effects - + Frontend music - + Append date and time to record file name - + Check for updates at startup - + Fullscreen - + Show FPS - - + + Save password @@ -1871,12 +1976,12 @@ - + Record audio - + Use game resolution @@ -1899,88 +2004,88 @@ - + (System default) - - Disabled - - - - - Red/Cyan - - - - Cyan/Red + Disabled - Red/Blue + Red/Cyan - Blue/Red + Cyan/Red - Red/Green + Red/Blue + Blue/Red + + + + + Red/Green + + + + Green/Red + + Side-by-side + + + + + Top-Bottom + + + + + Red/Cyan grayscale + + + + + Cyan/Red grayscale + + + + + Red/Blue grayscale + + + + + Blue/Red grayscale + + + - Side-by-side + Red/Green grayscale - Top-Bottom - - - - - Red/Cyan grayscale - - - - - Cyan/Red grayscale - - - - - Red/Blue grayscale - - - - - Blue/Red grayscale - - - - - Red/Green grayscale - - - - Green/Red grayscale - - + + Any @@ -2018,7 +2123,7 @@ - + Playing teams @@ -2096,42 +2201,47 @@ - + Tip: - + This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Server name: - + Server port: - + Locale - + Nickname - + + This setting will be effective at next restart. + + + + Resolution - + Quality @@ -2151,17 +2261,17 @@ - + Stereo rendering - + Initial sound volume - + FPS limit @@ -2283,52 +2393,52 @@ - + Your Email - - Summary - - - + Summary + + + + Send system information - + Description - + Type the security code: - + Format - + Audio codec - + Video codec - + Framerate - + Bitrate (Kbps) @@ -2336,7 +2446,7 @@ QLineEdit - + unnamed @@ -2347,7 +2457,7 @@ - + anonymous @@ -2378,81 +2488,82 @@ - + Cannot delete default scheme '%1'! - + Please select a record from the list - + Hedgewars - Nick not registered - + Unable to start server - + Connection to server is lost + + Not all players are ready + + + + + Are you sure you want to start this game? +Not all players are ready. + + + + + + Hedgewars - Error + + + + + System Information Preview + + + + + + Failed to generate captcha + + + + + Failed to download captcha + + + + + Please fill out all fields. Email is optional. + + + + + + Hedgewars - Success + + + - Not all players are ready - - - - - Are you sure you want to start this game? -Not all players are ready. - - - - - Hedgewars - Error - - - - - System Information Preview - - - - - - Failed to generate captcha - - - - - Failed to download captcha - - - - - Please fill out all fields. Email is optional. - - - - - - Hedgewars - Success - - - - All file associations have been set - + File association failed. @@ -2490,46 +2601,6 @@ - - - Main - Error - - - - - Cannot create directory %1 - - - - - Failed to open data directory: -%1 - -Please check your installation! - - - - - - TCP - Error - - - - - Unable to start the server: %1. - - - - - Unable to run engine at - - - - - Error code: %1 - - - Netgame - Error @@ -2570,22 +2641,22 @@ - + Room Name - Error - + Please select room from the list - + Room Name - Are you sure? - + The game you are trying to join has started. Do you still want to join the room? @@ -2634,7 +2705,7 @@ - + File error @@ -2645,7 +2716,7 @@ - + Cannot open '%1' for reading @@ -2676,26 +2747,20 @@ - + Hedgewars - Warning - + Hedgewars - Information - - - Hedgewars - - QPushButton - default @@ -2737,12 +2802,37 @@ + + Reset + + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start - + + Start private server + + + + Associate file extensions @@ -2775,12 +2865,12 @@ - + Set default options - + Restore default coding parameters @@ -2962,6 +3052,28 @@ + TCPBase + + + Unable to start server at %1. + + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + + At least two teams are required to play! + + + + TeamShowWidget @@ -2972,17 +3084,17 @@ ThemePrompt - + Search for a theme: - + Cancel - + Use selected theme @@ -3355,7 +3467,7 @@ - + Keyboard @@ -3715,147 +3827,4 @@ - - server - - - Not room master - - - - - Corrupted hedgehogs info - - - - - too many teams - - - - - too many hedgehogs - - - - - There's already a team with same name in the list - - - - - round in progress - - - - - restricted - - - - - REMOVE_TEAM: no such team - - - - - Not team owner! - - - - - Less than two clans! - - - - - Room with such name already exists - - - - - Nickname already chosen - - - - - Illegal nickname - - - - - Protocol already known - - - - - Bad number - - - - - Nickname is already in use - - - - - No checker rights - - - - - Authentication failed - - - - - 60 seconds cooldown after kick - - - - - kicked - - - - - Ping timeout - - - - - bye - - - - - Illegal room name - - - - - No such room - - - - - Joining restricted - - - - - Registered users only - - - - - You are banned in this room - - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ms.ts --- a/share/hedgewars/Data/Locale/hedgewars_ms.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ms.ts Thu Jun 13 22:27:23 2013 +0200 @@ -97,7 +97,7 @@ DataManager - + Use Default @@ -105,17 +105,37 @@ FeedbackDialog - + + We are always happy about suggestions, ideas, or bug reports. + + + + + Send us feedback! + + + + + If you found a bug, you can see if it's already been reported here: + + + + + Your email address is optional, but necessary if you want us to get back at you. + + + + View - + Cancel - + Send Feedback @@ -205,6 +225,24 @@ + + + Scheme '%1' not supported + + + + + Cannot create directory %1 + + + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,52 +255,67 @@ HWChatWidget - + + %1 has joined + + + + + %1 has left + + + + + %1 has left (%2) + + + + %1 has been removed from your ignore list - + %1 has been added to your ignore list - + %1 has been removed from your friends list - + %1 has been added to your friends list - + Stylesheet imported from %1 - + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - + Couldn't read %1 - + StyleSheet discarded - + StyleSheet saved to %1 - + Failed to save StyleSheet to %1 @@ -280,17 +333,17 @@ - + Game aborted - + Hedgewars - Nick registered - + This nick is registered, and you haven't specified a password. If this nick isn't yours, please register your own nick at www.hedgewars.org @@ -299,107 +352,112 @@ - + Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + Your password wasn't saved either. - + Nickname - + Someone already uses your nickname %1 on the server. Please pick another nickname: - - + + No nickname supplied. - - + + Hedgewars - Empty nickname - + Hedgewars - Wrong password - + You entered a wrong password. - + Try Again - + Hedgewars - Connection error - + You reconnected too fast. Please wait a few seconds and try again. - - + + Cannot save record to file %1 - + Hedgewars Demo File File Types - + Hedgewars Save File File Types - + Demo name - + Demo name: + + + This page requires an internet connection. + + HWGame - + en.txt ms.txt - + Cannot open demofile %1 @@ -407,158 +465,158 @@ HWMapContainer - + Map type: - - Image map - - - - Mission map + Image map - Hand-drawn + Mission map - Randomly generated + Hand-drawn + Randomly generated + + + + Random maze - + Random - + Map preview: - + Load map drawing - + Edit map drawing - - All - - - - - Small - - - - - Medium - - - - Large + All - Cavern + Small + Medium + + + + + Large + + + + + Cavern + + + + Wacky - - Large tunnels - - - - - Small islands - - - - - Medium islands - - - + Large tunnels + + + + + Small islands + + + + + Medium islands + + + + Large islands - + Map size: - + Maze style: - + Mission: - + Map: - - - Theme: - - - - + + + Theme: %1 + + + + Load drawn map - + Drawn Maps - + All files - + Small tunnels - + Medium tunnels - + Seed @@ -584,7 +642,7 @@ HWNewNet - + Quit reason: @@ -614,35 +672,28 @@ - + You got kicked - - %1 *** %2 has joined - - - - - + %1 *** %2 has left - - + %1 *** %2 has left (%3) - - + + %1 *** %2 has joined the room - + Room destroyed @@ -654,6 +705,24 @@ Login + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + + Nickname: + + + + + Password: + + HWUploadVideoDialog @@ -679,17 +748,17 @@ HatPrompt - + Search for a hat: - + Cancel - + Use selected hat @@ -834,6 +903,19 @@ + PageDataDownload + + + Loading, please wait. + + + + + This page requires an internet connection. + + + + PageDrawMap @@ -954,47 +1036,57 @@ - + + Play again + + + + + Save + + + + The best shot award was won by <b>%1</b> with <b>%2</b> pts. - + The best killer is <b>%1</b> with <b>%2</b> kills in a turn. - + A total of <b>%1</b> hedgehog(s) were killed during this round. - + (%1 kill) - + <b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts. - + <b>%1</b> killed <b>%2</b> of his own hedgehogs. - + <b>%1</b> was scared and skipped turn <b>%2</b> times. @@ -1093,12 +1185,12 @@ PageMultiplayer - + Edit game preferences - + Start @@ -1127,6 +1219,19 @@ + PageNetServer + + + Click here for details + + + + + Insert your address here + + + + PageOptions @@ -1245,97 +1350,97 @@ - + Frontend - + Custom colors - + Reset to default colors - + Game audio - + Frontend audio - + Account - + Proxy settings - - Proxy host - - - - - Proxy port - - - - Proxy login + Proxy host + Proxy port + + + + + Proxy login + + + + Proxy password - - No proxy - - - - - System proxy settings - - - - Socks5 proxy + No proxy + System proxy settings + + + + + Socks5 proxy + + + + HTTP proxy - + Miscellaneous - + Updates - + Check for updates - + Video recording options @@ -1356,52 +1461,52 @@ PageRoomsList - + Search for a room: - + Create room - + Join room - + Room state - + Rules: - + Weapons: - + Clear filters - + Admin features - + Open server administration page - + %1 players online @@ -1726,33 +1831,33 @@ - + Ignore - + Add friend - - Unignore - - - + Unignore + + + + Remove friend - + Show games in lobby - + Show games in-progress @@ -1760,8 +1865,8 @@ QCheckBox - - + + Save password @@ -1776,79 +1881,79 @@ - + Check for updates at startup - + Fullscreen - + Alternative damage show - + Show FPS - + Show ammo menu tooltips - + Visual effects - - + + Sound - + In-game sound effects - - + + Music - + In-game music - + Frontend sound effects - + Frontend music - + Append date and time to record file name - + Record audio - + Use game resolution @@ -1871,88 +1976,88 @@ - + (System default) - - Disabled - - - - - Red/Cyan - - - - Cyan/Red + Disabled - Red/Blue + Red/Cyan - Blue/Red + Cyan/Red - Red/Green + Red/Blue + Blue/Red + + + + + Red/Green + + + + Green/Red + + Side-by-side + + + + + Top-Bottom + + + + + Red/Cyan grayscale + + + + + Cyan/Red grayscale + + + + + Red/Blue grayscale + + + + + Blue/Red grayscale + + + - Side-by-side + Red/Green grayscale - Top-Bottom - - - - - Red/Cyan grayscale - - - - - Cyan/Red grayscale - - - - - Red/Blue grayscale - - - - - Blue/Red grayscale - - - - - Red/Green grayscale - - - - Green/Red grayscale - - + + Any @@ -2000,7 +2105,7 @@ - + Playing teams @@ -2080,47 +2185,47 @@ - + Your Email - - Summary - - - + Summary + + + + Send system information - + Description - + Type the security code: + + Tip: + + + - Tip: - - - - This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Server name: - + Server port: @@ -2130,22 +2235,27 @@ - + Locale - + Nickname - + + This setting will be effective at next restart. + + + + Resolution - + Quality @@ -2165,17 +2275,17 @@ - + Stereo rendering - + Initial sound volume - + FPS limit @@ -2260,27 +2370,27 @@ - + Format - + Audio codec - + Video codec - + Framerate - + Bitrate (Kbps) @@ -2308,7 +2418,7 @@ QLineEdit - + unnamed @@ -2319,7 +2429,7 @@ - + anonymous @@ -2350,125 +2460,86 @@ - + Cannot delete default scheme '%1'! - + Please select a record from the list - + Hedgewars - Nick not registered - + Unable to start server - + Connection to server is lost + + Not all players are ready + + + + + Are you sure you want to start this game? +Not all players are ready. + + + + + + Hedgewars - Error + + + + + System Information Preview + + + + + + Failed to generate captcha + + + + + Failed to download captcha + + + + + Please fill out all fields. Email is optional. + + + + + + Hedgewars - Success + + + - Not all players are ready - - - - - Are you sure you want to start this game? -Not all players are ready. - - - - - Hedgewars - Error - - - - - System Information Preview - - - - - - Failed to generate captcha - - - - - Failed to download captcha - - - - - Please fill out all fields. Email is optional. - - - - - - Hedgewars - Success - - - - All file associations have been set - + File association failed. - - - Main - Error - - - - - Cannot create directory %1 - - - - - Failed to open data directory: -%1 - -Please check your installation! - - - - - - TCP - Error - - - - - Unable to start the server: %1. - - - - - Unable to run engine at - - - - - Error code: %1 - - - Error while authenticating at google.com: @@ -2532,22 +2603,22 @@ - + Room Name - Error - + Please select room from the list - + Room Name - Are you sure? - + The game you are trying to join has started. Do you still want to join the room? @@ -2594,7 +2665,7 @@ - + File error @@ -2605,7 +2676,7 @@ - + Cannot open '%1' for reading @@ -2646,20 +2717,15 @@ - + Hedgewars - Warning - + Hedgewars - Information - - - Hedgewars - - QPushButton @@ -2670,7 +2736,6 @@ - default @@ -2712,12 +2777,37 @@ + + Reset + + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start - + + Start private server + + + + Associate file extensions @@ -2745,12 +2835,12 @@ - + Set default options - + Restore default coding parameters @@ -2932,6 +3022,28 @@ + TCPBase + + + Unable to start server at %1. + + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + + At least two teams are required to play! + + + + TeamShowWidget @@ -2942,17 +3054,17 @@ ThemePrompt - + Search for a theme: - + Cancel - + Use selected theme @@ -3643,7 +3755,7 @@ - + Keyboard @@ -3685,147 +3797,4 @@ - - server - - - Not room master - - - - - Corrupted hedgehogs info - - - - - too many teams - - - - - too many hedgehogs - - - - - There's already a team with same name in the list - - - - - round in progress - - - - - restricted - - - - - REMOVE_TEAM: no such team - - - - - Not team owner! - - - - - Less than two clans! - - - - - Room with such name already exists - - - - - Nickname already chosen - - - - - Illegal nickname - - - - - Protocol already known - - - - - Bad number - - - - - Nickname is already in use - - - - - No checker rights - - - - - Authentication failed - - - - - 60 seconds cooldown after kick - - - - - kicked - - - - - Ping timeout - - - - - bye - - - - - Illegal room name - - - - - No such room - - - - - Joining restricted - - - - - Registered users only - - - - - You are banned in this room - - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_nl.ts --- a/share/hedgewars/Data/Locale/hedgewars_nl.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_nl.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -441,10 +488,6 @@ - Theme: - - - Load drawn map @@ -460,6 +503,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -503,10 +550,6 @@ - %1 *** %2 has joined - - - %1 *** %2 has left (%3) @@ -533,6 +576,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -683,6 +741,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -824,6 +893,14 @@ + + Play again + + + + Save + + PageInGame @@ -929,6 +1006,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1876,6 +1964,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1964,37 +2056,6 @@ - Main - Error - - - - Cannot create directory %1 - - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - - - - Unable to start the server: %1. - - - - Unable to run engine at - - - - Error code: %1 - - - Video upload - Error @@ -2139,10 +2200,6 @@ - Hedgewars - - - Not all players are ready @@ -2254,6 +2311,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2364,6 +2441,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2965,119 +3061,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_pl.ts --- a/share/hedgewars/Data/Locale/hedgewars_pl.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_pl.ts Thu Jun 13 22:27:23 2013 +0200 @@ -5,7 +5,7 @@ About Unknown Compiler - + Nieznany kompilator @@ -30,73 +30,89 @@ BanDialog IP - IP + IP Nick - + Nick IP/Nick - + IP/Nick Reason - + Powód Duration - + Czas trwania Ok - + Ok Cancel - Anuluj + Anuluj you know why - + Wiesz za co Warning - + Ostrzeżenie Please, specify %1 - + Proszę, opisz %1 nickname - + ksywka permanent - + dożywotni DataManager Use Default - + Użyj domyślnych FeedbackDialog View - + Pokaż Cancel - Anuluj + Anuluj Send Feedback - + Wyśłij opinię + + + We are always happy about suggestions, ideas, or bug reports. + Jesteśmy wdzięczni za sugestie, pomysły i znalezione błędy. + + + Send us feedback! + Wyślij swoją opinię! + + + If you found a bug, you can see if it's already been reported here: + Jeśli znalazłeś błąd, możesz sprawdzić czy został już zgłoszony w tym miejscu: + + + Your email address is optional, but necessary if you want us to get back at you. + E-mail jest opcjonalny chyba, że chcesz byśmy się z tobą skontaktowali. @@ -130,59 +146,84 @@ Game scheme will auto-select a weapon - + Schemat gry automatycznie wybierze uzbrojenie Map - Mapa + Mapa Game options - + Ustawienia gry + + + + GameUIConfig + + Guest + Gość HWApplication %1 minutes - - - - + + %1 minuta + %1 minuty + %1 minut %1 hour - - - - + + %1 godzina + %1 godziny + %1 godzin %1 hours - - - - + + %1 godziny + %1 godziny + %1 godzin %1 day - - - - + + %1 dzień + %1 dni + %1 dni %1 days - - - - + + %1 dni + %1 dni + %1 dni + + Scheme '%1' not supported + Shemat '%1' nie jest wspierany + + + Cannot create directory %1 + Nie można utworzyć katalogu %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Nie można otworzyć katalogu z danymi: +%1 + +Sprawdź poprawność instalacji! + HWAskQuitDialog @@ -233,6 +274,18 @@ Failed to save StyleSheet to %1 Nie można było zapisać arkusza stylów jako %1 + + %1 has joined + %1 dołączył + + + %1 has left + %1 wyszedł + + + %1 has left (%2) + %1 wyszedł (%2) + HWForm @@ -282,11 +335,11 @@ %1's Team - + Zespół %1 Hedgewars - Nick registered - + Hedgewars - Zarejestrowany nick This nick is registered, and you haven't specified a password. @@ -294,44 +347,61 @@ If this nick isn't yours, please register your own nick at www.hedgewars.org Password: - + Ten nick jest zarejestrowany i musisz podać hasło. + +Jeżeli ten nick nie jest twój, zarejestrój własny na www.hedgewars.org + +Hasło: Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + Twój nick nie jest zarejestrowany. +By zapobiec używania go przez kogoś innego +zarejestruj go na www.hedgewars.org Your password wasn't saved either. - + + +Twoje hasło nie zostało zapisane. Hedgewars - Empty nickname - + Hedgewars - Brak nicku Hedgewars - Wrong password - + Hedgewars - Złe hasło You entered a wrong password. - + Wpisałeś złe hasło. Try Again - + Spróbuj ponownie Hedgewars - Connection error - + Hedgewars - Błąd połączenia You reconnected too fast. Please wait a few seconds and try again. - + Za szybko połączyłes się ponownie. +Poczekaj kilka sekund i spróbuj ponownie. + + + This page requires an internet connection. + Ta strona wymaga połączenia z internetem. + + + Guest + Gość @@ -385,91 +455,91 @@ Map type: - + Typ mapy: Image map - + Mapa z obrazka Mission map - + Misja Hand-drawn - Rys. ręcznie + Rysowana ręcznie Randomly generated - + Losowa mapa Random maze - + Losowe labirynty Random - Losowo + Losowo Map preview: - + Podgląd: Load map drawing - + Wczytaj rysowana mapę Edit map drawing - + Edytuj mapę Small islands - + Małe wyspy Medium islands - + Średnie wyspy Large islands - + Duże wyspy Map size: - + Rozmiar mapy: Maze style: - + Styl labiryntu: Mission: - + Misja: Map: - - - - Theme: - + Mapa: Load drawn map - Załaduj mapę + Załaduj mapę Drawn Maps - Narysowane mapy + Narysowane mapy All files - Wszystkie pliki + Wszystkie pliki Large tunnels - + Duże tunele + + + Theme: %1 + Motyw: %1 @@ -515,7 +585,7 @@ %1 *** %2 has joined - %1 *** %2 dołączył + %1 *** %2 dołączył %1 *** %2 has left (%3) @@ -542,7 +612,25 @@ HWPasswordDialog Login - + Login + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + Zaloguj się by połączyć się z serwerem. + +Jeśli nie masz konta na www.hedgewars.org, +po prostu wpisz swój nick. + + + Nickname: + Nick: + + + Password: + Hasło: @@ -560,22 +648,22 @@ HatButton Change hat (%1) - + Zmień czapkę (%1) HatPrompt Cancel - Anuluj + Anuluj Use selected hat - + Użyj wybranej czapki Search for a hat: - + Szukaj czapki: @@ -589,7 +677,7 @@ KeyBinder Category - + Kategoria @@ -597,30 +685,30 @@ Duration: %1m %2s - Długość: %1m %2s + Długość: %1m %2s Video: %1x%2, - Wideo: %1x%2, + Wideo: %1x%2, %1 fps, - %1 kl/s, + %1 kl/s, Audio: - Audio: + Audio: unknown - + nieznany MapModel No description available. - + Brak opisu. @@ -655,35 +743,35 @@ General - Ogólne + Ogólne Bans - + Bany IP/Nick - + IP/Nick Expiration - + Wygaśnie Reason - + Powód Refresh - + Odśwież Add - + Dodaj Remove - + Usuń @@ -694,6 +782,17 @@ + PageDataDownload + + Loading, please wait. + Ładowanie, proszę czekać. + + + This page requires an internet connection. + Ta strona wymaga połączenia z internetem. + + + PageDrawMap Undo @@ -740,39 +839,39 @@ Select an action to choose a custom key bind for this team - + Wybierz czynność by przypisać klawisz dla tego zespołu Use my default - + Użyj domyślnych Reset all binds - + Zresetuj przypisania Custom Controls - + Własne ustawienia Hat - Grzybek + Czapka Name - Nazwa + Nazwa This hedgehog's name - + Imię jeża Randomize this hedgehog's name - + Losuj imię Random Team - Losowa Drużyna + Losowa Drużyna @@ -841,6 +940,14 @@ <b>%1</b> trząsł portkami i opuścił turę <b>%2</b> razy. + + Play again + Zagraj ponownie + + + Save + Zapisz + PageInGame @@ -896,23 +1003,23 @@ Play a game across a local area network - + Zagraj poprzez sieć lokalną Play a game on an official server - + Zagraj na oficjalnym serwerze Feedback - + Twoja opinia Play local network game - + Zagraj poprzez LAN Play official network game - + Zagraj na oficjalnym serwerze @@ -923,7 +1030,7 @@ Edit game preferences - Zmień ustawienia gry + Zmień ustawienia gry @@ -934,19 +1041,30 @@ Edit game preferences - Zmień ustawienia gry + Zmień ustawienia gry Start - Start + Start Update - + Aktualizuj Room controls - + Ustawienia pokoju + + + + PageNetServer + + Click here for details + Pokaż szczegóły + + + Insert your address here + Wprowadź adres @@ -1033,91 +1151,91 @@ Select an action to change what key controls it - + Wybierz czynność by przypisać do niej klawisz Reset to default - + Przywróć domyślne Reset all binds - + Zresetuj klawisze Game - + Gra Graphics - + Grafika Audio - + Dźwięk Controls - + Sterowanie Video Recording - + Nagrywanie wideo Network - + Sieć Teams - Drużyny + Drużyny Schemes - + Schematy Weapons - Uzbrojenie + Uzbrojenie Frontend - + Interfejs Custom colors - Własne kolory + Własne kolory Game audio - + Dźwięki w grze Frontend audio - + Dźwięki interfejsu Account - + Konto Proxy settings - Ustawienia proxy + Ustawienia proxy Miscellaneous - Różne + Różne Updates - + Aktualizacja Check for updates - + Sprawdź aktualizacje Video recording options - Ustawienia nagrywania + Ustawienia nagrywania @@ -1175,27 +1293,27 @@ Search for a room: - + Szukaj pokoju: Create room - + Stwórz pokój Join room - + Dołącz do gry Room state - + Stan gry Clear filters - + Usuń filtry Open server administration page - + Otwórz ustawienia admina @@ -1318,7 +1436,7 @@ Add an indestructible border along the bottom - >Dodaje niezniszczalną ramkę u dołu mapy + Dodaje niezniszczalną ramkę u dołu mapy @@ -1419,12 +1537,12 @@ Date: %1 - + Data: %1 Size: %1 - + Rozmiar: %1 @@ -1475,15 +1593,15 @@ Restrict Unregistered Players Join - + Blokuj niezarejestrowanych graczy Show games in lobby - + Pokaż nierozpoczęte gry Show games in-progress - + Pokaż trwające gry @@ -1534,31 +1652,31 @@ Visual effects - + Efekty wizualne Sound - + Dźwięk In-game sound effects - + Efekty dźwiękowe w grze Music - + Muzyka In-game music - + Muzyka w grze Frontend sound effects - + Efekty dźwiękowe w menu Frontend music - + Muzyka w menu @@ -1903,43 +2021,47 @@ This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Ta wersja deweloperska nie jest końcową wersją gry i może być niekompatybilna z innymi wersjami i niektóre funkcje mogą być niekompletne lub nie działać w ogóle! Fullscreen - Pełny ekran + Pełny ekran Fullscreen Resolution - + Rozdzielczość Windowed Resolution - + Rozmiar okna Your Email - + Twój e-mail Summary - + Krótki opis Send system information - + Wyśłij informacje o systemie Type the security code: - + Wpisz litery z obrazka: Revision - + Wersja This program is distributed under the %1 - + Ten program jest rozpowszechniany na licencji %1 + + + This setting will be effective at next restart. + Ustawienia zadziałają po restarcie gry. @@ -1965,7 +2087,7 @@ -r%1 (%2) - + -r%1 (%2) @@ -2030,37 +2152,37 @@ Main - Error - Błąd + Błąd Cannot create directory %1 - Nie można utworzyć katalogu %1 + Nie można utworzyć katalogu %1 Failed to open data directory: %1 Please check your installation! - Nie można otworzyć katalogu z danymi: + Nie można otworzyć katalogu z danymi: %1 Sprawdź poprawność instalacji! TCP - Error - TCP - Błąd + TCP - Błąd Unable to start the server: %1. - Nie można uruchomić serwera: %1. + Nie można uruchomić serwera: %1. Unable to run engine at - Nie można uruchomić silnika na + Nie można uruchomić silnika na Error code: %1 - Kod błędu: %1 + Kod błędu: %1 Video upload - Error @@ -2182,44 +2304,41 @@ Hedgewars - Nick not registered - + Hedgewars - Niezarejestrowany nick System Information Preview - + Podgląd informacji o systemie Failed to generate captcha - + Nie udało się wygenerować captchy Failed to download captcha - + Nie udało się pobrać captchy Please fill out all fields. Email is optional. - + Wypełnij wszystkie pola. E-mail nie jest wymagany. Hedgewars - Warning - + Hedgewars - Ostrzeżenie Hedgewars - Information - - - - Hedgewars - + Hedgewars - Informacja Not all players are ready - + Nie wszyscy gracze są gotowi Are you sure you want to start this game? Not all players are ready. - + Jesteś pewien, że chcesz rozpocząc grę? +Nie wszyscy gracze są gotowi. @@ -2286,7 +2405,7 @@ Set default options - Zapisz jako domyśłne ustawienia + Przywróć domyślne ustawienia Open videos directory @@ -2306,38 +2425,58 @@ Restore default coding parameters - + Przywróć domyślne ustawienia Open the video directory in your system - + Otwórz katalog z filmami Play this video - + Odtwórz wideo Delete this video - + Usuń wideo Upload this video to your Youtube account - + Wyślij to wideo na konto Youtube + + + Reset + Zresetuj + + + Set the default server port for Hedgewars + Ustaw domyślny port serwera Hedgewars + + + Invite your friends to your server in just 1 click! + Zaproś swoich znajomych jednym kliknięciem! + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + Kliknij by skopiować unikalny link twojego serwera do schowka. Wyślij link swoim znajomym aby mogli dołączyć do gry. + + + Start private server + Uruchom prywatny serwer RoomNamePrompt Enter a name for your room. - + Wprowadź nazwę pokoju. Cancel - Anuluj + Anuluj Create room - + Stwórz pokój @@ -2391,19 +2530,19 @@ SeedPrompt The map seed is the basis for all random values generated by the game. - + Ziarno jest podstawą wszystkich losowych wartości tworzynych przez grę. Cancel - Anuluj + Anuluj Set seed - + Ustaw ziarno Close - + Zamknij @@ -2434,25 +2573,45 @@ + TCPBase + + Unable to start server at %1. + Nie można uruchomić serwera na %1. + + + Unable to run engine at %1 +Error code: %2 + Nie można uruchomić silnika na %1 +Kod błędu: %2 + + + + TeamSelWidget + + At least two teams are required to play! + Do rozpoczęcia gry potrzeba dwóch druzyn! + + + TeamShowWidget %1's team - + Drużyna %1 ThemePrompt Cancel - Anuluj + Anuluj Search for a theme: - + Szukaj motywu: Use selected theme - + Użyj wybranego motywu @@ -2623,26 +2782,26 @@ hedgehog info - + informacje o jeżu binds (categories) Movement - + Ruch Weapons - Uzbrojenie + Uzbrojenie Camera - + Kamera Miscellaneous - Różne + Różne @@ -2713,7 +2872,7 @@ Hedgehog movement - + Poruszanie się jeżem @@ -3035,119 +3194,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_pt_BR.ts --- a/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -173,6 +189,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Não foi possível criar o diretório %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -223,6 +254,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -322,6 +365,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -442,10 +489,6 @@ - Theme: - - - Load drawn map Carregar mapa @@ -461,6 +504,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -505,7 +552,7 @@ %1 *** %2 has joined - %1 *** %2 entrou + %1 *** %2 entrou %1 *** %2 has left (%3) @@ -534,6 +581,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -684,6 +746,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -825,6 +898,14 @@ <b>%1</b> estava assustado e passou o turno <b>%2</b> vezes.</p>. + + Play again + + + + Save + Salvar + PageInGame @@ -934,6 +1015,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1917,6 +2009,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2005,35 +2101,12 @@ - Main - Error - - - Cannot create directory %1 - Não foi possível criar o diretório %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Não foi possível criar o diretório %1 Unable to start the server: %1. - Não foi possível iniciar o servidor: %1. - - - Unable to run engine at - - - - Error code: %1 - + Não foi possível iniciar o servidor: %1. Video upload - Error @@ -2181,10 +2254,6 @@ - Hedgewars - - - Not all players are ready @@ -2296,6 +2365,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2407,6 +2496,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3013,119 +3121,4 @@ DPad - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_pt_PT.ts --- a/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts Thu Jun 13 22:27:23 2013 +0200 @@ -5,14 +5,14 @@ About Unknown Compiler - + Compilador Desconhecido AbstractPage Go back - Retrodecer + Retroceder @@ -23,80 +23,96 @@ copy of - copia de + cópia de BanDialog IP - IP + IP Nick - + Utilizador IP/Nick - + IP/Utilizador Reason - + Motivo Duration - + Duração Ok - + Ok Cancel - Cancelar + Cancelar you know why - + tu sabes porquê Warning - + Aviso Please, specify %1 - + Por favor, especifica %1 nickname - + utilizador permanent - + permanente DataManager Use Default - + Utilizar configuração por omissão FeedbackDialog View - + Ver Cancel - Cancelar + Cancelar Send Feedback - + Enviar Feedback + + + We are always happy about suggestions, ideas, or bug reports. + Estamos sempre abertos a novas sugestões, ideias, ou submissões de bugs encontrados. + + + Send us feedback! + Envia-nos feedback! + + + If you found a bug, you can see if it's already been reported here: + Se encontraste um bug, podes verificar se já foi submetido aqui: + + + Your email address is optional, but necessary if you want us to get back at you. + O teu e-mail é opcional, mas necessário se quiseres que te contactemos de volta. @@ -129,54 +145,72 @@ Game scheme will auto-select a weapon - + O esquema de jogo irá auto-selecionar uma arma Map - Mapa + Mapa Game options - + Opções de jogo HWApplication %1 minutes - - - + + %1 minuto + %1 minutos %1 hour - - - + + %1 hora + %1 horas %1 hours - - - + + %1 hora + %1 horas %1 day - - - + + %1 dia + %1 dias %1 days - - - + + %1 dia + %1 dias + + Scheme '%1' not supported + Esquema '%1' não suportado + + + Cannot create directory %1 + Não foi possível criar o diretório %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Erro ao abrir o diretório: +%1 + +Por favor verifica a tua instalação! + HWAskQuitDialog @@ -213,7 +247,7 @@ Couldn't read %1 - Não foi possivel carregar %1 + Não foi possível carregar %1 StyleSheet discarded @@ -227,6 +261,18 @@ Failed to save StyleSheet to %1 Não foi possível gravar o StyleSheet em %1 + + %1 has joined + %1 entrou + + + %1 has left + %1 saíu + + + %1 has left (%2) + %1 saíu (%2) + HWForm @@ -271,16 +317,16 @@ Someone already uses your nickname %1 on the server. Please pick another nickname: - Alguem já está a utilizar o teu nome de utilizador %1 no servidor. + Alguém já está a utilizar o teu nome de utilizador %1 no servidor. Por favor escolhe outro nome de utilizador: %1's Team - + Equipa de %1 Hedgewars - Nick registered - + Hedgewars - Utilizador registado This nick is registered, and you haven't specified a password. @@ -288,44 +334,57 @@ If this nick isn't yours, please register your own nick at www.hedgewars.org Password: - + Este utilizador está registado, e não foi especificada uma palavra-passe. + +Se este utilizador não te pertence, acede a www.hedgewars.org e regista o teu próprio utilizador. + +Palavra-passe: Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + O teu nome de utilizador não está registado. +De forma a prevenir que alguém o utilize, +por favor regista-o em www.hedgewars.org Your password wasn't saved either. - + + +A tua palavra-passe também não foi gravada. Hedgewars - Empty nickname - + Hedgewars - Utilizador vazio Hedgewars - Wrong password - + Hedgewars - Palavra-passe incorreta You entered a wrong password. - + Introduziste a palavra-passe errada. Try Again - + Tenta Novamente Hedgewars - Connection error - + Hedgewars - Erro na ligação You reconnected too fast. Please wait a few seconds and try again. - + Tentás-te voltar ao servidor num espaço de tempo demasiado curto. +Por favor, aguarda alguns segundos e tenta novamente. + + + This page requires an internet connection. + Esta página requer ligação à internet @@ -367,11 +426,11 @@ Small tunnels - Túneis pequenos + Túneis estreitos Medium tunnels - Túneis medios + Túneis médios Seed @@ -379,91 +438,95 @@ Map type: - + Mapa: Image map - + Imagem Mission map - + Missão Hand-drawn - Desenhado à mão + Desenhado à mão Randomly generated - + Aleatoriamente gerado Random maze - + Labirinto aleatório Random - Aleatório + Aleatório Map preview: - + Pré-visualização do mapa: Load map drawing - + Carregar mapa desenhado Edit map drawing - + Editar mapa desenhado + + + Large tunnels + Túneis largos Small islands - + Ilhas pequenas Medium islands - + Ilhas médias Large islands - + Ilhas grandes Map size: - + Tamanho do mapa: Maze style: - + Estilo de labirinto: Mission: - + Missão: Map: - + Mapa: Theme: - + Tema: Load drawn map - Carregar mapa desenhado + Carregar mapa desenhado Drawn Maps - Mapas Desenhados + Mapas Desenhados All files - Todos os ficheiros - - - Large tunnels - + Todos os ficheiros + + + Theme: %1 + Tema: %1 @@ -501,7 +564,7 @@ You got kicked - Foi expulso + Foste expulso %1 *** %2 has joined the room @@ -509,7 +572,7 @@ %1 *** %2 has joined - %1 *** %2 juntou-se + %1 *** %2 entrou %1 *** %2 has left (%3) @@ -536,7 +599,25 @@ HWPasswordDialog Login - + Login + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + Por favor faz login para aceder ao servidor. + +Se ainda não tens uma conta em www.hedgewars.org, +simplesmente insere o teu nome de utilizador. + + + Nickname: + Utilizador: + + + Password: + Password: @@ -554,36 +635,36 @@ HatButton Change hat (%1) - + Trocar chapéu (%1) HatPrompt Cancel - Cancelar + Cancelar Use selected hat - + Utiliza o chapéu selecionado Search for a hat: - + Procurar: KB SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib. - SDL_ttf retornou um erro ao renderizar o texto, muito provavelmente está relacionado com o bug no freetype2. É recomendado actualizar a sua lib freetype. + SDL_ttf retornou um erro ao renderizar o texto, muito provavelmente está relacionado com o bug no freetype2. É recomendado atualizar a sua lib freetype. KeyBinder Category - + Categoria @@ -604,18 +685,18 @@ Audio: - Audio: + Áudio: unknown - + desconhecido MapModel No description available. - + Nenhuma descrição disponível. @@ -650,35 +731,35 @@ General - Geral + Geral Bans - + Expulsões IP/Nick - + IP/Utilizador Expiration - + Expiração Reason - + Motivo Refresh - + Atualizar Add - + Adicionar Remove - + Remover @@ -689,6 +770,17 @@ + PageDataDownload + + Loading, please wait. + A carregar, aguarda por favor. + + + This page requires an internet connection. + Esta página requer ligação à internet. + + + PageDrawMap Undo @@ -735,39 +827,39 @@ Select an action to choose a custom key bind for this team - + Seleciona uma ação para personalizar uma tecla com esta equipa Use my default - + Configuração por omissão Reset all binds - + Repor todos os valores Custom Controls - + Controlos Personalizados Hat - Chapéu + Chapéu Name - Nome + Nome This hedgehog's name - + Nome deste ouriço Randomize this hedgehog's name - + Escolhe um nome para este ouriço aleatoriamente Random Team - Equipa aleatória + Gerar Equipa Aleatória @@ -830,6 +922,14 @@ <b>%1</b> estava tão amedrontado que passou <b>%2</b> turnos. + + Play again + Jogar novamente + + + Save + Gravar + PageInGame @@ -861,7 +961,7 @@ Read about who is behind the Hedgewars Project - Lê sobre quem está por trás do Projecto Hedgewars + Descobre quem está por trás do Projecto Hedgewars Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars @@ -881,27 +981,27 @@ Edit game preferences - Editar as preferencias de jogo + Editar as preferências de jogo Play a game across a local area network - + Joga na rede local Play a game on an official server - + Joga num servidor oficial Feedback - + Feedback Play local network game - + Jogar na rede local Play official network game - + Jogar no servidor oficial @@ -912,30 +1012,37 @@ Edit game preferences - Editar as preferencias de jogo + Editar preferências de jogo PageNetGame - Control - Controlo - - Edit game preferences - Editar as preferencias de jogo + Editar preferências de jogo Start - Iniciar + Iniciar Update - Actualizar + Atualizar Room controls - + Restrições + + + + PageNetServer + + Click here for details + Clica aqui para detalhes + + + Insert your address here + Insere aqui o teu endereço @@ -986,7 +1093,7 @@ Reset to default colors - Repor cores por omisão + Repor cores por omissão Proxy host @@ -1022,91 +1129,91 @@ Select an action to change what key controls it - + Seleciona uma ação para alterar a tecla que a controla Reset to default - + Repor valor por omissão Reset all binds - + Repor todos os valores Game - + Jogo Graphics - + Gráficos Audio - + Áudio Controls - + Controlos Video Recording - + Vídeo Gravação Network - + Rede Teams - Equipas + Equipas Schemes - + Esquemas Weapons - + Armamento Frontend - + Frontend Custom colors - Cores personalizadas + Cores personalizadas Game audio - + Áudio de jogo Frontend audio - + Áudio do frontend Account - + Conta Proxy settings - Definições do Proxy + Definições do Proxy Miscellaneous - Outras opções + Outras opções Updates - + Atualizações Check for updates - + Procurar atualizações Video recording options - Opções de criação de vídeo + Opções de criação de vídeo @@ -1123,22 +1230,10 @@ PageRoomsList - Create - Criar - - - Join - Entrar - - Admin features Recursos de administrador - Room Name: - Nome da Sala: - - Rules: Regras: @@ -1146,14 +1241,6 @@ Weapons: Armamento: - - Search: - Pesquisa: - - - Clear - Limpar - %1 players online @@ -1163,27 +1250,27 @@ Search for a room: - + Procurar sala: Create room - + Criar sala Join room - + Entrar no jogo Room state - + Estado da sala Clear filters - + Limpar filtros Open server administration page - + Abrir menu de administração do servidor @@ -1222,7 +1309,7 @@ Your hogs are unable to move, put your artillery skills to the test - Os teus ouriços serão impossibilidados de se mover, testa as tuas capacidades no modo artilharia + Os teus ouriços serão impossibilitados de se mover, testa as tuas capacidades no modo artilharia Random @@ -1254,15 +1341,15 @@ Ammo is shared between all teams that share a colour. - As armas são partilhadas entre todas as equipas da mesma cor. + O armamento é partilhado entre todas as equipas da mesma cor. Disable girders when generating random maps. - Desactivar vigas em mapas gerados aleatoriamente. + Desativar vigas em mapas gerados aleatoriamente. Disable land objects when generating random maps. - Não adicionar objectos no terreno ao gerar mapas aleatórios. + Não adicionar objetos no terreno ao gerar mapas aleatórios. AI respawns on death. @@ -1290,7 +1377,7 @@ Wind will affect almost everything. - O vento afecta praticamente tudo. + O vento afeta praticamente tudo. Copy @@ -1363,7 +1450,7 @@ Select a mission! - Selecciona uma missão! + Seleciona uma missão! Pick the mission or training to play @@ -1406,12 +1493,14 @@ Date: %1 - + Data: %1 + Size: %1 - + Tamanho: %1 + @@ -1426,11 +1515,11 @@ Restrict Joins - Restringir entradas + Impedir a entrada de novos utilizadores Restrict Team Additions - Restringir adição de equipas + Trancar a adição de equipas Ban @@ -1457,27 +1546,23 @@ Remover amigo - Update - Actualizar - - Restrict Unregistered Players Join - + Impedir a entrada de utilizadores não registados Show games in lobby - + Mostrar jogos a aguardar jogadores Show games in-progress - + Mostrar jogos em progresso QCheckBox Check for updates at startup - Verificar por actualizações no arranque + Verificar por atualizações no arranque Fullscreen @@ -1497,7 +1582,7 @@ Show ammo menu tooltips - Mostrar a ajuda no menu das armas + Mostrar a ajuda no menu de armamento Save password @@ -1513,7 +1598,7 @@ Record audio - Gravar audio + Gravar áudio Use game resolution @@ -1521,31 +1606,31 @@ Visual effects - + Efeitos visuais Sound - + Som In-game sound effects - + Efeitos sonoros durante o jogo Music - + Musica In-game music - + Musica durante o jogo Frontend sound effects - + Efeitos sonoros no frontend Frontend music - + Musica no frontend @@ -1571,16 +1656,8 @@ Qualquer - In lobby - No lobby - - - In progress - Em progresso - - Disabled - Desactivado + Desativado Red/Cyan @@ -1689,12 +1766,8 @@ Minas - Version - Versão - - Weapons - Armas + Armamento Host: @@ -1798,7 +1871,7 @@ Sudden Death Water Rise - Súbida da Água durante Morte Súbita + Subida da Água durante Morte Súbita Sudden Death Health Decrease @@ -1825,14 +1898,10 @@ % Tempo Para Retirar - This program is distributed under the GNU General Public License v2 - Esta aplicação é distribuída sob a GNU General Public License v2 - - There are videos that are currently being processed. Exiting now will abort them. Do you really want to quit? - Existem vídeos a serem currentemente processados. + Existem vídeos a serem correntemente processados. Sair irá cancela-los. Deseja mesmo sair? @@ -1874,7 +1943,7 @@ Audio codec - Codec de Audio + Codec de Áudio Video codec @@ -1890,43 +1959,47 @@ This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Esta versão de desenvolvimento demonstra um "trabalho em progresso" o qual pode não ser compatível com outras versões do jogo, enquanto algumas funcionalidades podem estar inutilizáveis ou incompletas! Fullscreen - Ecrã completo + Ecrã completo Fullscreen Resolution - + Resolução Ecrã Completo Windowed Resolution - + Resolução da Janela Your Email - + E-mail Summary - + Sumário Send system information - + Enviar informações de sistema Type the security code: - + Digita o código de segurança: Revision - + Revisão This program is distributed under the %1 - + Este programa é distribuído sob a %1 + + + This setting will be effective at next restart. + Esta opção entrará em efeito quando o jogo for reiniciado. @@ -1952,7 +2025,7 @@ -r%1 (%2) - + -r%1 (%2) @@ -1967,7 +2040,7 @@ File association failed. - Não foi possivel associar os ficheiros. + Não foi possível associar os ficheiros. Error while authenticating at google.com: @@ -1995,7 +2068,7 @@ Cannot delete default scheme '%1'! - Não é possivel apagar o esquema por omisão '%1'! + Não é possível apagar o esquema por omissão '%1'! Please select a record from the list @@ -2019,37 +2092,37 @@ Main - Error - Main - Erro + Main - Erro Cannot create directory %1 - Não foi possível criar o diretório %1 + Não foi possível criar o diretório %1 Failed to open data directory: %1 Please check your installation! - Erro ao abrir o diretório: + Erro ao abrir o diretório: %1 Por favor verifica a tua instalação! TCP - Error - TCP - Erro + TCP - Erro Unable to start the server: %1. - Não foi possível iniciar o servidor: %1. + Não foi possível iniciar o servidor: %1. Unable to run engine at - Não foi possivel lançar o motor de jogo em + Não foi possível lançar o motor de jogo em Error code: %1 - Código de erro: %1 + Código de erro: %1 Video upload - Error @@ -2073,15 +2146,15 @@ Please select record from the list - Por favor selecciona uma gravação da lista + Por favor seleciona uma gravação da lista Cannot rename to - Não é possivel renomear para + Não é possível renomear para Cannot delete file - Não é possivel apagar o ficheiro + Não é possível apagar o ficheiro Room Name - Error @@ -2089,7 +2162,7 @@ Please select room from the list - Por favor selecciona uma sala da lista + Por favor seleciona uma sala da lista Room Name - Are you sure? @@ -2138,31 +2211,31 @@ Cannot open '%1' for writing - Impossivel abrir '%1' para escrita + Impossível abrir '%1' para escrita Cannot open '%1' for reading - Impossivel abrir '%1' para leitura + Impossível abrir '%1' para leitura Cannot use the ammo '%1'! - Impossivel utilizar as munições '%1'! + Impossível utilizar as munições '%1'! Weapons - Warning - Armas - Aviso + Armamento - Aviso Cannot overwrite default weapon set '%1'! - Não é possivel substituir o esquema de armas '%1'! + Não é possível substituir o esquema de armas '%1'! Cannot delete default weapon set '%1'! - Não é possivel apagar o esquema de armas por omisão '%1'! + Não é possível apagar o esquema de armas por omissão '%1'! Weapons - Are you sure? - Armas - Tens a certeza? + Armamento - Tens a certeza? Do you really want to delete the weapon set '%1'? @@ -2170,44 +2243,45 @@ Hedgewars - Nick not registered - + Hedgewars - Utilizador não registado System Information Preview - + Pré-visualizar Informação do Sistema Failed to generate captcha - + Não foi possível gerar o captcha Failed to download captcha - + Não foi possível descarregar o captcha Please fill out all fields. Email is optional. - + Por favor preenche todos os campos. O e-mail é opcional. Hedgewars - Warning - + Hedgewars - Aviso Hedgewars - Information - + Hedgewars - Informação Hedgewars - + Hedgewars Not all players are ready - + Nem todos os jogadores se encontram prontos Are you sure you want to start this game? Not all players are ready. - + Tens a certeza que queres iniciar este jogo? +Nem todos os jogadores estão prontos. @@ -2234,7 +2308,7 @@ Update - Actualizar + Atualizar Specify @@ -2274,7 +2348,7 @@ Set default options - Restaurar opções por omisão + Restaurar opções por omissão Open videos directory @@ -2294,7 +2368,7 @@ Restore default coding parameters - Restaurar os parametros de conversão por omisão + Restaurar os parâmetros de conversão por omissão Open the video directory in your system @@ -2312,20 +2386,40 @@ Upload this video to your Youtube account Enviar este vídeo para a tua conta do Youtube + + Reset + Repor + + + Set the default server port for Hedgewars + Define a porta por omisão do servidor Hedgewars + + + Invite your friends to your server in just 1 click! + Convida os teus amigos para o teu servidor com apenas 1 click! + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + Clica para copiar o URL do teu servidor. Partilha este link com os teus amigos para que se possam juntar a ti. + + + Start private server + Iniciar o servidor privado + RoomNamePrompt Enter a name for your room. - + Introduz um nome para a tua sala de jogo. Cancel - Cancelar + Cancelar Create room - + Criar sala @@ -2379,19 +2473,19 @@ SeedPrompt The map seed is the basis for all random values generated by the game. - + A semente do mapa é a base de todos os valores aleatórios gerados pelo jogo. Cancel - Cancelar + Cancelar Set seed - + Definir semente Close - + Fechar @@ -2406,7 +2500,7 @@ Ammo in boxes - Caixas de armas + Munições por caixa Delays @@ -2422,25 +2516,45 @@ + TCPBase + + Unable to start server at %1. + Não foi possível iniciar o servidor em %1. + + + Unable to run engine at %1 +Error code: %2 + Não foi possível iniciar o motor de jogo em %1 +Código de erro:: %2 + + + + TeamSelWidget + + At least two teams are required to play! + São necessárias pelo menos 2 equipas (para jogar)! + + + TeamShowWidget %1's team - + Equipa de %1 ThemePrompt Cancel - Cancelar + Cancelar Search for a theme: - + Procurar: Use selected theme - + Utilizar o tema selecionado @@ -2483,7 +2597,7 @@ ammo menu - menu de armas + menu de armamento slot 1 @@ -2603,7 +2717,7 @@ mute audio - Silenciar audio + silenciar áudio record @@ -2611,65 +2725,65 @@ hedgehog info - + informação do ouriço binds (categories) Movement - + Movimento Weapons - + Armamento Camera - + Câmara Miscellaneous - Outras opções + Outras opções binds (descriptions) Traverse gaps and obstacles by jumping: - Ultrapassar fendas e obstaculos saltando: + Ultrapassar fendas e obstáculos: Fire your selected weapon or trigger an utility item: - Disparar a arma currentemente seleccionada ou utilizar um utilitario: + Disparar a arma correntemente selecionada ou utilizar um utilitario: Pick a weapon or a target location under the cursor: - Seleccionar uma arma ou escolher um alvo com o cursor: + Selecionar uma arma ou escolher um alvo com o cursor: Switch your currently active hog (if possible): - Trocar de ouriço currentemente seleccionado (se possivel): + Trocar de ouriço correntemente selecionado (se possível): Pick a weapon or utility item: - Apanhar armas ou utilitarios: + Selecionar armas ou utilitários: Set the timer on bombs and timed weapons: - Escolher o tempo nas bombas e outras armas temporizadas: + Definir o temporizador nas bombas e em outras armas temporizadas: Move the camera to the active hog: - Mover a camara para o ouriço currentemente activo: + Mover a câmara para o ouriço correntemente activo: Move the cursor or camera without using the mouse: - Mover o cursor ou camara sem usar o rato: + Mover o cursor ou câmara sem utilizar o rato: Modify the camera's zoom level: - Modificar o nível de zoom da camara: + Modificar o nível de zoom da câmara: Talk to your team or all participants: @@ -2685,7 +2799,7 @@ Toggle fullscreen mode: - Alterar para modo de ecrã inteiro: + Ativar ou desativar o modo ecrã inteiro: Take a screenshot: @@ -2701,7 +2815,7 @@ Hedgehog movement - + Movimentar ouriço @@ -3027,115 +3141,115 @@ server Not room master - + Não és o anfitrião da sala Corrupted hedgehogs info - + Informação dos ouriços corrompida too many teams - + demasiadas equipas too many hedgehogs - + demasiados ouriços There's already a team with same name in the list - + Já existe uma equipa com o mesmo nome na lista round in progress - + partida em progresso restricted - + limitada REMOVE_TEAM: no such team - + REMOVE_TEAM: equipa inexistente Not team owner! - + A equipa não te pertence! Less than two clans! - + Menos de 2 clãs! Room with such name already exists - + Já existe uma sala com esse nome Nickname already chosen - + Utilizador já em uso Illegal nickname - + Nome de utilizador ilegal Protocol already known - + Protocolo já conhecido Bad number - + Número inválido Nickname is already in use - + Nome de utilizador já em uso No checker rights - + Não possui permissões para verificar Authentication failed - + A autenticação falhou 60 seconds cooldown after kick - + É necessário aguardar 60 segundos após uma expulsão kicked - + expulso Ping timeout - + Ping timeout bye - + tchau (bye) Illegal room name - + Nome da sala ilegal No such room - + Sala inexistente Joining restricted - + Entrada restrita Registered users only - + Apenas utilizadores registados You are banned in this room - + Estás banido desta sala Empty config entry - + Campo vazio na configuração diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ro.ts --- a/share/hedgewars/Data/Locale/hedgewars_ro.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ro.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -179,6 +195,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Cannot create directory %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -229,6 +260,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -328,6 +371,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -447,10 +494,6 @@ - Theme: - - - Load drawn map @@ -466,6 +509,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -510,7 +557,7 @@ %1 *** %2 has joined - %1 *** %2 has joined + %1 *** %2 has joined %1 *** %2 has left (%3) @@ -539,6 +586,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -689,6 +751,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -836,6 +909,14 @@ + + Play again + + + + Save + + PageInGame @@ -945,6 +1026,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1914,6 +2006,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1988,35 +2084,12 @@ - Main - Error - - - Cannot create directory %1 - Cannot create directory %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Cannot create directory %1 Unable to start the server: %1. - Unable to start the server: %1. - - - Unable to run engine at - - - - Error code: %1 - + Unable to start the server: %1. Error while authenticating at google.com: @@ -2179,10 +2252,6 @@ - Hedgewars - - - Not all players are ready @@ -2294,6 +2363,26 @@ Cancel uploading + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2404,6 +2493,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3005,119 +3113,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_ru.ts --- a/share/hedgewars/Data/Locale/hedgewars_ru.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_ru.ts Thu Jun 13 22:27:23 2013 +0200 @@ -5,7 +5,7 @@ About Unknown Compiler - + Неизвестный компилятор @@ -30,31 +30,31 @@ BanDialog IP - IP + IP Nick - + Псевдоним IP/Nick - + IP/Псевдоним Reason - + Причина Duration - + Длительность Ok - + ОК Cancel - Отмена + Отмена you know why @@ -62,41 +62,57 @@ Warning - + Предупреждение Please, specify %1 - + Пожалуйста, укажите %1 nickname - + псевдоним permanent - + постоянный DataManager Use Default - + Использовать значение по умолчанию FeedbackDialog View - + Вид Cancel - Отмена + Отмена Send Feedback - + Отослать отзыв + + + We are always happy about suggestions, ideas, or bug reports. + Мы всегда рады новым предложениям, идям или сообщениям об ошибках. + + + Send us feedback! + Пришлите нам отзыв! + + + If you found a bug, you can see if it's already been reported here: + Если вы нашли ошибку, можете проверить, не было ли уже сообщения о ней здесь: + + + Your email address is optional, but necessary if you want us to get back at you. + Адрес e-mail необязателен, но необходим, если вы хотите получить ответ. @@ -130,59 +146,77 @@ Game scheme will auto-select a weapon - + Схема игры определяет набор оружия Map - Карта + Карта Game options - + Настройки игры HWApplication %1 minutes - - - - + + %1 минута + %1 минуты + %1 минут %1 hour - - - - + + %1 час + %1 часа + %1 часов %1 hours - - - - + + %1 час + %1 часа + %1 часов %1 day - - - - + + %1 день + %1 дня + %1 дней %1 days - - - - + + %1 день + %1 дня + %1 дней + + Scheme '%1' not supported + Схема "%1" не поддерживается + + + Cannot create directory %1 + Не могу создать папку %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Не могу открыть папку: +%1 + +Пожалуйста, проверьте установку приложения! + HWAskQuitDialog @@ -233,6 +267,18 @@ Failed to save StyleSheet to %1 Ошибка при сохранении стиля в %1 + + %1 has joined + %1 вошёл + + + %1 has left + %1 вышел + + + %1 has left (%2) + %1 вышел (%2) + HWForm @@ -282,7 +328,7 @@ %1's Team - + Команда %1 Hedgewars - Nick registered @@ -331,6 +377,11 @@ You reconnected too fast. Please wait a few seconds and try again. + Вы переподключились слишком быстро. +Пожалуйста, попробуйте снова через несколько секунд. + + + This page requires an internet connection. @@ -385,91 +436,91 @@ Map type: - + Тип карты: Image map - + Изображение Mission map - + Миссия Hand-drawn - Рисованная карта + Рисованная карта Randomly generated - + Случайно сгенерированная Random maze - + Случайный лабиринт Random - Случайно + Случайно Map preview: - + Предпросмотр карты: Load map drawing - + Загрузить рисованную карту Edit map drawing - + Редактировать рисованную карту Small islands - + Маленькие острова Medium islands - + Средние острова Large islands - + Большие острова Map size: - + Размер карты: Maze style: - + Стиль лабиринта: Mission: - + Миссия: Map: - - - - Theme: - + Карта: Load drawn map - Загрузить рисованную карту + Загрузить рисованную карту Drawn Maps - Рисованные карты + Рисованные карты All files - Все файлы + Все файлы Large tunnels - + Большие туннели + + + Theme: %1 + Тема: %1 @@ -515,7 +566,7 @@ %1 *** %2 has joined - %1 *** %2 вошёл + %1 *** %2 вошёл %1 *** %2 has left (%3) @@ -544,6 +595,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + Псевдоним: + + + Password: + Пароль: + HWUploadVideoDialog @@ -560,22 +626,22 @@ HatButton Change hat (%1) - + Сменить шляпу (%1) HatPrompt Cancel - Отмена + Отмена Use selected hat - + Использовать выбранную шляпу Search for a hat: - + Поиск по шляпам: @@ -589,7 +655,7 @@ KeyBinder Category - + Категория @@ -597,30 +663,30 @@ Duration: %1m %2s - Длительность: %1мин %2сек + Длительность: %1мин %2сек Video: %1x%2, - Видео: %1x%2, + Видео: %1x%2, %1 fps, - %1 кадров/сек, + %1 кадров/сек, Audio: - Аудио: + Аудио: unknown - + неизвестно MapModel No description available. - + Описание отсутствует. @@ -655,35 +721,35 @@ General - Основные настройки + Основные настройки Bans - + Баны IP/Nick - + IP/Псевдоним Expiration - + Окончание Reason - + Причина Refresh - + Обновить Add - + Добавить Remove - + Удалить @@ -694,6 +760,17 @@ + PageDataDownload + + Loading, please wait. + Идёт загрузка пожалуйста, подождите. + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -744,35 +821,35 @@ Use my default - + Использовать мои настройки по умолчанию Reset all binds - + Сбросить все привязки Custom Controls - + Настройка управления Hat - Шляпа + Шляпа Name - Название + Название This hedgehog's name - + Имя этого ежа Randomize this hedgehog's name - + Выбрать случайное имя для этого ежа Random Team - Случайная команда + Случайная команда @@ -841,6 +918,14 @@ <b>%1</b> испугался и пропустил <b>%2</b> ходов. + + Play again + + + + Save + Сохранить + PageInGame @@ -896,23 +981,23 @@ Play a game across a local area network - + Играть по локальной сети Play a game on an official server - + Играть на официальном сервере Feedback - + Отзыв Play local network game - + Играть по локальной сети Play official network game - + Играть на официальном сервере @@ -923,7 +1008,7 @@ Edit game preferences - Редактировать настройки игры + Редактировать настройки игры @@ -934,18 +1019,29 @@ Edit game preferences - Редактировать настройки игры + Редактировать настройки игры Start - Старт + Старт Update - Обновить + Обновить Room controls + Управление комнатой + + + + PageNetServer + + Click here for details + + + + Insert your address here @@ -1037,47 +1133,47 @@ Reset to default - + Сбросить на значения по умолчанию Reset all binds - + Сбросить все привязки Game - + Игра Graphics - + Графика Audio - + Звук Controls - + Управление Video Recording - + Запись видео Network - + Сеть Teams - Команды + Команды Schemes - + Схемы Weapons - Оружие + Оружие Frontend @@ -1085,7 +1181,7 @@ Custom colors - Свои цвета + Свои цвета Game audio @@ -1101,23 +1197,23 @@ Proxy settings - Настройки прокси + Настройки прокси Miscellaneous - Разное + Разное Updates - + Обновления Check for updates - + Проверить обновления Video recording options - Настройки видео + Настройки видео @@ -1175,27 +1271,27 @@ Search for a room: - + Искать комнату: Create room - + Создать комнату Join room - + Войти в комнату Room state - + Состояние комнаты Clear filters - + Очистить фильтры Open server administration page - + Открыть страницу администрирования сервера @@ -1419,12 +1515,12 @@ Date: %1 - + Дата: %1 Size: %1 - + Размер: %1 @@ -1475,7 +1571,7 @@ Restrict Unregistered Players Join - + Запретить вход незарегистрированным игрокам Show games in lobby @@ -1483,7 +1579,7 @@ Show games in-progress - + Показать текущие игры @@ -1534,11 +1630,11 @@ Visual effects - + Визуальные эффекты Sound - + Звук In-game sound effects @@ -1546,7 +1642,7 @@ Music - + Музыка In-game music @@ -1907,15 +2003,15 @@ Fullscreen - Полный экран + Полный экран Fullscreen Resolution - + Разрешение в полноэкранном режиме Windowed Resolution - + Разрешение в оконном режиме Your Email @@ -1941,6 +2037,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2029,35 +2129,12 @@ - Main - Error - - - Cannot create directory %1 - Не могу создать папку %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Не могу создать папку %1 Unable to start the server: %1. - Ошибка запуска сервера: %1. - - - Unable to run engine at - - - - Error code: %1 - + Ошибка запуска сервера: %1. Video upload - Error @@ -2206,17 +2283,14 @@ - Hedgewars - - - Not all players are ready - + Не все игроки готовы Are you sure you want to start this game? Not all players are ready. - + Вы действительно хотите запустить игру? +Не все игроки готовы. @@ -2321,20 +2395,40 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt Enter a name for your room. - + Введите название для вашей комнаты. Cancel - Отмена + Отмена Create room - + Создать комнату @@ -2388,19 +2482,19 @@ SeedPrompt The map seed is the basis for all random values generated by the game. - + Зерно карты - это основа для всех псведослучайных значений, используемых в игре. Cancel - Отмена + Отмена Set seed - + Установить зерно Close - + Закрыть @@ -2431,25 +2525,44 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + Для игры нужны как минимум две команды! + + + TeamShowWidget %1's team - + Команда %1 ThemePrompt Cancel - Отмена + Отмена Search for a theme: - + Искать тему: Use selected theme - + Использовать выбранную тему @@ -2620,26 +2733,26 @@ hedgehog info - + информация о еже binds (categories) Movement - + Передвижение Weapons - Оружие + Оружие Camera - + Камера Miscellaneous - Разное + Разное @@ -2710,7 +2823,7 @@ Hedgehog movement - + Движение ежа @@ -3032,119 +3145,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_sk.ts --- a/share/hedgewars/Data/Locale/hedgewars_sk.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_sk.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -183,6 +199,24 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Nepodarilo sa vytvoriť adresár %1 + + + Failed to open data directory: +%1 + +Please check your installation! + Chyba pri otváraní adresára s dátami: +%1 + +Skontrolujte, prosím, inštaláciu! + HWAskQuitDialog @@ -233,6 +267,18 @@ Failed to save StyleSheet to %1 Nepodarilo sa uložiť súbor so štýlom do %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -332,6 +378,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -451,10 +501,6 @@ - Theme: - - - Load drawn map Načítať nakreslenú mapu @@ -470,6 +516,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -514,7 +564,7 @@ %1 *** %2 has joined - %1 *** %2 sa pridal + %1 *** %2 sa pridal %1 *** %2 has left (%3) @@ -543,6 +593,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -693,6 +758,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -840,6 +916,14 @@ <b>%1</b> sa zľakol a preskočil ťah <b>%2</b>krát. + + Play again + + + + Save + Uložiť + PageInGame @@ -949,6 +1033,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1938,6 +2033,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2027,37 +2126,37 @@ Main - Error - Hlavné okno - Chyba + Hlavné okno - Chyba Cannot create directory %1 - Nepodarilo sa vytvoriť adresár %1 + Nepodarilo sa vytvoriť adresár %1 Failed to open data directory: %1 Please check your installation! - Chyba pri otváraní adresára s dátami: + Chyba pri otváraní adresára s dátami: %1 Skontrolujte, prosím, inštaláciu! TCP - Error - TCP - Chyba + TCP - Chyba Unable to start the server: %1. - Nepodarilo sa spustiť server: %1. + Nepodarilo sa spustiť server: %1. Unable to run engine at - Nepodarilo sa spustiť enginu na + Nepodarilo sa spustiť enginu na Error code: %1 - Kód chyby: %1 + Kód chyby: %1 Video upload - Error @@ -2206,10 +2305,6 @@ - Hedgewars - - - Not all players are ready @@ -2321,6 +2416,26 @@ Upload this video to your Youtube account Uploadovať video na váš účet YouTube + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2431,6 +2546,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3032,119 +3166,4 @@ Pravý joystick (Doľava) - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_sv.ts --- a/share/hedgewars/Data/Locale/hedgewars_sv.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_sv.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -177,6 +193,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Kan inte skapa katalog %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -227,6 +258,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -326,6 +369,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -445,10 +492,6 @@ - Theme: - - - Load drawn map Läs in ritad karta @@ -464,6 +507,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -508,7 +555,7 @@ %1 *** %2 has joined - %1 *** %2 har gått med + %1 *** %2 har gått med %1 *** %2 has left (%3) @@ -537,6 +584,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -687,6 +749,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -828,6 +901,14 @@ <b>%1</b> var rädd och hoppade över turer <b>%2</b> gånger. + + Play again + + + + Save + Spara + PageInGame @@ -937,6 +1018,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1920,6 +2012,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2008,35 +2104,12 @@ - Main - Error - - - Cannot create directory %1 - Kan inte skapa katalog %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Kan inte skapa katalog %1 Unable to start the server: %1. - Kunde inte starta servern: %1. - - - Unable to run engine at - - - - Error code: %1 - + Kunde inte starta servern: %1. Video upload - Error @@ -2184,10 +2257,6 @@ - Hedgewars - - - Not all players are ready @@ -2299,6 +2368,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2409,6 +2498,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3010,119 +3118,4 @@ Styrkors - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_tr_TR.ts --- a/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -167,6 +183,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + %1 dizini oluşturulamadı + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,6 +248,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -316,6 +359,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -435,10 +482,6 @@ - Theme: - - - Load drawn map @@ -454,6 +497,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -497,10 +544,6 @@ - %1 *** %2 has joined - - - %1 *** %2 has left @@ -527,6 +570,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -677,6 +735,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -812,6 +881,14 @@ + + Play again + + + + Save + + PageInGame @@ -921,6 +998,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1882,6 +1970,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1970,35 +2062,12 @@ - Main - Error - - - Cannot create directory %1 - %1 dizini oluşturulamadı - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + %1 dizini oluşturulamadı Unable to start the server: %1. - Sunucu başlatılamadı: %1. - - - Unable to run engine at - - - - Error code: %1 - + Sunucu başlatılamadı: %1. Video upload - Error @@ -2144,10 +2213,6 @@ - Hedgewars - - - Not all players are ready @@ -2259,6 +2324,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2369,6 +2454,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2970,119 +3074,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_uk.ts --- a/share/hedgewars/Data/Locale/hedgewars_uk.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_uk.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -183,6 +199,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + Не можу створити директорію %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -233,6 +264,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -332,6 +375,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -451,10 +498,6 @@ - Theme: - - - Load drawn map Завантажити намальовану мапу @@ -470,6 +513,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -514,7 +561,7 @@ %1 *** %2 has joined - %1 *** %2 приєднався + %1 *** %2 приєднався %1 *** %2 has left (%3) @@ -543,6 +590,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -693,6 +755,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -840,6 +913,14 @@ + + Play again + + + + Save + Зберегти + PageInGame @@ -949,6 +1030,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1934,6 +2026,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -2022,35 +2118,12 @@ - Main - Error - - - Cannot create directory %1 - Не можу створити директорію %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + Не можу створити директорію %1 Unable to start the server: %1. - Помилка запуску сервера: %1. - - - Unable to run engine at - - - - Error code: %1 - + Помилка запуску сервера: %1. Video upload - Error @@ -2199,10 +2272,6 @@ - Hedgewars - - - Not all players are ready @@ -2314,6 +2383,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2424,6 +2513,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -3025,119 +3133,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_zh_CN.ts --- a/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts Thu Jun 13 22:27:23 2013 +0200 @@ -97,7 +97,7 @@ DataManager - + Use Default @@ -105,17 +105,37 @@ FeedbackDialog - + + We are always happy about suggestions, ideas, or bug reports. + + + + + Send us feedback! + + + + + If you found a bug, you can see if it's already been reported here: + + + + + Your email address is optional, but necessary if you want us to get back at you. + + + + View - + Cancel 取消 - + Send Feedback @@ -205,6 +225,24 @@ + + + Scheme '%1' not supported + + + + + Cannot create directory %1 + + + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,52 +255,67 @@ HWChatWidget - + + %1 has joined + + + + + %1 has left + + + + + %1 has left (%2) + + + + %1 has been removed from your ignore list - + %1 has been added to your ignore list - + %1 has been removed from your friends list - + %1 has been added to your friends list - + Stylesheet imported from %1 - + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - + Couldn't read %1 - + StyleSheet discarded - + StyleSheet saved to %1 - + Failed to save StyleSheet to %1 @@ -280,17 +333,17 @@ - + Game aborted - + Hedgewars - Nick registered - + This nick is registered, and you haven't specified a password. If this nick isn't yours, please register your own nick at www.hedgewars.org @@ -299,93 +352,98 @@ - + Your nickname is not registered. To prevent someone else from using it, please register it at www.hedgewars.org - + Your password wasn't saved either. - + Nickname - + Someone already uses your nickname %1 on the server. Please pick another nickname: - - + + No nickname supplied. - - + + Hedgewars - Empty nickname - + Hedgewars - Wrong password - + You entered a wrong password. - + Try Again - + Hedgewars - Connection error - + You reconnected too fast. Please wait a few seconds and try again. - + Hedgewars Demo File File Types - + Hedgewars Save File File Types - + Demo name - + Demo name: - - + + This page requires an internet connection. + + + + + Cannot save record to file %1 无法录入文件 %1 @@ -393,13 +451,13 @@ HWGame - + en.txt zh_CN.txt - + Cannot open demofile %1 DEMO %1 打不开 @@ -407,158 +465,158 @@ HWMapContainer - + Small tunnels - + Medium tunnels - + Seed - + Map type: - - Image map - - - - Mission map + Image map - Hand-drawn + Mission map - Randomly generated + Hand-drawn + Randomly generated + + + + Random maze - + Random - + Map preview: - + Load map drawing - + Edit map drawing - - All - 全部 - - - - Small - 小型 - - - - Medium - 中型 - - - Large - 大型 + All + 全部 - Cavern - 洞穴 + Small + 小型 + Medium + 中型 + + + + Large + 大型 + + + + Cavern + 洞穴 + + + Wacky 曲折 - - Large tunnels - - - - - Small islands - - - - - Medium islands - - - + Large tunnels + + + + + Small islands + + + + + Medium islands + + + + Large islands - + Map size: - + Maze style: - + Mission: - + Map: - - - Theme: - - - - + + + Theme: %1 + + + + Load drawn map - + Drawn Maps - + All files @@ -609,40 +667,33 @@ - - %1 *** %2 has joined - - - - - + %1 *** %2 has left - - + %1 *** %2 has left (%3) - - + + %1 *** %2 has joined the room - + Quit reason: 退出原因: - + Room destroyed 房间损坏 - + You got kicked 被踢出 @@ -654,6 +705,24 @@ Login + + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + + Nickname: + + + + + Password: + + HWUploadVideoDialog @@ -679,17 +748,17 @@ HatPrompt - + Search for a hat: - + Cancel 取消 - + Use selected hat @@ -834,6 +903,19 @@ + PageDataDownload + + + Loading, please wait. + + + + + This page requires an internet connection. + + + + PageDrawMap @@ -954,47 +1036,57 @@ - + + Play again + + + + + Save + 保存 + + + The best shot award was won by <b>%1</b> with <b>%2</b> pts. - + The best killer is <b>%1</b> with <b>%2</b> kills in a turn. - + A total of <b>%1</b> hedgehog(s) were killed during this round. - + (%1 kill) - + <b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts. - + <b>%1</b> killed <b>%2</b> of his own hedgehogs. - + <b>%1</b> was scared and skipped turn <b>%2</b> times. @@ -1093,12 +1185,12 @@ PageMultiplayer - + Edit game preferences - + Start 开始 @@ -1131,6 +1223,19 @@ + PageNetServer + + + Click here for details + + + + + Insert your address here + + + + PageOptions @@ -1249,97 +1354,97 @@ - + Frontend - + Custom colors - + Reset to default colors - + Game audio - + Frontend audio - + Account - + Proxy settings - - Proxy host - - - - - Proxy port - - - - Proxy login + Proxy host + Proxy port + + + + + Proxy login + + + + Proxy password - - No proxy - - - - - System proxy settings - - - - Socks5 proxy + No proxy + System proxy settings + + + + + Socks5 proxy + + + + HTTP proxy - + Miscellaneous - + Updates - + Check for updates - + Video recording options @@ -1360,42 +1465,42 @@ PageRoomsList - + Search for a room: - + Create room - + Join room - + Room state - + Rules: - + Weapons: - + Clear filters - + Open server administration page @@ -1408,14 +1513,14 @@ 加入 - + %1 players online - + Admin features 管理员功能 @@ -1742,33 +1847,33 @@ - + Ignore - + Add friend - - Unignore - - - + Unignore + + + + Remove friend - + Show games in lobby - + Show games in-progress @@ -1776,75 +1881,75 @@ QCheckBox - + Fullscreen 游戏全屏幕 - + Show FPS 显示帧率 (FPS) - + Alternative damage show 另一种伤害显示方式 - + Visual effects - - + + Sound - + In-game sound effects - - + + Music - + In-game music - + Frontend sound effects - + Frontend music - + Check for updates at startup - + Show ammo menu tooltips - + Append date and time to record file name 记录名称中包含具体时间日期 - - + + Save password @@ -1859,12 +1964,12 @@ - + Record audio - + Use game resolution @@ -1887,88 +1992,88 @@ Lv 级别 - + (System default) - - Disabled - - - - - Red/Cyan - - - - Cyan/Red + Disabled - Red/Blue + Red/Cyan - Blue/Red + Cyan/Red - Red/Green + Red/Blue + Blue/Red + + + + + Red/Green + + + + Green/Red + + Side-by-side + + + + + Top-Bottom + + + + + Red/Cyan grayscale + + + + + Cyan/Red grayscale + + + + + Red/Blue grayscale + + + + + Blue/Red grayscale + + + - Side-by-side + Red/Green grayscale - Top-Bottom - - - - - Red/Cyan grayscale - - - - - Cyan/Red grayscale - - - - - Red/Blue grayscale - - - - - Blue/Red grayscale - - - - - Red/Green grayscale - - - - Green/Red grayscale - - + + Any @@ -1991,7 +2096,7 @@ 城堡模式 - + Playing teams 玩家队伍 @@ -2024,22 +2129,27 @@ QLabel - + Locale - + Nickname - + + This setting will be effective at next restart. + + + + Resolution 分辨率 - + Quality @@ -2059,12 +2169,12 @@ - + Stereo rendering - + FPS limit FPS 上限 @@ -2079,12 +2189,12 @@ - + Server name: 服务器名: - + Server port: 服务器端口: @@ -2108,7 +2218,7 @@ 版本 - + Initial sound volume 初始音量 @@ -2255,62 +2365,62 @@ - + Your Email - - Summary - - - + Summary + + + + Send system information - + Description - + Type the security code: + + Tip: + + + - Tip: - - - - This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete! - + Format - + Audio codec - + Video codec - + Framerate - + Bitrate (Kbps) @@ -2328,7 +2438,7 @@ QLineEdit - + unnamed 无名 @@ -2339,7 +2449,7 @@ - + anonymous @@ -2380,81 +2490,82 @@ - + Cannot delete default scheme '%1'! - + Please select a record from the list - + Hedgewars - Nick not registered - + Unable to start server - + Connection to server is lost 服务器连接丢失 + + Not all players are ready + + + + + Are you sure you want to start this game? +Not all players are ready. + + + + + + Hedgewars - Error + + + + + System Information Preview + + + + + + Failed to generate captcha + + + + + Failed to download captcha + + + + + Please fill out all fields. Email is optional. + + + + + + Hedgewars - Success + + + - Not all players are ready - - - - - Are you sure you want to start this game? -Not all players are ready. - - - - - Hedgewars - Error - - - - - System Information Preview - - - - - - Failed to generate captcha - - - - - Failed to download captcha - - - - - Please fill out all fields. Email is optional. - - - - - - Hedgewars - Success - - - - All file associations have been set - + File association failed. @@ -2482,46 +2593,6 @@ - - - Main - Error - - - - - Cannot create directory %1 - - - - - Failed to open data directory: -%1 - -Please check your installation! - - - - - - TCP - Error - - - - - Unable to start the server: %1. - - - - - Unable to run engine at - - - - - Error code: %1 - - - Netgame - Error @@ -2562,22 +2633,22 @@ - + Room Name - Error - + Please select room from the list - + Room Name - Are you sure? - + The game you are trying to join has started. Do you still want to join the room? @@ -2624,7 +2695,7 @@ - + File error @@ -2635,7 +2706,7 @@ - + Cannot open '%1' for reading @@ -2666,20 +2737,15 @@ - + Hedgewars - Warning - + Hedgewars - Information - - - Hedgewars - - QPushButton @@ -2701,11 +2767,36 @@ 上场! + + Reset + + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start 开始 + + Start private server + + + Start server 开始服务端 @@ -2727,7 +2818,6 @@ - default 默认 @@ -2760,17 +2850,17 @@ - + Associate file extensions - + Set default options - + Restore default coding parameters @@ -2952,6 +3042,28 @@ + TCPBase + + + Unable to start server at %1. + + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + + At least two teams are required to play! + + + + TeamShowWidget @@ -2962,17 +3074,17 @@ ThemePrompt - + Search for a theme: - + Cancel 取消 - + Use selected theme @@ -3663,7 +3775,7 @@ - + Keyboard @@ -3705,147 +3817,4 @@ - - server - - - Not room master - - - - - Corrupted hedgehogs info - - - - - too many teams - - - - - too many hedgehogs - - - - - There's already a team with same name in the list - - - - - round in progress - - - - - restricted - - - - - REMOVE_TEAM: no such team - - - - - Not team owner! - - - - - Less than two clans! - - - - - Room with such name already exists - - - - - Nickname already chosen - - - - - Illegal nickname - - - - - Protocol already known - - - - - Bad number - - - - - Nickname is already in use - - - - - No checker rights - - - - - Authentication failed - - - - - 60 seconds cooldown after kick - - - - - kicked - - - - - Ping timeout - - - - - bye - - - - - Illegal room name - - - - - No such room - - - - - Joining restricted - - - - - Registered users only - - - - - You are banned in this room - - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hedgewars_zh_TW.ts --- a/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts Thu Jun 13 22:27:23 2013 +0200 @@ -98,6 +98,22 @@ Send Feedback + + We are always happy about suggestions, ideas, or bug reports. + + + + Send us feedback! + + + + If you found a bug, you can see if it's already been reported here: + + + + Your email address is optional, but necessary if you want us to get back at you. + + FreqSpinBox @@ -167,6 +183,21 @@ + + Scheme '%1' not supported + + + + Cannot create directory %1 + 無法創建路徑 %1 + + + Failed to open data directory: +%1 + +Please check your installation! + + HWAskQuitDialog @@ -217,6 +248,18 @@ Failed to save StyleSheet to %1 + + %1 has joined + + + + %1 has left + + + + %1 has left (%2) + + HWForm @@ -316,6 +359,10 @@ Please wait a few seconds and try again. + + This page requires an internet connection. + + HWGame @@ -435,10 +482,6 @@ - Theme: - - - Load drawn map @@ -454,6 +497,10 @@ Large tunnels + + Theme: %1 + + HWNetServersModel @@ -498,7 +545,7 @@ %1 *** %2 has joined - %1***%2已經進入 + %1***%2已經進入 %1 *** %2 has left (%3) @@ -527,6 +574,21 @@ Login + + To connect to the server, please log in. + +If you don't have an account on www.hedgewars.org, +just enter your nickname. + + + + Nickname: + + + + Password: + + HWUploadVideoDialog @@ -677,6 +739,17 @@ + PageDataDownload + + Loading, please wait. + + + + This page requires an internet connection. + + + + PageDrawMap Undo @@ -812,6 +885,14 @@ + + Play again + + + + Save + + PageInGame @@ -921,6 +1002,17 @@ + PageNetServer + + Click here for details + + + + Insert your address here + + + + PageOptions New team @@ -1890,6 +1982,10 @@ This program is distributed under the %1 + + This setting will be effective at next restart. + + QLineEdit @@ -1978,35 +2074,12 @@ - Main - Error - - - Cannot create directory %1 - 無法創建路徑 %1 - - - Failed to open data directory: -%1 - -Please check your installation! - - - - TCP - Error - + 無法創建路徑 %1 Unable to start the server: %1. - 無法開始服務端: %1. - - - Unable to run engine at - - - - Error code: %1 - + 無法開始服務端: %1. Video upload - Error @@ -2152,10 +2225,6 @@ - Hedgewars - - - Not all players are ready @@ -2267,6 +2336,26 @@ Upload this video to your Youtube account + + Reset + + + + Set the default server port for Hedgewars + + + + Invite your friends to your server in just 1 click! + + + + Click to copy your unique server URL in your clipboard. Send this link to your friends ands and they will be able to join you. + + + + Start private server + + RoomNamePrompt @@ -2377,6 +2466,25 @@ + TCPBase + + Unable to start server at %1. + + + + Unable to run engine at %1 +Error code: %2 + + + + + TeamSelWidget + + At least two teams are required to play! + + + + TeamShowWidget %1's team @@ -2978,119 +3086,4 @@ - - server - - Not room master - - - - Corrupted hedgehogs info - - - - too many teams - - - - too many hedgehogs - - - - There's already a team with same name in the list - - - - round in progress - - - - restricted - - - - REMOVE_TEAM: no such team - - - - Not team owner! - - - - Less than two clans! - - - - Room with such name already exists - - - - Nickname already chosen - - - - Illegal nickname - - - - Protocol already known - - - - Bad number - - - - Nickname is already in use - - - - No checker rights - - - - Authentication failed - - - - 60 seconds cooldown after kick - - - - kicked - - - - Ping timeout - - - - bye - - - - Illegal room name - - - - No such room - - - - Joining restricted - - - - Registered users only - - - - You are banned in this room - - - - Empty config entry - - - diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/hu.txt --- a/share/hedgewars/Data/Locale/hu.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/hu.txt Thu Jun 13 22:27:23 2013 +0200 @@ -146,7 +146,6 @@ 02:01=%1 Eccot, a delfint játssza 02:01=%1 meglátogatja Aquaria-t 02:01=%1 meglelte Atlantiszt -02:01=%1 a Bioshock 3 főszerepére vágyik 02:01=A kutyaúszásod még nem tőkéletes, %1 02:01=%1 hozhatott volna jet ski-t is 02:01=%1 nem szereti a vízisportokat diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/it.txt --- a/share/hedgewars/Data/Locale/it.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/it.txt Thu Jun 13 22:27:23 2013 +0200 @@ -56,7 +56,7 @@ 00:53=Macchina Spazio-Temporale ; 00:54=Attrezzi da Costruzione 00:54=Terreno Spray -00:55=Congelatore +00:55=Raggio Congelatore 00:56=Mannarino 01:00=Combattiamo! @@ -451,10 +451,10 @@ 03:51=Terreno al 100% 03:52=NON USATO 03:53=TARDIS Modello 40 -03:54=(Arma in sviluppo) -03:55=Utilità di costruzione -03:56=(Arma in sviluppo) -03:57=Ecco il grande chef! +;03:54=(Arma in sviluppo) +03:54=Utilità di costruzione +03:55=Arma di ibernazione di massa +03:56=Ecco il grande chef! ; Weapon Descriptions (use | as line breaks) 04:00=Attacca i tuoi nemici con una semplice granata.|Esploderà quando il timer arriverà a zero secondi.|1-5: Imposta il timer della granata|Attacco: Tieni premuto per lanciare con più forza|Mirino di Precisione + 1-5: Imposta livello di rimbalzo @@ -511,10 +511,10 @@ 04:51=Spingete i nemici in acqua o sopra le mine!|Questa semplice arma non farà molti danni ma|spingerà con forza i nemici che colpisce!|Nei temi Snow e Christmas è una palla di neve!|Attacco: Tieni premuto per lanciare con più forza 04:52=NON USATO 04:53=Parti per un'avventura unica attraverso spazio e tempo,|lasciando i tuoi compagni da soli a combattere.|Preparati a ritornare in qualsiasi momento,|o per il Sudden Death o se sei l'ultimo sopravvissuto.|Attenzione! Non è utilizzabile durante il Sudden Death,|se sei rimasto da solo, o se sei il Re.|Attacco: Inzia la tua avventura nello spazio-tempo! -04:54=DESCRIZIONE NON DISPONIBILE (arma ancora in sviluppo) -04:55=Con questo terreno spray non ti mancherà mai la terra |sotto ai piedi. Utilissimo per costruire ponti, |seppellire nemici e sigillare tunnel.|Ma fai attenzione a non usarlo a tuo svantaggio!|Attacco: Attiva|Su/Giù: Continua a mirare|Sinistra/Destra: Modifica la potenza di fuoriuscita del terreno -04:56=DESCRIZIONE NON DISPONIBILE (arma ancora in sviluppo) -04:57=Lancia due mannarini da cucina verso i tuoi nemici, se |lanciati con potenza possono rappresentare una... tagliente sorpresa!|Ricorda che rimarranno sul terreno dopo averli lanciati!|Attacco: Tieni premuto per lanciare con più forza +;04:54=DESCRIZIONE NON DISPONIBILE (arma ancora in sviluppo) +04:54=Con questo terreno spray non ti mancherà mai la terra |sotto ai piedi. Utilissimo per costruire ponti, |seppellire nemici e sigillare tunnel.|Ma fai attenzione a non usarlo a tuo svantaggio!|Attacco: Attiva|Su/Giù: Continua a mirare|Sinistra/Destra: Modifica la potenza di fuoriuscita del terreno +04:55=L'era glaciale non è mai stata così imminente!|Con questo potente raggio potrai congelare i ricci nemici,|rendere il terreno scivoloso e salvarti dalle cadute|in acqua trasformando il mare in una distesa di ghiaccio!|Attacco: Attiva|Su/Giù: Continua a mirare +04:56=Lancia due mannarini da cucina verso i tuoi nemici, se |lanciati con potenza possono rappresentare una... tagliente sorpresa!|Ricorda che rimarranno sul terreno dopo averli lanciati!|Attacco: Tieni premuto per lanciare con più forza ; Game goal strings 05:00=Modalità di Gioco diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/ja.txt --- a/share/hedgewars/Data/Locale/ja.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/ja.txt Thu Jun 13 22:27:23 2013 +0200 @@ -177,7 +177,6 @@ 02:01=%1はエコーザのイルカを再生したい 02:01=%1は水族館を訪問してしまった 02:01=%1がアトランティスの失われた都市を発見した -02:01=%1でBioshock3の先導的な役割を目指して 02:01=あなたの犬のパドルは、少し作業は、%1を使用することができます 02:01=%1はジェットスキーを持っている必要があります 02:01=%1はウォータースポーツが好きではありません。 @@ -466,8 +465,8 @@ 03:51=地上で発見 03:52=UNUSED 03:53=タイプ40 -03:54=何かを構築 -03:55=ユーティリティ +;03:54=何かを構築 +03:54=ユーティリティ ; Weapon Descriptions (use | as line breaks) 04:00=シンプルな手榴弾を使って敵を攻撃。|そのタイマーがゼロに達するとそれが爆発する。|1-5:セットグレネードのタイマー攻撃:より多くの電力をスローするようにホールド @@ -524,8 +523,8 @@ 04:51=泥のボールを投げつけることによって自由なショットで取得します。|刺されは、ビット、豚をバックノックする。 04:52=UNUSED 04:53=あなたの仲間が単独で戦うために残しながら、時間と空間を介して冒険に出る。|いつでも返すように準備する、または突然死の場合、または、それらはすべて敗北しています。|免責事項。|あなたは一人である場合は、突然死で機能するか、キングである場合ではありません。 -04:54=INCOMPLETE -04:55=スティッキーフレークのストリームをスプレー。|トンネルを封鎖、敵を埋める、ブリッジを構築します。|あなたが上の任意のを取得しないように注意してください! +;04:54=INCOMPLETE +04:54=スティッキーフレークのストリームをスプレー。|トンネルを封鎖、敵を埋める、ブリッジを構築します。|あなたが上の任意のを取得しないように注意してください! ; Game goal strings 05:00=ゲームモード diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/lt.txt --- a/share/hedgewars/Data/Locale/lt.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/lt.txt Thu Jun 13 22:27:23 2013 +0200 @@ -175,7 +175,6 @@ 02:01=%1 nori žaisti delfinus 02:01=%1 nuejo i Aquaria 02:01=%1 rado prarasta atlantijos miesta -02:01=%1 bando pajimti pagrindini vaidmeni Bioshock 3 02:01=Tavo šuniuko stylius galėtu panaudoti šiek tiek daugiau praktikos, %1 02:01=%1 galėjo atsinešti laiva 02:01=%1 nepatinka vandens sportas @@ -447,7 +446,7 @@ 03:51=Rastas Ant Žemės 03:52=UNUSED 03:53=Tipas 40 -03:54=Pastatyk Ka Nors +;03:54=Pastatyk Ka Nors ; Weapon Descriptions (use | as line breaks) 04:00=Atakuok savo priešus su paprasta granata.|Ji sprogs kaip jos laikmatis pasieks nuli.|1-5: Nustatyk granatos laikmati|Ataka: Laikyk kad mestum stipriau diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/missions_en.txt --- a/share/hedgewars/Data/Locale/missions_en.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/missions_en.txt Thu Jun 13 22:27:23 2013 +0200 @@ -43,8 +43,11 @@ User_Mission_-_Rope_Knock_Challenge.name=Challenge: Rope Knocking User_Mission_-_Rope_Knock_Challenge.desc="Look behind you!" +User_Mission_-_Nobody_Laugh.name=Mission: Nobody Laugh +User_Mission_-_Nobody_Laugh.desc="This ain't no joke." + User_Mission_-_RCPlane_Challenge.name=Challenge: RC Plane User_Mission_-_RCPlane_Challenge.desc="Feeling pretty confident, eh, flyboy?" -portal.name= Mission: Portal training mission +portal.name=Mission: Portal Mind Challenge portal.desc="Use the portal to move fast and far, use it to kill, use it with caution!" diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/missions_fr.txt --- a/share/hedgewars/Data/Locale/missions_fr.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/missions_fr.txt Thu Jun 13 22:27:23 2013 +0200 @@ -13,7 +13,7 @@ Basic_Training_-_Sniper_Rifle.name=Initiation au Sniper Basic_Training_-_Sniper_Rifle.desc="Pan ! En pleine tête !" -Basic_Training_-_Rope.name=Initiation à la Corde Ninja +Basic_Training_-_Rope.name=Initiation au Grappin Basic_Training_-_Rope.desc="Bouge de là et Balance toi !" User_Mission_-_Dangerous_Ducklings.name=Mission: Canards dangereux @@ -40,8 +40,11 @@ User_Mission_-_The_Great_Escape.name=Mission: La grande évasion User_Mission_-_The_Great_Escape.desc="Tu pense que tu peux me capturer ?!" -User_Mission_-_Rope_Knock_Challenge.name=Challenge: A coup de Corde Ninja +User_Mission_-_Rope_Knock_Challenge.name=Challenge: A coup de Grappin User_Mission_-_Rope_Knock_Challenge.desc="Regarde derrière toi !" User_Mission_-_RCPlane_Challenge.name=Challenge: Avion télécommandé -User_Mission_-_RCPlane_Challenge.desc="Plutôt confiant, hein, aviateur ?" \ No newline at end of file +User_Mission_-_RCPlane_Challenge.desc="Plutôt confiant, hein, aviateur ?" + +portal.name=Portal Casse Tête +portal.desc="Utilisez le fusil à portail pour voyager loin et rapidemment ou pour tuer ! Utiliser avec prudence !" diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/missions_pt.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Locale/missions_pt.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,50 @@ +Basic_Training_-_Bazooka.name=Treino Básico com Bazuca +Basic_Training_-_Bazooka.desc="Saber utilizar o vento para tua vantagem é a chave!" + +Basic_Training_-_Grenade.name=Treino Básico com Granada +Basic_Training_-_Grenade.desc="Lembra-te, tens de retirar a cavilha E ATIRAR!" + +Basic_Training_-_Cluster_Bomb.name=Treino Básico com Bomba de Fragmentos +Basic_Training_-_Cluster_Bomb.desc="Alguem está a precisar de um duche bem quente!" + +Basic_Training_-_Shotgun.name=Treino Básico com Caçadeira +Basic_Training_-_Shotgun.desc="Dispara primeiro, questiona depois!" + +Basic_Training_-_Sniper_Rifle.name=Treino Básico com Sniper +Basic_Training_-_Sniper_Rifle.desc="Boom, headshot!" + +Basic_Training_-_Rope.name=Treino Básico com Corda +Basic_Training_-_Rope.desc="Get out there and swing!" + +User_Mission_-_Dangerous_Ducklings.name=Missão: Dangerous Ducklings +User_Mission_-_Dangerous_Ducklings.desc="Alright, rookie! Time to put what we learned in Basic Training into practice!" + +User_Mission_-_Diver.name=Missão: Diver +User_Mission_-_Diver.desc="Esta coisa do 'assalto anfíbio' é mais difícil do que parece..." + +User_Mission_-_Teamwork.name=Missão: Teamwork +User_Mission_-_Teamwork.desc="Por vezes, o amor doi." + +User_Mission_-_Spooky_Tree.name=Missão: Spooky Tree +User_Mission_-_Spooky_Tree.desc="Imensas caixas por todo o lado. Só espero que este pássaro não se esteja a sentir com fome." + +User_Mission_-_Bamboo_Thicket.name=Missão: Bamboo Thicket +User_Mission_-_Bamboo_Thicket.desc="Death comes from above." + +User_Mission_-_That_Sinking_Feeling.name=Missão: That Sinking Feeling +User_Mission_-_That_Sinking_Feeling.desc="A água está a subir rapidamente e o tempo é limitado. Muitos tentaram e falharam. Consegues salvá-los todos?" + +User_Mission_-_Newton_and_the_Hammock.name=Missão: Newton and the Hammock +User_Mission_-_Newton_and_the_Hammock.desc="Remember hoglets: The velocity of a body remains constant unless the body is acted upon by an external force!" + +User_Mission_-_The_Great_Escape.name=Missão: The Great Escape +User_Mission_-_The_Great_Escape.desc="Pensas que me consegues enjaular!?" + +User_Mission_-_Rope_Knock_Challenge.name=Desafio: Rope Knocking +User_Mission_-_Rope_Knock_Challenge.desc="Look behind you!" + +User_Mission_-_RCPlane_Challenge.name=Desafio: Avião Telecomandado +User_Mission_-_RCPlane_Challenge.desc="Feeling pretty confident, eh, flyboy?" + +portal.name=Missão: Treino com Portais +portal.desc="Use the portal to move fast and far, use it to kill, use it with caution!" diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/missions_tr.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Locale/missions_tr.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,50 @@ +Basic_Training_-_Bazooka.name=Temel Roketatar Eğitimi +Basic_Training_-_Bazooka.desc="Rüzgarı yararına kullanmak bir anahtar!" + +Basic_Training_-_Grenade.name=Temel Bomba Eğitimi +Basic_Training_-_Grenade.desc="Unutma, pimi çek VE at!" + +Basic_Training_-_Cluster_Bomb.name=Temel Parça Tesirli Bomba Eğitimi +Basic_Training_-_Cluster_Bomb.desc="Birinin sıcak duşa ihtiyacı var!" + +Basic_Training_-_Shotgun.name=Temel Tüfek Eğitimi +Basic_Training_-_Shotgun.desc="Önce atış yap, soruları sonra sor!" + +Basic_Training_-_Sniper_Rifle.name=Temel Keskin Nişancı Tüfeği Eğitimi +Basic_Training_-_Sniper_Rifle.desc="Bum, kafadan!" + +Basic_Training_-_Rope.name=Temel Halat Eğitimi +Basic_Training_-_Rope.desc="Ordan çık ve sallan!" + +User_Mission_-_Dangerous_Ducklings.name=Görev: Tehlikeli Ördek Yavruları +User_Mission_-_Dangerous_Ducklings.desc="Peki acemi! Şimdi Temel Eğitimde öğrendiklerini uygulamanın zamanı!" + +User_Mission_-_Diver.name=Görev: Dalıcı +User_Mission_-_Diver.desc="Bu 'iki yönlü saldırı' göründüğünden daha zor..." + +User_Mission_-_Teamwork.name=Görev: Takım Çalışması +User_Mission_-_Teamwork.desc="Bazen, aşk acıtır." + +User_Mission_-_Spooky_Tree.name=Görev: Korkak Ağaç +User_Mission_-_Spooky_Tree.desc="Burada çok fazla kasa var. Eminim bu kuş aç değildir." + +User_Mission_-_Bamboo_Thicket.name=Görev: Bambu Ormanı +User_Mission_-_Bamboo_Thicket.desc="Ölüm yukardan gelir." + +User_Mission_-_That_Sinking_Feeling.name=Görev: Batıyormuş Hissi +User_Mission_-_That_Sinking_Feeling.desc="Su hızlıca yükseliyor ve zaman kısıtlı. Çoğu denedi ve kaybetti. Hepsini kurtarabilecek misin?" + +User_Mission_-_Newton_and_the_Hammock.name=Görev: Newton ve Hamak +User_Mission_-_Newton_and_the_Hammock.desc="Kirpişleri unutma: Bir vücudun hızı harici bir kuvvetle itilmedikçe sabit kalır!" + +User_Mission_-_The_Great_Escape.name=Görev: Büyük Kaçış +User_Mission_-_The_Great_Escape.desc="Beni hapsedebileceğini mi sanıyorsun!?" + +User_Mission_-_Rope_Knock_Challenge.name=Mücadele: Halat Vuruşu +User_Mission_-_Rope_Knock_Challenge.desc="Arkana bak!" + +User_Mission_-_RCPlane_Challenge.name=Mücadele: RC Uçağı +User_Mission_-_RCPlane_Challenge.desc="Çok emin görünüyorsun değil mi, uçan çocuk?" + +portal.name= Görev: Portal eğitim görevi +portal.desc="Hızlı ve uzak yerlere hareket için portalı kullan, öldürmek için kullan, dikkatli kullan!" diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/nl.txt --- a/share/hedgewars/Data/Locale/nl.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/nl.txt Thu Jun 13 22:27:23 2013 +0200 @@ -164,7 +164,6 @@ 02:01=%1 wants to play Ecco the dolphin 02:01=%1 has gone to visit Aquaria 02:01=%1 has found the lost city of Atlantis -02:01=%1 aims for the lead role in Bioshock 3 02:01=Your doggy paddle could use a little work, %1 02:01=%1 should have brought a jet ski 02:01=%1 doesn't like watersports diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/pl.txt --- a/share/hedgewars/Data/Locale/pl.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/pl.txt Thu Jun 13 22:27:23 2013 +0200 @@ -174,7 +174,7 @@ 02:01=%1 śpi z rybami 02:01=%1 uważa, że fizyka płynów w tej grze jest do bani! 02:01=%1 wygląda na spragnionego -02:01=Morze Ciebie wzywa, %1 +02:01=Morze Cię wzywa, %1 02:01=%1 zaginął na morzu 02:01=%1 powinien przynieść zestaw do nurkowania 02:01=%1 ma pogrzeb na morzu @@ -193,7 +193,6 @@ 02:01=%1 będzie grał w "Uwolnić Orkę" 02:01=%1 szuka rybek do akwarium! 02:01=%1 odnalazł Atlantydę! -02:01=%1 chce być główną postacią w Bioshock 3 02:01=Trzeba było się uczyć pływać... 02:01=%1 powinien ze sobą zabrać narty wodne 02:01=%1 nie lubi sportów wodnych @@ -287,7 +286,7 @@ 02:05=Dobre życie... w formie skrzyneczki! 02:05=Ktoś dzwonił po doktora? 02:05=Świeże bandaże! -02:05=To pomoże poczuć się Tobie lepiej +02:05=Po tym poczujesz sie lepiej! 02:05=Pomniejszy Eliksir Żywotności! Eeee... To chyba nie ta nazwa. 02:05=Zbierz mnie! 02:05=Zbierz to! @@ -310,6 +309,7 @@ 02:05=W Hedgewars opieka zdrowotna naprawdę wymiata! 02:05=Na zdrowie! 02:05=Szczepionka! +02:05=Ostatnio coś niewyraźnie wyglądasz. Weź tę apteczkę! ; New ammo crate 02:06=Więcej broni! @@ -540,8 +540,10 @@ 03:51=Znalezione na ziemi 03:52=UNUSED 03:53=Typ 40 -03:54=Zbuduj coś przydatnego -03:55=Narzędzie +;03:54=Zbuduj coś przydatnego +03:54=Narzędzie +03:55=Przełammy lody! +03:56=Nie przytnij sobie igieł! ; Weapon Descriptions (use | as line breaks) 04:00=Atakuj przeciwników zwykłym granatem.|Wybuchnie kiedy zapalnik skończy odliczanie.|1-5: Ustawia zapalnik|Atak: Przytrzymaj by rzucić z większą siłą @@ -598,8 +600,10 @@ 04:51=Obrzuć kogoś błotem! Broń ta nie zadaje dużych|obrażeń ale może Gogol zepchnąć z krawędzi!|Atak: Przytrzymaj by strzelić z większą siłą 04:52=UNUSED 04:53=Wybierz się na podróż w czasie i przestrzeni|zostawiając inne jeże na polu walki.|Bądź przygotowany na powrót w dowolnym momencie.|Gdy rozpocznie się|Nagła Śmierć lub większość jeży zostanie wybita.|Uwaga. Nie zadziała podczas Nagłej Śmierci,|gdy jesteś sam lub jeśli jesteś Królem. -04:54=INCOMPLETE -04:55=Wystrzel strumień kleistej mazi.|Buduj mosty, zasypuj wrogów, zatykaj tunele.|Uważaj by nie zasypać samego siebie! +;04:54=INCOMPLETE +04:54=Wystrzel strumień kleistej mazi.|Buduj mosty, zasypuj wrogów, zatykaj tunele.|Uważaj by nie zasypać samego siebie! +04:55=Epoka lodowcowa powraca!!|Zamroź jeże, uczyń podłoże śliskim lub zapobiegnij|utonięciu zamrażając wodę.|Atak: Strzał +04:56=Rzuć w przeciwnika dwoma tasakami i zablokuj mu |drogę lub użyj ich do wspinaczki! Jednak uważaj! |Te tasaki są naprawdę ostre!|Atak: Przytrzymaj by rzucić z większą siłą (dwukrotnie) ; Game goal strings 05:00=Ustawienia gry diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/pt_BR.txt --- a/share/hedgewars/Data/Locale/pt_BR.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/pt_BR.txt Thu Jun 13 22:27:23 2013 +0200 @@ -328,8 +328,8 @@ 03:51=Encontrei no chão 03:52=Sem uso 03:53=Tipo 40 -03:54=Constrói algo -03:55=Utilidade +;03:54=Constrói algo +03:54=Utilidade ; Weapon Descriptions (use | as line breaks) @@ -392,8 +392,8 @@ 04:51=Ganhe um tiro de graça, atirando uma bola de barro.|Fará com que o inimigo saia voando|e arde a vista. 04:52=Sem Uso 04:53=Viage através do tempo e espaço,|deixando seus camaradas na mão.|Esteja preparado para retornar a qualquer momento,|ou para a Morte Súbita se todos os aliados foram mortos.|Aviso. Não funciona na Morte Súbita,|se você estiversozinho, ou se você for o Rei. -04:54=INCOMPLETO -04:55=Atira um jorro de barro pegajoso.|Constrói pontes, enterra inimigos, sela túneis.|Cuidado para que não pegue em você! +;04:54=INCOMPLETO +04:54=Atira um jorro de barro pegajoso.|Constrói pontes, enterra inimigos, sela túneis.|Cuidado para que não pegue em você! ; Game goal strings 05:00=Modos de Jogo diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/pt_PT.lua --- a/share/hedgewars/Data/Locale/pt_PT.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/pt_PT.lua Thu Jun 13 22:27:23 2013 +0200 @@ -5,19 +5,19 @@ ["011101000"] = "011101000", -- A_Classic_Fairytale:dragon ["011101001"] = "011101001", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united ["30 minutes later..."] = "30 minutos depois...", -- A_Classic_Fairytale:shadow --- ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "ácerca de\aproximadamente um mês atrás, um cyborg veio e disse-nos que voces é que eram os cabinais!", -- A_Classic_Fairytale:enemy + ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "À volta de um mês atrás, apareceu um cyborg e disse-nos que voces é que eram os cabinais!", -- A_Classic_Fairytale:enemy ["Accuracy Bonus!"] = "Bónus de Precisão!", ["Ace"] = "Ás", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge ["Achievement Unlocked"] = "Proeza Desbloqueada", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler ["???"] = "???", -- A_Classic_Fairytale:backstab ["A Classic Fairytale"] = "Um Clássico Conto de Fadas", -- A_Classic_Fairytale:first_blood --- ["Actually, you aren't worthy of life! Take this..."] = "Pensando melhor, não mereçes viver\a vida que te foi dada\não mereces o ar que respiras! Toma\Pega isto...", -- A_Classic_Fairytale:shadow + ["Actually, you aren't worthy of life! Take this..."] = "Pensando melhor, não mereçes viver! Toma isto...", -- A_Classic_Fairytale:shadow ["A cy-what?"] = "Um cy-quê?", -- A_Classic_Fairytale:enemy ["Adventurous"] = "Aventureiro", -- A_Classic_Fairytale:journey ["Africa"] = "África", -- Continental_supplies --- ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "Depois do Leaks A Lot ter traido a sua tribo, ele juntou-se aos canibais...", -- A_Classic_Fairytale:first_blood + ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "Depois do Leaks A Lot ter traído a sua tribo, ele juntou-se aos canibais...", -- A_Classic_Fairytale:first_blood ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "Depois do choque causado pelo espião inimigo, Leaks A Lot e Nuvem Densa foram caçar para relaxar.", -- A_Classic_Fairytale:shadow --- ["Again with the 'cannibals' thing!"] = "Outra vez com a cena dos 'canibais'!", -- A_Classic_Fairytale:enemy + ["Again with the 'cannibals' thing!"] = "Outra vez com a cena dos 'canibais'!", -- A_Classic_Fairytale:enemy ["a Hedgewars challenge"] = "um desafio Hedgewars", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge ["a Hedgewars mini-game"] = "um mini-jogo Hedgewars", -- Space_Invasion, The_Specialists ["Aiming Practice"] = "Pratica a tua pontaria", --Bazooka, Shotgun, SniperRifle @@ -31,27 +31,27 @@ ["Ammo is reset at the end of your turn."] = "O armamento é reposto no fim do teu turno.", -- ["Ammo Maniac!"] = "", ["Ammo"] = "Munições", --- ["And how am I alive?!"] = "E como (raio) estou eu ainda vivo?!", -- A_Classic_Fairytale:enemy + ["And how am I alive?!"] = "E como raio estou eu vivo ainda?!", -- A_Classic_Fairytale:enemy -- ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood ["And so it began..."] = "E assim começou...", -- A_Classic_Fairytale:first_blood --- ["...and so the cyborgs took over the world..."] = "...e então os cyborgs tomaram conta\apoderaram-se do mundo...", -- A_Classic_Fairytale:shadow --- ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey --- ["And where's all the weed?"] = "E onde está a erva toda?", -- A_Classic_Fairytale:dragon --- ["And you believed me? Oh, god, that's cute!"] = "E tu acreditaste em mim? Ai Jesus, tão fofo!", -- A_Classic_Fairytale:journey + ["...and so the cyborgs took over the world..."] = "...e então os cyborgs apoderaram-se do mundo...", -- A_Classic_Fairytale:shadow + ["And so they discovered that cyborgs weren't invulnerable..."] = "E então descobriram que os cyborgs não eram invulneráveis...", -- A_Classic_Fairytale:journey + ["And where's all the weed?"] = "E onde está a erva toda?", -- A_Classic_Fairytale:dragon + ["And you believed me? Oh, god, that's cute!"] = "E tu acreditaste em mim? Ai meu deus, tão fofo!", -- A_Classic_Fairytale:journey -- ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies ["Antarctica"] = "Antártica", -- Continental_supplies ["Are we there yet?"] = "Já chegámos?", -- A_Classic_Fairytale:shadow -- ["Are you accusing me of something?"] = "Estás a acusar-me de alguma coisa?", -- A_Classic_Fairytale:backstab -- ["Are you saying that many of us have died for your entertainment?"] = "Estás a tentar dizer-me que estas quantidade de nós morreu para o teu entertenimento?", -- A_Classic_Fairytale:enemy -- ["Artur Detour"] = "", -- A_Classic_Fairytale:queen --- ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon + ["As a reward for your performance, here's some new technology!"] = "De forma a recompensar o teu desempenho, aqui tens alguma nova tecnologia!", -- A_Classic_Fairytale:dragon ["a shoppa minigame"] = "um minijogo shoppa", -- WxW ["Asia"] = "Ásia", -- Continental_supplies -- ["Assault Team"] = "", -- A_Classic_Fairytale:backstab --- ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "Como o armamento\munições é escaço, podes querer re-usar as cordas enquanto no ar.|", -- A_Classic_Fairytale:dragon + ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "Como o armamento está muito disperso, podes querer reutilizar a corda enquanto no ar.|", -- A_Classic_Fairytale:dragon -- ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood --- ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon --- ["Attack From Rope"] = "", -- WxW + ["As you can see, there is no way to get on the other side!"] = "Como podes ver, não existe forma de passarmos para o outro lado!", -- A_Classic_Fairytale:dragon + ["Attack From Rope"] = "Ataca Da Corda", -- WxW ["Australia"] = "Austrália", -- Continental_supplies -- ["Available points remaining: "] = "Pontos activos restantes: ", -- ["Back Breaker"] = "Parte Costas", -- A_Classic_Fairytale:backstab @@ -136,7 +136,7 @@ -- ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil -- ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge ["Cybernetic Empire"] = "Império Cibernético", --- ["Cyborg. It's what the aliens call themselves."] = "Cyborg. É o que os extra terrestres se chamam a eles mesmos(errrr)", -- A_Classic_Fairytale:enemy +-- ["Cyborg. It's what the aliens call themselves."] = "Cyborg. É o que os extra terrestres se chamam a eles mesmos(errrr)\autointitulam", -- A_Classic_Fairytale:enemy -- ["Dahmer"] = "", -- A_Classic_Fairytale:backstab -- ["DAMMIT, ROOKIE!"] = "", -- ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "", @@ -147,7 +147,7 @@ -- ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow -- ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy -- ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow --- ["Demolition is fun!"] = "Demolir é divertido!", + ["Demolition is fun!"] = "Demolir é divertido!", ["Dense Cloud"] = "Nuvem Densa", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united ["Dense Cloud must have already told them everything..."] = "O Nuvem Densa já lhes deve ter dito tudo...", -- A_Classic_Fairytale:shadow -- ["Depleted Kamikaze!"] = "", @@ -155,10 +155,10 @@ -- ["Destroy invaders to score points."] = "", -- ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood -- ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood --- ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united + ["Did anyone follow you?"] = "Foste seguido por alguém?", -- A_Classic_Fairytale:united -- ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow --- ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow --- ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon + ["Did you warn the village?"] = "Avisaste a aldeia?", -- A_Classic_Fairytale:shadow + ["Die, die, die!"] = "Morre, morre, morre!", -- A_Classic_Fairytale:dragon -- ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies -- ["Dist: "] = "", -- Space_Invasion -- ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab @@ -324,11 +324,11 @@ -- ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey -- ["His arms are so strong!"] = "Os braços dele são tão fortes!", -- A_Classic_Fairytale:first_blood -- ["Hit Combo!"] = "", --- ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy + ["Hmmm...actually...I didn't either."] = "Hmmm...na verdade...uu também não fazia ideia.", -- A_Classic_Fairytale:enemy ["Hmmm..."] = "Hmmm...", -- ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal ["Hmmm...it's a draw. How unfortunate!"] = "Hmmm...é um empate. Que azar!", -- A_Classic_Fairytale:enemy --- ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood + ["Hmmm...perhaps a little more time will help."] = "Hmmm...talvez um pouco mais de tempo ajude.", -- A_Classic_Fairytale:first_blood -- ["Hogminator"] = "", -- A_Classic_Fairytale:family -- ["Hogs in sight!"] = "", -- Continental_supplies -- ["HOLY SHYTE!"] = "", -- Mutant @@ -337,7 +337,7 @@ -- ["Hostage Situation"] = "", -- A_Classic_Fairytale:family -- ["How can I ever repay you for saving my life?"] = "Como posso eu (possivelmente) recompensar-te por teres salvo a minha vida?", -- A_Classic_Fairytale:journey -- ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon --- ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood + ["How difficult would you like it to be?"] = "Quão difícil gostarias que fosse?", -- A_Classic_Fairytale:first_blood -- ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united -- ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey -- ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey @@ -779,7 +779,7 @@ ["TIME: "] = "TEMPO: ", -- ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope ["Toggle Shield"] = "Ligar\Desligar Escudo", --- ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey + ["To help you, of course!"] = "Para te ajudar claro!", -- A_Classic_Fairytale:journey -- ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow -- ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey -- [" to save the village."] = "", -- A_Classic_Fairytale:dragon @@ -848,14 +848,14 @@ -- ["We have to unite and defeat those cylergs!"] = "Temos de nos unir e derrotar estes ciber-pernudos!", -- A_Classic_Fairytale:enemy ["Welcome, Leaks A Lot!"] = "Bem vindo, Leaks a Lot!", -- A_Classic_Fairytale:journey ["Well done."] = "Bom trabalho.", --- ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy + ["We'll give you a problem then!"] = "Nós arranjamos-te um problema então!", -- A_Classic_Fairytale:enemy -- ["We'll spare your life for now!"] = "Vamos poupar a tua vida para ja!", -- A_Classic_Fairytale:backstab -- ["Well, that was a waste of time."] = "Bem, isto foi um desperdicio de tempo.", -- A_Classic_Fairytale:dragon --- ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey --- ["Well, yes. This was a cyborg television show."] = "Bem, claro. Isto era um programa de televisão para cyborgs.", -- A_Classic_Fairytale:enemy --- ["We made sure noone followed us!"] = "Certificamo-nos que ninguem nos seguiu!", -- A_Classic_Fairytale:backstab --- ["We need to move!"] = "Temos de nos mover!", -- A_Classic_Fairytale:united --- ["We need to prevent their arrival!"] = "Temos de prevenir que cheguem!", -- A_Classic_Fairytale:backstab +-- ["Well, well! Isn't that the cutest thing you've ever seen?"] = "Bem, bem! Não isto é coisa mais fofa que já alguma vez viste?", -- A_Classic_Fairytale:journey + ["Well, yes. This was a cyborg television show."] = "Bem, claro. Isto era um programa de televisão para cyborgs.", -- A_Classic_Fairytale:enemy + ["We made sure noone followed us!"] = "Certificá-mo-nos que ninguém nos seguiu! que ninguem nos seguiu!", -- A_Classic_Fairytale:backstab + ["We need to move!"] = "Temos de ir!", -- A_Classic_Fairytale:united +-- ["We need to prevent their arrival!"] = "Temos de prevenir a sua chegada!", -- A_Classic_Fairytale:backstab ["We need to warn the village."] = "Temos de avisar a aldeia.", -- A_Classic_Fairytale:shadow -- ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow -- ["We were trying to save her and we got lost."] = "Estavamos a tentar salva-la e acabamos por nos perder.", -- A_Classic_Fairytale:family @@ -863,18 +863,18 @@ -- ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "O quê? Um canibal? Aqui? Não ha tempo a perder! Vem, estás preparado.", -- A_Classic_Fairytale:first_blood ["What a douche!"] = "Que otário!", -- A_Classic_Fairytale:enemy -- ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family --- ["What are you doing at a distance so great, young one?"] = "O que estás a tão grande distancia, jovem?", -- A_Classic_Fairytale:first_blood +-- ["What are you doing at a distance so great, young one?"] = "O que estás a fazer a tão grande distancia, jovem?", -- A_Classic_Fairytale:first_blood -- ["What are you doing? Let her go!"] = "Que estás a fazer? Larga-a!", -- A_Classic_Fairytale:journey ["What a ride!"] = "Que viagem!", -- A_Classic_Fairytale:shadow ["What a strange cave!"] = "Que caverna estranha!", -- A_Classic_Fairytale:dragon --- ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab +-- ["What a strange feeling!"] = "Tenho um mau persentimento!", -- A_Classic_Fairytale:backstab ["What do my faulty eyes observe? A spy!"] = "O que vêm observam os meus defeituoso olhos? Um espião!", -- A_Classic_Fairytale:first_blood -- ["Whatever floats your boat..."] = "O que quer que seja que faz o teu barco flutuar... (preciso melhor expressão verdadeiramente portuguesa)", -- A_Classic_Fairytale:shadow [" What !! For all of this struggle i just win some ... TIME o0"] = " O quê !! Por todo este esforço tudo o que ganho é ... TEMPO o0", -- portal -- ["What has "] = "Foi aquilo ", -- A_Classic_Fairytale:backstab ["What? Here? How did they find us?!"] = "O quê? Aqui? Como raio nos encontraram?!", -- A_Classic_Fairytale:backstab -- ["What is this place?"] = "O que é este sitio?\Que (raio de) sitio é este?", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy --- ["What shall we do with the traitor?"] = "O que fazemos com o traidor?", -- A_Classic_Fairytale:backstab + ["What shall we do with the traitor?"] = "O que fazemos com o traidor?", -- A_Classic_Fairytale:backstab -- ["WHAT?! You're the ones attacking us!"] = "O QUÊ?! Voces é que nos atacaram\estão a atacar!", -- A_Classic_Fairytale:enemy ["When?"] = "Quando?", -- A_Classic_Fairytale:enemy ["When I find it..."] = "Quando o encontrar...", -- A_Classic_Fairytale:dragon diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/pt_PT.txt --- a/share/hedgewars/Data/Locale/pt_PT.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/pt_PT.txt Thu Jun 13 22:27:23 2013 +0200 @@ -78,7 +78,7 @@ 01:16=Pouco 01:17=Normal 01:18=Muito -01:19=Excessivo +01:19=Imenso 01:20=Ressalto: %1 01:21=Áudio Silenciado @@ -178,7 +178,6 @@ 02:01=%1 foi brincar com os golfinhos 02:01=%1 foi visitar o Oceanário 02:01=%1 encontrou a Atlântida perdida -02:01=%1 inscreve-se no papel principal do Bioshock 3 02:01=O teu pato insuflável ficou triste %1 02:01=%1 devia ter comprado uma mota de água 02:01=%1 não gosta de desportos náuticos @@ -450,8 +449,8 @@ 03:51=Encontrado no chão 03:52=UNUSED 03:53=Modelo 40 -03:54=Constroi qualquer coisa -03:55=Utilitário +;03:54=Constroi qualquer coisa +03:54=Utilitário ; Weapon Descriptions (use | as line breaks) 04:00=Ataca os teus inimigos usando uma simples granada.|Explodirá quando o tempo chegar a zero.|1-5: Define o temporizador da granada|Ataque: Deixa premido para lançar com mais força @@ -508,8 +507,8 @@ 04:51=Empurra um ouriço sem perder o turno|criando uma bola de lama tu mesmo! 04:52=UNUSED 04:53=Parte numa aventura pelo tempo e espaço,|deixando os teus colegas para se defenderem sozinhos.|Está preparado para regressar a qualquer altura,|para Morte Súbita ou se todos forem derrotados.|Atenção: Não funciona em Morte Súbita,|se estiveres sozinho, ou se fores o Rei. -04:54=INCOMPLETO -04:55=Aplica estas particulas de terreno em spray onde quiseres.|Constroi pontes, enterra inimigos ou fecha túneis.|Tem apenas cuidado, não o uses em ti proprio! +;04:54=INCOMPLETO +04:54=Aplica estas particulas de terreno em spray onde quiseres.|Constroi pontes, enterra inimigos ou fecha túneis.|Tem apenas cuidado, não o uses em ti proprio! ; Game goal strings 05:00=Modos de Jogo diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/ro.txt --- a/share/hedgewars/Data/Locale/ro.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/ro.txt Thu Jun 13 22:27:23 2013 +0200 @@ -175,7 +175,6 @@ 02:01=%1 wants to play Ecco the dolphin 02:01=%1 has gone to visit Aquaria 02:01=%1 has found the lost city of Atlantis -02:01=%1 aims for the lead role in Bioshock 3 02:01=Your doggy paddle could use a little work, %1 02:01=%1 should have brought a jet ski 02:01=%1 doesn't like watersports @@ -447,8 +446,8 @@ 03:51=Found on the ground 03:52=UNUSED 03:53=Type 40 -03:54=Build something -03:55=Utility +;03:54=Build something +03:54=Utility ; Weapon Descriptions (use | as line breaks) 04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power @@ -505,8 +504,8 @@ 04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back. 04:52=UNUSED 04:53=Go on an adventure through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King. -04:54=INCOMPLETE -04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you! +;04:54=INCOMPLETE +04:54=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you! ; Game goal strings 05:00=Game Modes diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/ru.txt --- a/share/hedgewars/Data/Locale/ru.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/ru.txt Thu Jun 13 22:27:23 2013 +0200 @@ -177,7 +177,6 @@ 02:01=%1 хочет поиграть в Ecco the Dolphin 02:01=%1 пошел посмотреть аквариум 02:01=%1 нашёл потерянный город Атлантиды -02:01=%1 стремится к главной роли в игре Bioshock 3 02:01=Твое плаванье по-собачьи принесло мало пользы, %1 02:01=%1 забыл взять гидроцикл 02:01=%1 не любит водный спорт @@ -450,8 +449,8 @@ 03:51=Найденный на земле 03:52=Не используется 03:53=Модель 40 -03:54=Построй что нибудь -03:55=Полезная вещь +;03:54=Построй что нибудь +03:54=Полезная вещь ; Weapon Descriptions (use | as line breaks) 04:00=Атакуй своих врагов обычной гранатой.|Она взорвется сразу, как только таймер|достигнет нуля.|1-5: Установить таймер гранаты|Атака: Удерживай для более дальнего броска diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/sk.txt --- a/share/hedgewars/Data/Locale/sk.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/sk.txt Thu Jun 13 22:27:23 2013 +0200 @@ -269,8 +269,8 @@ 03:51=Nájdené na zemi 03:52=NEPOUŽÍVANÉ 03:53=Typ 40 -03:54=Postavte niečo -03:55=Pomôcka +;03:54=Postavte niečo +03:54=Pomôcka ; Popis zbraní (ako oddeľovač riadkov použite |) 04:00=Zaútočte na vašich nepriateľov obyčajným granátom.|Vybuchne vtedy, keď vyprší časomiera.|1‐5: Nastavenie časovača granátu|Útok: Držanie tlačidla zvyšuje silu hodu| @@ -327,8 +327,8 @@ 04:51=Nemíňajte muníciu - hod blatom je zdarma.|Trošku štípe a dokáže ježka zhodiť. 04:52=NEPOUŽITÉ 04:53=Vyberte sa na cestu časom a priestorom|a nechajte vašich priateľov bojovať bez vás.|Buďte pripravený vrátiť sa kedykoľvek,|buď pri Náhlej smrti alebo keď sú všetci porazení.|Poznámka: Nefunguje počas Náhlej smrti,|ak ste sám alebo ak ste kráľom. -04:54=NEKOMPLETNÉ -04:55=Rozprášte prúd lepkavej hliny.|Postavte mosty, pochovajte nepriateľov,|zapečaťte tunely. Buďte|však opatrný a nezašpinte sa|od nej aj vy. +;04:54=NEKOMPLETNÉ +04:54=Rozprášte prúd lepkavej hliny.|Postavte mosty, pochovajte nepriateľov,|zapečaťte tunely. Buďte|však opatrný a nezašpinte sa|od nej aj vy. ; Reťazce pre ciele hry diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/sv.txt --- a/share/hedgewars/Data/Locale/sv.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/sv.txt Thu Jun 13 22:27:23 2013 +0200 @@ -180,7 +180,6 @@ 02:01=%1 vill leka Ecco the dolphin 02:01=%1 har gått för att besöka Aquaria 02:01=%1 har funnit den förlorade staden Atlantis -02:01=%1 siktar på huvudrollen i Bioshock 3 02:01=Du borde träna på ditt hundsim, %1 02:01=%1 skulle ha tagit med sig vattenskidor 02:01=%1 gillar inte vattensporter @@ -477,8 +476,8 @@ 03:51=Upphittad på marken 03:52=UNUSED 03:53=Typ 40 -03:54=Bygg något -03:55=Verktyg +;03:54=Bygg något +03:54=Verktyg ; Weapon Descriptions (use | as line breaks) 04:00=Attackera fienden med en enkel granat.|Exploderar när tiden når noll.|1-5: Ställ in granatens tid|Attack: Håll ner för att kasta med mer kraft @@ -535,8 +534,8 @@ 04:51=Få till en gratisträff genom att kasta en boll med|jord. Känns lite gran, och knuffar tillbaka|igelkottar. 04:52=UNUSED 04:53=Åk på ett äventyr genom tid och rymd, medan dina|kamrater blir kvar själva att slåss. Var beredd|att komma tillbaka när som helst, eller till|Sudden Death eller om de andra blir besegrade.|Varning. Fungerar inte under Sudden Death, om du|är ensam, eller om du är en kung. -04:54=INCOMPLETE -04:55=Spruta en ström av fästande jord.|Bygg broar, gräv ner fienden, stäng igen tunnlar.|Var försiktig så att du inte får något på dig! +;04:54=INCOMPLETE +04:54=Spruta en ström av fästande jord.|Bygg broar, gräv ner fienden, stäng igen tunnlar.|Var försiktig så att du inte får något på dig! ; Game goal strings 05:00=Spellägen diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/tr.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Locale/tr.lua Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,989 @@ +locale = { +-- [":("] = "", +-- ["!!!"] = "", +-- ["..."] = "", +-- ["011101000"] = "", -- A_Classic_Fairytale:dragon +-- ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united + ["30 minutes later..."] = "30 dakika sonra...", -- A_Classic_Fairytale:shadow +-- ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy + ["Accuracy Bonus!"] = "Güzel Nişan Bonusu!", +-- ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge +-- ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler +-- ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood +-- ["???"] = "", -- A_Classic_Fairytale:backstab +-- ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow +-- ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy +-- ["Adventurous"] = "", -- A_Classic_Fairytale:journey +-- ["Africa"] = "", -- Continental_supplies +-- ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood +-- ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow +-- ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy +-- ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge + ["a Hedgewars mini-game"] = "Hedgewars mini oyunu", -- Space_Invasion, The_Specialists + ["Aiming Practice"] = "Atış Eğitimi", --Bazooka, Shotgun, SniperRifle +-- ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood +-- ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow +-- ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy +-- ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey +-- ["All walls touched!"] = "", -- WxW + ["Ammo Depleted!"] = "Munition erschöpft!", + ["ammo extended!"] = "Munition aufgestockt!", + ["Ammo is reset at the end of your turn."] = "Munition wird am Ende des Spielzuges zurückgesetzt.", + ["Ammo Maniac!"] = "Munitionsverrückter!", + ["Ammo"] = "Mermi", +-- ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy +-- ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood +-- ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood +-- ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow +-- ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey +-- ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon +-- ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey +-- ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies +-- ["Antarctica"] = "", -- Continental_supplies +-- ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow +-- ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab +-- ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy +-- ["Artur Detour"] = "", -- A_Classic_Fairytale:queen +-- ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon +-- ["a shoppa minigame"] = "", -- WxW +-- ["Asia"] = "", -- Continental_supplies +-- ["Assault Team"] = "", -- A_Classic_Fairytale:backstab +-- ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon +-- ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood +-- ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon +-- ["Attack From Rope"] = "", -- WxW +-- ["Australia"] = "", -- Continental_supplies + ["Available points remaining: "] = "Verfügbare Punkte verbleibend:", +-- ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab +-- ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united +-- ["[Backspace]"] = "", +-- ["Backstab"] = "", -- A_Classic_Fairytale:backstab +-- ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape +-- ["Bamboo Thicket"] = "", + ["Barrel Eater!"] = "Fassfresser!", + ["Barrel Launcher"] = "Fasswerfer", +-- ["Baseballbat"] = "", -- Continental_supplies + ["Bat balls at your enemies and|push them into the sea!"] = "Schlage Bälle auf deine Widersacher|und lass sie ins Meer fallen!", + ["Bat your opponents through the|baskets and out of the map!"] = "Schlage deine Widersacher durch|die Körbe und aus der Karte hinaus!", + ["Bazooka Training"] = "Bazooka-Training", +-- ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen + ["Best laps per team: "] = "Beste Rundenzeiten pro Team: ", + ["Best Team Times: "] = "Beste Team-Zeiten: ", +-- ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon +-- ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family +-- ["Blender"] = "", -- A_Classic_Fairytale:family +-- ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab +-- ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow +-- ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow + ["Bloody Rookies"] = "Blutige Anfänger", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree +-- ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab +-- ["Bonely"] = "", -- A_Classic_Fairytale:shadow + ["Boom!"] = "Bumm!", + ["BOOM!"] = "KABUMM!", + ["Boss defeated!"] = "Boss wurde besiegt!", + ["Boss Slayer!"] = "Boss-Töter!", +-- ["Brain Blower"] = "", -- A_Classic_Fairytale:journey +-- ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow +-- ["Brainila"] = "", -- A_Classic_Fairytale:united +-- ["Brain Stu"] = "", -- A_Classic_Fairytale:united +-- ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab +-- ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil +-- ["Brutus"] = "", -- A_Classic_Fairytale:backstab + ["Build a track and race."] = "Konstruiere eine Strecke und mach ein Wettrennen.", +-- ["Bullseye"] = "", -- A_Classic_Fairytale:dragon +-- ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon +-- ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab +-- ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy +-- ["But...we died!"] = "", -- A_Classic_Fairytale:backstab +-- ["But where can we go?"] = "", -- A_Classic_Fairytale:united +-- ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab +-- ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy +-- ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey +-- ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family +-- ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood +-- ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey +-- ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy + ["CAPTURE THE FLAG"] = "EROBERE DIE FAHNE", + ["Careless"] = "Achtlos", +-- ["Carol"] = "", -- A_Classic_Fairytale:family +-- ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge + ["Change Weapon"] = "Waffenwechsel", +-- ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow + ["Clumsy"] = "Hoppla", +-- ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb +-- ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb + ["Codename: Teamwork"] = "Code-Name: Teamwork", +-- ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey +-- ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey +-- ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge +-- ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood +-- ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge + ["Complete the track as fast as you can!"] = "Durchlaufe die Strecke so schnell du kannst!", +-- ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["Configuration accepted."] = "", -- WxW +-- ["Congratulations"] = "", -- Basic_Training_-_Rope + ["Congratulations!"] = "Gratulation!", +-- ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb +-- ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope + ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Gratulation! Du hast alle Ziele innerhalb der|verfügbaren Zeit ausgeschaltet.", --Bazooka, Shotgun, SniperRifle +-- ["Continental supplies"] = "", -- Continental_supplies + ["Control pillars to score points."] = "Kontrolliere die Säulen um Punkte zu erhalten.", +-- ["Corporationals"] = "", -- A_Classic_Fairytale:queen +-- ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow +-- ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil +-- ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge + ["Cybernetic Empire"] = "Kybernetisches Imperium", +-- ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy +-- ["Dahmer"] = "", -- A_Classic_Fairytale:backstab + ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "VERDAMMT, REKRUT! RUNTER VON MEINEM KOPF!", + ["DAMMIT, ROOKIE!"] = "VERDAMMT, REKRUT!", +-- ["Dangerous Ducklings"] = "", + ["Deadweight"] = "Gravitus", +-- ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab +-- ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united +-- ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow +-- ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy +-- ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow + ["Demolition is fun!"] = "Zerstörung macht Spaß!", +-- ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united +-- ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow + ["Depleted Kamikaze!"] = "Munitionsloses Kamikaze!", +-- ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood + ["Destroy invaders to score points."] = "Zerstöre die Angreifer um Punkte zu erhalten.", +-- ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood +-- ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood +-- ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united +-- ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow +-- ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow +-- ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon +-- ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies +-- ["Dist: "] = "", -- Space_Invasion +-- ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab +-- ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood +-- ["Double Kill!"] = "", +-- ["DOUBLE KILL"] = "", -- Mutant +-- ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy +-- ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy +-- ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon +-- ["Drills"] = "", -- A_Classic_Fairytale:backstab +-- ["Drone Hunter!"] = "", +-- ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies + ["Drowner"] = "Absäufer", +-- ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family +-- ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey +-- ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab +-- ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow +-- ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon +-- ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab +-- ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab +-- ["Duration"] = "", -- Continental_supplies +-- ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies + ["Each turn you get 1-3 random weapons"] = "Du bekommst jede Runde 1-3 zufällig gewählte Waffen", + ["Each turn you get one random weapon"] = "Du bekommst jede Runde eine zufällig gewählte Waffe.", +-- ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab +-- ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies +-- ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil +-- ["Elderbot"] = "", -- A_Classic_Fairytale:family +-- ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape + ["Eliminate all enemies"] = "Vernichte alle Gegner", + ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Eliminiere alle Ziele bevor die Zeit ausläuft.|Du hast in dieser Mission unbegrenzte Munition.", --Bazooka, Shotgun, SniperRifle +-- ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander + ["Eliminate Poison before the time runs out"] = "Neutralisiere das Gift bevor die Zeit abgelaufen ist", + ["Eliminate the Blue Team"] = "Lösche das Blaue Team aus", + ["Eliminate the enemy before the time runs out"] = "Vernichte den Feind bevor die Zeit abgelaufen ist", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock + ["Eliminate the enemy hogs to win."] = "Vernichte alle gegnerischen Igel um zu gewinnen", + ["Eliminate the enemy specialists."] = "Vernichte die gegnerischen Spezialisten", + ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Vernichte Einheit 3378 | Kraftloser Widerstand muss überleben", +-- ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Energetic Engineer"] = "", + ["Enjoy the swim..."] = "Viel Spaß beim Schwimmen...", +-- ["[Enter]"] = "", +-- ["Europe"] = "", -- Continental_supplies +-- [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab +-- ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy +-- ["Every single time!"] = "", -- A_Classic_Fairytale:dragon +-- ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy +-- ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab +-- ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey +-- ["INSANITY"] = "", -- Mutant +-- ["Family Reunion"] = "", -- A_Classic_Fairytale:family + ["Fastest lap: "] = "Schnellste Runde: ", + ["Feeble Resistance"] = "Kraftloser Widerstand", +-- ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen +-- ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family +-- ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow +-- ["Fierce Competition!"] = "", -- Space_Invasion +-- ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united +-- ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon +-- ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood +-- ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies + ["Fire"] = "Feuer", +-- ["First aid kits?!"] = "", -- A_Classic_Fairytale:united +-- ["First Blood"] = "", -- A_Classic_Fairytale:first_blood +-- ["FIRST BLOOD MUTATES"] = "", -- Mutant +-- ["First Steps"] = "", -- A_Classic_Fairytale:first_blood + ["Flag captured!"] = "Fahne erobert!", + ["Flag respawned!"] = "Fahne wieder erschienen!", + ["Flag returned!"] = "Fahne zurückgebracht!", + ["Flags, and their home base will be placed where each team ends their first turn."] = "Fahnen und deren Heimatstandort werden dort plaziert wo jedes Team deren ersten Zug beendet.", +-- ["Flamer"] = "", +-- ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab +-- ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies +-- ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey +-- ["For improved features/stability, play 0.9.18+"] = "", -- WxW +-- ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey +-- ["Friendly Fire!"] = "", + ["fuel extended!"] = "Treibstoff aus!", + ["GAME BEGUN!!!"] = "SPIEL GESTARTET!!!", +-- ["Game Modifiers: "] = "", -- The_Specialists + ["GAME OVER!"] = "SPIEL ZU ENDE!", + ["Game Started!"] = "Spiel Gestartet!]", +-- ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy +-- ["GasBomb"] = "", -- Continental_supplies +-- ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen +-- ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey + ["Get on over there and take him out!"] = "Mach, dass du hinüber kommst und schalte ihn aus!", +-- ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood +-- ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape +-- ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey +-- ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope +-- ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family +-- ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab +-- ["Glark"] = "", -- A_Classic_Fairytale:shadow + ["Goal"] = "Ziel", + ["GO! GO! GO!"] = "Bewegung, Bewegung, Bewegung!", + ["Good birdy......"] = "Braver Vogel......", +-- ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape +-- ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united +-- ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey + ["Good luck out there!"] = "Viel Glück da draußen!", + ["Good so far!"] = "Gut soweit!", + ["Good to go!"] = "Startklar!", +-- ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood +-- ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab +-- ["Gorkij"] = "", -- A_Classic_Fairytale:journey +-- ["Go surf!"] = "", -- WxW + ["GOTCHA!"] = "ERWISCHT!", + ["Grab Mines/Explosives"] = "Sammle Minen/Fässer", +-- ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow +-- ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope +-- ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow +-- ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies +-- ["Greetings, "] = "", -- A_Classic_Fairytale:dragon +-- ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow +-- ["Grenade Training"] = "", -- Basic_Training_-_Grenade +-- ["Grenadiers"] = "", -- Basic_Training_-_Grenade +-- ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab +-- ["HAHA!"] = "", -- A_Classic_Fairytale:enemy +-- ["Haha!"] = "", -- A_Classic_Fairytale:united +-- ["Hahahaha!"] = "", + ["Haha, now THAT would be something!"] = "Haha, na DAS wär ja was!", +-- ["Hannibal"] = "", -- A_Classic_Fairytale:epil + ["Hapless Hogs"] = "Glücklose Igel", + [" Hapless Hogs left!"] = " Glücklose Igel verbleibend!", + +-- [" HAS MUTATED"] = "", -- Mutant +-- ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen +-- ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow +-- ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy + ["Health crates extend your time."] = "Medipacks verlängern deine Zeit.", +-- ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united + ["Heavy"] = "Schwierig", +-- ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy +-- ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies + ["Hedgewars-Basketball"] = "Hedgewars-Basketball", + ["Hedgewars-Knockball"] = "Hedgewars-Knockball", +-- ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab + ["Heh, it's not that bad."] = "Hehe, so schlimm ist es nicht.", +-- ["Hello again, "] = "", -- A_Classic_Fairytale:family +-- ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey +-- ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey +-- ["Help me, please!"] = "", -- A_Classic_Fairytale:journey +-- ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood +-- ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey +-- ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab +-- ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family +-- ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape +-- ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood +-- ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab +-- ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab +-- ["Hey guys!"] = "", -- A_Classic_Fairytale:united +-- ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey +-- ["HIGHLANDER"] = "", -- Highlander +-- ["Hightime"] = "", -- A_Classic_Fairytale:first_blood +-- ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood +-- ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey +-- ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey +-- ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey +-- ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Hit Combo!"] = "", +-- ["Hmmm..."] = "", +-- ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy +-- ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal +-- ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy +-- ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood +-- ["Hogminator"] = "", -- A_Classic_Fairytale:family +-- ["Hogs in sight!"] = "", -- Continental_supplies +-- ["HOLY SHYTE!"] = "", -- Mutant +-- ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy + ["Hooray!"] = "Hurra!", +-- ["Hostage Situation"] = "", -- A_Classic_Fairytale:family +-- ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey +-- ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon +-- ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood +-- ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united +-- ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey +-- ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey +-- ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon +-- [" HP"] = "", -- Mutant + ["Hunter"] = "Jäger", --Bazooka, Shotgun, SniperRifle +-- ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab +-- ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood +-- ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow +-- ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy +-- ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab +-- ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow +-- ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family +-- ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey +-- ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy +-- ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope +-- ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab +-- ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab +-- ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood +-- ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab +-- ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united +-- ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow +-- ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey +-- ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow +-- ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey +-- ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow +-- ["If you say so..."] = "", -- A_Classic_Fairytale:shadow + +-- ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon +-- ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow +-- ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow +-- ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab +-- ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow +-- ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood +-- ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab +-- ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family +-- ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey +-- ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow +-- ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood +-- ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab +-- ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon +-- ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab +-- ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood +-- ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy +-- ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family +-- ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family +-- ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family +-- ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united +-- ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood +-- ["I'm so scared!"] = "", -- A_Classic_Fairytale:united +-- ["Incredible..."] = "", -- A_Classic_Fairytale:shadow +-- ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab +-- ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey +-- ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united +-- ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab +-- ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab +-- ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab +-- ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon + ["Instructor"] = "Ausbilder", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings +-- ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy +-- ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab +-- ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow + ["invaders destroyed"] = "Angreifer zerstört", +-- ["Invasion"] = "", -- A_Classic_Fairytale:united +-- ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow +-- ["I see..."] = "", -- A_Classic_Fairytale:shadow +-- ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood +-- ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood +-- ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab +-- ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab +-- ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon +-- ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon +-- ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon +-- ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab +-- ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow +-- ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy +-- ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood +-- ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family +-- ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab +-- ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab +-- ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy +-- ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab + ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Gut, dass SUDDEN DEATH noch 99 Runden entfernt ist...", +-- ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon +-- ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family +-- ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow +-- ["It's over..."] = "", -- A_Classic_Fairytale:shadow +-- ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey +-- ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy +-- ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow +-- ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab +-- ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united +-- ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey +-- ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab +-- ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon +-- ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow +-- ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family +-- ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey +-- ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon +-- ["John"] = "", -- A_Classic_Fairytale:journey +-- ["Judas"] = "", -- A_Classic_Fairytale:backstab + ["Jumping is disabled"] = "Sprünge sind deaktiviert!", +-- ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy +-- ["Just on a walk."] = "", -- A_Classic_Fairytale:united +-- ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family + ["Kamikaze Expert!"] = "Kamikazeexperte!", + ["Keep it up!"] = "Weiter so!", +-- ["Kerguelen"] = "", -- Continental_supplies + ["Killing spree!"] = "Blutrausch!", +-- ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood +-- ["KILLS"] = "", +-- ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon +-- ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab + ["Last Target!"] = "Letzte Zielscheibe!", +-- ["Leader"] = "", -- A_Classic_Fairytale:enemy +-- ["Leaderbot"] = "", -- A_Classic_Fairytale:queen +-- ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united +-- ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey +-- ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey +-- ["Led Heart"] = "", -- A_Classic_Fairytale:queen +-- ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["[Left Shift]"] = "", +-- ["Let a Continent provide your weapons!"] = "", -- Continental_supplies +-- ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey +-- ["Let's go home!"] = "", -- A_Classic_Fairytale:journey +-- ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow +-- ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey +-- ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab +-- ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab +-- ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab +-- ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united + ["Listen up, maggot!!"] = "Aufgepasst, du Made!!", +-- ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow +-- ["Lively Lifeguard"] = "", +-- ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies +-- ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab +-- ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab +-- ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy +-- ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy +-- ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united +-- ["LUDICROUS KILL"] = "", -- Mutant +-- ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab +-- ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies +-- ["MEGA KILL"] = "", -- Mutant +-- ["Meiwes"] = "", -- A_Classic_Fairytale:backstab +-- ["Mindy"] = "", -- A_Classic_Fairytale:united + ["Mine Deployer"] = "Minenleger", + ["Mine Eater!"] = "Minenfresser!", + ["|- Mines Time:"] = "| - Minenzündzeit: ", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork + ["MISSION FAILED"] = "MISSION GESCHEITERT", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork + ["MISSION SUCCESSFUL"] = "MISSION ERFOLGREICH", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork + ["MISSION SUCCESS"] = "MISSIONSERFOLG", +-- ["Molotov"] = "", -- Continental_supplies +-- ["MONSTER KILL"] = "", -- Mutant +-- ["More Natives"] = "", -- A_Classic_Fairytale:epil + ["Movement: [Up], [Down], [Left], [Right]"] = "Bewegung: [Hoch], [Runter], [Links], [Rechts]", +-- ["Multi-shot!"] = "", + ["Munition!"] = "Munition erschöpft!", +-- ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow +-- ["-------"] = "", -- Mutant +-- ["Nade Boy"] = "", -- Basic_Training_-_Grenade +-- ["Name"] = "", -- A_Classic_Fairytale:queen + ["Nameless Heroes"] = "Namenlose Helden", +-- ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen +-- ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies +-- ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united + ["New Barrels Per Turn"] = "Neue Fässer jede Runde", + ["NEW CLAN RECORD: "] = "NEUER KLAN-REKORD", + ["NEW fastest lap: "] = "NEUE schnellste Runde: ", + ["New Mines Per Turn"] = "Neue Minen jede Runde", + ["NEW RACE RECORD: "] = "NEUER RENNREKORD: ", +-- ["Newton's Hammock"] = "", +-- ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy +-- ["Nice work, "] = "", -- A_Classic_Fairytale:dragon +-- ["Nice work!"] = "", -- A_Classic_Fairytale:enemy +-- ["Nilarian"] = "", -- A_Classic_Fairytale:queen +-- ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow +-- ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey +-- ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey +-- ["NomNom"] = "", -- A_Classic_Fairytale:united +-- ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow +-- ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey +-- ["NORMAL"] = "", -- Continental_supplies +-- ["North America"] = "", -- Continental_supplies +-- ["Not all hogs are born equal."] = "", -- Highlander + ["NOT ENOUGH WAYPOINTS"] = "NICHT GENUG WEGPUNKTE", +-- ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab + ["Not So Friendly Match"] = "Kein-so-Freundschaftsspiel", -- Basketball, Knockball +-- ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow +-- ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united +-- ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope +-- ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey +-- ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow +-- ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon +-- ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab +-- ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow +-- ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon +-- ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family +-- ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey +-- ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab + ["Oh no! Just try again!"] = "Oh nein! Versuch's nochmal!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork +-- ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united + ["Oh no! Time's up! Just try again."] = "Oh nein! Die Zeit ist um! Versuche es nochmal.", --Bazooka, Shotgun, SniperRifle +-- ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb +-- ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab +-- ["Olive"] = "", -- A_Classic_Fairytale:united +-- ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood +-- ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood +-- ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant +-- ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood +-- ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united +-- ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Operation Diver"] = "", + ["Opposing Team: "] = "Gegnerisches Team: ", +-- ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen +-- ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy +-- ["Parachute"] = "", -- Continental_supplies + ["Pathetic Hog #%d"] = "Erbärmlicher Igel #%d", + ["Pathetic Resistance"] = "Erbärmlicher Widerstand", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock +-- ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood + ["Per-Hog Ammo"] = "Munition pro Igel", +-- ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[precise/left shift]=Decrease) on Skip|Some weapons have a second option. Find them with [switch/tab]"] = "", -- Continental_supplies + +-- ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow +-- ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies +-- ["Pings left:"] = "", -- Space_Invasion + + ["Place more waypoints using the 'Air Attack' weapon."] = "Platziere mehr Wegpunkte durch Verwenden der 'Luftangriff'-Waffe", +-- ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge +-- ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge +-- ["Play with me!"] = "", -- A_Classic_Fairytale:shadow +-- ["Please place the way-point further from the waterline."] = "", -- Racer +-- ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer +-- ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow +-- ["Point Blank Combo!"] = "", -- Space_Invasion + ["points"] = "Punkte", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle + ["Poison"] = "Gift", +-- ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon +-- ["Portal mission"] = "", -- portal + ["Power Remaining"] = "Verbleibende Energie", + ["Prepare yourself"] = "Mach dich bereit", +-- ["Press [Enter] to accept this configuration."] = "", -- WxW +-- ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood +-- ["Press [Precise] to skip intro"] = "", +-- ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb +-- ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow + ["PUNKTESTAND"] = "", + ["Race complexity limit reached."] = "Rennkomplexitätslimit erreicht.", +-- ["RACER"] = "", +-- ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Radar Ping"] = "", -- Space_Invasion +-- ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united +-- ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow +-- ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge +-- ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow +-- ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab +-- ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab +-- ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope +-- ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow + [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Bringe die gegnerische Flagge zu deiner Heimatbasis um zu punkten. | - Das Team das zuerst 3 Flaggen erobert gewinnt. | - Du kannst nur punkten wenn deine eigene Flagge in deiner Basis ist | - Igel lassen die Flagge fallen wenn sie sterben oder ertrinken | - Fallen gelassene Flaggen können zurückgebracht oder wieder gestohlen werden | - Igel tauchen nach ihrem Tod wieder auf", +-- ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow +-- ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united +-- ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["Rope Training"] = "", -- Basic_Training_-_Rope +-- ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow +-- ["Round Limit:"] = "", + ["Round Limit"] = "Rundenbegrenzung", +-- ["Rounds Complete: "] = "", + ["Rounds Complete"] = "Runden Gespielt", + ["RULES OF THE GAME [Press ESC to view]"] = "SPIEL REGELN (Drücke ESC zum Anzeigen)", +-- ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen +-- ["s|"] = "", +-- ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies +-- ["Salivaslurper"] = "", -- A_Classic_Fairytale:united +-- ["Salvation"] = "", -- A_Classic_Fairytale:family +-- ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon + ["Save as many hapless hogs as possible!"] = "Rette so viele glücklose Igel als möglich!", +-- ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey +-- ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow +-- ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family +-- ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey +-- ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab +-- ["Score"] = "", -- Mutant +-- ["SCORE"] = "", -- Space_Invasion +-- ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies +-- ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag +-- ["Seduction"] = "", -- Continental_supplies +-- ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab +-- ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood + ["See ya!"] = "Mach's gut!", +-- ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon +-- ["Select continent!"] = "", -- Continental_supplies +-- ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood + ["selected!"] = "ausgewählt!", +-- ["s"] = "", -- GaudyRacer, Space_Invasion +-- ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey +-- ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family + ["Shield boosted! +30 power"] = "Schild verstärkt! +30 Energie", + ["Shield Depleted"] = "Schild aufgebraucht!", + ["Shield is fully recharged!"] = "Schild vollständig aufgeladen!", + ["Shield Master!"] = "Schildmeister!", + ["Shield Miser!"] = "Schildgieriger", + ["Shield OFF:"] = "Schild AUS:", + ["Shield ON:"] = "Schild AN:", + ["Shield Seeker!"] = "Schildsucher!", +-- ["Shotgun"] = "", -- Continental_supplies + ["Shotgun Team"] = "Schrotflinten-Team", + ["Shotgun Training"] = "Schrotflinten-Training", + ["shots remaining."] = "Schüsse übrig", + ["Silly"] = "Doofi", + ["Sinky"] = "Blubb", +-- ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy + ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s ist draußen und Team %d|erhält eine Strafe!| |Punktestand:", -- Basketball, Knockball + ["%s is out and Team %d|scored a point!| |Score:"] = "%s ist draußen und Team %d|erhält einen Punkt!| |Punktestand:", -- Basketball, Knockball +-- ["Slippery"] = "", -- A_Classic_Fairytale:journey +-- ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy +-- ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy +-- ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy +-- ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy +-- ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy +-- ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy +-- ["Sniper Rifle"] = "", -- Continental_supplies +-- ["Sniper!"] = "", -- Space_Invasion + ["Sniper Training"] = "Scharfschützen-Training", + ["Sniperz"] = "Heckenschützen", +-- ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood +-- ["South America"] = "", -- Continental_supplies +-- ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow +-- ["Spawn the crate, and attack!"] = "", -- WxW +-- ["Special Weapons:"] = "", -- Continental_supplies + ["Spielmodifikatoren: "] = "", +-- ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow +-- ["Spleenlover"] = "", -- A_Classic_Fairytale:united + ["Sponge"] = "Schwamm", +-- ["Spooky Tree"] = "", +-- ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion +-- ["Steel Eye"] = "", -- A_Classic_Fairytale:queen +-- ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood +-- ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["Sticky Mine"] = "", -- Continental_supplies +-- ["Stronglings"] = "", -- A_Classic_Fairytale:shadow +-- ["Structure"] = "", -- Continental_supplies +-- ["Super Weapons"] = "", -- WxW +-- ["Surf Before Crate"] = "", -- WxW +-- ["Surfer! +15 points!"] = "", -- Space_Invasion +-- ["Surfer!"] = "", -- WxW +-- ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow +-- ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood + ["Switched to "] = "Gewechselt zu ", +-- ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon +-- ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon +-- ["Team %d: "] = "", + ["Team Scores"] = "Teampunktestand", -- Control, Space_Invasion +-- ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon +-- ["Thanks!"] = "", -- A_Classic_Fairytale:family +-- ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family +-- ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey +-- ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey +-- ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united +-- ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy +-- ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab +-- ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab +-- ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow +-- ["That Sinking Feeling"] = "", +-- ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy +-- ["That's typical of you!"] = "", -- A_Classic_Fairytale:family +-- ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united + ["That was pointless."] = "Das war sinnlos.", +-- ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab +-- ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal +-- ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood +-- ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united +-- ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood +-- ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow +-- ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon + ["The enemy is hiding out on yonder ducky!"] = "Der Feind versteckt sich auf dem Entlein dort drüben!", +-- ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy +-- ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood +-- ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow + ["The flag will respawn next round."] = "Die Fahne wird nächste Runde wieder auftauchen.", +-- ["The food bites back"] = "", -- A_Classic_Fairytale:backstab +-- ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood +-- ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape +-- ["The guardian"] = "", -- A_Classic_Fairytale:shadow +-- ["The Individualist"] = "", -- A_Classic_Fairytale:shadow +-- ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united +-- ["The Journey Back"] = "", -- A_Classic_Fairytale:journey +-- ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood +-- ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey + ["The Nameless One"] = "Der Namenlose", +-- ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope +-- ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow +-- ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood +-- ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab +-- ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united +-- ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey +-- ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey +-- ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey +-- ["The Rising"] = "", -- A_Classic_Fairytale:first_blood +-- ["The Savior"] = "", -- A_Classic_Fairytale:journey +-- ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab +-- ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow +-- ["The Showdown"] = "", -- A_Classic_Fairytale:shadow +-- ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood + ["THE SPECIALISTS"] = "DIE SPEZIALISTEN", +-- ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood +-- ["The Torment"] = "", -- A_Classic_Fairytale:first_blood +-- ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey +-- ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood +-- ["The Union"] = "", -- A_Classic_Fairytale:enemy +-- ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey +-- ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow +-- ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood +-- ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood +-- ["The what?!"] = "", -- A_Classic_Fairytale:dragon +-- ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood +-- ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy +-- ["They Call Me Bullseye!"] = "", -- Space_Invasion +-- ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united +-- ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united +-- ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united +-- ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy +-- ["They never learn"] = "", -- A_Classic_Fairytale:journey +-- ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy +-- ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy +-- ["Thighlicker"] = "", -- A_Classic_Fairytale:united +-- ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood +-- ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy +-- ["This is typical!"] = "", -- A_Classic_Fairytale:dragon +-- ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow +-- ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab + ["This one's tricky."] = "Der hier ist knifflig.", + ["This rain is really something..."] = "Das nenne ich mal einen Regenschauer...", +-- ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy +-- ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family + ["Timed Kamikaze!"] = "Pünktliches Kamikaze!", + ["Time Extended!"] = "Zeit verlängert!", + ["Time Extension"] = "Zeitverlängerung", + ["Time Left: "] = "Verbleibende Zeit", + ["TIME: "] = "ZEIT: ", +-- ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope + ["Toggle Shield"] = "Schild ein/aus", +-- ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey +-- ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow +-- ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey +-- [" to save the village."] = "", -- A_Classic_Fairytale:dragon +-- ["To the caves..."] = "", -- A_Classic_Fairytale:united + ["Toxic Team"] = "Giftige Gegner", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork + ["TRACK COMPLETED"] = "STRECKENLAUF BEENDET", + ["TRACK FAILED!"] = "STRECKENLAUF GESCHEITERT", +-- ["training"] = "", -- portal +-- ["Traitors"] = "", -- A_Classic_Fairytale:epil +-- ["Tribe"] = "", -- A_Classic_Fairytale:backstab +-- ["TrophyRace"] = "", +-- ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united +-- ["T_T"] = "", + ["Tumbling Time Extended!"] = "Purzelzeit verlängert!", +-- ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon +-- [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon + ["Turn Time"] = "Zeit pro Zug", +-- ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey +-- ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow +-- ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy +-- ["ULTRA KILL"] = "", -- Mutant +-- ["Under Construction"] = "", -- A_Classic_Fairytale:shadow +-- ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon +-- ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family +-- ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united + ["Unit 3378"] = "Einheit 3378", + ["Unit 835"] = "Einheit 3378", +-- ["United We Stand"] = "", -- A_Classic_Fairytale:united + ["Unit"] = "Einheit", + ["Unlimited Attacks"] = "Unbegrenzte Angriffe", +-- ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge + ["Unstoppable!"] = "Unaufhaltbar!", +-- ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon +-- ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood +-- ["User Challenge"] = "", + +-- ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon +-- ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge + ["Use your rope to get from start to finish as fast as you can!"] = "Nutze das Seil um von Start zu Ziel zu gelangen - so schnell du kannst!", +-- ["Vedgies"] = "", -- A_Classic_Fairytale:journey +-- ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy +-- ["Victory!"] = "", -- Basic_Training_-_Rope + ["Victory for the "] = "Sieg für ", -- CTF_Blizzard, Capture_the_Flag +-- ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Walls Left"] = "", -- WxW +-- ["Walls Required"] = "", -- WxW +-- ["WALL TO WALL"] = "", -- WxW +-- ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge +-- ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge +-- ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood + ["Waypoint placed."] = "Wegpunkt gesetzt", + ["Way-Points Remaining"] = "Wegpunkte verbleibend", +-- ["Weaklings"] = "", -- A_Classic_Fairytale:shadow +-- ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood +-- ["Weapons reset."] = "", -- Highlander + ["Weapons Reset"] = "Waffenzurücksetzung", +-- ["We are indeed."] = "", -- A_Classic_Fairytale:backstab +-- ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow +-- ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united +-- ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy +-- ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey +-- ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy +-- ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united +-- ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy +-- ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey + ["Well done."] = "Gut gemacht.", +-- ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy +-- ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab +-- ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon +-- ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey +-- ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy +-- ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab +-- ["We need to move!"] = "", -- A_Classic_Fairytale:united +-- ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab +-- ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow +-- ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow +-- ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family +-- ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey +-- ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood +-- ["What a douche!"] = "", -- A_Classic_Fairytale:enemy +-- ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family +-- ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood +-- ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey +-- ["What a ride!"] = "", -- A_Classic_Fairytale:shadow +-- ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon +-- ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab +-- ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow +-- [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal +-- ["What has "] = "", -- A_Classic_Fairytale:backstab +-- ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab +-- ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy +-- ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab +-- ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy +-- ["When?"] = "", -- A_Classic_Fairytale:enemy +-- ["When I find it..."] = "", -- A_Classic_Fairytale:dragon +-- ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow +-- ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab +-- ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon +-- ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow +-- ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow +-- ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow +-- ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab +-- ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy +-- ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab +-- ["Where have you been?"] = "", -- A_Classic_Fairytale:united +-- ["? Why?"] = "", -- A_Classic_Fairytale:backstab +-- ["Why "] = "", -- A_Classic_Fairytale:backstab +-- ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united +-- ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey +-- ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family +-- ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family +-- ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood +-- ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow +-- ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy +-- ["Why me?!"] = "", -- A_Classic_Fairytale:backstab +-- ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab +-- ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies +-- ["- Will refresh Parachute each turn."] = "", -- Continental_supplies +-- ["- Will refresh portalgun each turn."] = "", -- Continental_supplies + ["Will this ever end?"] = "Bu sona erecek mi?", +-- ["WINNER IS "] = "", -- Mutant + ["WINNING TIME: "] = "KAZANMA SÜRESİ: ", +-- ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen +-- ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey +-- ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon +-- ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood +-- ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab +-- ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow +-- ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy +-- ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon +-- ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow +-- ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab +-- ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon +-- ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey +-- ["Yes!"] = "", -- A_Classic_Fairytale:enemy +-- ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood +-- ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family +-- ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow +-- ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy +-- ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united +-- ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon +-- ["You can't fire a portal on the blue surface"] = "", -- portal +-- ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey + ["You'd almost swear the water was rising!"] = "Suyun yükseldiğine yemin edebilirdin!", +-- ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey +-- ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope +-- ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab +-- ["You have "] = "", -- A_Classic_Fairytale:dragon +-- ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab +-- ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope +-- ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope +-- ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united +-- ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey +-- ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab +-- ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy +-- ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy +-- ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab +-- ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood +-- ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy + ["You have SCORED!!"] = "VURDUN!", +-- ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb +-- ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy +-- ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab +-- ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow +-- ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab +-- ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab +-- ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab +-- ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy +-- ["You may only attack from a rope!"] = "", -- WxW +-- ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy +-- ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab +-- ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united +-- ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood +-- ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy +-- ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow +-- ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab +-- ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab +-- ["You're funny!"] = "", -- A_Classic_Fairytale:journey +-- ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope +-- ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow +-- ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab +-- ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow +-- ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey +-- ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood + ["You saved"] = "Kurtarılan: ", +-- ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy + ["You've failed. Try again."] = "Başaramadın. Yeniden dene!", + ["You've reached the goal!| |Time: "] = "Hedefe ulaştın!| |Süre: ", +-- ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow +-- ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab +-- ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family +-- ["Zealandia"] = "", -- Continental_supplies + ["'Zooka Team"] = "Roketatar Takımı", +-- ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen + } diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/tr.txt --- a/share/hedgewars/Data/Locale/tr.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/tr.txt Thu Jun 13 22:27:23 2013 +0200 @@ -2,7 +2,7 @@ 00:00=El Bombası 00:01=Parça Tesirli Bomba -00:02=Bazuka +00:02=Roketatar 00:03=UFO 00:04=Pompalı Tüfek 00:05=Kompresör @@ -12,7 +12,7 @@ 00:09=Çöl Kartalı 00:10=Dinamit 00:11=Beyzbol Sopası -00:12=Shoryuken +00:12=Yükselen Ejderha 00:13=san 00:14=Paraşüt 00:15=Hava Saldırısı @@ -37,34 +37,501 @@ 00:34=Ölümsüzlük 00:35=Arttırılmış Zaman 00:36=Lazer Görüşü -00:37=Vampirism -00:38=Sniper Rifle -00:39=Flying Saucer -00:40=Molotov Cocktail +00:37=Vampirleşme +00:38=Keskin Nişansı Tüfeği +00:39=Uçan Daire +00:40=Molotof Kokteyli +00:41=Kuşçuk +00:42=Taşınabilir Portal Aygıtı +00:43=Piano Vuruşu +00:44=Eski Limburger +00:45=Sinüs Tabancası (beta) +00:46=Alev Püskürtücü +00:47=Yapışkan Mayın +00:48=Çekiç +00:49=Yeniden Doğuş +00:50=Matkap Vuruşu +00:51=Çamur Topu +00:52=Silah Seçilmedi +00:53=Zaman Kutusu +; 00:54=Yapı +00:54=Zemin Spreyi +00:55=Dondurucu +00:56=Satır 01:00=Savaş başlasın! 01:01=Beraberlik 01:02=%1 kazandı! -01:03=Bölüm %1% +01:03=Bölüm %%1 01:04=Duraklatıldı 01:05=Çıkılsın mı (Y/Esc)? 01:06=Ani ölüm! -01:07=%1 Remaining -01:08=Fuel +01:07=%1 Kaldı +01:08=Yakıt +01:09=Eşzamanlanıyor... +01:10=Bu yardımcıyı kullanmak sıranı bitirmeyecek! +01:11=Bu silah veya yardımcı henüz kullanılamıyor! +01:12=Ani Ölüm için son tur! +01:13=Ani Ölüme %1 tur kaldı! +01:14=Hazırlan, %1! +01:15=Az +01:16=Düşük +01:17=Normal +01:18=Yüksek +01:19=En Yüksek +01:20=%1 Sekmesi +01:21=Ses Kapalı + ; Event messages ; Hog (%1) died -02:00=%1 has kicked the bucket! -02:00=%1 has seen the light! -02:00=%1 never saw that comming! +02:00=%1 sepeti boyladı! +02:00=%1 ışığı gördü! +02:00=%1 bunun geldiğini farketmemişti! +02:00=%1 baş baş yapıyor! +02:00=%1 daha iyi bir yere gitti! +02:00=%1 yapan ile buluşuyor! +02:00=%1 daha fazla dayanamıyor! +02:00=%1 görevini yaptı! +02:00=%1 mükemmel fedakarlık yapıyor! +02:00=%1 havan sarımını ateşliyor! +02:00=%1 ağaç olup ayrılıyor! +02:00=%1 zaman aşımına uğradı! +02:00=%1 dünya barışı istiyor! +02:00=%1 sevgiyle hatırlanacak! +02:00=%1 damar genişlemesi başladı! +02:00=%1 arkasında gözü yaşlı eş ve çocuk bırakıyor +02:00=%1 son roketatarını fırlattı +02:00=%1 son el bombasını fırlattı +02:00=%1 son pastasını pişirdi +02:00=%1 son halatında sallandı +02:00=%1 son hava saldırısını çağırdı +02:00=%1 son tüfeğini ateşledi +02:00=%1 son karpuzunu attı +02:00=%1 son çizimini yaptı +02:00=%1 bir atışı çok kez aldı +02:00=%1 gerçekten bir sağlık sandığı kullanabilirdi +02:00=%1 daha iyi bir oyun oynamak için gitti +02:00=%1 hayata kaçtı +02:00=%1 başarısız oldu +02:00=Zavallı %1... +02:00=%1 wormux'u tercih ediyor +02:00=%1 yüzüyle vuruşları engelliyordu +02:00=%1 bana göre bir kahraman...hımmm...kirpi +02:00=%1 kendi yerini Valhalla'da buldu +02:00=%1 binayı terketti +02:00=%1 dinazorların yanına gidiyor +02:00=%1 kirpileri nesillerini tüketmeye bir adım daha yaklaştırdı +02:00=%1 gözlerimi yaşarttı +02:00=%1 eskiden bir kirpiydi +02:00=%1 papatya ekiyor +02:00=%1 artık yok +02:00=%1 için bir veda yapalım +02:00=%1 ümidi kesildi +02:00=%1 son perdeyi kapattı +02:00=Varsa iç bir tane %1 +02:00=%1 Anlık Yoğun Varlık Sorunu çekiyor +02:00=%1 hayata veda etti +02:00=%1 kaya gibi öldü +02:00=%1 artık yok +02:00=%1 son kullanma tarihi doldu +02:00=Yaşamdan yoksun, %1 huzur içinde yatsın +02:00=%1 görünmezler korosuna katıldı +02:00=Hoşça kal %1, seni iyi bilirdik! +02:00=%1 vurulmaya çok az dayanabildi +02:00=%1 ek bir can kullanabilirdi +02:00=Evde bir doktor var mı? + ; Hog (%1) drowned -02:01=%1 plays submarine! -02:01=%1 mimics the Titanic! -02:01=%1 swims like a stone! -; Match starts -02:02=Let's fight! -02:02=Armed and ready! +02:01=%1 deniz altı oynuyor! +02:01=%1 Titanik'i taklit ediyor! +02:01=%1 kaya gibi yüzüyor! +02:01=%1 tuğla gibi havada kaldı! +02:01=%1 derin dibi kontrol ediyor +02:01=%1 bir şey diyor: "gulu gulu gulu" +02:01=%1 atlama yapıyor +02:01=%1 kolluklarını unuttu +02:01=%1 gerçekten yüzme dersi almalıydı +02:01=%1 sörf tahtasını evde bırakmış +02:01=%1 yıkanıyor +02:01=%1 ıslak bir kirpi +02:01=%1 can yeleğini getirmeyi unuttu +02:01=%1 bıcı bıcıya gidiyor +02:01=%1 balıklarla yüzüyor +02:01=%1 oyundaki su fiziğinin berbat olduğunu düşünüyor +02:01=%1 susamış görünüyor +02:01=Deniz seni istiyor %1 +02:01=%1 denizde kayboldu +02:01=%1 dalış takımını getirmeliydi +02:01=%1 denizde gömülüyor +02:01=%1 batıyor gibi hissediyor +02:01=%1 sırtüstü yüzme denemesi yapıyor +02:01=%1 Titanik'i aramaya gidiyor +02:01=%1 bu sefer güldürmedi +02:01=%1 Nemo'yu arıyor +02:01=%1 su alıyor +02:01=Aşağıda kaç kirpi var bir bilsen +02:01=%1 okyanus seviyesini yükseltiyor +02:01=%1 orduya katılmamıştı +02:01=%1 ölü balık taklidi yapıyor +02:01=En azından tuvalette boğulmadın, %1 +02:01=Sonic yüzemezdi %1 de öyle +02:01=%1 Ecco the dolphin oyunu oynamak istiyor +02:01=%1 Akvaryum ziyaretine gitti +02:01=%1 kayıp şehir Atlantis'i buldu +02:01=%1 Bioshock 3'te baş rolü oynamaya gidiyor +02:01=Patilerin biraz çalışabilirdi, %1 +02:01=%1 bir jet ski getirmeliydi +02:01=%1 su sporlarını sevmiyor +02:01=%1 sonsuza kadar baloncuk çıkarıyor +02:01=%1 bir sala ihtiyaç duyuyor +02:01=%1 tuzlu suyun cilt için iyi geldiğini düşünüyor +02:01=%1 yarasına tuz basıyor +02:01=%1 tahtada yürüdü +02:01=%1 bir banyoya sahip +02:01=%1 artık ıslak ıslak ıslak +02:01=%1 tüylerini ıslattı +02:01=O, %1 için bir Davy Jones dolabı + +; Round starts +02:02=Savaş başlasın! +02:02=Hazır ve nazır! +02:02=Haykırmaya hazır ol! +02:02=Hadi başlayalım! +02:02=Artık parti başlasın +02:02=Son kalan kirpi kazansın +02:02=Hadi gidelim! +02:02=Başlayalım! +02:02=Bastır! +02:02=Başlıyor... +02:02=Bu büyük şeyin bir başlangıcı +02:02=Hedgewars'a Hoş Geldin +02:02=Sınır hattına hoş geldin +02:02=Düşmanını ez! +02:02=En iyi kirpi kazansın +02:02=Zafer ya da ölüm +02:02=Zafer ganimettir +02:02=Kaybetmek bir seçenek değil +02:02=Ağla tahribat! Kirpi savaşı başlasın! +02:02=Hedgewars, Hedgewars.org tarafından sağlandı +02:02=GL HF +02:02=Şansın varmış Tiyuri'ye karşı oynamıyorsun +02:02=Şansın varmış C0Rr'e karşı oynamıyorsunun +02:02=Şansın varmış Nemo'ya karşı oynamıyorsun +02:02=Şansın varmış Smaxx'e karşı oynamıyorsun +02:02=Şansın varmış Jessor'e karşı oynamıyorsun +02:02=Her şeyi ortaya koy! +02:02=Kaybeden bulaşıkları yıkar! +02:02=Binyıl dövüşü başlasın +02:02=Yüzyıl dövüşü başlasın +02:02=Onyıl dövüşü başlasın +02:02=Yılın dövüşü başlasın +02:02=Ayın dövüşü başlasın +02:02=Haftanın dövüşü başlasın +02:02=Günün dövüşü başlasın +02:02=Saatin dövüşü başlasın +02:02=Elinden geleni yap! +02:02=Düşmanı yok et! +02:02=İyi şanslar +02:02=İyi eğlenceler +02:02=İyi dövüş +02:02=Pis dövüş +02:02=Onura dövüş +02:02=Pes etme +02:02=Asla teslim olma +02:02=Yen ve parçala! +02:02=Parçalama festivali başlasın! +02:02=Umarım mücadeleye hazırsın! +02:02=Hadi Hadi Hadi! +02:02=Hedgehogs devam! +02:02=Göster onlara! +02:02=Asla korkma! +02:02=Cesur ol ve fethet + +; Round ends (win; unused atm) +02:03=... + +; Round ends (draw; unused atm) +02:04=... + +; New health crate +02:05=Yardım geliyor! +02:05=İlkyardım! +02:05=Göklerden ilkyardım! +02:05=Size bir sağlık paketi +02:05=İyi sağlık... kutu biçiminde! +02:05=Doktor çağırıyor +02:05=Taze yara bantları! +02:05=Bu daha iyi hissetmeni sağlayacak +02:05=Büyük iksir! Aaa, yanlış oyun +02:05=Bir beni-al! +02:05=Yakala +02:05=Sağlıklı bir atıştırmalık +02:05=Acıya tedavi +02:05=Kullanım dozu: bulabildiğin kadar çok! +02:05=Acele posta +02:05=Emanetler! + +; New ammo crate +02:06=Daha çok silah! +02:06=Destek geliyor! +02:06=Kilitlen ve bırak! +02:06=Acaba içinde hangi silah var? +02:06=Tedarikler! +02:06=İçinde ne olabilir? +02:06=Hedgewars'ta yılbaşı erken geliyor +02:06=Bir hediye! +02:06=Özel posta! +02:06=Bunu gümrükten geçirmek bir kabustu +02:06=Cennetten yok edici oyuncaklar +02:06=Uyarı! Uçucu İçerik +02:06=Kaldır veya havaya uçur, seçim senin +02:06=Eşyalar! +02:06=Hım hım Cephane +02:06=Yok edici güç kutusu +02:06=Uçak postası! +02:06=Bu kutuda ne varsa pizza olmadığı kesin +02:06=Al şunu! +02:06=Silah bırakılıyor +02:06=Düşmanın bunu almasın! +02:06=Yeni parlak oyuncaklar! +02:06=Gizemli bir kutu! + +; New utility crate +02:07=Araç zamanı! +02:07=Bu işe yarayabilir... +02:07=Araçlar! +02:07=Bu kutudan yararlan +02:07=Dikkat et +02:07=Daha fazla alet! +02:07=Senin için alet! +02:07=Bu güzel olmalı! +02:07=Zekice kullan +02:07=Off bu kutu da ağırmış +02:07=Buna ihtiyacın olabilir + +; Hog (%1) skips his turn +02:08=%1 çoook sıkıcı... +02:08=%1 rahatsız olamazdı +02:08=%1 tembel bir kirpi +02:08=%1 düşüncesiz +02:08=%1 pes etti +02:08=Ertelersen kaybedersin, %1 +02:08=%1 utanmaksızın geçiyor +02:08=%1 gerçekten tembel +02:08=%1 daha fazla motivasyona ihtiyacın var +02:08=%1 bir barışcı +02:08=%1 bir mola alıyor +02:08=%1 dinleniyor +02:08=%1 moral bozmuyor +02:08=%1 yeteneklerine inanmıyor +02:08=%1 hiçbir şey yapmamaya karar veriyor +02:08=%1 düşmanın kendisini yok etmesine izin veriyor +02:08=%1 partilerde berbat olur +02:08=%1 saklanıyor +02:08=%1 bu fırsatı değerlendirmek istemedi +02:08=%1 yapabileceği en iyi şeyin...hiçbir şey olduğuna karar verdi +02:08=%1 koca bir korkak +02:08=Gıt gıt gıdak, %1 bir tavuk +02:08=%1 küçük bir sarı arıyor +02:08=%1 bir ürkek! +02:08=%1 ani ölümü bekliyor +02:08=%1 dövüş istemiyor +02:08=%1 hayattaki amacını tekrar düşünüyor +02:08=%1 hiçbir zaman iyi bir atış yapamadı zaten +02:08=%1 orduya da isteyerek katılmamıştı +02:08=Zamanımızı boşa harcamayı kes, %1 +02:08=Beni hayal kırıklığına uğrattın, %1 +02:08=Hadi ama, bundan daha iyisini yapabilirsin %1 +02:08=%1 kalbi kırıldı +02:08=Görünüyor ki %1 daha iyi yapacak şeylere sahip +02:08=%1 korkak bir ölü +02:08=%1 uyuya kaldı + +; Hog (%1) hurts himself only +02:09=%1 atış çalışmalı! +02:09=%1 kendinden nefret ediyor gibi görünüyor +02:09=%1 yanlış tarafta duruyor! +02:09=%1 emo gibi yapıyor +02:09=%1 silahını yanlış yönde tutuyordu +02:09=%1 sanki biraz sadist +02:09=%1 bir mazoşist +02:09=%1 kendini koruma iç güdüsüne sahip değil +02:09=%1 batırdı +02:09=%1 mahvetti +02:09=Kötü bir atıştı, %1 +02:09=%1 tehlikeli silahlarla çok dikkatsiz +02:09=%1 kariyerini değiştirmeyi düşünmeli +02:09=Dünyadaki. En berbat. Atıştı! +02:09=Yo yo yo %1, DÜŞMANA ateş etmelisin! +02:09=%1 sadece düşmanı yok etmeli +02:09=%1 intihara bir adım daha yaklaşıyor +02:09=%1 düşmana yardım ediyor +02:09=Bu aptalcaydı %1 +02:09=%1 "acı yok, kazanmak yok" deyimiyle yaşıyor +02:09=%1, sanki kafan karışık +02:09=%1 yanlışlıkla kendine zarar veriyor +02:09=%1, kendini utandırmakta üstüne yok +02:09=%1 bir saloz! +02:09=Sakarsın %1 +02:09=%1 düşmana yeteneklerini gösteriyor +02:09=%1 her zaman mükemmel olması beklenemez +02:09=Sorun değil %1, hiç kimse mükemmel değildir +02:09=%1 bunu kesinlikle bilerek yaptı +02:09=Yapmazsan kimseye söylemem, %1 +02:09=Ne utanç verici ama! +02:09=Eminim kimse bunu görmedi %1 +02:09=%1 kendi alan kılavuzunu gözden geçirmeli +02:09=%1 silahında sorun vardı + ; Hog shot an home run (using the bat and another hog) -02:10=Home Run! -02:10=A bird, a plane, ... -02:10=That one is out! +02:10=Tur Vuruşu! +02:10=Bu bir kuş. Hayır uçak, ... +02:10=Bu çıkar! + +; Hog (%1) has to leave (team is gone) +02:11=%1 uyumaya gitmeli! +02:11=%1 oynamak için çok meşgul görünüyor +02:11=Ateşle onu, Scotty! +02:11=%1 gitmeli + +; Weapon Categories +03:00=Zamanlı El Bombası +03:01=Zamanlı El Bombası +03:02=Balistik Silah +03:03=Kılavuzlu Silah +03:04=Tabanca (çok atışlı) +03:05=Kazma Aracı +03:06=Eylem +03:07=Taşıma Yardımcısı +03:08=Yakınlık Bombası +03:09=Tabanca (çok atışlı) +03:10=BUM! +03:11=Bum! +03:12=Dövüş Sanatları +03:13=KULLANILMIYOR +03:14=Taşıma Yardımcısı +03:15=Hava Saldırısı +03:16=Hava Saldırısı +03:17=Kazma Aracı +03:18=Yardımcı +03:19=Taşıma Yardımcısı +03:20=Eylem +03:21=Balistik Silah +03:22=Bana Indiana de! +03:23=(Gerçekten) Dövüş Sanatları +03:24=Pasta yalan DEĞİL! +03:25=Kostüm Seti +03:26=Meyveli El Bombası +03:27=Ateşli El Bombası +03:28=Balistik Silah +03:29=Balistik Silah +03:30=Hava Saldırısı +03:31=Uzaktan Kumandalı Bomba +03:32=Geçici Etki +03:33=Geçici Etki +03:34=Geçici Etki +03:35=Geçici Etki +03:36=Geçici Etki +03:37=Geçici Etki +03:38=Tabanca (çok atışlı) +03:39=Taşıma Yardımcısı +03:40=Yakıcı El Bombası +03:41=Cıvıldamaların büyük fanı +03:42=Burada bir şey demek istiyorum... +; the misspelled "Beethoven" is intentional (-> to beat) +03:43=Beathoven'ın ölümcül sonatasını gösteriyor +03:44=Son kullanma tarihi: 1923 +03:45=Bilimin gücü +03:46=Sıcak Sıcak Sıcak! +03:47=Bunları kullanışlı bir yere yapıştır! +03:48=Çekiç zamanı! +03:49=Tahmin ettiğin şeyi yapıyor +03:50=Köstebek fanı +03:51=Zeminde bulunan +03:52=KULLANILMIYOR +03:53=Tür 40 +03:54=Bir şey inşa et +03:55=Yardımcı + +; Weapon Descriptions (use | as line breaks) +04:00=Düşmanlarına basit el bombası ile saldır.|Zamanlayıcı sıfır olduğunda patlayacak.|1-5: Bomba süresini ayarla|Saldır: Daha fazla güçte atmak için basılı tut +04:01=Düğmanlarına parça tesirli bomba ile saldır.|Zamanlayıcı sıfır olduğunda daha küçük|bombalara dönüşür.|1-5: Bomba süresini ayarla|Saldır: Daha fazla güçte atmak için basılı tut +04:02=Düşmanlarına rüzgardan etkilenebilecek|balistik mermi kullanarak saldır.|Saldır: Daha fazla güçle atış için basılı tut +04:03=Seçili hedefe kilitlenecek patlayıcı bir arı|fırlat. Kesinliğini arttırmak için tam güçle|fırlatma.|İmleç: Hedef seç|Saldır: Daha fazla güçle atış için basılı tut +04:04=Düşmanına iki atışla tüfek kullanarak saldır.|Yayılması sayesinde rakibine zarar vermen için|keskin vuruş yapman gerekmiyor.|Saldır: Ateş (çok kez) +04:05=Yer altına hareket et! Çekici kullanarak|zemine bir delik kaz ve diğer yerlere ulaş.|Saldır: Kazmayı başlat ve durdur +04:06=Sıkıldın mı? Saldıracak yer mi yok? Cephane mi |kurtarmak istiyorsun? Problem yok!|Pas geç korkak!|Saldır: Dövüşmeden turu atla +04:07=İp kullanarak zamanlı atışlarla uzun mesafelere|bağlan. Diğer kirpilere doğru kaymak için|momentumunu kullan veya üzerlerine el bombası|ve diğer silahları at.|Saldır: At ve ipi bırak|Uzun Atlama: El bombası veya benzer silahları|bırak +04:08=Küçük geçişlere veya ayaklarının yanına mayın|bırakarak düşmanı uzaklaştır. Kendin için|tetiklemediğinden emin ol!|Saldır: Ayağının yanına mayın bırak +04:09=Hedefinden emin değil misin? Tabanca|kullanarak dört atışa kadar düşmanı vur.|Saldır: Ateş (çok kez) +04:10=Zor kullanım her zaman bir seçenek. Bu klasik|patlayıcıyı düşmanının yanına koy ve çekil.|Saldır: Ayağının yanına dinamit bırak +04:11=Düşman kirpilerden üzerlerine sopa ile vurarak|uzaklara veya suya düşür. Veya|arkadaşlarına birkaç mayın fırlatmak nasıl olurdu?|Saldır: Önündeki herşeye vurarak fırlat +04:12=Yakınlaş ve neredeyse bu ölümcül dövüş sanatı|teknik gücünü ortaya çıkar.|Saldır: Muhteşem Yükselen Ejderha yap. +04:13=KULLANILMIYOR +04:14=Yükseklikten mi korkuyorsun? O zaman bir paraşüt|kullan.|Uzağa düşerken açılacak ve kirpinin düşme zararı|almasını engelleyecek|Saldır: Paraşütü aç|Uzun Atlama: El bombası veya benzeri silahlar bırak +04:15=Bombalayıcı kulanarak uçakla düşmanlarına saldır.|Sol/Sağ: Saldırı yönünü belirle|İmleç: Hedef bölgeyi seç +04:16=Hedef alana çeşitli mayın atacak bir uçak çağır.|Sol/Sağ: Saldırı yönünü belirle|İmleç: Hedef bölgeyi seç +04:17=Korunak mı gerekiyor? Seni kaplayabilecek bir|tünel için kaynak makinesi kullan|Saldır: Kazmayı başlat/durdur +04:18=Ek koruma mı gerekiyor? Yoksa geçilemez|zemini mi geçmek istiyorsun? İstediğin kadar|merdiven koy|Sol/Sağ: Yerleştilecek merdiveni seç|İmleç: Geçerli yere merdiven yerleştir +04:19=Doğru yerde kullanıldığında ışınlanma tüm|silahlardan daha güçlü olabilir. Kirpileri|saniyeler içerisinde tehlikeli durumlardan|kurtarır.|İmleç: Hedef bölgeyi seç +04:20=Geçerli turu başka bir kirpiyle oynamanı|sağlar.|Saldır: Kirpi değiştirmeyi etkinleştir +04:21=El bombasına benzer bir füze fırlatır ve|çarpma sonrası çok sayıda bombaya dönüşür.|Saldır: Tam güçte fırlat +04:22=Sadece Indiana Jones için değil! Kamçı|çoğu durumda çok kullanışlı bir silahtır.|Özellikle birini yamaçtan uçurmak için.|Saldır: Önündeki her şeye vur +04:23=Eğer kaybedecek hiçbir şeyin yoksa, bu|kullanışlı olabilir. Kirpini özel bir yönde|başlatarak feda et ve önündeki her şeye|zarar verip sonunda patlamasını sağla.|Saldır: Şiddetli ve ölümcül bir saldırı başlat +04:24=Mutlu Yıllar! Bu keki çalıştır, düşmanının yanına|yürümesine izin ver ve patlayan bir parti yapmalarını|sağla. Kek neredeyse tüm zeminlerden geçebilir|fakat yolun ortasında patlayabilir.|Saldır: Keki başlat ve durdurup patlat +04:25=Bu kiti kullanarak düşmanlarının kirpine doğru zıplamasını|sağla (ve bir boşluk veya deliğe).|Saldır: Kiti kullan ve diğer kirpiyi etkile +04:26=Bu sulu karpuzu düşmanına at. Zaman dolduğunda|çok sayıda patlayıcı parçaya ayrılacaktır.|1-5: Karpuz zaanlayıcısını ayarla.|Saldır: Daha fazla güçle atış için basılı tut +04:27=Bu zalim patlayıcıyı kullanarak rakibini cehennem|ateş yağmuruna tut. Küçük ateşler daha|uzun süreceğinden yakın olmamaya dikkat et.|Saldır: Daha fazla güçle atış için basılı tut +04:28=Bu roketi fırlattıktan kısa süre sonra katı zemini|kazmaya başlayacak ve tekrar yüzeye çıktığında|veya süresi dolduğunda patlayacak.|Saldır: Daha fazla güçle atış için basılı tut +04:29=Bu küçük çocuklar için değil! Top tabancası patlayıcı|dolu tonlarca küçük renkli top fırlatır.|Saldır: Tam güçte atış yap|Yukarı/Aşağı: Nişan al +04:30=Muhteşem napalm atışı için bir uçak çağır.|Doğru nişan ile bu saldırı zeminin büyük bölümünü|yok edebilir ve tabii ki şansız kirpileri de.|Sol/Sağ: Saldırı yönünü belirle|İmleç: Hedef bölgeyi seç +04:31=RC uçağı sandıkları toplamak veya uzaktaki kirpilere|saldırmak için kullanışlı bir silahtır.|Doğrudan düşmanlara çarp veya ilk olarak bomba bırak.|Saldır: Uçağı başlat veya bomba bırak|Uzun Zıplama: Valkrie'lerin savaşa gelmelerini sağla|Sol/Sağ: Uçağı kontrol et +04:32=Düşük yer çekimi diğer tüm diyetlerden daha etkilidir!|Daha yukarı ve büyük uzaklıklara zıpla|veya düşmanının daha uzağa uçmasını sağla|Saldır: Etkinleştir +04:33=Bazen daha fazla zarar vermek için bu küçük ek güce|ihtiyacın olabilir.|Saldır: Etkinleştir +04:34=Bana dokunamazsın!|Saldır: Etkinleştir +04:35=Bazen zaman su gibi akıp geçiyor. Saldırını bitirmek|için ek saniye al.|Saldır: Etkinleştir +04:36=Aslında bazen hedef tutturmada çok kötüsün. Modern|teknoloji kullanarak biraz yardım al.|Saldır: Etkinleştir +04:37=Gün ışığından korkma. Sadece bir tur sürecek fakat|Diğer kirpilere verdiğin zararı emmeni sağlayacak.|Saldır: Etkinleştir +04:38=Keskin nişancı tüfeği birliğindeki en zarar verici silah|olabilir ancak yakın mesafede etkisi azdır.|Hasar, hedef uzak oldukça daha çok artar.|Saldır: Ateş et (iki kez) +04:39=Haritanın diğer yerlerine uçan daire ile uç.|Bu uzmanlaşmak için zaman gerektirir ve|alışana kadar savaş alanında her yere|götürebilir.|Saldır: Etkinleştir|Yukarı/Sol/Sağ: Bir yöne güç uygula|Uzun Atlama: El bombası veya|benzer silahlar bırak +04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Saldır: Daha fazla güçle atış için basılı tut +04:41=Doğa uçan dairenin üzerinde de olabilir|Kuşçuk kirpini taşıyabilir ve|düşmanlarına yumurta bırakabilir!|Hızlı ol, çünkü Kuşçuğu kullanmak |zamanını tüketir!|Saldır: Etkinleştir ve yumurta bırak|Yukarı/Sol/Sağ: Bir yöne kanat çırp +04:42=Bu taşınabilir portal aygıtı seni, düşmanlarını|veya bir silahını zemindeki iki nokta arasında|hemen taşıma yeteneğine|sahip.|Zekice kullan ve maceran bir... BAŞARIYA|DÖNÜŞSÜN!|Saldır: Bir portal ateş et|Değiştir: Portal renkleri arasında geçiş yap +04:43=Müzikal kariyerine başarılı bir patlamayla başla!|Cennetten bir piyano düşür, fakat dikkat et...|birinin çalması gerekiyor ve|bu senin hayatın olmasın.|İmleç: Hedef bölgeyi seç|F1-F9: Piyanoyu çal +04:44=Bu sadece bir peynir değil, bir biyolojik silah!|Zamanlayıcı sıfır olduğunda koca bir hasar|vermenin yanında, kokuya dokunan şanssız|herkesi de zehirleyecek!|1-5: Bombanın zamanını ayarla|Saldır: Daha fazla güç ile fırlatmak için tut +04:45=Sonunda fizik dersleri işe yaradı.|Düşmanlarına kocaman bir sinüs dalgası at.|Dikkatli ol, bu silah oldukça büyük bir vuruşa sahip|(Bu silah bitmedi)|Saldır: Ateş et +04:46=Düşmanlarını sızan akışkan alevle kapla|Kalp ısıtıcı!|Saldır: Etkinleştir|Yukarı/Aşağı: Hedef almaya devam et|Sol/Sağ: Fışkırtma gücünü değiştir +04:47=Dikenli, sinsi, yapışkan mayınlarla çifte zevk!|Zincirleme reaksiyon ayarla veya kendini koru (veya ikisi de!)|Saldır: Daha fazla güçle atış için basılı tut (iki kez) +04:48=Niçin köstebeklere kötü davranılsın?|Bir kirpi de zevk için dövülebilir! Bu|çekicin iyi bir yanı kirpinin canının |üçte birini alması ve yer altına sokması.|Saldır: Etkinleştir +04:49=Arkadaşlarını yeniden canlandır!|Fakat dikkatli ol, bu ayrıca düşmanlarını da|canlandırır.|Saldır: Yavaşça canlandırmak için saldırma|düğmesini basılı tut|Yukarı: Canlandırmayı hızlandır +04:50=Biri altta mı saklanıyor?|Matkap saldırısı ile kaz!|Zamanlayıcı ne kadar kazılacağını denetler. +04:51=Bir çamur topu fırlatarak ücretsiz bir atış kap.|Biraz kokar ancak kirpileri geri sektirir. +04:52=KULLANILMIYOR +04:53=Arkadaşlarını savaşta yalnız bırakarak|zaman ve uzaya seyahat et.|Herhangi bir an, Ani Ölüm veya tümü|ölmüşse geri gelmeye hazır ol.|Yadsıma: Ani Ölüm kipinde, tek isen veya|Kralsan çalışmaz. +04:54=TAM DEĞİL +04:55=Yapışkan tanecikler püskürt.|Köprü yap, düşmanı göm, tünelleri kapat.|Dikkatli ol sana gelmesin! + +; Game goal strings +05:00=Oyun Kipleri +05:01=Aşağıdaki kurallar uygulanır +05:02=Kaleler: Kaleni savun; düşmanlarını alt et! +05:03=Düşük Yer Çekimi: Adımına dikkat et +05:04=Dayanıklılık: Kirpiler (neredeyse) zarar görmezler +05:05=Vampirleşme: Verilen hasar kirpileri iyileştirir +05:06=Karma: Verilen hasar kirpilere zarar verir +05:07=Kralı Koru: Kralın ölmesine izin verme!|Kralı Yerleştir: Kralın için korunaklı bir başlangıç noktası seç +05:08=Kirpileri Yerleştir: Kirpilerini oyun başlamadan önce yerleştir +05:09=Ağır Sınıf: Kirpiler hareket etmek için yer değiştiremezler +05:10=Yıkılmaz Zemin: Çoğu silah zemine zarar veremez +05:11=Paylaşılan Cephane: Aynı renkteki tüm takımlar cephaneyi paylaşır +05:12=Mayın Zamanlayıcı: Mayınlar %1 saniye sonra patlayacak +05:13=Mayın Zamanlayıcı: Mayınlar hemen patlayacak +05:14=Mayın Zamanlayıcı: Mayınlar 0 - 5 saniye içinde patlayacak +05:15=Hasar Değiştirici: Tüm silahlar %%1 hasar verecek +05:16=Tur sonunda tüm kirpilerin sağlığı sıfırlanacak +05:17=Yapay zeka kirpileri öldükten sonra yeniden doğar +05:18=Sınırsız Saldırı +05:19=Silahlar her tur sonunda sıfırlanır +05:20=Silahlar kirpiler arasında paylaşılmaz +05:21=Takımları Etiketle: Klandaki takımlar başarılı turlar alır|Paylaşılan Zaman: Klandaki takımlar tur zamanını paylaşırlar diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/uk.txt --- a/share/hedgewars/Data/Locale/uk.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/uk.txt Thu Jun 13 22:27:23 2013 +0200 @@ -286,8 +286,8 @@ 03:51=Знайдено на землі 03:52=UNUSED 03:53=Тип 40 -03:54=Збудуй щось -03:55=Утиліта +;03:54=Збудуй щось +03:54=Утиліта ; Weapon Descriptions (use | as line breaks) 04:00=Атакуй ворогів використовуючи просту гранату.|Вона вибухне як тільки її таймер доходить до нуля.|1-5: Вистав таймер гранати|Атака: Утримуй щоб метнути сильніше @@ -344,8 +344,8 @@ 04:51=Здійсни халявний удар, шпурни грудку багна.|Трохи пече і відкидає їжака назад. 04:52=UNUSED 04:53=Здійсни подорож крізь час та простір,|залишивши товаришів битись далі самим.|Будь готовий повернутись в кожну мить,|або до Раптової смерті або до їх поразки.|Відмова. Не працює в Раптовій Смерті,|якщо ти один, або якщо ти Король. -04:54=НЕЗАВЕРШЕНО -04:55=Розпили потік лепких пластівців.|будуй мости, хорони ворогів, перекривай тунелі.|Стеж щоб на тебе не впала жодна з них! +;04:54=НЕЗАВЕРШЕНО +04:54=Розпили потік лепких пластівців.|будуй мости, хорони ворогів, перекривай тунелі.|Стеж щоб на тебе не впала жодна з них! ; Game goal strings 05:00=Режими Гри diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Locale/zh_TW.txt --- a/share/hedgewars/Data/Locale/zh_TW.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Locale/zh_TW.txt Thu Jun 13 22:27:23 2013 +0200 @@ -237,8 +237,6 @@ 02:01=%1 去水族館報到了 ;02:01=%1 has found the lost city of Atlantis 02:01=%1 找到了傳說中的亞特蘭蒂斯城 -;02:01=%1 aims for the lead role in Bioshock 3 -02:01=%1 的目的是為了在生化危機3中起帶頭作用 ;02:01=Your doggy paddle could use a little work, %1 02:01=狗爬式會有用的, %1 ;02:01=%1 should have brought a jet ski diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/Basketball/map.lua --- a/share/hedgewars/Data/Maps/Basketball/map.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/Basketball/map.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ -- Hedgewars - Basketball for 2+ Players -HedgewarsScriptLoad("Scripts/Locale.lua")() +HedgewarsScriptLoad("/Scripts/Locale.lua") local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0} diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/CMakeLists.txt --- a/share/hedgewars/Data/Maps/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -33,6 +33,14 @@ portal Ropes Ruler + SB_Bones + SB_Crystal + SB_Grassy + SB_Grove + SB_Haunty + SB_Oaks + SB_Shrooms + SB_Tentacles Sheep ShoppaKing Sticks diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/CTF_Blizzard/map.lua --- a/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua Thu Jun 13 22:27:23 2013 +0200 @@ -91,7 +91,7 @@ -- add support for more players -- re-enable sudden death, but set water rise to 0 -HedgewarsScriptLoad("Scripts/Locale.lua")() +HedgewarsScriptLoad("/Scripts/Locale.lua") --------------------------------------------------------------- ----------lots of bad variables and things diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/Control/map.lua --- a/share/hedgewars/Data/Maps/Control/map.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/Control/map.lua Thu Jun 13 22:27:23 2013 +0200 @@ -49,7 +49,7 @@ --script begins ----------------- -HedgewarsScriptLoad("Scripts/Locale.lua")() +HedgewarsScriptLoad("/Scripts/Locale.lua") --------------------------------------------------------------- ----------lots of bad variables and things diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/Eyes/preview.png Binary file share/hedgewars/Data/Maps/Eyes/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/Knockball/map.lua --- a/share/hedgewars/Data/Maps/Knockball/map.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/Knockball/map.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ -- Hedgewars - Knockball for 2+ Players -HedgewarsScriptLoad("Scripts/Locale.lua")() +HedgewarsScriptLoad("/Scripts/Locale.lua") local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0} diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/Octorama/preview.png Binary file share/hedgewars/Data/Maps/Octorama/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Bones/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Bones/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,5 @@ +install(FILES + map.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Bones) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Bones/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Bones/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Desert +48 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Bones/map.png Binary file share/hedgewars/Data/Maps/SB_Bones/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Bones/preview.png Binary file share/hedgewars/Data/Maps/SB_Bones/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Crystal/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Crystal/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Crystal) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Crystal/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Crystal/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Cave +32 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Crystal/map.png Binary file share/hedgewars/Data/Maps/SB_Crystal/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Crystal/mask.png Binary file share/hedgewars/Data/Maps/SB_Crystal/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Crystal/preview.png Binary file share/hedgewars/Data/Maps/SB_Crystal/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grassy/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Grassy/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Grassy) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grassy/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Grassy/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Castle +40 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grassy/map.png Binary file share/hedgewars/Data/Maps/SB_Grassy/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grassy/mask.png Binary file share/hedgewars/Data/Maps/SB_Grassy/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grassy/preview.png Binary file share/hedgewars/Data/Maps/SB_Grassy/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grove/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Grove/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Grove) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grove/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Grove/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Nature +48 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grove/map.png Binary file share/hedgewars/Data/Maps/SB_Grove/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grove/mask.png Binary file share/hedgewars/Data/Maps/SB_Grove/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Grove/preview.png Binary file share/hedgewars/Data/Maps/SB_Grove/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Haunty/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Haunty/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Haunty) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Haunty/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Haunty/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Halloween +24 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Haunty/map.png Binary file share/hedgewars/Data/Maps/SB_Haunty/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Haunty/mask.png Binary file share/hedgewars/Data/Maps/SB_Haunty/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Haunty/preview.png Binary file share/hedgewars/Data/Maps/SB_Haunty/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Oaks/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Oaks/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Oaks) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Oaks/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Oaks/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Nature +48 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Oaks/map.png Binary file share/hedgewars/Data/Maps/SB_Oaks/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Oaks/mask.png Binary file share/hedgewars/Data/Maps/SB_Oaks/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Oaks/preview.png Binary file share/hedgewars/Data/Maps/SB_Oaks/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Shrooms/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Shrooms/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Shrooms) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Shrooms/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Shrooms/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Nature +48 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Shrooms/map.png Binary file share/hedgewars/Data/Maps/SB_Shrooms/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Shrooms/mask.png Binary file share/hedgewars/Data/Maps/SB_Shrooms/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Shrooms/preview.png Binary file share/hedgewars/Data/Maps/SB_Shrooms/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Tentacles/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Tentacles/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +install(FILES + map.png + mask.png + map.cfg + preview.png + DESTINATION ${SHAREPATH}Data/Maps/SB_Tentacles) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Tentacles/map.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Maps/SB_Tentacles/map.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Hell +40 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Tentacles/map.png Binary file share/hedgewars/Data/Maps/SB_Tentacles/map.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Tentacles/mask.png Binary file share/hedgewars/Data/Maps/SB_Tentacles/mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/SB_Tentacles/preview.png Binary file share/hedgewars/Data/Maps/SB_Tentacles/preview.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Maps/TrophyRace/map.lua --- a/share/hedgewars/Data/Maps/TrophyRace/map.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ -- Hedgewars - Roperace for 2+ Players -HedgewarsScriptLoad("Scripts/Locale.lua")() +HedgewarsScriptLoad("/Scripts/Locale.lua") -- store number of hedgehogs local numhhs = 0 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,9 @@ file(GLOB Config *.ini) file(GLOB Missions *.lua) +file(GLOB Packs *.hwp) install(FILES ${Config} ${Missions} + ${Packs} DESTINATION "${SHAREPATH}Data/Missions/Campaign/A Classic Fairytale") diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua Thu Jun 13 22:27:23 2013 +0200 @@ -760,7 +760,9 @@ SaveCampaignVar("M5ChiefDead", "0") end SaveCampaignVar("M5Choice", "" .. choice) - SaveCampaignVar("Progress", "5") + if progress and progress<5 then + SaveCampaignVar("Progress", "5") + end for i = 1, 7 do if natives[i] == deployedHog then @@ -814,6 +816,7 @@ end function GetVariables() + progress = tonumber(GetCampaignVar("Progress")) m2DenseDead = tonumber(GetCampaignVar("M2DenseDead")) m2Choice = tonumber(GetCampaignVar("M2Choice")) m4DenseDead = tonumber(GetCampaignVar("M4DenseDead")) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua Thu Jun 13 22:27:23 2013 +0200 @@ -399,8 +399,11 @@ function DoMissionFinished() AddCaption(loc("Salvation was one step closer now...")) - SaveCampaignVar("Progress", "6") - ParseCommand("teamgone " .. loc("011101001")) + if progress and progress<6 then + SaveCampaignVar("Progress", "6") + end + RestoreHedge(cyborg) + DeleteGear(cyborg) TurnTimeLeft = 0 end @@ -419,8 +422,8 @@ end function EndMission() - ParseCommand("teamgone " .. loc("Natives")) - ParseCommand("teamgone " .. loc("011101001")) + RestoreHedge(cyborg) + DeleteGear(cyborg) TurnTimeLeft = 0 end @@ -451,6 +454,7 @@ end function GetVariables() + progress = tonumber(GetCampaignVar("Progress")) m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) end diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua Thu Jun 13 22:27:23 2013 +0200 @@ -400,7 +400,9 @@ end function WinMission() - SaveCampaignVar("Progress", "9") + if progress and progress<9 then + SaveCampaignVar("Progress", "9") + end ParseCommand("teamgone " .. loc("011101001")) TurnTimeLeft = 0 end @@ -420,6 +422,7 @@ end function GetVariables() + progress = tonumber(GetCampaignVar("Progress")) m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) m2Choice = tonumber(GetCampaignVar("M2Choice")) m5Choice = tonumber(GetCampaignVar("M5Choice")) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua Thu Jun 13 22:27:23 2013 +0200 @@ -284,7 +284,9 @@ function DoPrincessFreed() AnimSay(princess, loc("Thank you, my hero!"), SAY_SAY, 0) - SaveCampaignVar("Progress", "7") + if progress and progress<7 then + SaveCampaignVar("Progress", "7") + end ParseCommand("teamgone " .. loc("011101001")) TurnTimeLeft = 0 end @@ -390,6 +392,7 @@ end function GetVariables() + progress = tonumber(GetCampaignVar("Progress")) m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) m2Choice = tonumber(GetCampaignVar("M2Choice")) m5Choice = tonumber(GetCampaignVar("M5Choice")) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.hwp Binary file share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.hwp has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua Thu Jun 13 22:27:23 2013 +0200 @@ -56,6 +56,7 @@ canKilled = false desertTaken = false challengeFailed = false +deleteCrate = false difficultyChoice = false princessFace = "Left" elderFace = "Left" @@ -220,6 +221,9 @@ end -----------------------------Events------------------------------------ function CheckNeedToTurn(gear) + if youngKilled then + return false + end if gear == princess then if princessKilled ~= true then if (GetX(princess) > GetX(youngh) and princessFace == "Right") @@ -466,6 +470,7 @@ function DoTimesUp() challengeFailed = true + deleteCrate = true DeleteGear(crates[1]) TurnTimeLeft = -1 AddCaption(loc("And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame...")) @@ -538,7 +543,9 @@ function DoCannibalKilled() AddAnim(cannKilledAnim) - SaveCampaignVar("Progress", "1") + if not progress then + SaveCampaignVar("Progress", "1") + end end function DoCannibalKilledEarly() @@ -603,9 +610,7 @@ MinesTime = 3000 Explosives = 0 Delay = 10 - MapGen = 0 - TemplateFilter = 6 - TemplateNumber = 33 + Map = "A_Classic_Fairytale_first_blood" Theme = "Nature" @@ -630,6 +635,7 @@ end function onGameStart() + progress = tonumber(GetCampaignVar("Progress")) TurnTimeLeft = -1 FollowGear(youngh) ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0) @@ -664,6 +670,8 @@ rope2Taken = true elseif gear == ropeCrate3 then rope3Taken = true + elseif gear == crates[1] and deleteCrate == true then + deleteCrate = false elseif gear == crates[1] and challengeFailed == false then crates[1] = nil cratesCollected = cratesCollected + 1 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.hwp Binary file share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.hwp has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua Thu Jun 13 22:27:23 2013 +0200 @@ -903,7 +903,9 @@ end function DoWon() - SaveCampaignVar("Progress", "3") + if progress and progress<3 then + SaveCampaignVar("Progress", "3") + end AddAnim(winAnim) AddFunction({func = FinishWon, args = {}}) end @@ -939,11 +941,10 @@ MinesTime = 3000 Explosives = 0 Delay = 5 - MapGen = 0 - TemplateFilter = 6 - TemplateNumber = 27 - Theme = "Nature" - SuddenDeathTurns = 3000 + Map = "A_Classic_Fairytale_journey" + Theme = "Nature" + + SuddenDeathTurns = 3000 AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy") leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo") @@ -974,6 +975,7 @@ end function onGameStart() + progress = tonumber(GetCampaignVar("Progress")) m2Choice = tonumber(GetCampaignVar("M2Choice")) m2DenseDead = tonumber(GetCampaignVar("M2DenseDead")) m2RamonDead = tonumber(GetCampaignVar("M2RamonDead")) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua Thu Jun 13 22:27:23 2013 +0200 @@ -575,6 +575,7 @@ end function GetVariables() + progress = tonumber(GetCampaignVar("Progress")) m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) m2Choice = tonumber(GetCampaignVar("M2Choice")) m5Choice = tonumber(GetCampaignVar("M5Choice")) @@ -606,7 +607,9 @@ SaveCampaignVar("M8PrincessLeader", princessLeader) SaveCampaignVar("M8EnemyFled", enemyFled) SaveCampaignVar("M8Scene", "" .. scene) - SaveCampaignVar("Progress", "8") + if progress and progress<8 then + SaveCampaignVar("Progress", "8") + end end function SetupPlace() diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.hwp Binary file share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.hwp has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua Thu Jun 13 22:27:23 2013 +0200 @@ -761,7 +761,9 @@ SaveCampaignVar("M2RamonDead", "0") SaveCampaignVar("M2SpikyDead", "0") AddFunction({func = KillCyborg, args = {}}) - SaveCampaignVar("Progress", "2") + if progress and progress<2 then + SaveCampaignVar("Progress", "2") + end SaveCampaignVar("M2Choice", "" .. choice) end @@ -783,7 +785,9 @@ end AddAnim(refusedFinalAnim) AddFunction({func = KillCyborg, args = {}}) - SaveCampaignVar("Progress", "2") + if progress and progress<2 then + SaveCampaignVar("Progress", "2") + end SaveCampaignVar("M2Choice", "" .. choice) end @@ -791,7 +795,9 @@ SaveCampaignVar("M2DenseDead", "1") SaveCampaignVar("M2RamonDead", "0") SaveCampaignVar("M2SpikyDead", "0") - SaveCampaignVar("Progress", "2") + if progress and progress<2 then + SaveCampaignVar("Progress", "2") + end SaveCampaignVar("M2Choice", "" .. choice) AddAnim(attackedFinalAnim) AddFunction({func = KillCyborg, args = {}}) @@ -839,11 +845,9 @@ MinesTime = 3000 Explosives = 0 Delay = 10 - MapGen = 0 - TemplateFilter = 6 - TemplateNumber = 22 + Map = "A_Classic_Fairytale_shadow" Theme = "Nature" - SuddenDeathTurns = 3000 + SuddenDeathTurns = 3000 AddHogs() PlaceHogs() @@ -854,6 +858,7 @@ end function onGameStart() + progress = tonumber(GetCampaignVar("Progress")) HideHogs() AddAmmo(leaks, amSwitch, 100) AddAmmo(dense, amSwitch, 100) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua --- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua Thu Jun 13 22:27:23 2013 +0200 @@ -109,7 +109,9 @@ else SaveCampaignVar("M4DenseDead", "0") end - SaveCampaignVar("Progress", "4") + if progress and progress<4 then + SaveCampaignVar("Progress", "4") + end ParseCommand("teamgone " .. loc("011101001")) TurnTimeLeft = 0 end @@ -416,6 +418,7 @@ end function onGameStart() + progress = tonumber(GetCampaignVar("Progress")) GetVariables() SetupAmmo() SetupPlace() diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua --- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,11 +1,9 @@ HedgewarsScriptLoad("/Scripts/Locale.lua") - local player = nil -- This variable will point to the hog's gear local instructor = nil local enemy = nil ---local givenSpeech = false local speechStage = 0 @@ -33,22 +31,18 @@ AddTeam(loc("Bloody Rookies"), 14483456, "Simple", "Island", "Default") player = AddHog(loc("Hunter"), 0, 1, "NoHat") + instructor = AddHog(loc("Instructor"), 0, 100, "sf_vega") - --AddTeam("Instructors", 14483456, "Simple", "Island", "Default") - instructor = AddHog(loc("Instructor"), 1, 1, "sf_vega") - - AddTeam("Blue Team", 29439, "Simple", "Island", "Default") - enemy = AddHog("Filthy Blue", 1, 100, "Skull") + AddTeam(loc("Blue Team"), 29439, "Simple", "Island", "Default") + enemy = AddHog(loc("Filthy Blue"), 1, 100, "Skull") SetGearPosition(player,146,902) SetGearPosition(instructor,317,902) SetGearPosition(enemy,1918,837) - HogSay(player, ".............................", SAY_THINK) HogTurnLeft(instructor, true) - end @@ -59,15 +53,7 @@ FollowGear(player) - --spawnTarget() - - -- Show some nice mission goals. - -- Parameters are: caption, sub caption, description, - -- extra text, icon and time to show. - -- A negative icon parameter (-n) represents the n-th weapon icon - -- A positive icon paramter (n) represents the (n+1)-th mission icon - -- A timeframe of 0 is replaced with the default time to show. - ShowMission(loc("Dangerous Ducklings"), "", loc("Eliminate the Blue Team"), -amRope, 1); + ShowMission(loc("Dangerous Ducklings"), "", loc("Eliminate the Blue Team"), -amRope, 5000); end @@ -101,15 +87,14 @@ end - -- if player falls in water or if player ignores speech if (CurrentHedgehog ~= nil) and (CurrentHedgehog == player) then - if (GetY(player) > 2060) and (gameLost == false) then + if (GetY(player) > WaterLine) and (gameLost == false) then HogSay(instructor, loc("DAMMIT, ROOKIE!"), SAY_SHOUT) gameLost = true end - if (GetX(player) > 1324) and (GetY(player) > 1908) and (notListening == false) and (speechStage < 3) then + if (GetX(player) > 300) and (GetY(player) > 880) and (notListening == false) and (speechStage < 3) then HogSay(instructor, loc("DAMMIT, ROOKIE! GET OFF MY HEAD!"), SAY_SHOUT) notListening = true end @@ -126,10 +111,11 @@ endTimer = endTimer + 1 if (CurrentHedgehog ~= nil) and (CurrentHedgehog == instructor) then if endTimer >= 3000 then - SetHealth(instructor,0) - TurnTimeLeft = 0 + --SetHealth(instructor,0) + TurnTimeLeft = 1 + ParseCommand("teamgone " .. loc("Bloody Rookies")) end - ShowMission(loc("MISSION FAILED"), loc(":("), loc("You've failed. Try again."), -amRope, 1); + ShowMission(loc("MISSION FAILED"), loc(":("), loc("You've failed. Try again."), -amRope, 5000); end end @@ -146,9 +132,12 @@ if GetGearType(gear) == gtHedgehog then if gear == player then gameLost = true - elseif gear == instructor then + elseif (gear == instructor) and (GetY(gear) > WaterLine) then HogSay(player, loc("See ya!"), SAY_THINK) TurnTimeLeft = 3000 + AddCaption(loc("Achievement Unlocked") .. ": " .. loc("Naughty Ninja"),0xffba00ff,capgrpMessage2) + ParseCommand("teamgone " .. loc("Blue Team")) + gameWon = true elseif gear == enemy then HogSay(player, loc("Enjoy the swim..."), SAY_THINK) gameWon = true diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Training/User_Mission_-_Nobody_Laugh.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Nobody_Laugh.lua Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,130 @@ +-------------------------------------- +-- NOBODY LAUGH +-- a hilarious (not really) adventure +-------------------------------------- + +HedgewarsScriptLoad("/Scripts/Locale.lua") +HedgewarsScriptLoad("/Scripts/Tracker.lua") + +local hhs = {} + +function onGameInit() + + Seed = 0 + GameFlags = gfInfAttack + gfPerHogAmmo +gfDisableWind + SuddenDeathTurns = 9999 + TurnTime = 180000 + CaseFreq = 0 + MinesNum = 0 + Explosives = 0 + Map = "Bath" + Theme = "Nature" + + AddTeam(loc("Nameless Heroes"), 14483456, "eyecross", "Wood", "HillBilly", "cm_birdy") + hhs[1] = AddHog(loc( "Hunter" ), 0, 1, "Skull") + SetGearPosition(hhs[1], 1267, 451) + hhs[2] = AddHog(loc("Drowner"), 0, 31, "mp3") + SetGearPosition(hhs[2], 1332, 451) + + AddTeam(loc("Clowns"), 1175851, "Duck2", "Tank", "Mobster", "cm_spider") + hhs[3] = AddHog("Poison", 5, 100, "WhySoSerious") + SetGearPosition(hhs[3], 1133, 446) + hhs[4] = AddHog("Bobo", 5, 100, "clown") + SetGearPosition(hhs[4], 1215, 553) + hhs[5] = AddHog("Copper", 5, 10, "clown-copper") + SetGearPosition(hhs[5], 414, 376) + hhs[6] = AddHog("Derp", 5, 100, "clown-crossed") + SetGearPosition(hhs[6], 1590, 886) + hhs[7] = AddHog("Eckles", 5, 100, "clown-copper") + SetGearPosition(hhs[7], 772, 754) + hhs[8] = AddHog("Frank", 5, 50, "clown-copper") + SetGearPosition(hhs[8], 1688, 714) + hhs[9] = AddHog("Harry", 5, 50, "clown-copper") + SetGearPosition(hhs[9], 1932, 837) + hhs[10] = AddHog("Igmund", 5, 50, "WhySoSerious") + SetGearPosition(hhs[10], 1601, 733) + +end + +function onGameStart() + + AddAmmo(enemy, amAirAttack, 100) + + ShowMission( loc("Nobody Laugh"), + loc("User Challenge"), + loc("Eliminate the enemy before the time runs out") + , 0, 0 + ) + + -- GIRDERS + PlaceGirder(1212, 710, 7) + PlaceGirder(1215, 570, 4) + PlaceGirder(1288, 520, 2) + PlaceGirder(1184, 468, 4) + PlaceGirder(1344, 468, 4) + PlaceGirder(1247, 346, 4) + + PlaceGirder(667, 438, 4) + PlaceGirder(507, 438, 4) + PlaceGirder(434, 487, 2) + PlaceGirder(505, 537, 4) + PlaceGirder(665, 537, 4) + PlaceGirder(737, 487, 2) + + PlaceGirder(416, 465, 6) + PlaceGirder(1415, 378, 6) + PlaceGirder(1300, 625, 3) + PlaceGirder(1359, 566, 3) + PlaceGirder(1436, 538, 0) + PlaceGirder(1505, 468, 4) + + ------ AMMO CRATE LIST ------ + tempG = SpawnAmmoCrate(1242, 315, amBaseballBat) + tempG = SpawnAmmoCrate(1309, 315, amAirAttack) + tempG = SpawnAmmoCrate(144, 895, amAirAttack) + tempG = SpawnAmmoCrate(664, 699, amIceGun) + tempG = SpawnAmmoCrate(1572, 444, amFirePunch) + tempG = SpawnAmmoCrate(1574, 382, amDynamite) + + ------ UTIL CRATE LIST ------ + tempG = SpawnUtilityCrate(654, 513, amParachute) + tempG = SpawnUtilityCrate(1569, 413, amParachute) + + -- HOG AMMO + AddAmmo(hhs[1],amParachute,1) + AddAmmo(hhs[1],amHammer,1) + AddAmmo(hhs[2],amWhip,1) + + for i = 3, 10 do + AddAmmo(hhs[i], amDeagle, 100) + AddAmmo(hhs[i], amShotgun, 100) + AddAmmo(hhs[i], amGrenade, 100) + AddAmmo(hhs[i], amBazooka, 100) + AddAmmo(hhs[i], amDrill, 100) + end + +end + +function onNewTurn() + SetWind(100) +end + +function onAmmoStoreInit() + + SetAmmo(amBaseballBat, 0, 0, 0, 1) + SetAmmo(amAirAttack, 0, 0, 0, 1) + SetAmmo(amFirePunch, 0, 0, 0, 1) + SetAmmo(amDynamite, 0, 0, 0, 1) + SetAmmo(amHammer, 0, 0, 0, 1) + SetAmmo(amIceGun, 0, 0, 0, 1) + + SetAmmo(amParachute, 0, 0, 0, 1) + + SetAmmo(amSwitch, 9, 0, 0, 0) + SetAmmo(amSkip, 9, 0, 0, 0) + +end + +------------------------------ +-- I'm in whitesppaaaaaaaaaacceeeee :D +------------------------------ diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua --- a/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua Thu Jun 13 22:27:23 2013 +0200 @@ -20,7 +20,7 @@ Explosives = 0 AddTeam(loc("Wannabe Flyboys"), 14483456, "Simple", "Island", "Default", "Hedgewars") - player = AddHog(loc("Ace"), 0, 80, "Gasmask") --NoHat + player = AddHog(loc("Ace"), 0, 80, "Gasmask") SetGearPosition(player, 1380, 1500) end @@ -314,6 +314,10 @@ if cratesLeft == 0 then + if planesUsed == 1 then + AddCaption(loc("Achievement Unlocked") .. ": " .. loc("Prestigious Pilot"),0xffba00ff,capgrpMessage2) + end + ShowMission ( loc("CHALLENGE COMPLETE"), loc("Congratulations!"), diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Locale.lua --- a/share/hedgewars/Data/Scripts/Locale.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Scripts/Locale.lua Thu Jun 13 22:27:23 2013 +0200 @@ -2,17 +2,8 @@ local lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua") -if lang ~= nil then - lang() -else - lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua") - if lang ~= nil then - lang() - end -end - function loc(text) - if lang ~= nil and locale ~= nil and locale[text] ~= nil then return locale[text] + if locale ~= nil and locale[text] ~= nil then return locale[text] else return text end end diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/Frenzy.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Frenzy.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Default +locked diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/Frenzy.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Frenzy.lua Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,142 @@ +------------------------------------------- +-- FRENZY +-- a hedgewars mode inspired by Hysteria +------------------------------------------- + +HedgewarsScriptLoad("/Scripts/Locale.lua") +HedgewarsScriptLoad("/Scripts/Tracker.lua") + +local cTimer = 0 +local cn = 0 + +function initialSetup(gear) + SetHealth(gear, 75) -- official is 80, but that assumes bazookas/grenades that do 50 damage +end + +function showStartingInfo() + + ruleSet = "" .. + loc("RULES") .. ": " .. "|" .. + loc("Each turn is only ONE SECOND!") .. "|" .. + loc("Use your ready time to think.") .. "|" .. + loc("Slot keys save time! (F1-F10 by default)") .. "|" .. + " |" .. + loc("SLOTS") .. ": " .. "|" .. + loc("Slot") .. " 1 - " .. loc("Bazooka") .. "|" .. + loc("Slot") .. " 2 - " .. loc("Grenade") .. "|" .. + loc("Slot") .. " 3 - " .. loc("Shotgun") .. "|" .. + loc("Slot") .. " 4 - " .. loc("Shoryuken") .. "|" .. + loc("Slot") .. " 5 - " .. loc("Mine") .. "|" .. + loc("Slot") .. " 6 - " .. loc("Teleport") .. "|" .. + loc("Slot") .. " 7 - " .. loc("Blowtorch") .. "|" .. + loc("Slot") .. " 8 - " .. loc("Flying Saucer") .. "|" .. + loc("Slot") .. " 9 - " .. loc("Molotov") .. "|" .. + loc("Slot") .. " 10 - " .. loc("Low Gravity") + + ShowMission(loc("FRENZY"), + loc("a frenetic Hedgewars mini-game"), + ruleSet, 0, 4000) + +end + +function onGameInit() + + if TurnTime > 10001 then + Ready = 8000 + else + Ready = TurnTime + end + + TurnTime = 1000 + + --These are the official settings, but I think I prefer allowing customization in this regard + --MinesNum = 8 + --MinesTime = 3000 + --MinesDudPercent = 30 + --Explosives = 0 + + --Supposedly official settings + HealthCaseProb = 0 + CrateFreq = 0 + + --Approximation of Official Settings + --SuddenDeathTurns = 10 + --WaterRise = 47 + --HealthDecrease = 0 + +end + +function onGameStart() + showStartingInfo() + runOnHogs(initialSetup) +end + +function onSlot(sln) + cTimer = 8 + cn = sln +end + +function onGameTick() + if cTimer ~= 0 then + cTimer = cTimer -1 + if cTimer == 1 then + ChangeWep(cn) + cn = 0 + cTimer = 0 + end + end +end + +function ChangeWep(s) + + if s == 0 then + ParseCommand("setweap " .. string.char(amBazooka)) + elseif s == 1 then + ParseCommand("setweap " .. string.char(amGrenade)) + elseif s == 2 then + ParseCommand("setweap " .. string.char(amShotgun)) + elseif s == 3 then + ParseCommand("setweap " .. string.char(amFirePunch)) + elseif s == 4 then + ParseCommand("setweap " .. string.char(amMine)) + elseif s == 5 then + ParseCommand("setweap " .. string.char(amTeleport)) + elseif s == 6 then + ParseCommand("setweap " .. string.char(amBlowTorch)) + elseif s == 7 then + ParseCommand("setweap " .. string.char(amJetpack)) + elseif s == 8 then + ParseCommand("setweap " .. string.char(amMolotov)) + elseif s == 9 then + ParseCommand("setweap " .. string.char(amLowGravity)) + end + +end + +function onGearAdd(gear) + if GetGearType(gear) == gtHedgehog then + trackGear(gear) + end +end + +function onGearDelete(gear) + if GetGearType(gear) == gtHedgehog then + trackDeletion(gear) + end +end + +function onAmmoStoreInit() + SetAmmo(amBazooka, 9, 0, 0, 0) + SetAmmo(amGrenade, 9, 0, 0, 0) + SetAmmo(amMolotov, 9, 0, 0, 0) + SetAmmo(amShotgun, 9, 0, 0, 0) + --SetAmmo(amFlamethrower, 9, 0, 0, 0) -- this was suggested on hw.org but it's not present on base + SetAmmo(amFirePunch, 9, 0, 0, 0) + SetAmmo(amMine, 9, 0, 0, 0) + --SetAmmo(amCake, 1, 0, 2, 0) -- maybe it's beefcake? + SetAmmo(amJetpack, 9, 0, 0, 0) + SetAmmo(amBlowTorch, 9, 0, 0, 0) + SetAmmo(amTeleport, 9, 0, 0, 0) + SetAmmo(amLowGravity, 9, 0, 0, 0) + --SetAmmo(amSkipGo, 9, 0, 0, 0) -- not needed with 1s turn time +end diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,6 +1,6 @@ -------------------------------- -- HIGHLANDER / HOGS OF WAR --- version 0.4 +-- version 0.4b -- by mikade -------------------------------- @@ -63,10 +63,15 @@ -- add more whitespace -- break everything +----------- +--0.4b +----------- +-- as per request, add ice-gun + ------------------------- -- ideas for the future ------------------------- --- add ice gun, structure +-- add structure -- allow switcher, resurrector -- add abuse -- nerf teleport @@ -90,7 +95,7 @@ local atkArray = { amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]] amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb, - amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun, + amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun, amIceGun, amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]] amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine, amRCPlane, amSMine, diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,625 +1,615 @@ -local MUTANT_VERSION = "v0.9.4" - ---[[ ___ ___ - ( ) ( ) -___ .-. .-. ___ ___ | |_ .---. ___ .-. | |_ -( ) ' ( )( ( __) / .-, ( ) ( __) -| .-. .-. | | | | | | (__) ; || .-. .| | -| | | | | | | | | | | ___ .'` || | | || | ___ -| | | | | | | | | | |( / .'| || | | || |( ) -| | | | | | | | | | | | | / | || | | || | | | -| | | | | | | ; ' | ' | ; | ; || | | || ' | | -| | | | | ' `-' / ' `-' ' `-' || | | |' `-' ; -(___)(___)(___'.__.' `.__.`.__.'_(___)(___)`.__. - - ----- IMPORTANT! ----- ----- You should save (press Ctrl+S) this script to: ----- Program Files\Hedgewars\share\hedgewars\Data\Scripts\Multiplayer\Mutant.lua ----- or (on Linux): ----- ~/.hedgewars/Data/Scripts/Multiplayer/Mutant.lua ----- ----- (or wherever scripts like Highlander.lua, Racer.lua are on your system) ----- ----- Also, if you didn't have Mutant script yet, you need to restart Hedgewars for it to find the script file. ----- - - ----- GAME RULES ----- ----- Recommended settings: ----- * one hedgehog per team ----- * 'Small' one-island map ----- ----- First one to kill anyone becomes Mutant. Mutant has super-weapons ----- and a lot of health, which however depletes if he doesn't frag fast. ----- Goal of Mutant is to use his weapons to hold his status for as long ----- as he can. ----- Goal of others is to hunt the Mutant down. The one who kills Mutant, ----- becomes Mutant himself. ----- The player with least points (or most deaths) is Bottom Feeder. He ----- can gain points by killing anyone. Other normal players only get points ----- for killing Mutant. ----- ----- Points: ----- +2 for becoming a Mutant ----- +1 to a Mutant for killing anyone ----- +1 to a Bottom Feeder for killing anyone ----- -1 to anyone for a suicide ----- other kills don't give you points. ----- - ---]] - -HedgewarsScriptLoad("/Scripts/Locale.lua") -HedgewarsScriptLoad("/Scripts/Tracker.lua") - ---[[ - MUTANT SCRIPT - - To Do: -Clean-up this fucking piece of code - -Debug - -Find a girlfriend - -Fix Sheepluva's hat +[p] - -Cookies - ------------------------]] - -local hhs = {} -local numhhs = 0 - -local gameOver=false - -local mutant = nil -local mutant_base_health = 200 -local mutant_base_disease = 25 -local disease_timer = 2000 - -local kill_reward = nil -local mt_hurt=false - -local killsCounter = 0 - -local team_fire_punishment = 3 -local mutant_kill_reward = 2 - -local hh_weapons = { amBazooka, amGrenade, amShotgun, amMine} - -local mt_weapons = {amWatermelon, amHellishBomb, amBallgun, amRCPlane, amTeleport} - -local disease=0 -local timer=0 - -local winScore = 15 -local hogsLimit = 1 - -local teams = {} - -local circles = {} -local circleFrame = -1 - -function onGameInit() - TurnTime = 20000 - WaterRise = 0 - GameFlags = GameFlags + gfResetWeps + gfPerHogAmmo - HealthCaseProb=0 - HealthCaseAmount=0 - MinesTime=1000 - CaseFreq = 2 - -end - - -function limitHogs(gear) - cnthhs = cnthhs + 1 - if cnthhs > 1 then - hogLimitHit = true - SetEffect(gear, heResurrectable, false) - --SetHealth(gear, 0) - SetGearPosition(gear, -100,LAND_HEIGHT) - end -end - -function onGameStart() - trackTeams() - teamScan() - runOnHogs(saveStuff) - --local str = "/say " .. MUTANT_VERSION - --ParseCommand(str) - - hogLimitHit = false - for i=0 , TeamsCount - 1 do - cnthhs = 0 - runOnHogsInTeam(limitHogs, teams[i]) - end - if hogLimitHit then - AddCaption(loc("ONE HOG PER TEAM! KILLING EXCESS HEDGES")) - end -end - - - -function giveWeapons(gear) - - if gear == mutant then - AddAmmo(gear, amRope) - for i=1, #mt_weapons do - AddAmmo(gear, mt_weapons[i]) - end - - else - for i=1, #hh_weapons do - AddAmmo(gear,hh_weapons[i]) - end - end -end - -function onAmmoStoreInit() - - SetAmmo(amSkip, 9, 0, 0, 0) - SetAmmo(amRope,0,1,0,5) - SetAmmo(amSnowball,0,1,0,1) - - for i=1, #hh_weapons do - SetAmmo(hh_weapons[i], 0, 0, 0, 1) - end - - for i=1, #mt_weapons do - SetAmmo(mt_weapons[i], 0, 3, 0, 1) - end - -end - -function drawCircles() - for i = 0, #hhs do - if circles[hhs[i]] ~= nil then - DeleteVisualGear(circles[hhs[i]]) - circles[hhs[i]] = nil - end - - if hhs[i] ~= CurrentHedgehog then - if mutant == nil then - circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) - SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080) - elseif CurrentHedgehog == mutant then - circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) - SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070) - elseif getGearValue(CurrentHedgehog, "Feeder") and hhs[i] ~= mutant then - circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) - SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070) - elseif hhs[i] == mutant then - circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) - SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080) - end - end - end - circleFrame = 0 -end - -function onNewTurn() - - trackTeams() - killsCounter = 0 - - if mutant == nil then - AddCaption( loc("FIRST BLOOD MUTATES") ) - end - - checkScore() - giveWeapons(CurrentHedgehog) - drawCircles() - setAIHints() - kill_reward= numhhs*10 - - if CurrentHedgehog == mutant then - mt_hurt=true - disease= mutant_base_disease - numhhs - else - mt_hurt=false - end - - setGearValue(CurrentHedgehog, "Alive", true) - -end - -function countBodies() - if killsCounter == 2 then - AddCaption(loc("DOUBLE KILL")) - elseif killsCounter == 3 then - AddCaption(loc("MEGA KILL")) - PlaySound(sndRegret) - elseif killsCounter == 4 then - AddCaption(loc("ULTRA KILL")) - elseif killsCounter == 5 then - AddCaption(loc("MONSTER KILL")) - PlaySound(sndIllGetYou) - elseif killsCounter == 6 then - AddCaption(loc("LUDICROUS KILL")) - PlaySound(sndNutter) - elseif killsCounter == 7 then - AddCaption(loc("HOLY SHYTE!")) - PlaySound(sndLaugh) - elseif killsCounter > 8 then - AddCaption(loc("INSANITY")) - end - -end - -function onGameTick() - - if circleFrame > -1 then - for i = 0, #hhs do - if circles[hhs[i]] ~= nil and hhs[i]~= nil then - hhx, hhy = GetGearPosition(hhs[i]) - X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(circles[hhs[i]]) - SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25), Timer, Tint) - end - end - - circleFrame = circleFrame + 0.06 - - if circleFrame >= 25 then - for i = 0, #hhs do - if circles[hhs[i]] ~= nil then - DeleteVisualGear(circles[hhs[i]]) - circles[hhs[i]] = nil - end - end - end - end - - if TurnTimeLeft==0 and mt_hurt then - mt_hurt = false - end - - if mt_hurt and mutant~=nil then - timer = timer + 1 - if timer > disease_timer then - timer = 0 - SetHealth(mutant, GetHealth(mutant)-disease ) - AddVisualGear(GetX(mutant), GetY(mutant)-5, vgtHealthTag, disease, true) - if GetHealth(mutant)<=0 then - SetHealth(mutant,0) - mt_hurt= false - setGearValue(mutant,"SelfDestruct",true) - TurnTimeLeft = 0 - end - end - end -end - -function saveStuff(gear) - setGearValue(gear,"Name",GetHogName(gear)) - setGearValue(gear,"Hat",GetHogHat(gear)) -end - -function armageddon(gear) - SetState(gear, gstLoser) - SetEffect(gear, heResurrectable, false) - SetHealth(gear, 0) -end - -function updateScore() -local showScore = "" - - for i=0, TeamsCount-1 do - if teams[i]~= nil then - - local curr_score = getTeamValue(teams[i], "Score") - showScore = showScore .. teams[i] .. ": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|" - - end - end - - ShowMission(loc("Score"), - "-------", - showScore, 0, 200) - - HideMission() - -end - -function checkScore() -local showScore = "" -local lowest_score_team = nil -local min_score=nil -local winTeam = nil - -local only_low_score = true - - for i=0, TeamsCount-1 do - if teams[i]~=nil then - local curr_score = getTeamValue(teams[i], "Score") - - runOnHogsInTeam(removeFeeder, teams[i]) - - showScore = showScore .. teams[i] ..": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|" - - if curr_score >= winScore then - gameOver = true - winTeam = teams[i] - end - - if min_score==nil then - min_score= curr_score - lowest_score_team = teams[i] - else - if curr_score <= min_score then - if curr_score == min_score then - if getTeamValue(teams[i], "DeadHogs") == getTeamValue(lowest_score_team, "DeadHogs") then - only_low_score = false - else - if getTeamValue(teams[i], "DeadHogs") > getTeamValue(lowest_score_team, "DeadHogs") then - lowest_score_team = teams[i] - end - only_low_score = true - end - - else - min_score= curr_score - lowest_score_team = teams[i] - only_low_score = true - end - end - end - end - end - - if gameOver then - TurnTimeLeft = 0 - for i=0, #teams do - if teams[i]~=winTeam then - runOnHogsInTeam(armageddon, teams[i]) - end - end - - ShowMission( loc("WINNER IS ") .. winTeam, - "~~~~~~~~~~~~~~~~~~~~~~~~~", - showScore, 0, 200) - else - - if only_low_score then - runOnHogsInTeam(setFeeder, lowest_score_team) - end - - ShowMission( loc("Score"), - loc("-------"), - showScore, 0, 200) - - end -end - -function backToNormal(gear) - - SetHogName(gear, getGearValue(gear,"Name")) - SetHogHat(gear, 'NoHat') - SetHogHat(gear, getGearValue(gear,"Hat")) - setGearValue(mutant,"SelfDestruct",false) - mt_hurt=false - mutant=nil -end - -function setAIHints() - for i = 0, #hhs do - if mutant == nil or hhs[i] == mutant or CurrentHedgehog == mutant then - SetGearAIHints(hhs[i], aihUsual) - else - SetGearAIHints(hhs[i], aihDoesntMatter) - end - end -end - -function removeFeeder(gear) - - if gear~=nil then - setGearValue(gear,"Feeder",false) - if gear~= mutant then - SetHogName(gear, getGearValue(gear,"Name") ) - SetHogHat(gear, 'NoHat') - SetHogHat(gear, getGearValue(gear,"Hat")) - end - end -end - -function setFeeder(gear) - - if gear~= mutant and gear~= nil then - SetHogName(gear,"BOTTOM FEEDER") - SetHogHat(gear, 'poke_slowpoke') - setGearValue(gear,"Feeder", true) - end -end - -function setMutantStuff(gear) - mutant = gear - - SetHogName(gear,"MUTANT") - SetHogHat(gear,'WhySoSerious') - SetHealth(gear, ( mutant_base_health + numhhs*25) ) - SetEffect(gear, hePoisoned, 1) - setGearValue(mutant,"SelfDestruct",false) - setGearValue(gear, "Feeder", false) - - AddCaption(getGearValue(gear, "Name") .. loc(" HAS MUTATED")) - - TurnTimeLeft=0 - - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - PlaySound(sndSuddenDeath) -end - -function teamScan() - - for i=0, TeamsCount-1 do --nil filling - teams[i]=nil - end - - for i=0, #hhs do - for j=0, TeamsCount-1 do - if teams[j] ==nil and hhs[i]~=nil then - teams[j] = GetHogTeamName(hhs[i]) - setTeamValue(teams[j],"Score",0) - setTeamValue(teams[j], "DeadHogs",0) - break - end - - if teams[j] == GetHogTeamName(hhs[i]) then - break - end - end - end - - ---***--- -end - - -function onGearDamage(gear, dmg) - -end - -function set_Mutant_and_Score(gear) - -local curr_team = GetHogTeamName(CurrentHedgehog) - - if gear == CurrentHedgehog then - if CurrentHedgehog == mutant then - PlaySound(sndHomerun) - if getGearValue(gear, "SelfDestruct")==false then - decreaseTeamValue(curr_team,"Score") - end - backToNormal(gear) - else - decreaseTeamValue(curr_team,"Score") - end - - else - if gear == mutant then - backToNormal(mutant) - if curr_team ~=GetHogTeamName(gear) then - if getGearValue(CurrentHedgehog, "Alive") then - setMutantStuff(CurrentHedgehog) - setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward)) - end - else - setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) - end - else - if mutant==nil then - if curr_team ~=GetHogTeamName(gear) then - if getGearValue(CurrentHedgehog, "Alive") then - setMutantStuff(CurrentHedgehog) - setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward)) - else - increaseTeamValue(curr_team,"Score") - end - else - setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) - end - else - if curr_team ~=GetHogTeamName(gear) then - if CurrentHedgehog==mutant and getGearValue(mutant,"SelfDestruct")==false then - SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+kill_reward) - AddCaption("+" .. kill_reward .. loc(" HP") ) - increaseTeamValue(curr_team,"Score") - end - if getGearValue(CurrentHedgehog,"Feeder") then - increaseTeamValue(curr_team,"Score") - end - else - setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) - end - end - end - end -end - -function onGearResurrect(gear) -if not gameOver then - if GetGearType(gear) == gtHedgehog then - - increaseTeamValue(GetHogTeamName(gear), "DeadHogs") - - if gear==CurrentHedgehog then - setGearValue(CurrentHedgehog, "Alive", false) - end - set_Mutant_and_Score(gear) - if gear~=CurrentHedgehog then - killsCounter = killsCounter + 1 - countBodies() - end - AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) - PlaySound(sndWhack) - updateScore() - end -end -end - -function onGearAdd(gear) - - -- Catch hedgehogs for the tracker - if GetGearType(gear) == gtHedgehog then - trackGear(gear) - hhs[numhhs] = gear - numhhs = numhhs + 1 - SetEffect(gear, heResurrectable, 1) - end -end - -function checkEmptyTeam (teamName) - for i=0 , #hhs do - if hhs[i]~=nil then - if teamName == GetHogTeamName(hhs[i]) then - return false - end - end - end - return true -end - -function onGearDelete(gear) - -- Remove hogs that are gone - if GetGearType(gear) == gtHedgehog then - numhhs = numhhs - 1 - - local found - for i=0, #hhs do - if hhs[i] == gear then - found = i - break - end - end - for i = found, #hhs - 1 do - hhs[i] = hhs[i + 1] - end - hhs[#hhs] = nil - - local t_name = GetHogTeamName(gear) - if checkEmptyTeam(t_name) then - for i = 0, TeamsCount - 1 do - if teams[i] == t_name then - found = i - break - end - end - for i = found, TeamsCount - 2 do - teams[i] = teams[i + 1] - end - teams[TeamsCount - 1] = nil - TeamsCount = TeamsCount - 1 - end - AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) - trackDeletion(gear) - end -end - ---[[ -S T A R R I N G - - prof - Coding, implementing and evangelism - vos - Initial idea and script improvements ---]] +local MUTANT_VERSION = "v0.9.5" + +--[[ ___ ___ + ( ) ( ) +___ .-. .-. ___ ___ | |_ .---. ___ .-. | |_ +( ) ' ( )( ( __) / .-, ( ) ( __) +| .-. .-. | | | | | | (__) ; || .-. .| | +| | | | | | | | | | | ___ .'` || | | || | ___ +| | | | | | | | | | |( / .'| || | | || |( ) +| | | | | | | | | | | | | / | || | | || | | | +| | | | | | | ; ' | ' | ; | ; || | | || ' | | +| | | | | ' `-' / ' `-' ' `-' || | | |' `-' ; +(___)(___)(___'.__.' `.__.`.__.'_(___)(___)`.__. + + +---- Recommended settings: +---- * one hedgehog per team +---- * 'Small' one-island map + +--]] + +HedgewarsScriptLoad("/Scripts/Locale.lua") +HedgewarsScriptLoad("/Scripts/Tracker.lua") + +--[[ + MUTANT SCRIPT + + To Do: -Clean-up this fucking piece of code + -Debug + -Find a girlfriend + -Fix Sheepluva's hat +[p] + -Cookies +-----------------------]] + +local hhs = {} +local numhhs = 0 +local meh = false + +local gameOver=false + +local mutant = nil +local mutant_base_health = 200 +local mutant_base_disease = 25 +local disease_timer = 2000 + +local kill_reward = nil +local mt_hurt=false + +local killsCounter = 0 + +local team_fire_punishment = 3 +local mutant_kill_reward = 2 + +local hh_weapons = { amBazooka, amGrenade, amShotgun, amMine} + +local mt_weapons = {amWatermelon, amHellishBomb, amBallgun, amRCPlane, amTeleport} + +local disease=0 +local timer=0 + +local winScore = 15 +local hogsLimit = 1 + +local teams = {} + +local circles = {} +local circleFrame = -1 + +function showStartingInfo() + + ruleSet = loc("RULES") .. ": " .. + " |" .. --" |" .. + loc("The first player to kill someone becomes the Mutant.") .. "|" .. + loc("The Mutant has super-weapons and a lot of health.") .. "|" .. + loc("The Mutant loses health quickly if he doesn't keep scoring kills.") .. "|" .. + " |" .. + loc("Normal players can only score points by killing the mutant.") .. "|" .. + " |" .. "" .. + loc("The player with least points (or most deaths) becomes the Bottom Feeder.") .. "|" .. + loc("The Bottom Feeder can score points by killing anyone.") .. "|" .. + " |" .. + loc("POINTS") .. ": " .. + " |" .. + loc("+2 for becoming a Mutant") .. "|" .. + loc("+1 to a Mutant for killing anyone") .. "|" .. + loc("+1 to a Bottom Feeder for killing anyone") .. "|" .. + loc("-1 to anyone for a suicide") .. "|" .. + loc("Other kills don't give you points.") + + ShowMission(loc("Mutant"), + loc("a Hedgewars tag game"), + ruleSet, 0, 5000) + +end + +function onGameInit() + TurnTime = 20000 + WaterRise = 0 + GameFlags = GameFlags + gfResetWeps + gfPerHogAmmo + HealthCaseProb=0 + HealthCaseAmount=0 + MinesTime=1000 + CaseFreq = 2 +end + + +function limitHogs(gear) + cnthhs = cnthhs + 1 + if cnthhs > 1 then + hogLimitHit = true + SetEffect(gear, heResurrectable, false) + --SetHealth(gear, 0) + SetGearPosition(gear, -100,LAND_HEIGHT) + end +end + +function onGameStart() + trackTeams() + teamScan() + runOnHogs(saveStuff) + --local str = "/say " .. MUTANT_VERSION + --ParseCommand(str) + + hogLimitHit = false + for i=0 , TeamsCount - 1 do + cnthhs = 0 + runOnHogsInTeam(limitHogs, teams[i]) + end + if hogLimitHit then + AddCaption(loc("ONE HOG PER TEAM! KILLING EXCESS HEDGES")) + end + showStartingInfo() +end + + + +function giveWeapons(gear) + if gear == mutant then + AddAmmo(gear, amRope) + for i=1, #mt_weapons do + AddAmmo(gear, mt_weapons[i]) + end + + else + for i=1, #hh_weapons do + AddAmmo(gear,hh_weapons[i]) + end + end +end + +function onAmmoStoreInit() + + SetAmmo(amSkip, 9, 0, 0, 0) + SetAmmo(amRope,0,1,0,5) + SetAmmo(amSnowball,0,1,0,1) + + for i=1, #hh_weapons do + SetAmmo(hh_weapons[i], 0, 0, 0, 1) + end + + for i=1, #mt_weapons do + SetAmmo(mt_weapons[i], 0, 3, 0, 1) + end + +end + +function drawCircles() + for i = 0, #hhs do + if circles[hhs[i]] ~= nil then + DeleteVisualGear(circles[hhs[i]]) + circles[hhs[i]] = nil + end + + if hhs[i] ~= CurrentHedgehog then + if mutant == nil then + circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) + SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080) + elseif CurrentHedgehog == mutant then + circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) + SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070) + elseif getGearValue(CurrentHedgehog, "Feeder") and hhs[i] ~= mutant then + circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) + SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070) + elseif hhs[i] == mutant then + circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false) + SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080) + end + end + end + circleFrame = 0 +end + +function onNewTurn() + + trackTeams() + killsCounter = 0 + + if mutant == nil then + AddCaption( loc("FIRST BLOOD MUTATES") ) + end + + checkScore() + giveWeapons(CurrentHedgehog) + drawCircles() + setAIHints() + kill_reward= numhhs*10 + + if CurrentHedgehog == mutant then + mt_hurt=true + disease= mutant_base_disease - numhhs + else + mt_hurt=false + end + + setGearValue(CurrentHedgehog, "Alive", true) + +end + +function countBodies() + if killsCounter == 2 then + AddCaption(loc("DOUBLE KILL")) + elseif killsCounter == 3 then + AddCaption(loc("MEGA KILL")) + PlaySound(sndRegret) + elseif killsCounter == 4 then + AddCaption(loc("ULTRA KILL")) + elseif killsCounter == 5 then + AddCaption(loc("MONSTER KILL")) + PlaySound(sndIllGetYou) + elseif killsCounter == 6 then + AddCaption(loc("LUDICROUS KILL")) + PlaySound(sndNutter) + elseif killsCounter == 7 then + AddCaption(loc("HOLY SHYTE!")) + PlaySound(sndLaugh) + elseif killsCounter > 8 then + AddCaption(loc("INSANITY")) + end +end + +function onGameTick() + + if circleFrame > -1 then + for i = 0, #hhs do + if circles[hhs[i]] ~= nil and hhs[i]~= nil then + hhx, hhy = GetGearPosition(hhs[i]) + X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(circles[hhs[i]]) + SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25), Timer, Tint) + end + end + + circleFrame = circleFrame + 0.06 + + if circleFrame >= 25 then + for i = 0, #hhs do + if circles[hhs[i]] ~= nil then + DeleteVisualGear(circles[hhs[i]]) + circles[hhs[i]] = nil + end + end + end + end + + if TurnTimeLeft==0 and mt_hurt then + mt_hurt = false + end + + if mt_hurt and mutant~=nil then + timer = timer + 1 + if timer > disease_timer then + timer = 0 + SetHealth(mutant, GetHealth(mutant)-disease ) + AddVisualGear(GetX(mutant), GetY(mutant)-5, vgtHealthTag, disease, true) + if GetHealth(mutant)<=0 then + SetHealth(mutant,0) + mt_hurt= false + setGearValue(mutant,"SelfDestruct",true) + TurnTimeLeft = 0 + end + end + end + +end + +function saveStuff(gear) + setGearValue(gear,"Name",GetHogName(gear)) + setGearValue(gear,"Hat",GetHogHat(gear)) +end + +function armageddon(gear) + SetState(gear, gstLoser) + SetEffect(gear, heResurrectable, false) + SetHealth(gear, 0) +end + +function updateScore() + + local showScore = "" + + for i=0, TeamsCount-1 do + if teams[i]~= nil then + + local curr_score = getTeamValue(teams[i], "Score") + showScore = showScore .. teams[i] .. ": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|" + + end + end + + ShowMission(loc("Score"), + "-------", + showScore, 0, 200) + + HideMission() + +end + +function checkScore() +local showScore = "" +local lowest_score_team = nil +local min_score=nil +local winTeam = nil + +local only_low_score = true + + for i=0, TeamsCount-1 do + if teams[i]~=nil then + local curr_score = getTeamValue(teams[i], "Score") + + runOnHogsInTeam(removeFeeder, teams[i]) + + showScore = showScore .. teams[i] ..": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|" + + if curr_score >= winScore then + gameOver = true + winTeam = teams[i] + end + + if min_score==nil then + min_score= curr_score + lowest_score_team = teams[i] + else + if curr_score <= min_score then + if curr_score == min_score then + if getTeamValue(teams[i], "DeadHogs") == getTeamValue(lowest_score_team, "DeadHogs") then + only_low_score = false + else + if getTeamValue(teams[i], "DeadHogs") > getTeamValue(lowest_score_team, "DeadHogs") then + lowest_score_team = teams[i] + end + only_low_score = true + end + + else + min_score= curr_score + lowest_score_team = teams[i] + only_low_score = true + end + end + end + end + end + + if gameOver then + TurnTimeLeft = 0 + for i=0, #teams do + if teams[i]~=winTeam then + runOnHogsInTeam(armageddon, teams[i]) + end + end + + ShowMission( loc("WINNER IS ") .. winTeam, + "~~~~~~~~~~~~~~~~~~~~~~~~~", + showScore, 0, 200) + else + + if only_low_score then + runOnHogsInTeam(setFeeder, lowest_score_team) + end + + if meh == false then + meh = true + else + ShowMission( loc("Score"), + loc("-------"), + showScore, 0, 200) + end + + end +end + +function backToNormal(gear) + SetHogName(gear, getGearValue(gear,"Name")) + SetHogHat(gear, 'NoHat') + SetHogHat(gear, getGearValue(gear,"Hat")) + setGearValue(mutant,"SelfDestruct",false) + mt_hurt=false + mutant=nil +end + +function setAIHints() + for i = 0, #hhs do + if mutant == nil or hhs[i] == mutant or CurrentHedgehog == mutant then + SetGearAIHints(hhs[i], aihUsual) + else + SetGearAIHints(hhs[i], aihDoesntMatter) + end + end +end + +function removeFeeder(gear) + if gear~=nil then + setGearValue(gear,"Feeder",false) + if gear~= mutant then + SetHogName(gear, getGearValue(gear,"Name") ) + SetHogHat(gear, 'NoHat') + SetHogHat(gear, getGearValue(gear,"Hat")) + end + end +end + +function setFeeder(gear) + if gear~= mutant and gear~= nil then + SetHogName(gear,"BOTTOM FEEDER") + SetHogHat(gear, 'poke_slowpoke') + setGearValue(gear,"Feeder", true) + end +end + +function setMutantStuff(gear) + mutant = gear + + SetHogName(gear,"MUTANT") + SetHogHat(gear,'WhySoSerious') + SetHealth(gear, ( mutant_base_health + numhhs*25) ) + SetEffect(gear, hePoisoned, 1) + setGearValue(mutant,"SelfDestruct",false) + setGearValue(gear, "Feeder", false) + + AddCaption(getGearValue(gear, "Name") .. loc(" HAS MUTATED")) + + TurnTimeLeft=0 + + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + PlaySound(sndSuddenDeath) +end + +function teamScan() + + for i=0, TeamsCount-1 do --nil filling + teams[i]=nil + end + + for i=0, #hhs do + for j=0, TeamsCount-1 do + if teams[j] ==nil and hhs[i]~=nil then + teams[j] = GetHogTeamName(hhs[i]) + setTeamValue(teams[j],"Score",0) + setTeamValue(teams[j], "DeadHogs",0) + break + end + + if teams[j] == GetHogTeamName(hhs[i]) then + break + end + end + end + + ---***--- +end + +function set_Mutant_and_Score(gear) + +local curr_team = GetHogTeamName(CurrentHedgehog) + + if gear == CurrentHedgehog then + if CurrentHedgehog == mutant then + PlaySound(sndHomerun) + if getGearValue(gear, "SelfDestruct")==false then + decreaseTeamValue(curr_team,"Score") + end + backToNormal(gear) + else + decreaseTeamValue(curr_team,"Score") + end + + else + if gear == mutant then + backToNormal(mutant) + if curr_team ~=GetHogTeamName(gear) then + if getGearValue(CurrentHedgehog, "Alive") then + setMutantStuff(CurrentHedgehog) + setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward)) + end + else + setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) + end + else + if mutant==nil then + if curr_team ~=GetHogTeamName(gear) then + if getGearValue(CurrentHedgehog, "Alive") then + setMutantStuff(CurrentHedgehog) + setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward)) + else + increaseTeamValue(curr_team,"Score") + end + else + setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) + end + else + if curr_team ~=GetHogTeamName(gear) then + if CurrentHedgehog==mutant and getGearValue(mutant,"SelfDestruct")==false then + SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+kill_reward) + AddCaption("+" .. kill_reward .. loc(" HP") ) + increaseTeamValue(curr_team,"Score") + end + if getGearValue(CurrentHedgehog,"Feeder") then + increaseTeamValue(curr_team,"Score") + end + else + setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment)) + end + end + end + end +end + +function onGearResurrect(gear) +if not gameOver then + if GetGearType(gear) == gtHedgehog then + + increaseTeamValue(GetHogTeamName(gear), "DeadHogs") + + if gear==CurrentHedgehog then + setGearValue(CurrentHedgehog, "Alive", false) + end + set_Mutant_and_Score(gear) + if gear~=CurrentHedgehog then + killsCounter = killsCounter + 1 + countBodies() + end + AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false) + PlaySound(sndWhack) + updateScore() + end +end +end + +function onGearAdd(gear) + + -- Catch hedgehogs for the tracker + if GetGearType(gear) == gtHedgehog then + trackGear(gear) + hhs[numhhs] = gear + numhhs = numhhs + 1 + SetEffect(gear, heResurrectable, 1) + end +end + +function checkEmptyTeam (teamName) + for i=0 , #hhs do + if hhs[i]~=nil then + if teamName == GetHogTeamName(hhs[i]) then + return false + end + end + end + return true +end + +function onGearDelete(gear) + -- Remove hogs that are gone + if GetGearType(gear) == gtHedgehog then + numhhs = numhhs - 1 + + local found + for i=0, #hhs do + if hhs[i] == gear then + found = i + break + end + end + for i = found, #hhs - 1 do + hhs[i] = hhs[i + 1] + end + hhs[#hhs] = nil + + local t_name = GetHogTeamName(gear) + if checkEmptyTeam(t_name) then + for i = 0, TeamsCount - 1 do + if teams[i] == t_name then + found = i + break + end + end + for i = found, TeamsCount - 2 do + teams[i] = teams[i + 1] + end + teams[TeamsCount - 1] = nil + TeamsCount = TeamsCount - 1 + end + AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) + trackDeletion(gear) + end +end + +--[[ +S T A R R I N G + prof - Coding, implementing and evangelism + vos - Initial idea and script improvements + mikade - Moving the `how to play` into the game so that people know `how to play`, and whitespace :D +--]] diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Thu Jun 13 22:27:23 2013 +0200 @@ -1,700 +1,706 @@ - ------------------------------------------- --- RACER 0.5 --- map-independant racing script --- by mikade ------------------------------------------ - ------------------------------------ ---0.1: took all the code from crazy racer and scrapped most of it ------------------------------------ - --- Removed tumbler system --- Removed extra adds like boosters etc --- Added experimental waypoint placement system --- More user feedback --- Reduced race complexity limit to 5 waypoints --- stop placement at complexity limit reached and end turn --- guys dont keep racing after dying --- invulnerable feasibility --- reverted time keeping method --- reduced feedback display time --- colour-coded addcaptions --- cleaned up code --- support for more players properly added --- tardis fix --- remove airstrikes - --- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn - --- update feedback - -------- --- 0.2 -------- - --- allow gameflags --- extend time to 90s --- remove other air-attack based weps --- turn off water rise for sd - -------- --- 0.3 -------- - --- prevent WP being placed in land --- prevent waypoints being placed outside border - -------- --- 0.4 -------- - --- update user feedback --- add more sounds - -------- --- 0.5 -------- - --- fix ghost disappearing if hog falls in water or somehow dies --- lengthen ghost tracking interval to improve performance on slower machines --- increase waypoint limit to 8 --- allow for persistent showmission information - ------------------------------ --- SCRIPT BEGINS ------------------------------ - -HedgewarsScriptLoad("/Scripts/Locale.lua") - ------------------- --- Got Variables? ------------------- - -local fMod = 1000000 -- 1 -local roundLimit = 3 -local roundNumber = 0 -local firstClan = 10 - -local fastX = {} -local fastY = {} -local fastCount = 0 -local fastIndex = 0 -local fastColour - -local currX = {} -local currY = {} -local currCount = 0 - --------------------------- --- hog and team tracking variales --------------------------- - -local numhhs = 0 -- store number of hedgehogs -local hhs = {} -- store hedgehog gears - -local numTeams -- store the number of teams in the game -local teamNameArr = {} -- store the list of teams -local teamClan = {} -local teamSize = {} -- store how many hogs per team -local teamIndex = {} -- at what point in the hhs{} does each team begin - -local teamComment = {} -local teamScore = {} - -------- --- racer vars --------- - -local cGear = nil - -local bestClan = nil -local bestTime = nil - -local gameBegun = false -local gameOver = false -local racerActive = false -local trackTime = 0 - -local wpCirc = {} -local wpX = {} -local wpY = {} -local wpCol = {} -local wpActive = {} -local wpRad = 450 --75 -local wpCount = 0 -local wpLimit = 8 - -local roundN -local lastRound -local RoundHasChanged - -------------------- --- general methods -------------------- - -function RebuildTeamInfo() - - - -- make a list of individual team names - for i = 0, (TeamsCount-1) do - teamNameArr[i] = " " -- = i - teamSize[i] = 0 - teamIndex[i] = 0 - teamScore[i] = 100000 - end - numTeams = 0 - - for i = 0, (numhhs-1) do - - z = 0 - unfinished = true - while(unfinished == true) do - - newTeam = true - tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name - - if tempHogTeamName == teamNameArr[z] then - newTeam = false - unfinished = false - end - - z = z + 1 - - if z == TeamsCount then - unfinished = false - if newTeam == true then - teamNameArr[numTeams] = tempHogTeamName - numTeams = numTeams + 1 - end - end - - end - - end - - -- find out how many hogs per team, and the index of the first hog in hhs - for i = 0, (numTeams-1) do - for z = 0, (numhhs-1) do - if GetHogTeamName(hhs[z]) == teamNameArr[i] then - teamClan[i] = GetHogClan(hhs[z]) - if teamSize[i] == 0 then - teamIndex[i] = z -- should give starting index - end - teamSize[i] = teamSize[i] + 1 - --add a pointer so this hog appears at i in hhs - end - end - - end - -end - - ------------------ --- RACER METHODS ------------------ - -function CheckWaypoints() - - trackFinished = true - - for i = 0, (wpCount-1) do - - g1X, g1Y = GetGearPosition(CurrentHedgehog) - g2X, g2Y = wpX[i], wpY[i] - - g1X = g1X - g2X - g1Y = g1Y - g2Y - dist = (g1X*g1X) + (g1Y*g1Y) - - --if i == 0 then - -- AddCaption(dist .. "/" .. (wpRad*wpRad) ) - --end - - NR = (48/100*wpRad)/2 - - if dist < (NR*NR) then - --if dist < (wpRad*wpRad) then - --AddCaption("howdy") - wpActive[i] = true - wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new --GetClanColor(1) - SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) - - wpRem = 0 - for k = 0, (wpCount-1) do - if wpActive[k] == false then - wpRem = wpRem + 1 - end - end - - AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo) - - end - - if wpActive[i] == false then - trackFinished = false - end - - end - - return(trackFinished) - -end - -function AdjustScores() - - if bestTime == nil then - bestTime = 100000 - bestClan = 10 - bestTimeComment = "N/A" - end - - newScore = false - - -- update this clan's time if the new track is better - for i = 0, (numTeams-1) do - if teamClan[i] == GetHogClan(CurrentHedgehog) then - if trackTime < teamScore[i] then - teamScore[i] = trackTime - newScore = true - else - newScore = false - end - end - end - - --bestTime = 100000 - --bestClan = 10 - - -- find the best time out of those so far - for i = 0, (numTeams-1) do - if teamScore[i] < bestTime then - bestTime = teamScore[i] - bestClan = teamClan[i] - end - end - - if bestTime ~= 100000 then - bestTimeComment = (bestTime/1000) ..loc("s") - end - - if newScore == true then - if trackTime == bestTime then -- best time of the race - ShowMission(loc("RACER"), - loc("TRACK COMPLETED"), - loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. - loc("WINNING TIME: ") .. bestTimeComment, 0, 4000) - PlaySound(sndHomerun) - else -- best time for the clan - ShowMission(loc("RACER"), - loc("TRACK COMPLETED"), - loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. - loc("WINNING TIME: ") .. bestTimeComment, 4, 4000) - end - else -- not any kind of new score - ShowMission(loc("RACER"), - loc("TRACK COMPLETED"), - loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" .. - loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000) - PlaySound(sndHellish) - end - - - -------- - --new - -------- - - if bestTime == trackTime then - --AddCaption("wooooooooooooooooooooooooooooo") - - fastColour = GetClanColor(GetHogClan(CurrentHedgehog)) - - for i = 0, (currCount-1) do - fastX[i] = currX[i] - fastY[i] = currY[i] - end - - fastCount = currCount - fastIndex = 0 - - --currCount = 0 -- is this needed? - - else - currCount = 0 - fastIndex = 0 - end - - -end - -function onNewRound() - - roundNumber = roundNumber + 1 - - totalComment = "" - for i = 0, (TeamsCount-1) do - if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] - teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") - totalComment = totalComment .. teamComment[i] - elseif teamNameArr[i] == " " then - teamComment[i] = "|" - end - end - - ShowMission( loc("RACER"), - loc("STATUS UPDATE"), - loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. - loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) - - -- end game if its at round limit - if roundNumber == roundLimit then - for i = 0, (numhhs-1) do - if GetHogClan(hhs[i]) ~= bestClan then - SetEffect(hhs[i], heResurrectable, 0) - SetHealth(hhs[i],0) - end - end - gameOver = true - TurnTimeLeft = 1 - end - -end - -function CheckForNewRound() - - ------------- - ------ new - ------------- - - --[[turnN = turnN + 1 - if gameBegun == false then - if turnN == 2 then - for i = 0, (numhhs-1) do - if hhs[i] ~= nil then - SetEffect(hhs[i], heResurrectable, 0) - SetHealth(hhs[i],0) - end - end - gameOver = true - TurnTimeLeft = 1 - end - else - - - end]] - - --[[if roundBegun == true then - - if RoundHasChanged == true then - roundN = roundN + 1 - RoundHasChanged = false - onNewRound() - end - - if lastRound ~= TotalRounds then -- new round, but not really - - if RoundHasChanged == false then - RoundHasChanged = true - end - - end - - AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) - - lastRound = TotalRounds - - end]] - - ------------ - ----- old - ------------ - - if GetHogClan(CurrentHedgehog) == firstClan then - onNewRound() - end - -end - -function DisableTumbler() - currCount = 0 - fastIndex = 0 - TurnTimeLeft = 0 - racerActive = false -- newadd -end - -function HandleGhost() - - -- get the current xy of the racer at this point - currX[currCount] = GetX(CurrentHedgehog) - currY[currCount] = GetY(CurrentHedgehog) - currCount = currCount + 1 - - -- draw a ping of smoke where the fastest player was at this point - if (fastCount ~= 0) and (fastIndex < fastCount) then - - fastIndex = fastIndex + 1 - - tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false) - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE) - SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour ) - - --AddCaption("fC: " .. fastIndex .. " / " .. fastCount) - - else - - --AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount) - - end - - - -end - ----------------------------------- --- GAME METHODS / EVENT HANDLERS ----------------------------------- - -function onGameInit() - GameFlags = GameFlags + gfInfAttack + gfInvulnerable - CaseFreq = 0 - TurnTime = 90000 - WaterRise = 0 -end - - -function onGameStart() - - roundN = 0 - lastRound = TotalRounds - RoundHasChanged = false -- true - - RebuildTeamInfo() - - ShowMission ( - loc("RACER"), - loc("a Hedgewars mini-game"), - - loc("Build a track and race.") .. "|" .. - loc("Round Limit:") .. " " .. roundLimit .. "|" .. - - "", 4, 4000 - ) -end - -function PlaceWayPoint(x,y) - - if (wpCount < wpLimit) then -- seems to not work with a hedgehog nil chek - - wpX[wpCount] = x - wpY[wpCount] = y - wpCol[wpCount] = 0xffffffff - wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true) - --100 - SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount]) - - wpCount = wpCount + 1 - - AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount)) - - end - -end - -function onNewTurn() - - CheckForNewRound() - - racerActive = false - - trackTime = 0 - - currCount = 0 -- hopefully this solves problem - AddAmmo(CurrentHedgehog, amAirAttack, 0) - gTimer = 0 - - -- Set the waypoints to unactive on new round - for i = 0,(wpCount-1) do - wpActive[i] = false - wpCol[i] = 0xffffffff - SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) - end - - -- Handle Starting Stage of Game - if (gameOver == false) and (gameBegun == false) then - if wpCount >= 3 then - gameBegun = true - roundNumber = 0 - firstClan = GetHogClan(CurrentHedgehog) - ShowMission(loc("RACER"), - loc("GAME BEGUN!!!"), - loc("Complete the track as fast as you can!"), 2, 4000) - else - ShowMission(loc("RACER"), - loc("NOT ENOUGH WAYPOINTS"), - loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000) - AddAmmo(CurrentHedgehog, amAirAttack, 4000) - ParseCommand("setweap " .. string.char(amAirAttack)) - end - end - - if gameOver == true then - gameBegun = false - racerActive = false -- newadd - end - - AddAmmo(CurrentHedgehog, amTardis, 0) - AddAmmo(CurrentHedgehog, amDrillStrike, 0) - AddAmmo(CurrentHedgehog, amMineStrike, 0) - AddAmmo(CurrentHedgehog, amNapalm, 0) - AddAmmo(CurrentHedgehog, amPiano, 0) - -end - -function onGameTick20() - - -- airstrike detected, convert this into a potential waypoint spot - if cGear ~= nil then - x,y = GetGearPosition(cGear) - if x > -9000 then - x,y = GetGearTarget(cGear) - - - if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then - AddCaption(loc("Please place the way-point in the open, within the map boundaries.")) - PlaySound(sndDenied) - elseif (y > WaterLine-50) then - AddCaption(loc("Please place the way-point further from the waterline.")) - PlaySound(sndDenied) - else - PlaceWayPoint(x, y) - if wpCount == wpLimit then - AddCaption(loc("Race complexity limit reached.")) - DisableTumbler() - end - end - else - DeleteGear(cGear) - end - SetGearPosition(cGear, -10000, 0) - end - - - -- start the player tumbling with a boom once their turn has actually begun - if racerActive == false then - - if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then - - -- if the gamehas started put the player in the middle of the first - --waypoint that was placed - if gameBegun == true then - AddCaption(loc("Good to go!")) - racerActive = true - trackTime = 0 - - SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) - AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) - FollowGear(CurrentHedgehog) - - HideMission() - - else - -- still in placement mode - end - - end - end - - - - -- has the player started his tumbling spree? - if (CurrentHedgehog ~= nil) then - - --airstrike conversion used to be here - - -- if the RACE has started, show tracktimes and keep tabs on waypoints - if (racerActive == true) and (gameBegun == true) then - - --ghost - if GameTime%40 == 0 then - HandleGhost() - end - - trackTime = trackTime + 20 - - if GameTime%100 == 0 then - - if trackTime%1000 == 0 then - AddCaption((trackTime/1000)..'.0',GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) - else - AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) - end - - if (CheckWaypoints() == true) then - AdjustScores() - racerActive = false - DisableTumbler() - end - - end - - end - - - - -- if the player has expended his tunbling time, stop him tumbling - if TurnTimeLeft <= 20 then - DisableTumbler() - end - - end - -end - -function onGearResurrect(gear) - - AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) - - if gear == CurrentHedgehog then - DisableTumbler() - end - - -- if the player stops and "dies" or flies into water, stop him racing - --[[if gear == CurrentHedgehog then - DisableTumbler() - ShowMission(loc("RACER"), - loc("TRACK FAILED!"), - loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000) - end]] - -end - -function onGearAdd(gear) - - if GetGearType(gear) == gtHedgehog then - hhs[numhhs] = gear - numhhs = numhhs + 1 - SetEffect(gear, heResurrectable, 1) - end - - if GetGearType(gear) == gtAirAttack then - cGear = gear - end - -end - -function onGearDelete(gear) - - if GetGearType(gear) == gtAirAttack then - cGear = nil - end - -end - ---[[function onAmmoStoreInit() - SetAmmo(amRope, 9, 0, 0, 0) - SetAmmo(amJetpack, 9, 0, 0, 0) - SetAmmo(amSkip, 9, 0, 0, 0) -end]] - - + +------------------------------------------ +-- RACER 0.6 +-- map-independant racing script +-- by mikade +----------------------------------------- + +----------------------------------- +--0.1: took all the code from crazy racer and scrapped most of it +----------------------------------- + +-- Removed tumbler system +-- Removed extra adds like boosters etc +-- Added experimental waypoint placement system +-- More user feedback +-- Reduced race complexity limit to 5 waypoints +-- stop placement at complexity limit reached and end turn +-- guys dont keep racing after dying +-- invulnerable feasibility +-- reverted time keeping method +-- reduced feedback display time +-- colour-coded addcaptions +-- cleaned up code +-- support for more players properly added +-- tardis fix +-- remove airstrikes + +-- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn + +-- update feedback + +------- +-- 0.2 +------- + +-- allow gameflags +-- extend time to 90s +-- remove other air-attack based weps +-- turn off water rise for sd + +------- +-- 0.3 +------- + +-- prevent WP being placed in land +-- prevent waypoints being placed outside border + +------- +-- 0.4 +------- + +-- update user feedback +-- add more sounds + +------- +-- 0.5 +------- + +-- fix ghost disappearing if hog falls in water or somehow dies +-- lengthen ghost tracking interval to improve performance on slower machines +-- increase waypoint limit to 8 +-- allow for persistent showmission information + +------- +-- 0.6 +------- + +-- remove hogs from racing area as per request + +----------------------------- +-- SCRIPT BEGINS +----------------------------- + +HedgewarsScriptLoad("/Scripts/Locale.lua") + +------------------ +-- Got Variables? +------------------ + +local fMod = 1000000 -- 1 +local roundLimit = 3 +local roundNumber = 0 +local firstClan = 10 + +local fastX = {} +local fastY = {} +local fastCount = 0 +local fastIndex = 0 +local fastColour + +local currX = {} +local currY = {} +local currCount = 0 + +-------------------------- +-- hog and team tracking variales +-------------------------- + +local numhhs = 0 -- store number of hedgehogs +local hhs = {} -- store hedgehog gears + +local numTeams -- store the number of teams in the game +local teamNameArr = {} -- store the list of teams +local teamClan = {} +local teamSize = {} -- store how many hogs per team +local teamIndex = {} -- at what point in the hhs{} does each team begin + +local teamComment = {} +local teamScore = {} + +------- +-- racer vars +-------- + +local cGear = nil + +local bestClan = nil +local bestTime = nil + +local gameBegun = false +local gameOver = false +local racerActive = false +local trackTime = 0 + +local wpCirc = {} +local wpX = {} +local wpY = {} +local wpCol = {} +local wpActive = {} +local wpRad = 450 --75 +local wpCount = 0 +local wpLimit = 8 + +local roundN +local lastRound +local RoundHasChanged + +------------------- +-- general methods +------------------- + +function RebuildTeamInfo() + + + -- make a list of individual team names + for i = 0, (TeamsCount-1) do + teamNameArr[i] = " " -- = i + teamSize[i] = 0 + teamIndex[i] = 0 + teamScore[i] = 100000 + end + numTeams = 0 + + for i = 0, (numhhs-1) do + + z = 0 + unfinished = true + while(unfinished == true) do + + newTeam = true + tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name + + if tempHogTeamName == teamNameArr[z] then + newTeam = false + unfinished = false + end + + z = z + 1 + + if z == TeamsCount then + unfinished = false + if newTeam == true then + teamNameArr[numTeams] = tempHogTeamName + numTeams = numTeams + 1 + end + end + + end + + end + + -- find out how many hogs per team, and the index of the first hog in hhs + for i = 0, (numTeams-1) do + for z = 0, (numhhs-1) do + if GetHogTeamName(hhs[z]) == teamNameArr[i] then + teamClan[i] = GetHogClan(hhs[z]) + if teamSize[i] == 0 then + teamIndex[i] = z -- should give starting index + end + teamSize[i] = teamSize[i] + 1 + --add a pointer so this hog appears at i in hhs + end + end + + end + +end + + +----------------- +-- RACER METHODS +----------------- + +function CheckWaypoints() + + trackFinished = true + + for i = 0, (wpCount-1) do + + g1X, g1Y = GetGearPosition(CurrentHedgehog) + g2X, g2Y = wpX[i], wpY[i] + + g1X = g1X - g2X + g1Y = g1Y - g2Y + dist = (g1X*g1X) + (g1Y*g1Y) + + --if i == 0 then + -- AddCaption(dist .. "/" .. (wpRad*wpRad) ) + --end + + NR = (48/100*wpRad)/2 + + if dist < (NR*NR) then + --if dist < (wpRad*wpRad) then + --AddCaption("howdy") + wpActive[i] = true + wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new --GetClanColor(1) + SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) + + wpRem = 0 + for k = 0, (wpCount-1) do + if wpActive[k] == false then + wpRem = wpRem + 1 + end + end + + AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo) + + end + + if wpActive[i] == false then + trackFinished = false + end + + end + + return(trackFinished) + +end + +function AdjustScores() + + if bestTime == nil then + bestTime = 100000 + bestClan = 10 + bestTimeComment = "N/A" + end + + newScore = false + + -- update this clan's time if the new track is better + for i = 0, (numTeams-1) do + if teamClan[i] == GetHogClan(CurrentHedgehog) then + if trackTime < teamScore[i] then + teamScore[i] = trackTime + newScore = true + else + newScore = false + end + end + end + + --bestTime = 100000 + --bestClan = 10 + + -- find the best time out of those so far + for i = 0, (numTeams-1) do + if teamScore[i] < bestTime then + bestTime = teamScore[i] + bestClan = teamClan[i] + end + end + + if bestTime ~= 100000 then + bestTimeComment = (bestTime/1000) ..loc("s") + end + + if newScore == true then + if trackTime == bestTime then -- best time of the race + ShowMission(loc("RACER"), + loc("TRACK COMPLETED"), + loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. + loc("WINNING TIME: ") .. bestTimeComment, 0, 4000) + PlaySound(sndHomerun) + else -- best time for the clan + ShowMission(loc("RACER"), + loc("TRACK COMPLETED"), + loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. + loc("WINNING TIME: ") .. bestTimeComment, 4, 4000) + end + else -- not any kind of new score + ShowMission(loc("RACER"), + loc("TRACK COMPLETED"), + loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" .. + loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000) + PlaySound(sndHellish) + end + + + -------- + --new + -------- + + if bestTime == trackTime then + --AddCaption("wooooooooooooooooooooooooooooo") + + fastColour = GetClanColor(GetHogClan(CurrentHedgehog)) + + for i = 0, (currCount-1) do + fastX[i] = currX[i] + fastY[i] = currY[i] + end + + fastCount = currCount + fastIndex = 0 + + --currCount = 0 -- is this needed? + + else + currCount = 0 + fastIndex = 0 + end + + +end + +function onNewRound() + + roundNumber = roundNumber + 1 + + totalComment = "" + for i = 0, (TeamsCount-1) do + if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] + teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") + totalComment = totalComment .. teamComment[i] + elseif teamNameArr[i] == " " then + teamComment[i] = "|" + end + end + + ShowMission( loc("RACER"), + loc("STATUS UPDATE"), + loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. + loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) + + -- end game if its at round limit + if roundNumber == roundLimit then + for i = 0, (numhhs-1) do + if GetHogClan(hhs[i]) ~= bestClan then + SetEffect(hhs[i], heResurrectable, 0) + SetHealth(hhs[i],0) + end + end + gameOver = true + TurnTimeLeft = 1 + end + +end + +function CheckForNewRound() + + ------------- + ------ new + ------------- + + --[[turnN = turnN + 1 + if gameBegun == false then + if turnN == 2 then + for i = 0, (numhhs-1) do + if hhs[i] ~= nil then + SetEffect(hhs[i], heResurrectable, 0) + SetHealth(hhs[i],0) + end + end + gameOver = true + TurnTimeLeft = 1 + end + else + + + end]] + + --[[if roundBegun == true then + + if RoundHasChanged == true then + roundN = roundN + 1 + RoundHasChanged = false + onNewRound() + end + + if lastRound ~= TotalRounds then -- new round, but not really + + if RoundHasChanged == false then + RoundHasChanged = true + end + + end + + AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) + + lastRound = TotalRounds + + end]] + + ------------ + ----- old + ------------ + + if GetHogClan(CurrentHedgehog) == firstClan then + onNewRound() + end + +end + +function DisableTumbler() + currCount = 0 + fastIndex = 0 + TurnTimeLeft = 0 + racerActive = false -- newadd +end + +function HandleGhost() + + -- get the current xy of the racer at this point + currX[currCount] = GetX(CurrentHedgehog) + currY[currCount] = GetY(CurrentHedgehog) + currCount = currCount + 1 + + -- draw a ping of smoke where the fastest player was at this point + if (fastCount ~= 0) and (fastIndex < fastCount) then + + fastIndex = fastIndex + 1 + + tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false) + g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE) + SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour ) + + --AddCaption("fC: " .. fastIndex .. " / " .. fastCount) + + else + + --AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount) + + end + + + +end + +function TryRepositionHogs() + + if MapHasBorder() == true then + + for i = 0, (numhhs-1) do + if hhs[i] ~= nil then + SetGearPosition(hhs[i],GetX(hhs[i]), TopY-10) + end + end + + end + +end + +---------------------------------- +-- GAME METHODS / EVENT HANDLERS +---------------------------------- + +function onGameInit() + GameFlags = bor(GameFlags,gfInfAttack + gfInvulnerable) + CaseFreq = 0 + TurnTime = 90000 + WaterRise = 0 +end + + +function onGameStart() + + roundN = 0 + lastRound = TotalRounds + RoundHasChanged = false -- true + + RebuildTeamInfo() + + ShowMission ( + loc("RACER"), + loc("a Hedgewars mini-game"), + + loc("Build a track and race.") .. "|" .. + loc("Round Limit:") .. " " .. roundLimit .. "|" .. + + "", 4, 4000 + ) + + TryRepositionHogs() + +end + +function PlaceWayPoint(x,y) + + if (wpCount < wpLimit) then -- seems to not work with a hedgehog nil chek + + wpX[wpCount] = x + wpY[wpCount] = y + wpCol[wpCount] = 0xffffffff + wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true) + --100 + SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount]) + + wpCount = wpCount + 1 + + AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount)) + + end + +end + +function onNewTurn() + + CheckForNewRound() + TryRepositionHogs() + + racerActive = false + + trackTime = 0 + + currCount = 0 -- hopefully this solves problem + AddAmmo(CurrentHedgehog, amAirAttack, 0) + gTimer = 0 + + -- Set the waypoints to unactive on new round + for i = 0,(wpCount-1) do + wpActive[i] = false + wpCol[i] = 0xffffffff + SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) + end + + -- Handle Starting Stage of Game + if (gameOver == false) and (gameBegun == false) then + if wpCount >= 3 then + gameBegun = true + roundNumber = 0 + firstClan = GetHogClan(CurrentHedgehog) + ShowMission(loc("RACER"), + loc("GAME BEGUN!!!"), + loc("Complete the track as fast as you can!"), 2, 4000) + else + ShowMission(loc("RACER"), + loc("NOT ENOUGH WAYPOINTS"), + loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000) + AddAmmo(CurrentHedgehog, amAirAttack, 4000) + ParseCommand("setweap " .. string.char(amAirAttack)) + end + end + + if gameOver == true then + gameBegun = false + racerActive = false -- newadd + end + + AddAmmo(CurrentHedgehog, amTardis, 0) + AddAmmo(CurrentHedgehog, amDrillStrike, 0) + AddAmmo(CurrentHedgehog, amMineStrike, 0) + AddAmmo(CurrentHedgehog, amNapalm, 0) + AddAmmo(CurrentHedgehog, amPiano, 0) + +end + +function onGameTick20() + + -- airstrike detected, convert this into a potential waypoint spot + if cGear ~= nil then + x,y = GetGearPosition(cGear) + if x > -9000 then + x,y = GetGearTarget(cGear) + + + if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then + AddCaption(loc("Please place the way-point in the open, within the map boundaries.")) + PlaySound(sndDenied) + elseif (y > WaterLine-50) then + AddCaption(loc("Please place the way-point further from the waterline.")) + PlaySound(sndDenied) + else + PlaceWayPoint(x, y) + if wpCount == wpLimit then + AddCaption(loc("Race complexity limit reached.")) + DisableTumbler() + end + end + else + DeleteGear(cGear) + end + SetGearPosition(cGear, -10000, 0) + end + + + -- start the player tumbling with a boom once their turn has actually begun + if racerActive == false then + + if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then + + -- if the gamehas started put the player in the middle of the first + --waypoint that was placed + if gameBegun == true then + AddCaption(loc("Good to go!")) + racerActive = true + trackTime = 0 + + SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) + AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) + FollowGear(CurrentHedgehog) + + HideMission() + + else + -- still in placement mode + end + + end + end + + + + -- has the player started his tumbling spree? + if (CurrentHedgehog ~= nil) then + + --airstrike conversion used to be here + + -- if the RACE has started, show tracktimes and keep tabs on waypoints + if (racerActive == true) and (gameBegun == true) then + + --ghost + if GameTime%40 == 0 then + HandleGhost() + end + + trackTime = trackTime + 20 + + if GameTime%100 == 0 then + + if trackTime%1000 == 0 then + AddCaption((trackTime/1000)..'.0',GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) + else + AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) + end + + if (CheckWaypoints() == true) then + AdjustScores() + racerActive = false + DisableTumbler() + end + + end + + end + + -- if the player has expended his tunbling time, stop him tumbling + if TurnTimeLeft <= 20 then + DisableTumbler() + end + + end + +end + +function onGearResurrect(gear) + + AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) + + if gear == CurrentHedgehog then + DisableTumbler() + end + +end + +function onGearAdd(gear) + + if GetGearType(gear) == gtHedgehog then + hhs[numhhs] = gear + numhhs = numhhs + 1 + SetEffect(gear, heResurrectable, 1) + end + + if GetGearType(gear) == gtAirAttack then + cGear = gear + end + +end + +function onGearDelete(gear) + + if GetGearType(gear) == gtAirAttack then + cGear = nil + end + +end diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/ShoppaMap.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Scripts/Multiplayer/ShoppaMap.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,2 @@ +Default +Default diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Scripts/Multiplayer/ShoppaMap.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Scripts/Multiplayer/ShoppaMap.lua Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,450 @@ +ObjectList = {} +PointsBuffer = '' -- A string to accumulate points in + +-- Overall padding for roping freedom +Padding = 430 + +function AddPoint(x, y, width, erase) + PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff)) + if width then + width = bor(width,0x80) + if erase then + width = bor(width,0x40) + end + PointsBuffer = PointsBuffer .. string.char(width) + else + PointsBuffer = PointsBuffer .. string.char(0) + end + if #PointsBuffer > 245 then + ParseCommand('draw '..PointsBuffer) + PointsBuffer = '' + end +end +function FlushPoints() + if #PointsBuffer > 0 then + ParseCommand('draw '..PointsBuffer) + PointsBuffer = '' + end +end + +-- This could probably use less points and more precision +-- 700x700 for object space +function DrawStar(x, y, d, f) +-- default scale is 700x700 or so + s = 700 + if not(d == 1) then s = div(s,d) end + if NoOverlap(x,y,s,s) then + AddCollision(x,y,s,s) + if not(d == 1) then + i = 6-d + j = math.min(div(5,d),1) + -- centre + AddPoint(x,y,div(20,d)) + -- arms + AddPoint(x-div(325,d),y-f*div(108,d),2) + AddPoint(x+div(325,d),y-f*div(108,d)) + AddPoint(x-div(205,d),y+f*div(270,d)) + AddPoint(x,y-f*div(345,d)) + AddPoint(x+div(205,d),y+f*div(270,d)) + AddPoint(x-div(325,d),y-f*div(108,d)) + if d < 4 then + -- fill in arm 1 + AddPoint(x-div(275,d),y-f*div(92,d),i) + AddPoint(x-div(50,d),y-f*div(92,d)) + AddPoint(x-div(105,d),y+f*div(25,d)) + AddPoint(x-div(250,d),y-f*div(80,d)) + AddPoint(x-div(115,d),y-f*div(70,d)) + AddPoint(x-div(130,d),y-f*div(25,d)) + AddPoint(x-div(175,d),y-f*div(60,d)) + -- fill in arm 2 + AddPoint(x+div(275,d),y-f*div(92,d),i) + AddPoint(x+div(50,d),y-f*div(92,d)) + AddPoint(x+div(105,d),y+f*div(25,d)) + AddPoint(x+div(250,d),y-f*div(80,d)) + AddPoint(x+div(115,d),y-f*div(70,d)) + AddPoint(x+div(130,d),y-f*div(25,d)) + AddPoint(x+div(175,d),y-f*div(60,d)) + -- fill in arm 3 + AddPoint(x-div(175,d),y+f*div(230,d),i) + AddPoint(x-div(110,d),y+f*div(60,d)) + AddPoint(x,y+f*div(120,d)) + AddPoint(x-div(155,d),y+f*div(215,d)) + AddPoint(x-div(105,d),y+f*div(95,d)) + AddPoint(x-div(60,d),y+f*div(130,d)) + AddPoint(x-div(85,d),y+f*div(155,d),j) + -- fill in arm 4 + AddPoint(x,y-f*div(300,d),3) + AddPoint(x+div(50,d),y-f*div(125,d)) + AddPoint(x-div(50,d),y-f*div(125,d)) + AddPoint(x,y-f*div(270,d)) + AddPoint(x-div(40,d),y-f*div(160,d)) + AddPoint(x+div(40,d),y-f*div(160,d)) + AddPoint(x,y-f*div(195,d),j) + -- fill in arm 5 + AddPoint(x+div(175,d),y+f*div(230,d),i) + AddPoint(x+div(110,d),y+f*div(60,d)) + AddPoint(x,y+f*div(120,d)) + AddPoint(x+div(155,d),y+f*div(215,d)) + AddPoint(x+div(105,d),y+f*div(95,d)) + AddPoint(x+div(60,d),y+f*div(130,d)) + AddPoint(x+div(85,d),y+f*div(155,d),j) + end + else + -- centre + AddPoint(x,y,20) + -- arms + AddPoint(x-325,y-f*108,1) + AddPoint(x+325,y-f*108) + AddPoint(x-205,y+f*270) + AddPoint(x,y-f*345) + AddPoint(x+205,y+f*270) + AddPoint(x-325,y-f*108) + -- fill in arm 1 + AddPoint(x-275,y-f*92,4) + AddPoint(x-50,y-f*92) + AddPoint(x-105,y+f*25) + AddPoint(x-250,y-f*80) + AddPoint(x-115,y-f*70) + AddPoint(x-130,y-f*25) + AddPoint(x-175,y-f*60) + -- fill in arm 2 + AddPoint(x+275,y-f*92,4) + AddPoint(x+50,y-f*92) + AddPoint(x+105,y+f*25) + AddPoint(x+250,y-f*80) + AddPoint(x+115,y-f*70) + AddPoint(x+130,y-f*25) + AddPoint(x+175,y-f*60) + -- fill in arm 3 + AddPoint(x-175,y+f*230,4) + AddPoint(x-110,y+f*60) + AddPoint(x-10,y+f*120) + AddPoint(x-155,y+f*215) + AddPoint(x-105,y+f*95) + AddPoint(x-60,y+f*130) + AddPoint(x-85,y+f*155,5) + -- fill in arm 4 + AddPoint(x,y-f*300,3) + AddPoint(x+50,y-f*125) + AddPoint(x-50,y-f*125) + AddPoint(x,y-f*270) + AddPoint(x-40,y-f*160) + AddPoint(x+40,y-f*160) + AddPoint(x,y-f*195,5) + -- fill in arm 5 + AddPoint(x+175,y+f*230,4) + AddPoint(x+110,y+f*60) + AddPoint(x+10,y+f*120) + AddPoint(x+155,y+f*215) + AddPoint(x+105,y+f*95) + AddPoint(x+60,y+f*130) + AddPoint(x+85,y+f*155,5) + end + return true + else + return false + end +end + +-- well. this was easy +function DrawCircle(x, y, w) + if NoOverlap(x,y,w*10+6,w*10+6) then + AddCollision(x,y,w*10+6,w*10+6) + AddPoint(x,y,w) + return true + else + return false + end +end + +function DrawCrescent(x, y, w, s) + b = div(w*(GetRandom(4)+1)*10+6,6) + + if NoOverlap(x,y,w*10+6,w*10+6) then + AddCollision(x,y,w*10+6,w*10+6) + AddPoint(x,y,w) + if s then -- side + if GetRandom(1) == 0 then + b = b*-1 + end + AddPoint(x-b,y,w,true) + else -- top + AddPoint(x,y-b,w,true) + end + return true + else + return false + end +end + +function DrawCones(x,w,h,c) + y = 2048-h + hw = div(w,2) + if NoOverlap(x+div(w*c,2),y+div(h,2),w*c,h) then + AddCollision(x+div(w*c,2),y+div(h,2),w*c,h) + x = x + hw + for i = 1,c do -- I'm guessing outlining is slightly more efficient than fanning at 16px brush + AddPoint(x,y,1) + AddPoint(x-hw+8,2048) + AddPoint(x+hw-8,2048) + AddPoint(x,y) + for j = x-hw+25,x+hw,34 do + AddPoint(x,y+30,3) + AddPoint(j,2048) + end + if GetRandom(2)==0 then + AddPoint(x,y-20,8) + end + x = x + w + end + else + return false + end + +end + +function DrawPlateau(x,y,l,t,b) + if NoOverlapXY(x-28,y-28,x+l+28,y+l+28) then + AddPoint(x,y,5) + AddPoint(x+l,y) + + to = GetRandom(6) + if not(to==0) then + if GetRandom(2)==0 then + to = div(l,to) + else + to = l-div(l,to) + end + end + if t>0 and NoOverlapXY(x+to-28,y-t-28,x+to+28,y+28) then + AddPoint(x+to,y-t,5) + AddPoint(x+to,y) + if GetRandom(2)==0 then + AddPoint(x+to,y-t+75,20) + else -- square off + AddPoint(x+to-20,y-t,1) + AddPoint(x+to-20,y-t-20) + AddPoint(x+to+20,y-t-20) + AddPoint(x+to+20,y-t) + end + tSucc = true + end + + if to > 120 and GetRandom(2)==0 then -- left bumper + AddPoint(x+15,y-20,9) + else -- square off + --AddPoint(x-50,y,2) + AddPoint(x,y+20,1) + AddPoint(x-20,y+20) + AddPoint(x-20,y-20) + AddPoint(x,y-20) + end + if to < (l-120) and GetRandom(2)==0 then -- right bumper + AddPoint(x+l-15,y-20,9) + else -- square off + --AddPoint(x+l+50,y,2) + AddPoint(x+l,y+20,1) + AddPoint(x+l+20,y+20) + AddPoint(x+l+20,y-20) + AddPoint(x+l,y-20) + end + bo = GetRandom(6) + if not(bo == 0) then + if GetRandom(2)==0 then + bo = div(l,bo) + else + bo = l-div(l,bo) + end + end + -- still consider a success even if we can't place this one. Might need to return more than true/false + if b>0 and NoOverlapXY(x+bo-28,y-28,x+bo+28,y+b+28) then + AddPoint(x+bo,y,5) + AddPoint(x+bo,y+b) + if GetRandom(2)==0 then + AddPoint(x+bo,y+b-75,20) + else -- square off + AddPoint(x+bo-20,y+b,1) + AddPoint(x+bo-20,y+b+20) + AddPoint(x+bo+20,y+b+20) + AddPoint(x+bo+20,y+b) + end + bSucc = true + end + if bSucc then AddCollisionXY(x+bo-28,y-28,x+bo+28,y+b+28) end + if tSucc then AddCollisionXY(x+to-28,y-t-28,x+to+28,y+28) end + AddCollisionXY(x-28,y-28,x+l+28,y+28) + return true + else + return false + end +end + +function AddCollision(x,y,w,h) + table.insert(ObjectList,{x-div(w+Padding,2), + y-div(h+Padding,2), + x+div(w+Padding,2), + y+div(h+Padding,2)}) +end + +function AddCollisionXY(x,y,x2,y2) + table.insert(ObjectList,{x-div(Padding,2), + y-div(Padding,2), + x2+div(Padding,2), + y2+div(Padding,2)}) +end + +-- bounding box check +function NoOverlap(x,y,w,h) + w = w + h = h + x = x-div(w,2) + y = y-div(h,2) + x2 = x+w + y2 = y+h + return NoOverlapXY(x,y,x2,y2) +end +function NoOverlapXY(x,y,x2,y2) + i=1 + l=table.getn(ObjectList) + while i<=l do + ox = ObjectList[i][1] + oy = ObjectList[i][2] + ox2 = ObjectList[i][3] + oy2 = ObjectList[i][4] + -- WriteLnToConsole(ox..' '..oy..' '..ox2..' '..oy2..' - '..x..' '..y..' '..x2..' '..y2) + --if (math.abs(ox + ox2 -x - x2) <= (ox2 - ox + x2 - x)) and (math.abs(oy + oy2 - y - y2) <= (oy - oy2 + y - y2)) then + if x < ox2 and ox < x2 and y < oy2 and oy < y2 then + return false + end + i=i+1 + end + return true +end + +function dbg() + i=1 + l=table.getn(ObjectList) + while i<=l do + ox = ObjectList[i][1] + oy = ObjectList[i][2] + ox2 = ObjectList[i][3] + oy2 = ObjectList[i][4] + AddPoint(ox,oy,1) + AddPoint(ox2,oy) + AddPoint(ox2,oy2) + AddPoint(ox,oy2) + AddPoint(ox,oy) + AddPoint(ox2,oy2) + i=i+1 + end +end + +function onGameInit() + MapGen = 2 + TemplateFilter = 0 + TotGen = 0 + Tries = 0 + if band(GameFlags,gfBottomBorder) == 0 and GetRandom(2) == 0 then + AddPoint(-50,2010,7) + AddPoint(4150,2010) + for i = 0,GetRandom(3) do + x = GetRandom(4096) + w = GetRandom(40)+10 + AddPoint(x,2200,w,true) + AddPoint(x,1900) + table.insert(ObjectList,{x-div(w*9,2), + 2010-div(100,2), + x+div(w*9,2), + 2010+div(100,2)}) + end + end + + if GetRandom(2) == 0 then + l = GetRandom(3)+1 + w = GetRandom(200)+200 + h = GetRandom(350)+200 + x = GetRandom(4096-w*l) + DrawCones(x,w,h,l) + --if DrawCones(x,w,h,l) then TotGen = TotGen+1 + end + if GetRandom(2) == 0 then + for i = 1,GetRandom(5)+1 do + w = GetRandom(35)+15 + x = GetRandom(4096-w*12)+w + if GetRandom(2)==0 then + y = 2048-GetRandom(w*10+6) + else + y = 2048 + end + -- if AddPoint(x,y,w) then TotGetn = TotGen+1 + DrawCircle(x,y,w) + end + end + if GetRandom(2)==0 then + x = GetRandom(3300)+350 + y = GetRandom(1300)+350 + if DrawStar(x,y, 1, 1+GetRandom(2)*-2) then + TotGen = TotGen+1 + end + end + + while (TotGen < 6) and (Tries < 100) do + l = GetRandom(1000-Tries*10)+300 + x = GetRandom(3900-l)+100 + y = GetRandom(1900)+100 + if GetRandom(2)==0 then b = GetRandom(800)+300 + else b = 0 end + if GetRandom(2)==0 then t = GetRandom(800)+300 + else t = 0 end + if y-t < 50 then t = y - 50 end + if t < 200 then t = 0 end + if DrawPlateau(x,y,l,t,b) then + TotGen = TotGen+1 + end + Tries = Tries + 1 + end + Tries = 0 + while (TotGen < 17) and (Tries < 1000) do + if Tries < 500 and GetRandom(2)==0 then + x = GetRandom(3300)+350 + y = GetRandom(1300)+350 + if DrawStar(x,y, 1, 1+GetRandom(2)*-2) then + TotGen = TotGen+1 + end + else + if Tries > 500 then d = GetRandom(2)+3 + else d = GetRandom(3)+2 end + x = GetRandom(4000-div(700,d))+div(700,d*2) + y = GetRandom(1300-div(700,d))+div(700,d*2) + if DrawStar(x,y, d, 1+GetRandom(2)*-2) then + TotGen = TotGen+1 + end + end + w = GetRandom(35-div(Tries,29))+15 + x = GetRandom(4050-w*20)+w*10 + y = GetRandom(2000-w*20)+w*10 + if DrawCircle(x,y,w) then + TotGen = TotGen+1 + end + w = GetRandom(35-div(Tries,29))+5 + x = GetRandom(4050-w*20)+w*10 + y = GetRandom(2000-w*20)+w*10 + if DrawCrescent(x,y,w,GetRandom(2)==0) then + TotGen = TotGen+1 + end + Tries = Tries + 1 + end +-- Padding = div(Padding,2) +-- Tries = 0 +-- while (TotGen < 21) and (Tries < 10000) do +-- r = GetRandom(20-div(Tries,223))+5 +-- x = GetRandom(4050-r*20)+r*10 +-- y = GetRandom(2000-r*20)+r*10 +-- if DrawCircle(x,y,r) then +-- TotGen = TotGen+1 +-- end +-- Tries = Tries + 1 +-- end + --dbg() + FlushPoints() +end diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Sounds/frozen_hog_impact.ogg Binary file share/hedgewars/Data/Sounds/frozen_hog_impact.ogg has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Sounds/hog_freeze.ogg Binary file share/hedgewars/Data/Sounds/hog_freeze.ogg has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Sounds/ice_beam.ogg Binary file share/hedgewars/Data/Sounds/ice_beam.ogg has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Sounds/voices/Default_uk/JustYouwait.ogg Binary file share/hedgewars/Data/Sounds/voices/Default_uk/JustYouwait.ogg has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Sounds/voices/Default_uk/Justyouwait.ogg Binary file share/hedgewars/Data/Sounds/voices/Default_uk/Justyouwait.ogg has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Bamboo/Flake.png Binary file share/hedgewars/Data/Themes/Bamboo/Flake.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Blox/LandBackTex.png Binary file share/hedgewars/Data/Themes/Blox/LandBackTex.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/CMakeLists.txt --- a/share/hedgewars/Data/Themes/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/Themes/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -9,14 +9,15 @@ Castle Cheese Christmas + City Compost + CrazyMission Deepspace Desert - City - CrazyMission EarthRise Eyes Freeway + Fruit Golf Halloween Hell diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalactite.png Binary file share/hedgewars/Data/Themes/Cave/Stalactite.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalactite_mask.png Binary file share/hedgewars/Data/Themes/Cave/Stalactite_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalagmite01.png Binary file share/hedgewars/Data/Themes/Cave/Stalagmite01.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalagmite01_mask.png Binary file share/hedgewars/Data/Themes/Cave/Stalagmite01_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalagmite02.png Binary file share/hedgewars/Data/Themes/Cave/Stalagmite02.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cave/Stalagmite02_mask.png Binary file share/hedgewars/Data/Themes/Cave/Stalagmite02_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cheese/cheese.png Binary file share/hedgewars/Data/Themes/Cheese/cheese.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Cheese/cheese_mask.png Binary file share/hedgewars/Data/Themes/Cheese/cheese_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/Chunk.png Binary file share/hedgewars/Data/Themes/EarthRise/Chunk.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/Rock.png Binary file share/hedgewars/Data/Themes/EarthRise/Rock.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/RockShort.png Binary file share/hedgewars/Data/Themes/EarthRise/RockShort.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/RockShort_mask.png Binary file share/hedgewars/Data/Themes/EarthRise/RockShort_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/Rock_mask.png Binary file share/hedgewars/Data/Themes/EarthRise/Rock_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/horizontL.png Binary file share/hedgewars/Data/Themes/EarthRise/horizontL.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/horizontR.png Binary file share/hedgewars/Data/Themes/EarthRise/horizontR.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/icon.png Binary file share/hedgewars/Data/Themes/EarthRise/icon.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/EarthRise/icon@2x.png Binary file share/hedgewars/Data/Themes/EarthRise/icon@2x.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Banana.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Banana.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,170 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Banana1.png Binary file share/hedgewars/Data/Themes/Fruit/Banana1.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Banana2.png Binary file share/hedgewars/Data/Themes/Fruit/Banana2.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/BlueWater.png Binary file share/hedgewars/Data/Themes/Fruit/BlueWater.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Border.png Binary file share/hedgewars/Data/Themes/Fruit/Border.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Border.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Border.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,88 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,6 @@ +file(GLOB images *.png) + +install(FILES + theme.cfg + ${images} + DESTINATION ${SHAREPATH}Data/Themes/Fruit) diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Chunk.png Binary file share/hedgewars/Data/Themes/Fruit/Chunk.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Clouds.png Binary file share/hedgewars/Data/Themes/Fruit/Clouds.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Clouds.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Clouds.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,141 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Droplet.png Binary file share/hedgewars/Data/Themes/Fruit/Droplet.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Droplet.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Droplet.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,478 @@ + + + + + + + + image/svg+xml + + + + + Carlos Vives B. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Flake.png Binary file share/hedgewars/Data/Themes/Fruit/Flake.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Girder.png Binary file share/hedgewars/Data/Themes/Fruit/Girder.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/LandBackTex.png Binary file share/hedgewars/Data/Themes/Fruit/LandBackTex.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/LandBackTex.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/LandBackTex.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,355 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/LandTex.png Binary file share/hedgewars/Data/Themes/Fruit/LandTex.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/LandTex.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/LandTex.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,462 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Orange.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Orange.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,241 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Orange1.png Binary file share/hedgewars/Data/Themes/Fruit/Orange1.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Orange2.png Binary file share/hedgewars/Data/Themes/Fruit/Orange2.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Sky.png Binary file share/hedgewars/Data/Themes/Fruit/Sky.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/SkyL.png Binary file share/hedgewars/Data/Themes/Fruit/SkyL.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Snowball.png Binary file share/hedgewars/Data/Themes/Fruit/Snowball.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Splash.png Binary file share/hedgewars/Data/Themes/Fruit/Splash.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Splash.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Splash.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,1024 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Watermelon.png Binary file share/hedgewars/Data/Themes/Fruit/Watermelon.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Watermelon.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/Watermelon.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,395 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/Watermelon_mask.png Binary file share/hedgewars/Data/Themes/Fruit/Watermelon_mask.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/amSnowball.png Binary file share/hedgewars/Data/Themes/Fruit/amSnowball.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/amSnowball.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/amSnowball.svg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,100 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/horizont.png Binary file share/hedgewars/Data/Themes/Fruit/horizont.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/icon.png Binary file share/hedgewars/Data/Themes/Fruit/icon.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/icon@2x.png Binary file share/hedgewars/Data/Themes/Fruit/icon@2x.png has changed diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/Themes/Fruit/theme.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Themes/Fruit/theme.cfg Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,13 @@ +sky = 50, 40, 131 +border = 0, 128, 0 +water-top = 255, 98, 0 +water-bottom = 255, 68, 0 +water-opacity = 125 +music = oriental.ogg +clouds = 20 +object = Orange1, 1, 50, 84, 15, 3, 1, 8, 2, 90, 73 +object = Orange2, 1, 50, 84, 15, 3, 1, 8, 2, 90, 73 +object = Watermelon, 1, 87, 272, 77, 10, 1, 21, 2, 242, 219 +object = Banana1, 1, 152, 191, 37, 24, 1, 2, 1, 163, 174 +object = Banana2, 1, 1, 190, 37, 24, 1, 22, 0, 163, 174 +flakes = 20, 3, 999999999, 100, 260 diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/misc/hedgewars-mimeinfo.xml --- a/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml Thu Jun 13 22:27:23 2013 +0200 @@ -18,6 +18,7 @@ Ukázka hry Hedgewars Demo för Hedgewars Hedgewars-demo + Hedgewars Dösteri @@ -39,10 +40,21 @@ Uložená hra Hedgewars Sparfil för Hedgewars Gemt Hedgewars-spil + Hedgewars kayıtlı oyun + + + + Hedgewars ServerAccess Scheme + + + + + + diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/misc/hedgewars.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/misc/hedgewars.desktop Thu Jun 13 22:27:23 2013 +0200 @@ -0,0 +1,24 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Hedgewars +GenericName=Fighting Hedgehogs +GenericName[de]=Kämpfende Igel +GenericName[es]=Batallas entre erizos +GenericName[fr]=Bataille de hérissons +GenericName[ko]=고슴도치 싸우기 +GenericName[ja]=ファイチングハリネズミ +GenericName[it]=Ricci combattenti +GenericName[pl]=Walczące jeże +GenericName[pt]=Batalhas entre ouriços +GenericName[ru]=Битвы ежей +GenericName[sk]=Bojujúci ježkovia +GenericName[cs]=Bojující ježci +GenericName[sv]=Stridande igelkottar +GenericName[tr]=Dövüşen Kirpiler +Icon=hedgewars.png +Exec=hedgewars %U +Terminal=false +StartupNotify=false +Categories=Application;Game;StrategyGame; +MimeType=x-scheme-handler/hwplay diff -r 11438c0bd46b -r bce8cf41d666 share/hedgewars/Data/misc/hwengine.desktop.in --- a/share/hedgewars/Data/misc/hwengine.desktop.in Tue Apr 30 01:47:30 2013 +0200 +++ b/share/hedgewars/Data/misc/hwengine.desktop.in Thu Jun 13 22:27:23 2013 +0200 @@ -1,7 +1,6 @@ [Desktop Entry] Type=Application Version=1.0 -Encoding=UTF-8 Name=Hedgewars Engine GenericName=Hedgewars engine, for playback of saves and demos GenericName[de]=Hedgewars engine, für die Wiedergabe von gespeicherten Spielen und Demos @@ -13,6 +12,7 @@ GenericName[pt]=Motor de jogo Hedgewars, para reprodução de jogos guardados e demos GenericName[ru]=Движок Hedgewars для проигрывания сохранённых игр и демок GenericName[sk]=Engine hry Hedgewars, pre prehrávanie uložených hier a demo súborov +GenericName[tr]=Kayıtların ve gösterilerin oynatılması için Hedgewars motoru GenericName[cs]=Engine hry Hedgewars pro přehrávání uložených her a ukázkových souborů GenericName[sv]=Hedgewarsmotorn, för att öppna demo- och sparfiler GenericName[da]=Kæmpende Pindsvin diff -r 11438c0bd46b -r bce8cf41d666 tools/CMakeLists.txt --- a/tools/CMakeLists.txt Tue Apr 30 01:47:30 2013 +0200 +++ b/tools/CMakeLists.txt Thu Jun 13 22:27:23 2013 +0200 @@ -33,6 +33,7 @@ if(NOT NOPNG) #get the neme of the library (harmelss if it is static) string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}") + string(REGEX REPLACE ".*/(.*)$" "\\1" ZLIB_LIBNAME "${ZLIB_LIBRARY}") endif() set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}) diff -r 11438c0bd46b -r bce8cf41d666 tools/CreateMacBundle.cmake.in --- a/tools/CreateMacBundle.cmake.in Tue Apr 30 01:47:30 2013 +0200 +++ b/tools/CreateMacBundle.cmake.in Thu Jun 13 22:27:23 2013 +0200 @@ -16,6 +16,7 @@ #same here, for libpng and hwengine, let's assume the version pulled by macdeployqt is the same #(yes libpng is pulled by macdeployqt even when NOVIDEOREC is active) execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${engine_full_path}) + execute_process(COMMAND install_name_tool -change ${ZLIB_LIBRARY} @executable_path/../Frameworks/${ZLIB_LIBNAME} ${engine_full_path}) endif() if(doBundle EQUAL 1) diff -r 11438c0bd46b -r bce8cf41d666 tools/PascalBasics.hs --- a/tools/PascalBasics.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -{-# LANGUAGE FlexibleContexts #-} -module PascalBasics where - -import Text.Parsec.Combinator -import Text.Parsec.Char -import Text.Parsec.Prim -import Text.Parsec.Token -import Text.Parsec.Language -import Data.Char - -builtin = ["succ", "pred", "low", "high", "ord", "inc", "dec", "exit", "break", "continue", "length"] - -pascalLanguageDef - = emptyDef - { commentStart = "(*" - , commentEnd = "*)" - , commentLine = "//" - , nestedComments = False - , identStart = letter <|> oneOf "_" - , identLetter = alphaNum <|> oneOf "_" - , reservedNames = [ - "begin", "end", "program", "unit", "interface" - , "implementation", "and", "or", "xor", "shl" - , "shr", "while", "do", "repeat", "until", "case", "of" - , "type", "var", "const", "out", "array", "packed" - , "procedure", "function", "with", "for", "to" - , "downto", "div", "mod", "record", "set", "nil" - , "cdecl", "external", "if", "then", "else" - ] -- ++ builtin - , reservedOpNames= [] - , caseSensitive = False - } - -preprocessorSwitch :: Stream s m Char => ParsecT s u m String -preprocessorSwitch = do - try $ string "{$" - s <- manyTill (noneOf "\n") $ char '}' - return s - -caseInsensitiveString s = do - mapM_ (\a -> satisfy (\b -> toUpper a == toUpper b)) s s - return s - -pas = patch $ makeTokenParser pascalLanguageDef - where - patch tp = tp {stringLiteral = stringL} - -comment = choice [ - char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}') - , (try $ string "(*") >> manyTill anyChar (try $ string "*)") - , (try $ string "//") >> manyTill anyChar (try newline) - ] - -comments = do - spaces - skipMany $ do - preprocessorSwitch <|> comment - spaces - -stringL = do - (char '\'') - s <- (many $ noneOf "'") - (char '\'') - ss <- many $ do - (char '\'') - s' <- (many $ noneOf "'") - (char '\'') - return $ '\'' : s' - comments - return $ concat (s:ss) diff -r 11438c0bd46b -r bce8cf41d666 tools/PascalParser.hs --- a/tools/PascalParser.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,659 +0,0 @@ -module PascalParser where - -import Text.Parsec -import Text.Parsec.Char -import Text.Parsec.Token -import Text.Parsec.Language -import Text.Parsec.Expr -import Text.Parsec.Prim -import Text.Parsec.Combinator -import Text.Parsec.String -import Control.Monad -import Data.Maybe -import Data.Char - -import PascalBasics -import PascalUnitSyntaxTree - -knownTypes = ["shortstring", "ansistring", "char", "byte"] - -pascalUnit = do - comments - u <- choice [program, unit, systemUnit, redoUnit] - comments - return u - -iD = do - i <- liftM (flip Identifier BTUnknown) (identifier pas) - comments - return i - -unit = do - string "unit" >> comments - name <- iD - semi pas - comments - int <- interface - impl <- implementation - comments - return $ Unit name int impl Nothing Nothing - - -reference = buildExpressionParser table term "reference" - where - term = comments >> choice [ - parens pas (liftM RefExpression expression >>= postfixes) >>= postfixes - , try $ typeCast >>= postfixes - , char '@' >> liftM Address reference >>= postfixes - , liftM SimpleReference iD >>= postfixes - ] "simple reference" - - table = [ - ] - - postfixes r = many postfix >>= return . foldl (flip ($)) r - postfix = choice [ - parens pas (option [] parameters) >>= return . FunCall - , char '^' >> return Dereference - , (brackets pas) (commaSep1 pas $ expression) >>= return . ArrayElement - , (char '.' >> notFollowedBy (char '.')) >> liftM (flip RecordField) reference - ] - - typeCast = do - t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes - e <- parens pas expression - comments - return $ TypeCast (Identifier t BTUnknown) e - -varsDecl1 = varsParser sepEndBy1 -varsDecl = varsParser sepEndBy -varsParser m endsWithSemi = do - vs <- m (aVarDecl endsWithSemi) (semi pas) - return vs - -aVarDecl endsWithSemi = do - isVar <- liftM (== Just "var") $ - if not endsWithSemi then - optionMaybe $ choice [ - try $ string "var" - , try $ string "const" - , try $ string "out" - ] - else - return Nothing - comments - ids <- do - i <- (commaSep1 pas) $ (try iD "variable declaration") - char ':' - return i - comments - t <- typeDecl "variable type declaration" - comments - init <- option Nothing $ do - char '=' - comments - e <- initExpression - comments - return (Just e) - return $ VarDeclaration isVar False (ids, t) init - - -constsDecl = do - vs <- many1 (try (aConstDecl >>= \i -> semi pas >> return i) >>= \i -> comments >> return i) - comments - return vs - where - aConstDecl = do - comments - i <- iD - t <- optionMaybe $ do - char ':' - comments - t <- typeDecl - comments - return t - char '=' - comments - e <- initExpression - comments - return $ VarDeclaration False (isNothing t) ([i], fromMaybe (DeriveType e) t) (Just e) - -typeDecl = choice [ - char '^' >> typeDecl >>= return . PointerTo - , try (string "shortstring") >> return (String 255) - , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255 - , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255 - , arrayDecl - , recordDecl - , setDecl - , functionType - , sequenceDecl >>= return . Sequence - , try iD >>= return . SimpleType - , rangeDecl >>= return . RangeType - ] "type declaration" - where - arrayDecl = do - try $ do - optional $ (try $ string "packed") >> comments - string "array" - comments - r <- option [] $ do - char '[' - r <- commaSep pas rangeDecl - char ']' - comments - return r - string "of" - comments - t <- typeDecl - if null r then - return $ ArrayDecl Nothing t - else - return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) - recordDecl = do - try $ do - optional $ (try $ string "packed") >> comments - string "record" - comments - vs <- varsDecl True - union <- optionMaybe $ do - string "case" - comments - iD - comments - string "of" - comments - many unionCase - string "end" - return $ RecordType vs union - setDecl = do - try $ string "set" >> space - comments - string "of" - comments - liftM Set typeDecl - unionCase = do - try $ commaSep pas $ (iD >> return ()) <|> (integer pas >> return ()) - char ':' - comments - u <- parens pas $ varsDecl True - char ';' - comments - return u - sequenceDecl = (parens pas) $ (commaSep pas) (iD >>= \i -> optional (spaces >> char '=' >> spaces >> integer pas) >> return i) - functionType = do - fp <- try (string "function") <|> try (string "procedure") - comments - vs <- option [] $ parens pas $ varsDecl False - comments - ret <- if (fp == "function") then do - char ':' - comments - ret <- typeDecl - comments - return ret - else - return VoidType - optional $ try $ char ';' >> comments >> string "cdecl" - comments - return $ FunctionType ret vs - -typesDecl = many (aTypeDecl >>= \t -> comments >> return t) - where - aTypeDecl = do - i <- try $ do - i <- iD "type declaration" - comments - char '=' - return i - comments - t <- typeDecl - comments - semi pas - comments - return $ TypeDeclaration i t - -rangeDecl = choice [ - try $ rangeft - , iD >>= return . Range - ] "range declaration" - where - rangeft = do - e1 <- initExpression - string ".." - e2 <- initExpression - return $ RangeFromTo e1 e2 - -typeVarDeclaration isImpl = (liftM concat . many . choice) [ - varSection, - constSection, - typeSection, - funcDecl, - operatorDecl - ] - where - varSection = do - try $ string "var" - comments - v <- varsDecl1 True "variable declaration" - comments - return v - - constSection = do - try $ string "const" - comments - c <- constsDecl "const declaration" - comments - return c - - typeSection = do - try $ string "type" - comments - t <- typesDecl "type declaration" - comments - return t - - operatorDecl = do - try $ string "operator" - comments - i <- manyTill anyChar space - comments - vs <- parens pas $ varsDecl False - comments - rid <- iD - comments - char ':' - comments - ret <- typeDecl - comments - return ret - char ';' - comments - forward <- liftM isJust $ optionMaybe (try (string "forward;") >> comments) - inline <- liftM (any (== "inline;")) $ many functionDecorator - b <- if isImpl && (not forward) then - liftM Just functionBody - else - return Nothing - return $ [OperatorDeclaration i rid inline ret vs b] - - - funcDecl = do - fp <- try (string "function") <|> try (string "procedure") - comments - i <- iD - vs <- option [] $ parens pas $ varsDecl False - comments - ret <- if (fp == "function") then do - char ':' - comments - ret <- typeDecl - comments - return ret - else - return VoidType - char ';' - comments - forward <- liftM isJust $ optionMaybe (try (string "forward;") >> comments) - inline <- liftM (any (== "inline;")) $ many functionDecorator - b <- if isImpl && (not forward) then - liftM Just functionBody - else - return Nothing - return $ [FunctionDeclaration i inline ret vs b] - - functionDecorator = do - d <- choice [ - try $ string "inline;" - , try $ caseInsensitiveString "cdecl;" - , try $ string "overload;" - , try $ string "export;" - , try $ string "varargs;" - , try (string "external") >> comments >> iD >> optional (string "name" >> comments >> stringLiteral pas)>> string ";" - ] - comments - return d - - -program = do - string "program" - comments - name <- iD - (char ';') - comments - comments - u <- uses - comments - tv <- typeVarDeclaration True - comments - p <- phrase - comments - char '.' - comments - return $ Program name (Implementation u (TypesAndVars tv)) p - -interface = do - string "interface" - comments - u <- uses - comments - tv <- typeVarDeclaration False - comments - return $ Interface u (TypesAndVars tv) - -implementation = do - string "implementation" - comments - u <- uses - comments - tv <- typeVarDeclaration True - string "end." - comments - return $ Implementation u (TypesAndVars tv) - -expression = do - buildExpressionParser table term "expression" - where - term = comments >> choice [ - builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n BTUnknown)) - , try (parens pas $ expression >>= \e -> notFollowedBy (comments >> char '.') >> return e) - , brackets pas (commaSep pas iD) >>= return . SetExpression - , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . NumberLiteral . show) i - , float pas >>= return . FloatLiteral . show - , try $ integer pas >>= return . NumberLiteral . show - , try (string "_S" >> stringLiteral pas) >>= return . StringLiteral - , try (string "_P" >> stringLiteral pas) >>= return . PCharLiteral - , stringLiteral pas >>= return . strOrChar - , try (string "#$") >> many hexDigit >>= \c -> comments >> return (HexCharCode c) - , char '#' >> many digit >>= \c -> comments >> return (CharCode c) - , char '$' >> many hexDigit >>= \h -> comments >> return (HexNumber h) - --, char '-' >> expression >>= return . PrefixOp "-" - , char '-' >> reference >>= return . PrefixOp "-" . Reference - , (try $ string "not" >> notFollowedBy comments) >> unexpected "'not'" - , try $ string "nil" >> return Null - , reference >>= return . Reference - ] "simple expression" - - table = [ - [ Prefix (try (string "not") >> return (PrefixOp "not")) - , Prefix (try (char '-') >> return (PrefixOp "-"))] - , - [ Infix (char '*' >> return (BinOp "*")) AssocLeft - , Infix (char '/' >> return (BinOp "/")) AssocLeft - , Infix (try (string "div") >> return (BinOp "div")) AssocLeft - , Infix (try (string "mod") >> return (BinOp "mod")) AssocLeft - , Infix (try (string "in") >> return (BinOp "in")) AssocNone - , Infix (try $ string "and" >> return (BinOp "and")) AssocLeft - , Infix (try $ string "shl" >> return (BinOp "shl")) AssocLeft - , Infix (try $ string "shr" >> return (BinOp "shr")) AssocLeft - ] - , [ Infix (char '+' >> return (BinOp "+")) AssocLeft - , Infix (char '-' >> return (BinOp "-")) AssocLeft - , Infix (try $ string "or" >> return (BinOp "or")) AssocLeft - , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft - ] - , [ Infix (try (string "<>") >> return (BinOp "<>")) AssocNone - , Infix (try (string "<=") >> return (BinOp "<=")) AssocNone - , Infix (try (string ">=") >> return (BinOp ">=")) AssocNone - , Infix (char '<' >> return (BinOp "<")) AssocNone - , Infix (char '>' >> return (BinOp ">")) AssocNone - ] - {-, [ Infix (try $ string "shl" >> return (BinOp "shl")) AssocNone - , Infix (try $ string "shr" >> return (BinOp "shr")) AssocNone - ] - , [ - Infix (try $ string "or" >> return (BinOp "or")) AssocLeft - , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft - ]-} - , [ - Infix (char '=' >> return (BinOp "=")) AssocNone - ] - ] - strOrChar [a] = CharCode . show . ord $ a - strOrChar a = StringLiteral a - -phrasesBlock = do - try $ string "begin" - comments - p <- manyTill phrase (try $ string "end" >> notFollowedBy alphaNum) - comments - return $ Phrases p - -phrase = do - o <- choice [ - phrasesBlock - , ifBlock - , whileCycle - , repeatCycle - , switchCase - , withBlock - , forCycle - , (try $ reference >>= \r -> string ":=" >> return r) >>= \r -> comments >> expression >>= return . Assignment r - , builtInFunction expression >>= \(n, e) -> return $ BuiltInFunctionCall e (SimpleReference (Identifier n BTUnknown)) - , procCall - , char ';' >> comments >> return NOP - ] - optional $ char ';' - comments - return o - -ifBlock = do - try $ string "if" >> notFollowedBy (alphaNum <|> char '_') - comments - e <- expression - comments - string "then" - comments - o1 <- phrase - comments - o2 <- optionMaybe $ do - try $ string "else" >> space - comments - o <- option NOP phrase - comments - return o - return $ IfThenElse e o1 o2 - -whileCycle = do - try $ string "while" - comments - e <- expression - comments - string "do" - comments - o <- phrase - return $ WhileCycle e o - -withBlock = do - try $ string "with" >> space - comments - rs <- (commaSep1 pas) reference - comments - string "do" - comments - o <- phrase - return $ foldr WithBlock o rs - -repeatCycle = do - try $ string "repeat" >> space - comments - o <- many phrase - string "until" - comments - e <- expression - comments - return $ RepeatCycle e o - -forCycle = do - try $ string "for" >> space - comments - i <- iD - comments - string ":=" - comments - e1 <- expression - comments - up <- liftM (== Just "to") $ - optionMaybe $ choice [ - try $ string "to" - , try $ string "downto" - ] - --choice [string "to", string "downto"] - comments - e2 <- expression - comments - string "do" - comments - p <- phrase - comments - return $ ForCycle i e1 e2 p up - -switchCase = do - try $ string "case" - comments - e <- expression - comments - string "of" - comments - cs <- many1 aCase - o2 <- optionMaybe $ do - try $ string "else" >> notFollowedBy alphaNum - comments - o <- many phrase - comments - return o - string "end" - comments - return $ SwitchCase e cs o2 - where - aCase = do - e <- (commaSep pas) $ (liftM InitRange rangeDecl <|> initExpression) - comments - char ':' - comments - p <- phrase - comments - return (e, p) - -procCall = do - r <- reference - p <- option [] $ (parens pas) parameters - return $ ProcCall r p - -parameters = (commaSep pas) expression "parameters" - -functionBody = do - tv <- typeVarDeclaration True - comments - p <- phrasesBlock - char ';' - comments - return (TypesAndVars tv, p) - -uses = liftM Uses (option [] u) - where - u = do - string "uses" - comments - u <- (iD >>= \i -> comments >> return i) `sepBy1` (char ',' >> comments) - char ';' - comments - return u - -initExpression = buildExpressionParser table term "initialization expression" - where - term = comments >> choice [ - liftM (uncurry BuiltInFunction) $ builtInFunction initExpression - , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet - , try $ parens pas (commaSep pas $ initExpression) >>= \ia -> when (null $ tail ia) mzero >> return (InitArray ia) - , try $ parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord - , parens pas initExpression - , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . InitNumber . show) i - , try $ float pas >>= return . InitFloat . show - , try $ integer pas >>= return . InitNumber . show - , stringLiteral pas >>= return . InitString - , char '#' >> many digit >>= \c -> comments >> return (InitChar c) - , char '$' >> many hexDigit >>= \h -> comments >> return (InitHexNumber h) - , char '@' >> initExpression >>= \c -> comments >> return (InitAddress c) - , try $ string "nil" >> return InitNull - , itypeCast - , iD >>= return . InitReference - ] - - recField = do - i <- iD - spaces - char ':' - spaces - e <- initExpression - spaces - return (i ,e) - - table = [ - [ - Prefix (char '-' >> return (InitPrefixOp "-")) - ,Prefix (try (string "not") >> return (InitPrefixOp "not")) - ] - , [ Infix (char '*' >> return (InitBinOp "*")) AssocLeft - , Infix (char '/' >> return (InitBinOp "/")) AssocLeft - , Infix (try (string "div") >> return (InitBinOp "div")) AssocLeft - , Infix (try (string "mod") >> return (InitBinOp "mod")) AssocLeft - , Infix (try $ string "and" >> return (InitBinOp "and")) AssocLeft - , Infix (try $ string "shl" >> return (InitBinOp "shl")) AssocNone - , Infix (try $ string "shr" >> return (InitBinOp "shr")) AssocNone - ] - , [ Infix (char '+' >> return (InitBinOp "+")) AssocLeft - , Infix (char '-' >> return (InitBinOp "-")) AssocLeft - , Infix (try $ string "or" >> return (InitBinOp "or")) AssocLeft - , Infix (try $ string "xor" >> return (InitBinOp "xor")) AssocLeft - ] - , [ Infix (try (string "<>") >> return (InitBinOp "<>")) AssocNone - , Infix (try (string "<=") >> return (InitBinOp "<=")) AssocNone - , Infix (try (string ">=") >> return (InitBinOp ">=")) AssocNone - , Infix (char '<' >> return (InitBinOp "<")) AssocNone - , Infix (char '>' >> return (InitBinOp ">")) AssocNone - , Infix (char '=' >> return (InitBinOp "=")) AssocNone - ] - {--, [ Infix (try $ string "and" >> return (InitBinOp "and")) AssocLeft - , Infix (try $ string "or" >> return (InitBinOp "or")) AssocLeft - , Infix (try $ string "xor" >> return (InitBinOp "xor")) AssocLeft - ] - , [ Infix (try $ string "shl" >> return (InitBinOp "shl")) AssocNone - , Infix (try $ string "shr" >> return (InitBinOp "shr")) AssocNone - ]--} - --, [Prefix (try (string "not") >> return (InitPrefixOp "not"))] - ] - - itypeCast = do - t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes - i <- parens pas initExpression - comments - return $ InitTypeCast (Identifier t BTUnknown) i - -builtInFunction e = do - name <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) builtin - spaces - exprs <- option [] $ parens pas $ option [] $ commaSep1 pas $ e - spaces - return (name, exprs) - -systemUnit = do - string "system;" - comments - string "type" - comments - t <- typesDecl - string "var" - v <- varsDecl True - return $ System (t ++ v) - -redoUnit = do - string "redo;" - comments - string "type" - comments - t <- typesDecl - string "var" - v <- varsDecl True - return $ Redo (t ++ v) - diff -r 11438c0bd46b -r bce8cf41d666 tools/PascalPreprocessor.hs --- a/tools/PascalPreprocessor.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -module PascalPreprocessor where - -import Text.Parsec -import Control.Monad.IO.Class -import Control.Monad -import System.IO -import qualified Data.Map as Map -import Data.Char - - --- comments are removed -comment = choice [ - char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}') >> return "" - , (try $ string "(*") >> manyTill anyChar (try $ string "*)") >> return "" - , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n" - ] - -initDefines = Map.fromList [ - ("FPC", "") - , ("PAS2C", "") - , ("ENDIAN_LITTLE", "") - ] - -preprocess :: String -> IO String -preprocess fn = do - r <- runParserT (preprocessFile fn) (initDefines, [True]) "" "" - case r of - (Left a) -> do - hPutStrLn stderr (show a) - return "" - (Right a) -> return a - - where - preprocessFile fn = do - f <- liftIO (readFile fn) - setInput f - preprocessor - - preprocessor, codeBlock, switch :: ParsecT String (Map.Map String String, [Bool]) IO String - - preprocessor = chainr codeBlock (return (++)) "" - - codeBlock = do - s <- choice [ - switch - , comment - , char '\'' >> many (noneOf "'\n") >>= \s -> char '\'' >> return ('\'' : s ++ "'") - , identifier >>= replace - , noneOf "{" >>= \a -> return [a] - ] - (_, ok) <- getState - return $ if and ok then s else "" - - --otherChar c = c `notElem` "{/('_" && not (isAlphaNum c) - identifier = do - c <- letter <|> oneOf "_" - s <- many (alphaNum <|> oneOf "_") - return $ c:s - - switch = do - try $ string "{$" - s <- choice [ - include - , ifdef - , if' - , elseSwitch - , endIf - , define - , unknown - ] - return s - - include = do - try $ string "INCLUDE" - spaces - (char '"') - fn <- many1 $ noneOf "\"\n" - char '"' - spaces - char '}' - f <- liftIO (readFile fn `catch` error ("File not found: " ++ fn)) - c <- getInput - setInput $ f ++ c - return "" - - ifdef = do - s <- try (string "IFDEF") <|> try (string "IFNDEF") - let f = if s == "IFNDEF" then not else id - - spaces - d <- identifier - spaces - char '}' - - updateState $ \(m, b) -> - (m, (f $ d `Map.member` m) : b) - - return "" - - if' = do - s <- try (string "IF" >> notFollowedBy alphaNum) - - manyTill anyChar (char '}') - --char '}' - - updateState $ \(m, b) -> - (m, False : b) - - return "" - - elseSwitch = do - try $ string "ELSE}" - updateState $ \(m, b:bs) -> (m, (not b):bs) - return "" - endIf = do - try $ string "ENDIF}" - updateState $ \(m, b:bs) -> (m, bs) - return "" - define = do - try $ string "DEFINE" - spaces - i <- identifier - d <- ((string ":=" >> return ()) <|> spaces) >> many (noneOf "}") - char '}' - updateState $ \(m, b) -> (if (and b) && (head i /= '_') then Map.insert i d m else m, b) - return "" - replace s = do - (m, _) <- getState - return $ Map.findWithDefault s s m - - unknown = do - fn <- many1 $ noneOf "}\n" - char '}' - return $ "{$" ++ fn ++ "}" diff -r 11438c0bd46b -r bce8cf41d666 tools/PascalUnitSyntaxTree.hs --- a/tools/PascalUnitSyntaxTree.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -module PascalUnitSyntaxTree where - -import Data.Maybe -import Data.Char - -data PascalUnit = - Program Identifier Implementation Phrase - | Unit Identifier Interface Implementation (Maybe Initialize) (Maybe Finalize) - | System [TypeVarDeclaration] - | Redo [TypeVarDeclaration] - deriving Show -data Interface = Interface Uses TypesAndVars - deriving Show -data Implementation = Implementation Uses TypesAndVars - deriving Show -data Identifier = Identifier String BaseType - deriving Show -data TypesAndVars = TypesAndVars [TypeVarDeclaration] - deriving Show -data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl - | VarDeclaration Bool Bool ([Identifier], TypeDecl) (Maybe InitExpression) - | FunctionDeclaration Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase)) - | OperatorDeclaration String Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase)) - deriving Show -data TypeDecl = SimpleType Identifier - | RangeType Range - | Sequence [Identifier] - | ArrayDecl (Maybe Range) TypeDecl - | RecordType [TypeVarDeclaration] (Maybe [[TypeVarDeclaration]]) - | PointerTo TypeDecl - | String Integer - | Set TypeDecl - | FunctionType TypeDecl [TypeVarDeclaration] - | DeriveType InitExpression - | VoidType - | VarParamType TypeDecl -- this is a hack - deriving Show -data Range = Range Identifier - | RangeFromTo InitExpression InitExpression - | RangeInfinite - deriving Show -data Initialize = Initialize String - deriving Show -data Finalize = Finalize String - deriving Show -data Uses = Uses [Identifier] - deriving Show -data Phrase = ProcCall Reference [Expression] - | IfThenElse Expression Phrase (Maybe Phrase) - | WhileCycle Expression Phrase - | RepeatCycle Expression [Phrase] - | ForCycle Identifier Expression Expression Phrase Bool -- The last Boolean indicates wether it's up or down counting - | WithBlock Reference Phrase - | Phrases [Phrase] - | SwitchCase Expression [([InitExpression], Phrase)] (Maybe [Phrase]) - | Assignment Reference Expression - | BuiltInFunctionCall [Expression] Reference - | NOP - deriving Show -data Expression = Expression String - | BuiltInFunCall [Expression] Reference - | PrefixOp String Expression - | PostfixOp String Expression - | BinOp String Expression Expression - | StringLiteral String - | PCharLiteral String - | CharCode String - | HexCharCode String - | NumberLiteral String - | FloatLiteral String - | HexNumber String - | Reference Reference - | SetExpression [Identifier] - | Null - deriving Show -data Reference = ArrayElement [Expression] Reference - | FunCall [Expression] Reference - | TypeCast Identifier Expression - | SimpleReference Identifier - | Dereference Reference - | RecordField Reference Reference - | Address Reference - | RefExpression Expression - deriving Show -data InitExpression = InitBinOp String InitExpression InitExpression - | InitPrefixOp String InitExpression - | InitReference Identifier - | InitArray [InitExpression] - | InitRecord [(Identifier, InitExpression)] - | InitFloat String - | InitNumber String - | InitHexNumber String - | InitString String - | InitChar String - | BuiltInFunction String [InitExpression] - | InitSet [InitExpression] - | InitAddress InitExpression - | InitNull - | InitRange Range - | InitTypeCast Identifier InitExpression - deriving Show - -data BaseType = BTUnknown - | BTChar - | BTString - | BTInt - | BTBool - | BTFloat - | BTRecord String [(String, BaseType)] - | BTArray Range BaseType BaseType - | BTFunction Bool Int BaseType - | BTPointerTo BaseType - | BTUnresolved String - | BTSet BaseType - | BTEnum [String] - | BTVoid - | BTUnit - | BTVarParam BaseType - deriving Show diff -r 11438c0bd46b -r bce8cf41d666 tools/build_windows.bat --- a/tools/build_windows.bat Tue Apr 30 01:47:30 2013 +0200 +++ b/tools/build_windows.bat Thu Jun 13 22:27:23 2013 +0200 @@ -13,7 +13,8 @@ if %BUILD_TYPE%=="Debug" ( for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\ ) -for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do ( +:: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10 +for %%G in (QtCore4 QtGui4 QtNetwork4) do ( xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\ ) @@ -39,7 +40,8 @@ echo Running cmake... set ERRORLEVEL= -cmake . -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" +cmake . -G "MinGW Makefiles" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils\\" +:: prefix should be last if %ERRORLEVEL% NEQ 0 goto exitpoint diff -r 11438c0bd46b -r bce8cf41d666 tools/pas2c.hs --- a/tools/pas2c.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1086 +0,0 @@ -{-# LANGUAGE ScopedTypeVariables #-} -module Pas2C where - -import Text.PrettyPrint.HughesPJ -import Data.Maybe -import Data.Char -import Text.Parsec.Prim hiding (State) -import Control.Monad.State -import System.IO -import System.Directory -import Control.Monad.IO.Class -import PascalPreprocessor -import Control.Exception -import System.IO.Error -import qualified Data.Map as Map -import qualified Data.Set as Set -import Data.List (find) -import Numeric - -import PascalParser(pascalUnit) -import PascalUnitSyntaxTree - - -data InsertOption = - IOInsert - | IOInsertWithType Doc - | IOLookup - | IOLookupLast - | IOLookupFunction Int - | IODeferred - -data Record = Record - { - lcaseId :: String, - baseType :: BaseType, - typeDecl :: Doc - } - deriving Show -type Records = Map.Map String [Record] -data RenderState = RenderState - { - currentScope :: Records, - lastIdentifier :: String, - lastType :: BaseType, - lastIdTypeDecl :: Doc, - stringConsts :: [(String, String)], - uniqCounter :: Int, - toMangle :: Set.Set String, - currentUnit :: String, - currentFunctionResult :: String, - namespaces :: Map.Map String Records - } - -rec2Records = map (\(a, b) -> Record a b empty) - -emptyState = RenderState Map.empty "" BTUnknown empty [] 0 Set.empty "" "" - -getUniq :: State RenderState Int -getUniq = do - i <- gets uniqCounter - modify(\s -> s{uniqCounter = uniqCounter s + 1}) - return i - -addStringConst :: String -> State RenderState Doc -addStringConst str = do - strs <- gets stringConsts - let a = find ((==) str . snd) strs - if isJust a then - do - modify (\s -> s{lastType = BTString}) - return . text . fst . fromJust $ a - else - do - i <- getUniq - let sn = "__str" ++ show i - modify (\s -> s{lastType = BTString, stringConsts = (sn, str) : strs}) - return $ text sn - -escapeStr :: String -> String -escapeStr = foldr escapeChar [] - -escapeChar :: Char -> ShowS -escapeChar '"' s = "\\\"" ++ s -escapeChar '\\' s = "\\\\" ++ s -escapeChar a s = a : s - -strInit :: String -> Doc -strInit a = text "STRINIT" <> parens (doubleQuotes (text $ escapeStr a)) - -renderStringConsts :: State RenderState Doc -renderStringConsts = liftM (vcat . map (\(a, b) -> text "static const string255" <+> (text a) <+> text "=" <+> strInit b <> semi)) - $ gets stringConsts - -docToLower :: Doc -> Doc -docToLower = text . map toLower . render - -pas2C :: String -> IO () -pas2C fn = do - setCurrentDirectory "../hedgewars/" - s <- flip execStateT initState $ f fn - renderCFiles s - where - printLn = liftIO . hPutStrLn stdout - print = liftIO . hPutStr stdout - initState = Map.empty - f :: String -> StateT (Map.Map String PascalUnit) IO () - f fileName = do - processed <- gets $ Map.member fileName - unless processed $ do - print ("Preprocessing '" ++ fileName ++ ".pas'... ") - fc' <- liftIO - $ tryJust (guard . isDoesNotExistError) - $ preprocess (fileName ++ ".pas") - case fc' of - (Left a) -> do - modify (Map.insert fileName (System [])) - printLn "doesn't exist" - (Right fc) -> do - print "ok, parsing... " - let ptree = parse pascalUnit fileName fc - case ptree of - (Left a) -> do - liftIO $ writeFile "preprocess.out" fc - printLn $ show a ++ "\nsee preprocess.out for preprocessed source" - fail "stop" - (Right a) -> do - printLn "ok" - modify (Map.insert fileName a) - mapM_ f (usesFiles a) - - -renderCFiles :: Map.Map String PascalUnit -> IO () -renderCFiles units = do - let u = Map.toList units - let nss = Map.map (toNamespace nss) units - --hPutStrLn stderr $ "Units: " ++ (show . Map.keys . Map.filter (not . Map.null) $ nss) - --writeFile "pas2c.log" $ unlines . map (\t -> show (fst t) ++ "\n" ++ (unlines . map ((:) '\t' . show) . snd $ t)) . Map.toList $ nss - mapM_ (toCFiles nss) u - where - toNamespace :: Map.Map String Records -> PascalUnit -> Records - toNamespace nss (System tvs) = - currentScope $ execState f (emptyState nss) - where - f = do - checkDuplicateFunDecls tvs - mapM_ (tvar2C True False True False) tvs - toNamespace nss (Redo tvs) = -- functions that are re-implemented, add prefix to all of them - currentScope $ execState f (emptyState nss){currentUnit = "fpcrtl_"} - where - f = do - checkDuplicateFunDecls tvs - mapM_ (tvar2C True False True False) tvs - toNamespace _ (Program {}) = Map.empty - toNamespace nss (Unit (Identifier i _) interface _ _ _) = - currentScope $ execState (interface2C interface True) (emptyState nss){currentUnit = map toLower i ++ "_"} - - -withState' :: (RenderState -> RenderState) -> State RenderState a -> State RenderState a -withState' f sf = do - st <- liftM f get - let (a, s) = runState sf st - modify(\st -> st{ - lastType = lastType s - , uniqCounter = uniqCounter s - , stringConsts = stringConsts s - }) - return a - -withLastIdNamespace f = do - li <- gets lastIdentifier - nss <- gets namespaces - withState' (\st -> st{currentScope = fromMaybe Map.empty $ Map.lookup li (namespaces st)}) f - -withRecordNamespace :: String -> [Record] -> State RenderState Doc -> State RenderState Doc -withRecordNamespace _ [] = error "withRecordNamespace: empty record" -withRecordNamespace prefix recs = withState' f - where - f st = st{currentScope = Map.unionWith un records (currentScope st), currentUnit = ""} - records = Map.fromList $ map (\(Record a b d) -> (map toLower a, [Record (prefix ++ a) b d])) recs - un [a] b = a : b - -toCFiles :: Map.Map String Records -> (String, PascalUnit) -> IO () -toCFiles _ (_, System _) = return () -toCFiles _ (_, Redo _) = return () -toCFiles ns p@(fn, pu) = do - hPutStrLn stdout $ "Rendering '" ++ fn ++ "'..." - toCFiles' p - where - toCFiles' (fn, p@(Program {})) = writeFile (fn ++ ".c") $ "#include \"fpcrtl.h\"\n" ++ (render2C initialState . pascal2C) p - toCFiles' (fn, (Unit unitId@(Identifier i _) interface implementation _ _)) = do - let (a, s) = runState (id2C IOInsert (setBaseType BTUnit unitId) >> interface2C interface True) initialState{currentUnit = map toLower i ++ "_"} - (a', s') = runState (id2C IOInsert (setBaseType BTUnit unitId) >> interface2C interface False) initialState{currentUnit = map toLower i ++ "_"} - writeFile (fn ++ ".h") $ "#pragma once\n\n#include \"pas2c.h\"\n\n" ++ (render (a $+$ text "")) - writeFile (fn ++ ".c") $ "#include \"fpcrtl.h\"\n\n#include \"" ++ fn ++ ".h\"\n" ++ render (a' $+$ text "") ++ (render2C s . implementation2C) implementation - initialState = emptyState ns - - render2C :: RenderState -> State RenderState Doc -> String - render2C a = render . ($+$ empty) . flip evalState a - - -usesFiles :: PascalUnit -> [String] -usesFiles (Program _ (Implementation uses _) _) = ["pas2cSystem", "pas2cRedo"] ++ uses2List uses -usesFiles (Unit _ (Interface uses1 _) (Implementation uses2 _) _ _) = ["pas2cSystem", "pas2cRedo"] ++ uses2List uses1 ++ uses2List uses2 -usesFiles (System {}) = [] -usesFiles (Redo {}) = [] - -pascal2C :: PascalUnit -> State RenderState Doc -pascal2C (Unit _ interface implementation init fin) = - liftM2 ($+$) (interface2C interface True) (implementation2C implementation) - -pascal2C (Program _ implementation mainFunction) = do - impl <- implementation2C implementation - [main] <- tvar2C True False True True (FunctionDeclaration (Identifier "main" BTInt) False (SimpleType $ Identifier "int" BTInt) [VarDeclaration False False ([Identifier "argc" BTInt], SimpleType (Identifier "Integer" BTInt)) Nothing, VarDeclaration False False ([Identifier "argv" BTUnknown], SimpleType (Identifier "PPChar" BTUnknown)) Nothing] (Just (TypesAndVars [], mainFunction))) - return $ impl $+$ main - - --- the second bool indicates whether do normal interface translation or generate variable declarations --- that will be inserted into implementation files -interface2C :: Interface -> Bool -> State RenderState Doc -interface2C (Interface uses tvars) True = do - u <- uses2C uses - tv <- typesAndVars2C True True True tvars - r <- renderStringConsts - return (u $+$ r $+$ tv) -interface2C (Interface uses tvars) False = do - u <- uses2C uses - tv <- typesAndVars2C True False False tvars - r <- renderStringConsts - return tv - -implementation2C :: Implementation -> State RenderState Doc -implementation2C (Implementation uses tvars) = do - u <- uses2C uses - tv <- typesAndVars2C True False True tvars - r <- renderStringConsts - return (u $+$ r $+$ tv) - -checkDuplicateFunDecls :: [TypeVarDeclaration] -> State RenderState () -checkDuplicateFunDecls tvs = - modify $ \s -> s{toMangle = Map.keysSet . Map.filter (> 1) . foldr ins initMap $ tvs} - where - initMap = Map.empty - --initMap = Map.fromList [("reset", 2)] - ins (FunctionDeclaration (Identifier i _) _ _ _ _) m = Map.insertWith (+) (map toLower i) 1 m - ins _ m = m - --- the second bool indicates whether declare variable as extern or not --- the third bool indicates whether include types or not - -typesAndVars2C :: Bool -> Bool -> Bool -> TypesAndVars -> State RenderState Doc -typesAndVars2C b externVar includeType(TypesAndVars ts) = do - checkDuplicateFunDecls ts - liftM (vcat . map (<> semi) . concat) $ mapM (tvar2C b externVar includeType False) ts - -setBaseType :: BaseType -> Identifier -> Identifier -setBaseType bt (Identifier i _) = Identifier i bt - -uses2C :: Uses -> State RenderState Doc -uses2C uses@(Uses unitIds) = do - - mapM_ injectNamespace (Identifier "pas2cSystem" undefined : unitIds) - mapM_ injectNamespace (Identifier "pas2cRedo" undefined : unitIds) - mapM_ (id2C IOInsert . setBaseType BTUnit) unitIds - return $ vcat . map (\i -> text $ "#include \"" ++ i ++ ".h\"") $ uses2List uses - where - injectNamespace (Identifier i _) = do - getNS <- gets (flip Map.lookup . namespaces) - modify (\s -> s{currentScope = Map.unionWith (++) (fromMaybe Map.empty (getNS i)) $ currentScope s}) - -uses2List :: Uses -> [String] -uses2List (Uses ids) = map (\(Identifier i _) -> i) ids - - -setLastIdValues vv = (\s -> s{lastType = baseType vv, lastIdentifier = lcaseId vv, lastIdTypeDecl = typeDecl vv}) - -id2C :: InsertOption -> Identifier -> State RenderState Doc -id2C IOInsert i = id2C (IOInsertWithType empty) i -id2C (IOInsertWithType d) (Identifier i t) = do - ns <- gets currentScope - tom <- gets (Set.member n . toMangle) - cu <- gets currentUnit - let (i', t') = case (t, tom) of - (BTFunction _ p _, True) -> (cu ++ i ++ ('_' : show p), t) - (BTFunction _ _ _, _) -> (cu ++ i, t) - (BTVarParam t', _) -> ('(' : '*' : i ++ ")" , t') - _ -> (i, t) - modify (\s -> s{currentScope = Map.insertWith (++) n [Record i' t' d] (currentScope s), lastIdentifier = n}) - return $ text i' - where - n = map toLower i - -id2C IOLookup i = id2CLookup head i -id2C IOLookupLast i = id2CLookup last i -id2C (IOLookupFunction params) (Identifier i t) = do - let i' = map toLower i - v <- gets $ Map.lookup i' . currentScope - lt <- gets lastType - if isNothing v then - error $ "Not defined: '" ++ i' ++ "'\n" ++ show lt ++ "\nwith num of params = " ++ show params ++ "\n" ++ show v - else - let vv = fromMaybe (head $ fromJust v) . find checkParam $ fromJust v in - modify (setLastIdValues vv) >> (return . text . lcaseId $ vv) - where - checkParam (Record _ (BTFunction _ p _) _) = p == params - checkParam _ = False -id2C IODeferred (Identifier i t) = do - let i' = map toLower i - v <- gets $ Map.lookup i' . currentScope - if (isNothing v) then - modify (\s -> s{lastType = BTUnknown, lastIdentifier = i}) >> return (text i) - else - let vv = head $ fromJust v in modify (setLastIdValues vv) >> (return . text . lcaseId $ vv) - -id2CLookup :: ([Record] -> Record) -> Identifier -> State RenderState Doc -id2CLookup f (Identifier i t) = do - let i' = map toLower i - v <- gets $ Map.lookup i' . currentScope - lt <- gets lastType - if isNothing v then - error $ "Not defined: '" ++ i' ++ "'\n" ++ show lt - else - let vv = f $ fromJust v in modify (setLastIdValues vv) >> (return . text . lcaseId $ vv) - - -id2CTyped :: TypeDecl -> Identifier -> State RenderState Doc -id2CTyped = id2CTyped2 Nothing - -id2CTyped2 :: Maybe Doc -> TypeDecl -> Identifier -> State RenderState Doc -id2CTyped2 md t (Identifier i _) = do - tb <- resolveType t - case (t, tb) of - (_, BTUnknown) -> do - error $ "id2CTyped: type BTUnknown for " ++ show i ++ "\ntype: " ++ show t - (SimpleType {}, BTRecord _ r) -> do - ts <- type2C t - id2C (IOInsertWithType $ ts empty) (Identifier i (BTRecord (render $ ts empty) r)) - (_, BTRecord _ r) -> do - ts <- type2C t - id2C (IOInsertWithType $ ts empty) (Identifier i (BTRecord i r)) - _ -> case md of - Nothing -> id2C IOInsert (Identifier i tb) - Just ts -> id2C (IOInsertWithType ts) (Identifier i tb) - - -resolveType :: TypeDecl -> State RenderState BaseType -resolveType st@(SimpleType (Identifier i _)) = do - let i' = map toLower i - v <- gets $ Map.lookup i' . currentScope - if isJust v then return . baseType . head $ fromJust v else return $ f i' - where - f "integer" = BTInt - f "pointer" = BTPointerTo BTVoid - f "boolean" = BTBool - f "float" = BTFloat - f "char" = BTChar - f "string" = BTString - f _ = error $ "Unknown system type: " ++ show st -resolveType (PointerTo (SimpleType (Identifier i _))) = return . BTPointerTo $ BTUnresolved (map toLower i) -resolveType (PointerTo t) = liftM BTPointerTo $ resolveType t -resolveType (RecordType tv mtvs) = do - tvs <- mapM f (concat $ tv : fromMaybe [] mtvs) - return . BTRecord "" . concat $ tvs - where - f :: TypeVarDeclaration -> State RenderState [(String, BaseType)] - f (VarDeclaration _ _ (ids, td) _) = mapM (\(Identifier i _) -> liftM ((,) i) $ resolveType td) ids -resolveType (ArrayDecl (Just i) t) = do - t' <- resolveType t - return $ BTArray i BTInt t' -resolveType (ArrayDecl Nothing t) = liftM (BTArray RangeInfinite BTInt) $ resolveType t -resolveType (FunctionType t a) = liftM (BTFunction False (length a)) $ resolveType t -resolveType (DeriveType (InitHexNumber _)) = return BTInt -resolveType (DeriveType (InitNumber _)) = return BTInt -resolveType (DeriveType (InitFloat _)) = return BTFloat -resolveType (DeriveType (InitString _)) = return BTString -resolveType (DeriveType (InitBinOp {})) = return BTInt -resolveType (DeriveType (InitPrefixOp _ e)) = initExpr2C e >> gets lastType -resolveType (DeriveType (BuiltInFunction{})) = return BTInt -resolveType (DeriveType (InitReference (Identifier{}))) = return BTBool -- TODO: derive from actual type -resolveType (DeriveType _) = return BTUnknown -resolveType (String _) = return BTString -resolveType VoidType = return BTVoid -resolveType (Sequence ids) = return $ BTEnum $ map (\(Identifier i _) -> map toLower i) ids -resolveType (RangeType _) = return $ BTVoid -resolveType (Set t) = liftM BTSet $ resolveType t -resolveType (VarParamType t) = liftM BTVarParam $ resolveType t - - -resolve :: String -> BaseType -> State RenderState BaseType -resolve s (BTUnresolved t) = do - v <- gets $ Map.lookup t . currentScope - if isJust v then - resolve s . baseType . head . fromJust $ v - else - error $ "Unknown type " ++ show t ++ "\n" ++ s -resolve _ t = return t - -fromPointer :: String -> BaseType -> State RenderState BaseType -fromPointer s (BTPointerTo t) = resolve s t -fromPointer s t = do - error $ "Dereferencing from non-pointer type " ++ show t ++ "\n" ++ s - - -functionParams2C params = liftM (hcat . punctuate comma . concat) $ mapM (tvar2C False False True True) params - -numberOfDeclarations :: [TypeVarDeclaration] -> Int -numberOfDeclarations = sum . map cnt - where - cnt (VarDeclaration _ _ (ids, _) _) = length ids - cnt _ = 1 - -hasPassByReference :: [TypeVarDeclaration] -> Bool -hasPassByReference = or . map isVar - where - isVar (VarDeclaration v _ (_, _) _) = v - isVar _ = error $ "hasPassByReference called not on function parameters" - -toIsVarList :: [TypeVarDeclaration] -> [Bool] -toIsVarList = concatMap isVar - where - isVar (VarDeclaration v _ (p, _) _) = replicate (length p) v - isVar _ = error $ "toIsVarList called not on function parameters" - - -funWithVarsToDefine :: String -> [TypeVarDeclaration] -> Doc -funWithVarsToDefine n params = text "#define" <+> text n <> parens abc <+> text (n ++ "__vars") <> parens cparams - where - abc = hcat . punctuate comma . map (char . fst) $ ps - cparams = hcat . punctuate comma . map (\(c, v) -> if v then char '&' <> parens (char c) else char c) $ ps - ps = zip ['a'..] (toIsVarList params) - -fun2C :: Bool -> String -> TypeVarDeclaration -> State RenderState [Doc] -fun2C _ _ (FunctionDeclaration name inline returnType params Nothing) = do - t <- type2C returnType - t'<- gets lastType - p <- withState' id $ functionParams2C params - n <- liftM render . id2C IOInsert $ setBaseType (BTFunction hasVars (numberOfDeclarations params) t') name - let decor = if inline then text "inline" else empty - if hasVars then - return [funWithVarsToDefine n params $+$ decor <+> t empty <+> text (n ++ "__vars") <> parens p] - else - return [decor <+> t empty <+> text n <> parens p] - where - hasVars = hasPassByReference params - - -fun2C True rv (FunctionDeclaration name@(Identifier i _) inline returnType params (Just (tvars, phrase))) = do - let res = docToLower $ text rv <> text "_result" - t <- type2C returnType - t'<- gets lastType - - notDeclared <- liftM isNothing . gets $ Map.lookup (map toLower i) . currentScope - - n <- liftM render . id2C IOInsert $ setBaseType (BTFunction hasVars (numberOfDeclarations params) t') name - - let isVoid = case returnType of - VoidType -> True - _ -> False - - (p, ph) <- withState' (\st -> st{currentScope = Map.insertWith un (map toLower rv) [Record (render res) t' empty] $ currentScope st - , currentFunctionResult = if isVoid then [] else render res}) $ do - p <- functionParams2C params - ph <- liftM2 ($+$) (typesAndVars2C False False True tvars) (phrase2C' phrase) - return (p, ph) - - let phrasesBlock = if isVoid then ph else t empty <+> res <> semi $+$ ph $+$ text "return" <+> res <> semi - let define = if hasVars then text "#ifndef" <+> text n $+$ funWithVarsToDefine n params $+$ text "#endif" else empty - let decor = if inline then text "inline" else empty - return [ - define - $+$ - --(if notDeclared && hasVars then funWithVarsToDefine n params else empty) $+$ - decor <+> t empty <+> text (if hasVars then n ++ "__vars" else n) <> parens p - $+$ - text "{" - $+$ - nest 4 phrasesBlock - $+$ - text "}"] - where - phrase2C' (Phrases p) = liftM vcat $ mapM phrase2C p - phrase2C' p = phrase2C p - un [a] b = a : b - hasVars = hasPassByReference params - -fun2C False _ (FunctionDeclaration (Identifier name _) _ _ _ _) = error $ "nested functions not allowed: " ++ name -fun2C _ tv _ = error $ "fun2C: I don't render " ++ show tv - --- the second bool indicates whether declare variable as extern or not --- the third bool indicates whether include types or not --- the fourth bool indicates whether ignore initialization or not (basically for dynamic arrays since we cannot do initialization in function params) -tvar2C :: Bool -> Bool -> Bool -> Bool -> TypeVarDeclaration -> State RenderState [Doc] -tvar2C b _ includeType _ f@(FunctionDeclaration (Identifier name _) _ _ _ _) = do - t <- fun2C b name f - if includeType then return t else return [] -tvar2C _ _ includeType _ td@(TypeDeclaration i' t) = do - i <- id2CTyped t i' - tp <- type2C t - return $ if includeType then [text "typedef" <+> tp i] else [] - -tvar2C _ _ _ _ (VarDeclaration True _ (ids, t) Nothing) = do - t' <- liftM ((empty <+>) . ) $ type2C t - liftM (map(\i -> t' i)) $ mapM (id2CTyped2 (Just $ t' empty) (VarParamType t)) ids - -tvar2C _ externVar includeType ignoreInit (VarDeclaration _ isConst (ids, t) mInitExpr) = do - t' <- liftM (((if isConst then text "static const" else if externVar - then text "extern" - else empty) - <+>) . ) $ type2C t - ie <- initExpr mInitExpr - lt <- gets lastType - case (isConst, lt, ids, mInitExpr) of - (True, BTInt, [i], Just _) -> do - i' <- id2CTyped t i - return $ if includeType then [text "enum" <> braces (i' <+> ie)] else [] - (True, BTFloat, [i], Just e) -> do - i' <- id2CTyped t i - ie <- initExpr2C e - return $ if includeType then [text "#define" <+> i' <+> parens ie <> text "\n"] else [] - (_, BTFunction{}, _, Nothing) -> liftM (map(\i -> t' i)) $ mapM (id2CTyped t) ids - (_, BTArray r _ _, [i], _) -> do - i' <- id2CTyped t i - ie' <- return $ case (r, mInitExpr, ignoreInit) of - (RangeInfinite, Nothing, False) -> text "= NULL" -- force dynamic array to be initialized as NULL if not initialized at all - (_, _, _) -> ie - result <- liftM (map(\i -> varDeclDecision isConst includeType (t' i) ie')) $ mapM (id2CTyped t) ids - case (r, ignoreInit) of - (RangeInfinite, False) -> - -- if the array is dynamic, add dimension info to it - return $ [dimDecl] ++ result - where - arrayDimStr = show $ arrayDimension t - arrayDimInitExp = text ("={" ++ ".dim = " ++ arrayDimStr ++ ", .a = {0, 0, 0, 0}}") - dimDecl = varDeclDecision isConst includeType (text "fpcrtl_dimension_t" <+> i' <> text "_dimension_info") arrayDimInitExp - - (_, _) -> return result - - _ -> liftM (map(\i -> varDeclDecision isConst includeType (t' i) ie)) $ mapM (id2CTyped2 (Just $ t' empty) t) ids - where - initExpr Nothing = return $ empty - initExpr (Just e) = liftM (text "=" <+>) (initExpr2C e) - varDeclDecision True True varStr expStr = varStr <+> expStr - varDeclDecision False True varStr expStr = if externVar then varStr else varStr <+> expStr - varDeclDecision False False varStr expStr = varStr <+> expStr - varDeclDecision True False varStr expStr = empty - arrayDimension a = case a of - ArrayDecl Nothing t -> let a = arrayDimension t in if a > 3 then error "Dynamic array with dimension > 4 is not supported." else 1 + arrayDimension t - ArrayDecl _ _ -> error "Mixed dynamic array and static array are not supported." - _ -> 0 - -tvar2C f _ _ _ (OperatorDeclaration op (Identifier i _) inline ret params body) = do - r <- op2CTyped op (extractTypes params) - fun2C f i (FunctionDeclaration r inline ret params body) - - -op2CTyped :: String -> [TypeDecl] -> State RenderState Identifier -op2CTyped op t = do - t' <- liftM (render . hcat . punctuate (char '_') . map (\t -> t empty)) $ mapM type2C t - bt <- gets lastType - return $ Identifier (t' ++ "_op_" ++ opStr) bt - where - opStr = case op of - "+" -> "add" - "-" -> "sub" - "*" -> "mul" - "/" -> "div" - "/(float)" -> "div" - "=" -> "eq" - "<" -> "lt" - ">" -> "gt" - "<>" -> "neq" - _ -> error $ "op2CTyped: unknown op '" ++ op ++ "'" - -extractTypes :: [TypeVarDeclaration] -> [TypeDecl] -extractTypes = concatMap f - where - f (VarDeclaration _ _ (ids, t) _) = replicate (length ids) t - f a = error $ "extractTypes: can't extract from " ++ show a - -initExpr2C, initExpr2C' :: InitExpression -> State RenderState Doc -initExpr2C (InitArray values) = liftM (braces . vcat . punctuate comma) $ mapM initExpr2C values -initExpr2C a = initExpr2C' a -initExpr2C' InitNull = return $ text "NULL" -initExpr2C' (InitAddress expr) = do - ie <- initExpr2C' expr - lt <- gets lastType - case lt of - BTFunction True _ _ -> return $ text "&" <> ie <> text "__vars" - _ -> return $ text "&" <> ie -initExpr2C' (InitPrefixOp op expr) = liftM (text (op2C op) <>) (initExpr2C' expr) -initExpr2C' (InitBinOp op expr1 expr2) = do - e1 <- initExpr2C' expr1 - e2 <- initExpr2C' expr2 - return $ parens $ e1 <+> text (op2C op) <+> e2 -initExpr2C' (InitNumber s) = return $ text s -initExpr2C' (InitFloat s) = return $ text s -initExpr2C' (InitHexNumber s) = return $ text "0x" <> (text . map toLower $ s) -initExpr2C' (InitString [a]) = return . quotes $ text [a] -initExpr2C' (InitString s) = return $ strInit s -initExpr2C' (InitChar a) = return $ quotes $ text "\\x" <> text (showHex (read a) "") -initExpr2C' (InitReference i) = id2C IOLookup i -initExpr2C' (InitRecord fields) = do - (fs :: [Doc]) <- mapM (\(Identifier a _, b) -> liftM (text "." <> text a <+> equals <+>) $ initExpr2C b) fields - return $ lbrace $+$ (nest 4 . vcat . punctuate comma $ fs) $+$ rbrace -initExpr2C' (InitArray [value]) = initExpr2C value -initExpr2C' r@(InitRange (Range i@(Identifier i' _))) = do - id2C IOLookup i - t <- gets lastType - case t of - BTEnum s -> return . int $ length s - BTInt -> case i' of - "byte" -> return $ int 256 - _ -> error $ "InitRange identifier: " ++ i' - _ -> error $ "InitRange: " ++ show r -initExpr2C' (InitRange (RangeFromTo (InitNumber "0") r)) = initExpr2C $ BuiltInFunction "succ" [r] -initExpr2C' (InitRange (RangeFromTo (InitChar "0") (InitChar r))) = initExpr2C $ BuiltInFunction "succ" [InitNumber r] -initExpr2C' (InitRange a) = error $ show a --return $ text "<>" -initExpr2C' (InitSet []) = return $ text "0" -initExpr2C' (InitSet a) = return $ text "<>" -initExpr2C' (BuiltInFunction "low" [InitReference e]) = return $ - case e of - (Identifier "LongInt" _) -> int (-2^31) - (Identifier "SmallInt" _) -> int (-2^15) - _ -> error $ "BuiltInFunction 'low': " ++ show e -initExpr2C' (BuiltInFunction "high" [e]) = do - initExpr2C e - t <- gets lastType - case t of - (BTArray i _ _) -> initExpr2C' $ BuiltInFunction "pred" [InitRange i] - a -> error $ "BuiltInFunction 'high': " ++ show a -initExpr2C' (BuiltInFunction "succ" [BuiltInFunction "pred" [e]]) = initExpr2C' e -initExpr2C' (BuiltInFunction "pred" [BuiltInFunction "succ" [e]]) = initExpr2C' e -initExpr2C' (BuiltInFunction "succ" [e]) = liftM (<> text " + 1") $ initExpr2C' e -initExpr2C' (BuiltInFunction "pred" [e]) = liftM (<> text " - 1") $ initExpr2C' e -initExpr2C' b@(BuiltInFunction _ _) = error $ show b -initExpr2C' a = error $ "initExpr2C: don't know how to render " ++ show a - - -range2C :: InitExpression -> State RenderState [Doc] -range2C (InitString [a]) = return [quotes $ text [a]] -range2C (InitRange (Range i)) = liftM (flip (:) []) $ id2C IOLookup i -range2C (InitRange (RangeFromTo (InitString [a]) (InitString [b]))) = return $ map (\i -> quotes $ text [i]) [a..b] -range2C a = liftM (flip (:) []) $ initExpr2C a - -baseType2C :: String -> BaseType -> Doc -baseType2C _ BTFloat = text "float" -baseType2C _ BTBool = text "bool" -baseType2C _ BTString = text "string255" -baseType2C s a = error $ "baseType2C: " ++ show a ++ "\n" ++ s - -type2C :: TypeDecl -> State RenderState (Doc -> Doc) -type2C (SimpleType i) = liftM (\i a -> i <+> a) $ id2C IOLookup i -type2C t = do - r <- type2C' t - rt <- resolveType t - modify (\st -> st{lastType = rt}) - return r - where - type2C' VoidType = return (text "void" <+>) - type2C' (String l) = return (text "string255" <+>)--return (text ("string" ++ show l) <+>) - type2C' (PointerTo (SimpleType i)) = do - i' <- id2C IODeferred i - lt <- gets lastType - case lt of - BTRecord _ _ -> return $ \a -> text "struct __" <> i' <+> text "*" <+> a - BTUnknown -> return $ \a -> text "struct __" <> i' <+> text "*" <+> a - _ -> return $ \a -> i' <+> text "*" <+> a - type2C' (PointerTo t) = liftM (\t a -> t (parens $ text "*" <> a)) $ type2C t - type2C' (RecordType tvs union) = do - t <- withState' f $ mapM (tvar2C False False True False) tvs - u <- unions - return $ \i -> text "struct __" <> i <+> lbrace $+$ nest 4 ((vcat . map (<> semi) . concat $ t) $$ u) $+$ rbrace <+> i - where - f s = s{currentUnit = ""} - unions = case union of - Nothing -> return empty - Just a -> do - structs <- mapM struct2C a - return $ text "union" $+$ braces (nest 4 $ vcat structs) <> semi - struct2C tvs = do - t <- withState' f $ mapM (tvar2C False False True False) tvs - return $ text "struct" $+$ braces (nest 4 (vcat . map (<> semi) . concat $ t)) <> semi - type2C' (RangeType r) = return (text "int" <+>) - type2C' (Sequence ids) = do - is <- mapM (id2C IOInsert . setBaseType bt) ids - return (text "enum" <+> (braces . vcat . punctuate comma . map (\(a, b) -> a <+> equals <+> text "0x" <> text (showHex b "")) $ zip is [0..]) <+>) - where - bt = BTEnum $ map (\(Identifier i _) -> map toLower i) ids - type2C' (ArrayDecl Nothing t) = type2C (PointerTo t) - type2C' (ArrayDecl (Just r) t) = do - t' <- type2C t - lt <- gets lastType - ft <- case lt of - -- BTFunction {} -> type2C (PointerTo t) - _ -> return t' - r' <- initExpr2C (InitRange r) - return $ \i -> ft i <> brackets r' - type2C' (Set t) = return (text "<>" <+>) - type2C' (FunctionType returnType params) = do - t <- type2C returnType - p <- withState' id $ functionParams2C params - return (\i -> (t empty <> (parens $ text "*" <> i) <> parens p)) - type2C' (DeriveType (InitBinOp _ _ i)) = type2C' (DeriveType i) - type2C' (DeriveType (InitPrefixOp _ i)) = type2C' (DeriveType i) - type2C' (DeriveType (InitNumber _)) = return (text "int" <+>) - type2C' (DeriveType (InitHexNumber _)) = return (text "int" <+>) - type2C' (DeriveType (InitFloat _)) = return (text "float" <+>) - type2C' (DeriveType (BuiltInFunction {})) = return (text "int" <+>) - type2C' (DeriveType (InitString {})) = return (text "string255" <+>) - type2C' (DeriveType r@(InitReference {})) = do - initExpr2C r - t <- gets lastType - return (baseType2C (show r) t <+>) - type2C' (DeriveType a) = error $ "Can't derive type from " ++ show a - -phrase2C :: Phrase -> State RenderState Doc -phrase2C (Phrases p) = do - ps <- mapM phrase2C p - return $ text "{" $+$ (nest 4 . vcat $ ps) $+$ text "}" -phrase2C (ProcCall f@(FunCall {}) []) = liftM (<> semi) $ ref2C f -phrase2C (ProcCall ref []) = liftM (<> semi) $ ref2CF ref -phrase2C (ProcCall ref params) = error $ "ProcCall"{-do - r <- ref2C ref - ps <- mapM expr2C params - return $ r <> parens (hsep . punctuate (char ',') $ ps) <> semi -} -phrase2C (IfThenElse (expr) phrase1 mphrase2) = do - e <- expr2C expr - p1 <- (phrase2C . wrapPhrase) phrase1 - el <- elsePart - return $ - text "if" <> parens e $+$ p1 $+$ el - where - elsePart | isNothing mphrase2 = return $ empty - | otherwise = liftM (text "else" $$) $ (phrase2C . wrapPhrase) (fromJust mphrase2) -phrase2C (Assignment ref expr) = do - r <- ref2C ref - t <- gets lastType - case (t, expr) of - (BTFunction {}, (Reference r')) -> do - e <- ref2C r' - return $ r <+> text "=" <+> e <> semi - (BTString, _) -> do - e <- expr2C expr - lt <- gets lastType - case lt of - -- assume pointer to char for simplicity - BTPointerTo _ -> do - e <- expr2C $ Reference $ FunCall [Reference $ RefExpression expr] (SimpleReference (Identifier "pchar2str" BTUnknown)) - return $ r <+> text "=" <+> e <> semi - BTString -> do - e <- expr2C expr - return $ r <+> text "=" <+> e <> semi - _ -> error $ "Assignment to string from " ++ show lt - (BTArray _ _ _, _) -> do - case expr of - Reference er -> do - exprRef <- ref2C er - exprT <- gets lastType - case exprT of - BTArray RangeInfinite _ _ -> - return $ text "FIXME: assign a dynamic array to an array" - BTArray _ _ _ -> phrase2C $ - ProcCall (FunCall - [ - Reference $ ref - , Reference $ RefExpression expr - , Reference $ FunCall [expr] (SimpleReference (Identifier "sizeof" BTUnknown)) - ] - (SimpleReference (Identifier "memcpy" BTUnknown)) - ) [] - _ -> return $ text "FIXME: assign a non-specific value to an array" - - _ -> return $ text "FIXME: dynamic array assignment 2" - _ -> do - e <- expr2C expr - return $ r <+> text "=" <+> e <> semi -phrase2C (WhileCycle expr phrase) = do - e <- expr2C expr - p <- phrase2C $ wrapPhrase phrase - return $ text "while" <> parens e $$ p -phrase2C (SwitchCase expr cases mphrase) = do - e <- expr2C expr - cs <- mapM case2C cases - d <- dflt - return $ - text "switch" <> parens e $+$ braces (nest 4 . vcat $ cs ++ d) - where - case2C :: ([InitExpression], Phrase) -> State RenderState Doc - case2C (e, p) = do - ies <- mapM range2C e - ph <- phrase2C p - return $ - vcat (map (\i -> text "case" <+> i <> colon) . concat $ ies) <> nest 4 (ph $+$ text "break;") - dflt | isNothing mphrase = return [text "default: break;"] -- avoid compiler warning - | otherwise = do - ph <- mapM phrase2C $ fromJust mphrase - return [text "default:" <+> nest 4 (vcat ph)] - -phrase2C wb@(WithBlock ref p) = do - r <- ref2C ref - t <- gets lastType - case t of - (BTRecord _ rs) -> withRecordNamespace (render r ++ ".") (rec2Records rs) $ phrase2C $ wrapPhrase p - a -> do - error $ "'with' block referencing non-record type " ++ show a ++ "\n" ++ show wb -phrase2C (ForCycle i' e1' e2' p up) = do - i <- id2C IOLookup i' - iType <- gets lastIdTypeDecl - e1 <- expr2C e1' - e2 <- expr2C e2' - let inc = if up then "inc" else "dec" - let add = if up then "+ 1" else "- 1" - let iEnd = i <> text "__end__" - ph <- phrase2C . appendPhrase (BuiltInFunctionCall [Reference $ SimpleReference i'] (SimpleReference (Identifier inc BTUnknown))) $ wrapPhrase p - return . braces $ - i <+> text "=" <+> e1 <> semi - $$ - iType <+> iEnd <+> text "=" <+> e2 <> semi - $$ - text "if" <+> (parens $ i <+> text "<=" <+> iEnd) <+> text "do" <+> ph <+> - text "while" <> parens (i <+> text "!=" <+> iEnd <+> text add) <> semi - where - appendPhrase p (Phrases ps) = Phrases $ ps ++ [p] -phrase2C (RepeatCycle e' p') = do - e <- expr2C e' - p <- phrase2C (Phrases p') - return $ text "do" <+> p <+> text "while" <> parens (text "!" <> parens e) <> semi -phrase2C NOP = return $ text ";" - -phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "exit" BTUnknown))) = do - f <- gets currentFunctionResult - if null f then - return $ text "return" <> semi - else - return $ text "return" <+> text f <> semi -phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "break" BTUnknown))) = return $ text "break" <> semi -phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "continue" BTUnknown))) = return $ text "continue" <> semi -phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "exit" BTUnknown))) = liftM (\e -> text "return" <+> e <> semi) $ expr2C e -phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "dec" BTUnknown))) = liftM (\e -> text "--" <> e <> semi) $ expr2C e -phrase2C (BuiltInFunctionCall [e1, e2] (SimpleReference (Identifier "dec" BTUnknown))) = liftM2 (\a b -> a <> text " -= " <> b <> semi) (expr2C e1) (expr2C e2) -phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "inc" BTUnknown))) = liftM (\e -> text "++" <> e <> semi) $ expr2C e -phrase2C (BuiltInFunctionCall [e1, e2] (SimpleReference (Identifier "inc" BTUnknown))) = liftM2 (\a b -> a <+> text "+=" <+> b <> semi) (expr2C e1) (expr2C e2) -phrase2C a = error $ "phrase2C: " ++ show a - -wrapPhrase p@(Phrases _) = p -wrapPhrase p = Phrases [p] - -expr2C :: Expression -> State RenderState Doc -expr2C (Expression s) = return $ text s -expr2C b@(BinOp op expr1 expr2) = do - e1 <- expr2C expr1 - t1 <- gets lastType - e2 <- expr2C expr2 - t2 <- gets lastType - case (op2C op, t1, t2) of - ("+", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strconcat" (BTFunction False 2 BTString)) - ("+", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strappend" (BTFunction False 2 BTString)) - ("+", BTChar, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strprepend" (BTFunction False 2 BTString)) - ("+", BTChar, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_chrconcat" (BTFunction False 2 BTString)) - ("==", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcomparec" (BTFunction False 2 BTBool)) - ("==", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcompare" (BTFunction False 2 BTBool)) - ("!=", BTString, _) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strncompare" (BTFunction False 2 BTBool)) - ("&", BTBool, _) -> return $ parens e1 <+> text "&&" <+> parens e2 - ("|", BTBool, _) -> return $ parens e1 <+> text "||" <+> parens e2 - (_, BTRecord t1 _, BTRecord t2 _) -> do - i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier t2 undefined)] - ref2C $ FunCall [expr1, expr2] (SimpleReference i) - (_, BTRecord t1 _, BTInt) -> do - -- aw, "LongInt" here is hwengine-specific hack - i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier "LongInt" undefined)] - ref2C $ FunCall [expr1, expr2] (SimpleReference i) - ("in", _, _) -> - case expr2 of - SetExpression set -> do - ids <- mapM (id2C IOLookup) set - modify(\s -> s{lastType = BTBool}) - return . parens . hcat . punctuate (text " || ") . map (\i -> parens $ e1 <+> text "==" <+> i) $ ids - _ -> error "'in' against not set expression" - (o, _, _) | o `elem` boolOps -> do - modify(\s -> s{lastType = BTBool}) - return $ parens e1 <+> text o <+> parens e2 - | otherwise -> do - o' <- return $ case o of - "/(float)" -> text "/(float)" -- pascal returns real value - _ -> text o - e1' <- return $ case (o, t1, t2) of - ("-", BTInt, BTInt) -> parens $ text "(int64_t)" <+> parens e1 - _ -> parens e1 - e2' <- return $ case (o, t1, t2) of - ("-", BTInt, BTInt) -> parens $ text "(int64_t)" <+> parens e2 - _ -> parens e2 - return $ e1' <+> o' <+> e2' - where - boolOps = ["==", "!=", "<", ">", "<=", ">="] -expr2C (NumberLiteral s) = do - modify(\s -> s{lastType = BTInt}) - return $ text s -expr2C (FloatLiteral s) = return $ text s -expr2C (HexNumber s) = return $ text "0x" <> (text . map toLower $ s) -{-expr2C (StringLiteral [a]) = do - modify(\s -> s{lastType = BTChar}) - return . quotes . text $ escape a - where - escape '\'' = "\\\'" - escape a = [a]-} -expr2C (StringLiteral s) = addStringConst s -expr2C (PCharLiteral s) = return . doubleQuotes $ text s -expr2C (Reference ref) = ref2CF ref -expr2C (PrefixOp op expr) = do - e <- expr2C expr - lt <- gets lastType - case lt of - BTRecord t _ -> do - i <- op2CTyped op [SimpleType (Identifier t undefined)] - ref2C $ FunCall [expr] (SimpleReference i) - BTBool -> do - o <- return $ case op of - "not" -> text "!" - _ -> text (op2C op) - return $ o <> parens e - _ -> return $ text (op2C op) <> parens e -expr2C Null = return $ text "NULL" -expr2C (CharCode a) = do - modify(\s -> s{lastType = BTChar}) - return $ quotes $ text "\\x" <> text (showHex (read a) "") -expr2C (HexCharCode a) = if length a <= 2 then return $ quotes $ text "\\x" <> text (map toLower a) else expr2C $ HexNumber a -expr2C (SetExpression ids) = mapM (id2C IOLookup) ids >>= return . parens . hcat . punctuate (text " | ") - -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "low" _))) = do - e' <- liftM (map toLower . render) $ expr2C e - lt <- gets lastType - case lt of - BTEnum a -> return $ int 0 - BTInt -> case e' of - "longint" -> return $ int (-2147483648) - BTArray {} -> return $ int 0 - _ -> error $ "BuiltInFunCall 'low' from " ++ show e ++ "\ntype: " ++ show lt -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "high" _))) = do - e' <- liftM (map toLower . render) $ expr2C e - lt <- gets lastType - case lt of - BTEnum a -> return . int $ length a - 1 - BTInt -> case e' of - "longint" -> return $ int (2147483647) - BTString -> return $ int 255 - BTArray (RangeFromTo _ n) _ _ -> initExpr2C n - _ -> error $ "BuiltInFunCall 'high' from " ++ show e ++ "\ntype: " ++ show lt -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "ord" _))) = liftM parens $ expr2C e -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "succ" _))) = liftM (<> text " + 1") $ expr2C e -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "pred" _))) = liftM (<> text " - (int64_t)1") $ expr2C e -expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "length" _))) = do - e' <- expr2C e - lt <- gets lastType - modify (\s -> s{lastType = BTInt}) - case lt of - BTString -> return $ text "fpcrtl_Length" <> parens e' - BTArray RangeInfinite _ _ -> error $ "length() called on variable size array " ++ show e' - BTArray (RangeFromTo _ n) _ _ -> initExpr2C (BuiltInFunction "succ" [n]) - _ -> error $ "length() called on " ++ show lt -expr2C (BuiltInFunCall params ref) = do - r <- ref2C ref - t <- gets lastType - ps <- mapM expr2C params - case t of - BTFunction _ _ t' -> do - modify (\s -> s{lastType = t'}) - _ -> error $ "BuiltInFunCall lastType: " ++ show t - return $ - r <> parens (hsep . punctuate (char ',') $ ps) -expr2C a = error $ "Don't know how to render " ++ show a - -ref2CF :: Reference -> State RenderState Doc -ref2CF (SimpleReference name) = do - i <- id2C IOLookup name - t <- gets lastType - case t of - BTFunction _ _ rt -> do - modify(\s -> s{lastType = rt}) - return $ i <> parens empty --xymeng: removed parens - _ -> return $ i -ref2CF r@(RecordField (SimpleReference _) (SimpleReference _)) = do - i <- ref2C r - t <- gets lastType - case t of - BTFunction _ _ rt -> do - modify(\s -> s{lastType = rt}) - return $ i <> parens empty - _ -> return $ i -ref2CF r = ref2C r - -ref2C :: Reference -> State RenderState Doc --- rewrite into proper form -ref2C (RecordField ref1 (ArrayElement exprs ref2)) = ref2C $ ArrayElement exprs (RecordField ref1 ref2) -ref2C (RecordField ref1 (Dereference ref2)) = ref2C $ Dereference (RecordField ref1 ref2) -ref2C (RecordField ref1 (RecordField ref2 ref3)) = ref2C $ RecordField (RecordField ref1 ref2) ref3 -ref2C (RecordField ref1 (FunCall params ref2)) = ref2C $ FunCall params (RecordField ref1 ref2) -ref2C (ArrayElement (a:b:xs) ref) = ref2C $ ArrayElement (b:xs) (ArrayElement [a] ref) --- conversion routines -ref2C ae@(ArrayElement [expr] ref) = do - e <- expr2C expr - r <- ref2C ref - t <- gets lastType - case t of - (BTArray _ _ t') -> modify (\st -> st{lastType = t'}) --- (BTFunctionReturn _ (BTArray _ _ t')) -> modify (\st -> st{lastType = t'}) --- (BTFunctionReturn _ (BTString)) -> modify (\st -> st{lastType = BTChar}) - (BTString) -> modify (\st -> st{lastType = BTChar}) - (BTPointerTo t) -> do - t'' <- fromPointer (show t) =<< gets lastType - case t'' of - BTChar -> modify (\st -> st{lastType = BTChar}) - a -> error $ "Getting element of " ++ show a ++ "\nReference: " ++ show ae - a -> error $ "Getting element of " ++ show a ++ "\nReference: " ++ show ae - case t of - BTString -> return $ r <> text ".s" <> brackets e - _ -> return $ r <> brackets e -ref2C (SimpleReference name) = id2C IOLookup name -ref2C rf@(RecordField (Dereference ref1) ref2) = do - r1 <- ref2C ref1 - t <- fromPointer (show ref1) =<< gets lastType - r2 <- case t of - BTRecord _ rs -> withRecordNamespace "" (rec2Records rs) $ ref2C ref2 - BTUnit -> error "What??" - a -> error $ "dereferencing from " ++ show a ++ "\n" ++ show rf - return $ - r1 <> text "->" <> r2 -ref2C rf@(RecordField ref1 ref2) = do - r1 <- ref2C ref1 - t <- gets lastType - case t of - BTRecord _ rs -> do - r2 <- withRecordNamespace "" (rec2Records rs) $ ref2C ref2 - return $ r1 <> text "." <> r2 - BTUnit -> withLastIdNamespace $ ref2C ref2 - a -> error $ "dereferencing from " ++ show a ++ "\n" ++ show rf -ref2C d@(Dereference ref) = do - r <- ref2C ref - t <- fromPointer (show d) =<< gets lastType - modify (\st -> st{lastType = t}) - return $ (parens $ text "*" <> r) -ref2C f@(FunCall params ref) = do - r <- fref2C ref - t <- gets lastType - case t of - BTFunction _ _ t' -> do - ps <- liftM (parens . hsep . punctuate (char ',')) $ mapM expr2C params - modify (\s -> s{lastType = t'}) - return $ r <> ps - _ -> case (ref, params) of - (SimpleReference i, [p]) -> ref2C $ TypeCast i p - _ -> error $ "ref2C FunCall erroneous type cast detected: " ++ show f ++ "\nType detected: " ++ show t - where - fref2C (SimpleReference name) = id2C (IOLookupFunction $ length params) name - fref2C a = ref2C a - -ref2C (Address ref) = do - r <- ref2C ref - lt <- gets lastType - case lt of - BTFunction True _ _ -> return $ text "&" <> parens (r <> text "__vars") - _ -> return $ text "&" <> parens r -ref2C (TypeCast t'@(Identifier i _) expr) = do - lt <- expr2C expr >> gets lastType - case (map toLower i, lt) of - ("pchar", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pchar" $ BTPointerTo BTChar)) - ("shortstring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2str" $ BTString)) - (a, _) -> do - e <- expr2C expr - t <- id2C IOLookup t' - return . parens $ parens t <> e -ref2C (RefExpression expr) = expr2C expr - - -op2C :: String -> String -op2C "or" = "|" -op2C "and" = "&" -op2C "not" = "~" -op2C "xor" = "^" -op2C "div" = "/" -op2C "mod" = "%" -op2C "shl" = "<<" -op2C "shr" = ">>" -op2C "<>" = "!=" -op2C "=" = "==" -op2C "/" = "/(float)" -op2C a = a - diff -r 11438c0bd46b -r bce8cf41d666 tools/unitCycles.hs --- a/tools/unitCycles.hs Tue Apr 30 01:47:30 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -module Main where - -import PascalParser -import System -import Control.Monad -import Data.Either -import Data.List -import Data.Graph -import Data.Maybe - -unident :: Identificator -> String -unident (Identificator s) = s - -extractUnits :: PascalUnit -> (String, [String]) -extractUnits (Program (Identificator name) (Implementation (Uses idents) _ _) _) = ("program " ++ name, map unident idents) -extractUnits (Unit (Identificator name) (Interface (Uses idents1) _) (Implementation (Uses idents2) _ _) _ _) = (name, map unident $ idents1 ++ idents2) - -f :: [(String, [String])] -> String -f = unlines . map showSCC . stronglyConnComp . map (\(a, b) -> (a, a, b)) - where - showSCC (AcyclicSCC v) = v - showSCC (CyclicSCC vs) = intercalate ", " vs - -myf :: [(String, [String])] -> String -myf d = unlines . map (findCycle . fst) $ d - where - findCycle :: String -> String - findCycle searched = searched ++ ": " ++ (intercalate ", " $ fc searched []) - where - fc :: String -> [String] -> [String] - fc curSearch visited = let uses = curSearch `lookup` d; res = dropWhile null . map t $ fromJust uses in if isNothing uses || null res then [] else head res - where - t u = - if u == searched then - [u] - else - if u `elem` visited then - [] - else - let chain = fc u (u:visited) in if null chain then [] else u:chain - - -main = do - fileNames <- getArgs - files <- mapM readFile fileNames - putStrLn . myf . map extractUnits . rights . map parsePascalUnit $ files diff -r 11438c0bd46b -r bce8cf41d666 tools/w32DownloadUnzip.vbs --- a/tools/w32DownloadUnzip.vbs Tue Apr 30 01:47:30 2013 +0200 +++ b/tools/w32DownloadUnzip.vbs Thu Jun 13 22:27:23 2013 +0200 @@ -7,6 +7,7 @@ ' References ' http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line ' http://stackoverflow.com/questions/1021557/how-to-unzip-a-file-using-the-command-line +' http://stackoverflow.com/questions/424331/get-the-current-temporary-directory-path-in-vbscript Set ArgObj = WScript.Arguments @@ -23,7 +24,8 @@ End if End if -strHDLocation = "C:\Windows\Temp\temp.zip" +' Temporary directory +strHDLocation = WScript.CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2) + "\hwlibtemp.zip" ' Fetch the file WScript.Echo ( "Trying to download from " & strFileURL) @@ -37,7 +39,7 @@ objADOStream.Type = 1 'adTypeBinary objADOStream.Write objXMLHTTP.ResponseBody - objADOStream.Position = 0 'Set the stream position to the start + objADOStream.Position = 0 'Set the stream position to the start Set objFSO = Createobject("Scripting.FileSystemObject") If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation @@ -46,12 +48,12 @@ objADOStream.SaveToFile strHDLocation objADOStream.Close Set objADOStream = Nothing + Set objXMLHTTP = Nothing Else WScript.Echo ("Error downloading file (error code: " & objXMLHTTP.Status & ")") Set objXMLHTTP = Nothing WScript.Quit End if -Set objXMLHTTP = Nothing WScript.Echo ( "Extracting file to " & strOutputPath) Set objShell = CreateObject( "Shell.Application" )