commit 22f39b5d40281dd989dfd1fc067447fa2621c2a6
Author: Julia Nechaevskaya <julia.nechaevskaya@live.com>
AuthorDate: Wed Jan 8 22:43:53 2020 +0300
Commit: Julia Nechaevskaya <julia.nechaevskaya@live.com>
CommitDate: Wed Jan 8 22:43:53 2020 +0300
Heretic: artifacts can be binded to own keys
By the request of @fabiangreffrath, see: https://github.com/JNechaevsky/russian-doom/commit/d0356943a48c48c7db36a674bd24a908340999c0#commitcomment-36712800
---
src/heretic/g_game.c | 46 +++++++++++++++++++++++++++++++++
src/m_config.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/m_controls.c | 20 +++++++++++++++
src/m_controls.h | 10 ++++++++
src/setup/keyboard.c | 18 +++++++++++++
5 files changed, 166 insertions(+)
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index a2a0964e..fa52f3bb 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -453,6 +453,52 @@ void G_BuildTiccmd(ticcmd_t *cmd, int maketic)
gamekeydown[127] = false;
cmd->arti = arti_tomeofpower;
}
+ if (gamekeydown[key_arti_quartz] && !cmd->arti
+ && (players[consoleplayer].mo->health < MAXHEALTH))
+ {
+ gamekeydown[key_arti_quartz] = false;
+ cmd->arti = arti_health;
+ }
+ else if (gamekeydown[key_arti_urn] && !cmd->arti)
+ {
+ gamekeydown[key_arti_urn] = false;
+ cmd->arti = arti_superhealth;
+ }
+ else if (gamekeydown[key_arti_bomb] && !cmd->arti)
+ {
+ gamekeydown[key_arti_bomb] = false;
+ cmd->arti = arti_firebomb;
+ }
+ else if (gamekeydown[key_arti_tome] && !cmd->arti)
+ {
+ gamekeydown[key_arti_tome] = false;
+ cmd->arti = arti_tomeofpower;
+ }
+ else if (gamekeydown[key_arti_ring] && !cmd->arti)
+ {
+ gamekeydown[key_arti_ring] = false;
+ cmd->arti = arti_invulnerability;
+ }
+ else if (gamekeydown[key_arti_chaosdevice] && !cmd->arti)
+ {
+ gamekeydown[key_arti_chaosdevice] = false;
+ cmd->arti = arti_teleport;
+ }
+ else if (gamekeydown[key_arti_shadowsphere] && !cmd->arti)
+ {
+ gamekeydown[key_arti_shadowsphere] = false;
+ cmd->arti = arti_invisibility;
+ }
+ else if (gamekeydown[key_arti_wings] && !cmd->arti)
+ {
+ gamekeydown[key_arti_wings] = false;
+ cmd->arti = arti_fly;
+ }
+ else if (gamekeydown[key_arti_torch] && !cmd->arti)
+ {
+ gamekeydown[key_arti_torch] = false;
+ cmd->arti = arti_torch;
+ }
//
// buttons
diff --git a/src/m_config.c b/src/m_config.c
index c88cd274..9d8cd47a 100644
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -1523,6 +1523,78 @@ static default_t extra_defaults_list[] =
CONFIG_VARIABLE_KEY(key_nextweapon),
+ //!
+ // @game heretic
+ //
+ // Key to use "quartz flask" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_quartz),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "mystic urn" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_urn),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "timebomb of the ancients" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_bomb),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "tome of power" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_tome),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "ring of invincibility" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_ring),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "chaos device" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_chaosdevice),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "shadowsphere" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_shadowsphere),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "wings of wrath" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_wings),
+
+ //!
+ // @game heretic
+ //
+ // Key to use "torch" artifact.
+ //
+
+ CONFIG_VARIABLE_KEY(key_arti_torch),
+
//!
// @game hexen
//
diff --git a/src/m_controls.c b/src/m_controls.c
index 7225647c..caf2ed7c 100644
--- a/src/m_controls.c
+++ b/src/m_controls.c
@@ -54,6 +54,16 @@ int key_invleft = '[';
int key_invright = ']';
int key_useartifact = KEY_ENTER;
+int key_arti_quartz = 0;
+int key_arti_urn = 0;
+int key_arti_bomb = 0;
+int key_arti_tome = 0;
+int key_arti_ring = 0;
+int key_arti_chaosdevice = 0;
+int key_arti_shadowsphere = 0;
+int key_arti_wings = 0;
+int key_arti_torch = 0;
+
//
// Hexen key controls
//
@@ -254,6 +264,16 @@ void M_BindHereticControls(void)
M_BindIntVariable("key_invleft", &key_invleft);
M_BindIntVariable("key_invright", &key_invright);
M_BindIntVariable("key_useartifact", &key_useartifact);
+
+ M_BindIntVariable("key_arti_quartz", &key_arti_quartz);
+ M_BindIntVariable("key_arti_urn", &key_arti_urn);
+ M_BindIntVariable("key_arti_bomb", &key_arti_bomb);
+ M_BindIntVariable("key_arti_tome", &key_arti_tome);
+ M_BindIntVariable("key_arti_ring", &key_arti_ring);
+ M_BindIntVariable("key_arti_chaosdevice", &key_arti_chaosdevice);
+ M_BindIntVariable("key_arti_shadowsphere", &key_arti_shadowsphere);
+ M_BindIntVariable("key_arti_wings", &key_arti_wings);
+ M_BindIntVariable("key_arti_torch", &key_arti_torch);
}
void M_BindHexenControls(void)
diff --git a/src/m_controls.h b/src/m_controls.h
index 5d12f96e..f0da1351 100644
--- a/src/m_controls.h
+++ b/src/m_controls.h
@@ -67,6 +67,16 @@ extern int key_weapon6;
extern int key_weapon7;
extern int key_weapon8;
+extern int key_arti_quartz;
+extern int key_arti_urn;
+extern int key_arti_bomb;
+extern int key_arti_tome;
+extern int key_arti_ring;
+extern int key_arti_chaosdevice;
+extern int key_arti_shadowsphere;
+extern int key_arti_wings;
+extern int key_arti_torch;
+
extern int key_arti_all;
extern int key_arti_health;
extern int key_arti_poisonbag;
diff --git a/src/setup/keyboard.c b/src/setup/keyboard.c
index 80a06278..8c8602e6 100644
--- a/src/setup/keyboard.c
+++ b/src/setup/keyboard.c
@@ -45,6 +45,9 @@ static int *controls[] = { &key_left, &key_right, &key_up, &key_down,
&key_weapon1, &key_weapon2, &key_weapon3,
&key_weapon4, &key_weapon5, &key_weapon6,
&key_weapon7, &key_weapon8,
+ &key_arti_quartz, &key_arti_urn, &key_arti_bomb,
+ &key_arti_tome, &key_arti_ring, &key_arti_chaosdevice,
+ &key_arti_shadowsphere, &key_arti_wings, &key_arti_torch,
&key_arti_all, &key_arti_health, &key_arti_poisonbag,
&key_arti_blastradius, &key_arti_teleport,
&key_arti_teleportother, &key_arti_egg,
@@ -240,6 +243,21 @@ static void ConfigExtraKeys(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
AddKeyControl(table, "Use artifact", &key_useartifact);
}
+ if (gamemission == heretic)
+ {
+ AddSectionLabel(table, "Artifacts", true);
+
+ AddKeyControl(table, "Quartz Flask", &key_arti_quartz);
+ AddKeyControl(table, "Mystic Urn", &key_arti_urn);
+ AddKeyControl(table, "Timebomb", &key_arti_bomb);
+ AddKeyControl(table, "Tome of Power", &key_arti_tome);
+ AddKeyControl(table, "Ring of Invincibility ", &key_arti_ring);
+ AddKeyControl(table, "Chaos Device", &key_arti_chaosdevice);
+ AddKeyControl(table, "Shadowsphere", &key_arti_shadowsphere);
+ AddKeyControl(table, "Wings of Wrath", &key_arti_wings);
+ AddKeyControl(table, "Torch", &key_arti_torch);
+ }
+
if (gamemission == hexen)
{
AddSectionLabel(table, "Artifacts", true);