mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	* further changes towards support for ranged spells
* added info about author & license in files
This commit is contained in:
		
							
								
								
									
										10
									
								
								AI_Base.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								AI_Base.h
									
									
									
									
									
								
							| @@ -5,6 +5,16 @@ | ||||
| #include <iostream> | ||||
| #include "CGameInterface.h" | ||||
|  | ||||
| /* | ||||
|  * AI_Base.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| #define AI_INTERFACE_VER 1 | ||||
|  | ||||
| #endif // __AI_BASE_H__ | ||||
|   | ||||
| @@ -9,6 +9,17 @@ | ||||
| #include "client/CConfigHandler.h" | ||||
| #include "client/Graphics.h" | ||||
| #include "CBattleInterface.h" | ||||
|  | ||||
| /* | ||||
|  * AdevntureMapButton.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| AdventureMapButton::AdventureMapButton () | ||||
| { | ||||
| 	type=2; | ||||
|   | ||||
| @@ -7,6 +7,16 @@ | ||||
| #include "client/FunctionList.h" | ||||
| #include <boost/bind.hpp> | ||||
|  | ||||
| /* | ||||
|  * AdventureMapButton.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| namespace config{struct ButtonInfo;} | ||||
|  | ||||
| class AdventureMapButton  | ||||
|   | ||||
| @@ -31,6 +31,16 @@ | ||||
| #pragma warning (disable : 4355) | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CAdvMapInterface.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX; //fonts | ||||
|  | ||||
| #define ADVOPT (conf.go()->ac) | ||||
|   | ||||
| @@ -14,6 +14,17 @@ class CGHeroInstance; | ||||
| class CGTownInstance; | ||||
| class CHeroWindow; | ||||
| /*****************************/ | ||||
|  | ||||
| /* | ||||
|  * CAdcmapInterface.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CMinimap | ||||
| 	: public ClickableL, public ClickableR, public Hoverable, public MotionInterested, public virtual CIntObject | ||||
| { | ||||
|   | ||||
| @@ -29,6 +29,16 @@ const double M_PI = 3.14159265358979323846; | ||||
| #include <cmath> | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CBattleInterface.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
| extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM, *GEOR16; | ||||
| extern SDL_Color zwykly; | ||||
| @@ -418,7 +428,34 @@ void CBattleInterface::show(SDL_Surface * to) | ||||
| 				currentlyHoveredHex = b; | ||||
| 			} | ||||
| 			//print shade | ||||
| 			if(settings.printMouseShadow) | ||||
| 			if(spellToCast) //when casting spell | ||||
| 			{ | ||||
| 				//calculating spell schoold level | ||||
| 				const CSpell & spToCast =  CGI->spellh->spells[spellToCast->additionalInfo]; | ||||
| 				ui8 schoolLevel = 0; | ||||
| 				if( LOCPLINT->cb->battleGetStackByID(activeStack)->attackerOwned ) | ||||
| 				{ | ||||
| 					if(attackingHeroInstance) | ||||
| 						schoolLevel = attackingHeroInstance->getSpellSchoolLevel(&spToCast); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					if(defendingHeroInstance) | ||||
| 						schoolLevel = defendingHeroInstance->getSpellSchoolLevel(&spToCast); | ||||
| 				} | ||||
| 				//obtaining range and printing it | ||||
| 				std::set<ui16> shaded = spToCast.rangeInHexes(b, schoolLevel); | ||||
| 				for(std::set<ui16>::iterator it = shaded.begin(); it != shaded.end(); ++it) //for spells with range greater then one hex | ||||
| 				{ | ||||
| 					if(settings.printMouseShadow && (*it % BFIELD_WIDTH != 0) && (*it % BFIELD_WIDTH != 16)) | ||||
| 					{ | ||||
| 						int x = 14 + ((*it/BFIELD_WIDTH)%2==0 ? 22 : 0) + 44*(*it%BFIELD_WIDTH) + pos.x; | ||||
| 						int y = 86 + 42 * (*it/BFIELD_WIDTH) + pos.y; | ||||
| 						CSDL_Ext::blit8bppAlphaTo24bpp(cellShade, NULL, to, &genRect(cellShade->h, cellShade->w, x, y)); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 			else if(settings.printMouseShadow) //when not casting spell | ||||
| 			{ | ||||
| 				int x = 14 + ((b/BFIELD_WIDTH)%2==0 ? 22 : 0) + 44*(b%BFIELD_WIDTH) + pos.x; | ||||
| 				int y = 86 + 42 * (b/BFIELD_WIDTH) + pos.y; | ||||
| @@ -985,7 +1022,6 @@ void CBattleInterface::bAutofightf() | ||||
| void CBattleInterface::bSpellf() | ||||
| { | ||||
| 	CGI->curh->changeGraphic(0,0); | ||||
| 	deactivate(); | ||||
|  | ||||
| 	const CGHeroInstance * chi = NULL; | ||||
| 	if(attackingHeroInstance->tempOwner == LOCPLINT->playerID) | ||||
| @@ -993,8 +1029,7 @@ void CBattleInterface::bSpellf() | ||||
| 	else | ||||
| 		chi = defendingHeroInstance; | ||||
| 	CSpellWindow * spellWindow = new CSpellWindow(genRect(595, 620, (conf.cc.resx - 620)/2, (conf.cc.resy - 595)/2), chi); | ||||
| 	spellWindow->activate(); | ||||
| 	LOCPLINT->objsToBlit.push_back(spellWindow); | ||||
| 	LOCPLINT->pushInt(spellWindow); | ||||
| } | ||||
|  | ||||
| void CBattleInterface::bWaitf() | ||||
|   | ||||
| @@ -5,6 +5,16 @@ | ||||
| #include "CPlayerInterface.h" | ||||
| #include <list> | ||||
|  | ||||
| /* | ||||
|  * CBattleInterface.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CCreatureSet; | ||||
| class CGHeroInstance; | ||||
| class CDefHandler; | ||||
|   | ||||
| @@ -27,6 +27,16 @@ | ||||
| #endif | ||||
| extern CSharedCond<std::set<CPack*> > mess; | ||||
|  | ||||
| /* | ||||
|  * CCallback.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| int gcd(int x, int y) | ||||
| { | ||||
| 	int temp; | ||||
|   | ||||
							
								
								
									
										10
									
								
								CCallback.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CCallback.h
									
									
									
									
									
								
							| @@ -11,6 +11,16 @@ | ||||
| #endif | ||||
| #include "CGameState.h" | ||||
|  | ||||
| /* | ||||
|  * CCallback.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CGHeroInstance; | ||||
| class CGameState; | ||||
| struct CPath; | ||||
|   | ||||
| @@ -26,6 +26,16 @@ | ||||
| using namespace boost::assign; | ||||
| using namespace CSDL_Ext; | ||||
|  | ||||
| /* | ||||
|  * CCastleInterface.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern TTF_Font * GEOR16; | ||||
| CBuildingRect::CBuildingRect(Structure *Str) | ||||
| 	:moi(false), offset(0), str(Str) | ||||
|   | ||||
| @@ -14,6 +14,17 @@ struct Structure; | ||||
| class CSpell; | ||||
| class AdventureMapButton; | ||||
| class CResDataBar; | ||||
|  | ||||
| /* | ||||
|  * CCastleInterface.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CBuildingRect : public Hoverable, public MotionInterested, public ClickableL, public ClickableR//, public TimeInterested | ||||
| { | ||||
| public: | ||||
|   | ||||
| @@ -10,6 +10,16 @@ HANDLE handleOut; | ||||
| #endif | ||||
| WORD defColor; | ||||
|  | ||||
| /* | ||||
|  * CConsoleHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| void CConsoleHandler::setColor(int level) | ||||
| { | ||||
| 	WORD color; | ||||
|   | ||||
| @@ -11,6 +11,16 @@ | ||||
| #define _kill_thread(a,b) TerminateThread(a,b); | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CConsoleHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| namespace boost | ||||
| { | ||||
| 	template<typename signature> | ||||
|   | ||||
| @@ -5,6 +5,16 @@ | ||||
| #include "CGameInfo.h" | ||||
| #include "hch/CDefHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CCursorHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
|  | ||||
| void CCursorHandler::initCursor() | ||||
|   | ||||
| @@ -6,6 +6,16 @@ struct SDL_Thread; | ||||
| class CDefHandler; | ||||
| struct SDL_Surface; | ||||
|  | ||||
| /* | ||||
|  * CCursorhandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CCursorHandler //handles cursor | ||||
| { | ||||
| public: | ||||
|   | ||||
| @@ -2,6 +2,16 @@ | ||||
| #include "CGameInfo.h" | ||||
| #include "lib/VCMI_Lib.h" | ||||
|  | ||||
| /* | ||||
|  * CGameInfo.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CGameInfo * CGI; | ||||
|  | ||||
| CGameInfo::CGameInfo() | ||||
|   | ||||
							
								
								
									
										14
									
								
								CGameInfo.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								CGameInfo.h
									
									
									
									
									
								
							| @@ -2,13 +2,19 @@ | ||||
| #define __CGAMEINFO_H__ | ||||
| #include "global.h" | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| #include <vector> | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * CGameInfo.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CMapHandler; | ||||
| class CArtHandler; | ||||
| class CHeroHandler; | ||||
|   | ||||
| @@ -7,6 +7,16 @@ | ||||
| 	#include <dlfcn.h> | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CGameInterface.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname) | ||||
| { | ||||
| 	char temp[50]; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include "lib/BattleAction.h" | ||||
| #include "client/FunctionList.h" | ||||
|  | ||||
| /* | ||||
|  * CGameInterface.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| using namespace boost::logic; | ||||
| class CCallback; | ||||
| class ICallback; | ||||
|   | ||||
| @@ -25,7 +25,6 @@ | ||||
| #include "lib/RegisterTypes.cpp" | ||||
| boost::rand48 ran; | ||||
|  | ||||
|  | ||||
| #ifdef min | ||||
| #undef min | ||||
| #endif | ||||
| @@ -33,6 +32,16 @@ boost::rand48 ran; | ||||
| #undef max | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CGameState.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| void foofoofoo() | ||||
| { | ||||
| 	//never called function to force instantation of templates | ||||
|   | ||||
							
								
								
									
										10
									
								
								CGameState.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CGameState.h
									
									
									
									
									
								
							| @@ -14,6 +14,16 @@ | ||||
| #include "tchar_amigaos4.h" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CGameState.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CTown; | ||||
| class CScriptCallback; | ||||
| class CCallback; | ||||
|   | ||||
| @@ -25,6 +25,16 @@ | ||||
| #include <cstdlib> | ||||
| #include <sstream> | ||||
|  | ||||
| /* | ||||
|  * CHeroWindow.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
| extern TTF_Font * GEOR16; | ||||
| using namespace boost::assign; | ||||
|   | ||||
| @@ -4,6 +4,16 @@ | ||||
|  | ||||
| #include "CPlayerInterface.h" | ||||
|  | ||||
| /* | ||||
|  * CHeroWindow.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class AdventureMapButton; | ||||
| struct SDL_Surface; | ||||
| class CGHeroInstance; | ||||
|   | ||||
							
								
								
									
										11
									
								
								CMT.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								CMT.cpp
									
									
									
									
									
								
							| @@ -45,6 +45,17 @@ | ||||
| #if __MINGW32__ | ||||
| #undef main | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CMT.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| std::string NAME = NAME_VER + std::string(" (client)"); //application name | ||||
| SDL_Surface *screen = NULL, *screen2 = NULL; //main screen surface and hlp surface (used to store not-active interfaces layer) | ||||
|  | ||||
|   | ||||
							
								
								
									
										11
									
								
								CMessage.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								CMessage.cpp
									
									
									
									
									
								
							| @@ -15,6 +15,17 @@ | ||||
| #include "hch/CGeneralTextHandler.h" | ||||
| #include "client/Graphics.h" | ||||
| #include "CAdvmapInterface.h" | ||||
|  | ||||
| /* | ||||
|  * CMessage.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| SDL_Color tytulowy, tlo, zwykly ; | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
|   | ||||
							
								
								
									
										10
									
								
								CMessage.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CMessage.h
									
									
									
									
									
								
							| @@ -6,6 +6,16 @@ | ||||
| #include <SDL.h> | ||||
| #include "CPreGame.h" | ||||
|  | ||||
| /* | ||||
|  * CMessage.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| enum EWindowType {infoOnly, infoOK, yesOrNO}; | ||||
| class CPreGame; | ||||
| class MapSel; | ||||
|   | ||||
| @@ -45,6 +45,17 @@ | ||||
| #ifdef max | ||||
| #undef max | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CPlayerInterface.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| using namespace boost::assign; | ||||
| using namespace CSDL_Ext; | ||||
|  | ||||
|   | ||||
| @@ -18,6 +18,16 @@ | ||||
| #undef min | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CPlayerInterface.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CDefEssential; | ||||
| class AdventureMapButton; | ||||
| class CHighlightableButtonsGroup; | ||||
|   | ||||
							
								
								
									
										10
									
								
								CPreGame.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CPreGame.cpp
									
									
									
									
									
								
							| @@ -23,6 +23,16 @@ | ||||
| #include <cstdlib> | ||||
| #include "lib/Connection.h" | ||||
|  | ||||
| /* | ||||
|  * CPreGame.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
| extern SDL_Color tytulowy, tlo, zwykly ; | ||||
| extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM; | ||||
|   | ||||
							
								
								
									
										10
									
								
								CPreGame.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CPreGame.h
									
									
									
									
									
								
							| @@ -11,6 +11,16 @@ | ||||
| #include <boost/bind.hpp> | ||||
| #include <cstdlib> | ||||
|  | ||||
| /* | ||||
|  * CPreGame.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CPreGame; | ||||
| class CDefHandler; | ||||
| extern CPreGame * CPG; | ||||
|   | ||||
| @@ -1,6 +1,17 @@ | ||||
| #include "CThreadHelper.h" | ||||
| #include <boost/thread.hpp> | ||||
| #include <boost/bind.hpp> | ||||
|  | ||||
| /* | ||||
|  * CThreadHelper.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CThreadHelper::CThreadHelper(std::vector<boost::function<void()> > *Tasks, int Threads) | ||||
| { | ||||
| 	currentTask = 0; amount = Tasks->size(); | ||||
|   | ||||
| @@ -4,6 +4,18 @@ | ||||
| #include "global.h" | ||||
| #include <boost/function.hpp> | ||||
| #include <boost/thread.hpp> | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * CThreadHelper.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| typedef boost::function<void()> Task; | ||||
|  | ||||
| class CThreadHelper | ||||
|   | ||||
| @@ -11,6 +11,16 @@ | ||||
| #include <map> | ||||
| #include "client/Graphics.h" | ||||
|  | ||||
| /* | ||||
|  * SDL_Extensions.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| SDL_Surface * CSDL_Ext::newSurface(int w, int h, SDL_Surface * mod) //creates new surface, with flags/format same as in surface given | ||||
| { | ||||
| 	return SDL_CreateRGBSurface(mod->flags,w,h,mod->format->BitsPerPixel,mod->format->Rmask,mod->format->Gmask,mod->format->Bmask,mod->format->Amask); | ||||
|   | ||||
| @@ -3,6 +3,16 @@ | ||||
| #include "SDL.h" | ||||
| #include "SDL_ttf.h" | ||||
|  | ||||
| /* | ||||
|  * SDL_Extensions.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen, *screen2; | ||||
| extern SDL_Color tytulowy, tlo, zwykly ; | ||||
| extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM; | ||||
|   | ||||
							
								
								
									
										10
									
								
								StartInfo.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								StartInfo.h
									
									
									
									
									
								
							| @@ -4,6 +4,16 @@ | ||||
| #include "global.h" | ||||
| #include <vector> | ||||
|  | ||||
| /* | ||||
|  * StartInfo.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| enum Ebonus {brandom=-1,bartifact, bgold, bresource}; | ||||
|  | ||||
| struct PlayerSettings | ||||
|   | ||||
| @@ -6,6 +6,17 @@ | ||||
| #include "../hch/CLodHandler.h" | ||||
| #include <sstream> | ||||
| #include <boost/thread.hpp> | ||||
|  | ||||
| /* | ||||
|  * CBitmapHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| boost::mutex bitmap_handler_mx; | ||||
| int readNormalNr (int pos, int bytCon, unsigned char * str); | ||||
| CLodHandler * BitmapHandler::bitmaph = NULL; | ||||
|   | ||||
| @@ -7,6 +7,16 @@ | ||||
| struct SDL_Surface; | ||||
| class CLodHandler; | ||||
|  | ||||
| /* | ||||
|  * CBitmapHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| enum Epcxformat {PCX8B, PCX24B}; | ||||
|  | ||||
| struct BMPPalette | ||||
|   | ||||
| @@ -8,6 +8,16 @@ using namespace config; | ||||
| using namespace boost::spirit; | ||||
| using namespace phoenix; | ||||
|  | ||||
| /* | ||||
|  * CConfigHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CConfigHandler conf; | ||||
| GUIOptions *current = NULL; | ||||
| std::pair<int,int> curRes; | ||||
|   | ||||
| @@ -2,6 +2,17 @@ | ||||
| #define __CCONFIGHANDLER_H__ | ||||
| #include "../global.h" | ||||
| class CAdvMapInt; | ||||
|  | ||||
| /* | ||||
|  * CConfighandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| namespace config | ||||
| { | ||||
| 	struct ClientConfig | ||||
|   | ||||
| @@ -1,5 +1,16 @@ | ||||
| #include "CCreatureAnimation.h" | ||||
| #include "../hch/CLodHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CCreatureAnimation.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| int CCreatureAnimation::getType() const | ||||
| { | ||||
| 	return type; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include "../CPlayerInterface.h" | ||||
| #include "../hch/CDefHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CCreatureAnimation.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CCreatureAnimation : public CIntObject | ||||
| { | ||||
| private: | ||||
|   | ||||
| @@ -12,6 +12,16 @@ | ||||
| #include <boost/bind.hpp> | ||||
| #include <sstream> | ||||
|  | ||||
| /* | ||||
|  * CSpellWindow.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
| extern SDL_Color tytulowy, zwykly ; | ||||
| extern TTF_Font *GEOR16; | ||||
|   | ||||
| @@ -5,6 +5,16 @@ | ||||
| #include "../global.h" | ||||
| #include "../CPlayerInterface.h" | ||||
|  | ||||
| /* | ||||
|  * CSpellWindow.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct SDL_Surface; | ||||
| class CDefHandler; | ||||
| struct SDL_Rect; | ||||
|   | ||||
| @@ -32,6 +32,16 @@ | ||||
| extern std::string NAME; | ||||
| namespace intpr = boost::interprocess; | ||||
|  | ||||
| /* | ||||
|  * Client.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CBaseForCLApply | ||||
| { | ||||
| public: | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include <boost/thread.hpp> | ||||
| #include "../lib/IGameCallback.h" | ||||
|  | ||||
| /* | ||||
|  * Client.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct StartInfo; | ||||
| class CGameState; | ||||
| class CGameInterface; | ||||
|   | ||||
| @@ -1,12 +1,18 @@ | ||||
| #ifndef FUNCTIONLIST_H | ||||
| #define FUNCTIONLIST_H | ||||
|  | ||||
| #ifdef _MSC_VER | ||||
| #pragma  once | ||||
| #endif | ||||
|  | ||||
| #include <boost/function.hpp> | ||||
|  | ||||
| /* | ||||
|  * FunctionList.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| template<typename Signature> | ||||
| class CFunctionList | ||||
| { | ||||
|   | ||||
| @@ -21,7 +21,19 @@ using namespace CSDL_Ext; | ||||
| #ifdef max | ||||
| #undef max | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * Graphics.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| Graphics * graphics = NULL; | ||||
|  | ||||
| SDL_Surface * Graphics::drawPrimarySkill(const CGHeroInstance *curh, SDL_Surface *ret, int from, int to) | ||||
| { | ||||
| 	char buf[10]; | ||||
|   | ||||
| @@ -4,6 +4,15 @@ | ||||
|  | ||||
| #include "../global.h" | ||||
|  | ||||
| /* | ||||
|  * Graphics.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CDefEssential; | ||||
| struct SDL_Surface; | ||||
|   | ||||
| @@ -22,6 +22,15 @@ | ||||
| 		if(vstd::contains(cl->playerint,player))		\ | ||||
| 			cl->playerint[player]->function(__VA_ARGS__); | ||||
|  | ||||
| /* | ||||
|  * NetPacksClient.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CSharedCond<std::set<CPack*> > mess(new std::set<CPack*>); | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								global.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								global.h
									
									
									
									
									
								
							| @@ -33,6 +33,16 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte) | ||||
| #define SERVER_NAME "./vcmiserver" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * global.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| enum Ecolor {RED, BLUE, TAN, GREEN, ORANGE, PURPLE, TEAL, PINK}; //player's colors | ||||
| enum EterrainType {border=-1, dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock}; | ||||
| enum Eriver {noRiver=0, clearRiver, icyRiver, muddyRiver, lavaRiver}; | ||||
|   | ||||
| @@ -9,6 +9,16 @@ | ||||
| extern CLodHandler *bitmaph; | ||||
| using namespace boost::assign; | ||||
|  | ||||
| /* | ||||
|  * CArtHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| const std::string & CArtifact::Name() const | ||||
| { | ||||
| 	if(name.size()) | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include <string> | ||||
| #include <vector> | ||||
|  | ||||
| /* | ||||
|  * CArtHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| enum EartClass {SartClass=0, TartClass, NartClass, JartClass, RartClass}; //artifact class (relict, treasure, strong, weak etc.) | ||||
| class CDefHandler; | ||||
|  | ||||
|   | ||||
| @@ -7,6 +7,17 @@ | ||||
| #include <sstream> | ||||
| #include <fstream> | ||||
| extern CLodHandler * bitmaph; | ||||
|  | ||||
| /* | ||||
|  * CBuildingHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| unsigned int readNr(std::string &in, int &it) | ||||
| { | ||||
| 	int last=it; | ||||
|   | ||||
| @@ -3,6 +3,17 @@ | ||||
| #include "../global.h" | ||||
| #include <map> | ||||
| #include <vector> | ||||
|  | ||||
| /* | ||||
|  * CBuildingHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| //enum EbuildingType {NEUTRAL=-1, CASTLE, RAMPART, TOWER, INFERNO, NECROPOLIS, DUNGEON, STRONGHOLD, FORTRESS, CONFLUX}; | ||||
| class DLL_EXPORT CBuilding //a typical building encountered in every castle ;] | ||||
| { | ||||
|   | ||||
| @@ -9,8 +9,20 @@ | ||||
| #include <boost/algorithm/string/find.hpp> | ||||
| #include <boost/algorithm/string/replace.hpp> | ||||
| #include "../lib/VCMI_Lib.h" | ||||
|  | ||||
| using namespace boost::assign; | ||||
| extern CLodHandler * bitmaph; | ||||
|  | ||||
| /* | ||||
|  * CCreatureHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CCreatureHandler::CCreatureHandler() | ||||
| { | ||||
| 	VLC->creh = this; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include <map> | ||||
| #include <set> | ||||
|  | ||||
| /* | ||||
|  * CCreatureHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CLodHandler; | ||||
|  | ||||
| class DLL_EXPORT CCreature | ||||
|   | ||||
| @@ -3,7 +3,19 @@ | ||||
| #include "CDefHandler.h" | ||||
| #include <sstream> | ||||
| #include "CLodHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CDefHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CLodHandler* CDefHandler::Spriteh = NULL; | ||||
|  | ||||
| long long pow(long long a, int b) | ||||
| { | ||||
| 	if (!b) return 1; | ||||
|   | ||||
| @@ -5,6 +5,16 @@ struct SDL_Surface; | ||||
| class CDefEssential; | ||||
| class CLodHandler; | ||||
|  | ||||
| /* | ||||
|  * CDefHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct Cimage | ||||
| { | ||||
| 	int groupNumber; | ||||
|   | ||||
| @@ -6,7 +6,19 @@ | ||||
| #include <sstream> | ||||
| #include "../lib/VCMI_Lib.h" | ||||
| #include <set> | ||||
|  | ||||
| extern CLodHandler * bitmaph; | ||||
|  | ||||
| /* | ||||
|  * CDefObjInfoHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| bool CGDefInfo::isVisitable() | ||||
| { | ||||
| 	for (int i=0; i<6; i++) | ||||
|   | ||||
| @@ -3,6 +3,17 @@ | ||||
| #include <vector> | ||||
| #include <map> | ||||
| #include "../global.h" | ||||
|  | ||||
| /* | ||||
|  * CDefObjInfoHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CDefHandler; | ||||
| class CLodHandler; | ||||
| class DLL_EXPORT CGDefInfo | ||||
|   | ||||
| @@ -8,6 +8,16 @@ | ||||
| #include <fstream> | ||||
| #include <sstream> | ||||
|  | ||||
| /* | ||||
|  * CGeneralTextHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| std::string readTo(std::string &in, int &it, char end) | ||||
| { | ||||
| 	int pom = it; | ||||
|   | ||||
| @@ -3,6 +3,17 @@ | ||||
| #include "../global.h" | ||||
| #include <string> | ||||
| #include <vector> | ||||
|  | ||||
| /* | ||||
|  * CGeneralTextHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode); | ||||
| std::string readTo(std::string &in, int &it, char end); | ||||
| class DLL_EXPORT CGeneralTextHandler //Handles general texts | ||||
|   | ||||
| @@ -7,6 +7,16 @@ | ||||
| extern CLodHandler * bitmaph; | ||||
| void loadToIt(std::string &dest, std::string &src, int &iter, int mode); | ||||
|  | ||||
| /* | ||||
|  * CHeroHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CHeroClass::CHeroClass() | ||||
| { | ||||
| 	skillLimit = 8; | ||||
|   | ||||
| @@ -4,6 +4,17 @@ | ||||
| #include <string> | ||||
| #include <vector> | ||||
| #include <set> | ||||
|  | ||||
| /* | ||||
|  * CHeroHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CHeroClass; | ||||
| class CDefHandler; | ||||
| class CGameInfo; | ||||
|   | ||||
| @@ -13,6 +13,17 @@ | ||||
| #ifdef max | ||||
| #undef max | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CLodHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| DLL_EXPORT int readNormalNr (int pos, int bytCon, unsigned char * str) | ||||
| { | ||||
| 	int ret=0; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include <string> | ||||
| #include "../nodrze.h" | ||||
|  | ||||
| /* | ||||
|  * CLodhandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct SDL_Surface; | ||||
| class CDefHandler; | ||||
| class CDefEssential; | ||||
|   | ||||
| @@ -1,6 +1,16 @@ | ||||
| #include "../stdafx.h" | ||||
| #include "CMusicHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CMusicHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| void CMusicHandler::initMusics() | ||||
| { | ||||
| 	if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096)==-1) | ||||
|   | ||||
| @@ -4,6 +4,16 @@ | ||||
| #include <SDL_mixer.h> | ||||
| #include "CSndHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CMusicHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CMusicHandler | ||||
| { | ||||
| protected: | ||||
|   | ||||
| @@ -20,6 +20,16 @@ | ||||
| #include "../StartInfo.h" | ||||
| #include "../map.h" | ||||
|  | ||||
| /* | ||||
|  * CObjectHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| std::map<int,std::map<int, std::vector<int> > > CGTeleport::objs; | ||||
| IGameCallback * IObjectInterface::cb = NULL; | ||||
| DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode); | ||||
| @@ -771,6 +781,23 @@ int CGHeroInstance::getTotalStrength() const | ||||
| 	return getHeroStrength() * getArmyStrength(); | ||||
| } | ||||
|  | ||||
| ui8 CGHeroInstance::getSpellSchoolLevel(const CSpell * spell) const | ||||
| { | ||||
| 	//TODO: skill level may be different on special terrain | ||||
| 	ui8 skill = 0; //skill level | ||||
|  | ||||
| 	if(spell->fire) | ||||
| 		skill = std::max(skill,getSecSkillLevel(14)); | ||||
| 	if(spell->air) | ||||
| 		skill = std::max(skill,getSecSkillLevel(15)); | ||||
| 	if(spell->water) | ||||
| 		skill = std::max(skill,getSecSkillLevel(16)); | ||||
| 	if(spell->earth) | ||||
| 		skill = std::max(skill,getSecSkillLevel(17)); | ||||
|  | ||||
| 	return skill; | ||||
| } | ||||
|  | ||||
| int3 CGHeroInstance::getSightCenter() const | ||||
| { | ||||
| 	return getPosition(false); | ||||
|   | ||||
| @@ -14,6 +14,16 @@ | ||||
| #include "../lib/VCMI_Lib.h" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * CObjectHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| using boost::logic::tribool; | ||||
| class IGameCallback; | ||||
| struct BattleResult; | ||||
| @@ -252,6 +262,7 @@ public: | ||||
| 	static int3 convertPosition(int3 src, bool toh3m); //toh3m=true: manifest->h3m; toh3m=false: h3m->manifest | ||||
| 	double getHeroStrength() const; | ||||
| 	int getTotalStrength() const; | ||||
| 	ui8 getSpellSchoolLevel(const CSpell * spell) const; //returns level on which given spell would be casted by this hero | ||||
|  | ||||
| 	////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,15 @@ | ||||
| #include "../stdafx.h" | ||||
| #include "CSndHandler.h" | ||||
|  | ||||
| /* | ||||
|  * CSndHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CSndHandler::~CSndHandler() | ||||
| { | ||||
|   | ||||
| @@ -4,6 +4,17 @@ | ||||
| #include <vector> | ||||
| #include <fstream> | ||||
| #include <map> | ||||
|  | ||||
| /* | ||||
|  * CSndHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct MemberFile | ||||
| { | ||||
| 	std::ifstream * ifs; | ||||
|   | ||||
| @@ -9,6 +9,16 @@ | ||||
|  | ||||
| extern CLodHandler *bitmaph; | ||||
|  | ||||
| /* | ||||
|  * CSpellHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| namespace SRSLPraserHelpers | ||||
| { | ||||
| 	int XYToHex(int x, int y) | ||||
|   | ||||
| @@ -5,7 +5,17 @@ | ||||
| #include <vector> | ||||
| #include <set> | ||||
|  | ||||
| class CSpell | ||||
| /* | ||||
|  * CSpellHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class DLL_EXPORT CSpell | ||||
| { | ||||
| public: | ||||
| 	ui32 id; | ||||
|   | ||||
| @@ -5,8 +5,20 @@ | ||||
| #include <sstream> | ||||
| #include "../lib/VCMI_Lib.h" | ||||
| #include "CGeneralTextHandler.h" | ||||
|  | ||||
| extern CLodHandler * bitmaph; | ||||
| void loadToIt(std::string &dest, std::string &src, int &iter, int mode); | ||||
|  | ||||
| /* | ||||
|  * CTownHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CTownHandler::CTownHandler() | ||||
| { | ||||
| 	VLC->townh = this; | ||||
|   | ||||
| @@ -2,6 +2,17 @@ | ||||
| #define __CTOWNHANDLER_H__ | ||||
| #include "../global.h" | ||||
| #include <set> | ||||
|  | ||||
| /* | ||||
|  * CTownHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CBuilding; | ||||
| class CSpell; | ||||
| class CHero; | ||||
|   | ||||
							
								
								
									
										9
									
								
								int3.h
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								int3.h
									
									
									
									
									
								
							| @@ -4,6 +4,15 @@ | ||||
| #include <vector> | ||||
| #include <cmath> | ||||
|  | ||||
| /* | ||||
|  * int3.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CCreature; | ||||
| class CCreatureSet //seven combined creatures | ||||
|   | ||||
| @@ -1,5 +1,16 @@ | ||||
| #ifndef __BATTLEACTION_H__ | ||||
| #define __BATTLEACTION_H__ | ||||
|  | ||||
| /* | ||||
|  * BattleAction.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct BattleAction | ||||
| { | ||||
| 	ui8 side; //who made this action: false - left, true - right player | ||||
|   | ||||
							
								
								
									
										11
									
								
								lib/CondSh.h
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								lib/CondSh.h
									
									
									
									
									
								
							| @@ -1,6 +1,17 @@ | ||||
| #ifndef __CONDSH_H__ | ||||
| #define __CONDSH_H__ | ||||
| #include <boost/thread.hpp> | ||||
|  | ||||
| /* | ||||
|  * CondSh.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| template <typename T> struct CondSh | ||||
| { | ||||
| 	T data; | ||||
|   | ||||
| @@ -8,6 +8,16 @@ | ||||
| #include "../lib/RegisterTypes.cpp" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * Connection.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| using namespace boost; | ||||
| using namespace boost::asio::ip; | ||||
| template<typename Serializer> DLL_EXPORT void registerTypes(Serializer &s); //defined elsewhere and explicitly instantiated for used serializers | ||||
|   | ||||
| @@ -23,6 +23,16 @@ const ui32 version = 704; | ||||
| class CConnection; | ||||
| namespace mpl = boost::mpl; | ||||
|  | ||||
| /* | ||||
|  * Connection.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| namespace boost | ||||
| { | ||||
| 	namespace asio | ||||
|   | ||||
| @@ -2,6 +2,16 @@ | ||||
| #include "../global.h" | ||||
| #include <string> | ||||
|  | ||||
| /* | ||||
|  * HeroBonus.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct DLL_EXPORT HeroBonus | ||||
| { | ||||
| 	enum BonusType | ||||
|   | ||||
| @@ -5,6 +5,16 @@ | ||||
| #include "../hch/CObjectHandler.h" | ||||
| #include "../StartInfo.h" | ||||
|  | ||||
| /* | ||||
|  * IGameCallback.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| const CGObjectInstance* IGameCallback::getObj(int objid) | ||||
| { | ||||
| 	if(objid < 0  ||  objid >= gs->map->objects.size()) | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include <set> | ||||
| #include "../client/FunctionList.h" | ||||
|  | ||||
| /* | ||||
|  * IGameCallback.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct SetMovePoints; | ||||
| struct GiveBonus; | ||||
| class CGObjectInstance; | ||||
|   | ||||
| @@ -3,6 +3,16 @@ | ||||
| #include <boost/interprocess/mapped_region.hpp> | ||||
| #include <boost/interprocess/shared_memory_object.hpp> | ||||
|  | ||||
| /* | ||||
|  * Interprocess.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| struct ServerReady | ||||
| { | ||||
| 	bool ready; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include "HeroBonus.h" | ||||
| #include <set> | ||||
|  | ||||
| /* | ||||
|  * NetPacks.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CClient; | ||||
| class CGameState; | ||||
| class CGameHandler; | ||||
|   | ||||
| @@ -13,6 +13,16 @@ | ||||
| #include <boost/thread.hpp> | ||||
| #include <boost/thread/shared_mutex.hpp> | ||||
|  | ||||
| /* | ||||
|  * NetPacksLib.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| DLL_EXPORT void SetResource::applyGs( CGameState *gs ) | ||||
| { | ||||
| 	gs->getPlayer(player)->resources[resid] = val; | ||||
|   | ||||
| @@ -7,6 +7,15 @@ | ||||
| #include "../hch/CTownHandler.h" | ||||
| #include "RegisterTypes.h" | ||||
|  | ||||
| /* | ||||
|  * RegisterTypes.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| template<typename Serializer> DLL_EXPORT | ||||
| void registerTypes1(Serializer &s) | ||||
|   | ||||
| @@ -15,4 +15,14 @@ void registerTypes3(Serializer &s); | ||||
|  | ||||
| //register all | ||||
| template<typename Serializer> DLL_EXPORT | ||||
| void registerTypes(Serializer &s); | ||||
| void registerTypes(Serializer &s); | ||||
|  | ||||
| /* | ||||
|  * RegisterTypes.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
| @@ -10,6 +10,17 @@ | ||||
| #include "../hch/CBuildingHandler.h" | ||||
| #include "../hch/CSpellHandler.h" | ||||
| #include "../hch/CGeneralTextHandler.h" | ||||
|  | ||||
| /* | ||||
|  * VCMI_Lib.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CLodHandler; | ||||
| LibClasses * VLC = NULL; | ||||
| CLodHandler * bitmaph=NULL; | ||||
|   | ||||
| @@ -6,6 +6,16 @@ | ||||
| #include "../hch/CGeneralTextHandler.h" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * VCMI_Lib.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CLodHandler; | ||||
| class CArtHandler; | ||||
| class CHeroHandler; | ||||
|   | ||||
							
								
								
									
										11
									
								
								map.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								map.cpp
									
									
									
									
									
								
							| @@ -6,6 +6,17 @@ | ||||
| #include "lib/VCMI_Lib.h" | ||||
| #include <zlib.h> | ||||
| #include <boost/crc.hpp> | ||||
|  | ||||
| /* | ||||
|  * map.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| std::set<si32> convertBuildings(const std::set<si32> h3m, int castleID) | ||||
| { | ||||
| 	std::map<int,int> mapa; | ||||
|   | ||||
							
								
								
									
										11
									
								
								map.h
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								map.h
									
									
									
									
									
								
							| @@ -13,6 +13,17 @@ | ||||
| #include "hch/CObjectHandler.h" | ||||
| #include "hch/CDefObjInfoHandler.h" | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * map.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CGDefInfo; | ||||
| class CGObjectInstance; | ||||
| class CGHeroInstance; | ||||
|   | ||||
| @@ -15,7 +15,19 @@ | ||||
| #include "hch/CObjectHandler.h" | ||||
| #include "map.h" | ||||
| #include "hch/CDefHandler.h" | ||||
|  | ||||
| /* | ||||
|  * mapHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| extern SDL_Surface * screen; | ||||
|  | ||||
| std::string nameFromType (int typ) | ||||
| { | ||||
| 	switch((EterrainType)typ) | ||||
|   | ||||
							
								
								
									
										11
									
								
								mapHandler.h
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								mapHandler.h
									
									
									
									
									
								
							| @@ -3,9 +3,20 @@ | ||||
| #include "global.h" | ||||
| #include <list> | ||||
| #include <set> | ||||
|  | ||||
| const int Woff = 13; //width of map's frame | ||||
| const int Hoff = 10; | ||||
|  | ||||
| /* | ||||
|  * mapHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CGObjectInstance; | ||||
| class CGHeroInstance; | ||||
| struct Mapa; | ||||
|   | ||||
| @@ -21,6 +21,16 @@ | ||||
| #include <boost/thread/shared_mutex.hpp> | ||||
| #include <fstream> | ||||
|  | ||||
| /* | ||||
|  * CGameHandler.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| #undef DLL_EXPORT | ||||
| #define DLL_EXPORT  | ||||
| #include "../lib/RegisterTypes.cpp" | ||||
| @@ -88,19 +98,6 @@ double distance(int3 a, int3 b) | ||||
| { | ||||
| 	return std::sqrt( (double)(a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); | ||||
| } | ||||
| int getSchoolLevel(const CGHeroInstance *h, const CSpell *s) | ||||
| { | ||||
| 	ui8 ret = 0; | ||||
| 	if(s->fire) | ||||
| 		ret = std::max(ret,h->getSecSkillLevel(14)); | ||||
| 	if(s->air) | ||||
| 		ret = std::max(ret,h->getSecSkillLevel(15)); | ||||
| 	if(s->water) | ||||
| 		ret = std::max(ret,h->getSecSkillLevel(16)); | ||||
| 	if(s->earth) | ||||
| 		ret = std::max(ret,h->getSecSkillLevel(17)); | ||||
| 	return ret; | ||||
| } | ||||
| void giveExp(BattleResult &r) | ||||
| { | ||||
| 	r.exp[0] = 0; | ||||
| @@ -2204,18 +2201,7 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 			} | ||||
|  | ||||
| 			CSpell *s = &VLC->spellh->spells[ba.additionalInfo]; | ||||
| 			ui8 skill = 0; //skill level | ||||
|  | ||||
| 			if(s->fire) | ||||
| 				skill = std::max(skill,h->getSecSkillLevel(14)); | ||||
| 			if(s->air) | ||||
| 				skill = std::max(skill,h->getSecSkillLevel(15)); | ||||
| 			if(s->water) | ||||
| 				skill = std::max(skill,h->getSecSkillLevel(16)); | ||||
| 			if(s->earth) | ||||
| 				skill = std::max(skill,h->getSecSkillLevel(17)); | ||||
|  | ||||
| 			//TODO: skill level may be different on special terrain | ||||
| 			ui8 skill = h->getSpellSchoolLevel(s); //skill level | ||||
|  | ||||
| 			if(   !(vstd::contains(h->spells,ba.additionalInfo)) //hero doesn't know this spell  | ||||
| 				|| (h->mana < s->costs[skill]) //not enough mana | ||||
| @@ -2232,11 +2218,11 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 			//TODO: check resistances | ||||
|  | ||||
| #define SPELL_CAST_TEMPLATE_1(NUMBER, DURATION) SetStackEffect sse; \ | ||||
| 			if(getSchoolLevel(h,s) < 3)  /*not expert */ \ | ||||
| 			if(h->getSpellSchoolLevel(s) < 3)  /*not expert */ \ | ||||
| 			{ \ | ||||
| 				sse.stacks.insert(gs->curB->getStackT(ba.destinationTile)->ID); \ | ||||
| 				sse.effect.id = (NUMBER); \ | ||||
| 				sse.effect.level = getSchoolLevel(h,s); \ | ||||
| 				sse.effect.level = h->getSpellSchoolLevel(s); \ | ||||
| 				sse.effect.turnsRemain = (DURATION); /*! - any duration */ \ | ||||
| 				sendAndApply(&sse); \ | ||||
| 			} \ | ||||
| @@ -2253,7 +2239,7 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 					} \ | ||||
| 				} \ | ||||
| 				sse.effect.id = (NUMBER); \ | ||||
| 				sse.effect.level = getSchoolLevel(h,s); \ | ||||
| 				sse.effect.level = h->getSpellSchoolLevel(s); \ | ||||
| 				sse.effect.turnsRemain = (DURATION); \ | ||||
| 				sendAndApply(&sse); \ | ||||
| 			} | ||||
| @@ -2273,7 +2259,7 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 					BattleStackAttacked bsa; | ||||
| 					bsa.flags |= 2; | ||||
| 					bsa.effect = 64; | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 10  +  s->powers[getSchoolLevel(h,s)];  | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 10  +  s->powers[h->getSpellSchoolLevel(s)];  | ||||
| 					bsa.stackAttacked = attacked->ID; | ||||
| 					prepareAttacked(bsa,attacked); | ||||
| 					sendAndApply(&bsa); | ||||
| @@ -2286,7 +2272,7 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 					BattleStackAttacked bsa; | ||||
| 					bsa.flags |= 2; | ||||
| 					bsa.effect = 46; | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 20  +  s->powers[getSchoolLevel(h,s)];  | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 20  +  s->powers[h->getSpellSchoolLevel(s)];  | ||||
| 					bsa.stackAttacked = attacked->ID; | ||||
| 					prepareAttacked(bsa,attacked); | ||||
| 					sendAndApply(&bsa); | ||||
| @@ -2299,7 +2285,7 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 					BattleStackAttacked bsa; | ||||
| 					bsa.flags |= 2; | ||||
| 					bsa.effect = 38; | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 25  +  s->powers[getSchoolLevel(h,s)];  | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 25  +  s->powers[h->getSpellSchoolLevel(s)];  | ||||
| 					bsa.stackAttacked = attacked->ID; | ||||
| 					prepareAttacked(bsa,attacked); | ||||
| 					sendAndApply(&bsa); | ||||
| @@ -2312,12 +2298,25 @@ void CGameHandler::makeCustomAction( BattleAction &ba ) | ||||
| 					BattleStackAttacked bsa; | ||||
| 					bsa.flags |= 2; | ||||
| 					bsa.effect = 10; | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 75  +  s->powers[getSchoolLevel(h,s)];  | ||||
| 					bsa.damageAmount = h->getPrimSkillLevel(2) * 75  +  s->powers[h->getSpellSchoolLevel(s)];  | ||||
| 					bsa.stackAttacked = attacked->ID; | ||||
| 					prepareAttacked(bsa,attacked); | ||||
| 					sendAndApply(&bsa); | ||||
| 					break; | ||||
| 				} | ||||
| 			case 21: //fireball | ||||
| 				{ | ||||
| 					std::set<ui16> attackedHexes = s->rangeInHexes(ba.destinationTile, h->getSpellSchoolLevel(s)); | ||||
| 					std::set<CStack*> attackedCres; //set to exclude multiple occurences of two hex creatures | ||||
| 					for(std::set<ui16>::iterator it = attackedHexes.begin(); it != attackedHexes.end(); ++it) | ||||
| 					{ | ||||
| 						attackedCres.insert(gs->curB->getStackT(*it)); | ||||
| 					} | ||||
|  | ||||
| 					if(attackedCres.size()) break; | ||||
| 					//TODO: the rest of it | ||||
| 					break; | ||||
| 				} | ||||
| 			case 27: //shield  | ||||
| 			case 28: //air shield | ||||
| 			case 41: //bless | ||||
|   | ||||
| @@ -10,6 +10,17 @@ | ||||
| #include "../lib/BattleAction.h" | ||||
| #include <boost/function.hpp> | ||||
| #include <boost/thread.hpp> | ||||
|  | ||||
| /* | ||||
|  * CGameHandler.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CVCMIServer; | ||||
| class CGameState; | ||||
| struct StartInfo; | ||||
|   | ||||
| @@ -33,6 +33,16 @@ namespace intpr = boost::interprocess; | ||||
| bool end2 = false; | ||||
| int port = 3030; | ||||
|  | ||||
| /* | ||||
|  * CVCMIServer.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| void vaccept(tcp::acceptor *ac, tcp::socket *s, boost::system::error_code *error) | ||||
| { | ||||
| 	ac->accept(*s,*error); | ||||
|   | ||||
| @@ -2,6 +2,17 @@ | ||||
| #define __CVCMISERVER_H__ | ||||
| #include "../global.h" | ||||
| #include <set> | ||||
|  | ||||
| /* | ||||
|  * CVCMIServer.h, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| class CConnection; | ||||
| namespace boost | ||||
| { | ||||
|   | ||||
| @@ -8,6 +8,16 @@ | ||||
| 							return;} | ||||
| #define ERROR_IF_NOT_OWNS(id)	if(!PLAYER_OWNS(id)) ERROR_AND_RETURN | ||||
|  | ||||
| /* | ||||
|  * NetPacksServer.cpp, part of VCMI engine | ||||
|  * | ||||
|  * Authors: listed in file AUTHORS in main folder | ||||
|  * | ||||
|  * License: GNU General Public License v2.0 or later | ||||
|  * Full text of license available in license.txt file, in main folder | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| CGameState* CPackForServer::GS(CGameHandler *gh) | ||||
| { | ||||
| 	return gh->gs; | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user