1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

191 Commits

Author SHA1 Message Date
Laserlicht
a1384bf47f defending, when not possible to attack invincible 2024-09-19 20:54:50 +02:00
Ivan Savenko
2a05fbdd50 Unified handling of battle sides ID's
- Replaced BattleSide namespace-enum with enum class
- Merged two different BattleSide enum's into one
- Merged BattlePerspective enum into BattleSide enum
- Changed all places that use integers to represent battle side to use
BattleSide enum
- Added BattleSideArray convenience wrapper for std::array that is
always 2-elements in size and allows access to its elements using
BattleSide enum
2024-08-11 20:54:44 +00:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
Tomasz Zieliński
5eabadd7db Use vstd 2024-07-09 06:50:00 +02:00
Tomasz Zieliński
bfa93be765 Limit predicted damage / loses to actual stack health 2024-07-09 06:39:41 +02:00
Ivan Savenko
eb67e04ccb Remove old and unmaintained codeblocks project 2024-05-17 10:44:57 +00:00
Ivan Savenko
3f6eb13ee0 Delete old and unmaintained msvc project files 2024-05-17 10:44:11 +00:00
Evgeny Malygin
25125f96da
Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
Ivan Savenko
9ebd194ab1
Merge pull request #3609 from IvanSavenko/single_process
Allow running server as part of client process
2024-02-14 12:06:22 +02:00
Ivan Savenko
4c70abbeb5 Reduced usage of global variables - removed or made const / constexpr 2024-02-12 13:49:45 +02:00
Ivan Savenko
a909d7ddde Removed cmake_modules/VCMI_lib macro, use it directly in place 2024-02-11 20:38:24 +02:00
Ivan Savenko
f08c9f4d59 Renamed ENABLE_STATIC_AI_LIBS option to match its actual effect 2024-02-11 17:55:02 +02:00
Ivan Savenko
a9866bb5c6 Added RandomGeneratorUtil::nextItemWeighted convenience method 2024-01-31 00:17:40 +02:00
Ivan Savenko
2a193effcc Merge branch 'master' into 'develop' 2024-01-25 16:23:13 +02:00
Ivan Savenko
62935b4ba4 Fix crash on using StupidAI for player actions 2024-01-20 17:15:51 +02:00
Alexander Wilms
73019c204d Replace redundant types with auto for the lvalues of template factory functions for smart pointers
grep -r --include \*.h --include \*.cpp "= std::" * | grep -v auto | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return" | grep -v double | grep -v si64 | grep -v si32 | grep -v ui32 | grep \< | grep -v float | tr -d '\t' | grep -v assert > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = ":".join(line.split(":")[1:]).strip()

        print()
        print(path)
        print(original_code)
        prefix = "auto "
        if original_code.startswith("static"):
            static = True
        else:
            static = False

        cpp_type = " ".join(original_code.split("=")[0].strip().split(" ")[0:-1])
        print(cpp_type)

        if static:
            new_code = "static auto "+ " ".join(original_code.split(" ")[2:])
        else:
            new_code = "auto "+ " ".join(original_code.split(" ")[1:])
        print(new_code)

        if True:
            with open(path, "r") as f:
                filedata = f.read()

            filedata = filedata.replace(original_code, new_code)

            with open(path, "w") as f:
                f.write(filedata)
2024-01-17 12:50:00 +00:00
Alexander Wilms
f3277b7953 Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
Johannes Schauer Marin Rodrigues
a1a5bc28c2
convert line endings from CRLF (Windows) to LF (Linux/Unix)
Mixed line endings cause problems when exporting patches with
git-format-patch and then trying to "git am" a patch with mixed and
non-matching line endings. In such a situation git will fail to apply
the patch.

This commit runs the dos2unix tools on the remaining files with CRLF
(\r\n) line endings to convert them to line-feeds (\n) only.

Files that are Windows specific like *.vcxproj and *.props files were
not converted.

Closes: #3073
2023-10-19 16:23:21 +02:00
Ivan Savenko
41210c1dbf Client-side support for multiple battles 2023-09-06 16:03:47 +03:00
Ivan Savenko
036df2e0ad Support multiple battles in AI 2023-09-06 16:03:46 +03:00
Ivan Savenko
695a51d8c8 Merge remote-tracking branch 'vcmi/beta' into develop 2023-08-28 21:19:53 +03:00
Ivan Savenko
44d16b32fe Use API identical to std classes where possible 2023-08-23 16:32:29 +03:00
Ivan Savenko
013417fb7e Code cleanup 2023-08-21 17:55:49 +03:00
Dydzio
d8eef4905a Implement new callback in stupidAI 2023-08-20 13:53:25 +02:00
Ivan Savenko
aed8c411fc Minor rework & cleanup of combat replays 2023-07-27 19:25:55 +03:00
Ivan Savenko
e23166df88 Fix locking of mutexes by StupidAI 2023-07-24 23:01:18 +03:00
Ivan Savenko
639880a426 Fix handling of tactics by AI 2023-07-23 14:03:22 +03:00
Ivan Savenko
556763fb7b Fixed handling of tactics 2023-07-18 22:02:35 +03:00
Ivan Savenko
1bf6bbd9b6 Significantly simplified threading model in battles 2023-07-18 19:55:59 +03:00
Konstantin
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
Konstantin P
b472c89276 vcmi: make some CStack properties private
There is a getters for this properties already available
2023-04-27 20:58:49 +03:00
krs
e348193f7e Tactics movement is limited to movement range 2023-04-26 21:56:20 +04:00
nordsoft
bfc75ccd39 Merge remote-tracking branch 'upstream/develop' into battle-dialog 2023-04-11 02:22:42 +04:00
krs
dab07bdef9 Now unit range is shown in Tactics phase as well
A new parameter: isActiveStack was needed in battleGetAvailableHexes, so that we show the propper Tactics range.
2023-04-08 20:39:59 +03:00
nordsoft
ce3028bd73 Intermediate commit 2023-04-06 19:34:07 +04:00
Konstantin
11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
Konstantin
e0715a76c8 vcmi: reduce CStack usage a little bit 2023-04-04 23:02:54 +03:00
Ivan Savenko
970981cfc9 Show information on potential kills in attack tooltip 2023-03-24 17:18:47 +02:00
Ivan Savenko
31147ac83b refactoring: TDmgRange pair -> DamageRange struct 2023-03-23 17:49:33 +02:00
Andrey Filipenkov
0294a8b063 enable StupidAI and EmptyAI for static AI 2023-03-02 12:09:49 +03:00
Ivan Savenko
b86969909a Fixes compilation due to changes in callback interface 2023-01-20 15:18:10 +02:00
Ivan Savenko
5d80457eda Merge with vcmi/develop branch 2022-12-30 00:52:23 +02:00
Ivan Savenko
e9e549148d Implemented teleportation animation effect 2022-12-18 18:26:43 +02:00
Ivan Savenko
c79634b6a7 Moved all animation ordering logic to callers
Previously, CBattleAnimation & inheritors were controlling animation
ordering - e.g. which animations should play after which.
Now, this is controlled by caller, e.g. BattleInterface & its
controllers.
H3 animations are fairly linear and can be split in stages which are
already somewhat implemented via waitForAnims
2022-12-13 21:31:49 +02:00
Ivan Savenko
2855606a88 Enabled & fixed -Woverloaded-virtual warning from gcc/cland
- fixed almost all instances of overloaded-virtual warning
- cleared up inheritance & method overrides in code affected by warning
2022-12-07 21:50:45 +02:00
Andrey Filipenkov
5e838008df merge launcher and client
launcher is a static lib now
2022-09-24 15:55:22 +03:00
Andrey Filipenkov
c6e51852d0 add ability to build VCMI as single process
"Client process -> shared VCMI lib <- Server process" is turned into "shared Client-VCMI lib -> process <- static Server-VCMI lib"
- adds lib_client and lib_server targets that define distinct namespaces
- lib_client is a dynamic library which is shared with AI libs, lib_server is static
2022-09-24 15:55:21 +03:00
Andrey Filipenkov
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
Andrey Filipenkov
3388583089 use component-based install to copy only what's needed for every app 2022-09-24 15:55:20 +03:00
Soar Qin
188607b05f Replace cotire with CMake builtin precompiled headers support (Requires CMake version >= 3.16) 2022-06-17 17:20:08 +03:00