summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 23:04:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 23:04:11 +0300
commitc544a5ebb53d51fa98392188d2b44dc6ec27c390 (patch)
tree030bef947a6a4a0b1c302b67013555f54834d49d /src/gamemodifiers.cpp
parenteed7ef561a9d590d507255118132676f868b1bd3 (diff)
downloadmv-c544a5ebb53d51fa98392188d2b44dc6ec27c390.tar.gz
mv-c544a5ebb53d51fa98392188d2b44dc6ec27c390.tar.bz2
mv-c544a5ebb53d51fa98392188d2b44dc6ec27c390.tar.xz
mv-c544a5ebb53d51fa98392188d2b44dc6ec27c390.zip
move "change attack type" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index 3f2650659..87dcd5aa7 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -44,6 +44,7 @@ GameModifiers::GameModifiers()
settings.attackType = config.getIntValue("attackType");
settings.quickDropCounter = config.getIntValue("quickDropCounter");
settings.pickUpType = config.getIntValue("pickUpType");
+ settings.magicAttackType = config.getIntValue("magicAttackType");
}
GameModifiers::~GameModifiers()
@@ -350,3 +351,33 @@ std::string GameModifiers::getPickUpTypeString()
return gettext(getVarItem(&pickUpTypeStrings[0],
settings.pickUpType, pickUpTypeSize));
}
+
+const unsigned magicAttackSize = 5;
+
+void GameModifiers::changeMagicAttackType(const bool forward)
+{
+ changeMode(&settings.magicAttackType, magicAttackSize, "magicAttackType",
+ &GameModifiers::getMagicAttackString, 0, true, forward);
+}
+
+static const char *const magicAttackStrings[] =
+{
+ // TRANSLATORS: magic attack in status bar
+ N_("(f) use #flar for magic attack"),
+ // TRANSLATORS: magic attack in status bar
+ N_("(c) use #chiza for magic attack"),
+ // TRANSLATORS: magic attack in status bar
+ N_("(I) use #ingrav for magic attack"),
+ // TRANSLATORS: magic attack in status bar
+ N_("(F) use #frillyar for magic attack"),
+ // TRANSLATORS: magic attack in status bar
+ N_("(U) use #upmarmu for magic attack"),
+ // TRANSLATORS: magic attack in status bar
+ N_("(?) magic attack")
+};
+
+std::string GameModifiers::getMagicAttackString()
+{
+ return gettext(getVarItem(&magicAttackStrings[0],
+ settings.magicAttackType, magicAttackSize));
+}