1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* further changes towards support for ranged spells

* added info about author & license in files
This commit is contained in:
mateuszb 2009-04-15 14:03:31 +00:00
parent aa87e1ff16
commit f9ae91d88c
101 changed files with 1116 additions and 47 deletions

View File

@ -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__

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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
{

View File

@ -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()

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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:

View File

@ -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;

View File

@ -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>

View File

@ -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()

View File

@ -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:

View File

@ -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()

View File

@ -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;

View File

@ -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];

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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
View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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
{

View File

@ -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];

View File

@ -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;

View File

@ -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*>);

View File

@ -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};

View File

@ -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())

View File

@ -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;

View File

@ -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;

View File

@ -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 ;]
{

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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++)

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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:

View File

@ -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);

View File

@ -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
//////////////////////////////////////////////////////////////////////////

View File

@ -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()
{

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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
View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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())

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -16,3 +16,13 @@ void registerTypes3(Serializer &s);
//register all
template<typename Serializer> DLL_EXPORT
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
*
*/

View File

@ -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;

View File

@ -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
View File

@ -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
View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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
{

View File

@ -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