瀏覽代碼

Actually this one contains fixed Pyramid

DjWarmonger 16 年之前
父節點
當前提交
6bff8aec34
共有 3 個文件被更改,包括 39 次插入23 次删除
  1. 32 16
      hch/CObjectHandler.cpp
  2. 1 1
      hch/CObjectHandler.h
  3. 6 6
      server/CGameHandler.cpp

+ 32 - 16
hch/CObjectHandler.cpp

@@ -4220,24 +4220,11 @@ void CBank::onHeroVisit (const CGHeroInstance * h) const
 	else
 	{
 		InfoWindow iw;
-		if (ID == 85)
-		{
-			iw.components.push_back (Component (Component::MORALE, 0 , -1, 0));
-			GiveBonus gbonus;
-			gbonus.hid = h->id;
-			gbonus.bonus.duration = HeroBonus::ONE_BATTLE;
-			gbonus.bonus.source = HeroBonus::OBJECT;
-			gbonus.bonus.id = ID;
-			gbonus.bdescr << "\n" << VLC->generaltexth->arraytxt[ID];
-			gbonus.bonus.type = HeroBonus::MORALE;
-			gbonus.bonus.val = -1;
-			cb->giveHeroBonus(&gbonus);
-		}
 		iw.soundID = soundBase::GRAVEYARD;
 		iw.player = h->getOwner();
+		//if (ID == 16 || ID == 24 || ID == 25 || ID == 84)
 		iw.text << VLC->generaltexth->advobtxt[33];
-		if (ID == 16 || ID == 24 || ID == 85)
-			iw.text.addReplacement (VLC->objh->creBanksNames[index]);	
+		iw.text.addReplacement (VLC->objh->creBanksNames[index]);
 		cb->showInfoDialog(&iw);
 	}
 }
@@ -4260,7 +4247,7 @@ void CBank::endBattle (const CGHeroInstance *h, const BattleResult *result) cons
 
 		switch (ID)
 		{
-			case 16: case 25: case 84:
+			case 16: case 25:
 				textID = 34;
 				break;
 			case 24: //derelict ship
@@ -4268,10 +4255,39 @@ void CBank::endBattle (const CGHeroInstance *h, const BattleResult *result) cons
 					textID = 43;
 				else
 				{
+					iw.components.push_back (Component (Component::MORALE, 0 , -2, 0));
+					GiveBonus gbonus;
+					gbonus.hid = h->id;
+					gbonus.bonus.duration = HeroBonus::ONE_BATTLE;
+					gbonus.bonus.source = HeroBonus::OBJECT;
+					gbonus.bonus.id = ID;
+					gbonus.bdescr << "\n" << VLC->generaltexth->arraytxt[ID];
+					gbonus.bonus.type = HeroBonus::MORALE;
+					gbonus.bonus.val = -2;
+					cb->giveHeroBonus(&gbonus);
 					textID = 42;
 					iw.components.push_back (Component (Component::MORALE, 0 , -2, 0));
 				}
 				break;
+			case 84: //Crypt
+				if (bc->resources.size() != 0)
+					textID = 121;
+				else
+				{
+					iw.components.push_back (Component (Component::MORALE, 0 , -1, 0));
+					GiveBonus gbonus;
+					gbonus.hid = h->id;
+					gbonus.bonus.duration = HeroBonus::ONE_BATTLE;
+					gbonus.bonus.source = HeroBonus::OBJECT;
+					gbonus.bonus.id = ID;
+					gbonus.bdescr << "\n" << VLC->generaltexth->arraytxt[ID];
+					gbonus.bonus.type = HeroBonus::MORALE;
+					gbonus.bonus.val = -1;
+					cb->giveHeroBonus(&gbonus);
+					textID = 120;
+					iw.components.push_back (Component (Component::MORALE, 0 , -1, 0));
+				}
+				break;
 			case 85: //shipwreck
 				if (bc->resources.size() != 0)
 					textID = 124;

+ 1 - 1
hch/CObjectHandler.h

@@ -955,7 +955,7 @@ public:
 
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
-		h & static_cast<CGObjectInstance&>(*this);
+		h & static_cast<CBank&>(*this);
 		h & spell;
 	}
 };

+ 6 - 6
server/CGameHandler.cpp

@@ -2040,12 +2040,12 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid )
 		ssi.creatures[bid-30].first = VLC->creh->creatures[crid].growth;
 		ssi.creatures[bid-30].second.push_back(crid);
 		sendAndApply(&ssi);
-	}
-	else if(bid == 11)
-		ns.bid.insert(27);
-	else if(bid == 12)
-		ns.bid.insert(28);
-	else if(bid == 13)
+	}
+	else if(bid == 11)
+		ns.bid.insert(27);
+	else if(bid == 12)
+		ns.bid.insert(28);
+	else if(bid == 13)
 		ns.bid.insert(29);
 
 	ns.bid.insert(bid);