Пример #1
0
def use():
    body = flask.request.json
    itemId = body['itemId']

    # spend items
    userItem = dt.getUserObject('userItemList', itemId)
    userItem['quantity'] -= body['num']
    if userItem['quantity'] < 0:
        flask.abort(400, '{"errorTxt": "You don\'t have enough.","resultCode": "error","title": "Error"}')
    
    # add AP/BP
    capPoint = float('inf')
    if itemId == 'CURE_BP':
        apType = 'BTP'
        recoverPoint = dt.getUserObject('userStatusList', 'MAX_BTP')['point']
        capPoint = dt.getUserObject('userStatusList', 'MAX_BTP')['point']
    elif itemId == 'CURE_AP_50':
        apType = 'ACP'
        recoverPoint = 50
    else:
        apType = 'ACP'
        recoverPoint = dt.getUserObject('userStatusList', 'MAX_ACP')['point']

    apStatus = homu.getStatus(apType)
    apStatus['point'] = min(capPoint, apStatus['point']+recoverPoint)

    dt.setUserObject('userItemList', itemId, userItem)
    dt.setUserObject('userStatusList', apType, apStatus)

    response = {
        "resultCode": "success",
        'userItemList': [userItem],
        'userStatusList': [apStatus]
    }
    return flask.jsonify(response)
Пример #2
0
def customize():
    body = flask.request.json
    targetUserCardId = body['userCardId']
    
    targetUserCard = dt.getUserObject('userCardList', targetUserCardId)
    if targetUserCard is None:
        flask.abort(400, description='Tried to level up a card you don\'t have...')

    targetMatPos = body['target']

    # set info about chara
    targetUserCard['customized'+str(targetMatPos)] = True
    dt.setUserObject('userCardList', targetUserCardId, targetUserCard)

    # spend mats
    matId = targetUserCard['card']['cardCustomize']['giftId'+str(targetMatPos)]
    amount = targetUserCard['card']['cardCustomize']['giftNum'+str(targetMatPos)]
    
    try:
        revisedItemList = spendGift({matId: amount})
    except ValueError as e:
        flask.abort(400, description='{"errorTxt": "'+repr(e)+'","resultCode": "error","title": "Error"}')
    
    # make response
    response = {
        'resultCode': 'success',
        'userCardList': [targetUserCard],
        'userGiftList': revisedItemList
    }
    return flask.jsonify(response)
Пример #3
0
def setProtect(isProtected):
    body = flask.request.json
    userPiece = dt.getUserObject('userPieceList', body['userPieceId'])
    userPiece['protect'] = isProtected
    dt.setUserObject('userPieceList', body['userPieceId'], userPiece)
    response = {'resultCode': 'success', 'userPieceList': [userPiece]}
    return flask.jsonify(response)
Пример #4
0
def obtainItem(itemCode, amount=1):
    resultDict = {}
    if itemCode.startswith('GIFT'):
        giftId = int(itemCode.split('_')[1])
        dropNum = amount * int(
            itemCode.split('_')[-1])  # seems to be always 1, but whatever
        userGift = dt.getUserObject('userGiftList', giftId)
        userGift['quantity'] += dropNum
        resultDict['userGiftList'] = resultDict.get('userGiftList',
                                                    []) + [userGift]
        dt.setUserObject('userGiftList', giftId, userGift)
    elif itemCode.startswith('ITEM'):
        itemId = '_'.join(itemCode.split('_')[1:-1])
        dropNum = amount * int(
            itemCode.split('_')[-1])  # seems to be always 1, but whatever
        userItem = dt.getUserObject('userItemList', itemId)
        userItem['quantity'] += dropNum
        resultDict['userItemList'] = resultDict.get('userItemList',
                                                    []) + [userItem]
        dt.setUserObject('userItemList', itemId, userItem)
    elif itemCode.startswith('RICHE'):
        cc = amount * int(itemCode.split('_')[-1])
        resultDict['gameUser'] = dt.setGameUserValue(
            'riche',
            dt.getGameUserValue('riche') + cc)
    return resultDict
Пример #5
0
def spendAP(battle):
    apType, apDisplay = 'ACP', 'AP'
    if battle['battleType'] == 'ARENA':
        apType, apDisplay = 'BTP', 'BP'
        apAmount = 1
    elif battle['questBattle']['consumeType'] == 'FREE_AT_NOT_CLEAR':
        userQuestBattle = dt.getUserObject('userQuestBattleList',
                                           battle['questBattleId'])
        apAmount = battle['scenario']['cost'] if (
            'cleared' in userQuestBattle and userQuestBattle['cleared']) else 0
    else:  # TODO: this won't work for event stuff
        apAmount = battle['scenario']['cost']
        if 'consumeType' not in battle['questBattle'] or battle['questBattle'][
                'consumeType'] != 'NORMAL':
            # TODO: this is just an error log to help debug
            logger.error('Unexpected consumeType; entire battle is ' +
                         json.dumps(battle['questBattle']))
            apAmount = 0

    apStatus = homu.getStatus(apType)
    apStatus['point'] -= apAmount
    if apStatus['point'] < 0:
        flask.abort(
            400, '{"errorTxt": "Not enough ' + apDisplay +
            '.","resultCode": "error","title": "Error"}')
    dt.setUserObject('userStatusList', apType, apStatus)
    return apStatus
Пример #6
0
def save():
    body = flask.request.json

    # sometimes, when you continue to edit a team, the deckType isn't sent at all,
    # so we have to store it
    # not sure if the request ever doesn't have a deckType on the first time you edit a team
    if 'deckType' in body:
        deckType = body['deckType']
        dt.saveJson('data/user/deckType.json',{'deckType': body['deckType']})
    else:
        deckType = dt.readJson('data/user/deckType.json')['deckType']

    userDeck = dt.getUserObject('userDeckList', deckType)
    if userDeck is None:
        userDeck = {'createdAt': nowstr(), 'userId': dt.userId, 'deckType': deckType}
    
    userDeck['name'] = body['name']
    
    if 'questPositionHelper' in body.keys():
        userDeck['questPositionHelper'] = body['questPositionHelper']
    if 'episodeUserCardId' in body.keys():
        userDeck['questEpisodeUserCardId'] = body['episodeUserCardId']
    if 'formationSheetId' in body.keys():
        userDeck['formationSheetId'] = body['formationSheetId']
        
    userFormation = dt.getUserObject('userFormationSheetList', body['formationSheetId'])
    if userFormation is None:
        flask.abort(400, description='{"errorTxt": "Trying to use a nonexistent formation","resultCode": "error","title": "Error"}')

    userDeck['formationSheet'] = userFormation['formationSheet']

    keys = set(userDeck.keys())
    for key in keys:
        if key.startswith('questPositionId') or key.startswith('userCardId') or key.startswith('userPieceId'):
            del userDeck[key]        

    for i, positionId in enumerate(body['questPositionIds']):
        userDeck['questPositionId'+str(i+1)] = positionId
    
    for i, cardId in enumerate(body['userCardIds']):
        userDeck['userCardId'+str(i+1)] = cardId

    for i, pieceIdList in enumerate(body['userPieceIdLists']):
        numSlots = dt.getUserObject('userCardList', userDeck['userCardId'+str(i+1)])['revision'] + 1
        numMemoriaAssigned = 0
        for j, pieceId in enumerate(pieceIdList):
            userDeck['userPieceId0'+str(i+1)+str(j+1)] = pieceId
            numMemoriaAssigned += 1
            if numMemoriaAssigned >= numSlots:
                break

    dt.setUserObject('userDeckList', deckType, userDeck)
    gameUser = dt.setGameUserValue('deckType', deckType)
    
    return flask.jsonify({
        'resultCode': 'success',
        'userDeckList': [userDeck],
        'gameUser': gameUser
    })
Пример #7
0
def receiveReward(challenge):
    response = {}
    for reward in challenge['challenge']['rewardCodes'].split(','):
        response = dt.updateJson(response, obtainItem(reward))
    challenge['receivedAt'] = nowstr()
    dt.setUserObject('userDailyChallengeList', challenge['challengeId'],
                     challenge)
    return response
Пример #8
0
def getLive2d(charaId, live2dId, live2dItem):
    idx = int(str(charaId) + str(live2dId))
    userLive2d = dt.getUserObject('userLive2dList', idx)
    if userLive2d is None:
        userLive2d, _ = newtil.createUserLive2d(charaId, live2dId,
                                                live2dItem['description'])
        dt.setUserObject('userLive2dList', idx, userLive2d)
        return {'userLive2dList': [userLive2d]}
    return {}
Пример #9
0
def setLive2d():
    body = flask.request.json

    response = {"resultCode": "success"}
    userChara = dt.getUserObject('userCharaList', body['charaId'])
    userChara['live2dId'] = body['live2dId']
    response['userCharaList'] = [userChara]
    dt.setUserObject('userCharaList', body['charaId'], userChara)

    return flask.jsonify(response)
Пример #10
0
def getItem(itemCode, amount, item=None):
    userItem = dt.getUserObject('userItemList', itemCode)
    if userItem is None:  # assumes only backgrounds and stuff
        if item is None:
            flask.abort(500,
                        description=
                        'Item is None, but userItem doesn\'t already exist...')
        userItem, _ = newtil.createUserItem(item)
    userItem['quantity'] += amount
    dt.setUserObject('userItemList', itemCode, userItem)
    return {'userItemList': [userItem]}
Пример #11
0
def regist():
    adventureId = flask.request.json['adventureId']
    newAdventure = {
        "adventureId": adventureId,
        "createdAt": nowstr(),
        "skipped": False,
        "userId": dt.userId
    }
    dt.setUserObject('userQuestAdventureList', adventureId, newAdventure)
    return flask.jsonify({
        "userQuestAdventureList": [newAdventure]
    })
Пример #12
0
def startNewChapter(newChapterId, response):
    newChapter, exists = newtil.createUserChapter(newChapterId)
    if not exists:
        response['userChapterList'] = response.get('userChapterList',
                                                   []) + [newChapter]
        dt.setUserObject('userChapterList', newChapterId, newChapter)

    # create sections (and also battles) in new chapter
    canStart = True  # only for the first one
    for sectionId in sorted(chapterSections[newChapterId],
                            key=lambda x: x['sectionId']):
        startNewSection(sectionId, response, canStart)
        canStart = False
Пример #13
0
def getPiece(piece, isMax, num):
    newPieces = []
    for _ in range(num):
        newUserPiece, _ = newtil.createUserPiece(piece['pieceId'])
        if isMax:
            newUserPiece['level'] = userPiece.getMaxLevel(piece['rank'], 4)
            newUserPiece['lbcount'] = 4
            stats = userPiece.getStats(newUserPiece, newUserPiece['level'])
            for key in stats.keys():
                newUserPiece[key] = stats[key]
        newPieces.append(newUserPiece)
        dt.setUserObject('userPieceList', newUserPiece['id'], newUserPiece)
    return {'userPieceList': newPieces}
Пример #14
0
def obtainReward(clearReward, args):
    presentType = clearReward['presentType']
    quantity = clearReward['quantity']
    if presentType == 'DOPPEL':
        userDoppel, exists = newtil.createUserDoppel(clearReward['genericId'])
        if not exists:
            dt.setUserObject('userDoppelList', clearReward['genericId'],
                             userDoppel)
        args['userDoppelList'] = args.get('userDoppelList', []) + [userDoppel]
    elif presentType == 'GEM':  # only Iroha's gems are rewards, so no need to check missing chara
        userChara = dt.getUserObject('userCharaList', clearReward['genericId'])
        userChara['lbItemNum'] += quantity
        dt.setUserObject('userCharaList', clearReward['genericId'], userChara)
        args['userCharaList'] = args.get('userCharaList', []) + [userChara]
    elif presentType == 'ITEM':
        userItem = dt.getUserObject('userItemList', clearReward['itemId'])
        userItem['quantity'] += quantity
        dt.setUserObject('userItemList', clearReward['itemId'], userItem)
        args['userItemList'] = args.get('userItemList', []) + [userItem]
    elif presentType == 'LIVE2D':
        newLive2d, exists = newtil.createUserLive2d(clearReward['genericId'],
                                                    clearReward['genericCode'],
                                                    clearReward['displayName'])
        if not exists:
            userLive2dList = dt.readJson('data/user/userLive2dList.json')
            dt.saveJson('data/user/userLive2dList.json',
                        userLive2dList + [newLive2d])
        args['userLive2dList'] = args.get('userLive2dList', []) + [newLive2d]
    elif presentType == 'PIECE':
        args['userPieceList'] = args.get('userPieceList', [])
        for _ in range(quantity):
            newPiece = newtil.createUserMemoria(clearReward['genericId'])
            args['userPieceList'].append(newPiece)
            dt.setUserObject('userPieceList', newPiece['id'], newPiece)
    return args
Пример #15
0
def spendGift(gifts):
    # gifts is a list of (giftId, amount)
    revisedGiftList = []
    for giftId, giftNum in gifts.items():
        if giftNum < 0:
            raise ValueError('Tried to spend a negative amount of mats >:(')
        currGift = dt.getUserObject('userGiftList', giftId)
        currGift['quantity'] -= giftNum
        if currGift['quantity'] < 0:
            raise ValueError('Tried to spend more mats than they have D:')
        revisedGiftList.append(currGift)
        dt.setUserObject('userGiftList', giftId, currGift)

    return revisedGiftList
Пример #16
0
def spend(items):
    # items is a list of (itemId, amount)
    revisedItemList = []
    for itemId, amount in items.items():
        if amount < 0:
            raise ValueError('Tried to spend a negative amount of mats >:(')
        currItem = dt.getUserObject('userItemList', itemId)
        currItem['quantity'] -= amount
        if currItem['quantity'] < 0:
            raise ValueError('Tried to spend more mats than they have D:')
        dt.setUserObject('userItemList', itemId, currItem)
        revisedItemList.append(currItem)

    return revisedItemList
Пример #17
0
def setUpPity(groupId, pity=None):
    pityGroup = dt.getUserObject('userGachaGroupList', groupId)
    if pityGroup is not None:
        if pity is None:
            return pityGroup, pityGroup['count']
        else:
            pityGroup['count'] = pity
            dt.setUserObject('userGachaGroupList', groupId, pityGroup)
            return pityGroup, None

    # didn't find matching group
    newPity = newtil.createUserGachaGroup(groupId)
    dt.setUserObject('userGachaGroupList', groupId, newPity)
    return newPity, 0
Пример #18
0
def clearDaily(challengeIds):
    dailyChallenges = []
    for challengeId in challengeIds:
        dailyChallenge = dt.getUserObject('userDailyChallengeList',
                                          challengeId)
        if dailyChallenge['clearedCount'] < dailyChallenge['challenge'][
                'count']:
            dailyChallenge['clearedCount'] += 1
            if dailyChallenge['clearedCount'] >= dailyChallenge['challenge'][
                    'count']:
                dailyChallenge['clearedAt'] = nowstr()
            dt.setUserObject('userDailyChallengeList', challengeId,
                             dailyChallenge)
            dailyChallenges.append(dailyChallenge)
    return dailyChallenges
Пример #19
0
def getGift(giftId, amount):
    userGift = dt.getUserObject('userGiftList', giftId)
    if userGift is None:
        newGift = dt.masterGifts[giftId]
        newGift['rankGift'] = 'RANK_' + str(newGift['rank'])
        userGift = {
            "userId": dt.userId,
            "giftId": giftId,
            "quantity": amount,
            "createdAt": nowstr(),
            "gift": newGift
        }
    userGift['quantity'] += amount
    dt.setUserObject('userGiftList', giftId, userGift)
    return {'userGiftList': [userGift]}
Пример #20
0
def updateStatus(status, now):
    maxstatus = dt.getUserObject('userStatusList', 'MAX_' + status['statusId'])
    if maxstatus is not None and status['point'] < maxstatus['point']:
        minutesPassed = (now - datetime.strptime(
            status['checkedAt'], DATE_FORMAT)) / timedelta(minutes=1)
        recoverPoints = math.floor(status['periodicPoint'] *
                                   (minutesPassed / status['checkPeriod']))
        status['point'] = min(status['point'] + recoverPoints,
                              maxstatus['point'])

    status['checkedAt'] = now.strftime(DATE_FORMAT)
    status['createdAt'] = now.strftime(DATE_FORMAT)

    dt.setUserObject('userStatusList', status['statusId'], status)
    return status
Пример #21
0
def clearBattle(battle):
    userBattle = dt.getUserObject('userQuestBattleList',
                                  battle['questBattleId'])
    if userBattle is None: return None

    now = nowstr()
    userBattle['cleared'] = True
    if 'firstClearedAt' not in userBattle:
        userBattle['firstClearedAt'] = now
    userBattle['lastClearedAt'] = now
    userBattle['clearCount'] = userBattle.get('clearCount', 0) + 1

    dt.setUserObject('userQuestBattleList', battle['questBattleId'],
                     userBattle)
    return userBattle
Пример #22
0
def addChallengeQuests(section, response):
    challengeBattleIds = sectionChallengeBattles[section]
    if len(challengeBattleIds) == 0: return

    challengeBattles = []
    for challengeBattleId in challengeBattleIds:
        challengeBattle, exists = newtil.createUserQuestBattle(
            challengeBattleId)
        if not exists:
            challengeBattles.append(challengeBattle)
            dt.setUserObject('userQuestBattleList', challengeBattleId,
                             challengeBattle)

    response['userQuestBattleList'] = response.get('userQuestBattleList',
                                                   []) + challengeBattles
Пример #23
0
def getCard(charaNo, amount):
    userCard, userChara, userLive2ds, foundExisting = gacha.addMeguca(charaNo)

    if amount > 1:
        userChara['lbItemNum'] += amount - 1
        dt.setUserObject('userCharaList', charaNo, userChara)

    response = {'userCharaList': [userChara]}

    if not foundExisting:
        userSectionList, userQuestBattleList = gacha.addStory(charaNo)
        response['userSectionList'] = userSectionList
        response['userQuestBattleList'] = userQuestBattleList
        response['userLive2dList'] = userLive2ds
        response['userCardList'] = [userCard]

    return response
Пример #24
0
def setArchive(isArchive):
    body = flask.request.json

    resultUserPieceList = []
    for pieceId in body['archiveUserPieceIdList']:
        targetUserPiece = dt.getUserObject('userPieceList', pieceId)
        if targetUserPiece is None:
            flask.abort(400,
                        description='Tried to ' + ('' if isArchive else 'un') +
                        'archive a memoria you don\'t have...')

        targetUserPiece['archive'] = isArchive
        dt.setUserObject('userPieceList', pieceId, targetUserPiece)
        resultUserPieceList.append(targetUserPiece)

    response = {'resultCode': 'success', 'userPieceList': resultUserPieceList}
    return flask.jsonify(response)
Пример #25
0
def pruneLabyrinths(userSectionList=[], userQuestBattleList=[]):
    from util import newUserObjectUtil as newtil  # importing here to avoid circular imports

    todayIndex = min(6,
                     date.today().weekday() +
                     1)  # because Saturday and Sunday are both 6

    # delete existing sections and battles for other days
    for dayIndex in range(1, 7):
        removeSections = [
            i for i in range(len(userSectionList)) if str(
                userSectionList[i]['sectionId']).startswith(f'4000{dayIndex}')
        ]

        if dayIndex != todayIndex:
            for i in reversed(sorted(removeSections)):
                del userSectionList[i]

        # if these are today's quests and they don't exist yet, make them
        elif len(removeSections) == 0 and len(userSectionList) > 0:
            for labType in range(1, 3):
                sectionId = int(f'4000{dayIndex}{labType}')
                newSection, _ = newtil.createUserSection(sectionId)
                dt.setUserObject('userSectionList', sectionId, newSection)
                userSectionList.append(newSection)

        removeBattles = [
            i for i in range(len(userQuestBattleList))
            if str(userQuestBattleList[i]['questBattleId']).startswith(
                f'4000{dayIndex}')
        ]

        if dayIndex != todayIndex:
            for i in reversed(sorted(removeBattles)):
                del userQuestBattleList[i]

        elif len(removeBattles) == 0 and len(userQuestBattleList) > 0:
            for labType in range(1, 3):
                for j in range(1, 5):  # for each level
                    battleId = int(f'4000{dayIndex}{labType}{j}')
                    newBattle, _ = newtil.createUserQuestBattle(battleId)
                    dt.setUserObject('userQuestBattleList', battleId,
                                     newBattle)
                    userQuestBattleList.append(newBattle)

    return userSectionList, userQuestBattleList
Пример #26
0
def addPiece(pieceId):
    foundExisting = False
    for userPiece in dt.readJson('data/user/userPieceCollectionList.json'):
        foundExisting = foundExisting or (userPiece['pieceId'] == pieceId)
    
    userPiece = newtil.createUserMemoria(pieceId)
    
    if not foundExisting:
        newPieceColle = {
            "createdAt": userPiece['createdAt'],
            "maxLbCount": 0,
            "maxLevel": 1,
            "piece": userPiece['piece'],
            "pieceId": pieceId,
            "userId": dt.userId
        }
        dt.setUserObject('userPieceCollectionList', pieceId, newPieceColle)
    return userPiece, foundExisting
Пример #27
0
def compose():
    body = flask.request.json
    targetUserCardId = body['userCardId']
    
    targetUserCard = dt.getUserObject('userCardList', targetUserCardId)
    if targetUserCard is None:
        flask.abort(400, description='Tried to level up a card you don\'t have...')
    
    # figure out success type
    # (totally BS rates but whatevs)
    success = np.random.choice([1, 1.5, 2], p=[0.9, 0.08, 0.02])

    # modify meguca's level and stats
    rank = targetUserCard['card']['rank']
    origLevel = targetUserCard['level']
    
    exp = getComposeExp(targetUserCard['card']['attributeId'], body['useItem']) * success
    targetUserCard = levelUp(targetUserCard, rank, exp)
    
    dt.setUserObject('userCardList', targetUserCardId, targetUserCard)

    # spend items
    try:
        revisedItemList = spend(body['useItem'])
    except ValueError as e:
        flask.abort(400, description='{"errorTxt": "'+repr(e)+'","resultCode": "error","title": "Error"}')
    
    # modify CC
    cc = getCCAmount(rank, origLevel, body['useItem'])
    currCC = dt.getGameUserValue('riche')
    if currCC < cc:
        flask.abort(400, description='{"errorTxt": "Tried to use more cc than you have...","resultCode": "error","title": "Error"}')
    gameUser = dt.setGameUserValue('riche', currCC-cc)
    
    # make response
    response = {
        'composeEffect': success,
        'resultCode': 'success',
        'gameUser': gameUser,
        'userCardList': [targetUserCard],
        'userItemList': revisedItemList
    }
    return flask.jsonify(response)
Пример #28
0
def createUserMemoria(pieceId):
    piece = dt.masterPieces[pieceId]

    userPieceId = str(uuid1())
    userPiece = {
        "id": userPieceId,
        "userId": dt.userId,
        "pieceId": piece['pieceId'],
        "piece": piece,
        "level": 1,
        "experience": 0,
        "lbCount": 0,
        "attack": piece['attack'],
        "defense": piece['defense'],
        "hp": piece['hp'],
        "protect": False,
        "archive": False,
        "createdAt": nowstr()
    }
    dt.setUserObject('userPieceList', userPieceId, userPiece)
    return userPiece
Пример #29
0
def giveUserExp(battle):
    userExp = battle['questBattle']['exp']
    battle['exp'] = battle['questBattle']['exp']
    gameUser = dt.setGameUserValue('exp', dt.getGameUserValue('exp') + userExp)
    newStatus = []
    if gameUser['exp'] >= gameUser['totalExpForNextLevel']:
        newLevel = gameUser['level'] + 1
        dt.setGameUserValue('level', newLevel)
        dt.setGameUserValue('totalExpForCurrentLevel',
                            gameUser['totalExpForNextLevel'])

        expAdd = 0
        for i in range(0, newLevel + 1):
            expAdd += expForNextLevel[i] if i < len(expForNextLevel) else 30704

        gameUser = dt.setGameUserValue(
            'totalExpForNextLevel', gameUser['totalExpForNextLevel'] + expAdd)

        maxAP = dt.getUserObject('userStatusList', 'MAX_ACP')
        currAP = dt.getUserObject('userStatusList', 'ACP')
        maxAP['point'] += 1
        currAP['point'] += maxAP['point']

        currBP = dt.getUserObject('userStatusList', 'BTP')
        currBP['point'] = 5

        newStatus.append(maxAP)
        newStatus.append(currAP)

        dt.setUserObject('userStatusList', 'MAX_ACP', maxAP)
        dt.setUserObject('userStatusList', 'ACP', currAP)
        dt.setUserObject('userStatusList', 'BTP', currBP)
    return gameUser, newStatus
Пример #30
0
def clearLabyrinths():
    clearedSection = {
        "cleared": True,
        "clearedAt": "2020/01/01 00:00:00"
    }

    clearedBattle = {
        "cleared": True,
        "missionStatus1": "CLEARED",
        "missionStatus2": "CLEARED",
        "missionStatus3": "CLEARED",
        "rewardDone": True,
        "firstClearedAt": "2020/01/01 00:00:00",
        "lastClearedAt": "2020/01/01 00:00:00",
        "clearCount": 1,
        "maxDamage": 1,
    }

    for labType in range(1, 3):
        for day in range(1, 7):
            sectionId = int(f'4000{day}{labType}')
            section = dt.getUserObject('userSectionList', sectionId)

            if section is None: 
                section, _ = newtil.createUserSection(sectionId)

            if not section['cleared']:
                section.update(clearedSection)
                dt.setUserObject('userSectionList', sectionId, section)

            for level in range(1, 5):
                battleId = int(f'4000{day}{labType}{level}')
                battle = dt.getUserObject('userQuestBattleList', battleId)

                if battle is None:
                    battle, _ = newtil.createUserQuestBattle(battleId)

                if not battle['cleared']: 
                    battle.update(clearedBattle)
                    dt.setUserObject('userQuestBattleList', battleId, battle)