mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Unified war machine mechanics.
* it is possible to define new war machines * added warMachine field to artifact configuration
This commit is contained in:
@@ -152,6 +152,26 @@ void CCreature::setId(CreatureID ID)
|
||||
CBonusSystemNode::treeHasChanged();
|
||||
}
|
||||
|
||||
void CCreature::fillWarMachine()
|
||||
{
|
||||
switch (idNumber)
|
||||
{
|
||||
case CreatureID::CATAPULT: //Catapult
|
||||
warMachine = ArtifactID::CATAPULT;
|
||||
break;
|
||||
case CreatureID::BALLISTA: //Ballista
|
||||
warMachine = ArtifactID::BALLISTA;
|
||||
break;
|
||||
case CreatureID::FIRST_AID_TENT: //First Aid tent
|
||||
warMachine = ArtifactID::FIRST_AID_TENT;
|
||||
break;
|
||||
case CreatureID::AMMO_CART: //Ammo cart
|
||||
warMachine = ArtifactID::AMMO_CART;
|
||||
break;
|
||||
}
|
||||
warMachine = ArtifactID::NONE; //this creature is not artifact
|
||||
}
|
||||
|
||||
static void AddAbility(CCreature *cre, const JsonVector &ability_vec)
|
||||
{
|
||||
auto nsf = std::make_shared<Bonus>();
|
||||
|
||||
Reference in New Issue
Block a user