From 853160550b6ffa4b2f30cd1dd46b074e55d4fbeb Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 28 Nov 2026 07:55:30 +0100 Subject: [PATCH] Read and record the Imperial Citizen briefing from chat --- .../java/com/dunerealms/gui/QuestMenus.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java index 7760b6cc..6585e4d4 100644 --- a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java +++ b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java @@ -44,9 +44,9 @@ final class QuestMenus implements Listener { boolean list=verb.equals("list"); boolean roleStep=Set.of("dossier","cargo","partner").contains(verb); boolean nativeStep=roleStep||Set.of("research","meat","supply","refine").contains(verb); - if((roleStep?args.length<3||args.length>5:args.length!=(list?2:3))||!nativeStep&&!Set.of("list","show","start","claim").contains(verb)|| + if((roleStep?args.length<3||args.length>5:args.length!=(list?2:3))||!nativeStep&&!Set.of("list","show","start","claim","briefing").contains(verb)|| !Set.of("personal","pol").contains(args[1].toLowerCase(Locale.ROOT))){ - player.sendMessage("Use /missions list or /missions . POL steps: /missions pol ."); + player.sendMessage("Use /missions list or /missions . POL steps: /missions pol ."); return; } String kind=args[1].toLowerCase(Locale.ROOT); @@ -62,10 +62,19 @@ final class QuestMenus implements Listener { String state=text(row,"state",""); if(roleStep){roleMissionCommand(player,kind,data,row,verb,Arrays.copyOfRange(args,3,args.length));return;} if(nativeStep){nativeMissionStep(player,kind,row,verb);return;} + if(verb.equals("briefing")){ + if(state.equals("active")&&!yes(row,"canClaim")&&text(row,"metric","").equals("citizen-introduction"))recordCitizenBriefing(player); + else player.sendMessage("This mission has no briefing to record."); + return; + } if(verb.equals("show")){ player.sendMessage(id+" · "+text(row,"title","Mission")+" · "+state); player.sendMessage(text(row,"objective","Complete the verified objective.")); player.sendMessage("Progress: "+text(row,"progress","0")+" / "+text(row,"target","0")); + if(state.equals("active")&&!yes(row,"canClaim")&&text(row,"metric","").equals("citizen-introduction")){ + player.sendMessage(CITIZEN_BRIEFING); + player.sendMessage("Record it with /missions briefing "+kind+" "+id+"."); + } }else if(verb.equals("claim")&&yes(row,"canClaim")|| verb.equals("start")&&yes(row,"canStart")&&!yes(row,"canClaim")&&!Set.of("active","completed","claimed").contains(state)&& (!row.has("cooldownUntil")||row.get("cooldownUntil").isJsonNull()||row.get("cooldownUntil").getAsLong()<=System.currentTimeMillis())){ @@ -356,11 +365,19 @@ final class QuestMenus implements Listener { private void cargoPartner(Player p,PolQuestNpc.Role role,JsonObject row,String phase,String id){cargoPartner(p,role,row,phase,id,true);} private void cargoPartner(Player p,PolQuestNpc.Role role,JsonObject row,String phase,String id,boolean reopen){try{var input=new JsonObject();input.addProperty("action","cargo_partner");input.addProperty("kind","pol");input.addProperty("definitionId",text(row,"id",""));input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("confirmed",true);input.addProperty("npcRole",role.key());input.addProperty("npcUuid",bridge.questCharacterNpc(p,role.key()).toString());input.addProperty("phase",phase);input.addProperty(phase.equals("offer")?"partnerId":"pairId",id);request(p,input,result->{if(reopen)load(p,"pol",text(row,"branch",""),text(row,"id",""),0);else p.sendMessage("Cooperative assignment updated.");});}catch(Exception unavailable){p.sendMessage("Meet Edric with your current cooperative mission.");}} private void starter(Player p,String kind,String branch,int page,JsonObject row,String operation){try{var input=new JsonObject();input.addProperty("action","prepare_starter");input.addProperty("kind","personal");input.addProperty("definitionId",text(row,"id",""));input.addProperty("operation",operation);input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("access","journal");input.addProperty("confirmed",true);request(p,input,permit->{try{bridge.starterKit(p,permit);load(p,kind,branch,text(row,"id",""),page);}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Your equipment exchange remains available. Reopen the quest.":failure.getMessage(),NamedTextColor.RED));}});}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Open /start in Survival or Adventure mode.":failure.getMessage(),NamedTextColor.RED));}} + private static final String CITIZEN_BRIEFING="Your House determines normal travel authority.\nGuild travel uses boarding windows and your central bank.\nClan and company actions follow current deeds.\nBlue missions require ingame actions or item turn-ins.\nWebsite missions use your linked website account.\nRead your Mentat Report for current news and duties."; + private void recordCitizenBriefing(Player player){ + try{ + bridge.citizenIntroduction(player); + player.closeInventory(); + player.sendMessage(Component.text("Citizen briefing submitted. Check the mission in a few seconds to claim its verified reward.",NamedTextColor.GREEN)); + }catch(Exception unavailable){player.sendMessage("The briefing could not be recorded. Try again while the mission is active.");} + } private void introduction(Player p,String kind,JsonObject data,String branch,int page,JsonObject row){ var screen=panel(p,"Imperial Citizen briefing"); - put(screen,13,"Welcome, Imperial Citizen","Your House determines normal travel authority.\nGuild travel uses boarding windows and your central bank.\nClan and company actions follow current deeds.\nBlue missions require ingame actions or item turn-ins.\nWebsite missions use your linked website account.\nRead your Mentat Report for current news and duties.",Material.WRITTEN_BOOK,null); - put(screen,30,"I understand","Confirm that you have read this briefing",Material.LIME_DYE,()->{try{bridge.citizenIntroduction(p);p.closeInventory();p.sendMessage(Component.text("Citizen briefing submitted. Refresh your mission journal in a few seconds to claim its verified reward.",NamedTextColor.GREEN));}catch(Exception unavailable){p.sendMessage("The briefing could not be recorded. Please reopen the journal.");}}); - put(screen,32,"Back","Return without confirming",Material.ARROW,()->details(p,kind,data,branch,page,row));show(p,screen); + put(screen,13,"Welcome, Imperial Citizen",CITIZEN_BRIEFING,Material.WRITTEN_BOOK,null); + put(screen,30,"Record briefing","Record that you have read the Imperial Citizen briefing",Material.LIME_DYE,()->recordCitizenBriefing(p)); + put(screen,32,"Back","Return to the mission",Material.ARROW,()->details(p,kind,data,branch,page,row));show(p,screen); } private void act(Player p,String kind,String branch,int page,JsonObject row,String action){act(p,kind,branch,page,row,action,true);} private void act(Player p,String kind,String branch,int page,JsonObject row,String action,boolean reopen){var input=new JsonObject();input.addProperty("action",action);input.addProperty("kind",kind);input.addProperty("definitionId",text(row,"id",""));input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("confirmed",true);if(action.equals("claim"))input.add("revision",row.get("revision"));request(p,input,result->{p.sendMessage(Component.text(action.equals("claim")?"Verified quest reward recorded.":"Mission accepted.",NamedTextColor.GREEN));if(action.equals("claim")&&text(row,"id","").equals("S1-H-02"))try{bridge.refreshKits(p);}catch(Exception unavailable){p.sendMessage("Your intact replacement remains queued for delivery.");}if(!reopen)return;var role=roleScope.get(p.getUniqueId());if(action.equals("claim")&&role!=null&&kind.equals("pol")){var read=new JsonObject();read.addProperty("action","read");read.addProperty("kind","pol");read.addProperty("npcRole",role.key());request(p,read,data->roleThanks(p,data,role,row));return;}load(p,kind,branch,text(row,"id",""),page);});}