Пример #1
0
 def build(self, cd):
     d = cd.counts
     bonusrate = gen_bonusrate(d['totalcount'], d['chance'])
     if cd['chancetime'] == 1:
         chainstr = "STEALTH RUSH - {0} Bonus".format(self.ordering(d['chain']))
         color = self.rgb2int(0xff, 0xff, 0x33)
         dd = {
             'framesvg0': 'resource/orangeflame_wide.svg',
             '0': {'text': '{count} <small>OF</small> 99'.format(**d)},
             '1': {'text': bonusrate},
             '2': {'text': '{bonus} / {chance}'.format(**d)},
             '4': {'text': chainstr}
         }
         self.bulk_set_color(dd, color)
         dd['0']['color'] = self.rgb2int(0, 0, 0)
     else:
         dd = {
             'framesvg0': 'resource/blueflame_wide.svg',
             '0': {'text': '{count} / {totalcount}'.format(**d)},
             '1': {'text': bonusrate},
             '2': {'text': '{bonus} / {chance}'.format(**d)},
             '4': {'text': ' '}
         }
         if cd['isbonus'] == 1:
             dd['framesvg0'] = 'resource/orangeflame_wide.svg'
             self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0x33))
             dd['0']['color'] = self.rgb2int(0, 0, 0)
         else:
             self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0xff))
     return json.dumps(dd)
Пример #2
0
    def build(self, cd):
        dd = {
            '1': {'text': gen_bonusrate(cd.totalcount, cd.sbonus)},
            '2': {'text': '{sbonus} / {chance} / {xr}'},
        }
        color = self.rgb2int(0xff, 0xff, 0xff)

        if self.state == STATE.NORMAL:
            dd.update({
                '0': {'text': '{count} / {totalcount}'},
                '4': {'text': ''},
            })

        elif self.state == STATE.UFOZONE:
            color = self.rgb2int(0x10, 0xff, 0x10)
            dd.update({
                '0': {'text': '{count} <small>OF</small> 5'},
                '4': {'text': 'UFO-ZONE'},
            })

        elif self.state == STATE.XTRARUSH:
            color = self.rgb2int(0xff, 0xff, 0x10)
            dd.update({
                '0': {'text': '{count}<small> OF 80</small>'},
                '4': {'text': 'XTRA-RUSH - {chain} Bonus Chain'},
            })

        self.bulk_set_color(dd, color)
        self.bulk_format_text(dd, **(cd.getdict()))

        return json.dumps(dd)
Пример #3
0
    def build(self, cd):
        if cd["chain"] > 0:
            bonus_rate = gen_bonusrate(cd["chancegames"], cd["chain"])
            # vat = self.ordering(cd["chance"])
            # continue_possibilty = ((1.0 - FALLDOWN_POSSIBILITY)
            #                         ** cd["chancegames"]) * 100
            idx = len(self.bonus_history)
            if idx >= 5:
                idx = 5
            no_str = "\n".join([self.ordering(t[0]) for t in self.bonus_history[:idx]])
            cnt_str = "\n".join([str(t[1]) for t in self.bonus_history[:idx]])

            dd = {
                "framesvg0": "resource/orangeflame_wide_vb.svg",
                "0": {"text": "{count}<small> / {chancegames}</small>"},
                "1": {"text": bonus_rate},
                "2": {"text": "{bonus}<small> | {chance}</small>"},
                "3": {"text": "<small>VAT.</small>{chance} - {chain}<small> CHAIN</small>"},
                "4": {"text": no_str},
                "5": {"text": cnt_str},
            }
            self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0x33))
            dd["0"]["color"] = self.rgb2int(0, 0, 0)
        else:
            color = self.rgb2int(0xff, 0xff, 0xff)
            bonus_rate = gen_bonusrate(cd["normalgames"], cd["chance"])
            dd = {
                "framesvg0": "resource/blueflame_wide_vb.svg",
                "0": {"text": "{count}<small> / {normalgames}</small>"},
                "1": {"text": bonus_rate},
                "2": {"text": "{bonus}<small> | {chance}</small>"},
                "3": {"text": ""},
                "4": {"text": ""},
                "5": {"text": ""},
            }
            self.bulk_set_color(dd, color)
        self.bulk_format_text(dd, **cd.counts)
        return json.dumps(dd)
Пример #4
0
    def build(self, cd):
        bonusrate = gen_bonusrate(cd.totalcount, cd.chance)
        if cd.chancetime == 1:
            dd = {
                "framesvg0": "resource/orangeflame_wide.svg",
                "0": {"text": "{count}<small></small>"},
                "1": {"text": "{chain}<small><small> CHAIN</small></small>"},
                "2": {"text": "{bonus}<small> ({chance})</small>"},
                "3": {"text": "{voutput:.0f}<small><small> PTS</small></small>"},
                "4": {"text": "UFO CHANCE ({pbr}R)"},
            }

            if cd.chain > 1:
                dd["4"]["text"] = "UFO RUSH ({pbr}R)"

            #self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0x33))
            dd["0"]["color"] = self.rgb2int(0, 0, 0)
        else:
            dd = {
                "framesvg0": "resource/blueflame_wide.svg",
                "0": {"text": "{count}<small> / {totalcount}</small>"},
                "1": {"text": bonusrate},
                "2": {"text": "{bonus}<small> ({chance})</small>"},
                "3": {"text": "{voutput:.0f}<small><small> PTS</small></small>"},
                "4": {"text": "{spg:.2f}sec/G"},
            }
            self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0xff))

        if cd.isbonus == 1:
            dd["framesvg0"] = "resource/orangeflame_wide.svg"
            dd["4"]["text"] = "BONUS TIME"
            #self.bulk_set_color(dd, self.rgb2int(0xff, 0xff, 0x33))
            dd["0"]["color"] = self.rgb2int(0, 0, 0)

        self.bulk_format_text(dd, **(cd.getdict()))

        return json.dumps(dd)