Selaa lähdekoodia

Support for Titan's Thunder (creating Spellbook) & Titan's Lightning Bolt.

DjWarmonger 14 vuotta sitten
vanhempi
sitoutus
c53c226820

+ 3 - 1
client/CBattleInterface.cpp

@@ -3015,6 +3015,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
 			break; //for 15 and 16 cases
 		}
 	case 17: //lightning bolt
+	case 57: //Titan's Thunder
 	case 77: //thunderbolt
 		displayEffect(1, sc->tile);
 		displayEffect(spell.mainEffectAnim, sc->tile);
@@ -3050,6 +3051,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
 		if(sc->castedByHero)
 		{
 			boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetFightingHero(sc->side)->name);
+			boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //spell name
 			boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetStackByID(*sc->affectedCres.begin(), false)->getCreature()->namePl ); //target
 		}
 		else
@@ -3143,7 +3145,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
 				}
 			}
 		}
-		if (!customSpell)
+		if (!customSpell) //TODO: should not get here for direct damage spells
 			boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //simple spell name
 		if (text.size())
 			console->addText(text);

+ 1 - 1
config/spell_info.txt

@@ -57,7 +57,7 @@
 54 -1 19 0 0 0 X
 55 1 28 0 0 0 0
 56 1 17 0 0 0 0
-57 -1 -1 0 0 0 0
+57 -1 38 0 0 0 0
 58 1 7 0 0 0 X
 59 -1 35 0 0 0-1 0-2
 60 -1 21 0 0 0 0

+ 2 - 0
lib/CArtHandler.cpp

@@ -1010,6 +1010,8 @@ void CArtifactInstance::move(ArtifactLocation &src, ArtifactLocation &dst)
 {
 	removeFrom(src.hero, src.slot);
 	putAt(dst.hero, dst.slot);
+	if (artType->id == 135 && dst.slot == Arts::RIGHT_HAND && !dst.hero->hasSpellbook()) //Titan's Thunder creates new spellbook on equip
+		dst.hero->giveArtifact(0);
 }
 
 CArtifactInstance * CArtifactInstance::createNewArtifactInstance(CArtifact *Art)

+ 2 - 2
lib/CGameInterface.cpp

@@ -57,8 +57,8 @@ rett * createAny(std::string dllname, std::string methodName)
 
 	return ret;
 }
-
-//Currently AI libraries use "lib" prefix only on non-win systems.
+
+//Currently AI libraries use "lib" prefix only on non-win systems.
 //May be applied to Win systems as well to remove this ifdef
 #ifdef _WIN32
 std::string getAIFileName(std::string input)

+ 1 - 0
server/CGameHandler.cpp

@@ -3450,6 +3450,7 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, THex destinati
 	case 24: //death ripple
 	case 25: //destroy undead
 	case 26: //armageddon
+	case 57: //Titan's Lightning bolt
 	case 77: //Thunderbolt (thunderbirds)
 		{
 			StacksInjured si;