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

234 Commits

Author SHA1 Message Date
ArseniyShestakov
9d9c026c85 Code style: serialize everything on own lines for easier debugging (#357) 2017-07-31 16:35:42 +03:00
ArseniyShestakov
006fa6c6df Merge pull request #332 from FeniksFire/SmallBugFix
Fix handling damage from obstacles
2017-07-15 00:09:37 +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
FeniksFire
43d324b561 Fix handling damage when stack wait in moat.
Currently stack don't take any damage from moat when he stay in same
place.
2017-07-09 15:07:20 +02: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
ArseniyShestakov
2f305cc68d Remove code related to duel mode (#312)
Remove code related to duel mode
2017-07-01 16:30:13 +03:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
AlexVinS
0f5202689e Cumulative spell effects
* Added experimental support for cumulative effects for ENCHANTED bonus
* Updated and fixed SPECIAL_PECULIAR_ENCHANT processing
* Initial implementation of cumulative spell effects.
* Scheme for new spell feature - cumulative bonus.
2017-06-13 21:50:50 +03:00
AlexVinS
0190c9804e formatting 2017-06-06 19:45:34 +03:00
AlexVinS
a31c28ec33 Unified war machine mechanics.
* it is possible to define new war machines
* added warMachine field to artifact configuration
2017-06-06 19:18:26 +03:00
Arseniy Shestakov
4b0f702e7e Add LeaveGame netpack and avoid replying on it and CloseServer 2017-06-02 02:51:44 +03:00
AlexVinS
609c6f81bd Fixed a few CWE-457 2016-11-27 22:37:41 +03:00
AlexVinS
86e33a4c45 [Refactoring] Unified SetResources NetPack API. 2016-11-26 15:14:43 +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
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
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
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
23b7a803b6 cleanup 2016-10-01 20:07:36 +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
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
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
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
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
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
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
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
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
AlexVinS
c94bea51e3 Update army in case of summoned creatures 2015-11-03 02:18:33 +03:00
Vadim Markovtsev
e4b1ef1405 Add "override" to virtual overriden methods 2015-10-13 21:05:36 +03:00
AlexVinS
e82dfb5a85 fixed mantiss 0002254 2015-09-04 18:08:25 +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
AlexVinS
ca5391cde6 Get rid of handleSpellCasting 2014-11-25 22:00:04 +03:00
AlexVinS
c67887ae58 Use spell mechanics clases in GameHandler 2014-11-25 18:16:14 +03:00
Ivan Savenko
aa0433228a Fixed cheats - sendMesssage will also pass current object.
Workaround-ish but should work. Branch should be fixed now.
2014-09-21 20:35:53 +03:00
Ivan Savenko
78709e223b Breaking things - trying to remove server-side knowledge of selected objects 2014-09-19 00:18:49 +03:00
Ivan Savenko
32240da34e Reduced number of #include's in headers. May break compilation on Win
since some net packs now need DLL_LINKAGE
2014-06-25 17:11:07 +03:00
Ivan Savenko
a0689fa377 Refactoring of hoverText from objects:
- removed hoverText field
- split getHoverText() method into 3:
- - getObjectName() for generic name
- - getHoverText(Player) for player-specific text
- - getHoverText(Hero) for hero-specific strings
2014-06-24 20:39:47 +03:00
Ivan Savenko
ad632d1e8a Moved FoW management from CGObjectInstance to callback 2014-06-24 20:39:47 +03:00
DjWarmonger
f8028f512d Fixed #1585 - destroyed war machines will be removed from hero's equipment. 2013-12-19 14:35:49 +00:00
beegee1
f0cbbbdb70 - Refactored method CGameState::init 2013-12-18 18:18:12 +00:00
beegee1
61fc216a6f - Fixed mantis #1421
- Fixed initial map selection in campaign bonus screen
2013-12-17 17:14:55 +00:00
beegee1
41e274b4aa - Moved FunctionList from /client to /lib -> used in client and server
- Updated project files
2013-11-30 10:08:38 +00:00
beegee1
c786a3076a - Refactored victory loss condition checks
- Added toString() method to EVictoryLossCheckResult enum class to improve debugging
- Removed mostly unused CFunctionList2
- Added missing header files for vcmiclient project to CMakeLists
- Tweaked SDL suggests bpp message a bit
- Added showInfoDialogAndWait (info dialog and waits, used from client thread) and showOkDialog (callback to ok click, used from GUI thread) to player interface
- Added showOkDialog method to CInfoWindow (unused for now, but may be used later)
2013-11-30 09:43:31 +00:00
beegee1
3e4407593f - Refactoring for checking victory/loss conditions (use enum class instead of magic numbers)
- Improved showing player lost message for one special case
2013-11-17 17:57:04 +00:00