{"action":"created","issue":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/421","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/421/labels{/name}","comments_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/421/comments","events_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/421/events","html_url":"https://github.com/Cardshifter/Cardshifter/issues/421","id":111696056,"number":421,"title":"Weights for pick n atRandom","user":{"login":"jacwah","id":3816754,"avatar_url":"https://avatars.githubusercontent.com/u/3816754?v=3","gravatar_id":"","url":"https://api.github.com/users/jacwah","html_url":"https://github.com/jacwah","followers_url":"https://api.github.com/users/jacwah/followers","following_url":"https://api.github.com/users/jacwah/following{/other_user}","gists_url":"https://api.github.com/users/jacwah/gists{/gist_id}","starred_url":"https://api.github.com/users/jacwah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacwah/subscriptions","organizations_url":"https://api.github.com/users/jacwah/orgs","repos_url":"https://api.github.com/users/jacwah/repos","events_url":"https://api.github.com/users/jacwah/events{/privacy}","received_events_url":"https://api.github.com/users/jacwah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/groovy-trigger","name":"groovy-trigger","color":"c7def8"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/moddability","name":"moddability","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T20:00:53Z","updated_at":"2015-10-15T20:59:11Z","closed_at":null,"body":"There are currently some cards that have duplicated closures given to `atRandom`. This is a way to adjust the weights of the options given.\r\n\r\n    pick 1 atRandom (\r\n        { doNothing() },\r\n        { doNothing() },\r\n        { summon 1 of 'Earth Totem' to 'you' zone 'Battlefield' },\r\n        { summon 1 of 'Tree Totem' to 'you' zone 'Battlefield' },\r\n        { summon 1 of 'Burning Totem' to 'you' zone 'Battlefield' }\r\n    )\r\n\r\nInstead of doing this, there could be an optional argument specifying the weight of the option. The weight would be relative to the number of options: 1 would be the default, and 2 would be equivalent to writing the same option out twice.\r\n\r\nProposed syntax:\r\n\r\n    pick 1 atRandom (\r\n        2 { doNothing() },\r\n        { summon 1 of 'Earth Totem' to 'you' zone 'Battlefield' },\r\n        { summon 1 of 'Tree Totem' to 'you' zone 'Battlefield' },\r\n        { summon 1 of 'Burning Totem' to 'you' zone 'Battlefield' }\r\n    )\r\n\r\nI think this syntax can be achieved by adjusting the integer meta class."},"comment":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/comments/148519682","html_url":"https://github.com/Cardshifter/Cardshifter/issues/421#issuecomment-148519682","issue_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/421","id":148519682,"user":{"login":"Phrancis","id":8539648,"avatar_url":"https://avatars.githubusercontent.com/u/8539648?v=3","gravatar_id":"","url":"https://api.github.com/users/Phrancis","html_url":"https://github.com/Phrancis","followers_url":"https://api.github.com/users/Phrancis/followers","following_url":"https://api.github.com/users/Phrancis/following{/other_user}","gists_url":"https://api.github.com/users/Phrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/Phrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phrancis/subscriptions","organizations_url":"https://api.github.com/users/Phrancis/orgs","repos_url":"https://api.github.com/users/Phrancis/repos","events_url":"https://api.github.com/users/Phrancis/events{/privacy}","received_events_url":"https://api.github.com/users/Phrancis/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T20:59:11Z","updated_at":"2015-10-15T20:59:11Z","body":"Could we perhaps do something along the line of `{ 2 of doNothing() }` or `{ doNothing() times 2 }`?"}}