Allow unaccepted cooperative cargo invitations to be declined or withdrawn safely

This commit is contained in:
Dev 2026-11-25 16:57:28 +01:00
commit 1669b3bc2a

View file

@ -113,7 +113,7 @@ final class QuestMenus implements Listener {
if(kind.equals("pol")&&Set.of("pol-jerboa-meat-25","pol-jerboa-meat-50").contains(text(row,"metric",""))&&!state.equals("claimed")&&!yes(row,"canClaim")&&(yes(row,"canStart")||state.equals("active")))put(screen,33,"Surrender cooked Jerboa meat","Stand near Shadout Mapes on Arrakis.\nSurrender the required genuine cooked Jerboa meat; no reuse of previous turn-ins.",Material.COOKED_RABBIT,()->meatTurnin(p,kind,branch,page,row));
if(kind.equals("pol")&&row.has("supply")&&!row.get("supply").isJsonNull()&&!state.equals("claimed")&&!yes(row,"canClaim")&&(yes(row,"canStart")||state.equals("active"))){var supply=row.getAsJsonObject("supply");put(screen,33,"Surrender mission supplies","Stand near "+text(supply,"contact","the mission contact")+".\nSurrender "+supply.get("quantity").getAsInt()+" genuine "+text(supply,"label","supplies")+".",Material.CHEST,()->supplyTurnin(p,kind,branch,page,row));}
if(kind.equals("pol")&&role!=null&&row.has("dossier")&&!row.get("dossier").isJsonNull()&&!yes(row,"canClaim")&&state.equals("active")){var dossier=row.getAsJsonObject("dossier");String next=text(dossier,"role","");put(screen,22,"Mission contact",text(dossier,"dialogue","")+"\nNext: "+next.replace('_',' '),Material.WRITABLE_BOOK,null);if(role.key().equals(next)&&!yes(dossier,"complete")){int stage=dossier.get("stage").getAsInt();if(stage<2)put(screen,33,stage==0?"Record briefing":"Record witness clue","Confirm this actual NPC interaction",Material.BOOK,()->dossierStep(p,data,role,row,stage,null));else if(dossier.has("answers")){int n=0;for(var answer:dossier.getAsJsonArray("answers")){int i=n++;put(screen,34+i,answer.getAsString(),"Submit this conclusion",Material.PAPER,()->dossierStep(p,data,role,row,stage,i));}}}}
if(kind.equals("pol")&&role!=null&&row.has("cargo")&&!row.get("cargo").isJsonNull()&&state.equals("active")&&!yes(row,"canClaim")){var cargo=row.getAsJsonObject("cargo");String phase=text(cargo,"stage",""),target=text(cargo,"role","");put(screen,22,"Assigned manifest",text(cargo,"quantity","—")+" × "+text(cargo,"item","Cargo")+"\nNext contact: "+target.replace('_',' ')+" · "+text(cargo,"server","").replace('-',' '),Material.CHEST,null);if(role.key().equals(target)&&phase.equals("seal"))put(screen,33,"Seal original cargo","Surrender the required genuine supplies into your bound parcel",Material.CHEST,()->cargoMission(p,role,row,phase));if(role.key().equals(target)&&phase.equals("pickup"))put(screen,33,"Collect sealed cargo","Receive the original company-funded parcel assigned to you",Material.CHEST,()->cargoMission(p,role,row,phase));if(role.key().equals(target)&&phase.equals("deliver")){if(yes(cargo,"routeReady"))put(screen,33,"Deliver sealed parcel","Surrender the exact original cargo after the required confirmed passage",Material.PAPER,()->cargoMission(p,role,row,phase));else put(screen,33,"Confirmed passage required","Take the assigned Guild route after sealing or collecting your parcel",Material.CLOCK,null);}if(role.key().equals(target)&&phase.equals("partner")){String partner=text(cargo,"partnerState","");if(partner.equals("choose"))put(screen,33,"Choose a mission partner","Select a player with the matching active mission and current affiliation",Material.PLAYER_HEAD,()->cargoPartners(p,data,role,row,0));else if(partner.equals("accept"))put(screen,33,"Accept cooperative assignment","Confirm the exact incoming partner assignment",Material.LIME_DYE,()->cargoPartner(p,role,row,"accept",text(cargo,"pairId","")));else put(screen,33,"Waiting for your partner","Both players must expressly accept the exact cooperative assignment",Material.CLOCK,null);}if(phase.equals("escort"))put(screen,33,"Escort the carrier","Complete your own confirmed Guild passage on the same assigned route within two minutes of your partner. The carrier delivers the parcel.",Material.COMPASS,null);if(phase.equals("wait"))put(screen,33,"Waiting for assigned carrier","The other accepted party must complete their assigned step.",Material.CLOCK,null);}
if(kind.equals("pol")&&role!=null&&row.has("cargo")&&!row.get("cargo").isJsonNull()&&state.equals("active")&&!yes(row,"canClaim")){var cargo=row.getAsJsonObject("cargo");String phase=text(cargo,"stage",""),target=text(cargo,"role","");put(screen,22,"Assigned manifest",text(cargo,"quantity","—")+" × "+text(cargo,"item","Cargo")+"\nNext contact: "+target.replace('_',' ')+" · "+text(cargo,"server","").replace('-',' '),Material.CHEST,null);if(role.key().equals(target)&&phase.equals("seal"))put(screen,33,"Seal original cargo","Surrender the required genuine supplies into your bound parcel",Material.CHEST,()->cargoMission(p,role,row,phase));if(role.key().equals(target)&&phase.equals("pickup"))put(screen,33,"Collect sealed cargo","Receive the original company-funded parcel assigned to you",Material.CHEST,()->cargoMission(p,role,row,phase));if(role.key().equals(target)&&phase.equals("deliver")){if(yes(cargo,"routeReady"))put(screen,33,"Deliver sealed parcel","Surrender the exact original cargo after the required confirmed passage",Material.PAPER,()->cargoMission(p,role,row,phase));else put(screen,33,"Confirmed passage required","Take the assigned Guild route after sealing or collecting your parcel",Material.CLOCK,null);}if(role.key().equals(target)&&phase.equals("partner")){String partner=text(cargo,"partnerState","");if(partner.equals("choose"))put(screen,33,"Choose a mission partner","Select a player with the matching active mission and current affiliation",Material.PLAYER_HEAD,()->cargoPartners(p,data,role,row,0));else if(partner.equals("accept")){put(screen,33,"Accept cooperative assignment","Confirm the exact incoming partner assignment",Material.LIME_DYE,()->cargoPartner(p,role,row,"accept",text(cargo,"pairId","")));put(screen,34,"Decline invitation","Close the unaccepted invitation without moving any cargo",Material.RED_DYE,()->cargoPartner(p,role,row,"decline",text(cargo,"pairId","")));}else{put(screen,33,"Waiting for your partner","Both players must expressly accept the exact cooperative assignment",Material.CLOCK,null);put(screen,34,"Withdraw invitation","Close the unaccepted invitation without moving any cargo",Material.RED_DYE,()->cargoPartner(p,role,row,"withdraw",text(cargo,"pairId","")));}}if(phase.equals("escort"))put(screen,33,"Escort the carrier","Complete your own confirmed Guild passage on the same assigned route within two minutes of your partner. The carrier delivers the parcel.",Material.COMPASS,null);if(phase.equals("wait"))put(screen,33,"Waiting for assigned carrier","The other accepted party must complete their assigned step.",Material.CLOCK,null);}
if(kind.equals("personal")&&(yes(row,"canStart")||Set.of("active","completed","claimed").contains(state))){
if(text(row,"id","").equals("S1-H-01"))put(screen,33,"Collect House T0 kit","Available directly from /start.\nFour Common MK 0 stillsuit pieces at half durability.\nOne Uncommon MK I wooden spice shovel.\nOne original kit per account and season.",Material.NETHERITE_CHESTPLATE,()->starter(p,kind,branch,page,row,"obtain"));
if(text(row,"id","").equals("S1-H-02")){put(screen,29,"Prepare four repair parts","Buy, craft with genuine spice or collect native 5% mob drops.\nRepair plate, Binding patch, Tool fitting, Calibration piece.\nOptional: prepare all four from the ordinary materials.",Material.IRON_INGOT,()->starter(p,kind,branch,page,row,"parts"));put(screen,33,"Surrender original kit & parts","Hand in the four original bound armour pieces\nand all four verified repair parts.\nThen claim this quest to receive the intact kit.",Material.ANVIL,()->starter(p,kind,branch,page,row,"repair"));}