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

137 Commits

Author SHA1 Message Date
ArseniyShestakov
a375c86ea2 movementPointsAfterEmbark: get max move points from TurnInfo
Missed that when originally implemented TurnInfo.
Not pretties code, but boost performance a lot.
2015-11-21 12:46:59 +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
9a63735c24 CPathfinderHelper: implement TurnInfo to avoid bonus re-checking
TurnInfo contain information about what movement-related bonuses and MP hero going to have on certain turn.
This way we can collect this information once for each turn so it's huge performance boost.
2015-11-10 14:26:45 +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
7eebcb9d60 Artifacts: replace few more ints by ArtifactID 2015-11-07 11:46:58 +03:00
DjWarmonger
621c62b44e Don't crash when spell school level is higher than 3 (which is another bug) 2015-10-31 21:15:40 +01:00
DjWarmonger
17071c6ec8 Merge pull request #125 from ArseniyShestakov/newMovementSystem
Okay, time to merge this.
2015-10-31 13:56:22 +01:00
DjWarmonger
8c9f8f22d9 Merge pull request #123 from ArseniyShestakov/mantis-1230
Okay, now we shouldn't get broken savegames. Merging.
2015-10-17 08:31:44 +02:00
ArseniyShestakov
3663b952ea Fix issue 2276. Refugee Camp shouldn't be guarded 2015-10-16 06:45:06 +03:00
ArseniyShestakov
226650582d Move base movement cost to GameConstants 2015-10-16 03:03:40 +03:00
ArseniyShestakov
3466e0fae7 getTileCost: one more pass over code and formatting fix 2015-10-15 15:17:21 +03:00
ArseniyShestakov
52a52dcfd9 Implement NO_TERRAIN_PENALTY bonus
Penalty of specified terrain type is ignored if hero have this bonus
2015-10-15 01:09:02 +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
ArseniyShestakov
41c4323818 CGHeroInstance: add canFly and update canWalkOnSea
canWalkOnSea shouldn't check for FLYING_MOVEMENT because it's two separate mechanics that apply different limitations.
2015-10-12 18:52:23 +03:00
AlexVinS
fa06e05487 Merge branch 'develop' into SpellsRefactoring7 2015-10-05 00:45:57 +03:00
DjWarmonger
abe02247b5 Fixed bank randomization. 2015-10-02 17:28:33 +02: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
9e0fd70208 Move isCastableBy logic back to CGHeroInstance - it is Hero-specific
* When and if canCastThisSpell will also be implmented for creatures common part may be moved to CSpell class.
2015-09-16 04:39:44 +03:00
AlexVinS
f2605e059c Fix 2042 2015-09-16 02:20:57 +03:00
AlexVinS
080244f30e MAXED_SPELL bonus should only affect spell effects
* fixes 2146
2015-09-15 06:00:24 +03:00
AlexVinS
fb5903d610 Initial experiments on hero & creature casting unification 2015-09-12 21:09:44 +03:00
AlexVinS
8f2da66a18 fix mantiss 1967 + some refactoring
* remove TModDescr and realted APIs - they were only used in one place
2015-09-04 22:29:20 +03:00
Sandy Carter
bdee647525 CastleInterface: Exclude previous building upgrade in reqs
Hide CityHall from Capitol prerequisites in Capitol build window
2015-08-19 12:05:43 -04:00
DjWarmonger
9e7b459882 Partial solution to #2206
TODO: add serialized field that contains custom guard config
2015-06-05 11:28:14 +02:00
AlexVinS
fb707a6576 fix mantiss 2142 2015-04-01 00:28:21 +03:00
Ivan Savenko
eef45b5ae8 Fixed warnings 2015-03-31 00:55:37 +03:00
DjWarmonger
ed33d99ac7 Silenced some more logs. 2015-03-28 22:17:45 +01:00
DjWarmonger
a832b7efee Fixed #2026 2015-03-12 10:08:10 +01:00
DjWarmonger
f894abe494 Unified interface for object template. 2015-03-12 08:31:30 +01: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
DjWarmonger
ec879046ca Merge pull request #93 from ArseniyShestakov/feature/pathfindingTeleports
Okay let's do this!
2015-03-10 09:04:25 +01:00
DjWarmonger
f32849a73e Attempt to compile refactored spells in MSVS. 2015-03-09 19:24:45 +01:00
ArseniyShestakov
1801b5eaf4 CGTeleport: use vstd::erase_if_present in getAll functions 2015-03-09 15:44:48 +03:00
ArseniyShestakov
8f8d237d5d Use isTeleportChannel callback functions to check teleport channel type 2015-03-09 02:13:40 +03:00
ArseniyShestakov
3b057e0408 CGMonolith: fix switch formatting 2015-03-09 01:27:40 +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
6d77322d6a CGMonolith: add text dialog when player visit one-way monolith exit 2015-03-08 18:07:06 +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
DjWarmonger
67ab90616d Seer Huts with exp / gold rewards. 2015-03-01 09:46:09 +01:00
DjWarmonger
dd887eb929 Fixes for Seer Huts. 2015-03-01 09:07:43 +01:00
AlexVinS
b9bdc95a7e Handle monster agressivness for VISIONS spell 2015-02-26 08:39:57 +03:00
AlexVinS
b846b717a1 implemented VISIONS spell (partially)
(-) todo: agressivnes
2015-02-26 08:39:56 +03:00
AlexVinS
2156204306 Visions spell in case of monsters 2015-02-26 08:39:55 +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
DjWarmonger
ef4e199f15 Implemented "Quantity does not grow" for monsters (#2094) 2015-02-22 20:54:09 +01:00