-
Notifications
You must be signed in to change notification settings - Fork 183
Nixprime's auto equalize shields #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
8dbf8b0
913bb55
eb5edf6
fe7a18e
ef53a23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,7 +330,9 @@ int Normal_key_set[] = { | |
| NAV_CYCLE, | ||
|
|
||
| TOGGLE_GLIDING, | ||
| CYCLE_PRIMARY_WEAPON_SEQUENCE | ||
| CYCLE_PRIMARY_WEAPON_SEQUENCE, | ||
|
|
||
| TOGGLE_AUTO_SHIELD_EQUALIZE, | ||
| }; | ||
|
|
||
| int Dead_key_set[] = { | ||
|
|
@@ -394,6 +396,7 @@ int Critical_key_set[] = { | |
| SHIELD_XFER_RIGHT, | ||
| XFER_SHIELD, | ||
| XFER_LASER, | ||
| TOGGLE_AUTO_SHIELD_EQUALIZE, | ||
| }; | ||
|
|
||
| int Non_critical_key_set[] = { | ||
|
|
@@ -465,7 +468,7 @@ int Non_critical_key_set[] = { | |
| AUTO_PILOT_TOGGLE, | ||
| NAV_CYCLE, | ||
| TOGGLE_GLIDING, | ||
| CYCLE_PRIMARY_WEAPON_SEQUENCE | ||
| CYCLE_PRIMARY_WEAPON_SEQUENCE, | ||
| }; | ||
|
|
||
| int Ignored_keys[CCFG_MAX]; | ||
|
|
@@ -2304,11 +2307,6 @@ int button_function(int n) | |
| case CYCLE_PREV_PRIMARY: // cycle to previous primary weapon | ||
| case CYCLE_SECONDARY: // cycle to next secondary weapon | ||
| case CYCLE_NUM_MISSLES: // cycle number of missiles fired from secondary bank | ||
| case SHIELD_EQUALIZE: // equalize shield energy to all quadrants | ||
| case SHIELD_XFER_TOP: // transfer shield energy to front | ||
| case SHIELD_XFER_BOTTOM: // transfer shield energy to rear | ||
| case SHIELD_XFER_LEFT: // transfer shield energy to left | ||
| case SHIELD_XFER_RIGHT: // transfer shield energy to right | ||
| case XFER_SHIELD: // transfer energy to shield from weapons | ||
| case XFER_LASER: // transfer energy to weapons from shield | ||
| return button_function_critical(n); | ||
|
|
@@ -2327,6 +2325,18 @@ int button_function(int n) | |
| } | ||
| return 1; | ||
| break; | ||
|
|
||
| case SHIELD_EQUALIZE: // equalize shield energy to all quadrants | ||
| Player->flags &= ~PLAYER_FLAGS_AUTO_SHIELD_EQUALIZE_OVERRIDE; | ||
| return button_function_critical(n); | ||
|
|
||
| case SHIELD_XFER_TOP: // transfer shield energy to front | ||
| case SHIELD_XFER_BOTTOM: // transfer shield energy to rear | ||
| case SHIELD_XFER_LEFT: // transfer shield energy to left | ||
| case SHIELD_XFER_RIGHT: // transfer shield energy to right | ||
| Player->flags |= PLAYER_FLAGS_AUTO_SHIELD_EQUALIZE_OVERRIDE; | ||
| return button_function_critical(n); | ||
|
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -2514,6 +2524,7 @@ int button_function(int n) | |
| if (!Sel_NextNav()) | ||
| gamesnd_play_iface(SND_GENERAL_FAIL); | ||
| break; | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like an accidental whitespace insertion. |
||
| default: | ||
| keyHasBeenUsed = FALSE; | ||
| break; | ||
|
|
@@ -2805,6 +2816,17 @@ int button_function(int n) | |
| hud_escort_target_next(); | ||
| break; | ||
|
|
||
| case TOGGLE_AUTO_SHIELD_EQUALIZE: | ||
| Players[Player_num].flags ^= PLAYER_FLAGS_AUTO_SHIELD_EQUALIZE; | ||
| if (Players[Player_num].flags & PLAYER_FLAGS_AUTO_SHIELD_EQUALIZE) { | ||
| Players[Player_num].flags &= ~PLAYER_FLAGS_AUTO_SHIELD_EQUALIZE_OVERRIDE; | ||
| button_function(SHIELD_EQUALIZE); | ||
| HUD_printf(XSTR("Auto shield equalization activated", 1638)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this uses a |
||
| } else { | ||
| HUD_printf(XSTR("Auto shield equalization deactivated", 1639)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| } | ||
| break; | ||
|
|
||
| default: | ||
| keyHasBeenUsed = FALSE; | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dead code since it appears after a return.