diff options
author | Samuel Villareal | 2010-09-03 04:11:39 +0000 |
---|---|---|
committer | Samuel Villareal | 2010-09-03 04:11:39 +0000 |
commit | d1c8cb2cfed18f5c5c32347011f33a210c96ff38 (patch) | |
tree | 2d0e2e886d0dae84347e8d9a390ea77652bab403 /src/strife/g_game.c | |
parent | 1c756bd681af926fabdb99c57248e68b776e66fd (diff) | |
download | chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.tar.gz chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.tar.bz2 chocolate-doom-d1c8cb2cfed18f5c5c32347011f33a210c96ff38.zip |
+ 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
Diffstat (limited to 'src/strife/g_game.c')
-rw-r--r-- | src/strife/g_game.c | 39 |
1 files changed, 37 insertions, 2 deletions
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] |