1
2
function [ cards, golden ] = createpack( trimult )
%CREATEPACK Creates a random pack according to simplified rules
% Not every pack is guaranteed one rare, but on average, the percentage of
% rares will be the same as in the game.
% Odds are compiled from http://hearthstone.gamepedia.com/Card_pack_statistics
%ncards are the number of cards of each rarity
%in the set. NOT including the tricards
%ntricards are the number of cards of each rarity of the tricard classes
%trimult is how much more likely tricards are than regular cards
%the output is a list of numbers saying which card it is.
%for example, if you have 10 commons and 5 rares, then the output could be
%[2,4,2,9,13], [0,0,0,1,0] which means you got 4 commons, one of which is
%golden, and a duplicate common, and one rare.
%the tricards come first, so if for example there were 2 common tricards,
%then the 2 would be a tricard, the 4 would not be
% Not every pack is guaranteed one rare, but on average, the percentage of
% rares will be the same as in the game.
% Odds are compiled from http://hearthstone.gamepedia.com/Card_pack_statistics
%ncards are the number of cards of each rarity
%in the set. NOT including the tricards
%ntricards are the number of cards of each rarity of the tricard classes
%trimult is how much more likely tricards are than regular cards
%the output is a list of numbers saying which card it is.
%for example, if you have 10 commons and 5 rares, then the output could be
%[2,4,2,9,13], [0,0,0,1,0] which means you got 4 commons, one of which is
%golden, and a duplicate common, and one rare.
%the tricards come first, so if for example there were 2 common tricards,
%then the 2 would be a tricard, the 4 would not be
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.