From d1c8cb2cfed18f5c5c32347011f33a210c96ff38 Mon Sep 17 00:00:00 2001 From: Samuel Villareal Date: Fri, 3 Sep 2010 04:11:39 +0000 Subject: + More button flags added to buttoncode_e + Looking/jumping implemented + Jump/look/center keys supported + Strife mouse firing bug implemented Subversion-branch: /branches/strife-branch Subversion-revision: 2003 --- src/strife/g_game.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'src/strife/g_game.c') diff --git a/src/strife/g_game.c b/src/strife/g_game.c index 7d8b08db..352e65de 100644 --- a/src/strife/g_game.c +++ b/src/strife/g_game.c @@ -170,6 +170,8 @@ fixed_t forwardmove[2] = {0x19, 0x32}; fixed_t sidemove[2] = {0x18, 0x28}; fixed_t angleturn[3] = {640, 1280, 320}; // + slow turn +int mouse_fire_countdown = 0; // villsa [STRIFE] + static int *weapon_keys[] = { &key_weapon1, &key_weapon2, @@ -364,6 +366,16 @@ void G_BuildTiccmd (ticcmd_t* cmd) cmd->consistancy = consistancy[consoleplayer][maketic%BACKUPTICS]; + + // villsa [STRIFE] + if(gamekeydown[key_lookup]) + cmd->buttons2 |= BT2_LOOKUP; + if (gamekeydown[key_lookdown]) + cmd->buttons2 |= BT2_LOOKDOWN; + if (gamekeydown[key_usehealth]) + cmd->buttons2 |= BT2_HEALTH; + + strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe] || joybuttons[joybstrafe]; @@ -377,6 +389,14 @@ void G_BuildTiccmd (ticcmd_t* cmd) || joybuttons[joybspeed]; forward = side = 0; + + // villsa [STRIFE] running causes centerview to occur + if(speed) + cmd->buttons2 |= BT2_CENTERVIEW; + + // villsa [STRIFE] disable running if low on health + if (players[consoleplayer].health <= 15) + speed = 0; // use two stage accelerative turning // on the keyboard and joystick @@ -456,10 +476,25 @@ void G_BuildTiccmd (ticcmd_t* cmd) // buttons cmd->chatchar = HU_dequeueChatChar(); + + // villsa [STRIFE] TODO - add mouse button support for jump + if(gamekeydown[key_jump] /*|| mousebuttons[mousebjump]*/) + cmd->buttons2 |= BT2_JUMP; - if (gamekeydown[key_fire] || mousebuttons[mousebfire] + // villsa [STRIFE] + if (gamekeydown[key_fire] /*|| mousebuttons[mousebfire]*/ || joybuttons[joybfire]) - cmd->buttons |= BT_ATTACK; + cmd->buttons |= BT_ATTACK; + + // villsa [STRIFE] + if(mousebuttons[mousebfire]) + { + if(mouse_fire_countdown <= 0) + cmd->buttons |= BT_ATTACK; + else + --mouse_fire_countdown; + + } if (gamekeydown[key_use] || joybuttons[joybuse] -- cgit v1.2.3