Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missions #2

Open
tonygustafsson opened this issue Aug 2, 2020 · 0 comments
Open

Add missions #2

tonygustafsson opened this issue Aug 2, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@tonygustafsson
Copy link
Owner

tonygustafsson commented Aug 2, 2020

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'
            },
        ]
    }
]
@tonygustafsson tonygustafsson added the enhancement New feature or request label Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant