mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Basic config for regular unit placement in Black Tower
This commit is contained in:
parent
d8f48f2c59
commit
3ac603767d
@ -33,6 +33,7 @@ void CBankInstanceConstructor::initTypeData(const JsonNode & input)
|
|||||||
bankResetDuration = static_cast<si32>(input["resetDuration"].Float());
|
bankResetDuration = static_cast<si32>(input["resetDuration"].Float());
|
||||||
blockVisit = input["blockedVisitable"].Bool();
|
blockVisit = input["blockedVisitable"].Bool();
|
||||||
coastVisitable = input["coastVisitable"].Bool();
|
coastVisitable = input["coastVisitable"].Bool();
|
||||||
|
regularUnitPlacement = input["regularUnitPlacement"].Bool();
|
||||||
}
|
}
|
||||||
|
|
||||||
BankConfig CBankInstanceConstructor::generateConfig(IGameCallback * cb, const JsonNode & level, CRandomGenerator & rng) const
|
BankConfig CBankInstanceConstructor::generateConfig(IGameCallback * cb, const JsonNode & level, CRandomGenerator & rng) const
|
||||||
@ -57,6 +58,7 @@ void CBankInstanceConstructor::randomizeObject(CBank * bank, CRandomGenerator &
|
|||||||
bank->resetDuration = bankResetDuration;
|
bank->resetDuration = bankResetDuration;
|
||||||
bank->blockVisit = blockVisit;
|
bank->blockVisit = blockVisit;
|
||||||
bank->coastVisitable = coastVisitable;
|
bank->coastVisitable = coastVisitable;
|
||||||
|
bank->regularUnitPlacement = regularUnitPlacement;
|
||||||
|
|
||||||
si32 totalChance = 0;
|
si32 totalChance = 0;
|
||||||
for(const auto & node : levels)
|
for(const auto & node : levels)
|
||||||
|
@ -79,6 +79,8 @@ class CBankInstanceConstructor : public CDefaultObjectTypeHandler<CBank>
|
|||||||
bool blockVisit;
|
bool blockVisit;
|
||||||
// bank is visitable from land even when bank is on water tile
|
// bank is visitable from land even when bank is on water tile
|
||||||
bool coastVisitable;
|
bool coastVisitable;
|
||||||
|
//If true, player units will be placed on the left and enemy on the right
|
||||||
|
bool regularUnitPlacement;
|
||||||
protected:
|
protected:
|
||||||
void initTypeData(const JsonNode & input) override;
|
void initTypeData(const JsonNode & input) override;
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ void CBank::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) cons
|
|||||||
if (answer)
|
if (answer)
|
||||||
{
|
{
|
||||||
if (bankConfig) // not looted bank
|
if (bankConfig) // not looted bank
|
||||||
cb->startBattleI(hero, this, true);
|
cb->startBattleI(hero, this, !regularUnitPlacement);
|
||||||
else
|
else
|
||||||
doVisit(hero);
|
doVisit(hero);
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ class DLL_LINKAGE CBank : public CArmedInstance
|
|||||||
ui32 daycounter;
|
ui32 daycounter;
|
||||||
ui32 resetDuration;
|
ui32 resetDuration;
|
||||||
bool coastVisitable;
|
bool coastVisitable;
|
||||||
|
bool regularUnitPlacement;
|
||||||
|
|
||||||
void setPropertyDer(ObjProperty what, ObjPropertyID identifier) override;
|
void setPropertyDer(ObjProperty what, ObjPropertyID identifier) override;
|
||||||
void doVisit(const CGHeroInstance * hero) const;
|
void doVisit(const CGHeroInstance * hero) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user