This is a totally free pirate-influenced, web based game (no signup needed). You will travel from town to town, and encounter many ships on the Caribbean Sea. Accumulate riches, ships and new crew members. Try to level up and be promoted!
Multiple missions should be allowed at once, and each mission can have multiple progress steps. It will be stored as JSON in game table as column ‘missions’.
Missionlib
IsMissionOpportunity: A random_int telling Main.php controller if the user should be presented with an opportunity or not. Only once per town visit, so that the user cannot just click around and trigger multiple missions. Maybe a chance in once per 30.
CreateMission: Randomized types, could be to visit places and talk to people, or to come back when certain things is valid (like giving someone 10 bottles of rum).
GetMissions: Get all missions in an array of objects.
GetMission: Get all info about the current mission (if needed)
IsMissionTaskTriggered: Check if the town and place should trigger an event. Needs to check all missions and all progress steps. Maybe not that performant. We should help the controllers at least by giving them game['mission_step_town'] and game['mission_step_place'] to avoid needing to check all missions on all places the user visits.
GUI
Have a mission label in the Inventory underneath the Title and Level. Even if there are no missions active.
When clicked upon, a special mission page will show current missions. Old missions are cleared from the database, and only viewable in the log book. I think it would be too much info for the JSON object to keep them all. Should be clear what step is the next.
JSON example
missions: [
{
progress: [
{
description: 'Please go to the my uncle in San Juan, he his an accountant at the bank there.',
town: 'sanjuan',
place: 'bank',
done: false
},
{
description: 'I know that guy. unfortionally the item has moved to Montenique. I think he is at the tavern.',
town: 'sanjuan',
place: 'bank',
done: false
},
{
description: 'Here you go, you are welcome. Go back to X and tell him hi from me.',
done: false,
town: 'sanjuan',
place: 'bank',
lastTask: true,
rewardAmount: 1000,
rewardItem: 'doubloons'
},
]
}
]
Multiple missions should be allowed at once, and each mission can have multiple progress steps. It will be stored as JSON in game table as column ‘missions’.
Missionlib
GUI
Have a mission label in the Inventory underneath the Title and Level. Even if there are no missions active.
When clicked upon, a special mission page will show current missions. Old missions are cleared from the database, and only viewable in the log book. I think it would be too much info for the JSON object to keep them all. Should be clear what step is the next.
JSON example