Created
September 16, 2018 21:59
-
-
Save richardbuckle/ac34863f350fa7581774549b273c15d4 to your computer and use it in GitHub Desktop.
Mission check galaxy VB version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{_ Mission report } | |
{_ Check what systems you have missions in } | |
{_ Setup allmissions function } | |
{set allmissions(system) to: | |
{set here to find(systems, system)} | |
{if here > -1: | |
{set number to systems_count[here] + 1} | |
{set systems_count to union(systems_count, [here:number])} | |
|else: | |
{set systems to cat(systems, [system])} | |
{set systems_count to cat(systems_count, [1])} | |
} | |
} | |
{if missionsCount > 0: | |
{set multi to 0} | |
You have {missionsCount} mission{if missionsCount != 1:s} to complete. | |
{if missionsCount = 1: | |
{if missions[0].destinationsystem && missions[0].destinationsystem != "": | |
It is {Occasionally(2,"located")} in the {P(missions[0].destinationsystem)} {Occasionally(2,"star")} system. | |
|else: | |
It doesn't have a designated {Occasionally(2,"star")} system. | |
} | |
|else: | |
{set systems to []} | |
{set systems_count to []} | |
{for mission in missions: | |
{if mission.status = "Active": | |
{if mission.destinationsystems: | |
{set multi to multi + 1} | |
{for destination in mission.destinationsystems: | |
{allmissions(destination.name)} | |
} | |
|elif mission.destinationsystem && mission.destinationsystem != "": | |
{allmissions(mission.destinationsystem)} | |
} | |
} | |
} | |
{if len(systems) = 0: | |
They have no designated target systems. | |
|elif len(systems) = 1: | |
They are all {Occasionally(2,"located")} in | |
{if systems[0] = "": | |
an unknown | |
|else: | |
the {P(systems[0])} | |
} | |
{Occasionally(2,"star")} system. | |
|else: | |
{if multi > 0: | |
{if multi > 1 && multi = missionsCount: All |else: {multi}} | |
of these | |
{if multi = 1: | |
is a multi-destination mission. | |
|else: | |
are multi-destination missions. | |
} | |
} | |
There {if systems_count[0] = 1: is |else: are } | |
{set cur to 0} | |
{while cur < len(systems): | |
{systems_count[cur]} | |
{if cur = 0: destination{if systems_count[0] > 1: s}} | |
{if systems[cur] = "": | |
in an unknown system | |
|else: | |
{OneOf("at","in")} {systems[cur]} | |
} | |
{set cur to cur + 1} | |
{if cur = len(systems)-1: and |elif cur < len(systems):, } | |
}. | |
} | |
} | |
|else: | |
{OneOf( | |
"You currently have no missions.", | |
"You have no missions at the moment.", | |
"You don't have any missions right now.", | |
"You have no missions right now." | |
)} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment