Commit Graph
100 Commits
Author SHA1 Message Date
ArseniyShestakov 323c4e1637 RMG Options: make "Computer only teams" buttons work as expected
Button "0" should be always enabled and if "Computer only players" set to "0" we should also computer only team count to "0" if it's not random.
2015-03-16 16:02:52 +03:00
ArseniyShestakov 448fbe44e9 Improve CButton::block and fix CToggleGroup->selectedID
CToggleGroup. Originally when I added initialization for selectedID I didn't find out that -1 is used for "random" buttons. So as result I fixed uninitialized variable usage, but break initial button state change in RMG options because setSelected ignore state change request because it's see -1 button already marked as selected.
2015-03-16 15:55:36 +03:00
ArseniyShestakov 120301ecc8 Split army: dont highlight down garrison slots if there no visiting hero
Before UI always highlighted all slots in both town garrisons even if there no visiting here and you can't actually set army on these slots.
Now garrison slots only highlighted if they're owned by us or our ally. If there no visiting hero in town then only suitable upper garrison slots will be highlighted.
2015-03-16 02:04:18 +03:00
ArseniyShestakov 078bf6c69c CSelectionScreen: always use isHost and isGuest when suitable 2015-03-15 19:33:58 +03:00
ArseniyShestakov c4000f2ac7 Multiplayer: always display flags in lobby, but block them for guest 2015-03-15 19:24:03 +03:00
ArseniyShestakov 783dcfea2e CMapGenOptions: fix crash when computer only limit is used
Currently when there is computer only players set resetPlayersMap may try to change settings for more than 8 players which obviously cause crash.
Now if any of "players and computer limit" or "computer limit" is set to random we automatically set total limit to 8 players.
2015-03-14 22:19:24 +03:00
ArseniyShestakov eeff8f3ea4 Multiplayer: add sync for RMG options in lobby
Sadly I'm not yet find proper way to block all buttons in CToggleGroup without make them invisible so it's still possible to press buttons for guest. Though CRandomMapTab::updateMapInfo is now disabled for guest so even if guest going to press multiple buttons it's not going to cause crash for him.
2015-03-13 23:33:46 +03:00
ArseniyShestakov 67aa869a33 Multiplayer: make chat history visible in lobby and improve CTextBox
Now we'll also play sound when new message added.
CTextBox::setText now will automatically change text height for slider.
2015-03-13 18:45:07 +03:00
ArseniyShestakov 1f1f61cf15 Custom campaigns list: redraw parent as we use it's background
This one fix issue 2057
2015-03-13 18:06:19 +03:00
ArseniyShestakov f8747a1f16 Multiplayer: don't add newly joined players to CPU-only slots 2015-03-13 15:05:12 +03:00
ArseniyShestakov 4f3eb919e5 CHeroWindow: block dismiss button if there no other heroes and no towns
This one resolve mantis issue 530.
2015-03-12 23:47:46 +03:00
ArseniyShestakov 32009690eb initTowns: only add Tovern by default to player-owned towns
Neutral towns with default buildings set should never get Tovern automatically.
This one fixes issue 2090.
2015-03-12 18:47:32 +03:00
ArseniyShestakov f2a237ce6c CPathfinder: move allowed teleport check into lambda
This also fix accidental whirlpool usage as previously I messed up code a bit.
2015-03-11 23:53:35 +03:00
ArseniyShestakov 17f3f94ca6 CGSubterraneanGate: fix pairing and always assign all gates to channel
Before gates on underground layer didn't had any channel assigned and of course any function that attempt to check -1 channel caused crash.
Also I find out that at point postInit executed It's possible to get mutable gamestate via gameState() callback so we don't need to pass it there.
2015-03-11 17:17:21 +03:00
ArseniyShestakov 2145be281a Merge pull request #86 from ArseniyShestakov/fixQuestSaving
Fix saving of player's quests and bump save format version
2015-03-10 18:01:38 +03:00
ArseniyShestakov 5d716d2a1c Added information teleportation support changes 2015-03-10 03:32:33 +03:00
ArseniyShestakov 11d4b4291c VCAI: always clear teleport channel probing list if we lost hero 2015-03-10 03:23:36 +03:00
ArseniyShestakov 431f3bd857 VCAI: use cannotFulfillGoalException instead of runtime_error 2015-03-09 17:09:34 +03:00
ArseniyShestakov 1801b5eaf4 CGTeleport: use vstd::erase_if_present in getAll functions 2015-03-09 15:44:48 +03:00
ArseniyShestakov f7a999f0f3 VCAI: add destinationTeleport to serialization 2015-03-09 15:37:54 +03:00
ArseniyShestakov 5c6633f8ad CPathfinder::addTeleportWhirlpool: check that obj isn't nullptr 2015-03-09 15:32:09 +03:00
ArseniyShestakov 00b0af7306 CGameInfoCallback: now actually drop excludeId argument 2015-03-09 14:20:34 +03:00
ArseniyShestakov 861104f493 CGameInfoCallback: refactoring of getTeleportChannelEntraces / getTeleportChannelExits
Move shared filtering code into getVisibleTeleportObjects.
Also remove excludeId as it's not currently used.
2015-03-09 05:10:31 +03:00
ArseniyShestakov 930a8b49da CPathfinder: move complicated check into lambda 2015-03-09 04:24:12 +03:00
ArseniyShestakov 8524bdbc25 VCAI: use copy_if instead of erase_if for teleport exit probing list 2015-03-09 03:24:39 +03:00
ArseniyShestakov 496338813c VCAI: explicitly check for teleportation between subterranean gates 2015-03-09 02:27:49 +03:00
ArseniyShestakov 8f8d237d5d Use isTeleportChannel callback functions to check teleport channel type 2015-03-09 02:13:40 +03:00
ArseniyShestakov 0c1a37e5a7 CGameInfoCallback: more functions to check teleport channel types 2015-03-09 02:01:24 +03:00
ArseniyShestakov eff4da1d03 ETeleportChannelType: is now strongly typed enumeration 2015-03-09 01:45:39 +03:00
ArseniyShestakov 3b057e0408 CGMonolith: fix switch formatting 2015-03-09 01:27:40 +03:00
ArseniyShestakov 8d901ad4d0 VCAI Explore goal: fix switch formatting 2015-03-09 01:25:52 +03:00
ArseniyShestakov 606013c535 CGSubterraneanGate::postInit put const back
Originally I removed it when change this code to actually change object.
Though this sorting can work with constant object just fine.
2015-03-08 21:16:30 +03:00
ArseniyShestakov 826a64b579 Pack of tiny code improvements for @alexvins request 2015-03-08 20:19:00 +03:00
ArseniyShestakov f490ea1fcd VCAI Explore goal: remove useless check 2015-03-08 18:36:25 +03:00
ArseniyShestakov a741c5fefd Added myself to AUTHORS file 2015-03-08 18:11:43 +03:00
ArseniyShestakov 6d77322d6a CGMonolith: add text dialog when player visit one-way monolith exit 2015-03-08 18:07:06 +03:00
ArseniyShestakov afac28a2f5 VCAI little fix for typo in retreiveVisitableObjs 2015-03-08 17:56:59 +03:00
ArseniyShestakov 9ece636cf8 VCAI Explore goal: add monolith's exploration support
Explore will also suggest AI to re-enter bidirectional teleporter in case of one of it's exits is not visible for some reason.

Also now AI won't try to visit teleporters in case if it's know that it's channel is impassable. E.g if map have several entrance monoliths of with same same SubID that don't have exit then AI will only try to visit one of them and later of he'll know that all other monoliths of this subtype is blocked because they all using same channel.
2015-03-08 17:49:14 +03:00
ArseniyShestakov 12cf883740 VCAI: add all new movement code include teleports and transit support 2015-03-08 17:47:58 +03:00
ArseniyShestakov 665712c196 VCAI: add any newly found teleports to knownTeleportChannels
Now all new objects added to visitableObjs only using addVisitableObj so we can catch them for teleports handling.
I also simplified one of retreiveVisitableObjs functions because it's only used for inserting things into visitableObjs.
2015-03-08 17:38:09 +03:00
ArseniyShestakov ab7ad4741a AIStatus: add teleport channel probing mode
When AI going through bidirectional teleport it's always getting list of all available exits.
If some of exits are invisible it's will attempt to visit each of them teleport probing begins.
2015-03-08 17:23:56 +03:00
ArseniyShestakov 5233b60243 CPlayerInterface: all new code for automatic teleport usage 2015-03-08 17:17:24 +03:00
ArseniyShestakov 530b63f7c4 CPathfinder: add all new code for pathfinding via teleporters
Each kind of teleporter have own function that determine if it's should or shouldn't be used.
For now Monolith with bidirectional channels and Subterranean Gate are united.
2015-03-08 17:13:26 +03: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
ArseniyShestakov 8d7b6d119f CGameInfoCallback: add functions that gather information about teleport channels
This code belongs to callback because both player and AI shouldn't directly access information about teleport channels.
For example pathfinder code need to check teleport channel type only based on information about objects player already seen.
2015-03-08 16:21:14 +03:00
ArseniyShestakov 1c2afc659f Config: replace teleport handler with monolith, subterraneanGate and whirlpool 2015-03-08 16:17:33 +03:00
ArseniyShestakov c9eba40fe6 Updated CGTeleport and new CGMonolith / CGSubterraneanGate / CGWhirlpool
Now CGTeleport is not publicly available handler, but generic class for teleport channels usage.
Teleport channels are stored as part of information about the map.
2015-03-08 16:11:23 +03:00
ArseniyShestakov 04a1df29ad Add TeleportChannel / TeleportChannelID / ETeleportChannelType
TeleportChannel is structure that contain two vectors of entrances and exits for certain teleport channel. It's also store passability state independently which almost only useful for Player and AI as they can't know if channel passible or not until enough entrances / exits are visible or server passed them information that certain channel is impassible when they visited entrance.

ETeleportChannelType is determined by checking intersection between entrances and exit vectors or checking their size:
 - IMPASSABLE: one of vectors empty or only one entrance id is same as only one exit id.
 - BIDIRECTIONAL: contents of both vectors is exactly the same.
 - UNIDIRECTIONAL: contents of both vectors do not intersect.
 - MIXED: contents of vectors only partially intersect. Not currently used; added for future modding.
2015-03-08 15:18:53 +03:00
ArseniyShestakov f145c82031 TerrainTile: implement exclusion for topVisitable functions
For pathfinder we usually want to check what object hero staying on.
Hero is always top object so we need option to exclude it.
2015-03-08 15:05:24 +03:00
ArseniyShestakov e4f591ba84 vstd: add function to check vector intersection 2015-03-08 14:41:17 +03:00
ArseniyShestakov ea46be03f3 AI: check if hero killed while visiting object he stayed on
This is need to avoid crashes like one happen in 2084, but then game bahaviour incorrect.
I'm not exactly sure if this possible currently, but I can imaging this would happen if hero decide to attack bank while staying on it.
2015-02-22 20:56:50 +03: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
ArseniyShestakov 00de870f17 Check input destination position when moving using arrow keys
This one fix crash I reported in 2085
2015-02-22 10:05:24 +03:00
ArseniyShestakov a6ce45e867 Cursor: show battle cursor for garrison if there creature behind
This one fixed issue 1563
2015-02-22 09:34:02 +03:00
ArseniyShestakov 536015f1c2 Quest Log: move slider to start when blocked
Partially fixes problem mentioned in issue 2093
2015-02-18 00:07:03 +03:00
ArseniyShestakov c0b78de6b4 Quest Log: block hide complete button when it useless
We only want to to be checkable when there is actually any complete quests in list.
2015-02-17 06:08:35 +03:00
ArseniyShestakov ae20499854 Quest Log: implement option to hide complete quests 2015-02-17 05:47:49 +03:00
ArseniyShestakov 007f95fa44 Fix valgrind warning about uninitialised value 2015-02-16 13:28:10 +03:00
ArseniyShestakov c865055803 Hero Exchange: fix quest log button 2015-02-16 01:33:05 +03:00
ArseniyShestakov 43f1e37546 Quest Log: fix text for quests with minimal level requirement
This is needed because m13478val is ui32 while translation expect %s string.
2015-02-16 00:53:44 +03:00
ArseniyShestakov df2894b798 Quest Log: implement support Seer names 2015-02-16 00:44:48 +03:00
ArseniyShestakov 37a5930f84 CSoundHandler: fix memory leak and implement cache
This one fix issue 2091 and add caching that actually works.
2015-02-15 22:51:33 +03:00
ArseniyShestakov 789da96a81 Stables: give 400 movement points bonus instead of 600
Tested it and now VCMI work exactly as original game.
This one fix issues 2077 / 2082
2015-02-15 07:55:59 +03:00
ArseniyShestakov 9665c50f3f Quest Log: clanup code that is not needed anymore
As far as I understand once object capturing used it's no longer needed to manually call Show.
Currently CIntObject::show and CIntObject::showAll automatically call it for all children.
2015-02-14 21:35:11 +03:00
ArseniyShestakov 8beed60815 Quest Log: cleanup minimap code
Usage of shared_ptr suggested by @alexwins
2015-02-14 21:31:56 +03:00
ArseniyShestakov 5a5c126f0e Quest Log: fix background resource name
Currently it's not PCX, but PNG
2015-02-14 20:39:53 +03:00
ArseniyShestakov a5998353c6 Update year to 2015 in readme 2015-02-14 19:15:34 +03:00
ArseniyShestakov d06bba422a Quest Log: display components under quest description
This commit add CComponentBox under text. If quest have components description height will be changed to avoid conflicts.
Though it's would be much better if VCMI had something like QScrollArea in Qt so both text and components was using shared slider.
2015-02-14 04:21:31 +03:00
ArseniyShestakov c978bc862d Quest Log: fix position of selection box on labels 2015-02-14 03:47:31 +03:00
ArseniyShestakov c046f8ddc6 Quest Log: update code for new graphics and fix bugs
This one should fix issues 1988 and 2022
2015-02-14 03:38:28 +03:00
ArseniyShestakov 8648081f0a Quest Log: change minimap level when quest selected
There also no need in own setLevel as one from CMinimap works fine.
2015-02-14 02:13:17 +03:00
ArseniyShestakov fd99f0b9f3 Quest Log: decrease number of displayed quests
New graphics only have 6 slots
2015-02-14 01:34:53 +03:00
ArseniyShestakov 0704e38697 Fix Quest Log button in hero window 2015-02-14 01:10:32 +03:00
ArseniyShestakov 746914d219 Added missionType check to CQuest::getRolloverText
This function shouldn't be called if quest type is MISSION_NONE as this type used for quest that don't have text yet.
For example Keymaster`s border guards in H3 didn't add any entries to Quest Log so there is no text for them or at least it's not defined how to use it in VCMI.
2015-02-14 00:57:33 +03:00
ArseniyShestakov ded4c18df9 CComponent: add option to choose image size
This option is used to choose small resource icons in Quest Log when there more than 4 of them.
2015-02-14 00:53:24 +03:00
ArseniyShestakov dae03fdf92 Blick Quest Log button if map have no quests 2015-02-14 00:52:00 +03:00
ArseniyShestakov 7dc0fbcca7 Improved Quest Log window graphics
Source can be found in vcmi-assets repository
2015-02-14 00:47:22 +03:00
ArseniyShestakov 7c5af02b78 Fix saving of player's quests
This commit break saves compatibility
2015-02-12 13:19:22 +03:00
ArseniyShestakov 1396476869 Merge pull request #79 from ArseniyShestakov/fixIssue1557
Only remove extension if it belongs to specified file type
2015-02-07 18:17:22 +03:00
ArseniyShestakov 4eed1716d5 Fix tiny memory leak on opening/closing new game window
Find this one when tested huge pack of 5000+ maps. Each time I opened/closed Single Scenario window memory usage was growing for ~1MB.
It's happen because inflateEnd is freed related structures, but not freed inflateState that created outside of zlib code.
2015-02-07 17:30:57 +03:00
ArseniyShestakov 96d57fc954 War Machines: replace immunity with absoluteImmunity
This commit replace SIEGE_WEAPON immunity with absoluteImmunity for following spells: Haste, Slow, Death Ripple, Clone, Teleport
2015-02-07 16:02:15 +03:00
ArseniyShestakov fbb84624f9 War Machines: add absoluteImmunity to Implosion spell 2015-02-07 16:00:06 +03:00
ArseniyShestakov 20387bd2da War Machines: add absoluteImmunity to some timed spells
This commit add SIEGE_WEAPON to absoluteImmunity of following timed spells: Curse, Bloodlust, Mirth, Sorrow, Frenzy, Counterstrike, Berserk, Hypnotize, Forgetfulness, Blind
2015-02-07 15:57:46 +03:00
ArseniyShestakov 8f08effe93 Check that resource type set before setName used 2015-02-06 10:51:32 +03:00
ArseniyShestakov 19d1de3142 Only remove extension if it belongs to specified file type
This one fixes issue 1557
Now it's possible to load maps with dots in filename.
2015-01-26 16:40:49 +03:00
ArseniyShestakov af8b030810 Fix skills learning in Universities
This one fixes 1945 and 1991
2015-01-07 18:33:09 +03:00
ArseniyShestakov 3466457d69 Fix crash on opening of Hill Fort window and attempt to upgrade one stack
This one fixes issue 1899
2015-01-07 13:10:48 +03:00
ArseniyShestakov ceb5da44d1 This fixes crash in battle I introduced in 8a697f2
dismissInfo do not present when createButtonPanel used inside the battle.
2014-12-27 06:29:09 +03:00
ArseniyShestakov 6ab807f694 Put artifact in different slot if selected is used
This one fixes issue 2002.
2014-12-26 01:42:50 +03:00
ArseniyShestakov 27705e1ac6 Fix removal of fully sacrificed stacks from heroes garrison slots
This one fixes issue 2010. Though CAltarWindow need proper refactoring.
2014-12-26 01:18:58 +03:00
ArseniyShestakov aca0eeed86 Fix position of selected unit count in Freelancer's Guild
This one fixes issue 2009
2014-12-25 22:03:19 +03:00
ArseniyShestakov f71cfdf173 Check if slot locked before pick on Artifact Merchants
This one is fixes issue 2007
2014-12-25 19:24:28 +03:00
ArseniyShestakov 04d15174e7 Use switch for CArtHandler::isTradableArtifact 2014-12-25 17:18:37 +03:00
ArseniyShestakov 54437a3b19 Fix check of locked artifacts for Altar of Sacrifice
This one is explained in issue 2001
2014-12-25 06:27:39 +03:00
ArseniyShestakov 046a6fc45a Visible blocked button for good and evil heroes on Altar of Sacrifice
This is expected behaviour as explained in issue 558
2014-12-25 06:20:40 +03:00
ArseniyShestakov 3371cd36c9 Fix check of 22 artifacts limit on Altar of Sacrifice
Partially fix for issue 558
2014-12-25 06:17:26 +03: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