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

158 Commits

Author SHA1 Message Date
Hao Hu
9ec9cffe9b Bug fix for berserk: fixed the issue that the berserk affected stack
won't attack the nearest live stack.
2016-10-07 23:50:34 -04:00
AlexVinS
affbc71c56 cleanup 2016-10-02 11:58:53 +03:00
AlexVinS
799b8519e0 Allow cast avdmap spells without spellbook
* fixes http://bugs.vcmi.eu/view.php?id=1898
* partial fix for http://bugs.vcmi.eu/view.php?id=482
* fixes http://bugs.vcmi.eu/view.php?id=2155
2016-10-01 17:21:39 +03:00
AlexVinS
c243ae6f3e Get rid of IBonusBearer::getEffect 2016-10-01 08:28:33 +03:00
AlexVinS
730e3b6d0f Explicit use of limit selector in CBattleInfoCallback::getRandomBeneficialSpell
* reverted changes in IBonusBearer::hasBonusFrom just in case
2016-10-01 07:28:03 +03:00
AlexVinS
72461c5c2e Fixed http://bugs.vcmi.eu/view.php?id=2268 2016-09-29 23:14:22 +03:00
AlexVinS
9097ffbd8a Handle HYPNOTIZE effect in case of FEAR and ENCHANTED effects 2016-09-29 22:26:28 +03:00
AlexVinS
83b3c700dd Handle HYPNOTIZE effect in case of mana drain 2016-09-29 21:47:41 +03:00
Vadim Markovtsev
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
dydzio
68af6a0c19 Refactoring InfoAboutHero + GetHeroInfo 2016-09-28 13:22:33 +02:00
AlexVinS
849e3fc04e Fixed http://bugs.vcmi.eu/view.php?id=2506 2016-09-24 09:27:58 +03:00
AlexVinS
7618e294c2 More fixes to not place obstacles on wall parts 2016-09-24 04:55:48 +03:00
AlexVinS
ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
Dydzio
8b0c62e10e Block surrender via escape tunnel. Fix issue 2389 2016-09-18 22:05:05 +02:00
AlexVinS
7e85154946 Unify battleCanCastSpell parameters 2016-09-18 18:12:07 +03:00
AlexVinS
ef34d21941 Passive cast can be blocked by spell level limit. 2016-09-18 17:21:56 +03:00
AlexVinS
505e53c17d Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts:
#	client/battle/CBattleInterface.cpp
#	lib/spells/BattleSpellMechanics.cpp
2016-09-12 10:13:40 +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
AlexVinS
f3b7fe947c Reworked spell target existence check.
* related to 2269
2016-09-05 11:36:25 +03:00
AlexVinS
b09f150e7b Factored out battleCanCastThisSpellHere 2016-08-30 12:20:11 +03:00
AlexVinS
be67faad90 Drafts 2016-08-30 12:20:03 +03:00
AlexVinS
40e6e0c143 Move REMOVE_OBSTACLE-related code from callback to where it should be. 2016-08-30 12:19:59 +03:00
AlexVinS
3b2a45c8dc Get rid of battleGetPossibleTargets. 2016-08-30 12:19:52 +03:00
AlexVinS
f6715ad787 Use ISpellCaster in CSpell::canBeCast.
* -2 todo notes
2016-08-30 12:12:46 +03:00
Arseniy Shestakov
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
AlexVinS
f890037008 Fixes 2016-02-29 04:42:15 +03:00
AlexVinS
5df8d1cbd0 Update low level battle stacks accessor for ghost selection support. 2016-02-28 05:10:20 +03:00
AlexVinS
47b619a543 Centralize GHOST state handling 2016-02-28 01:35:23 +03:00
AlexVinS
9036d39241 Do not remove battle stacks, make them ghosts instead.
* exclude ghost stacks from (hopefully all) get* results for now
2016-02-28 01:08:56 +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
2cfdfca7e5 Battles: fix more cases where invalid wall hex position present 2016-02-14 14:38: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
11dc428b1e Battles: move hexes enum to GameConstants and fix wall position
Before we had hex 62 marked as destructible wall while actually it's must be 78.
2016-02-09 17:38:59 +03:00
Vadim Markovtsev
eb10433535 Implement psychic elementals vs mind immune units 2016-02-02 14:30:37 +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
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
f02e553b70 Fixed another uninitialized field possiblity causing issues with StupidAI 2015-12-04 00:11:44 +02:00
Ivan Savenko
c3ce4b25df Removed all #include's of CMap.h from headers.
To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
2015-12-02 21:05:10 +02:00
AlexVinS
70d9be8447 Use ISpellCaster in battle callback 2015-09-29 17:26:52 +03:00
AlexVinS
a4d4851d80 Fix typo: casted->cast 2015-09-29 17:26:48 +03:00
AlexVinS
d9cbe487c7 remove useless function CSpell::getTargetInfo 2015-09-29 17:26:47 +03:00
AlexVinS
72587a8299 Removed hardcoded check for ANIMATE_DEAD absolute imminity - there is json configuration for that 2015-09-29 17:26:46 +03:00
AlexVinS
6010bbe7ba More correct usage of battleGetFightingHero
* this should fix "FIXME: battleGetFightingHero wrong argument!"
2015-09-29 17:26:38 +03:00
Fay
1cb54689cf Prevents first aid tents from melee attacking;
Moves attack possibility checks to battle callback (for consistency with shooting checks);
2015-04-09 21:49:11 +02:00
AlexVinS
e42ca15a0d Fix BERSERK effect 2015-04-03 05:20:17 +03:00
AlexVinS
10668974d6 Move SACRIFICE target existence check to mechanics 2015-04-03 00:35:29 +03:00
AlexVinS
0cce1ef2f1 Move ANOTHER_ELEMENTAL_SUMMONED problem check to SummonMechanics class 2015-04-03 00:02:15 +03:00
AlexVinS
9600446cf9 +smart target, +hit animation 2015-03-18 17:48:32 +03:00
AlexVinS
a1ea551a85 Block summon of elemtals only by ally summoned elementals 2015-03-18 16:48:21 +03:00