mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-01 01:00:50 +01:00
Update content of files
This commit is contained in:
parent
f378a64f05
commit
b590010d08
1 changed files with 42 additions and 1 deletions
|
@ -76,7 +76,48 @@ Clients should display the correct dice animated sticker for the specified value
|
|||
}
|
||||
}</code></pre>
|
||||
<p>For each of the dice emojis, a maximum "winning" value is specified, along with the frame number at which to show the fireworks <img class="emoji" src="//telegram.org/img/emoji/40/F09F8E86.png" width="20" height="20" alt="🎆" />.<br>
|
||||
Please note that dice animated stickers should loop only once, right after being sent/received <strong>for the first time</strong>; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type. </p></div>
|
||||
Please note that dice animated stickers should loop only once, right after being sent/received <strong>for the first time</strong>; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type. </p>
|
||||
<h3><a class="anchor" href="#slot-machine" id="slot-machine" name="slot-machine"><i class="anchor-icon"></i></a>Slot machine</h3>
|
||||
<p>Slot machine <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" /> dice stickers are implemented a bit differently: the <code>value</code> isn't used to directly index the stickers array, but is instead used as follows. </p>
|
||||
<p>The <code>value</code> is composed of three 2-bit values, each indicating the animated sticker to show in the three slots (left, center, right), incremented by one. </p>
|
||||
<p>The <code>stickers</code> array is composed as follows:</p>
|
||||
<ul>
|
||||
<li>0 => Slot machine background</li>
|
||||
<li>1 => Slot machine winning background, to show after a winning spin</li>
|
||||
<li>2 => Slot machine frame&handle to play once at the beginning</li>
|
||||
<li>3 => Left slot winning 7</li>
|
||||
<li>4..7 => Left slot non-winning options</li>
|
||||
<li>8 => Left slot spinning animation</li>
|
||||
<li>9 => Center slot winning 7</li>
|
||||
<li>10..13 => Center slot non-winning options</li>
|
||||
<li>14 => Center slot spinning animation</li>
|
||||
<li>15 => Right slot winning 7</li>
|
||||
<li>16..19 => Right slot non-winning options</li>
|
||||
<li>20 => Right slot spinning animation</li>
|
||||
</ul>
|
||||
<p>How to play the animation (all involved stickers are to be directly overlaid on top of each other, no special placing is required): </p>
|
||||
<ul>
|
||||
<li>Freeze single-frame background (<code>0</code>)</li>
|
||||
<li>Play handle animation (<code>2</code>) once</li>
|
||||
<li>Play the three spinning slots animations (<code>8</code>, <code>14</code>, <code>20</code>) once</li>
|
||||
<li>Play the three slot animations once, chosen as follows<ul>
|
||||
<li>If we're in a winning <code>value == 64</code>:<ul>
|
||||
<li>Left slot: choose <code>3</code></li>
|
||||
<li>Center slot: choose <code>9</code></li>
|
||||
<li>Right slot: choose <code>15</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Otherwise, considering <code>map := [1, 2, 3, 0]</code>:<ul>
|
||||
<li>Left slot: choose <code>4 + map[(value-1) & 3]</code></li>
|
||||
<li>Center slot: choose <code>10 + map[((value-1) >> 2) & 3]</code></li>
|
||||
<li>Right slot: choose <code>16 + map[((value-1) >> 4) & 3]</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If we're in a winning <code>value=64</code>, replace the background (<code>0</code>) with <code>1</code>.</li>
|
||||
</ul>
|
||||
<p>Example implementation: <a href="https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/history/view/media/history_view_slot_machine.cpp">tdesktop</a>.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue