Browse Source

Thieves guild information level is now a bonus type

Ivan Savenko 1 year ago
parent
commit
55fd7bd7aa

+ 0 - 4
client/windows/CCastleInterface.cpp

@@ -801,10 +801,6 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil
 							enterDwelling(town->town->creatures.size());
 							enterDwelling(town->town->creatures.size());
 						break;
 						break;
 
 
-				case BuildingSubID::THIEVES_GUILD:
-						enterAnyThievesGuild();
-						break;
-
 				case BuildingSubID::BANK:
 				case BuildingSubID::BANK:
 						enterBank();
 						enterBank();
 						break;
 						break;

+ 15 - 0
config/buildingsLibrary.json

@@ -10,6 +10,11 @@
 			{
 			{
 				"type": "MORALE",
 				"type": "MORALE",
 				"val": 1
 				"val": 1
+			},
+			{
+				"propagator": "PLAYER_PROPAGATOR",
+				"type": "THIEVES_GUILD_ACCESS",
+				"val": 1
 			}
 			}
 		]
 		]
 	},
 	},
@@ -203,5 +208,15 @@
 	// Section 3 - buildings that now have dedicated mechanics
 	// Section 3 - buildings that now have dedicated mechanics
 	"ballistaYard": {
 	"ballistaYard": {
 		"blacksmith" : "ballista"
 		"blacksmith" : "ballista"
+	},
+	
+	"thievesGuild" : {
+		"bonuses": [
+			{
+				"propagator": "PLAYER_PROPAGATOR",
+				"type": "THIEVES_GUILD_ACCESS",
+				"val": 2
+			}
+		]
 	}
 	}
 }
 }

+ 1 - 1
config/schemas/townBuilding.json

@@ -36,7 +36,7 @@
 		},
 		},
 		"type" : {
 		"type" : {
 			"type" : "string",
 			"type" : "string",
-			"enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "library", "escapeTunnel", "treasury", "thievesGuild", "bank" ],
+			"enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ],
 			"description" : "Subtype for some special buildings"
 			"description" : "Subtype for some special buildings"
 		},
 		},
 		"mode" : {
 		"mode" : {

+ 4 - 2
docs/modders/Bonus/Bonus_Types.md

@@ -1010,9 +1010,11 @@ Dummy bonus that acts as marker for Dendroid's Bind ability
 
 
 Dummy skill for alternative upgrades mod
 Dummy skill for alternative upgrades mod
 
 
-### TOWN_MAGIC_WELL
+### THIEVES_GUILD_ACCESS
 
 
-Internal bonus, do not use
+Increases amount of information available in affected thieves guild (in town or in adventure map tavern). Does not affects adventure map object "Den of Thieves". You may want to use PLAYER_PROPAGATOR with this bonus to make its effect player wide.
+
+- val: additional number of 'levels' of information to grant access to
 
 
 ### LEVEL_COUNTER
 ### LEVEL_COUNTER
 
 

+ 0 - 2
docs/modders/Entities_Format/Town_Building_Format.md

@@ -210,14 +210,12 @@ Following Heroes III buildings can be used as unique buildings for a town. Their
 - `castleGate`
 - `castleGate`
 - `creatureTransformer`
 - `creatureTransformer`
 - `portalOfSummoning`
 - `portalOfSummoning`
-- `ballistaYard`
 - `library`
 - `library`
 - `escapeTunnel`
 - `escapeTunnel`
 - `treasury`
 - `treasury`
 
 
 #### Buildings from other Heroes III mods
 #### Buildings from other Heroes III mods
 Following HotA buildings can be used as unique building for a town. Functionality should match corresponding HotA building:
 Following HotA buildings can be used as unique building for a town. Functionality should match corresponding HotA building:
-- `thievesGuild`
 - `bank`
 - `bank`
 
 
 #### Custom buildings
 #### Custom buildings

+ 1 - 9
lib/CGameInfoCallback.cpp

@@ -236,15 +236,7 @@ void CGameInfoCallback::getThievesGuildInfo(SThievesGuildInfo & thi, const CGObj
 
 
 	if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN)
 	if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN)
 	{
 	{
-		int taverns = 0;
-		for(auto town : gs->players[*getPlayerID()].getTowns())
-		{
-			if(town->hasBuilt(BuildingID::TAVERN))
-				taverns++;
-			
-			if(town->hasBuilt(BuildingSubID::THIEVES_GUILD))
-				taverns += 2;
-		}
+		int taverns = gs->players[*getPlayerID()].valOfBonuses(BonusType::THIEVES_GUILD_ACCESS);
 		gs->obtainPlayersStats(thi, taverns);
 		gs->obtainPlayersStats(thi, taverns);
 	}
 	}
 	else if(obj->ID == Obj::DEN_OF_THIEVES)
 	else if(obj->ID == Obj::DEN_OF_THIEVES)

+ 1 - 1
lib/bonuses/BonusEnum.h

@@ -150,7 +150,7 @@ class JsonNode;
 	BONUS_NAME(GARGOYLE) /* gargoyle is special than NON_LIVING, cannot be rised or healed */ \
 	BONUS_NAME(GARGOYLE) /* gargoyle is special than NON_LIVING, cannot be rised or healed */ \
 	BONUS_NAME(SPECIAL_ADD_VALUE_ENCHANT) /*specialty spell like Aenin has, increased effect of spell, additionalInfo = value to add*/\
 	BONUS_NAME(SPECIAL_ADD_VALUE_ENCHANT) /*specialty spell like Aenin has, increased effect of spell, additionalInfo = value to add*/\
 	BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty spell like Melody has, constant spell effect (i.e. 3 luck), additionalInfo = value to fix.*/\
 	BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty spell like Melody has, constant spell effect (i.e. 3 luck), additionalInfo = value to fix.*/\
-	BONUS_NAME(TOWN_MAGIC_WELL) /*one-time pseudo-bonus to implement Magic Well in the town*/\
+	BONUS_NAME(THIEVES_GUILD_ACCESS) \
 	BONUS_NAME(LIMITED_SHOOTING_RANGE) /*limits range of shooting creatures, doesn't adjust any other mechanics (half vs full damage etc). val - range in hexes, additional info - optional new range for broken arrow mechanic */\
 	BONUS_NAME(LIMITED_SHOOTING_RANGE) /*limits range of shooting creatures, doesn't adjust any other mechanics (half vs full damage etc). val - range in hexes, additional info - optional new range for broken arrow mechanic */\
 	BONUS_NAME(LEARN_BATTLE_SPELL_CHANCE) /*skill-agnostic eagle eye chance. subtype = 0 - from enemy, 1 - TODO: from entire battlefield*/\
 	BONUS_NAME(LEARN_BATTLE_SPELL_CHANCE) /*skill-agnostic eagle eye chance. subtype = 0 - from enemy, 1 - TODO: from entire battlefield*/\
 	BONUS_NAME(LEARN_BATTLE_SPELL_LEVEL_LIMIT) /*skill-agnostic eagle eye limit, subtype - school (-1 for all), others TODO*/\
 	BONUS_NAME(LEARN_BATTLE_SPELL_LEVEL_LIMIT) /*skill-agnostic eagle eye limit, subtype - school (-1 for all), others TODO*/\

+ 0 - 1
lib/constants/Enumerations.h

@@ -36,7 +36,6 @@ namespace BuildingSubID
 		FREELANCERS_GUILD,
 		FREELANCERS_GUILD,
 		MAGIC_UNIVERSITY,
 		MAGIC_UNIVERSITY,
 		TREASURY,
 		TREASURY,
-		THIEVES_GUILD,
 		BANK
 		BANK
 	};
 	};
 }
 }

+ 0 - 1
lib/constants/StringConstants.h

@@ -188,7 +188,6 @@ namespace MappedKeys
 		{ "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus
 		{ "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus
 		{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },
 		{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },
 		{ "treasury", BuildingSubID::TREASURY },
 		{ "treasury", BuildingSubID::TREASURY },
-		{ "thievesGuild", BuildingSubID::THIEVES_GUILD },
 		{ "bank", BuildingSubID::BANK }
 		{ "bank", BuildingSubID::BANK }
 	};
 	};