From: Daniel Karbach Date: Wed, 22 Aug 2012 19:49:34 +0000 (+0200) Subject: renamed TargetSelections Enemies to Monsters X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=fde7b27297882a7f033641df92e732abd137b532;p=l2e.git renamed TargetSelections Enemies to Monsters --- diff --git a/src/battle/BattleState.cpp b/src/battle/BattleState.cpp index fe821fc..3f28f5c 100644 --- a/src/battle/BattleState.cpp +++ b/src/battle/BattleState.cpp @@ -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)) { diff --git a/src/battle/TargetSelection.cpp b/src/battle/TargetSelection.cpp index 5fbf785..8769330 100644 --- a/src/battle/TargetSelection.cpp +++ b/src/battle/TargetSelection.cpp @@ -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 { diff --git a/src/battle/TargetSelection.h b/src/battle/TargetSelection.h index b57a41d..fd1d041 100644 --- a/src/battle/TargetSelection.h +++ b/src/battle/TargetSelection.h @@ -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; } diff --git a/src/battle/states/PerformAttacks.cpp b/src/battle/states/PerformAttacks.cpp index 4483179..6aae5d7 100644 --- a/src/battle/states/PerformAttacks.cpp +++ b/src/battle/states/PerformAttacks.cpp @@ -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)); diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index 5c1a27a..4fce8c7 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -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); diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index bd09da6..4c197ff 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -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); diff --git a/src/battle/states/SelectSpell.cpp b/src/battle/states/SelectSpell.cpp index 0708196..1bc195c 100644 --- a/src/battle/states/SelectSpell.cpp +++ b/src/battle/states/SelectSpell.cpp @@ -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); diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 591da67..37f2da9 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -94,7 +94,7 @@ void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector indicatorOffset(cursorOffset + Vector(cursorIcon->Width() / 8, cursorIcon->Height() / -8)); vector > positions; - if (selection->TargetsEnemies()) { + if (selection->TargetsMonsters()) { for (int i(0), end(battle->MaxMonsters()); i < end; ++i) { positions.push_back(battle->MonsterAt(i).Position()); }