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

176 Commits

Author SHA1 Message Date
Ivan Savenko
ee1b0459e6 Extended building dependencies:
- buiding/structure lists must use object format. This may break some
outdated mods.
- generic support for logical expressions that consist from and/or/not
operators.
- string ID's for buidings are now actually used.
2013-12-02 11:58:02 +00:00
Ivan Savenko
27a30b5ff9 - compile fix
- fixed crash if json defines only one creature horde
2013-11-24 11:36:51 +00:00
Ivan Savenko
3560bbb7f3 two patches/pull requests from janisozaur
- replace our custom bmap with std::map::at()
- compile fixes for editor
2013-11-12 10:45:42 +00:00
Michał W. Urbańczyk
141c1a9854 Not crash when asking callback about requirements for not existing building, fixing #1444 corrupted saves (for testing). 2013-09-07 16:57:31 +00:00
Ivan Savenko
76c77d58f6 const-ified CTown. May fix #1444 2013-09-06 21:57:16 +00:00
Ivan Savenko
f82122d9be second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported
- BOOST_FOREACH -> for
- replaced several boost classes with std (e.g. unordered)
- removed gcc-4.5 workarounds
- ran clang c++11 migration tool to detect some cases:
- - pointer initialized with "0" to nullptr
- - replace for with iterators with range-based for
- - use auto in some situations (type name specified twice, avoid long iterators type names)
2013-06-29 13:05:48 +00:00
Ivan Savenko
2b45e13c5c c++03 -> c++11 switch:
- use std versions of function, bind and ref
- OVERRIDE -> override
- NULL -> nullptr
- use std versions of random distributions

NOTE: this may be last revision that supports gcc-4.5
2013-06-26 11:18:27 +00:00
Michał W. Urbańczyk
9f5d1ba623 Fixed #1271. 2013-05-27 21:46:04 +00:00
Michał W. Urbańczyk
be7c2bd07f CGHeroInstance* can be serialized over network even when hero has been defeated. Strongly typed hero type ID introduced.
Should fix #1260.
2013-05-18 22:30:48 +00:00
Ivan Savenko
c6cc6e6301 Large changeset, first part of editing H3 objects via mods feature. Changes:
- loading of all objects (including H3 objects) will be directed by mod handlers
- common base for all handlers accessible from mod system (IHanderBase)
- json format changes: use struct with string ID's instead of vector

- fixed some gcc/clang errors and warnings
- fixed several cases of memory leaks and invalid memory access (mostly related to usage of bonus system and/or identifiers resolution)

Note that right now loading is much slower than before due to excessive json validation (or not fast enough validator)
2013-04-21 12:49:26 +00:00
beegee1
c7c2686379 - Integrated the logging API into the client and the lib - Remove some more comments and switched to /// style - Fixed recursive locks - Added Global.h to CMakeLists(now visible in qt-creator) - Removed usage of shared_mutex - Added unique_ptr to CLogger targets 2013-04-09 14:31:36 +00:00
beegee1
ee51c5beb5 - Renamed /lib subfolders to lowercase 2013-04-07 10:48:07 +00:00
alexvins
2eb8263e51 Basic Configuration for bonus types
* introduced new handler BonusTypeHandler
* config\bonusnames.json converted to common format and splitted info main and localizable parts
* hanlders initialization refactored
2013-03-06 18:49:56 +00:00
mateuszb
dbec99ffc7 * PlayerColor and TeamID refactoring 2013-03-03 17:06:03 +00:00
Michał W. Urbańczyk
d45a554fec Significant changes to saving system. Now both client and server store their lib part.
Desync detection upon loading. Fixed many desyncs. (more remain)
Monsters won't have creature count 0 even if that is set as creature properties.
2013-02-18 22:37:22 +00:00
mateuszb
560315bc48 * SlotID refactoring 2013-02-16 14:03:47 +00:00
mateuszb
9e00090c42 * refactoring, a few intriguing problems remain 2013-02-13 23:55:42 +00:00
alexvins
ceea466f54 [refactor] spell handling
* more config options for spells
  + mind immunity handled by config
  + direct damage immunity handled by config
  + immunity icon configurable
- removed mind_spell flag 
* more use of new spell identifacation
2013-02-13 19:35:43 +00:00
mateuszb
9c1a117c1c * refactoring 2013-02-12 22:24:48 +00:00
mateuszb
8a8eecd063 * refactoring 2013-02-11 19:11:34 +00:00
mateuszb
6ff7d61b91 * small fix 2013-02-11 16:07:29 +00:00
mateuszb
d540723739 * refactoring 2013-02-11 14:42:09 +00:00
mateuszb
86dc9386d6 * refactoring, including a generic solution for IDs 2013-02-10 23:24:57 +00:00
mateuszb
d03dbf64a6 * refactoring 2013-02-09 12:56:35 +00:00
mateuszb
f1c78e3260 * creature ID refactoring
* double week creatures are configurable now
2013-02-07 17:34:50 +00:00
mateuszb
3958364884 * a bit more work on campaigns; hero crossover still buggy 2013-02-06 10:16:44 +00:00
mateuszb
dc091a1ce1 * some work on hero crossover; still buggy 2013-02-05 23:16:13 +00:00
mateuszb
bda92a4a73 * refactoring
* fixed bug 1143
* some work on campaigns
2013-02-05 18:48:46 +00:00
mateuszb
8769f67c5d * JsonReader can convert to enums
* refactoring
2013-02-03 21:05:44 +00:00
DjWarmonger
beb1ca1bf8 - getDate function now uses enum for different modes
- Fixed Black Market (#1195)
- Fixed one-week bonuses removed eveyr day (#976)
2013-02-02 08:29:57 +00:00
alexvins
4bc2fd5519 [c::b] renamed map subfolder to workaround dependency tracking bug 2013-01-03 12:19:20 +00:00
beegee1
53169abea7 - Foundation for starting a random map is done - Moved StdInc.h to header file in some /Map and /RMG compilation units(better syntax highlighting, should have no negative impact) 2012-11-20 17:53:45 +00:00
mateuszb
100dad889a * much better callback function declaration (previous version inspired me to write a new coding guideline) 2012-11-14 21:19:32 +00:00
DjWarmonger
a7cea94247 - Hopefully fixed #1103
- Fixed #1137
2012-11-14 14:27:18 +00:00
beegee1
105083dd70 * Code convention updates * Default values for CMap types * Updated BinaryReader c-tor * Converted "bool" int types to bool in CMap classes * Removed map event operators in favor of member methods 2012-11-06 16:39:29 +00:00
beegee1
a878f5f79a * Separated map loading from the map object * Moved map classes to lib/Map * Renamed map.h/cpp to CMap.h/cpp * Profiling of map loading is now optional * Updated CMemoryStream 2012-11-03 13:30:47 +00:00
beegee1
720deba838 * Added comments to map.h * Refactoring(renamed attributes, some steps towards coding guidelines, ..) 2012-10-26 17:51:05 +00:00
mateuszb
59fcc15254 * last revision reverted, mysterious bug 2012-09-24 18:52:30 +00:00
mateuszb
55f1c47c16 * more TPlayerColor/TResource 2012-09-24 17:00:18 +00:00
mateuszb
18bd898cb1 * fixed bug when starting certain maps in campaigns
* introduced TPlayerColor typedef
2012-09-24 16:14:53 +00:00
mateuszb
6a81c8b1af * campaign against magic numbers
* ArtifactID was misleading and wrongly used in one place -- renamed and fixed
* minor changes
2012-09-23 18:01:04 +00:00
Ivan Savenko
3fcba4fb5c - fixed crash on start of some campaigns
- allowed on map factions is now set instead of bit field
2012-09-23 14:32:49 +00:00
Ivan Savenko
a138db7c9e - removed lib headers from PCH
- fixed #1062
- correct terrain penalty check
2012-09-06 10:39:48 +00:00
Ivan Savenko
0ca9f64573 Next part of town configuration:
- town screen is mostly implemented, has some minor issues
- factions are now separate from towns, neutrals have faction with id=9
- more constants to GameConstants: town-specific buildings, strings for terrains and resources
- replaced most access to builtBuildings with isBuilt() method
- replaced id's with enums for town subtype and buildings id's
2012-09-05 12:49:23 +00:00
Ivan Savenko
44cc848edc first part of town configuration:
- moved almost all loading to TownHandler
- CBuildings and CStructures are now part of CTown
- merged hall.json into buildings.json

Should not cause any crashes or glitches
2012-09-02 10:33:41 +00:00
Michał W. Urbańczyk
d390113c23 * New files for lib: CBattleCallback.cpp and CBattleCallback.h
* Updated MSVC project files
* Filesystem: My version of .SND archive does not have \0 after WAV extension. Fixed (though hardcoded 3-char extension length).
* New bonus types: BLOCK_MAGIC_ABOVE for blocking casting spells above given level and BLOCK_ALL_MAGIC for blocking all magic.
* Heavy rewrite of battle callbacks. Fixed some minor bugs. Code reusage between lib/client/server (removed proxy calls). Better access control and support for various perspectives.
* Fixed #1031
* Fixed Orb of Inhibition and Recanter's Cloak (they were incorrectly implemented). Fixed #97.
* Fleeing hero won't lose artifacts. Spellbook won't be captured. Fixed #980.
* Fixed crash when attacking stack dies before counterattack (ie. because of Fire Shield)
* Server does some basic checks if action requests during battle are valid
* Minor stuff.
2012-08-26 09:07:48 +00:00
Ivan Savenko
7e778045b8 - removed no longer used CSndHandler. Transition to new fs is finished
- moved TownHandler::requirements to CBuilding class
2012-08-09 10:32:50 +00:00
Michał W. Urbańczyk
5981ad15d4 Fixed Duel mode. Integrated some changes from programmingChallenge branch - it's possible to define duel parameters using JSON. 2012-07-26 00:48:44 +00:00
Ivan Savenko
50e8bc1704 - build system update
- compile fix for quests (vector can't be used to store const data)
- fixed several "unitialized" warnings
2012-07-06 20:19:54 +00:00
DjWarmonger
12511d8fee First part of new Quest Log, including common quest interface. 2012-07-06 19:12:04 +00:00
Ivan Savenko
47945383da gcc-4.5 compatibility 2012-06-23 17:19:50 +00:00
Ivan Savenko
770a6e077c - handling of incorrect or missing configuration files (settings.json\defaultSettings.json)
- better code for recruitment window, fixes #1013
- minor tweak to adv.map classes
2012-06-22 11:40:16 +00:00
Ivan Savenko
9d2711fb51 - rewrote most of classes from adventure map window
-- new files: client/AdventureMapClasses.*
-- implemented all missing details from infobox
- textinput can handle numbers as input
- fixed several bugs caused by CIntObject changes
- fixed #988
2012-06-13 13:04:06 +00:00
Ivan Savenko
faaf799d95 - fixed some extra warnings. Mostly harmless.
NOTE: Please check changes in BattleState.cpp and GameHandler.cpp for possible bugs
2012-05-28 19:29:32 +00:00
Michał W. Urbańczyk
ee6e9fcc7f Fixed #947. 2012-05-22 21:08:16 +00:00
Michał W. Urbańczyk
a234b4c935 Fixed #956.
Removed unused code left after tests.
Updated changelog.
2012-05-19 22:57:24 +00:00
Ivan Savenko
665837d656 - hopefully better town development for AI
- fixed minimap blitting
- fixed crash on attacking town without moat
2012-05-19 16:22:34 +00:00
Michał W. Urbańczyk
d168f3eac2 * Implemented Moat functionality during siege (stops movement and deals dmg)
* Mostly implemented battle spells:
 - Fire Wall
 - Force Field
 - Land Mine
 - Quicksands
2012-05-18 20:50:16 +00:00
Ivan Savenko
9efe05c90b - removed usage of Graphics in several places (Components and hero window).
minor:
- fixed several deprecation warnings in video player
- config file may have multiple upgrades for creatures
2012-05-13 15:04:21 +00:00
Michał W. Urbańczyk
5449546447 Advanced work on support for Quicksand and Land Mine spells. 2012-05-04 21:16:39 +00:00
Michał W. Urbańczyk
b5526f0f54 Fixed #925. 2012-04-14 07:22:08 +00:00
Michał W. Urbańczyk
a9af0da0ab Rewritten handling mouse movement over hex and l-clicking hex into one procedure. That way the tooltip and cursor are always accurate, because they're set by the same routing that selects action. Having that logic duplicated in two methods was unmaintainable. [though the new one is still monstrous...] By the way fixed numerous issues, including:
* #785 and parts of #760
* first aid tent can heal only creatures that suffered damage
* war machines can't be healed by tent
* creatures casting spells won't try to cast them during tactic phase
* console tooltips for first aid tent
* console tooltips for teleport spell
* cursor is reset to pointer when action is requested
* fixed a few other missing or wrong tooltips/cursors

Implemented opening creature window by l-clicking on stack. Master Genie's spell is picked by server, not client.
Minor changes.
2012-03-30 21:36:07 +00:00
Michał W. Urbańczyk
3546c7841a * Possibly fixed #870
* Fixed crash after catapult successfully destroyed one of turrets (stack queue wasn't properly updated)
2012-02-22 17:43:59 +00:00
DjWarmonger
5e14d17ed3 Fixes for r2543. 2012-02-20 09:50:49 +00:00
Michał W. Urbańczyk
046e54563c * fixed project files for RD configuration
* fixed crash when creature is casting Hypnosis (ie. exped Vampire Lords)
* fixed crash when creature is casting Cure before attack (ie. exped Unicorns)
* fixed crash when creature is summoning elemental (TODO fix it)
* fixed crash when doing a bonus system operation with a hero liberated from prison (ie. entering town or battle)
* fixed deadlock when StupidAI tried to assault the turrets
* fixed never ending siege when StupidAI has to use catapult (no more deadlocks on AI-AI siege)
* fixed deadlock when a hero received a level during another player's turn (ie. when he successfully defended)
* AI can win the game by defeating all enemies if there is a specific victory condition applying only to human players
* added options to help testing adventure map AI (--onlyAI, --autoSkip and --oneGoodAI).
* many minor changes
2012-01-03 01:55:26 +00:00
beegee1
156aa6e4d9 * Updated class - file - handling
* Renamed color constants
* Renamed class AdventureMapButton to CAdventureMapButton
* Moved basic controls like CTextBox from GuiClasses to CIntObjectClasses
* Moved new creature window from GuiClasses to CCreatureWindow
2011-12-22 13:05:19 +00:00
beegee1
2f5d6f2684 * CHexField renamed to CBattleHex
* CHexFieldControl renamed to CClickableHex
* CCreatureAnimation.cpp/.h moved to BattleInterface/CCreatureAnimation.cpp/.h
* Removed unused project files
* Added VCMI_client filters file for VS 2010
* Gathered common parts of StdInc.h in Global.h
* Boost.Spirit has been included in PCH for ERM project
* StopWatch renamed to CStopWatch
* GuiBase.cpp split up in UIFramework/...
2011-12-17 18:59:59 +00:00
beegee1
7f04ed990b Major refactoring. First part: BattleInterface
Introduction of pre compiled headers,...
2011-12-13 21:23:17 +00:00
DjWarmonger
9a1460c2e0 Handling of cursor for creatures casting spells.
Lots of refactoring.
2011-10-08 06:59:36 +00:00
DjWarmonger
6fdb984799 Lots of refactoring & work for creature spells.
No new features yet, but summon elementals now work properly again.
2011-10-01 19:56:54 +00:00
Michał W. Urbańczyk
6ef44bde5a Work on pathfinder: torn the code out from CGameState into a separate class. It can use Subterranean Gates and Boats. Removed code for handling Fly spell effect. It didn't work as supposed anyway. 2011-09-19 20:50:25 +00:00
DjWarmonger
899aeeb748 New feature: All tiles affected by multi-hex attack will be highlighted when attack is possible. 2011-09-10 13:04:20 +00:00
ori.bar
5b836f428a Partial fix for 37. Full fix for 27, 64, 600. Fix for bug where code tried to reload non existent file. 2011-09-04 00:04:48 +00:00
Ivan Savenko
0693312a8e - fixed several crashes with joining creatures
- support for loading *.tga images
- minor fixes
2011-07-18 15:21:16 +00:00
beegee1
55e7959fd9 * Bonus system caching updated, partially rewritten, much more robust, thread-safe
* Adjusted projectile speed, trebuchet canon speed
2011-07-13 18:39:02 +00:00
DjWarmonger
8102fd4cf0 Support for Death Blow ability. 2011-07-06 17:00:45 +00:00
Michał W. Urbańczyk
ed056cf0df Set of minor improvements and fixes. 2011-07-05 19:05:41 +00:00
Michał W. Urbańczyk
b3234e8bfa * CGameInterface.h/.cpp moved from client project to lib (and, appropriately, to lib subfolder).
* New files in lib: ResourceSet.h/.cpp -> containing new structure for managing resources logic
* Minor changes and fixes
2011-07-05 06:14:07 +00:00
Ivan Savenko
48e79b163c - missed file from previous commit
- minor fixes
2011-07-01 16:26:36 +00:00
Michał W. Urbańczyk
9775f88045 Version bump.
Initial support for IF:M elements and string formatting.
Various minor changes related to ERM interpreter.

The following script should be functional now:
ZVSE
!?PI;
!!DO1/0/6/1&v2777<>1:P0;

!?FU1;
!!IF:M^Hello world number %X16!^;
2011-06-10 23:50:32 +00:00
Michał W. Urbańczyk
0dbd7ee3c8 Fixed #739 and #742.
Version set to 0.85.
2011-06-01 18:26:44 +00:00
Frank Zago
ff49b852df Silenced several "warning: suggest parentheses around ‘&&’ within ‘||’": added some parenthesis, optimized a couple statments and fix a bug in another. 2011-05-30 19:20:14 +00:00
Michał W. Urbańczyk
3ca95ef5ed Fixed #730:
* crash on +5 growth week 
* crash on spawning wandering creatures on double growth months
(how come that has not been found in previous build?)

More logging for #729-like issues.
2011-05-28 01:02:28 +00:00
Michał W. Urbańczyk
072bb5884b Fixed #728.
Fixed issue with game loading.
Minor fixes.
2011-05-24 23:17:57 +00:00
mateuszb
94166b83aa * some changes 2011-05-22 18:46:52 +00:00
Michał W. Urbańczyk
617e1f962e New files for lib:
* lib/ERMScriptModule.cpp
* lib/ERMScriptModule.h
* lib/CObstacleInstance.h

More jugglery with callbacks. Moving stuff from CGameState to CGameInfoCallback. Work on unified game events interface for player (AI or GUI) and script module. Directing events to ERM interpretetr, first attempts of calling some triggers. Crashy, if there any scripts.
Some other changes, including fighting amount of includes in includes and tracking of hero visits (need further work).
2011-05-09 22:20:47 +00:00
Michał W. Urbańczyk
b4144dc616 Callback jugglery, part 1.
Fixed #252.
2011-05-03 03:14:18 +00:00
Michał W. Urbańczyk
ab20e024c0 Various fixes and improvements around kill hero and kill monster quests. A few minor unrelated fixes. 2011-02-11 12:27:38 +00:00
mateuszb
2451c0dea6 * a bit better stack reversing
* FoWChange uses unordered_set instead of set
2011-01-20 17:25:15 +00:00
mateuszb
49083c4e5a * ConstTransitive CGI more or less done
* hch contents distributed to more appropriate folders
2010-12-20 21:22:53 +00:00
mateuszb
b15deaa203 * more constTransitivePointers in GameInfo, separated client GUI classes from it, moved def handlers from CGDefInfo 2010-12-19 14:39:56 +00:00
mateuszb
5806976a9a * towards ConstTranssitivePointers in CGI 2010-12-18 22:11:28 +00:00
mateuszb
23c501b79e some changes 2010-12-17 18:47:07 +00:00
DjWarmonger
f6b97704c7 Partial support for random wandering stacks. Well, they are not 'that' random as don't use global ran() function. 2010-08-22 07:11:46 +00:00
Ivan Savenko
fd45cd0a6d - fix for #283
- ally support: adventure map
2010-08-13 10:46:08 +00:00
Ivan Savenko
3c868146a6 - linux fix for BuildingHandler
- #584 should be fixed

- first part of ally support:
-- shared FoW
-- function Callback::getPlayerRelations for team checking
2010-08-03 12:34:06 +00:00
Michał W. Urbańczyk
221728c680 Fixed #541 2010-07-26 21:14:08 +00:00
Ivan Savenko
5dc444cd2b - University is finally implemented, both town and map objects 2010-07-20 14:08:13 +00:00
Michał W. Urbańczyk
1e30045541 Support for Tavern on adv map. 2010-07-08 23:03:27 +00:00
DjWarmonger
12f6d5a380 Redesigned artifact randomization.
Fixed #119, #128, #433, #493
2010-06-28 05:07:21 +00:00