7yl4r / the-oregon-trajectory

:rocket: The Oregon Trail -- in SPAAACE!
http://7yl4r.github.io/the-oregon-trajectory/
GNU Affero General Public License v3.0
17 stars 6 forks source link

add random permutations to situations #123

Closed 7yl4r closed 9 years ago

7yl4r commented 9 years ago

example situation:

  initial:{
    story: "You come across a green alien.",
    question: "What do you do?",
    choices: [
      {
        name: "Say hi.",
        next:"hello"
      },{
        name: "RUN!",
        next: (gameData) ->
            gameData.scope.$broadcast('switchToModule', 'travel-screen')
      }
    ]
  },
  hello: {
    chances:[
      {
        chance: .8,
        next: die
      },
      {
        chance: .2,
        next: waves
    ]
  },
  die: {
    story: "the alien vaporizes you",
    next: (gameData) ->
            gameData.scope.$broadcast('switchToModule', 'travel-screen')
  },
  waves:{
    story: "the alien waves, and then flys away",
    next: (gameData) ->
            gameData.scope.$broadcast('switchToModule', 'travel-screen')
  }

This will require some modification to the situation module to handle the "chances" attribute, but I think it will help expand scenario novelty significantly.