mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Exclude some AB creatures from randomization picks
This changes handling of several campaign-only creatures to be in line with H3 - Sharpshooters, Enchanters and Azure/Rust/Faerie/Crystal dragons. Now these creatures will not be picked for - random creatures in Refugee Camp - as replacement for Random Monster object from map editor Random map generator is not affected and can still pick this creatures (confirmed to be same in H3)
This commit is contained in:
@@ -957,6 +957,7 @@ void CCreatureHandler::loadCreatureJson(CCreature * creature, const JsonNode & c
|
||||
}
|
||||
|
||||
creature->special = config["special"].Bool() || config["disabled"].Bool();
|
||||
creature->excludeFromRandomization = config["excludeFromRandomization"].Bool();
|
||||
|
||||
const JsonNode & sounds = config["sound"];
|
||||
creature->sounds.attack = AudioPath::fromJson(sounds["attack"]);
|
||||
@@ -1357,6 +1358,9 @@ CreatureID CCreatureHandler::pickRandomMonster(CRandomGenerator & rand, int tier
|
||||
if(creature->special)
|
||||
continue;
|
||||
|
||||
if(creature->excludeFromRandomization)
|
||||
continue;
|
||||
|
||||
if (creature->level == tier || tier == -1)
|
||||
allowed.push_back(creature->getId());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user