Explorar o código

* minor fixes for revision 2193 (no shooting penalty bonus wasn't needed indeed but was poorly removed)
* minor changes

mateuszb %!s(int64=14) %!d(string=hai) anos
pai
achega
c71127809e

+ 0 - 7
Scripting/ERM/ERMParser.cpp

@@ -37,13 +37,6 @@ namespace phoenix = boost::phoenix;
 //actually these macros help in dealing with boost::variant
 
 
-#define BEGIN_TYPE_CASE(LinePrinterVisitor) struct LinePrinterVisitor : boost::static_visitor<> \
-{
-
-#define FOR_TYPE(TYPE, VAR) void operator()(TYPE const& VAR) const
-
-#define DO_TYPE_CASE(LinePrinterVisitor, VAR) } ___UN; boost::apply_visitor(___UN, VAR);
-
 CERMPreprocessor::CERMPreprocessor(const std::string &Fname) : fname(Fname), file(Fname.c_str()), lineNo(0), version(INVALID)
 {
 	if(!file.is_open())

+ 10 - 0
Scripting/ERM/ERMScriptModule.cpp

@@ -1,6 +1,16 @@
 #include "ERMScriptModule.h"
 #include "ERMInterpreter.h"
 
+/*
+ * ERMScriptingModule.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
+ *
+ */
+
 IGameEventRealizer *acb;
 CPrivilagedInfoCallback *icb;
 

+ 12 - 0
Scripting/ERM/ERMScriptModule.h

@@ -1,5 +1,17 @@
 #pragma once
 
 #include "../../lib/CScriptingModule.h"
+
+/*
+ * ERMScriptingModule.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 IGameEventRealizer *acb;
 extern CPrivilagedInfoCallback *icb;

+ 5 - 4
lib/BattleState.cpp

@@ -607,10 +607,11 @@ TDmgRange BattleInfo::calculateDmgRange( const CStack* attacker, const CStack* d
 	};
 
 	//wall / distance penalty + advanced air shield
-	if (shooting && !NBonus::hasOfType(attackerHero, Bonus::NO_DISTANCE_PENALTY) && (
-		hasDistancePenalty(attacker, defender->position) || hasWallPenalty(attacker, defender->position) ||
-		HLP::hasAdvancedAirShield(defender) )
-		)
+	bool distPenalty = !NBonus::hasOfType(attackerHero, Bonus::NO_DISTANCE_PENALTY) &&
+		hasDistancePenalty(attacker, defender->position);
+	bool obstaclePenalty = !NBonus::hasOfType(attackerHero, Bonus::NO_OBSTACLES_PENALTY) &&
+		hasWallPenalty(attacker, defender->position);
+	if (shooting && (distPenalty || obstaclePenalty || HLP::hasAdvancedAirShield(defender) ))
 	{
 		multBonus *= 0.5;
 	}

+ 1 - 0
lib/CArtHandler.cpp

@@ -736,6 +736,7 @@ void CArtHandler::addBonuses()
 
 	//Bow of the Sharpshooter
 	giveArtBonus(137, Bonus::NO_DISTANCE_PENALTY, 0);
+	giveArtBonus(137, Bonus::NO_OBSTACLES_PENALTY, 0);
 	giveArtBonus(137, Bonus::FREE_SHOOTING, 0);
 
 	//Wizard's Well

+ 11 - 0
lib/CFileUtility.cpp

@@ -3,6 +3,17 @@
 #include <boost/filesystem.hpp>   // includes all needed Boost.Filesystem declarations
 #include <boost/algorithm/string/predicate.hpp>
 
+/*
+ * CFileUtility.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 fs = boost::filesystem;
 
 CFileUtility::CFileUtility(void)

+ 10 - 0
lib/CFileUtility.h

@@ -1,6 +1,16 @@
 #pragma once
 #include "../global.h"
 
+/*
+ * CFileUtility.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
+ *
+ */
+
 /// Struct which stores name, date and a value which says if the file is located in LOD
 struct FileInfo
 {