Skip to content

Commit

Permalink
Allowing all staffs to re-apply but some do not use last target
Browse files Browse the repository at this point in the history
  • Loading branch information
flend committed Apr 25, 2020
1 parent 0582913 commit 4cad4a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/brogue/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -3690,7 +3690,7 @@ void printHelpScreen() {
"hjklyubn, arrow keys, or numpad ****move or attack (control or shift to run)",
"",
" a/e/r/t/d/c/R ****apply/equip/remove/throw/drop/call/relabel an item",
" T, A ****re-throw / re-apply last item at last monster",
" T/A ****re-throw last item / re-apply last staff at last monster",
"i, right-click ****view inventory",
" D ****list discovered items",
"",
Expand Down
12 changes: 11 additions & 1 deletion src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -5963,6 +5963,16 @@ boolean playerCancelsBlinking(const short originLoc[2], const short targetLoc[2]
}

boolean staffOrWandSupportsAutoApply(item *theItem) {
switch (theItem->category) {
case WAND:
return false;
case STAFF:
return true;
}
return true;
}

boolean staffOrWandSupportsAutoApplyingOnLastTarget(item *theItem) {
switch (theItem->category) {
case WAND:
return false;
Expand Down Expand Up @@ -6045,7 +6055,7 @@ boolean useStaffOrWand(item *theItem, boolean autoApply, boolean *commandsRecord
originLoc[0] = player.xLoc;
originLoc[1] = player.yLoc;

if (autoApply && staffOrWandSupportsAutoApply(theItem) && creatureIsTargetable(rogue.lastTarget)) {
if (autoApply && staffOrWandSupportsAutoApplyingOnLastTarget(theItem) && creatureIsTargetable(rogue.lastTarget)) {
confirmedTarget = true;
zapTarget[0] = rogue.lastTarget->xLoc;
zapTarget[1] = rogue.lastTarget->yLoc;
Expand Down

0 comments on commit 4cad4a2

Please sign in to comment.