자유게시판

  • function.rpy

    페이지 정보

    profile_image
    작성자천사 조회 2,724회 작성일 2022-04-10 00:02:52 댓글 0

    본문

    init python:
        import time
        from hashlib import sha256
    
        def VersionCheck():
            global g_version
            if g_version == "null":
                g_version = config.version
            return True
    
    
        def Encryption( int_num ):
            if 999999 < 1:
                if not IsTest():
                    renpy.show_screen("security_warning")
                    return sha256(str(0)).hexdigest()
    
            return sha256(str(int_num)).hexdigest()
    
        def CheckEncryption():
            global g_gold, m_encryption
            if m_encryption == Encryption(g_gold):
                return True
    
    
        def SetEncryption( int_num ):
            global m_encryption
            m_encryption = Encryption(int_num)
    
        def PutGold(gold):
            global g_gold
    
            if CheckEncryption():
                renpy.hide_screen("put_gold_screen")
                renpy.show_screen("put_gold_screen", add_gold = gold)
    
                renpy.sound.play("audio/effect/getitem.wav")
                g_gold = g_gold + gold
                SetEncryption(g_gold)
    
                return True
            else:
                g_gold = 0
                SetEncryption(0)
                return True
    
    
        def SubGold(gold):
            global g_gold
    
            if g_gold < gold:
                return False
            else:
                return ForceSubGold(gold)
    
    
        def ForceSubGold(gold):
            global g_gold
            if CheckEncryption():
                renpy.hide_screen("put_gold_screen")
                renpy.show_screen("put_gold_screen", add_gold = -gold)
                close_screen_delay("put_gold_screen", 58)
    
                renpy.sound.play("audio/effect/buy.wav")
                g_gold = g_gold - gold
                SetEncryption(g_gold)
                return True
            else:
                g_gold = 0
                SetEncryption(0)
                return False
    
    
        def CheckGold(gold):
            global g_gold
            if g_gold < gold:
                return False
            else:
                if CheckEncryption():
                    return True
                else:
                    g_gold = 0
                    SetEncryption(0)
                    return False
    
        def close_screen_delay(screen_name, delay_time):
            global g_close_screen_delay
            g_close_screen_delay = delay_time
            renpy.show_screen("close_screen_delay", screen_name = "put_gold_screen")
    
        def close_screen_delay_l(screen_name):
            renpy.hide_screen(screen_name)
            renpy.hide_screen("close_screen_delay")
    
        def SubCard(card):
            global g_card
            if g_card < card:
                return False
            else:
                g_card = g_card - card
                return True
    
        def GetItem(pKey):
            for item in g_InventoryItem:
                if item.GetKey() == pKey:
                    return item
            return None
    
        def GetItemCount(pKey):
            for item in g_InventoryItem:
                if item.GetKey() == pKey:
                    return item.count
            return 0
    
        def IsHaveItem(pKey, count):
            for item in g_InventoryItem:
                if item.GetKey() == pKey:
                    if item.count >= count:
                        return True
            return False
    
        def PutItem(pKey, count):
            global g_InventoryItem, g_switch_put_item_screen
    
            if 999999 < 1:
                if not IsTest():
                    renpy.show_screen("security_warning")
                    return False
    
            renpy.sound.play( "audio/effect/getitem.wav")
    
            item = GetItem(pKey)
            if item:
                item.Add(count)
            else:
                g_InventoryItem.append(ItemData(pKey))
                g_InventoryItem[-1].Add(count)
    
            if g_switch_put_item_screen == 1:
                renpy.hide_screen(  "put_item_screen" )
                renpy.show_screen(  "put_item_screen" , pKey = pKey, count = count)
                g_switch_put_item_screen = 2
            else:
                renpy.hide_screen(  "put_item_screen2" )
                renpy.show_screen(  "put_item_screen2" , pKey = pKey, count = count)
                g_switch_put_item_screen = 1
    
    
        def SubItem(pKey, count):
            global g_InventoryItem
            for i in range(len(g_InventoryItem)):
                if g_InventoryItem[i].pKey == pKey:
                    if g_InventoryItem[i].count - count <= 0:
                        g_InventoryItem.remove(g_InventoryItem[i])
                    else:
                        g_InventoryItem[i].count = g_InventoryItem[i].count - count
                    break
    
            renpy.hide_screen(  "sub_item_screen" )
            renpy.show_screen(  "sub_item_screen" , pKey = pKey)
    
    
        def GetHavePicture(pKey, count):
            for item in g_InventoryPicture:
                if item.GetKey() == pKey:
                    if item.count >= count:
                        return item
            return None
    
        def IsHavePicture(pKey):
            count= 1
            for item in g_InventoryPicture:
                if item.GetKey() == pKey:
                    if item.count >= count:
                        return True
            return False
    
        def PutPicture(pKey):
            global g_InventoryPicture
            count= 1
    
            renpy.sound.play( "audio/effect/getitem.wav")
    
            picture = GetHavePicture(pKey, 1)
            if picture:
                picture.Add(count)
            else:
                g_InventoryPicture.append(PictureData(pKey))
                g_InventoryPicture[-1].Add(count)
    
            renpy.hide_screen(  "put_picture_screen" )
            renpy.show_screen(  "put_picture_screen" , pKey = pKey)
    
    
        def SubPicture(pKey, count):
            global g_InventoryPicture
            count = 1
            for i in range(len(g_InventoryPicture)):
                if g_InventoryPicture[i].pKey == pKey:
                    if g_InventoryPicture[i].count - count <= 0:
                        g_InventoryPicture.remove(g_InventoryPicture[i])
                    else:
                        g_InventoryPicture[i].count = g_InventoryPicture[i].count - count
                    break
    
            renpy.hide_screen(  "sub_picture_screen" )
            renpy.show_screen(  "sub_picture_screen" , pKey = pKey)
    
    
    
    
        def GetHaveBook(pKey, count):
            for item in g_InventoryBook:
                if item.GetKey() == pKey:
                    if item.count >= count:
                        return item
            return None
    
        def IsHaveBook(pKey):
            count= 1
            for item in g_InventoryBook:
                if item.GetKey() == pKey:
                    if item.count >= count:
                        return True
            return False
    
        def PutBook(pKey):
            global g_InventoryBook
            count= 1
    
            if 999999 < 1:
                if not IsTest():
                    renpy.show_screen("security_warning")
                    return False
    
    
            renpy.sound.play( "audio/effect/getitem.wav")
    
            book = GetHaveBook(pKey, 1)
            if book:
                book.Add(count)
            else:
                g_InventoryBook.append(BookData(pKey))
                g_InventoryBook[-1].Add(count)
    
            renpy.hide_screen(  "put_book_screen" )
            renpy.show_screen(  "put_book_screen" , pKey = pKey)
    
    
        def SubBook(pKey, count):
            global g_InventoryBook
            count = 1
            for i in range(len(g_InventoryBook)):
                if g_InventoryBook[i].pKey == pKey:
                    if g_InventoryBook[i].count - count <= 0:
                        g_InventoryBook.remove(g_InventoryBook[i])
                    else:
                        g_InventoryBook[i].count = g_InventoryBook[i].count - count
                    break
    
            renpy.hide_screen(  "sub_book_screen" )
            renpy.show_screen(  "sub_book_screen" , pKey = pKey)
    
    
    
        def GetTimeIcon(num):
            if num == 1:
                return "time_morning"
    
            elif num == 2:
                return "time_afternoon"
    
            elif num == 3:
                return "time_evening"
    
            elif num == 4:
                return "time_night"
    
    
    
    
        def GetActor(pKey):
            for actor in ActorData.getAll():
                if actor.GetKey() == pKey :
                    return actor
            return null
    
    
        def PutActor(pKey):
            return GetActor(pKey)
    
    
        def Rand( min, max ):
            return renpy.random.randint(min, max)
    
    
        def HaveQuest():
            rtn = list()
            for dataKey, questD in TB_Quest.items():
                quest = GetQuest( dataKey )
                if EventMap("christmas"):
                    if quest.IsInProgress():
                        if quest.Event() == "christmas":
                            rtn.append(quest)
                else:
                    if quest.IsInProgress():
                        if quest.Event() == "0":
                            rtn.append(quest)
            return rtn
    
    
        def GetQuest(pKey):
            if not pKey in gd_InventoryQuest :
                gd_InventoryQuest[pKey] = QuestData(pKey)
            return gd_InventoryQuest[pKey]
    
    
    
    
    
    
    
    
    
    
        def StartQuest(pKey):
            quest = GetQuest(pKey)
            quest.Start()
    
        def ClearQuest(pKey):
            quest = GetQuest(pKey)
    
            if quest.RewardItem() != "0":
                PutItem( quest.RewardItem(), quest.RewardItemCount() )
            if quest.RewardGold() != 0:
                PutGold( quest.RewardGold())
            quest.Clear()
    
    
        def RemoveQuest(pKey):
            quest = GetQuest(pKey)
            quest.Remove()
    
    
        def Clear():
            quest = GetQuest(g_do_quest)
            quest.Clear()
    
        def IsClearQuest(pKey):
            return gd_InventoryQuest[pKey].IsClear() if pKey in gd_InventoryQuest else False
    
    
    
    
    
    
    
    
    
    
        def IsNotClearQuest(pKey):
            if IsClearQuest(pKey):
                return False
            else:
                return True
    
        def IsHaveQuest(pKey):
            for quest in HaveQuest():
                if quest.GetKey() == pKey:
                    return True
            return False
    
        def IsNotStartQuest(pKey):
            if IsHaveQuest(pKey) or IsClearQuest(pKey):
                return False
            else:
                return True
    
    
        def SaySave(what):
            global g_what
            g_what = what
            return what
    
        def SetDuress(actorKey, duress):
            actor = GetActor(actorKey)
            if actor.duress < duress:
                actor.duress = duress
    
        def GetDuress(actorKey):
            return GetActor(actorKey).love
    
        def SetLove(actorKey, love):
            actor = GetActor(actorKey)
            if actor.love < love:
                actor.love = love
    
        def GetLove(actorKey):
            return GetActor(actorKey).love
    
    
        def SetMood(actorKey, mood):
            actor = GetActor(actorKey)
            if actor.mood < mood:
                actor.mood = mood
    
        def GetMood(actorKey):
            return GetActor(actorKey).mood
    
        def GetActorLocationAll(indexKey):
            rtn = list()
            for Actor in ActorData.getAll():
                flag = Actor.MoveActorQuest(indexKey)
                if flag == 0:
                    if Actor.getLocation() == indexKey:
                        if Actor.FirstQuest() == "0":
                            rtn.append(Actor)
                        elif IsClearQuest(Actor.FirstQuest()):
                            rtn.append(Actor)
    
                elif flag == 1:
                    rtn.append(Actor)
            return rtn
    
        def TimeSkipCool():
            global g_TimeSkipCool
            g_TimeSkipCool = 10
            TimeSkip()
    
        def TimeSkipCoolUpdate():
            global g_TimeSkipCool
            g_TimeSkipCool = g_TimeSkipCool -1
    
        def TimeSkip():
            if g_time == 4:
                ClickInventoryRoom("myroom")
            else:
                NextTime()
                TimeSkipMoveCheck()
    
    
        def TimeSkipMoveCheck():
            if RoomData(g_mylocationKey).CanMove() != 1:
                Move(RoomData(g_mylocationKey).Parent())
                TimeSkipMoveCheck()
    
    
    
        def NextTime():
            global g_time, g_call
            g_time = g_time + 1
            PlayMusic()
    
            if g_time == 4:
                renpy.sound.play("audio/effect/phonebell.wav")
                g_call = 1
            elif g_time > 4:
                g_time = 4
    
            if g_mylocationKey == "home_menu":
                GetActorWorldMap()
    
            ResetLockActionTime()
    
    
        def GetMusicTime():
            global g_time
            if RoomData(g_mylocationKey).Bgm() == "0":
                if g_time == 1:
                    music_s = "audio/bgm/Happy Acoustic.mp3"
                if g_time == 2:
                    music_s = "audio/bgm/morning.mp3"
                if g_time == 3:
                    music_s = "audio/bgm/readingnight.mp3"
                if g_time == 4:
                    music_s = "audio/bgm/night.mp3"
            else:
                music_s = "audio/bgm/" + RoomData(g_mylocationKey).Bgm()
            return music_s
    
        def PlayMusic():
            global g_music
            g_music = GetMusicTime()
            renpy.music.play(g_music)
    
    
        def SexMusic():
            renpy.music.play("audio/bgm/sex.mp3")
    
    
        def NextDay():
            global g_time, g_call, g_day, g_safe_box
            g_time = 1
            ResetLock()
            ResetRemoveActorTime()
    
            ResetLockActionToday()
            ResetLockActionTime()
    
            ToiletRandomMoney()
            TodayResorceMission()
    
            TodayBookShop()
    
            g_call = 0
            g_safe_box = 1
            GetActor("jihye").look = ""
            g_day = g_day + 1
            PlayMusic()
    
            ResetDailyFlag()
            RandomBlackboard()
    
    
    
    
    
        def OpenRoomToday(room_name):
            global g_OpenRoomToday
    
            for room in g_OpenRoomToday:
                if room == room_name:
                    return
            g_OpenRoomToday.append(room_name)
    
        def CloseRoomToday(room_name):
            global g_OpenRoomToday
            for room in g_OpenRoomToday:
                if room == room_name:
                    g_OpenRoomToday.remove(room_name)
                    return
    
        def IsOpenRoom(room_name):
            for roomName in g_OpenRoomToday:
                if roomName == room_name:
                    return True
                else:
                    return False
    
        def ResetOpenRoomToday():
            global g_OpenRoomToday
            g_OpenRoomToday = list()
    
    
    
        def IsUnLockActor(actor_name):
            for actorName in g_LockActorToday:
                if actorName == actor_name:
                    return False
            for actorName in g_LockActorTime:
                if actorName == actor_name:
                    return False
            return True
    
    
        def LockActorToday(actor_name):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.setLock(4)
    
        def LockActorTime(actor_name):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.setLock(g_time)
    
        def ResetLock():
            global g_InventoryActor
            for Actor in g_InventoryActor:
                Actor.resetLock()
    
        def UnLockActorToday(actor_name):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.resetLock()
    
    
    
        def RemoveActorTime(actor_name):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.setRemoveDay(g_time)
    
        def ResetRemoveActorTime():
            global g_InventoryActor
            for Actor in g_InventoryActor:
                Actor.resetRemoveDay()
    
    
        def MoveActor(actor_name, location, nTime):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.setLocation(location, nTime)
    
        def ResetActorLocation(actor_name):
            for Actor in ActorData.getAll():
                if Actor.GetKey() == actor_name:
                    Actor.resetLocation()
    
    
    
        def IsUnLockAction(action_name):
            for actionName in g_LockActionToday:
                if actionName == action_name:
                    return False
            for actionName in g_LockActionTime:
                if actionName == action_name:
                    return False
            return True
    
    
        def LockActionToday(action_name):
            global g_LockActionToday
            g_LockActionToday.append(action_name)
    
        def UnLockActionToday(action_name):
            global g_LockActionToday
            g_LockActionToday.remove(action_name)
    
        def ResetLockActionToday():
            global g_LockActionToday
            g_LockActionToday = list()
    
    
        def LockActionTime(action_name):
            global g_LockActionTime
            g_LockActionTime.append(action_name)
    
        def UnLockActionTime(action_name):
            global g_LockActionTime
            g_LockActionTime.remove(action_name)
    
        def ResetLockActionTime():
            global g_LockActionTime
            g_LockActionTime = list()
    
    
    
    
        def GetActor(pKey):
            global g_InventoryActor
            for actor in g_InventoryActor:
                if actor.GetKey() == pKey :
                    return actor
            g_InventoryActor.append( ActorData(pKey) )
            return g_InventoryActor[-1]
    
    
        def UpdateActor():
            for dataKey, Actor in TB_Actor.items():
                GetActor(dataKey)
    
    
    
        def GetResorceRandomMission(grade):
            rtn = list()
            for Resorce in ResorceData.getAll():
                if Resorce.Grade() == grade :
                    rtn.append(Resorce)
            randomx = Rand(1, len(rtn)) -1
            return rtn[randomx]
    
    
        def TodayResorceMission():
            global g_InventoryResorce
            g_InventoryResorce = list()
            for i in range(0,Rand(3,5)):
                ran = Rand(0,100)
                if ran < 25:
                    g_InventoryResorce.append(GetResorceRandomMission(3))
                elif ran < 50:
                    g_InventoryResorce.append(GetResorceRandomMission(2))
                elif ran < 75:
                    g_InventoryResorce.append(GetResorceRandomMission(1))
                else:
                    g_InventoryResorce.append(GetResorceRandomMission(0))
            return g_InventoryResorce
    
        def TodayBookShop():
            global g_InventoryBookShop
            g_InventoryBookShop = list()
    
            for book in BookData.getAll():
                if not GetHaveBook(book.GetKey(),1):
    
    
                    g_InventoryBookShop.append(book)
            return g_InventoryBookShop
    
    
    
        def GetPuzzle(pKey):
            global g_InventoryPuzzle
            for puzzle in g_InventoryPuzzle:
                if puzzle.GetKey() == pKey :
                    return puzzle
    
            g_InventoryPuzzle.append( PuzzleData(pKey) )
            return g_InventoryPuzzle[-1]
    
        def initPuzzle():
            for dataKey, Puzzle in TB_Puzzle.items():
                GetPuzzle(dataKey)
    
    
    
        def DonationSemen():
            global g_semen_count, g_semen_last_day
            g_semen_count= g_semen_count + 1
            g_semen_last_day= g_day
    
        def CanDonationSemenToday():
            if g_semen_last_day == g_day:
                return False
            else:
                return True
    
        def ResetSemenPoint():
            global g_semen_point
            g_semen_point = 0
    
        def AddSemenPoint():
            global g_semen_point
            g_semen_point = g_semen_point + 1
    
    
    
    
        def RandomBlackboard():
            global g_today_board
            pKey = "b" + str(Rand(1,len(TB_Board)))
            g_today_board = TB_Board[pKey]
    
        def GetBlackboard():
            global g_today_board
            if g_today_board == "":
                g_today_board = TB_Board['b1']
            return g_today_board
    
    
        def GetQuote():
            pKey = "b" + str(Rand(1,len(TB_Quote)))
            return TB_Quote[pKey]
    
    
    
        def SexStep(step):
            global g_sex_step
            if g_sex_step < step:
                g_sex_step = step
    
    
    
    
        def UseDailyFlag(key):
            global gd_DailyFlag
            gd_DailyFlag[key] = True
            return True
    
        def IsDailyFlag(key):
            global gd_DailyFlag
            if gd_DailyFlag.get(key):
                return False
            else:
                return True
    
        def ResetDailyFlag():
            global gd_DailyFlag
            gd_DailyFlag.clear()
    
    
        def CheckParentMap(mapKey, findMapKey):
            if mapKey == "0":
                return False
    
            if mapKey == findMapKey:
                return True
    
            return CheckParentMap(RoomData(mapKey).Parent(), findMapKey)
    
    
        def GetRootRoom(indexKey):
            parent = RoomData(indexKey).Parent()
            if parent == "home_menu" or parent == "0" :
                return indexKey
            return GetRootRoom(parent)
    
        def EventMap(eventKey):
            if RoomData(g_mylocationKey).Event() == eventKey:
                return True
            return False
    
        def IsTest():
            return IsHaveItem("test_key", 1)
    
    
    
        def IsSeason(month):
            if int(time.strftime("%m", time.gmtime())) == month:
                return True
            return False
    # Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc

    댓글목록

    등록된 댓글이 없습니다.

    Copyright © blog.batifa.com All rights reserved.