Skip to content

Commit

Permalink
Add deiron confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
ipkpjersi committed Jan 31, 2025
1 parent 565bcb5 commit 97362ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,27 @@ public void onTalkNpc(final Player player, final Npc npc) {
}
}

final int mode = player.getAttribute("ironman_mode");
final int mode = player.getAttribute("ironman_mode_new");
if (mode == -1) return;
player.setIronMan(mode);
player.message("You have downgraded your Ironman status.");
ActionSender.sendIronManMode(player);
ActionSender.sendIronManInterface(player);
mes( "Are you sure you wish to downgrade your Ironman status?");
// Confirmation for downgrading Ironman status
final int confirmation = multi(player,
"Yes, I am sure, please downgrade my Ironman status.", // 0
"No, I changed my mind, keep my Ironman status." // 1
);

switch (confirmation) {
case 0: // Confirm downgrade
player.setIronMan(mode);
player.setAttribute("ironman_mode", mode);
player.message("You have downgraded your Ironman status.");
break;
case 1: // Cancel downgrade
default:
player.message("You have chosen to keep your current Ironman status.");
break;
}

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void handleIronmanMode(final Player player, final OptionsStruct payload)
}

player.setAttribute("ironman_delete", true);
player.setAttribute("ironman_mode", mode);
player.setAttribute("ironman_mode_new", mode);

ironManNpc.initializeTalkScript(player);
break;
Expand Down

0 comments on commit 97362ee

Please sign in to comment.