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

394 Commits

Author SHA1 Message Date
Ivan Savenko
34772ef830 Fixed includes 2023-02-01 21:45:06 +02:00
Ivan Savenko
108a42e4ba Reorganized includes for new layout. New class - IImageLoader 2023-02-01 20:42:06 +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
SoundSSGood
3142f32cbb Fix for callback return. More code optimization 2022-11-11 01:28:04 +02:00
SoundSSGood
9647758812 Apply suggested changes next part 2022-11-10 23:24:41 +02:00
SoundSSGood
d0895e30ef callback functions and cleaning up unused code 2022-11-06 23:41:29 +02:00
Andrii Danylchenko
288f36c0c3
Merge pull request #1052 from Nordsoft91/mp-disconnection
MP handle disconnection
2022-10-19 09:56:18 +03:00
Andrii Danylchenko
82a9f82e1c BattleAI: retreat 2022-10-14 12:00:56 +03:00
nordsoft
895ec2d302 Make console available during other players' turn 2022-10-05 19:04:51 +04:00
Andrey Filipenkov
7e6ed0583c disable all scripting code when configuring without scripting modules 2022-09-21 19:31:42 +03:00
DjWarmonger
7ba271edf1
Rotation rebase2 (#912)
* Instead of [x][y][z] coordinates, map will be stored as [z][x][y].
* Nullkiller AI can get it too.
* Use boost::multi_array instead of nested vectors
* In MapHandler too
* Rotate foreach algorithms, too
* VCAI gets rotated, too
2022-09-18 17:39:10 +03:00
Dmitry Orlov
8cae3398ba Feature: Army Management Shortcuts should work as in HD+ Mod 2021-11-28 20:00:43 +02: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
AlexVinS
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
Alexander Shishkin
75f8c8b29a Gui cleanup4 (#446)
* use smart pointers for almost all widget fields
* use SDL2 texture for cursor
* a lot af small tweaks and formatting
* removed CompImage class, it is actually useless as long as regular SDLImage support margins
* CGuiHandler: use smart pointers for [push|pop]Int
2018-07-25 01:36:48 +03:00
AlexVinS
db60983b5a Fixed broken town`s marketplace 2018-04-06 05:49:18 +03:00
Arseniy Shestakov
674242da54 CCallback: remove unregisterAllInterfaces
Not needed since CPlayerInterface no longer handle interface removal.
It's far better when CClient::endGame doing it since they owned by CClient.
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
AlexVinS
e666b2740c Do not use CCreature in CSimpleArmy 2018-03-17 13:24:12 +08:00
AlexVinS
8cec07afbd Replaced CGHeroInstance and CGObjectInstance with ObjectInstanceID in NetPacks 2018-03-17 13:24:12 +08:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
Michał Kalinowski
26a222ac62 Change JsonType to enum class (#393)
Change enum JsonType to enum class JsonType
2017-11-27 00:18:18 +03:00
Piotr Wójcik
7171fa7ad4 Formatting 2017-10-28 11:04:55 +02:00
Piotr Wójcik
58b427345f Constify 2017-10-18 21:39:04 +02:00
Piotr Wójcik
78e5d39ea0 Change variables type 2017-10-18 21:02:23 +02:00
Piotr Wójcik
802680f925 Fix compilation 2017-10-17 09:55:11 +02:00
Piotr Wójcik
f145b4be91 Correctly sacrifice many stacks or many atrifacts, fixes #2607 2017-10-14 21:30:56 +02:00
AlexVinS
143ff682bc Logging cleanup 2017-08-10 21:59:55 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
ArseniyShestakov
a4c0ad94b1 Code style: remove default value hints in definitions (#342)
Some are outdated and this is something IDE are useful for.
2017-07-15 14:08:20 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
AlexVinS
2c525fc76e Attempt to fix headless tests crash. 2017-07-12 17:02:25 +03:00
AlexVinS
dbaf3cb023 Cleanup & formatting 2017-07-04 01:32:40 +03:00
AlexVinS
3d1a84875e Queries refactoring
* Moved SUMMON_BOAT special case to mechanics
* Partially moved Town portal logic to mechanics class
* Added generic query reply to CCallback
* Redesigned Queries so that base API do not depends on CGameHandler
* Got rid of CGameHandler::castSpellRequest
* Removed CGameHandler::castSpell
* Added new Query type for town portal dialog (not used yet)
2017-07-03 21:43:04 +03:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
AlexVinS
86f9df5f68 Made gamestate lock static 2017-06-14 07:59:41 +03:00
DjWarmonger
b06e20bba3 Compilation fixes for MSVS 2017-03-17 19:55:52 +01:00
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
DjWarmonger
cc452bdfa9 Improved road routing so they can go under any passable object. 2016-12-21 10:10:37 +01:00
AlexVinS
dc39fb2d14 Removed useless CPack::type field.
* it was an ancient network protocol artifact
2016-11-18 17:45:59 +03:00
Ivan Savenko
5b76c3f4eb Rebase of codebase changes for refactored serializer
Some of newer fixes not yet merged there and save compatibility a bit off.
2016-10-27 18:12:20 +03:00
Vadim Markovtsev
4bcc43d3d0 Fix Mantis #2234
CPlayerInterface instances were removed from CClient::playerint with
clear() and finish() was not called on each. Added multiple insurance.
2016-10-22 16:22:00 +02:00
Arseniy Shestakov
d06d07a39b Add ChangeFormation netpack to avoid MP desyncs
Previous code was working fine for single client, but would cause desync in multiplayer. Fix issue 2460.
2016-09-08 19:29:15 +03:00
Arseniy Shestakov
113bd1b9ea CCallback::recruitCreatures: add refugee camp exception. Fix issue 2426 2016-03-13 09:02:08 +03:00
Arseniy Shestakov
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
Arseniy Shestakov
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00
Ivan Savenko
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
ArseniyShestakov
b2e1ee5363 CGameState: move two pathfinding-related functions to CPathfinderHelper
Both getMovementCost and getNeighbours have nothing to do with gamestate.
2015-11-10 02:15:27 +03:00
ArseniyShestakov
fc6f62e633 getMovementCost: get rid of useless flying parameter 2015-10-19 07:27:00 +03:00
Rohit Nirmal
aa00fdbd0e Fix building with Boost 1.58. 2015-05-06 19:16:51 -05:00