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

1447 Commits

Author SHA1 Message Date
FeniksFire
039e3842fc Aesthetic changes in BattleHex (#303) 2017-05-29 10:33:34 +03:00
AlexVinS
25d06c8d70 Fixed CID 1375686 2017-05-28 15:00:55 +03:00
Fay
b5daa24982 Android support (#299)
* AI libs registering shenanigans on android;
* Fixed resolution aspect + mouse event scaling;
* Proper server init/deinit (through android IPC);
Enabled threaded init in CMT;
* Prevented a deadlock in logger on some devices;
* Fixed frozen intro frame after interrupting the video;
Added android progressbar displaying during initial data loading;
* Hacky fix for choppy animations during heroes movement (should look better now, but it's definitely not a good solution);
* Changes/fixes for new android launcher building process;
* Fixed app hang after getting SDL_QUIT when activity was destroyed;
* Functioanal, configurable advmap swiping support;
* VCMI changes cleanup;
Added few missing VCMI_ANDROID guards on swipe mechanics;
* Removed unneeded sleep in server startup code for android;
* Removed android ioapi hack (fixed in newest ndk);
* Removed unused android's library loading logic;
* Added android's swipe option to settings schema;
* Moved NO_STD_TOSTRING to be defined in global.h instead of build files;
2017-05-25 20:57:20 +03:00
AlexVinS
3c893a6bec Few spell-related tweaks 2017-03-18 14:08:02 +03:00
AlexVinS
5da109ad30 tweaks 2017-03-18 13:25:12 +03:00
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
Michał Janiszewski
f5ebc763b4 Add override keyword where applicable 2017-02-17 14:39:16 +01:00
Dydzio
86fe44d9ac Counterattack correction. Fixes bug #2501
Creatures should not be able to counterattack multiple times during one opponent attack under any circumstances.
2017-02-10 00:36:15 +01:00
dydzio
21f4a0ba60 Implement ranged counterattack 2017-02-04 10:33:45 +01:00
Dydzio
6c8ef79727 Merge branch 'develop' into MakeWOGGreatAgain 2017-02-01 23:14:36 +01:00
dydzio
cffa616bf1 Refactor SOUL_STEAL bonus handler 2017-02-01 22:58:31 +01:00
dydzio
4c4539b00e Rename ADVANCED_CATAPULT bonus to reflect the purpose better 2017-02-01 15:05:46 +01:00
dydzio
a8f04aede7 Extend creature siege support. Fix bug #2600 2017-02-01 11:25:57 +01:00
dydzio
b5bfb763fd Allow different subtypes of SOUL_STEAL work concurrently 2017-01-29 14:45:36 +01:00
dydzio
330c0961b7 Add missing code fix 2017-01-29 12:52:18 +01:00
dydzio
2f1f725ae6 Code improvements, minor fixes 2017-01-29 11:50:37 +01:00
dydzio
f447e44427 Add missing skill description, handler refactoring 2017-01-26 21:24:01 +01:00
dydzio
3e285c2004 Add santa gremlin missing creature ability, fix shooter init bug 2017-01-26 20:53:28 +01:00
dydzio
daec6d933c Add "WoG werewolf"-like ability support 2017-01-22 20:28:08 +01:00
dydzio
c310138fc3 Add WoG ghost ability support 2017-01-20 15:48:45 +01:00
DjWarmonger
80d5f7b4a4 Updated project files to MVS 2015 (in fact, it's trivial). 2016-12-12 19:14:45 +01:00
AlexVinS
204ee37ae4 boost/program_options has only 2 uses, and unlikely will be used more -> removed form Global.h. 2016-11-28 21:38:17 +03:00
AlexVinS
eeb21d2446 fixed regression 2016-11-28 05:19:44 +03:00
AlexVinS
2a62ca9522 Fixed CID 1197353 2016-11-28 02:50:43 +03:00
AlexVinS
60b1a9ac52 Fixed CID 1197370, CID 1197369, CID 1197371, CID 1197372, CID 1197374, CID 1288881, CID 1197376 2016-11-27 23:18:21 +03:00
AlexVinS
609c6f81bd Fixed a few CWE-457 2016-11-27 22:37:41 +03:00
AlexVinS
abe4beebc6 Fixed CID 1197516 2016-11-27 19:13:40 +03:00
AlexVinS
4b2bbd0d76 Fixed CID 1288864 2016-11-26 22:06:12 +03:00
AlexVinS
7befacfb1e Simplify CGameHandler::makeBattleAction 2016-11-26 20:50:05 +03:00
AlexVinS
86e33a4c45 [Refactoring] Unified SetResources NetPack API. 2016-11-26 15:14:43 +03:00
AlexVinS
0e57825679 Fixed CID 1197463 2016-11-25 21:17:24 +03:00
AlexVinS
e7a0bd690a Fixed CID 1197453 2016-11-25 17:39:06 +03:00
AlexVinS
dc39fb2d14 Removed useless CPack::type field.
* it was an ancient network protocol artifact
2016-11-18 17:45:59 +03:00
DjWarmonger
9db3bfcbf2 Merge pull request #212 from vcmi/refactoring/serialization2
Apparently it works - both new and old saves load at least.
2016-11-01 17:25:39 +01:00
Ivan Savenko
256f43f467 Fixes zero-initialized fileVersion member in deserializer 2016-10-29 19:52:19 +03:00
Vadim Markovtsev
24793e115c Fix formatting 2016-10-29 13:45:08 +02:00
Vadim Markovtsev
dccc25268c Fix the initial creature spells at battle start
Before: built-in spells appear on first move of the creature
After: all built-in spells appear before the first move but after tactics

Example: Air Shield for experienced skeletons
2016-10-28 23:37:45 +02: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
Arseniy Shestakov
15b4774076 Logging: always print version of client and server in the begining 2016-10-27 17:14:20 +03:00
Arseniy Shestakov
cb3d6a24e7 Cmake: cleanup for commit hash in build version
Since it's available in lib we don't need to include it everywhere.
2016-10-27 17:01:29 +03:00
Vadim Markovtsev
da1c9cf249 Fix rebuilding everything on HEAD change 2016-10-23 16:56:53 +02:00
Vadim Markovtsev
d0beb27197 Add git commit hash into the version string 2016-10-23 15:45:47 +02:00
Vadim Markovtsev
6fe5f2a7f6 Fix segfault / assertion failure during battle
The cause of the assertion failure at BattleStackAttacked::applyGs "at"
was shooting and casting some spell in handleAttackBeforeCasting() and
eventually killing the whole stack. Fix: filter dead stacks in the end of
handleAttackBeforeCasting().
2016-10-12 19:11:12 +02:00
Vadim Markovtsev
76ac9991ed Format code 2016-10-12 17:22:35 +02:00
Vadim Markovtsev
34cf92cb9b Change logging style 2016-10-03 20:32:01 +02:00
Vadim Markovtsev
eac5aab396 Survive client<->server ABI mismatch 2016-10-02 22:45:00 +02:00
AlexVinS
723734fd04 Fixed commander always dies. 2016-10-02 17:15:25 +03:00
Arseniy Shestakov
7b7958c548 Cheat codes: add option to apply cheats on different players
All suitable codes can now be used with "ai", "all" color or with object ID:
vcminahar all - will apply cheat to all heroes of all players
vcminahar ai - will apply cheat  to all heroes of AI players
vcminahar blue - will apply it to all heroes of blue player
vcminahar 553 - will apply cheat to hero with instance id of 553 if it's exist
Cheats without options work as before.
2016-10-02 16:21:46 +03:00
AlexVinS
cd5c0b3297 Style tweaks. 2016-10-02 15:22:55 +03:00
AlexVinS
23b7a803b6 cleanup 2016-10-01 20:07:36 +03:00
AlexVinS
a1ff409080 Tweak
* handle BIND_EFFECT by bonus type
2016-10-01 08:04:39 +03:00
AlexVinS
72461c5c2e Fixed http://bugs.vcmi.eu/view.php?id=2268 2016-09-29 23:14:22 +03:00
AlexVinS
9097ffbd8a Handle HYPNOTIZE effect in case of FEAR and ENCHANTED effects 2016-09-29 22:26:28 +03:00
AlexVinS
83b3c700dd Handle HYPNOTIZE effect in case of mana drain 2016-09-29 21:47:41 +03:00
Vadim Markovtsev
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
AlexVinS
34b8b2c91b Fixed Berserk spell effect aka Bonus::ATTACKS_NEAREST_CREATURE
* issue http://bugs.vcmi.eu/view.php?id=2513
* fix is not retroactive
2016-09-29 14:11:15 +03:00
AlexVinS
8f18dec5e3 Cleanup 2016-09-29 12:13:06 +03:00
AlexVinS
7874dffa7d fixed http://bugs.vcmi.eu/view.php?id=2282 2016-09-24 10:06:24 +03:00
AlexVinS
62d272f3e5 Cleanup 2016-09-22 21:35:37 +03:00
AlexVinS
ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
Arseniy Shestakov
58f90b736b New cheat vcmiungoliant: hide all tiles that out of sight radius 2016-09-20 10:51:57 +03:00
Arseniy Shestakov
75cffa7d0b CGameHandler::arrangeStacks: honour removableUnits of CGGarrison
Now server properly check allowed actions for CGGarrison. Fix issue 2303
Server now allow all stack arrangement as long as troops stay inside garrison.
It's possible to put more troops inside using swap/merge/split, but not take anything out if it.
2016-09-19 03:20:44 +03:00
AlexVinS
ef34d21941 Passive cast can be blocked by spell level limit. 2016-09-18 17:21:56 +03:00
AlexVinS
dcb0e8a0c1 Tweak 2016-09-18 13:39:02 +03:00
Arseniy Shestakov
1d45d214e5 CGameHandler refactoring: when possible only use const data
We only change gamestate via netpacks so there is absolutely no reason to use non-const pointers and functions in GH.
2016-09-18 11:53:51 +03:00
AlexVinS
d993710f8e Merge branch 'develop' into SpellsRefactoring8 2016-09-17 20:29:44 +03:00
Arseniy Shestakov
7ae4e70134 CGameHandler: fix player id logging 2016-09-17 00:05:10 +03:00
Arseniy Shestakov
ea65fb15c2 CVCMIServer: do not crash if port not specified 2016-09-16 20:01:07 +03:00
AlexVinS
505e53c17d Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts:
#	client/battle/CBattleInterface.cpp
#	lib/spells/BattleSpellMechanics.cpp
2016-09-12 10:13:40 +03:00
AlexVinS
33d1895d21 Merge branch 'develop' into SpellsRefactoring8 2016-09-11 18:34:18 +03:00
Arseniy Shestakov
fe6c0cf89b Use RandomGeneratorUtil::randomShuffle for reproducible gameplay 2016-09-11 00:10:52 +03:00
Arseniy Shestakov
c8faca8f39 Refactoring: only use RNGs explicitly to avoid bug prone code in future
Now server-side code should always use CRandomGenerator::getDefault which is serialized in GH.
CGameState::getRandomGenerator should be only used from GS code and CPackForClient-based applyGs.
2016-09-11 00:10:46 +03:00
AlexVinS
f8767a6380 cleanup 2016-09-10 09:37:18 +03:00
Arseniy Shestakov
70abae9b51 CGameState::battleGetBattlefieldType: use RNG by ref
For now I not sure about proper place for battleGetBattlefieldType so I left it in GS
2016-09-09 23:16:43 +03:00
Arseniy Shestakov
ea63497b19 Move CGameState::setupBattle code to CGameHandler::setupBattle
No reason to keep this code in GS.
2016-09-09 23:16:43 +03:00
Arseniy Shestakov
53502e84e3 Add PrepareHeroLevelUp netpack to keep secondary skills RNG in sync 2016-09-09 23:16:43 +03:00
Arseniy Shestakov
ca819b3cda CGHeroInstance::nextPrimarySkill: don't use GS RNG directly
Code used from both GS and CGameHandler.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov
c8bcb14d34 CCallbackBase: add CRandomGenerator to all callbacks
This is easiest way to make server RNG available to CBattleInfoCallback.

Now server, client and gamestate have own RNG instance.
Only server and gamestate RNGs are serialized.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov
85f49bc968 CGHeroInstance::initArmy: don't use GS RNG. Get RNG through a ref
This function used by both server-side and gamestate so it's must use appropriate random source.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov
2ba3b20928 Multiple changes to RNG usage to both client and server
Server should never use RNG from CGameState directly.
Instead server get's own RNG that's state is secret for client.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov
6747555339 CGameHandler: use ObjProperty enum instead of magic numbers 2016-09-09 17:42:16 +03: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
AlexVinS
1ce4675df6 Tweaks 2016-09-06 13:33:11 +03:00
AlexVinS
686cd00c68 Cleanup. 2016-09-06 12:26:01 +03:00
AlexVinS
18fc94d709 WIP on SpellCastContext 2016-09-06 06:40:23 +03:00
AlexVinS
d4a35c6839 Simplify getAffectedStacks arguments. casterColor not needed anymore. 2016-08-30 12:14:08 +03:00
AlexVinS
85f94676a5 Server: convert logging 2016-08-30 01:13:07 +03:00
Alexander Shishkin
5e5ce0bb09 Merge pull request #203 from vcmi/logFormat
boost::format support for CLogger
2016-08-29 17:32:44 +04:00
Arseniy Shestakov
abad3cfb17 PlayerState::daysWithoutCastle: change in netpacks only. Fix issue 2462
Moving code from CGameHandler to NetPacksLib without changes.
2016-08-23 08:02:04 +03:00
AlexVinS
439aeecc8b [c::b] re-enabled PCH, tested with GCC 5.3. (Older versions may not work) 2016-08-18 13:40:35 +03:00
Arseniy Shestakov
948cca02cc Fixes to some crashes on exit and to have cleaner valgrind output 2016-08-18 06:52:10 +03:00
Arseniy Shestakov
39fe9472b6 CGameHandler::moveArtifact: check lock status by slot instead of id
This one fix issue 2455. We still need to do something with ArtifactID::ART_LOCK or ids for artifact from mods since they might conflict with each other.
2016-08-18 06:35:29 +03:00
AlexVinS
e7f2858d33 Use make_unique for TurnInfo in CGameHandler.
* Fixes use after free @CGameHandler.cpp:2093
2016-08-17 08:53:36 +03:00
Arseniy Shestakov
b0045fa357 Fix TurnInfo memory leaks 2016-08-16 15:47:21 +03:00
AlexVinS
36c44c2ce7 projects update 2016-08-13 16:57:11 +03:00
AlexVinS
72f79a3ad7 Draft boost::format based log proxy. 2016-08-13 16:57:09 +03:00
Arseniy Shestakov
2e70d29479 CGameHandler::applyBattleEffects: improve Fire Shield support
Now damage is limited to total health of defending stack and clone have no file shield damage. In same time damage calculation is likely remain incorrect.
2016-03-14 15:28:17 +03:00
Arseniy Shestakov
605962019b CGameHandler::giveSpells: improve Conflux grail building support
Aurora Borealis give hero spells of all levels even if only first level of mages guild is built. Widsom requirement is still remain in place of course.
2016-03-13 13:26:00 +03:00
Arseniy Shestakov
bee0c6d705 CGameHandler::buildStructure: give spells after gs apply. Fix issue 2425
Hero will also immidiately get new spells when Library built in Tower or Grail in Conflux.
2016-03-13 11:31:09 +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
AlexVinS
e3e27b9bfe Move ghost creation to inner battle loop 2016-03-01 11:07:45 +03:00
AlexVinS
4bf9036c7b Ensure that ghost stacks are created only by BattleStacksRemoved packet.
This will allow client to receive notification.
2016-03-01 05:24:35 +03:00
AlexVinS
2c48c95c8d Fix casualties calculation for commander 2016-03-01 04:06:32 +03:00
AlexVinS
f890037008 Fixes 2016-02-29 04:42:15 +03:00
AlexVinS
5df8d1cbd0 Update low level battle stacks accessor for ghost selection support. 2016-02-28 05:10:20 +03:00
AlexVinS
9036d39241 Do not remove battle stacks, make them ghosts instead.
* exclude ghost stacks from (hopefully all) get* results for now
2016-02-28 01:08:56 +03:00
AlexVinS
5d5ad99436 Rename DEAD_CLONE -> GHOST, as this will be possible for any stack 2016-02-28 00:13:34 +03:00
Arseniy Shestakov
f8c6751707 CGameHandler::endBattle: change town ownership when hero lost siege 2016-02-22 03:35:38 +03:00
ArseniyShestakov
c550484613 Merge pull request #181 from vcmi/feature/drawbridgeMechanics
Feature/drawbridge mechanics
2016-02-14 16:32:24 +03:00
Arseniy Shestakov
c5cfc8467f Battles: change naming from drawbridge to gate for everything
This way code is shorter and cleaner while in future we may support towns with gate only.
2016-02-13 17:40:31 +03:00
Arseniy Shestakov
11dc428b1e Battles: move hexes enum to GameConstants and fix wall position
Before we had hex 62 marked as destructible wall while actually it's must be 78.
2016-02-09 17:38:59 +03:00
Arseniy Shestakov
01b4d0ae01 Battles: better handling for walking double-wide creatures
Request opening of gate even if only second half of double-wide stack going to stop on it.
2016-02-09 15:41:37 +03:00
Arseniy Shestakov
a07761b608 Battles: readable identifiers enum for drawbridge and gate hexes
Dont like to locate them in BattleHex, but it's best place I can see so far.
2016-02-09 12:25:13 +03:00
Arseniy Shestakov
731de439eb Battles: drawbridge support for double-hex flying creatures 2016-02-09 11:59:20 +03:00
Arseniy Shestakov
28aff78f2c Battles: implement drawbridge support for flying creatures 2016-02-09 11:30:09 +03:00
Arseniy Shestakov
fbb34b8d04 Battles: always update drawbridge state after battle state changed
Now gate tower destruction will immidiately affect drawbridge state.
2016-02-09 10:59:33 +03:00
Arseniy Shestakov
47433919ab Battles: handle drawbridge lowering from stack start position 2016-02-09 10:45:59 +03:00
Arseniy Shestakov
015a57f81c Battles: more advanced drawbridge mechanics on server-side
Everything work as intended except starting point not included in path.
So we send BattleDrawbridgeStateChanged package when already standing on bridge hex.
2016-02-08 12:16:47 +03:00
ArseniyShestakov
890ae43f55 Merge pull request #180 from Zyx-2000/FileInfo
Refactored CFileInfo & ResourceID
2016-02-08 04:55:39 +03:00
ArseniyShestakov
7f68124b97 Merge pull request #136 from vcmi/issue/1372-2
issue/1372
2016-01-31 20:28:54 +03:00
Vadim Markovtsev
3926920103 Rename radious -> radius
There is no such English word, "radious"
Some files get new lines in the end - BSD sed bug + best practices
2016-01-31 18:01:58 +03:00
Vadim Markovtsev
918fbd8530 Refactor hero's mana regain 2016-01-30 13:51:07 +03:00
Vadim Markovtsev
22fc4fd3e9 Fix 2406 reset potentially available heroes 2016-01-30 10:02:33 +03:00
AlexVinS
16e0d18880 Added special slots for war machines and arrow towers 2016-01-30 00:53:53 +03:00
Arseniy Shestakov
57328bdc83 Battles: implement basic drawbridge mechanics
Movement to blocking hex 94 not yet properly handled as stack movement code need to be rewritten first.
Also gate destruction not immidiately affect drawbridge state.
2016-01-29 22:43:35 +03:00
AlexVinS
ba017c443d Start from diff of pull request #124 from vcmi/issue/1372 2016-01-29 21:05:17 +03:00
Zyx-2000
3a1a8e3d47 further refactoring-related changes 2016-01-29 15:16:14 +01:00
Zyx-2000
c3e8c8bc1c Merge branch 'develop' into FileInfo 2016-01-27 19:21:43 +01:00
AlexVinS
d7c0c3759a Merge branch 'Zyx-develop' into develop
Conflicts:
	lib/filesystem/AdapterLoaders.h
2016-01-27 18:53:41 +03:00
Vadim Markovtsev
36eaa399e7 Add hardcodedFeature to switch winner's retreating with no troops 2016-01-27 16:42:17 +03:00
AlexVinS
bffdc2813d revert some project changes 2016-01-27 15:21:29 +03:00
ArseniyShestakov
4483c45905 Merge pull request #167 from vmarkovtsev/issue/1569
Fix 1569 winning hero with no troops shall retreat
2016-01-27 11:48:22 +03:00
Vadim Markovtsev
7772b6de74 Fix 981 reset hero on hiring after retreat/surrender 2016-01-26 22:48:31 +03:00
Zyx-2000
70e3c81b9f Replaced CFileInfo with more correct and efficient alternative 2016-01-26 14:51:38 +01:00
Vadim Markovtsev
6849ff846c Fix memory corruption with a draw; race in setBattleResult() 2016-01-25 15:55:32 +03:00
Vadim Markovtsev
afa95312ba Fix 2139 captured spell scroll descriptions 2016-01-25 08:49:26 +03:00
Vadim Markovtsev
7185890723 Fix double free in battleAfterLevelUp() in case of a draw 2016-01-24 01:31:39 +03:00
ArseniyShestakov
b19e082f37 Merge pull request #166 from vmarkovtsev/issue/1723
Fix 1723 quest crash on combined arts
2016-01-23 23:23:07 +03:00
Vadim Markovtsev
2a6a8cd433 Fix segfault when non-hero forces win 2016-01-23 19:42:56 +03:00
Vadim Markovtsev
9ffd0155e6 Fix 1810 suggest artifact assembly 2016-01-23 16:24:43 +03:00
Vadim Markovtsev
99992599db Partially fix 1416 tavern hero rotation 2016-01-22 22:37:46 +03:00
Vadim Markovtsev
9dfef2186d Fix 1569 winning hero with no troops shall retreat 2016-01-22 22:29:53 +03:00
Vadim Markovtsev
11bce2908d Fix 1723 quest crash on combined arts 2016-01-22 12:56:25 +03:00
Arseniy Shestakov
d25372a397 Added vcmiglaurung cheat that add 5000 crystal dragons into each slot 2016-01-21 10:49:09 +03:00
Zyx-2000
a50a702073 switched to -std=gnu++11 2016-01-18 17:49:07 +01:00
Vadim Markovtsev
4a05402c2f Revert 5cd4e852d4 "Use portable cast in CTeleportDialogQuery also"
Actually, this leads to crash on MacOSX, I specially left that intact.
2016-01-18 10:45:09 +03:00
Zyx-2000
203b2dccc3 hopefully fixed things 2016-01-09 21:23:55 +01: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
Arseniy Shestakov
29a7934a99 Refactoring: avoid using namespace when it's not absolutely needed 2015-12-29 02:14:08 +03:00
Arseniy Shestakov
6985e96f0d CGameHandler::newTurn: use next day TurnInfo to set correct hero MP
This hotfix actually fix issue 2083, but in future we need to rework new turn code anyway. See issue 2356.
2015-12-25 11:09:06 +03:00
Arseniy Shestakov
6f5c52a229 Refactoring: use cleaner CCreatureSet::stacksCount everywhere 2015-12-24 21:30:57 +03:00
Ivan Savenko
a051a08a46 Merge remote-tracking branch 'origin/issue/2306' into develop 2015-12-18 22:21:11 +02:00
ArseniyShestakov
bf9ac7318a CPathfinder: change cost calculation sequence for embark / disembark
With old embark cost calculation pathfinder may end up thinking that hero can embark/disembark while have less movement points than base movement cost is. Now hero would be only able to embark / disembark if we have enough movement points to step on that tile. This rule is also valid for situation when hero have Admiral's Hat as in H3 even if hero don't have embark penalty he still use move points for embark and disembark.

Problem was found as it's was causing infitite loop in AI. Server of course rejected attempt to embark with less than 100 movement points while pathfinder tell AI that it's can still embark with 93 movement points.
2015-12-15 20:08:52 +03:00
AlexVinS
5cd4e852d4 Use portable cast in CTeleportDialogQuery also 2015-12-13 15:59:48 +03:00
AlexVinS
9a0161e4e2 Fix and unify CBattleQuery::blocksPack 2015-12-13 15:57:33 +03:00
ArseniyShestakov
5aadc1ed6f CasualtiesAfterBattle: dont remove catapult artifact. Fix 2346 issue 2015-12-10 13:31:03 +03:00
ArseniyShestakov
d900e9bec2 CGameHandler: fix hero removal code on player loss. Fix issue 2347 2015-12-10 12:43:55 +03:00
ArseniyShestakov
03e9dd3bab Add hero gold cost to GameConstants 2015-12-07 00:13:58 +03:00
AlexVinS
0fab319c73 Merge remote-tracking branch 'remotes/origin/develop' into issue/2306
s reverts commit fa8a282696.

Conflicts:
	AI/VCAI/VCAI.cpp

Conflicts:
	AI/VCAI/VCAI.cpp
	client/windows/CAdvmapInterface.cpp
	lib/CPathfinder.cpp
	lib/CPathfinder.h
2015-12-05 12:56:12 +03:00
ArseniyShestakov
0a5e9c0fbe Merge pull request #144 from vcmi/fix/teleportMultiExitPoints
Support for exit selection between multiple teleport exit points
2015-12-05 03:12:17 +03:00
Ivan Savenko
faa7cbff18 Fixed gcc/clang warnings 2015-12-04 01:17:43 +02:00
ArseniyShestakov
2f9ca778b2 VCAI: add channel probing support for teleporters with multiple exits 2015-12-03 17:20:03 +03:00
Ivan Savenko
7189a12df2 removed few more includes from headers 2015-12-02 22:10:46 +02:00
Ivan Savenko
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
Ivan Savenko
c3ce4b25df Removed all #include's of CMap.h from headers.
To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
2015-12-02 21:05:10 +02:00
ArseniyShestakov
f55bfe41d6 Digging: implement digging status on right click. Fix issue 401
This is also fix possibility to dig on some non-blockable objects like event.
2015-11-29 12:34:23 +03:00
ArseniyShestakov
a1fe2ebc44 Pathfinding: restore gamestate usage to avoid overhead
Also when possible pass TerrainTile pointers to getMovementCost instead of using getTile.
2015-11-21 14:31:30 +03:00
ArseniyShestakov
abc4ea272f TurnInfo: store all bonuses and use TileInfo for everything
Currently this going to break ONE_WEEK bonuses because those don't work with CWillLastDays selector.
2015-11-12 14:30:29 +03:00
ArseniyShestakov
2ef9d7c3ec Rename getCost back to getMovementCost
Initially wanter to name main class differently and back then getCost make sense.
Then renamed class to CPathfinderHelper, but forgot to rename function back.
2015-11-10 02:30:05 +03: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
d3c8ca7c1c Pathfinding: implement duration checking for fly and water walking
Now pathfinder take into account different bonuses for different tuns. So if you only have FLYING_MOVEMENT bonus from Fly spell for one turn then pathfinder will only let you use air layer within one turn only.

That work for cost calculations too. Let's say you have two bonuses:
 - FLYING_MOVEMENT with 20% penalty for next 2 turns
 - FLYING_MOVEMENT with 40% penalty for 5 turns
Now pathfinder using correct penalty for each turn so movements in air layer going to be more expensive on 3-5 turns.
2015-11-09 19:57:26 +03:00
ArseniyShestakov
5106738160 Merge branch 'develop' into feature/pathfinderLayers 2015-11-09 19:20:13 +03:00
ArseniyShestakov
74198a537b CGameHandler::setOwner: fix InfoWindow text on last town loss 2015-11-09 00:54:59 +03:00
AlexVinS
e645b46aed Revert "Merge pull request #124 from vcmi/issue/1372"
This reverts commit da01af319b, reversing
changes made to 8b6b4e2e0b.
2015-11-07 11:35:02 +03:00
ArseniyShestakov
bd12989ad6 Artifacts: use ArtifactID instead of ints 2015-11-06 21:54:51 +03:00
ArseniyShestakov
62dc070c0a moveHero: add transit validation and avoid embarking on transit
Hero shouldn't embark into boat when attempt to transit over air layer.
2015-11-05 10:50:47 +03:00
ArseniyShestakov
ac12a0735e Plumbing on client and server to make flying actually work 2015-11-05 10:02:13 +03:00
AlexVinS
6a9dc78dcd [WiP]Added some checks for RISE_DEMONS action. 2015-11-03 02:18:36 +03:00
AlexVinS
fbebbf39f3 Fix zero size stack summoned in case of basic resurrection. 2015-11-03 02:18:35 +03:00
AlexVinS
f6b9015324 Use constant for summoned creature slot 2015-11-03 02:18:34 +03:00
AlexVinS
c94bea51e3 Update army in case of summoned creatures 2015-11-03 02:18:33 +03:00
AlexVinS
b024237e8a Remove stack instancies of removed stacks 2015-11-03 02:18:32 +03:00
AlexVinS
d46364c4c3 Merge branch 'develop' into issue/2306
Need to reapply changes to pathfiner

Conflicts:
	AI/VCAI/VCAI.cpp
	lib/CGameState.cpp
	lib/CGameStateFwd.h
2015-11-01 01:49:57 +03:00
Vadim Markovtsev
5c623868bf Fix invalid dynamic_cast replacement 2015-10-31 23:01:22 +03:00
Vadim Markovtsev
fa8a282696 Fix pthread_mutex_lock abort() in requestActionASAP impl 2015-10-31 18:04:06 +03:00
DjWarmonger
17071c6ec8 Merge pull request #125 from ArseniyShestakov/newMovementSystem
Okay, time to merge this.
2015-10-31 13:56:22 +01:00
Vadim Markovtsev
68cc860133 Fix dynamic_cast on MacOSX in CQuery.cpp 2015-10-31 15:05:52 +03:00
ArseniyShestakov
a0a55974ea Fix issue 2320. Town events for buildings should now work 2015-10-28 08:46:43 +03:00
DjWarmonger
c47c08aa01 Replaced iterators with auto & loop. 2015-10-25 07:07:01 +01:00
DjWarmonger
eb0af0096e Fixed #2072. 2015-10-24 18:16:57 +02:00
DjWarmonger
61692ba168 Possibly fixed #1583 and other issues concerning players capturing towns. 2015-10-24 18:03:00 +02:00
DjWarmonger
3c4f7ec126 Fixed #2311 2015-10-24 17:15:21 +02:00
DjWarmonger
641aa13526 Some fixes for previous commit. 2015-10-24 17:02:00 +02:00
DjWarmonger
716c324695 Don't give a turn to player who is about to lose (days without town). 2015-10-24 16:21:30 +02:00
DjWarmonger
abe88ea890 - Refactoring legacy code
- Some checks for #2311
2015-10-24 15:09:46 +02:00
ArseniyShestakov
fc6f62e633 getMovementCost: get rid of useless flying parameter 2015-10-19 07:27:00 +03:00
ArseniyShestakov
0d83f6fedd Fix issue 1877. Allow to buy heroes in ally towns
Also removed TODO because check already implemented in CGameHandler::hireHero
2015-10-15 04:00:21 +03:00
Alexander Shishkin
fca4deaad2 Merge pull request #122 from vmarkovtsev/feature/warnings
Fix warnings produced by recent Clang build
2015-10-14 07:28:47 +03:00
Vadim Markovtsev
e4b1ef1405 Add "override" to virtual overriden methods 2015-10-13 21:05:36 +03:00
AlexVinS
b94432b4ba Fixed http://bugs.vcmi.eu/view.php?id=2297
* allow banned spells by Tomes (XXX_SPELLS bonus), Spelbinders Hat (SPELLS_OF_LEVEL bonus)
* allow banned spells by cheat-code (now also SPELLS_OF_LEVEL bonus)
2015-10-13 13:16:46 +03:00
AlexVinS
f99bf099ca Made player interface tolerant to active stack removal. 2015-10-06 03:46:35 +03:00
AlexVinS
d042b08682 Fix the SACRIFICE fix regression
(crach if stack die on counter attack)
2015-10-06 02:04:25 +03:00
AlexVinS
d1ec538d72 Fix server crash releated to active stack remove. 2015-10-05 21:09:00 +03:00
AlexVinS
57e5b768e8 Allow multiple destinations in BattleSpellCastParameters 2015-09-30 00:31:50 +03:00
AlexVinS
70d9be8447 Use ISpellCaster in battle callback 2015-09-29 17:26:52 +03:00
AlexVinS
36e154d9b9 Use ISpellCaster in getAffectedStacks 2015-09-29 17:26:50 +03:00
AlexVinS
a4d4851d80 Fix typo: casted->cast 2015-09-29 17:26:48 +03:00
AlexVinS
660203b436 Tweak BattleSpellCastParameters 2015-09-29 17:26:41 +03:00
AlexVinS
2b434111bf More hero|creature casting unification 2015-09-29 17:26:40 +03:00
AlexVinS
e454649886 Use BattleSpellCastParameters for spell parameters override 2015-09-29 17:26:39 +03:00
AlexVinS
10318a3da3 Intoduce PASSIVE_CASTING mode for opening battle spells
* now at least one "caster" object is present
2015-09-29 17:26:39 +03:00
AlexVinS
6010bbe7ba More correct usage of battleGetFightingHero
* this should fix "FIXME: battleGetFightingHero wrong argument!"
2015-09-29 17:26:38 +03:00
AlexVinS
873979a300 The only usage of secHero cast parameter is mana channeling - better to get it OTF 2015-09-29 17:26:33 +03:00
AlexVinS
46f99db8d7 Hide some spell mechnaics details 2015-09-29 17:26:32 +03:00
AlexVinS
2c3a607497 Tweak StacksHealedOrResurrected
* flags should be bool
2015-09-29 17:26:31 +03:00
AlexVinS
a1e06aa217 Unify LIFE_DRAIN and Tent healing with magic healing 2015-09-29 17:26:30 +03:00
AlexVinS
b0c039bd7f fix 2241 2015-09-15 10:54:55 +03:00
AlexVinS
b4d73409b7 Fix random server crash after CLONE or SACRIFICE use 2015-09-15 04:58:32 +03:00
AlexVinS
e9c3bc9df6 Fix after rebase 2015-09-12 21:09:54 +03:00
AlexVinS
7776d7bbf7 rename BattleSpellCastParameters::caster 2015-09-12 21:09:54 +03:00
AlexVinS
e82dfb5a85 fixed mantiss 0002254 2015-09-04 18:08:25 +03:00
David Zéni
41293caf83 Fix bad formatting 2015-08-29 20:02:27 +02:00
David Zéni
b49fb7d07f Refactor actions for Catapult
No target -> Pass
No player or no ballistics -> automatic action
Else -> manual action
2015-08-27 23:03:48 +02:00
David Zéni
f84e5cf8b3 When hero has ballistics and no target pass turn 2015-08-26 20:54:24 +02:00
AlexVinS
40d3bb40c3 Partial fix for mantiss #2237 2015-08-22 16:22:10 +03:00
AlexVinS
782c8ec40b Changed windows minimum version back to winxp due to mingw bug
* will be changed back after newer mingw tests
2015-08-20 04:22:54 +03:00
AlexVinS
03a295f1a0 Added debug mingw64 build, minimum Windows version set to windows 7, SDL suffixes removed from Build Tagerts 2015-08-20 03:28:04 +03:00
DjWarmonger
c5691cbeb1 Compile fix - srsly? 2015-07-18 20:47:09 +02:00
AlexVinS
a8c45df732 Merge branch 'SDL1Wipe' into develop 2015-06-22 14:24:00 +03:00
AlexVinS
e27516a0b5 fix mantiss #2210 2015-06-21 21:27:58 +03:00
AlexVinS
53b85d16be Cleanup C::B projects 2015-06-21 01:59:33 +03:00
AlexVinS
f5c2e6d5e1 Style tweaks 2015-06-02 07:12:45 +03:00
AlexVinS
9eaa136c58 fix releasing obstacle pointer 2015-06-02 07:12:44 +03:00
AlexVinS
5226081f33 rewrite stack movement processing 2015-06-02 07:12:43 +03:00
AlexVinS
e45b6cfdda fix mantiss 0001581 2015-04-13 17:27:47 +03:00
AlexVinS
20acdbbf3b Fix wrong side for opening battle spells 2015-03-30 19:16:08 +03:00
AlexVinS
6dea40aa95 Do not damage immune creature by spell-created obstacle. This should fix 0001846 2015-03-29 16:50:23 +03:00
DjWarmonger
8820bc05a9 MSVS compiler doesn't allow default arguments for Lambdas. 2015-03-10 10:06:45 +01:00
DjWarmonger
ec879046ca Merge pull request #93 from ArseniyShestakov/feature/pathfindingTeleports
Okay let's do this!
2015-03-10 09:04:25 +01:00
ArseniyShestakov
3773859e9d CGameHandler::moveHero allow transit, but for teleports only 2015-03-08 17:08:57 +03:00
ArseniyShestakov
21aaad6972 MoveHero: add transit movement option
Transit is new option for hero movement. If it passed for movement then hero can get get on tile without visiting of object on it.
Currently it's will be only allowed is object under destination is teleport.
2015-03-08 17:04:09 +03:00
ArseniyShestakov
25656aa586 Add showTeleportDialog everywhere except actual code for AI and player
Just like TeleportDialog it's based off showBlockingDialog, but as number of package is higher when possible showTeleportDialog will be after other dialogs handling code.
2015-03-08 16:52:50 +03:00
ArseniyShestakov
18535db0ef Add TeleportDialog and CTeleportDialogQuery
TeleportDialog is based off BlockingDialog and it's needed for server to ask client what teleport hero should be teleported to.
It's also contain list of possible exits, identifier of currently used channel and also impassable option.
If impassable set to true then client will remember that current teleport channel is lack of exit point.
2015-03-08 16:37:33 +03:00
AlexVinS
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00
AlexVinS
08d4f7991e Extract adventure spell mechanics 2015-02-26 08:39:39 +03:00
DjWarmonger
a736a863da Merge branch 'develop' of https://github.com/vcmi/vcmi into develop 2015-02-22 18:36:23 +01:00
DjWarmonger
6797c374ed Additional check 2015-02-22 18:36:13 +01:00
ArseniyShestakov
445ded71a7 Movement: now hero will always ignore guards if visiting object that he staying on
This one is replicating original game behaviour and fixes issue 1990 and related to issue 2084.
Currently this is mainly caused problem with teleporters which lead to crash in AI due to unexcepted hero loss.
2015-02-22 20:12:49 +03:00
AlexVinS
aa5e9fc959 get rid of global debug macros. 2015-02-14 22:43:16 +03:00
DjWarmonger
a8ff08a562 Fixed #2012 2015-02-14 19:44:04 +01:00