I’ve had an idea for a settlement management game, and was wondering how to approach some of the coding.
If you’ve written anything similar, or just happen to be awesome at coding, would you mind letting me know the best way of writing the following?
- You control a settlement of 100 people: 20 warriors, 20 hunters and 60 villagers. You can assign these people to activities each week. Once people have been assigned to an activity, they can’t be assigned to anything else that week.
- This week, there’s a mission to rescue some farmers who are under attack from goblins. If the player wants to do it, then they need to send between 10 and 40 people. For example, the player might choose to send 10 warriors, 5 hunters and 3 villagers. Those people won’t be available for any other activities this week.
- The player also has the option of leading the mission. If they do, then they can’t do anything else that week.
- If you send less than 20 people on the mission then the goblins attack them.
- You need a total combat strength of 40 to beat the goblins, or the mission fails. Each Warrior has a combat strength of 3, each Hunter has a combat strength of 2, and each Villager has a combat strength of 1. The player also adds their own Combat stat to their side’s combat strength of they led the mission.
- If you lose the combat, then each person you’ve sent has a 10% chance of dying. They’re removed from the settlement population, and aren’t available for future missions.
- If you win the combat then each person you’ve sent has a 5% chance of dying.
- If you win the combat then each Villager you’ve sent has a 10% chance of levelling up and becoming a Warrior instead.
- If the mission succeeds then you get another 10 Villagers, who are available to be deployed for missions from the next week onwards.