]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
moved some items to l2 source files
[l2e.git] / src / main.cpp
index ecd24a122b4246c0972e3f14911a3802093e2291..00c07c592d6d311b5baae18719bffab1d4d50ff5 100644 (file)
@@ -174,79 +174,23 @@ int main(int argc, char **argv) {
                battleRes.jewelMenuIcon = intp.GetSprite("jewelIcon");
 
                Inventory inventory;
-               Item antidote;
-               antidote.SetName("Antidote");
-               antidote.SetMenuIcon(intp.GetSprite("potionIcon"));
-               antidote.SetUsableInBattle();
-               antidote.GetTargetingMode().TargetSingleAlly();
-               inventory.Add(&antidote, 9);
-               Item magicJar;
-               magicJar.SetName("Magic jar");
-               magicJar.SetMenuIcon(intp.GetSprite("potionIcon"));
-               magicJar.SetUsableInBattle();
-               magicJar.GetTargetingMode().TargetSingleAlly();
-               inventory.Add(&magicJar, 4);
-               Item hiPotion;
-               hiPotion.SetName("Hi-Potion");
-               hiPotion.SetMenuIcon(intp.GetSprite("potionIcon"));
-               hiPotion.SetUsableInBattle();
-               hiPotion.GetTargetingMode().TargetSingleAlly();
-               inventory.Add(&hiPotion, 4);
-               Item powerPotion;
-               powerPotion.SetName("Power potion");
-               powerPotion.SetMenuIcon(intp.GetSprite("potionIcon"));
-               inventory.Add(&powerPotion, 4);
-               Item escape;
-               escape.SetName("Escape");
-               inventory.Add(&escape, 2);
-               Item sleepBall;
-               sleepBall.SetName("Sleep ball");
-               sleepBall.SetMenuIcon(intp.GetSprite("ballIcon"));
-               sleepBall.SetUsableInBattle();
-               sleepBall.GetTargetingMode().TargetSingleEnemy();
-               inventory.Add(&sleepBall, 1);
-               Item multiBall;
-               multiBall.SetName("Multi-ball!");
-               multiBall.SetMenuIcon(intp.GetSprite("ballIcon"));
-               multiBall.SetUsableInBattle();
-               multiBall.GetTargetingMode().TargetMultipleEnemies();
-               inventory.Add(&multiBall, 1);
-               Item figgoru;
-               figgoru.SetName("Figgoru");
-               figgoru.SetMenuIcon(intp.GetSprite("crankIcon"));
-               figgoru.GetTargetingMode().TargetAllEnemies();
-               inventory.Add(&figgoru, 1);
+               inventory.Add(intp.GetItem("antidoteItem"), 9);
+               inventory.Add(intp.GetItem("magicJarItem"), 4);
+               inventory.Add(intp.GetItem("hiPotionItem"), 4);
+               inventory.Add(intp.GetItem("powerPotionItem"), 4);
+               inventory.Add(intp.GetItem("escapeItem"), 2);
+               inventory.Add(intp.GetItem("sleepBallItem"), 1);
                battleRes.inventory = &inventory;
 
-               battleRes.itemMenuHeadline = "Please choose an item.";
+               battleRes.itemMenuHeadline = intp.GetString("itemMenuHeadline");
                battleRes.itemMenuPrototype = Menu<const common::Item *>(intp.GetFont("normalFont"), intp.GetFont("disabledFont"), intp.GetSprite("handCursor"), 15, 6, 8, 16, 1, 32, 2, ':');
 
                SDL_Surface *swordAttackImg(IMG_Load("test-data/attack-sword.png"));
                Sprite swordAttackSprite(swordAttackImg, 96, 96);
                SimpleAnimation swordAttackAnimation(&swordAttackSprite, 2 * framerate, 4);
 
-               Item zircoSword;
-               zircoSword.SetName("Zirco sword");
-               zircoSword.SetMenuIcon(intp.GetSprite("swordIcon"));
-               zircoSword.GetTargetingMode().TargetSingleEnemy();
-               Ikari firestorm;
-               firestorm.SetName("Firestorm");
-               firestorm.SetCost(224);
-               firestorm.GetTargetingMode().TargetAllEnemies();
-               firestorm.SetPhysical();
-               zircoSword.SetIkari(&firestorm);
-               zircoSword.SetAttackAnimation(&swordAttackAnimation);
-               maxim.SetWeapon(&zircoSword);
-               Item zirconArmor;
-               zirconArmor.SetName("Zircon armor");
-               zirconArmor.SetMenuIcon(intp.GetSprite("armorIcon"));
-               Ikari magicCure;
-               magicCure.SetName("Magic cure");
-               magicCure.SetCost(128);
-               magicCure.GetTargetingMode().TargetSingleAlly();
-               magicCure.SetMagical();
-               zirconArmor.SetIkari(&magicCure);
-               maxim.SetArmor(&zirconArmor);
+               maxim.SetWeapon(intp.GetItem("zircoSwordItem"));
+               maxim.SetArmor(intp.GetItem("zirconArmorItem"));
                Item holyShield;
                holyShield.SetName("Holy shield");
                holyShield.SetMenuIcon(intp.GetSprite("shieldIcon"));
@@ -361,7 +305,7 @@ int main(int argc, char **argv) {
                torrent.SetPhysical();
                zircoAx.SetIkari(&torrent);
 //             guy.SetWeapon(&zircoAx);
-               guy.SetArmor(&zirconArmor);
+               guy.SetArmor(intp.GetItem("zirconArmorItem"));
                Item megaShield;
                megaShield.SetName("Mega shield");
                megaShield.SetMenuIcon(intp.GetSprite("shieldIcon"));