]> git.localhorst.tv Git - l2e.git/commitdiff
added physical/magical status of ikari attacks
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 10 Aug 2012 16:29:53 +0000 (18:29 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 10 Aug 2012 16:29:53 +0000 (18:29 +0200)
src/battle/states/SelectIkari.cpp
src/common/Ikari.cpp
src/common/Ikari.h
src/main.cpp

index c4fb5000b60c33a532b9363b97fdfa495f6ec70e..7928888d2bb031805d703001be8733336a180e0d 100644 (file)
@@ -73,7 +73,7 @@ void SelectIkari::HandleInput(const Input &input) {
                                } else {
                                        battle->ActiveHeroTargets().SetMultiple();
                                }
-                               ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroTargets(), battle->Res().magicTargetCursor));
+                               ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroTargets(), ikari->IsMagical() ? battle->Res().magicTargetCursor : battle->Res().weaponTargetCursor));
                        }
                }
        }
index fb3767e8a43be63a0a19321e95b3533a2186df38..6f7da0cd6ce77460771395783b18b31b9b966053 100644 (file)
@@ -11,7 +11,8 @@ namespace common {
 
 Ikari::Ikari()
 : name("")
-, cost(0) {
+, cost(0)
+, isPhysical(false) {
 
 }
 
index d73798f3c245428aa93b7a0f9f923a87fa7c2a14..a5751063e7057472ee1d608d8e0c533c63151b89 100644 (file)
@@ -25,12 +25,17 @@ public:
        TargetingMode &GetTargetingMode() { return targetingMode; }
        const TargetingMode &GetTargetingMode() const { return targetingMode; }
 
+       bool IsMagical() const { return !isPhysical; }
+       bool IsPhysical() const { return isPhysical; }
+
        // TODO: add missing ikari properties
 
 // temporary setters
 public:
        void SetName(const char *n) { name = n; }
        void SetCost(Uint8 c) { cost = c; }
+       void SetMagical() { isPhysical = false; }
+       void SetPhysical() { isPhysical = true; }
 
 private:
        const char *name;
@@ -38,6 +43,8 @@ private:
        Uint8 cost;
        TargetingMode targetingMode;
 
+       bool isPhysical;
+
 };
 
 }
index 6baf82770e762318ffc27b34a126f0fd056b77a4..a2672503090bbc3d5cb8d889745bbdec29236bf2 100644 (file)
@@ -331,6 +331,7 @@ int main(int argc, char **argv) {
                firestorm.SetName("Firestorm");
                firestorm.SetCost(224);
                firestorm.GetTargetingMode().TargetAllEnemies();
+               firestorm.SetPhysical();
                zircoSword.SetIkari(&firestorm);
                maxim.SetWeapon(&zircoSword);
                Item zirconArmor;
@@ -340,6 +341,7 @@ int main(int argc, char **argv) {
                magicCure.SetName("Magic cure");
                magicCure.SetCost(128);
                magicCure.GetTargetingMode().TargetSingleAlly();
+               magicCure.SetMagical();
                zirconArmor.SetIkari(&magicCure);
                maxim.SetArmor(&zirconArmor);
                Item holyShield;
@@ -349,6 +351,7 @@ int main(int argc, char **argv) {
                lightGuard.SetName("Light guard");
                lightGuard.SetCost(128);
                lightGuard.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+               lightGuard.SetMagical();
                holyShield.SetIkari(&lightGuard);
                maxim.SetShield(&holyShield);
                Item legendHelm;
@@ -358,6 +361,7 @@ int main(int argc, char **argv) {
                boomerang.SetName("Boomerang");
                boomerang.SetCost(164);
                boomerang.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+               boomerang.SetMagical();
                legendHelm.SetIkari(&boomerang);
                maxim.SetHelmet(&legendHelm);
                Item sProRing;
@@ -367,6 +371,7 @@ int main(int argc, char **argv) {
                courage.SetName("Courage");
                courage.SetCost(64);
                courage.GetTargetingMode().TargetMultipleAllies();
+               courage.SetMagical();
                sProRing.SetIkari(&courage);
                maxim.SetRing(&sProRing);
                Item evilJewel;
@@ -376,6 +381,7 @@ int main(int argc, char **argv) {
                gloomy.SetName("Gloomy");
                gloomy.SetCost(164);
                gloomy.GetTargetingMode().TargetAllEnemies();
+               gloomy.SetMagical();
                evilJewel.SetIkari(&gloomy);
                maxim.SetJewel(&evilJewel);
 
@@ -386,6 +392,7 @@ int main(int argc, char **argv) {
                thundershriek.SetName("Thundershriek");
                thundershriek.SetCost(224);
                thundershriek.GetTargetingMode().TargetAllEnemies();
+               thundershriek.SetPhysical();
                zircoWhip.SetIkari(&thundershriek);
                selan.SetWeapon(&zircoWhip);
                Item zirconPlate;
@@ -395,6 +402,7 @@ int main(int argc, char **argv) {
                suddenCure.SetName("Sudden cure");
                suddenCure.SetCost(96);
                suddenCure.GetTargetingMode().TargetAllAllies();
+               suddenCure.SetMagical();
                zirconPlate.SetIkari(&suddenCure);
                selan.SetArmor(&zirconPlate);
                Item zircoGloves;
@@ -404,6 +412,7 @@ int main(int argc, char **argv) {
                forcefield.SetName("Forcefield");
                forcefield.SetCost(64);
                forcefield.GetTargetingMode().TargetAllAllies();
+               forcefield.SetMagical();
                zircoGloves.SetIkari(&forcefield);
                selan.SetShield(&zircoGloves);
                Item holyCap;
@@ -413,6 +422,7 @@ int main(int argc, char **argv) {
                vulnerable.SetName("Vulnerable");
                vulnerable.SetCost(196);
                vulnerable.GetTargetingMode().TargetAllEnemies();
+               vulnerable.SetPhysical();
                holyCap.SetIkari(&vulnerable);
                selan.SetHelmet(&holyCap);
                Item ghostRing;
@@ -422,6 +432,7 @@ int main(int argc, char **argv) {
                destroy.SetName("Destroy");
                destroy.SetCost(128);
                destroy.GetTargetingMode().TargetMultipleEnemies();
+               destroy.SetMagical();
                ghostRing.SetIkari(&destroy);
                selan.SetRing(&ghostRing);
                Item eagleRock;
@@ -431,6 +442,7 @@ int main(int argc, char **argv) {
                dive.SetName("Dive");
                dive.SetCost(128);
                dive.GetTargetingMode().TargetSingleEnemy();
+               dive.SetPhysical();
                eagleRock.SetIkari(&dive);
                selan.SetJewel(&eagleRock);
 
@@ -441,6 +453,7 @@ int main(int argc, char **argv) {
                torrent.SetName("Torrent");
                torrent.SetCost(224);
                torrent.GetTargetingMode().TargetAllEnemies();
+               torrent.SetPhysical();
                zircoAx.SetIkari(&torrent);
                guy.SetWeapon(&zircoAx);
                guy.SetArmor(&zirconArmor);
@@ -451,6 +464,7 @@ int main(int argc, char **argv) {
                ironBarrier.SetName("Iron barrier");
                ironBarrier.SetCost(255);
                ironBarrier.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+               ironBarrier.SetMagical();
                megaShield.SetIkari(&ironBarrier);
                guy.SetShield(&megaShield);
                Item zircoHelmet;
@@ -460,6 +474,7 @@ int main(int argc, char **argv) {
                slow.SetName("Slow");
                slow.SetCost(196);
                slow.GetTargetingMode().TargetAllEnemies();
+               slow.SetPhysical();
                zircoHelmet.SetIkari(&slow);
                guy.SetHelmet(&zircoHelmet);
                Item powerRing;
@@ -469,6 +484,7 @@ int main(int argc, char **argv) {
                trick.SetName("Trick");
                trick.SetCost(32);
                trick.GetTargetingMode().TargetAllEnemies();
+               trick.SetMagical();
                zircoHelmet.SetIkari(&trick);
                guy.SetRing(&powerRing);
                guy.SetJewel(&evilJewel);
@@ -481,6 +497,7 @@ int main(int argc, char **argv) {
                dragonRush.SetName("Dragon rush");
                dragonRush.SetCost(164);
                dragonRush.GetTargetingMode().TargetSingleEnemy();
+               dragonRush.SetPhysical();
                lizardBlow.SetIkari(&dragonRush);
                dekar.SetWeapon(&lizardBlow);
                Item holyRobe;
@@ -490,6 +507,7 @@ int main(int argc, char **argv) {
                crisisCure.SetName("Crisis cure");
                crisisCure.SetCost(164);
                crisisCure.GetTargetingMode().TargetAllAllies();
+               crisisCure.SetMagical();
                holyRobe.SetIkari(&crisisCure);
                dekar.SetArmor(&holyRobe);
                dekar.SetShield(&zircoGloves);
@@ -501,6 +519,7 @@ int main(int argc, char **argv) {
                fake.SetName("Fake");
                fake.SetCost(32);
                fake.GetTargetingMode().TargetSingleAlly();
+               fake.SetMagical();
                rocketRing.SetIkari(&fake);
                dekar.SetRing(&rocketRing);
                Item krakenRock;
@@ -510,6 +529,7 @@ int main(int argc, char **argv) {
                tenLegger.SetName("Ten-legger");
                tenLegger.SetCost(164);
                tenLegger.GetTargetingMode().TargetAllEnemies();
+               tenLegger.SetPhysical();
                rocketRing.SetIkari(&tenLegger);
                dekar.SetJewel(&krakenRock);