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"));
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"));
--- /dev/null
+export Sprite potionIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>
+}
+export Sprite ballIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,16>
+}
+export Sprite crankIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,32>
+}
+export Sprite spearIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,48>
+}
+export Sprite swordIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,64>
+}
+export Sprite axIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,80>
+}
+export Sprite rodIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,96>
+}
+export Sprite armorIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,112>
+}
+export Sprite shieldIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,128>
+}
+export Sprite helmetIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,144>
+}
+export Sprite ringIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,160>
+}
+export Sprite jewelIcon {
+ image: "test-data/item-icons.png",
+ size: <16,16>,
+ offset: <0,176>
+}
+
+export SimpleAnimation swordAttackAnimation {
+ sprite: Sprite {
+ image: "test-data/attack-sword.png",
+ size: <96,96>
+ },
+ frametime: twoFramesTime,
+ repeat: false,
+ framecount: 4
+}
+
+export Item antidoteItem {
+ name: "Antidote",
+ menuicon: potionIcon,
+ battle: true,
+ targets: TargetingMode {
+ ally: true,
+ single: true
+ }
+}
+export Item escapeItem {
+ name: "Escape",
+ battle: false
+}
+export Item hiPotionItem {
+ name: "Hi-Potion",
+ menuicon: potionIcon,
+ battle: true,
+ targets: TargetingMode {
+ ally: true,
+ single: true
+ }
+}
+export Item magicJarItem {
+ name: "Magic jar",
+ menuicon: potionIcon,
+ battle: true,
+ targets: TargetingMode {
+ ally: true,
+ single: true
+ }
+}
+export Item powerPotionItem {
+ name: "Power potion",
+ menuicon: potionIcon,
+ battle: false
+}
+export Item sleepBallItem {
+ name: "Sleep ball",
+ menuicon: ballIcon,
+ battle: true,
+ targets: TargetingMode {
+ enemy: true,
+ single: true
+ }
+}
+export Item zirconArmorItem {
+ name: "Zircon armor",
+ menuicon: armorIcon,
+ battle: false,
+ ikari: magicCureIkari
+}
+export Item zircoSwordItem {
+ name: "Zirco sword",
+ menuicon: swordIcon,
+ battle: false,
+ targets: TargetingMode {
+ enemy: true,
+ single: true
+ },
+ ikari: firestormIkari,
+ attackanimation: swordAttackAnimation
+}
export String spellMenuHeadline "Please choose a spell."
-export Sprite potionIcon {
- image: "test-data/item-icons.png",
- size: <16,16>
-}
-export Sprite ballIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,16>
-}
-export Sprite crankIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,32>
-}
-export Sprite spearIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,48>
-}
-export Sprite swordIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,64>
-}
-export Sprite axIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,80>
-}
-export Sprite rodIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,96>
-}
-export Sprite armorIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,112>
-}
-export Sprite shieldIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,128>
-}
-export Sprite helmetIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,144>
-}
-export Sprite ringIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,160>
-}
-export Sprite jewelIcon {
- image: "test-data/item-icons.png",
- size: <16,16>,
- offset: <0,176>
-}
+include "test-data/ikaris.l2s"
+include "test-data/items.l2s"
+
+export String itemMenuHeadline "Please choose an item."