From: Daniel Karbach Date: Fri, 10 Aug 2012 16:29:53 +0000 (+0200) Subject: added physical/magical status of ikari attacks X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=41983a2cd8dbbfe6adc02cdfccbf5c2887306e51;p=l2e.git added physical/magical status of ikari attacks --- diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index c4fb500..7928888 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -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)); } } } diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index fb3767e..6f7da0c 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -11,7 +11,8 @@ namespace common { Ikari::Ikari() : name("") -, cost(0) { +, cost(0) +, isPhysical(false) { } diff --git a/src/common/Ikari.h b/src/common/Ikari.h index d73798f..a575106 100644 --- a/src/common/Ikari.h +++ b/src/common/Ikari.h @@ -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; + }; } diff --git a/src/main.cpp b/src/main.cpp index 6baf827..a267250 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);