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

273 Commits

Author SHA1 Message Date
Ivan Savenko
2e7c382612 Moved creature upgrade logic to CGObjectInstance inheritors 2023-06-16 17:59:10 +03:00
Tomasz Zieliński
a70555a725 Fix test mock 2023-06-08 10:32:38 +02:00
Ivan Savenko
97b3b2e147 Fix build 2023-06-03 00:48:32 +03:00
Konstantin
e60a4318c3 vcmi: a bunch of forward definitions 2023-05-07 20:37:32 +03:00
Konstantin P
057a33c508 SpellSchool: use identifier instead of int
Needs redifinition of MAGIC_SCHOOL_SKILL in all mods
2023-05-07 20:37:32 +03:00
Konstantin P
6ff83e6f16 tests: test nonMagical effects 2023-05-05 18:57:40 +03:00
Konstantin P
75948a5dd7 tests: add ResistanceCondition test 2023-05-05 18:57:40 +03:00
Konstantin
3d46ee3182 TargetCondition: units with 100% MR is immune
Spells should not consider units with 100% MR as valid targets.
2023-05-05 18:57:40 +03:00
Konstantin
b0d2787e86 vcmi: remove DIRECT_DAMAGE_IMMUNITY bonus
Replace by SPELL_DAMAGE_REDUCTION bonus with 100 value
2023-05-05 18:57:40 +03:00
Konstantin
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
Konstantin
a6de9097be vcmi: rename HeroBonus.h to Bonus.h 2023-05-02 11:20:58 +03:00
Konstantin
29c76fb9bf HeroBonus: split BonusList 2023-05-02 00:54:53 +03:00
Konstantin
4866c2fe5c vcmi: split IBonusBearer 2023-05-02 00:54:53 +03:00
Konstantin
6fa1b2b19f vcmi: move bonuses to its own folder 2023-05-02 00:53:50 +03:00
nordsoft
17c9dc3115 fix tests 2023-04-29 06:15:14 +04:00
Konstantin
88f8694825 tests: fix modhandler assert 2023-04-27 20:59:55 +03:00
Konstantin
15d933d354 tests: disable settings.init()
This will remove debug assertion than will prevent any test
from running in debug mode
2023-04-27 20:59:55 +03:00
Konstantin
2a8f9629ae tests: attempt to fix build without lua 2023-04-27 20:59:55 +03:00
Konstantin P
00487e3257 vcmi: disable -Wvirtual-move-assign from tests 2023-04-27 20:59:55 +03:00
Konstantin P
0d8e59a172 tests: add test directories to core loader
Fixes all tests loading
2023-04-27 20:59:55 +03:00
Konstantin P
d14c951005 CBattleInfoCallbackTest: fix catch-value 2023-04-27 20:59:55 +03:00
Konstantin P
608c30c3d3 vcmi: add formation inside test map 2023-04-27 20:59:55 +03:00
Konstantin P
c6fbb8b30d tests: fix faction test 2023-04-27 20:59:55 +03:00
Konstantin P
705d7164ae vcmi: fix heal and teleport tests 2023-04-27 20:59:55 +03:00
Konstantin P
e5f78a8997 vcmi: fix tests with latest develop 2023-04-27 20:59:55 +03:00
Konstantin
7c56fbd16b vcmi: fix test building for 1.2 2023-04-27 20:59:55 +03:00
Konstantin
924b456b0f vcmi: fix unit tests for latest develop 2023-04-27 20:59:55 +03:00
Konstantin
74656b9f96 vcmi: disable MapComparer team check for now 2023-04-27 20:59:55 +03:00
Konstantin
91c7c93d07 vcmi: fix MapComparer appearance check 2023-04-27 20:59:55 +03:00
Konstantin
d31a3362af vcmi: map objects test passed
It is weird, because some objects should have mod scope now, and some not
We need to fix this, and rework test if necessary - its data is too huge now.
2023-04-27 20:59:55 +03:00
Konstantin
bd7faddb55 vcmi: more verbose JSON compare 2023-04-27 20:59:55 +03:00
Konstantin
015f55cd82 vcmi: fix building tests without scripts 2023-04-27 20:59:55 +03:00
Konstantin
276bd5eebf vcmi: fix healing effect tests 2023-04-27 20:59:55 +03:00
Konstantin
42984396ff all: fix ImmunityNegationConditionTest 2023-04-27 20:59:55 +03:00
Konstantin
56601a0c2a vcmi: entity tests passed 2023-04-27 20:59:55 +03:00
Konstantin
2680046dd0 vcmi: make tests builds at least 2023-04-27 20:59:55 +03:00
Konstantin
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
Konstantin
fedf7d377c vcmi: remove TFaction
This is a huge change and will break save compatibility
2023-04-10 19:28:16 +03:00
Konstantin
11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
SoundSSGood
9f8aa25297 Backpack limit part4 (Using cheats, buying) 2023-03-21 12:14:33 +02:00
SoundSSGood
e23766280f Backpack limit part2 (Pick up, Dig up, Object rewards) 2023-03-21 12:14:33 +02:00
Konstantin
4617ce10e5 vcmi: allow showing more than one components in infobar
Up to 8, AFAIK. So, we can show multi-reward in infobox now.
One issue remain - cannot dynamically choose components size
based on text size.
2023-03-11 21:41:57 +03:00
Ivan Savenko
1fece0ce18
Merge pull request #1229 from IvanSavenko/battle_improvements
Battle: Fixing bugs & Implementation of missing features
2023-01-09 22:07:13 +02:00
Dydzio
a2ce9220ed Fix tests + scripting compilation on gcc 2023-01-05 17:42:33 +02:00
Ivan Savenko
43c1994ca2 Fix test 2023-01-04 21:41:11 +02:00
Ivan Savenko
2cbe6bcb47 Added common method to get names of hardcoded mod scopes 2022-12-07 15:18:19 +02:00
Tomasz Zieliński
20c102e648 Remove T prefix from new typedefs 2022-09-29 11:44:46 +02:00
Tomasz Zieliński
4ea57ea7fc A variety of suggested style tweaks 2022-09-25 09:33:56 +02:00
Tomasz Zieliński
494b0f0226 First version that compiles 2022-09-21 11:34:23 +02:00
Nordsoft91
ad01c7ffce
Vlc obstacles [part 1] (#888)
* obstacles content handler, entity service and VLC integration
2022-09-15 11:06:54 +03:00
Andrii Danylchenko
4b4cc3cf4b battlefields in VLC and custom bonuses for terrain patches 2022-09-11 11:31:27 +03:00
Nordsoft91
c4035134e5 New battlegrounds (#758) 2022-09-11 11:31:26 +03:00
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
Andrey Filipenkov
d7650ce9c0
use Conan to make macOS CI builds for both Intel and ARM (#782)
* [CI] append platform to output artifact name if it's given
2022-08-30 17:29:00 +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
Soar Qin
c87df8e704
Fix warnings/errors on MSVC (#753)
* Fix warnings/errors on MSVC
1. update googletest to tag release-1.11.0 to make googletest and
   googlemock compile on MSVC2022.
2. set gtest_force_shared_crt to ON in test cmake project to make tests
   compile on MSVC.
3. add /wd4251 and /wd4275 to MSVC compile flags to ignore DLL related
   warnings for class exports.
4. fix some other warnings and errors while compiling on MSVC2022.
2022-06-11 18:45:34 +03:00
Nordsoft91
9d06e51631
Place proper towns in underground (#743)
Implement feature of proper town selection in underground and surface
* Some minor refactoring of rmg
2022-05-28 16:03:50 +03:00
Andrii Danylchenko
7f175c7f19
Merge pull request #676 from ShubusCorporation/do/fix/mod_system/Patch3
Patch III for Mod system improvement : Negative bonuses: new feature, fixes, town building: Magic Well
2021-09-26 21:22:28 +03:00
Dmitry Orlov
30b879ae5d Fixed: duplicated bonusing building. Improved: opposite bonus propagation 2021-09-12 14:30:54 +03:00
Dmitry Orlov
ec7453ae85 Fix some warnings, Add headers to the solution 2021-09-05 17:31:12 +03:00
Dmitry Orlov
25d9ea1ddf Feature: Opposite Side Limiter 2021-09-04 14:15:38 +03:00
Andrii Danylchenko
9c8d776398 Merge branch 'develop' into handlersAbstraction
# Conflicts:
#	CI/linux/before_install.sh
#	CI/mac/before_install.sh
#	CI/mxe/before_install.sh
#	lib/CModHandler.cpp
#	lib/mapObjects/CObjectClassesHandler.cpp
#	lib/mapObjects/CObjectClassesHandler.h
#	lib/mapObjects/CommonConstructors.cpp
#	server/CGameHandler.cpp
#	test/CMakeLists.txt
#	test/spells/effects/TeleportTest.cpp
2021-07-16 00:32:13 +03:00
Andrii Danylchenko
6d8373a473 Configure github actions 2021-07-13 14:56:35 +01:00
Alexander Shishkin
9e422a1664
Merge pull request #690 from nullkiller/erm-fix-vr
ERM: fix string concatenations and bit operations
2021-04-29 16:05:20 +03:00
Andrii Danylchenko
fc9bbfb895 ERM: revert unwanted changes 2021-04-19 18:33:07 +03:00
Andrii Danylchenko
061941b3ac ERM VR:M,VR:U 2021-04-19 18:28:55 +03:00
AlexVinS
f0a7a6ffbf Fixed build
Some stubs for !!UN

C::B project update
2021-04-10 02:04:07 +03:00
Andrii Danylchenko
35566d7748 ERM: fix string concatenations and bit operations 2021-04-09 23:41:50 +03:00
Andrii Danylchenko
bd31a87133
a few erm interpretter unit tests and fixes (#688) 2021-03-27 15:47:44 +03:00
AlexVinS
483a4689ce Fixes for code review issues 2021-02-20 04:57:50 +03:00
AlexVinS
ec6f7b88fe !?OB WIP 2021-02-16 13:32:18 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
John Bolton
d7e82c1087 Fixed a bad fix. Fixed more warnings.
These warnings have not been fixed because the are legitimate and/or I don't know how to fix them:

test\googletest\googletest\include\gtest/gtest-printers.h(888,43): warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED.
lib\serializer\JsonSerializeFormat.h(523,26): warning C4244: 'argument': conversion from 'type1' to 'type2', possible loss of data
include\boost/iostreams/positioning.hpp(96,15): warning C4996: 'std::fpos<_Mbstatet>::seekpos': warning STL4019: The member std::fpos::seekpos() is non-Standard, ...
source\lib\filesystem\FileStream.h(39,69): warning C4910: 'boost::iostreams::stream<FileBuf,std::char_traits<char>,std::allocator<char>>': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
include\boost/optional/optional.hpp(274,53): warning C4244: 'argument': conversion from 'T' to 'T', possible loss of data
client\widgets\../gui/SDL_Extensions.h(112,14): warning C4244: 'initializing': conversion from 'type1' to 'type2', possible loss of data
client\CServerHandler.cpp(421,24): warning C4834: discarding return value of function with 'nodiscard' attribute (see https://bugs.vcmi.eu/view.php?id=3144)
client\CVideoHandler.cpp(130,25): warning C4996: 'AVStream::codec': was declared deprecated
2020-10-04 16:26:45 -07:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
John Bolton
6d8f1e4530 Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.
Replaced const TBonusListPtr with TConstBonusListPtr where necessary
Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary.
Removed superfluous use of const.
Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
2020-09-30 22:56:28 -07:00
Dmitry Orlov
ae3b8e4916 Travis errors & warnings fix 2020-09-28 16:39:55 +03:00
Toney Sui
dca5d86e7a
Fix bug: LandMine is not exploding to enemies. (#630)
* The reason is,

the mine has attribute hidden=true;
when enemy unit moves, the code in BattleInfo.cpp MoveUnit() (line 817) will update the revealed to true;
then in the CGameHandler.cpp handleDamageFromObstacle() (line 4846) is checking , and the condition battleIsObstacleVisibleForSide() will return true, so the effect will not be triggerred.

Resolution:
1. Remove the "revealed=true" in moveUnit(), and in handleDamageFromObstacle, remove the "const" restrict for obstacle, and then update revealed to true;
2. After the takeDamage function, add a pack "BattleObstaclesChanged" to update the obstacle to be "revealed=true".
2020-02-12 20:12:12 +03:00
AlexVinS
e7bced112c Fixed https://bugs.vcmi.eu/view.php?id=3059 2019-06-09 22:46:29 +03:00
AlexVinS
d2de94b811 fixed broken test 2019-06-09 20:32:06 +03:00
Dydzio
54550b50de Update VS files to 2019, partially fix test project 2019-06-09 17:28:55 +02:00
AlexVinS
1f2ee843aa [C::B] Switched to boost shared linkage 2019-05-30 20:55:40 +03:00
Michał Kalinowski
aee4bb7281 Fix building a test target
-Using Field matcher instead Eq to compare boost tribool value
2019-05-09 20:01:16 +03:00
Michał Kalinowski
ec536e613c CMake more transitive
-Moving AIs cmake to target focusing code
-Beign explicit when link libraries
2019-03-28 16:56:51 +03:00
AlexVinS
9311966706 [C::B] Switch to MinGW 7.3 2019-02-19 14:59:10 +03:00
Michał Kalinowski
a0d1808b62 CMake transitive compile dependency
Moving to more target focusing code that provides better transitive scope
2019-01-19 17:38:54 +03:00
Alexander Shishkin
b00e935e4d
Warnings fixes (#538)
Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
2019-01-19 13:52:02 +03:00
Dydzio
216d50788b Fix AI build, update default Windows SDK version for projects 2018-12-31 15:18:42 +01:00
AlexVinS
5a8416bd19 [c::b] Updated projects, fixed build 2018-12-31 00:03:31 +03:00
Andrii Danylchenko
035d279ae8 Refactor CGHeroInstance, make spells private 2018-12-23 15:49:26 +03:00
Michał Janiszewski
0ff2e1180d Throw std::runtime_exception instead of a pointer to new one
cf. https://isocpp.org/wiki/faq/exceptions#what-to-throw
2018-10-31 07:27:54 +01:00
AlexVinS
f17783cfb5 [c::b] Updated projects, applied fixes 2018-07-29 22:07:40 +03:00
DJWarmonger
30f99e7cc1 Fix for Travis 2018-07-28 16:02:59 +02:00
DJWarmonger
5cd366dca3 Compile fix 2018-07-28 14:14:24 +02:00
DJWarmonger
301565b315 Updated CMake 2018-07-27 06:44:10 +02:00
DJWarmonger
273802c92c I have no idea what I'm doing 2018-07-26 12:14:29 +02:00
karliss
ad2c429d8f CMake: unittest improvements (#447)
* Convert TestConfig to proper test environment.
* Copy test data to build directory.
* Get test recognized by ctest, but disable gtest discovery. Allowing ctest to run each test individually isn't currently practical because it is 50 times slower.
2018-04-15 18:02:31 +07:00
Arseniy Shestakov
74e5c5bf05 CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
Arseniy Shestakov
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
Henning Koehler
02b5a5e830 Make bonus stacking configurable + fix duplicate propagation/inheritance (#433)
Addresses several related problems:
* Propagation / unpropagation of duplicate bonuses is inconsistent, causing bugs
* Duplicate bonuses never stack, which is not always intended behaviour (e.g. multiple copies of resource generating artifacts)
* Different bonuses always stack, which is not always intended behaviour (e.g. Angel + Archangel morale bonuses)

This is addressed as follows:
* Duplicate bonuses are never eliminated during propagation/inheritance.
* Unpropagation eliminates only a single copy of duplicated bonus
* Bonus receives a new field stacking that determines stacking behaviour:
* * empty string = no stacking with duplicates (default)
* * "ALWAYS" = stacks with duplicates & everything else
* * some other value = no stacking with bonuses with same stacking value
Also Morale/Luck window now hides non-stacking bonuses.
2018-03-27 14:54:58 +07:00
AlexVinS
9d108d59db Redone RMG template serialization using JSON serializer, added tests 2018-03-10 19:36:19 +03:00