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

523 Commits

Author SHA1 Message Date
Ivan Savenko
602e52127b Cleaned up forward declarations 2022-12-12 18:26:04 +02:00
Ivan Savenko
d40d5250b7 changes to status bar according to review comments:
- renamed IStatusBar API to more clear names
- removed "locking" of status bar
- added comments for IStatusBar API
- removed dynamic_casts to CGStatusBar, now IStatusBar API is fully
sufficient
2022-12-12 18:23:41 +02:00
Ivan Savenko
1558c28c0a Fix obstacle rendering 2022-12-12 00:05:00 +02:00
Ivan Savenko
ac839ad26a Changes to rest of the code according to review:
- renamed status bar method clearMatching -> clearIfMatching
- renamed class ColorShifterAddMul -> ColorShifterMultiplyAndAdd
- fixed missing return from function
- fixed potential access to deleted object
2022-12-11 23:43:43 +02:00
Ivan Savenko
49a6d056d9 Changes for BattleInterface classes according to code review:
- added documentation comments for classes, members and methods
- added const specifier to methods where applicable
- renamed some methods with more clear name
- removed some commented-out or unused code
2022-12-11 23:16:23 +02:00
Ivan Savenko
7f5e5259c8 Changes to Canvas class according to review:
- renamed CCanvas -> Canvas.cpp
- replaced shared_ptr<Canvas> with Canvas&
- removed getSurface method
2022-12-11 22:09:57 +02:00
Ivan Savenko
c855823528 Renamed files in client/battle to match new names of classes 2022-12-09 13:38:46 +02:00
Ivan Savenko
3f9a0a855e Renamed most of classes in client/battle directory to match current code
style
2022-12-09 13:26:17 +02:00
Ivan Savenko
facf77b3ae vstd::unique -> std::unique 2022-12-07 23:36:20 +02:00
Ivan Savenko
2855606a88 Enabled & fixed -Woverloaded-virtual warning from gcc/cland
- fixed almost all instances of overloaded-virtual warning
- cleared up inheritance & method overrides in code affected by warning
2022-12-07 21:50:45 +02:00
Ivan Savenko
7007b86737 Do not show destroyed towers in battle results window 2022-12-07 15:57:17 +02:00
Ivan Savenko
a06d7ec80e Fix Armaggeddon visual effect 2022-12-06 14:29:31 +02:00
Ivan Savenko
3c037ed620 Fix spellcaster animations 2022-12-06 14:12:13 +02:00
Ivan Savenko
f247a98373 Fix non-siege battles 2022-12-06 14:11:37 +02:00
Ivan Savenko
2c05f588fd Moved CBattleRenderer into a separate file 2022-12-06 13:41:29 +02:00
Ivan Savenko
1b4c5be4de Implemented proper rendering order generation for battlefield objects 2022-12-02 17:49:38 +02:00
Ivan Savenko
90a25cb28d Fix tower shooter rendering 2022-12-02 02:13:02 +02:00
Ivan Savenko
58ba5f1aee Fixes to effects of earthquake, obstacle-creating and offensive spells 2022-12-02 01:55:09 +02:00
Ivan Savenko
215932b520 Fix compile after merge 2022-12-02 00:06:57 +02:00
Ivan Savenko
495e0b3657 Merge remote-tracking branch 'vcmi/develop' into battleint_refactor 2022-12-01 23:58:01 +02:00
Ivan Savenko
2442d38b9a Fix ranged attack animations 2022-12-01 23:40:03 +02:00
Ivan Savenko
bbd4d361e4 Send hover event to buttons in battle UI 2022-12-01 23:39:43 +02:00
Ivan Savenko
c721d7c4f3 Fix overwriting of hover text of buttons in combat 2022-12-01 23:36:41 +02:00
Ivan Savenko
5094fab4d9 Refactoring of spell animations, multiple fixes for spell visuals 2022-12-01 22:06:42 +02:00
Andrii Danylchenko
82179a9cdb
Merge pull request #1176 from IvanSavenko/tower_shooter_icons
Tower shooter icons fix
2022-12-01 12:30:24 +02:00
Ivan Savenko
92ca0d9877 cleared up rendering of tower shooters 2022-11-30 22:05:25 +02:00
Ivan Savenko
c233e57079
Apply suggestions from code review
Co-authored-by: Nordsoft91 <nordsoft@yahoo.com>
2022-11-29 18:24:03 +02:00
Ivan Savenko
6d4bcba842 Fix moat rendering position 2022-11-29 17:18:43 +02:00
Ivan Savenko
de5616bb3b Fix combat log position 2022-11-29 17:18:30 +02:00
Ivan Savenko
178cd0226f Show town-specific tower icon in battle queue, if such icon exists 2022-11-29 14:59:50 +02:00
Ivan Savenko
88d8655f01 Fix forward declarations for ios single-app build 2022-11-29 02:00:08 +02:00
SoundSSGood
909dcb82fa use ArtifactID 2022-11-29 00:32:18 +02:00
Ivan Savenko
86616a5a3b Fix visibility of stack amount box on start of combat 2022-11-28 22:47:28 +02:00
Ivan Savenko
9e11b8f38a Fixes for creature rendering order 2022-11-28 22:35:38 +02:00
Ivan Savenko
95e6035a23 Attempt to fix MSVC compilation 2022-11-28 21:44:16 +02:00
Ivan Savenko
6f6d350228 Formatting cleanup 2022-11-28 16:43:38 +02:00
Ivan Savenko
7c4e04c1ec Refactoring/cleanup of classes in CBattleAnimations.cpp 2022-11-28 16:02:46 +02:00
Ivan Savenko
8a059301d2 Fix blitting order of battlefield objects 2022-11-27 23:42:18 +02:00
Ivan Savenko
055824654e (partially) fix catapult explosion effect 2022-11-27 23:26:28 +02:00
Ivan Savenko
9f21569a79 Next batch of siege fixes 2022-11-27 22:50:18 +02:00
Ivan Savenko
35576834c9 Fixing sieges, part 1 2022-11-27 20:21:51 +02:00
Ivan Savenko
b5d1cb4996 Fixes for projectile playback. TODO: check catapult projectile 2022-11-27 17:24:45 +02:00
Ivan Savenko
15b588b164 Fix stack reactivation leading to broken spellcasting 2022-11-27 15:10:27 +02:00
Ivan Savenko
e76cd1b6a7 Bugfixing: fix crashes on battle start & most noticeable glitches 2022-11-27 02:26:02 +02:00
Ivan Savenko
0cae259f53 Most of rendering in BattleInt is done via canvas
- refactoring of CBattleStacksController.cpp
- moved EAlignment enum to Geometries.h from CIntObject
- renamed EAlignment to ETextAlignment, to avoid conflict with good/evil
alignemt
- ETextAlignment is now enum class
2022-11-26 23:12:20 +02:00
Ivan Savenko
4f91b062db Refactoring of projectile controller
- projectiles now separated based on type
- each type has its own rendering method
- refactoring of CShootingAnimation
2022-11-25 16:32:23 +02:00
Ivan Savenko
abb553d975 Next step of code refactoring:
- refactoring of CBattleFieldController code (except for 2 arcane
methods)
- introduced class CCanvas for encapsulated rendering surface
- battleint rendering is now partially done with CCanvas
- removed unused includes of CBitmapHandler
2022-11-25 11:46:47 +02:00
Ivan Savenko
6b3beb05e5 BattleInt split is finished, start of refactoring:
- Refactoring of siege controller code
- Replaced some usages of C struct SDL_Surface with proper c++ class
IImage
- Refactoring of rendering of battlefield objects (WIP)
2022-11-25 00:26:14 +02:00
Ivan Savenko
cb6fe1eedf Moved battle effects into a new class 2022-11-24 16:30:04 +02:00
Ivan Savenko
02fe0425c7 Moved battle actions handling into a separate class 2022-11-20 22:56:42 +02:00
Ivan Savenko
b01737daf2 Moved stacks & animations handling into a separate class 2022-11-20 19:11:34 +02:00
Ivan Savenko
7a6ad671ab Separated battle control panel into new class, refactoring of
CGStatusBar to allow shared API with battle console
2022-11-18 17:54:10 +02:00
Ivan Savenko
3c5858f01e Separated battlefield background&hexes handling into a new class 2022-11-17 23:57:51 +02:00
Ivan Savenko
9c2a6dc9fc moved battle obstacle handling into separate class 2022-11-17 19:36:25 +02:00
Ivan Savenko
a65dd0726d Separated siege-related part of BattleInterface into separate class
- added constants for BattleHex'es of castle towers
2022-11-17 18:50:12 +02:00
Ivan Savenko
bd1b2e4977 Battle Interface refactoring: separated projectile handling into a
separate class (untested)
2022-11-17 13:21:03 +02:00
Nordsoft91
1893212abb
Merge pull request #1146 from IvanSavenko/ray_projectile
Implemented ray-like projectiles for shooters
2022-11-16 22:45:00 +04:00
Ivan Savenko
b3067c0e3f Attemts to improve timing of ranged attacks:
- when computing number of steps/frames to display projectile round to
nearest instead of rounding down
- end projectile animation only *after* last step was shown
2022-11-16 17:53:40 +02:00
Ivan Savenko
d1c95204c5 Code formatting 2022-11-16 12:29:07 +02:00
Ivan Savenko
6678a747bb Implemented ray-like projectiles for shooters
- Added missing support for ray-like projectiles
- Archmages, Evil Eyes and Beholders now use ray for shooting
- New method to draw 1 pixel-wide line with color gradient at arbitrary
angle
- fixed incorrect attackClimaxFrame field for Archmages
2022-11-15 21:42:16 +02:00
Ivan Savenko
38b8fc0af8 Formatting: space -> tabs 2022-11-13 14:24:15 +02:00
Ivan Savenko
4af9bc2461 Music: remember playback position of music tracks
Town & terrain themes will now resume from previously stopped position
instead of playing from start, as it was in original game.
Fixes #965
2022-11-13 14:05:51 +02:00
nordsoft
6995911d6e Preventing multiple AI from being created 2022-11-03 22:01:20 +04:00
Andrey Filipenkov
c4c2e03b6e fix typo 2022-09-30 15:06:56 +03:00
DjWarmonger
58a3abb643
Merge pull request #963 from vcmi/terrain-rewrite
Terrain rewrite
2022-09-29 18:24:05 +02:00
Andrii Danylchenko
878aabd4d6
Merge pull request #981 from kambala-decapitator/fix-analyzer-warnings
Fix Clang Analyzer warnings
2022-09-29 19:23:24 +03:00
Tomasz Zieliński
f386f42166 Merge remote-tracking branch 'origin/develop' into terrain-rewrite
# Conflicts:
#	lib/Terrain.cpp
#	lib/Terrain.h
#	lib/battle/CBattleInfoEssentials.cpp
#	lib/rmg/ObstaclePlacer.cpp
#	lib/rmg/RiverPlacer.cpp
2022-09-27 07:50:17 +02:00
Tomasz Zieliński
cd3a1a02c2 More style tweaks 2022-09-25 21:47:44 +02:00
Andrey Filipenkov
72feb538ce add explicit null pointer checks 2022-09-25 10:05:16 +03:00
Andrey Filipenkov
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
Tomasz Zieliński
a5077245a8 Merge remote-tracking branch 'origin/develop' into terrain-rewrite
# Conflicts:
#	lib/Terrain.cpp
#	lib/Terrain.h
2022-09-23 20:01:13 +02:00
Andrey Filipenkov
c9c79887a7 remove unused variables 2022-09-22 11:54:10 +03:00
Tomasz Zieliński
494b0f0226 First version that compiles 2022-09-21 11:34:23 +02:00
Nordsoft91
ad01c7ffce
Vlc obstacles [part 1] (#888)
* obstacles content handler, entity service and VLC integration
2022-09-15 11:06:54 +03:00
Andrey Filipenkov
e6e7679a2c activate battle hexes after heroes
gives hexes higher priority when performing "hit test" for mouse click as CGuiHandler::handleElementActivate() uses push_front to a list
this fixes RMB click on the topmost corner stacks: now it shows stack info instead of hero
2022-09-11 13:40:38 +03:00
Andrii Danylchenko
4b4cc3cf4b battlefields in VLC and custom bonuses for terrain patches 2022-09-11 11:31:27 +03:00
Nordsoft91
c4035134e5 New battlegrounds (#758) 2022-09-11 11:31:26 +03:00
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
Evgeniy Meshcheryakov
ff00747ecf Fixed 3206 Bugged 'Start Walking' animation 2022-08-15 09:23:35 +03:00
Andrii Danylchenko
e0e3787748 When the battle is won with only summoned creatures - defeat 2022-05-01 09:30:30 +03:00
Andrii Danylchenko
fa9a420f99 Fix a few crashes 2022-04-17 09:10:53 +03:00
Dmitry Orlov
1ce7701168 Fixed: Animation errors should not lead to hanging 2021-11-10 20:32:54 +02:00
AlexVinS
483a4689ce Fixes for code review issues 2021-02-20 04:57:50 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
Dmitry Orlov
8cd1af6998 Fix: Siege crashes when creature on the archer's tower is not a shooter 2021-01-17 15:02:58 +03:00
Dmitry Orlov
39de2f6435 Fix: Morale bonus should be shown correctly 2020-11-11 22:43:40 +03:00
John Bolton
bb58d349cb Fixed potential race condition 2020-10-24 23:38:39 -07:00
John Bolton
c61bae4060 Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation. 2020-10-05 16:28:28 -07:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
Alexander Shishkin
00de1fd734
Merge pull request #625 from Toneyisnow/toneyisnow/Battle_Clone_Effect
Implement the Clone Effect in battle.
2020-01-27 13:42:58 +03:00
toneyisnow
a03e696ec0 Updated const. 2020-01-26 16:18:07 -08:00
toneyisnow
468584d469 Update the originalPalette, and use SDL_Palette methods to improve memory management. 2020-01-26 00:01:48 -08:00
toneyisnow
0f4a9e5106 Updated resolved some issues. 2020-01-25 18:49:53 -08:00
toneyisnow
0f3dabab9a Initialize the change:
1. Make color shifter for CAnimation, and use that in the clone effect.
2. Update the original position of the cloned object.
2020-01-25 01:21:26 -08:00
toneyisnow
0fe3c0a569 Initialize the change. 2020-01-19 04:12:59 +00:00
Alexander Shishkin
54bbf2abb3
Merge pull request #595 from dydzio0614/BattleConsoleButtons
Fix wrong battle console button image
2019-05-21 10:05:01 +03:00
Dydzio
2c0b0b8cf9 Fix wrong battle console button image 2019-05-19 19:58:53 +02:00
Dydzio
cd78779d9c Remove false warning indicating something is wrong 2019-05-19 12:22:41 +02:00
Dydzio
e50efdc279 Creature spellcast refactor (#569)
* Move some logic to lib
* Mouse action priority queue enhancement
* Get rid of siegehandler dependency
* Improve AI offensive spellcasting
* CBattleInterface cleanup
2019-05-04 06:42:55 +03:00
Alexander Shishkin
34f934370b
Merge pull request #565 from dydzio0614/moralewaitfix
Fix lack of unit action with morale+wait
2019-03-24 10:49:49 +03:00
Alexander Shishkin
9ad71b200f
Merge pull request #562 from dydzio0614/BattleIntroFix
Battle action start on client after intro sound
2019-03-24 10:36:01 +03:00
Dydzio
9e4619c08d Fix lack of unit action with morale+wait 2019-03-23 23:51:50 +01:00
Dydzio
68992fbbb8 Minor fix 2019-03-23 12:12:25 +01:00
Dydzio
262057ad1c Battle action start on client after intro sound 2019-03-22 21:39:53 +01:00
Dydzio
e1bf821c27
Tweak effect / spell animation speed
After reducing the value by half effect / spell projectile speed is really close to original H3 compared to other actions on same speed setting.
2019-03-22 14:21:27 +01:00
AlexVinS
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
Dydzio
0fd729fd86 Fix creature animation callback circular reference 2018-11-14 23:36:38 +01:00
Fior.in
47ba3b2476 Hero scheme: allow each hero to have a unique battle animation (#480)
* attribute for battle image added on hero class, allowing on hero schemes each hero have a unique battle .def in 'images' structures sided with portraits and specialties images
2018-08-27 09:42:36 +03:00
Alexander Shishkin
75f8c8b29a Gui cleanup4 (#446)
* use smart pointers for almost all widget fields
* use SDL2 texture for cursor
* a lot af small tweaks and formatting
* removed CompImage class, it is actually useless as long as regular SDLImage support margins
* CGuiHandler: use smart pointers for [push|pop]Int
2018-07-25 01:36:48 +03:00
Karlis Senko
7fb7ceaad7 Prevent out of bounds array access. 2018-04-30 23:59:36 +03:00
Johannes 'josch' Schauer
ed5df13e50
client/battle/CBattleInterface.cpp: uncomment unused variable until soundh->playSound() is implemented 2018-04-19 15:20:26 +02:00
Alexander Shishkin
5c09f751b3 Gui cleanup3 - UI refactoring to use smart pointers (#440)
* Changed most gui classes to use shared pointers
* Store and use IImage as shared_ptr
* CSpellWindow redesign
* AdventureMapClasses cleanup
* CLabel: store background as smart pointer
* Store CObjectList items as smart pointers
* Removed destroy function of list item
* Store toggle buttons as smart pointers
* Use CComponent as smart pointer
* Attempt to fix artifact merchant drawing
2018-04-07 18:34:11 +07:00
AlexVinS
43acfa160b [tweaks] IImage * -> auto 2018-03-30 14:02:04 +03:00
Raphnalor
0f00dbf8cf Fix highlighting of a selected bonus for campaign. (#432) 2018-03-17 12:23:22 +08:00
Dydzio
e68a2e7ef5 Fix arrow tower destruction mechanics 2018-03-02 15:23:07 +01:00
Nikolay Shalakin
3795985de9 Eliminate warnings / errors. Pull request #388 2018-02-11 15:17:14 +03:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
AlexVinS
fc1938c341 fix 2017-10-08 11:03:12 +03:00
AlexVinS
891eb5771a Use hero battle victory and failure animations 2017-09-27 17:35:30 +03:00
AlexVinS
270e1b75ce Support for creature 2-hex attack, alternate death and cast animation types
* margin option .json animation
* Use ranged attack animation for spell cast if there is no cast animation, display cast animation only on active casting.
2017-09-12 19:51:54 +03:00
AlexVinS
c30d9f2fd6 Fix 2017-09-06 15:50:59 +03:00
AlexVinS
3bbff27127 Wiped CDefEssential 2017-09-06 15:13:28 +03:00
AlexVinS
6cd0dd9843 Use CAnimation for creature projectiles 2017-09-05 20:04:17 +03:00
AlexVinS
05bb8b13e9 Use CAnimation for battle creature animation 2017-09-05 18:59:26 +03:00
AlexVinS
78b86224a0 Use CAnimation fro custom battle effects 2017-09-05 17:21:44 +03:00
AlexVinS
882e279818 Use CAnimation in CBattleInterfaceClasses 2017-09-05 16:44:27 +03:00
AlexVinS
b964a53abe Fixed battle animation 2017-09-04 17:52:36 +03:00
AlexVinS
64d9dadd64 Logging cleanup. 2017-08-11 15:47:50 +03:00
AlexVinS
c293589c07 A bit more logging cleanup 2017-08-10 23:47:58 +03:00
AlexVinS
143ff682bc Logging cleanup 2017-08-10 21:59:55 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
ArseniyShestakov
cb40c093f8 Avoid boost::optional assignment for Boost 1.64 compatibility (#360)
Two options here: to use emplace from 1.56 or boost::make_optional.
Unfortunately Ubuntu 14.04 is using 1.54 and I'd rather not to break it.
2017-08-05 16:09:29 +03:00
Arseniy Shestakov
6d9f99d4de Code style: and one more pass on lambda expressions parameter list 2017-07-19 02:11:17 +03:00
Arseniy Shestakov
2da3d8a563 Code style: remove senseless comments 2017-07-18 00:04:00 +03:00
ArseniyShestakov
b2f74a93cf Code style: add empty parameter list to all lambda expressions (#345) 2017-07-17 15:35:57 +03:00
Dydzio
81ccecedca Fix color change of highlighted hex borders (#343) 2017-07-17 01:15:05 +03:00
ArseniyShestakov
b52cfe5283 Code style: use parentheses for creating heap-based objects (#344) 2017-07-16 12:58:05 +03:00
AlexVinS
7374689301 Fixed https://bugs.vcmi.eu/view.php?id=2715 2017-07-16 00:02:55 +03:00
ArseniyShestakov
a4c0ad94b1 Code style: remove default value hints in definitions (#342)
Some are outdated and this is something IDE are useful for.
2017-07-15 14:08:20 +03:00
ArseniyShestakov
ea0ceb1805 Merge pull request #323 from vcmi/CStackTweaks
CStack tweaks
2017-07-15 00:42:08 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
Arseniy Shestakov
dbcd79c48a Code cleanup: remove double and unneded semicolons 2017-07-12 22:01:10 +03:00
AlexVinS
1fe01b7254 Moved defensive stance log message building to server side. 2017-07-10 04:05:36 +03:00
AlexVinS
7bf8c9bd69 fixed and cleanup 2017-07-08 21:20:38 +03:00
AlexVinS
4f14f22d3a Unified CStack ammo, casts and counterattacks
* it is possible now to add casts and shoots OTF (f.e. with spell bonus)

Centralized stack 'ammo' loading from bonus system.
* introduced small proxy class for local bonus cache
(no need to use global cache if particular selector used on node only in one place)
* handle killing resurrected creatures
* use IBonusBearer::MaxHealth() where possible
* Fixed https://bugs.vcmi.eu/view.php?id=2486
* Possible fix for 0 HP after resurrection.
* Hack-fixed https://bugs.vcmi.eu/view.php?id=2584
* Unified CStack health API
* Use CHealth for CStack count and health points
* increased SERIALIZATION_VERSION
2017-07-08 20:29:59 +03:00
ArseniyShestakov
3634af10ba Merge pull request #330 from dydzio0614/AmountBoxTweaks
Tweak battle creatures amount box hiding
2017-07-08 15:54:18 +03:00
Dydzio
2d6f964d65 Amount box support for stacked war machines 2017-07-07 19:04:29 +02:00
Dydzio
ae2323672a Tweak battle creatures amount box hiding 2017-07-07 18:11:05 +02:00
AlexVinS
4d204095cf fix 2017-07-07 02:55:23 +03:00
ArseniyShestakov
5dfb7a5771 Merge pull request #317 from vcmi/attackerOwned
Refactored CStack::attackerOwned to CStack::side
2017-07-03 16:19:54 +03:00
AlexVinS
3ce238e4d3 Tweak 2017-07-03 13:40:22 +03:00
AlexVinS
e4c14c4cc2 avoid assertions in stack position checks 2017-07-03 12:59:33 +03:00
AlexVinS
4f8c7bd4bb CStack refactoring
* removed all occurrences of attackerOwned
* Use BattleSide enum
* more tweaks
2017-07-01 19:17:08 +03:00
ArseniyShestakov
2f305cc68d Remove code related to duel mode (#312)
Remove code related to duel mode
2017-07-01 16:30:13 +03:00
FeniksFire
8ccdda6d2d Improve formatting, update other config information about includes. 2017-06-27 17:00:44 +02:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
AlexVinS
0af9aa382c Possible fix for https://bugs.vcmi.eu/view.php?id=2692 2017-06-14 04:53:26 +03:00
AlexVinS
0f5202689e Cumulative spell effects
* Added experimental support for cumulative effects for ENCHANTED bonus
* Updated and fixed SPECIAL_PECULIAR_ENCHANT processing
* Initial implementation of cumulative spell effects.
* Scheme for new spell feature - cumulative bonus.
2017-06-13 21:50:50 +03:00
Arseniy Shestakov
3f7cb9f893 Client: add some shortcuts for spectator mode
Following mode only work when client is started in spectator mode:
F5 - Pause / resume game by locking of pim
F6 - Toggle spectate-ignore-hero
F7 - Toggle spectate-skip-battle
F8 - Toggle spectate-skip-battle-result
F9 - Skip current battle
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
18161d3688 Client: implement spectator mode via command-line options
If running with --spectate/-s CPlayerInterface will appear even without human players.
Following command-line options also available:
 --spectate-ignore-hero
 --spectate-hero-speed=N
 --spectate-battle-speed=N
 --spectate-skip-battle
 --spectate-skip-battle-result
Boolean options can also be changed in runtime via client console:
 set spectate-ignore-hero on / off
Spectator mode also:
 - Work with --onlyAI option when starting game or loading saves.
 - Allow to use any cheat codes.
 - Give recon on towns and heroes.
2017-06-06 07:30:16 +03:00
AlexVinS
6c308956f9 get rid of CBattleInfoCallback::battleCanCastThisSpellHere 2017-06-05 23:25:48 +03:00
AlexVinS
4d430f6ad8 get rid of CPlayerBattleCallback::battleCanCastSpell 2017-06-05 22:16:12 +03:00
Arseniy Shestakov
4a302d4fe5 CBattleHero::clickRight: more elegant code for side detection 2017-06-03 04:28:03 +03:00
AlexVinS
f5cdaece6f Fixed CID 1375687 2017-05-28 14:40:36 +03:00
FeniksFire
d390dff54d Fix game crash after autofight.
Vcmi makes crash when I turn on autofight in the battle and wait until I
close result battle window.
2017-05-13 09:54:03 +02:00
Arseniy Shestakov
09d593e59b CBattleInterface: avoid freezes on end of battle. Fix issue 1897 2017-03-19 05:15:31 +03:00
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
dydzio
141e5ad032 Implement "emergency" projectile init attempt 2017-02-03 23:25:46 +01:00
Dydzio
6c8ef79727 Merge branch 'develop' into MakeWOGGreatAgain 2017-02-01 23:14:36 +01:00
dydzio
3e285c2004 Add santa gremlin missing creature ability, fix shooter init bug 2017-01-26 20:53:28 +01:00
Michał Kalinowski
4d39f652bf Making more detailed options when choosing AI in launcher: http://
bugs.vcmi.eu/view.php?id=2369
2017-01-17 12:34:28 +01:00
AlexVinS
2dd6a47764 try to plug a few coverity false positives 2016-11-28 02:50:41 +03:00
AlexVinS
abe4beebc6 Fixed CID 1197516 2016-11-27 19:13:40 +03:00
AlexVinS
c4ab962cc0 Fixed a few CWE-457 2016-11-27 17:48:18 +03:00
AlexVinS
80666fb134 Tweaks 2016-11-25 22:12:22 +03:00
AlexVinS
4e28efb8b4 Fixed CID 1288860 2016-11-25 16:09:14 +03:00
Vadim Markovtsev
79c85be93f Fix large obstacles drawing in front of the stacks 2016-10-30 04:51:35 +01:00
Vadim Markovtsev
ab7a0d64eb Fix formatting 2016-10-28 23:37:20 +02:00
AlexVinS
feaccead36 fixed missed initialization 2016-10-18 02:37:02 +03:00
AlexVinS
b256c4c36d Improved creature casting GUI.
* "F" is new hotkey for creature spells
* creature spells now have lowest priority unless F pressed
* creatures can cast NO_LOCATION spells (only with hotkey)
2016-10-17 08:09:09 +03:00
AlexVinS
63cbf960df cleaned up spell window creation 2016-10-16 09:27:22 +03:00
AlexVinS
c5440a1c6c Fixed http://bugs.vcmi.eu/view.php?id=2541 2016-10-02 01:32:28 +03:00
AlexVinS
52ae5b4a86 Fixed http://bugs.vcmi.eu/view.php?id=482 2016-10-01 18:18:46 +03:00
AlexVinS
96c17505ae get rid of IBonusBearer::getSpellBonuses & Selector::anyRange 2016-10-01 09:07:18 +03:00
AlexVinS
6ddc1c78a2 Fixed http://bugs.vcmi.eu/view.php?id=2530 2016-09-30 02:35:07 +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
dydzio
f9b5ca3374 Remove max mana info leak + tiny refactor 2016-09-28 00:20:45 +02:00
dydzio
f621ef4ce8 Implementing hero battle information window 2016-09-27 22:47:58 +02:00
AlexVinS
849e3fc04e Fixed http://bugs.vcmi.eu/view.php?id=2506 2016-09-24 09:27:58 +03:00
AlexVinS
21de5817e3 fixed http://bugs.vcmi.eu/view.php?id=2499 2016-09-22 18:44:57 +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
AlexVinS
4a9978c642 Disabled massive spells fore creatures as they are not fully supported yet.
* (WoG) commanders now cast spells properly.
2016-09-10 21:07:36 +03:00
AlexVinS
8eca149eb3 Fixed creature`s aimed spell targeting. 2016-09-10 20:21:51 +03:00
AlexVinS
f36b40e311 fixed typo 2016-09-10 19:38:14 +03:00
AlexVinS
b7509f588f Support all spell target types (except NO_TARGET) for creature casting. 2016-09-10 19:26:55 +03:00
AlexVinS
be002f6576 Cleanup 2016-09-10 18:56:38 +03:00
AlexVinS
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
AlexVinS
5d329b40a4 Factored spell action selection for location target. 2016-08-30 12:20:15 +03:00