mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
fixed mantiss 0002254
This commit is contained in:
parent
1510f1f14c
commit
e82dfb5a85
@ -186,7 +186,7 @@ public:
|
|||||||
|
|
||||||
void giveCreatures(const CArmedInstance * objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override {};
|
void giveCreatures(const CArmedInstance * objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override {};
|
||||||
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override {};
|
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override {};
|
||||||
bool changeStackType(const StackLocation &sl, CCreature *c) override {return false;};
|
bool changeStackType(const StackLocation &sl, const CCreature *c) override {return false;};
|
||||||
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override {return false;};
|
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override {return false;};
|
||||||
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;};
|
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;};
|
||||||
bool eraseStack(const StackLocation &sl, bool forceRemoval = false){return false;};
|
bool eraseStack(const StackLocation &sl, bool forceRemoval = false){return false;};
|
||||||
|
@ -864,7 +864,10 @@ public:
|
|||||||
WALKING_DEAD = 58,
|
WALKING_DEAD = 58,
|
||||||
WIGHTS = 60,
|
WIGHTS = 60,
|
||||||
LICHES = 64,
|
LICHES = 64,
|
||||||
|
BONE_DRAGON = 68,
|
||||||
TROGLODYTES = 70,
|
TROGLODYTES = 70,
|
||||||
|
HYDRA = 110,
|
||||||
|
CHAOS_HYDRA = 111,
|
||||||
AIR_ELEMENTAL = 112,
|
AIR_ELEMENTAL = 112,
|
||||||
EARTH_ELEMENTAL = 113,
|
EARTH_ELEMENTAL = 113,
|
||||||
FIRE_ELEMENTAL = 114,
|
FIRE_ELEMENTAL = 114,
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
virtual void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) =0;
|
virtual void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) =0;
|
||||||
virtual void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) =0;
|
virtual void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) =0;
|
||||||
virtual bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) =0;
|
virtual bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) =0;
|
||||||
virtual bool changeStackType(const StackLocation &sl, CCreature *c) =0;
|
virtual bool changeStackType(const StackLocation &sl, const CCreature *c) =0;
|
||||||
virtual bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count = -1) =0; //count -1 => moves whole stack
|
virtual bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count = -1) =0; //count -1 => moves whole stack
|
||||||
virtual bool eraseStack(const StackLocation &sl, bool forceRemoval = false) =0;
|
virtual bool eraseStack(const StackLocation &sl, bool forceRemoval = false) =0;
|
||||||
virtual bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) =0;
|
virtual bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) =0;
|
||||||
|
@ -795,7 +795,7 @@ struct ChangeStackCount : CGarrisonOperationPack //521
|
|||||||
struct SetStackType : CGarrisonOperationPack //522
|
struct SetStackType : CGarrisonOperationPack //522
|
||||||
{
|
{
|
||||||
StackLocation sl;
|
StackLocation sl;
|
||||||
CCreature *type;
|
const CCreature *type;
|
||||||
|
|
||||||
void applyCl(CClient *cl);
|
void applyCl(CClient *cl);
|
||||||
DLL_LINKAGE void applyGs(CGameState *gs);
|
DLL_LINKAGE void applyGs(CGameState *gs);
|
||||||
|
@ -2789,7 +2789,7 @@ bool CGameHandler::upgradeCreature( ObjectInstanceID objid, SlotID pos, Creature
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameHandler::changeStackType(const StackLocation &sl, CCreature *c)
|
bool CGameHandler::changeStackType(const StackLocation &sl, const CCreature *c)
|
||||||
{
|
{
|
||||||
if(!sl.army->hasStackAtSlot(sl.slot))
|
if(!sl.army->hasStackAtSlot(sl.slot))
|
||||||
COMPLAIN_RET("Cannot find a stack to change type");
|
COMPLAIN_RET("Cannot find a stack to change type");
|
||||||
@ -3208,14 +3208,15 @@ bool CGameHandler::transformInUndead(const IMarket *market, const CGHeroInstance
|
|||||||
|
|
||||||
|
|
||||||
const CStackInstance &s = army->getStack(slot);
|
const CStackInstance &s = army->getStack(slot);
|
||||||
int resCreature;//resulting creature - bone dragons or skeletons
|
|
||||||
|
|
||||||
if (s.hasBonusOfType(Bonus::DRAGON_NATURE))
|
//resulting creature - bone dragons or skeletons
|
||||||
resCreature = 68;
|
CreatureID resCreature = CreatureID::SKELETON;
|
||||||
else
|
|
||||||
resCreature = 56;
|
|
||||||
|
|
||||||
changeStackType(StackLocation(army, slot), VLC->creh->creatures.at(resCreature));
|
if(s.hasBonusOfType(Bonus::DRAGON_NATURE)
|
||||||
|
|| (s.getCreatureID() == CreatureID::HYDRA)
|
||||||
|
|| (s.getCreatureID() == CreatureID::CHAOS_HYDRA))
|
||||||
|
resCreature = CreatureID::BONE_DRAGON;
|
||||||
|
changeStackType(StackLocation(army, slot), resCreature.toCreature());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ public:
|
|||||||
|
|
||||||
void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override;
|
void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override;
|
||||||
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override;
|
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override;
|
||||||
bool changeStackType(const StackLocation &sl, CCreature *c) override;
|
bool changeStackType(const StackLocation &sl, const CCreature *c) override;
|
||||||
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override;
|
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override;
|
||||||
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override;
|
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override;
|
||||||
bool eraseStack(const StackLocation &sl, bool forceRemoval = false) override;
|
bool eraseStack(const StackLocation &sl, bool forceRemoval = false) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user