Esempio n. 1
0
    def __putCompleteData(self, model_mgr, playdata, stagemaster):

        if 0 < stagemaster.boss and BackendApi.check_event_boss_playable(
                playdata, stagemaster):
            # ボス出現.
            boss = BackendApi.get_boss(model_mgr,
                                       stagemaster.boss,
                                       using=settings.DB_READONLY)
            self.html_param['boss'] = Objects.boss(self, boss)

            self.setFromPage(Defines.FromPages.PRODUCEEVENTSCOUT,
                             stagemaster.id)
            url = UrlMaker.bosspre(stagemaster.id)
            self.html_param['url_bossbattle'] = self.makeAppLinkUrl(url)
        else:
            nextstagemaster = BackendApi.get_produceevent_next_stagemaster(
                model_mgr,
                playdata.mid,
                stagemaster,
                using=settings.DB_READONLY)
            if nextstagemaster and nextstagemaster.stage != stagemaster.stage:
                if nextstagemaster.area == stagemaster.area:
                    self.html_param['next_stage'] = nextstagemaster.name
                else:
                    self.html_param['next_area'] = nextstagemaster.areaname
                url = UrlMaker.produceevent_scoutdo(nextstagemaster.id,
                                                    playdata.confirmkey)
            else:
                url = UrlMaker.produceevent_scoutdo(stagemaster.id,
                                                    playdata.confirmkey)
            self.html_param['url_next'] = self.makeAppLinkUrl(url)
Esempio n. 2
0
 def __putCompleteData(self, model_mgr, playdata, stagemaster):
     
     if 0 < stagemaster.boss and BackendApi.check_event_boss_playable(playdata, stagemaster):
         # ボス出現.
         boss = BackendApi.get_boss(model_mgr, stagemaster.boss, using=settings.DB_READONLY)
         self.html_param['boss'] = Objects.boss(self, boss)
         
         self.setFromPage(Defines.FromPages.SCOUTEVENT, stagemaster.id)
         url = UrlMaker.bosspre(stagemaster.id)
         self.html_param['url_bossbattle'] = self.makeAppLinkUrl(url)
     else:
         nextstagemaster = BackendApi.get_event_next_stage(model_mgr, playdata.mid, stagemaster, using=settings.DB_READONLY)
         if nextstagemaster and nextstagemaster.stage != stagemaster.stage:
             if nextstagemaster.area == stagemaster.area:
                 self.html_param['next_stage'] = nextstagemaster.name
             else:
                 self.html_param['next_area'] = nextstagemaster.areaname
             url = UrlMaker.scouteventdo(nextstagemaster.id, playdata.confirmkey)
         else:
             url = UrlMaker.scouteventdo(stagemaster.id, playdata.confirmkey)
         self.html_param['url_next'] = self.makeAppLinkUrl(url)
         
         # 早期クリアボーナス.
         if stagemaster.earlybonus and playdata.result.get('earlybonus'):
             # 早期クリアボーナス.
             prizelist = BackendApi.get_prizelist(model_mgr, stagemaster.earlybonus, using=settings.DB_READONLY)
             self.html_param['earlybonus'] = BackendApi.make_prizeinfo(self, prizelist, using=settings.DB_READONLY)
Esempio n. 3
0
    def _checkBossBattleAble_PRODUCEEVENTSCOUT(self, model_mgr, using):
        v_player = self.getViewerPlayer()

        stage = self.getAreaMaster()
        if stage is None:
            return False
        eventmaster = BackendApi.get_current_produce_event_master(model_mgr,
                                                                  using=using)
        if eventmaster is None:
            return False
        playdata = BackendApi.get_produceeventstage_playdata(
            model_mgr, eventmaster.id, v_player.id, using)
        if playdata is None:
            return False

        return BackendApi.check_event_boss_playable(playdata, stage)
Esempio n. 4
0
    def process(self):

        v_player = self.getViewerPlayer()
        uid = v_player.id

        model_mgr = self.getModelMgr()

        using = settings.DB_READONLY

        # イベントマスター.
        eventmaster = self.getCurrentProduceEvent()
        mid = eventmaster.id

        # イベントスカウトのプレイ情報
        playdata = BackendApi.get_produceeventstage_playdata(model_mgr,
                                                             mid,
                                                             uid,
                                                             using=using)

        # 今いるステージ.
        stagemaster = BackendApi.get_current_produceeventstage_master(
            model_mgr, eventmaster, playdata, using=using)

        bossattack = False
        # 発生中のレイド情報.
        happeningraidset = self.getHappeningRaidSet()
        happeningset = None
        if happeningraidset:
            happeningset = happeningraidset.happening
        if happeningset:
            # レイドがある.
            if not happeningset.happening.is_end():
                bossattack = True

        # エリアボス出現
        areaboss_attack = False
        allcleared = BackendApi.check_event_boss_playable(
            playdata, stagemaster)
        boss = None
        if 0 < stagemaster.boss and allcleared:
            boss = BackendApi.get_boss(model_mgr,
                                       stagemaster.boss,
                                       using=settings.DB_READONLY)
            if boss is not None:
                areaboss_attack = True

        # エリアボス情報
        if areaboss_attack:
            # エリアボス戦へのURL
            self.html_param['areaboss'] = Objects.boss(self, boss)
            self.setFromPage(Defines.FromPages.PRODUCEEVENT, stagemaster.id)
            url = UrlMaker.bosspre(stagemaster.id)
            self.html_param['url_bossbattle'] = self.makeAppLinkUrl(url)

        # 現在のステージ情報
        obj_scout = self.makeStageObj(stagemaster,
                                      playdata,
                                      stagemaster.stage,
                                      bossattack=bossattack,
                                      areaboss_attack=areaboss_attack)
        self.__putParam('scout', obj_scout)

        # プレーヤーの情報
        self.html_param['player'] = Objects.player(self, v_player, None)

        # 宝箱の上限チェック.
        overlimit_treasure_list = BackendApi.get_treasuretype_list_overlimit(
            model_mgr, uid, using=using)
        self.__putParam('overlimit_treasure', overlimit_treasure_list)

        # スキップフラグ
        self.__putParam('flag_skip', BackendApi.get_scoutskip_flag(uid))
        # 全力探索フラグ
        self.__putParam('flag_search', BackendApi.get_scoutsearch_flag(uid))

        # 説明とランキングのリンク.
        self.putEventTopic(mid)

        self.writeHtml(eventmaster, 'scout/scout')
Esempio n. 5
0
    def process(self):

        v_player = self.getViewerPlayer()
        uid = v_player.id

        model_mgr = self.getModelMgr()

        using = settings.DB_READONLY

        # イベントマスター.
        eventmaster = self.getCurrentScoutEvent()
        mid = eventmaster.id

        # イベントプレイ情報
        playdata = BackendApi.get_event_playdata(model_mgr, mid, uid, using)

        # 今いるステージ.
        stage = BackendApi.get_current_scouteventstage_master(
            model_mgr, eventmaster, playdata, using=settings.DB_READONLY)
        stageid = stage.stage

        cardget_event = BackendApi.find_scout_event(
            playdata, Defines.ScoutEventType.GET_CARD)
        if cardget_event and not cardget_event.is_received:
            # カード獲得で離脱した.
            url = UrlMaker.scouteventresult(stage.id, playdata.alreadykey)
            self.appRedirect(self.makeAppLinkUrlRedirect(url))
            return

        # プレイ情報.
        self.__putParam('scout',
                        Objects.scoutevent_stage(self, stage, playdata))

        # ボス出現.
        bossattack = False
        allcleared = BackendApi.check_event_boss_playable(playdata, stage)
        boss = None
        if 0 < stage.boss and allcleared:
            boss = BackendApi.get_boss(model_mgr, stage.boss, using=using)
            if boss is not None:
                bossattack = True

        # ステージ情報.
        obj_stage = self.makeStageObj(stage, playdata, stageid, bossattack)
        self.__putParam('stagelist', [obj_stage])

        # ボス
        if bossattack:
            # ボス戦へのURL.
            self.__putParam('boss', Objects.boss(self, boss))
            self.setFromPage(Defines.FromPages.SCOUTEVENT, stage.id)
            url = UrlMaker.bosspre(stage.id)
            self.html_param['url_bossbattle'] = self.makeAppLinkUrl(url)

        self.html_param['player'] = Objects.player(self, v_player, None)

        self.html_param['scoutevent'] = Objects.scouteventmaster(
            self, eventmaster, None)

        # フィーバー
        self.html_param['scouteventfever'] = Objects.scoutevent_fever(playdata)

        # 説明とランキングのリンク.
        self.putEventTopic(mid, 'top')

        # カードの上限チェック.
        if v_player.cardlimit <= BackendApi.get_cardnum(
                uid, arg_model_mgr=model_mgr, using=using):
            self.__putParam('overlimit_card', True)

        # 宝箱の上限チェック.
        overlimit_treasure_list = BackendApi.get_treasuretype_list_overlimit(
            model_mgr, uid, using=using)
        self.__putParam('overlimit_treasure', overlimit_treasure_list)

        self.__putParam('flag_skip', BackendApi.get_scoutskip_flag(uid))

        config = BackendApi.get_current_scouteventconfig(
            model_mgr, using=settings.DB_READONLY)
        max_stage = config.get_stage_max()
        is_all_open = max_stage is None
        self.__putParam('is_all_open', is_all_open)

        is_all_cleared = False
        if is_all_open:
            if allcleared and not bossattack:
                stagelist_all = BackendApi.get_event_stage_by_stagenumber(
                    model_mgr, mid, using=settings.DB_READONLY)
                stagelist_all.sort(key=lambda x: x.stage, reverse=True)
                is_all_cleared = stagelist_all[0].stage <= playdata.cleared
        else:
            is_all_cleared = max_stage <= playdata.cleared
        self.__putParam('is_all_cleared', is_all_cleared)

        # 短冊情報.
        BackendApi.put_scoutevent_tanzakudata(self, uid)

        self.writeScoutEventHTML('scout', eventmaster)