1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

83 Commits

Author SHA1 Message Date
9f713a0914 Rename int3::valid to isValid for consistency 2025-03-03 10:46:00 +00:00
a8a6be7ac1 Fix potential compatibility with C++20 / C++23 mode
This fixes several issues with compatibility with C++20. C++23 was also
tested, but apparently it does not have any additional breaking changes
compared to C++20 (or we don't have those).

VCMI still uses C++17 as before - goal is only to make potential
transition easier.

There were 2 cases that are deprecated in C++20 that we use:
- Floating point operations on enums are deprecated
- `this` can no longer be captured when using default capture by value
`[=]`

Both of those should now be replaced with code that works fine in both C+
+17 and in C++20 mode
2025-03-02 14:11:48 +00:00
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00:00
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
a8f8c3f4b1 Replaced most of accesses to CGObjectInstance::pos with anchorPoint() 2024-10-09 15:43:46 +00:00
c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
a481f07daf PlayerState now stores all objects owned by player 2024-08-28 12:51:27 +00:00
b07408e984 New objects are now created and initialized on server and sent to client 2024-07-16 13:13:39 +00:00
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
60a51e98de Remove usage of std::function from CRandomGenerator 2024-07-16 13:13:07 +00:00
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
8b861fc58f Do not check for guards when teleporting using means other than DD 2024-05-07 20:05:23 +00:00
d70914a147 Fixes regression - blocked TP when casting spell on land 2024-04-13 16:56:48 +03:00
3fc4383153 Show popup dialog instead of server error when using TP from water 2024-04-10 20:04:08 +03:00
6c45353aa7 Casting DD or TP will now spend mana before hero movement (and any side
effects such as visiting objects)
2024-04-10 20:04:08 +03:00
8353bca34f Small refactoring of adventure map spell casting:
- Removed duplicated checks for DD possibility
- Moved most of spell-specific code from AdventureMapInterface to library
code
- AdventureSpellMechanics class now provides methods to check whether
spellcast is possible, similarly to battle spells
- If it is not possible to cast adventure map spell (e.g. no mana or no
move points) game will show infowindow immediately on clicking spellbook
instead of on cast attempt
- If hero does not have movement points for a DD, game will show correct
error message
- Added game settings 'dimensionDoorFailureSpendsPoints' due to
discovered H3 logic
2024-04-10 20:04:08 +03:00
e5e14adb51 Add setting for HD mod tournament rules dimension door limit 2024-04-01 21:52:11 +02:00
3bb66de551 Serverside validation, setting for terrain compatibility before cast etc 2024-04-01 18:12:38 +02:00
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00
20ef3a69e7 Fix most of memleaks discovered by valgrind 2023-11-13 16:27:15 +02:00
6b81012f31 Use variant identifier in netpacks where applicable 2023-11-08 14:00:23 +02:00
10e50548e7 Converted Component class to use VariantIdentifier instead of int 2023-11-02 12:00:04 +02:00
b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
b394158dc9 Bonus Source ID now uses metaidentifier 2023-10-22 16:55:18 +03:00
d257fb37f0 Use optional instead of Json for queries 2023-09-26 13:42:20 +03:00
8c0d78f1d9 Added initiator-player to packs that add/remove/move objects 2023-09-19 19:24:34 +03:00
ec8d31bbfc First step at unifying game identifiers code 2023-08-25 13:38:01 +03:00
08cfbe79cf Added encapsulation for movement points access 2023-06-25 17:42:36 +03:00
d8879f1e53 NewObject pack now receives visitable position instead of h3m position 2023-06-23 13:34:51 +03:00
56d69e790b Renamed MetaString methods to more logical names 2023-06-20 19:37:27 +03:00
ece9982ca0 Fix build 2023-06-16 18:11:45 +03:00
adec58f5bf - Set fixed boat type for Tavern / Prison
- Move magical boat offset to static function
2023-06-15 17:53:18 +02:00
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
de159df481 Rename boats 2023-04-20 21:20:51 +04:00
59a1a19d4a Summon boat for real boats only 2023-04-18 22:21:26 +04:00
ed798b06da Prepare transport enum 2023-04-18 13:04:49 +04:00
b9cabef179 Fixes issues related to spell mechanics 2023-04-10 17:08:24 +04:00
fc310c6e79 Town portal fix 2023-04-10 01:46:37 +04:00
601e7e854f Dimensions door fix 2023-04-10 01:37:46 +04:00
0093a44889 Added abstract method to caster interface 2023-04-10 01:31:41 +04:00
72b2a09f0b Boat summon spell rewritten 2023-04-10 01:06:02 +04:00
bc228a938a vcmi: use enum class for EComponentType
There is really no reason not to use it
2023-03-11 21:41:57 +03:00
11e4d84749 Implemented View Earth / View Air spells 2023-03-05 17:48:02 +02:00
4501036a04 Basic version of hero movement on map. Removed old code. 2023-03-05 17:48:02 +02:00
97fc424e98 vcmi: modernize lib/spells (except adventure one, needs major rework) 2023-02-12 21:23:00 +03:00
fa6f7513e8 All heroes-related strings are passed through translator 2023-01-20 15:18:36 +02:00
d0c292e2fd Fix order of map indexes 2023-01-20 15:15:57 +02:00
25bceda4ea Added convertToVisitablePos/convertFromVisitablePos to CGHeroInstance
This method replaces old convertPosition, but with more clear names and
without hardcoded magic constants.
2022-12-09 14:42:47 +02:00