]> git.localhorst.tv Git - l2e.git/commitdiff
renamed TargetSelections Enemies to Monsters
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 22 Aug 2012 19:49:34 +0000 (21:49 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 22 Aug 2012 19:49:34 +0000 (21:49 +0200)
src/battle/BattleState.cpp
src/battle/TargetSelection.cpp
src/battle/TargetSelection.h
src/battle/states/PerformAttacks.cpp
src/battle/states/SelectIkari.cpp
src/battle/states/SelectItem.cpp
src/battle/states/SelectSpell.cpp
src/battle/states/SelectTarget.cpp

index fe821fc416ad6999a30e314858f9ca84da1ab885..3f28f5cc43e1f74a2f4b9d650a867d7b8aa63961 100644 (file)
@@ -232,7 +232,7 @@ void BattleState::CalculateDamage() {
        // TODO: this only evaluates SWORD type attacks
        if (CurrentAttack().isMonster) {
                const Stats &attackerStats(MonsterAt(CurrentAttack().index).GetStats());
-               if (ts.TargetsEnemies()) {
+               if (ts.TargetsMonsters()) {
                        for (int i(0); i < MaxMonsters(); ++i) {
                                if (ts.IsSelected(i)) {
                                        if (MonsterAt(i).Health() > 0) {
@@ -260,7 +260,7 @@ void BattleState::CalculateDamage() {
        } else {
                const Stats &attackerStats(HeroAt(CurrentAttack().index).GetStats());
                bool hitSome(false);
-               if (ts.TargetsEnemies()) {
+               if (ts.TargetsMonsters()) {
                        for (int i(0); i < MaxMonsters(); ++i) {
                                if (ts.IsSelected(i)) {
                                        if (MonsterAt(i).Health() > 0) {
@@ -332,7 +332,7 @@ void BattleState::ApplyDamage() {
        if (attackCursor < 0) return;
        AttackChoice &ac(CurrentAttack().isMonster ? MonsterAt(CurrentAttack().index).GetAttackChoice() : HeroAt(CurrentAttack().index).GetAttackChoice());
        TargetSelection &ts(ac.Selection());
-       if (ts.TargetsEnemies()) {
+       if (ts.TargetsMonsters()) {
                for (int i(0); i < MaxMonsters(); ++i) {
                        Monster &monster(MonsterAt(i));
                        if (ts.IsBad(i)) {
index 5fbf78525d21d1318b636b5b63beb6f756c57c5c..876933061528176eebd3837b1fb50605f314fc39 100644 (file)
@@ -27,7 +27,7 @@ TargetSelection::TargetSelection(BattleState *battle, bool multiple, bool atEnem
 
 void TargetSelection::ReadMode(const common::TargetingMode &tm) {
        if (tm.TargetsEnemy()) {
-               SelectEnemies();
+               SelectMonsters();
        } else {
                SelectHeroes();
        }
@@ -39,8 +39,8 @@ void TargetSelection::ReadMode(const common::TargetingMode &tm) {
 }
 
 
-void TargetSelection::SelectEnemies() {
-       if (TargetsEnemies()) return;
+void TargetSelection::SelectMonsters() {
+       if (TargetsMonsters()) return;
        enemy = true;
        UnselectAll();
        cursor = 0;
@@ -58,23 +58,23 @@ void TargetSelection::SelectHeroes() {
 void TargetSelection::Reset() {
        UnselectAll();
        cursor = 0;
-       if (TargetsEnemies()) {
+       if (TargetsMonsters()) {
                FindNextEnemy();
        }
 }
 
 
 void TargetSelection::MoveUp() {
-       if (TargetsEnemies()) return;
+       if (TargetsMonsters()) return;
        if (cursor < 2) {
-               SelectEnemies();
+               SelectMonsters();
        } else {
                cursor -= 2;
        }
 }
 
 void TargetSelection::MoveRight() {
-       if (TargetsEnemies()) {
+       if (TargetsMonsters()) {
                cursor = (cursor + 1) % battle->MaxMonsters();
                while (!battle->MonsterPositionOccupied(cursor)) {
                        cursor = (cursor + 1) % battle->MaxMonsters();
@@ -85,7 +85,7 @@ void TargetSelection::MoveRight() {
 }
 
 void TargetSelection::MoveDown() {
-       if (TargetsEnemies()) {
+       if (TargetsMonsters()) {
                SelectHeroes();
                return;
        }
@@ -96,7 +96,7 @@ void TargetSelection::MoveDown() {
 }
 
 void TargetSelection::MoveLeft() {
-       if (TargetsEnemies()) {
+       if (TargetsMonsters()) {
                cursor = (cursor + battle->MaxMonsters() - 1) % battle->MaxMonsters();
                FindNextEnemy();
        } else {
index b57a41df26c5d3ab80bd772b876f07221185cb02..fd1d041c90fe604ea01b229be51036353a21da7d 100644 (file)
@@ -22,8 +22,8 @@ public:
        explicit TargetSelection(BattleState *battle = 0, bool multiple = false, bool atEnemy = true);
 
 public:
-       bool TargetsEnemies() const { return enemy; }
-       bool TargetsHeroes() const { return !TargetsEnemies(); }
+       bool TargetsMonsters() const { return enemy; }
+       bool TargetsHeroes() const { return !TargetsMonsters(); }
        bool IsSelected(int index) const { return index >= 0 && index < int(selected.size()) && selected[index].type != State::IGNORE; }
        bool HasSelected() const { return selection >= 0; }
        int SingleSelection() const { return selection; }
@@ -35,7 +35,7 @@ public:
 
        void ReadMode(const common::TargetingMode &);
 
-       void SelectEnemies();
+       void SelectMonsters();
        void SelectHeroes();
        void Select(int index) { selected[index].type = State::SELECTED; selection = index; }
        void Unselect(int index) { selected[index].type = State::IGNORE; }
index 44831791d2c749695cc83716d099178c6f552f67..6aae5d7401395ed3997b4c0b889440d6f280e2e6 100644 (file)
@@ -140,7 +140,7 @@ void PerformAttacks::HandleEvents(const Input &input) {
 }
 
 void PerformAttacks::AddNumberAnimations(const TargetSelection &ts) {
-       if (ts.TargetsEnemies()) {
+       if (ts.TargetsMonsters()) {
                for (int i(0); i < battle->MaxMonsters(); ++i) {
                        if (ts.IsBad(i)) {
                                numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().bigNumberSprite));
index 5c1a27a4ee76a781c4fc79ad1143495ac96bfe36..4fce8c75b5a1723fb24e50a797322e7bd7f65bc1 100644 (file)
@@ -62,7 +62,7 @@ void SelectIkari::HandleEvents(const Input &input) {
                        if (ikari->GetTargetingMode().TargetsAlly()) {
                                ac.Selection().SelectHeroes();
                        } else {
-                               ac.Selection().SelectEnemies();
+                               ac.Selection().SelectMonsters();
                        }
                        if (ikari->GetTargetingMode().TargetsAll()) {
                                ac.SetType(AttackChoice::MAGIC);
index bd09da664e204891b6a8b3aeeaf86b05e3b174db..4c197ff3c362b42e05e7099b1413c1cc9d2c5cff 100644 (file)
@@ -61,7 +61,7 @@ void SelectItem::HandleEvents(const Input &input) {
                        if (item->GetTargetingMode().TargetsAlly()) {
                                ac.Selection().SelectHeroes();
                        } else {
-                               ac.Selection().SelectEnemies();
+                               ac.Selection().SelectMonsters();
                        }
                        if (item->GetTargetingMode().TargetsAll()) {
                                ac.SetType(AttackChoice::ITEM);
index 0708196b7b0cfde37de92974785e70499e7719f6..1bc195c12223e2a7d00b95f642da72ef3a15f19c 100644 (file)
@@ -62,7 +62,7 @@ void SelectSpell::HandleEvents(const Input &input) {
                        if (spell->GetTargetingMode().TargetsAlly()) {
                                ac.Selection().SelectHeroes();
                        } else {
-                               ac.Selection().SelectEnemies();
+                               ac.Selection().SelectMonsters();
                        }
                        if (spell->GetTargetingMode().TargetsAll()) {
                                ac.SetType(AttackChoice::MAGIC);
index 591da6753972350cf1eb9f0f44041a8df2023368..37f2da9829d603405b1b546aa446659e239582a5 100644 (file)
@@ -94,7 +94,7 @@ void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector<int
        // offset the indicator by 1/8th to the right and top
        Vector<int> indicatorOffset(cursorOffset + Vector<int>(cursorIcon->Width() / 8, cursorIcon->Height() / -8));
        vector<Point<int> > positions;
-       if (selection->TargetsEnemies()) {
+       if (selection->TargetsMonsters()) {
                for (int i(0), end(battle->MaxMonsters()); i < end; ++i) {
                        positions.push_back(battle->MonsterAt(i).Position());
                }