1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-26 08:41:13 +02:00
Commit Graph

90 Commits

Author SHA1 Message Date
Evgeny Malygin
25125f96da
Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
Kris-Ja
27ba4f10be Fix BonusLimitEffect #3070
Change BonusList::getBonus() to return bonuses with any BonusLimitEffect by default (returned only bonuses with BonusLimitEffect::NO_LIMIT previously)
2024-03-25 23:31:58 +01:00
Kris-Ja
ff35a27176 Fix loading saved games (add ESerializationVersion) 2024-03-23 22:03:06 +01:00
Kris-Ja
05bbb45824 change MANA_PER_KNOWLEGDE to percentage 2024-03-23 20:28:49 +01:00
Ivan Savenko
922966dcf8 Renamed JsonNode::meta to more logical modScope. Member is now private 2024-02-26 12:55:49 +02:00
Ivan Savenko
08a27663f9 Reworked JsonNode constructors to more logical form 2024-02-26 12:55:49 +02:00
Ivan Savenko
54796c7c56 Rename toJson to toString/toCompactString for consistency 2024-02-26 12:55:49 +02:00
Ivan Savenko
c3957c2c2a Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
Alexander Wilms
678cacbd25 Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":",2)
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-13 15:21:30 +01:00
Alexander Wilms
522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":")
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-10 20:46:13 +01:00
Ivan Savenko
0c07384293 Refactoring of serialization versioning handling
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
Ivan Savenko
d04241b10a Code cleanup 2024-01-19 23:02:00 +02:00
Ivan Savenko
6e629a6a5f split getBonusLocalFirst into two distinct method:
- const method getFirstBonus that returns single matching bonusToString
- non-const method getLocalBonus that returns bonus from current node
2024-01-19 13:56:06 +02:00
Ivan Savenko
ea1f05d15a Stabilization 2024-01-19 13:55:22 +02:00
Ivan Savenko
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00
Ivan Savenko
c37ce05d06 Attempt to make constant bonus system nodes (CCreature / CArtifact)
fully constant
2024-01-19 13:54:49 +02:00
Ivan Savenko
2c4cad7d9c Slight simplification of bonus system node class 2024-01-19 13:54:49 +02:00
Ivan Savenko
bd5682ecc3 Merge remote-tracking branch 'vcmi/master' into develop 2024-01-19 13:49:54 +02:00
Alexander Wilms
7a1cee1a60 Fix error: 'auto' not allowed in non-static struct member 2024-01-17 14:49:28 +00: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
Ivan Savenko
bb670cfb82 Merged accurate shot bonus into death stare bonus 2024-01-13 15:55:07 +02:00
Alexander Wilms
f3277b7953 Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
M
67f18729fa REVENGE bonus that matches HotA haspid ability 2024-01-09 19:10:43 +01:00
Dydzio
675f9b11fa Add ENEMY_ATTACK_REDUCTION bonus - fixes HotA Nix 2024-01-08 19:37:04 +01:00
Dydzio
3c95f92c59 Update documentation 2024-01-07 21:22:10 +01:00
Dydzio
bb925e4cb0 First version of sea witch / sorceress ability 2024-01-07 19:27:32 +01:00
Dydzio
7283a4861e Initial version of ACCURATE_SHOT implementation 2024-01-04 22:27:51 +01:00
Dydzio
fbd988df42 Bit better documentation wording 2024-01-01 21:19:25 +01:00
Dydzio
7cf7543747 Configurable ferocity bonus 2024-01-01 21:16:38 +01:00
Dydzio
898b8f3c71 Add initial version of Ferocity ability (for Ayssids) 2024-01-01 19:58:32 +01:00
Dydzio
9e9849b741 Fix commander ability accumulation, change commander ability bonus 2023-12-23 20:16:29 +01:00
Ivan Savenko
4ed283a357
Merge pull request #3359 from IvanSavenko/crashfixes
Crashfixes
2023-12-22 15:17:59 +02:00
Ivan Savenko
ec89e7fa62 Move UNLIMITED_MOVEMENT bonus to very end of the list 2023-12-22 14:20:32 +02:00
Ivan Savenko
171044359d Fixed crash on connection to 1.4.1 game 2023-12-22 14:03:05 +02:00
Dydzio
fe39faf36c Add UNTIL_OWN_ATTACK bonus duration and use for berserk 2023-12-19 19:52:40 +01:00
Laserlicht
a24e78a210 real unlimited movement (like in OH3) 2023-12-09 13:42:09 +01:00
Laserlicht
4bad88f141
implement luck and morale cheats from OH3 2023-12-08 19:20:53 +01:00
Ivan Savenko
843e97349a Identifiers that can be added by mods are now serialized as string 2023-11-17 00:48:55 +02:00
Ivan Savenko
c6f9434c8e
Merge pull request #3170 from gamestales/gamestales/2903-morale-description-1442
#2903-morale-description-#1442
2023-11-13 01:53:29 +02:00
gamestales-com
a574f18e69 #2903-morale-description-#1442 2023-11-10 15:58:19 +01:00
Ivan Savenko
f8a7f6e5a7 Remove remaining boost::mpl usages 2023-11-08 21:27:05 +02:00
Ivan Savenko
5487f07d3b added toEntity overload that accepts generic Services class 2023-11-04 17:04:53 +02:00
Ivan Savenko
184f5a72cc Use toEntity/toXXX methods in Identifier instead VLC objects access 2023-11-03 16:03:29 +02:00
Ivan Savenko
885dce0c27 Replace static_cast's of Identifiers with getNum call 2023-11-03 16:03:29 +02:00
Ivan Savenko
1459006916 Added separate bonus for native terrain check 2023-10-28 17:54:58 +03:00
Ivan Savenko
3880ea58b9 Merge branch 'josch/dos2unix' into develop 2023-10-22 18:39:03 +03:00
Ivan Savenko
4f47555977 Split OBJECT bonus source into OBJECT_TYPE and OBJECT_INSTANCE 2023-10-22 16:55:19 +03:00
Ivan Savenko
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
Ivan Savenko
31cf3442af Update docs 2023-10-22 16:55:19 +03:00
Ivan Savenko
36a1d6c415 Removed remaining integer bonus subtypes from configs 2023-10-22 16:55:19 +03:00