-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsimulator.html
159 lines (139 loc) · 5.44 KB
/
simulator.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
title: Drop rates simulator
weight: 10
menu: false
---
<p class="alert alert-warning">A lot has changed since I build this tool. It’s mostly outdated now</p>
<form class="form-horizontal" name="simulator"
data-income="{{ site.data.values.daily_income }}"
data-arena-time="{{ site.data.values.arena_time }}"
data-adventure-time="{{ site.data.values.adventure_time }}"
data-refresh-cost="{{ site.data.values.refresh_cost }}"
data-token-rate="{{ site.data.values.token_rate }}"
data-adventure-drop-rate="{{ site.data.values.adventure_drop_rate }}"
data-adventure-gold-per-energy="{{ site.data.values.adventure_gold_per_energy }}"
data-adventure-energy-per-island="{{ site.data.values.adventure_energy_per_island }}"
>
<p>
Fill out the form below to see how many coins, tokens, Giggity and epic drops can you expect after a week of play.
</p>
<div class="row"><div class="col-md-6">
<div class="form-group">
<label for="arena_level" class="col-sm-6 control-label">Arena Level:</label>
<div class="col-sm-6">
<select id="arena_level" class="form-control">{% for item in site.data.values.arena_gold_per_energy %}
{% assign level = item[0] %}
{% assign label = item[1] %}
<option {% if site.data.values.defaults.arena_level == label %}selected=selected {% endif %}
value="{{ level }}">{{ label }}</option>
{% endfor %}</select>
</div>
<label for="video_bonus" class="col-sm-6 control-label">Active ads bonus:</label>
<div class="col-sm-6">
<select id="video_bonus" class="form-control">{% for item in site.data.values.ads_bonus %}
{% assign level = item[0] %}
{% assign label = item[1] %}
<option {% if site.data.values.defaults.ads_level == label %}selected=selected {% endif %}
value="{{ level }}">{{ label }}</option>
{% endfor %}</select>
</div>
<label for="guild_level" class="col-sm-6 control-label">Active guild members:</label>
<div class="col-sm-6">
<select id="guild_level" class="form-control">{% for item in site.data.values.guild_bonus %}
{% assign level = item[0] %}
{% assign label = item[1] %}
<option {% if site.data.values.defaults.guild_level == label %}selected=selected {% endif %}
value="{{ level }}">{{ label }}</option>
{% endfor %}</select>
</div>
<label for="win_rate" class="col-sm-6 control-label">Arena win rate:</label>
<div class="col-sm-6">
<select id="win_rate" class="form-control">{% for item in site.data.values.win_rates %}
{% assign level = item[0] %}
{% assign label = item[1] %}
<option {% if site.data.values.defaults.win_rate == level %}selected=selected {% endif %}
value="{{ level }}">{{ label }}</option>
{% endfor %}</select>
</div>
</div></div>
<div class="col-md-6"><div class="form-group">
<label>Max out selected heroes:</label>
<p>
<label class="checkbox-inline" style="display:none"><!-- bootstrap bug--></label>
{% for name in site.data.values.heroes %}
<label class="checkbox-inline">
<input type="checkbox" name="heroes[]" value="{{ name }}" {% if site.data.values.defaults.heroes contains name %} checked=checked{% endif %}>
{{ name }}
</label>
{% endfor %}
</div>
</div></div>
<div class="form-group text-center">
<button type="submit" class="btn btn-default">Simulate</button>
{% for item in site.data.values.crates %}
<cb-crate p="{{ item[0] }}" gold="{{ item[1].gold }}" adventure="{{ item[1].adventure }}" arena="{{ item[1].arena }}" ></cb-crate>
{% endfor %}
</div>
<div id=result class="container-fluid"></div>
<h3>The source of the data:</h3>
<dl class="dl-horizontal">
<dt>
Arena coin rewards
</dt>
<dd>
From the XML files, API and experience
</dd>
<dt>
Adventure rewards
</dt>
<dd>
XML files, experience
</dd>
<dt>
Guild coin bonus
</dt>
<dd>
It’s in the API response as well as shown on the guild tab
</dd>
<dt>
Epic drop rates
</dt>
<dd>
The drop rates are in the XML files and in the API. It’s not specified what is the chance of each
of the nine cards to drop, so I assumed it’s equal for all (1 in 9)
</dd>
<dt>
Ad Crates contents
</dt>
<dd>
It is unclear, but the API contains definitions of each possible ad crate type (from 500 gold to 2k gold)
along with a <code>p</code> value in increasing order (from <code>2%</code> to <code>100%</code>). This is
treated as an incremental probability for each type of crate. I.e. if the rarest doesn’t get selected, the next
one may be, up to the most common crate with probability of 100%.
</dd>
<dt>
Token drop rate
</dt>
<dd>
There is no mention about the token drop rate in the XML files nor in the API.
It was assumed about <code>0.75</code> points per won battle (the actual drop
rate is lower, but it’s not uncommon to receive 2, 5 or more tokens in one drop).
This value is based on a stats of few players from about 5k arena battles.
This may vary, so take it with a grain of salt.
</dd>
<dt>
Calculations
</dt>
<dd>
You can look at the values in the
<a href="https://github.com/cartoon-battle/cartoon-battle.github.io/blob/master/_data/values.yml">
<code>values.yaml</code> file
</a>
and the calculations are done using
<a href="https://github.com/cartoon-battle/cartoon-battle.github.io/blob/master/javascript/simulator.js">
javascript located in <code>simulator.js</code>
</a>
</dd>
</dl>
<script type="text/javascript" src="/javascript/simulator.js"></script>
</form>