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

1281 Commits

Author SHA1 Message Date
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
DjWarmonger
84b2510aa4 Merge pull request #62 from vcmi/SpellsRefactoring4
OK
2014-12-26 08:46:29 +01:00
DjWarmonger
8c471f6359 Merge pull request #69 from ArseniyShestakov/artifactsImprovements
Thanks, looks great now.
2014-12-25 20:24:08 +01:00
DjWarmonger
5b8180e327 Cleaning logs. 2014-12-25 12:58:15 +01:00
ArseniyShestakov
4cb98e7e8d Use isTradable and fix issue 1392
This change make it possible to sell spell scrolls in Artifacts Merchant.
2014-12-24 20:48:37 +03:00
ArseniyShestakov
937ef0227b Use ArtifactID instead of int when possible 2014-12-24 18:49:12 +03:00
AlexVinS
eebf65e88f Merge branch 'develop' into SpellsRefactoring4 2014-12-24 00:15:27 +03:00
DjWarmonger
c538370c5d Players will be always able to see their owned heroes and other objects. Fixes #1959. 2014-12-21 13:56:32 +01:00
AlexVinS
d94f15bdf4 Added configurable animation for SPELL_LIKE_ATTACK 2014-11-28 00:36:14 +03:00
AlexVinS
f4cf12d3f8 Fix a crash 2014-11-27 00:53:08 +03:00
AlexVinS
b31ed0e4ea Use SetMana packet in battle 2014-11-26 13:30:55 +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
AlexVinS
f2bf3d7f7b Added a way to obtain ID of newly added Stack 2014-11-25 12:26:32 +03:00
AlexVinS
f7ff61ce4f Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring4 2014-11-24 12:41:17 +03:00
KroArtem
e73c60740c corrected text in vcmibuilder, corrected errors and warnings from cppcheck 2014-11-16 20:48:29 +03:00
AlexVinS
a06dae1f96 Move getAffectedCreatures to CSpell. + more drafts 2014-11-13 04:53:25 +03:00
AlexVinS
d7800b834e get rid of CBattleInfoCallback::calculateSpellDmg 2014-11-12 09:52:11 +03:00
AlexVinS
e4b726151d get rid of CBattleInfoCallback::battleStackIsImmune 2014-11-12 09:20:20 +03:00
AlexVinS
ddf98a5920 +SpecialRisingSpellMechanics::isImmuneByStack 2014-11-12 08:34:43 +03:00
Patrick Simmons
41da0ad2e6 multiplayerload changes (committing so I can revert...) 2014-10-25 19:05:49 -04:00
Patrick Simmons
3685e96042 Revert "multiplayer load changes"
This reverts commit 368d2c8836cc6e3b5af9cf71e892bf4515f26bda.
2014-10-25 19:05:49 -04:00
Patrick Simmons
99a63c4bbd multiplayer load changes 2014-10-25 19:05:49 -04:00
Patrick Simmons
cfa6f46d62 VERY buggy, unusable, but progress is being made... 2014-10-25 19:05:49 -04:00
Mikhail Paulyshka
b8f5a57c64 Include ZLib headers for launcher and server 2014-10-12 16:33:38 +03:00
AlexVinS
66b022f93e initializer lists part1 2014-10-02 19:43:46 +04: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
6c0c03d74b Refactoing of pathfinder <-> client/AI interaction to remove dependency on selected hero
- finished removal of server-side setSelection
- disabled some broken code (AI & cheats). TODO: fix
2014-09-21 16:42:08 +03:00
Ivan Savenko
78709e223b Breaking things - trying to remove server-side knowledge of selected objects 2014-09-19 00:18:49 +03:00
DjWarmonger
36a7cff998 Cleaning error messages at access to players. 2014-09-17 11:03:53 +02:00
DjWarmonger
d9273b3b2a Cleaning logs. 2014-09-10 19:09:48 +02:00
Ivan Savenko
b551bdb725 Final part of the merge
Merging VCMI Dirs refactoring + GUI refactoring with current develop
2014-09-04 20:59:07 +03:00
josch
2e6e026645 let vcmiserver handle commandline options first
The vcmiserver application will first try to initialize various things
before parsing the commandline arguments. This leads to the program only
outputting an initialization error when it cannot initialize instead of
parsing arguments like --help. This patch moves the argument parsing to
earlier in program execution to avoid this behaviour.
2014-09-02 18:42:38 +02:00
DjWarmonger
0edaf4fa8a Merge pull request #26 from vcmi/FFMpeg
Let's do this, way too many branches running now.
2014-09-01 10:35:30 +02:00
DjWarmonger
8b10f70afd Migrating to MSVS 2013, which allows to delete inttypes.h file. 2014-08-31 19:08:39 +02:00
Karol
1b6f2ea3b7 VCMIDirs update #5 fix
- Updated old OS detect macros.
- Fixed 1 misspell.
2014-08-26 12:19:04 +02:00
Karol
a302f6c7ad VCMIDirs update #3
bfs = boost::filesystem;
- Updateting filenames (std::string -> bfs::path) #1
- Added platform detection, and some specyfic boost::filesystem includes
to Global.h
- Updated CBasicLogConfigurator. Now class uses bfs::path pathes.
2014-08-10 23:42:39 +02:00
beegee1
5139378319 - migrated boost::function/ref/bind to std:: variants 2014-08-04 20:33:59 +02:00
Michael Pavlyshko
bad7050096 spaces -> tabulation 2014-07-11 11:01:03 +03:00
Michael Pavlyshko
08ee65c3c8 fix .dll and .exe filenames 2014-07-10 01:06:37 +03:00
Michael Pavlyshko
c935193558 disable WIN32 flag for executables, fix previous commit 2014-07-10 00:47:22 +03:00
AlexVinS
195eae48ca Merge branch 'develop' into SDL2
Conflicts:
	client/CPlayerInterface.cpp
2014-07-02 17:15:12 +04:00
DjWarmonger
bf567c9e50 Fixed crash caused by hiding tiles around AI heroes. 2014-07-01 09:13:19 +02:00
Ivan Savenko
1157111fcf More bugfixing:
- Fixed compile in VCAI (precompiled headers should not include VCMI headers)
- Fixed crash on visiting observatories, including shroud of darkness
2014-06-29 17:23:06 +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
6e3eaeee21 Minor fix to schema, server will print visited objects in debug log 2014-06-25 00:23:56 +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
AlexVinS
3b8d0e44d4 Merge branch 'develop' into SDL2 2014-06-24 14:09:44 +04:00
DjWarmonger
3ac306f501 Merge pull request #19 from vcmi/feature/mapObjects
Feature/map objects
2014-06-22 14:49:42 +02:00
Ivan Savenko
0a71e89f58 Created large number of missing objects in configs
Minor bugfixes in code
2014-06-17 14:57:47 +03:00
Haryaalcar
fee9f0c1a0 "0001766: Disassembling artifacts in hero and hero meeting screen doesn't work." fix 2014-06-14 16:52:30 +03:00
AlexVinS
0bf7d2b84c fix server project configure 2014-06-13 07:55:49 +04:00
AlexVinS
56c74bc46a +More build target to support both SDL1 and SDL2 builds 2014-06-13 07:55:48 +04:00
AlexVinS
bbd0312b45 Tweak configuration 2014-06-13 07:55:47 +04:00
Ivan Savenko
44742814cd More cleanup:
- moved SoundBase.h to lib since it contains shared data
- added RMG info to object format. Note that data is not yet imported in
configs
- slightly updated API of object handlers
2014-06-05 23:51:24 +03:00
Ivan Savenko
b2e8c92383 Cleanup:
- removed commented-out #includ'es
- renamed some files to match name of class
2014-06-05 20:26:50 +03:00
Ivan Savenko
652ceb2bde Finally shattered CObjectHandler.cpp into tiny bits
- This file is now split into multiple smaller files in mapObjects
directory
- CObjectHandler itself now contains only core classes (Handler itself,
CGObject and interfaces)
- Cleaned up excessive #include's through whole project
2014-06-05 19:52:14 +03:00
Ivan Savenko
0afdfa529c Moved all object-related files to lib/mapObjects directory.
Renamed some classes to more readable names
2014-06-05 14:19:47 +03:00
Ivan Savenko
32b6568b65 Merged changes from upstream and fixed compilation caused by API changes 2014-06-03 22:45:18 +03:00
karol57
c676c5da82 Fixed small error in nearest town finding algorithm. 2014-05-25 21:53:25 +02:00
karol57
dd33fd51a8 int3 dist2d microoptimization 2014-05-25 20:42:25 +02:00
Ivan Savenko
7f276185bd Moving files:
- new config for objects (config/objects/generic.json)
- renamed lib/CDefObjectHandler to lib/CObjectClassesHandler
2014-05-24 02:07:54 +03:00
AlexVinS
6f65d2484b Extract battleStackIsImmune from battleIsImmune
This fix possible problems with rising spells as now immunty is handled on stack level not on hex level
* battleIsImmune in now protected - only used in canCastThisSpellHere
2014-05-19 13:44:38 +04:00
AlexVinS
ababd0d995 there can`t be resistance to rising spell (immunities are handled seperately) 2014-05-18 17:03:02 +04:00
AlexVinS
afd74ff649 Remove more hardcoded immunity handling.
* ANIMATE_DEAD already limited to UNDED
* make DEATH_STARE immunties absolute
2014-05-18 17:03:02 +04:00
AlexVinS
b6b12ad8f6 Merge and simplify resistance calculation 2014-05-18 17:03:01 +04:00
AlexVinS
1431fcedf7 handleSpellCasting: Handle immunity before RESISTANCE. Now immune creatures shouldnt show resisted animation 2014-05-18 17:03:00 +04:00
AlexVinS
d9368ca5ba Use new battleGetStacksIf method 2014-05-18 17:02:59 +04:00
DjWarmonger
00c31b4b85 Fixed #1790 2014-05-17 21:30:55 +02:00
Ilya Zhuravlev
db7cd79cf7 Android port.
Conflicts:
	lib/vcmi_endian.h
2014-05-16 23:24:29 +04:00
DjWarmonger
fb5152254d Merge branch 'develop' of git://github.com/Macron1Robot/vcmi into WarmysBackup
Conflicts:
	client/CKingdomInterface.cpp
2014-05-02 12:03:02 +02:00
DjWarmonger
4a71442c80 Missing changes. 2014-04-27 14:38:20 +02:00
Macron1Robot
31f2af6243 Removed commented part for daily income 2014-04-27 13:44:56 +04:00
Macron1Robot
8ec7a9b919 Moved "max heroes on map per player", "max heroes available for player" to "defaultMods.json" 2014-04-27 10:43:46 +04:00
Macron1Robot
907caedb13 Added "produce" section in "building" structure. Changed dailyIncome. 2014-04-26 18:23:35 +04:00
Macron1Robot
b7b890acff Added "tavernVideo","guildBackground" to "faction" JSON config and schema. If "primaryResource" is set to "gold", silo will generate 500 gold per day 2014-04-24 23:36:18 +04:00
DjWarmonger
9e7013de77 Backup for my own MVS project configuration 2014-04-24 21:07:43 +02:00
beegee1
1d57b75bc5 - random number generation refactoring
- fixed mantis #1743
2014-04-10 19:22:32 +02:00
DjWarmonger
a64df5718f Some nontrivial optimizations based on profiling results:
- Movement bonuses will be calculated ONCE per pathfinder loop
- Goals will be sorted by hero to reduce number of calculatePaths calls
2014-03-31 14:26:09 +00:00
Ivan Savenko
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
Ivan Savenko
760ae7d44a Changes related to Debian packaging, based on josch patch
- AUTHORS file is now in UTF-8
- tags for desktop files
- fixed some typos
- better reaction on --help and --version commands
- vcmibuilder should work with both avconf and ffmpeg
2014-03-20 18:17:40 +00:00
beegee1
fe1b16a7ec Some preparation towards mantis #1743:
- refactored CRandomGenerator (added util methods, improved method names)
- usages of std::minstd_ran are replaced by CRandomGenerator (not in entire code base, C rand() usages are still not replaced)
- refactored getArtSync method of CArtHandler -> now named pickRandomArtifact
- fixed some compiler warnings
- updated source code URL in VCMI spec
2014-03-17 19:51:07 +00:00
alexvins
9cac0af7be [Spells] More spell related refactoring
+ smart target modifier
- CREATURE_EXPERT_MASSIVE target type
* save format changed

spell format changes already documented in http://wiki.vcmi.eu/index.php?title=Spell_Format
2014-03-17 13:11:10 +00:00
alexvins
065b8366fb [Spells] Added basic support for icons and sounds
* few changes in spell format
* save format changed
2014-03-10 16:00:58 +00:00
Ivan Savenko
d2ae847ecf - files in local directories (saves & configs) now always have higher
priority than mods. Fixes #1685 and #1733
- fixed possible crash on exit in dispose() function
- (vcmibuilder) fixes problem with partial mp3 -> ogg conversion
2014-03-08 16:05:23 +00:00
alexvins
4203d69525 Part 2 of new spell configuration
1) spell handler refactored to support modding in general way
2) imunnity icons moved to WoG as they depends on wog`s graphics
3) introduced new class template for handlers (todo: use this in other handlers)
4) save format changed
5) introduced "absolute immunity" - unaffected by "the Orb" etc. (todo: use it in config)
6) new format documented on wiki, added json schema.

* more split of registertypes - fixes 32 mingw build
2014-03-07 13:21:09 +00:00
stopiccot
7356145c3a updated LD_RUNPATH_SEARCH_PATHS 2014-03-04 03:51:17 +00:00
Ivan Savenko
8d36bcabce Split registerTypes into multiple files, now in lib/registerTypes
directory in order to reduce huge memory usage by gcc
2014-02-24 19:57:33 +00:00
beegee1
674c8bc591 - Fix to previous commit (keep heroes which are in heroes pool too) 2014-02-23 16:21:30 +00:00
beegee1
d0a5a6eab4 - Implemented hero recreate handling correctly 2014-02-23 13:52:06 +00:00
Michał W. Urbańczyk
1e555a8ee3 Improved serializer. See: http://forum.vcmi.eu/viewtopic.php?p=11562#11562
Save format changed, removed compatibility workarounds.
2014-02-19 01:04:27 +00:00
alexvins
d01b84b460 [mechanics] fix copy-paste errors in magic skill arrays
[c::b] few tweaks to configuration
2014-02-15 09:40:33 +00:00
Ivan Savenko
8d178fbcf5 Minor fixes:
- fog of war will be initialized after bonuses are set (needed if heroes
have scouting or arts with sight bonus)
- victory condition "control all dwellings" also requires golem factory/
- it is possible to dismiss troops during exchange between heroes
2014-02-09 19:47:23 +00:00
DjWarmonger
a9b10c8099 - Changed aggregation method so now fuzzy engine takes all the factors into consideration
- Heroes now will use real path cost and their movement, which has numerous advantages:
* Actual movement cost is taken into consideration
* Groups of heroes will keep order
* Fastest heroes will be used for exploration first
2014-02-07 08:23:31 +00:00
beegee1
95034b9fa0 - Updated PCH to use our StdInc.h as the prefix header (not generated one from cotire) -> no exclude headers from ffmpeg/etc... statements required
- Fixed compilation error (VCAI ResourceSet logging)
2014-02-05 20:25:36 +00:00
Michał W. Urbańczyk
55165a8535 Fixed #1686. Compatibility measures to be removed later, when format changes become to big. 2014-02-02 14:31:56 +00:00
Michał W. Urbańczyk
e5312887d1 Fixed possible crash at the game start (when victory conditions are checked before currentPlayer is set). 2014-02-01 16:08:01 +00:00
beegee1
df0a28d9cb - added PCH compilation for CMake using cotire module (PCH is OFF per default, can be enabled with ENABLE_PCH=ON) 2014-02-01 13:37:26 +00:00
Michał W. Urbańczyk
679c3c5830 Split conditions fixed (it should be impossible to take units from ally). 2014-01-30 14:04:09 +00:00
Ivan Savenko
3779a54ddd - probably fixed 1671
- fixed missing loss condition in Birth of Barbarian
- fixed some bugs found by cppcheck
2014-01-30 11:08:37 +00:00
alexvins
16d6292be9 [refactor] extract often used classes from lib\NetPacks.h to separate header - less dependecies on whole packets class tree
[mingw build] fix linking issues with netpacks. 
Mingw build is finally fixed! 

[c::b] update projects

[config] fix and cleanup spell_info.json
2014-01-16 20:24:06 +00:00
Ivan Savenko
c5b74a2dce Miscellaneous fixes:
- proper block of "back" button in campaign menu.
- proper block of AI switch in battles
- vertical garrisons can now be attacked from top
- better UI logging, vcmi will print to log file all pressed buttons
- server will not try to build already existing building
2014-01-13 17:44:21 +00:00
Ivan Savenko
fb5c9fc972 - creatures availability tests no longer check for built buildings.
Fixes #1650
- do not crash if town has 0 creatures on some dwelling level
- do not crash if dwelling for some level is not present in town at all
2014-01-11 18:12:09 +00:00
alexvins
a740f7989c [c::b] update projects, disable PHC for now, +few fixes (still wip) 2014-01-05 17:48:50 +00:00
Ivan Savenko
2c4c964a45 Large rewrite of adventure map objects:
- replaced CDefObjInfo with ObjectTemplate class
- ObjectTempate is a direct member of objects instead of pointer with
shared ownership across CMap, handler and game objects
- simplified handling of objects that can change appearance (e.g. towns)
- all object queries regarding object appearance/blockmaps use h3m pos
instead of relative positions
- removed need of modhandler::reload
- cleanup of some old code
2014-01-02 23:48:38 +00:00
Ivan Savenko
2b9e074d54 - implements level limit (Mantis #1620)
- added workaround to weird bug where vcmi fails to find objects for
win/loss conditions
2014-01-01 16:12:53 +00:00
Ivan Savenko
0c5be52a42 Win/loss conditions based on logical expressions, yet another large
changeset:
- victory/defeat will be detected using triggered events
- vcmi will convert h3 conditions into set of triggered events
- it is possible to either change number of days without towns or even
remove this loss condition completely
- possibility of custom win/loss text and icons in pregame (no longer
connected to win/loss conditions)

Still missing:
- No interface to pass custom events/victory conditions into the game 
- AI would benefit from improvemets (handle all victory conditions,
select best one to fulfill)
- You have X days till defeat message still hardcoded to 7 days
2013-12-29 11:27:38 +00:00
Ivan Savenko
f6c1dace6c Minors:
- By default, cmake will keep debug info
- removed warnings from adventure map infobox (part of #1636)
- adventure map infobox will refresh on artifact changes (part of #1636)
- moved terrain music files to terrains.json file
- player should act before AI in all games, not only campaigns
2013-12-28 18:57:08 +00:00
beegee1
b8eddcd9a8 - Moved place bonus hero before normal random hero and starting hero placement -> same behaviour as in OH3
- Moved placing campaign heroes before random object generation -> same behaviour as in OH3
- Refactored pickHero into pickNextHeroType (hero generation sequence) and pickUnusedHeroTypeRandomly
- Added a SIGSEV violation handler to vcmiserver executable for logging stacktrace (for convenience only)
- Fixed Fuzzy.cpp and VCAI.h compilation on Clang
- Added a handleException function in addition to our macros (no use of macros, enables debugging support, does not re-throw, catches ...-case too)
2013-12-28 12:47:55 +00:00
beegee1
68bdf71db6 - Fixed GCC compiler warnings
- Implemented move heroes to next scenario partially
2013-12-20 13:07:58 +00: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
69eee05ccc - Partially fixed mantis #1065 (Gate with hex 95 can't be attacked)
- Fixed 'catapult tried to attack non-catapultable hex!' problem, now catapult attacks attackable wall parts only
- Fixed problem that the server performed applying damage on a wall part twice
- Added methods for checking what wall parts are attackable and if a wall part is potentially attackable
- Added functionality to trace net packages
- Added functionality to trace std::vectors
- Added tracing for CatapultAttack(CPack)
- Updated various toString methods to use {} instead of []
- Refactoring
2013-12-08 17:54:13 +00:00
beegee1
2d095cf20a - Fixed days without castle counter
- Fixed 'you have only 0 days...' message
- Checks victory/loss conditions every player turn instead of every day
- Fixed mantis #1463
2013-12-06 19:44:11 +00:00
Ivan Savenko
122db9963b More string ID's for buildings:
- town hall slots now use string ID's
- converted building requirements to new format
- "upgrades" property from buildings now uses string ID's
- several fixes for improved support of alternative creatures
- removed no longer needed "id" property from structures

Old mods should still work but will produce error messages during
validation
2013-12-04 10:36:39 +00:00
Ivan Savenko
3d3f93275d Multiple minor fixes:
- fixed starting armies of some heroes, including Bron #1602
- (debian) added vcmi-dbg package with debug information
- proper randomization of hero secondary skills, fixes #1603
- second capitol will show up as disabled immediately #1604
- proper deserialization of boost::variant
- empty file will no longer crash JsonNode parser
- fixed some compiler warnings
2013-12-03 09:03:37 +00:00
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
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
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
Ivan Savenko
ee6cdbeffe went through the rest of cppcheck warnings, mostly harmless 2013-11-07 12:48:41 +00:00
Ivan Savenko
71d6b0fea9 - Fixed some warnings from cppcheck
- Minor improvements to JSON validation
- Cleanup in SDL_Extensions.cpp
- Implemented new propery for creature format: idle animation duration
- Disabled idle animation of some of conflux creatures (was clearly
broken)
2013-11-06 13:42:58 +00:00
Ivan Savenko
0e3eae3095 patch from KroArtem 2013-11-03 12:51:25 +00:00
Ivan Savenko
c4716d0a9a - reordered files in cmake so files with long compile times will be
compiled first.
- changed format of modSettings.json, VCMI should properly update file
on the first run.
- implemented property "defaultTavern" that acts as default value for
"tavern" entry in hero class and town formats.
2013-11-03 12:07:23 +00:00
Ivan Savenko
f838cceddd - fixes Inferno Castle Gate 2013-10-17 13:54:12 +00:00
Michał W. Urbańczyk
5c6d12400f Fixed AI detection of battle end (solves some freezes). 2013-09-29 20:54:29 +00:00
Michał W. Urbańczyk
0abbe71b25 Merged fixes from the branch. 2013-09-28 00:58:33 +00:00
Michał W. Urbańczyk
c6c53a5b1e Few more freeze-related fixes. 2013-09-28 00:30:12 +00:00
Michał W. Urbańczyk
d1807585ad Fixed at least two #1428 freezes, likely more.
They were occurring when AI hero visited bank that was also guarded by neutral creature nearby,
2013-09-27 23:46:58 +00:00
Michał W. Urbańczyk
4f29b526ca The battle callback method battleGetAllStacks will by default omit the arrow turrets. Fixes #1453, #1455 and related. 2013-09-27 19:42:17 +00:00
DjWarmonger
d06b02638b Partially implemented #481 2013-09-17 12:02:33 +00:00
DjWarmonger
39f9069ed9 Implemented deterministic secondary skills, #1166. 2013-09-09 15:23:59 +00:00
DjWarmonger
99352a7220 Fixed crashes when clone dies #1357, #1441. 2013-09-08 17:43:10 +00:00
Michał W. Urbańczyk
385f4ab7f5 #1153 and #1395 should be fixed. Terrible, terrible, terrible.
Fixed crash in battles, when attempted to access <0 screen coordinates.
2013-09-01 22:55:57 +00:00
Ivan Savenko
5654fef901 - ZipArchive namespace for operations with zip archives, located in CZipLoader.h/cpp.
- new fields in mod format, for use with mod manager (check config/shemas/mod.json for details)
- removed some 0.92 compatibility from mods loading
- several compile fixes
2013-08-19 11:50:53 +00:00
Michał W. Urbańczyk
38c1542d9d Fixed crash on battle end — don't attempt giving exp to loser (hero is removed -> can't get exp -> crash). 2013-08-18 17:49:31 +00:00
Ivan Savenko
c81a31c74a - catapult attacks should be identical to H3
- catapult may miss and attack another part of wall instead (this is how it works in H3)
- minor fixes
2013-08-06 11:20:28 +00:00
DjWarmonger
6057226665 Fixed in r1364. It's all about logic! 2013-08-04 06:16:17 +00:00
Michał W. Urbańczyk
eb90f93231 Dereference optional in logs. 2013-08-01 16:26:29 +00:00
Ivan Savenko
b87897096c Filesystem handling is now more flexible
- removed CResourceLoader class in favor of one that implements resource loader interface
- removed global pool of files, in favour of more dynamic approach
- renamed some files to match current situation
All these changes are needed mostly for future mod manager + .zip support
2013-07-28 14:49:50 +00:00
DjWarmonger
abaa5b1c59 Fixed #1352. Implemented correct death stare algorithm. 2013-07-28 08:48:29 +00:00
DjWarmonger
5f310aa20f Fixed all issues with Resurrection: #123, #1358 2013-07-27 19:01:31 +00:00
Michał W. Urbańczyk
d8a27d8f3c Refactored player-specific data into single struct BattleState. 2013-07-21 22:01:29 +00:00
Ivan Savenko
491bd557ef fixed several bugs reported on forum:
- necromancy issues
- fix for lookout tower
- Sir Mullich is unavailable
- first hero is awakened on next turn
- give 500 XP on defeating hero
2013-07-21 18:27:33 +00:00
Michał W. Urbańczyk
1e11904d8a Fixed Remove Obstacle. TODO: limit its working on spell-created obstacles depending on spell school level. 2013-07-21 10:25:12 +00:00
Michał W. Urbańczyk
e9d51a2670 Fixed issue that allowed to build multiple boats in town. Renamed state() to sth more sensible. 2013-07-21 10:08:32 +00:00
DjWarmonger
9277c695a5 Fixed #1361. 2013-07-20 08:54:43 +00:00
Ivan Savenko
4ac2a6e8b6 minor refactoring of VCMIDirs, bugfixing
- VCMIDirs represent XDG specification more closely (partial #1310)
- Minor bugfixing, including #1327 #1328 and #1306
2013-07-08 20:55:22 +00:00
Ivan Savenko
146a5e5ef8 Made speed of most of battle animations time-based
- speed of creature-related animation no longer depends on framerate
- most of values from cranim.txt are now used correctly
- removed BMPPalette struct in favor of SDL_Color
- animation group "DEAD" that is used to display dead stacks, by default consists from last frame of "DEATH" group

Notes:
- animation speed may still need some adjustments
- range of config property "battle/animationSpeed" has been changed. This may result in extremely fast animation. To fix - change animation speed via options.
2013-07-06 16:10:20 +00:00
Michał W. Urbańczyk
1e8c58ecdf Patch from O01eg fixing #1308 http://forum.vcmi.eu/viewtopic.php?t=721
Helper functions for enabling/disabling smart vector memeber serialziation. [doesn't really save writing but adds consistency]
2013-07-02 16:48:01 +00:00
Michał W. Urbańczyk
a1f545792b Compile fixes specific for VS 2012"
* Reverted std::bind to boost::bind. std::bind on Visual 2012 doesn't work in some cases (especially with std::ref), not sure why [but it seems to be a bug, since 2013 preview compiles the same code fine]. 
 * Move assignment operator for VS 2012.
2013-07-02 15:23:32 +00:00
Michał W. Urbańczyk
4576719abe Visual Studio 2013 Preview compile fixes:
* 0 is not convertible to std::function, nullptr should be used
* std::ref(rand) is not convertible to function<int()>, used lambdas (why we dont just pass "rand" ? )
* CFunctionList needs to be constructible from nullptr
* move constructor for CMapInfo (Visual cannot generate them :( )
* #ifdefed some stuff that is not needed anymore since cmath is updated with C99 stuff
* using std::make_unique instead of our vstd implementation

CSelector: 
* introduced a class in place of typedef
* Having an overloaded && || operators over sth that is convertible to bool… Wasn't a good idea after all. Purged the operators, replaced  with And/Or methods (chaining-style).
* constructor that is present only when constructing from class or function (SFINAE). std::function has an implicit converting constructor from T causing ambiguities (even if the overload would cause compile error in the body)
2013-07-02 12:08:30 +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
254f194220 Some very early work towards autofight feature.
Added EmptyAI to the solution.
Passing callbacks by shared_ptr.
2013-06-22 14:47:20 +00:00
Michał W. Urbańczyk
06dbdd234f Further changes for duel mode. It is possible to pass names of AIs to be used by command line. Moved things in battle AI. 2013-06-21 20:59:32 +00:00
Ivan Savenko
6737c270c9 gcc 4.5 compatibility fixes. Mostly due to lack of fully finctional nullptr class 2013-06-19 21:26:27 +00:00
Michał W. Urbańczyk
6a88604937 * fixed crash related to cammander's SPELL_AFTER_ATTACK spell id not initialized properly (text id was resolved on copy of bonus)
* fixed duels, added no-GUI mode for automatic AI testing
* minor things
2013-06-17 15:45:55 +00:00
Michał W. Urbańczyk
f19e41d38c Fixed #1269.
Version set to 0.93.
2013-05-31 22:23:53 +00:00
Ivan Savenko
4724ccbb45 - fixes #1276
- minor fix to json arrays merging
- fixed update of growth icons on town screen
2013-05-30 18:43:45 +00:00
DjWarmonger
22e14d31cb Fixed #1275 2013-05-30 07:43:42 +00:00
Michał W. Urbańczyk
9f5d1ba623 Fixed #1271. 2013-05-27 21:46:04 +00:00
Ivan Savenko
b01637840a - compile fixes
- fixed building in towns after loading (partial #1272)
2013-05-27 14:20:46 +00:00
Michał W. Urbańczyk
79026bdfde Introduced strongly typed QueryID.
Exchange between heroes is now a proper first-class query. Fixes #1269. #66 should also be finally fully fixed.
VC projects: /Zm flag to fix compilation issues with recent Boost.
2013-05-27 10:53:28 +00:00