找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12069|回复: 13

[原创] renpy简单多对多RPG示例

[复制链接]
发表于 2021-8-14 22:08:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
本帖最后由 天使的遗族 于 2021-8-22 13:33 编辑

[RenPy] 纯文本查看 复制代码
# Ren'Py automatically loads all script files ending with .rpy. To use this
# file, define a label and jump to it from another file.
#战斗系统


init python:
    #{'skill_1':-50,'skill_2':-100}
    class BattlePlayer:
        def __init__(self, subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0):
            self.name = name
            self.subordinate = subordinate
            self.protrait = "gui/protraits/"+str(protrait)+".png"
            self.hp = hp
            self.mp = mp
            self.hp_range = hp
            self.mp_range = mp
            self.skills =skills
            self.exp = exp

    selected_left_player = BattlePlayer(subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0)
    selected_right_player = BattlePlayer(subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0)
    left_player_list =[selected_left_player,selected_left_player]
    right_player_list =[selected_right_player,selected_right_player]
    left_player_leader = BattlePlayer(subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0)
    right_player_leader = BattlePlayer(subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0)
    skill_num = 0

default left_player = BattlePlayer()
default right_player = BattlePlayer()
# default selected_left_player = BattlePlayer()
# default selected_right_player = BattlePlayer()
default skill_times = 0


init python:
    class LeftPlayer(BattlePlayer):
        def __init__(self, subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0):
            self.name = name
            self.subordinate = subordinate
            self.protrait = "gui/protraits/"+str(protrait)+".png"
            self.hp = hp
            self.mp = mp
            self.hp_range = hp
            self.mp_range = mp
            self.skills =skills
            self.exp = exp
            self.exp_battle = 0

        def attack(self,skill_num=0,target=selected_right_player):
            global skill_times

            if target.hp > 0:#如果敌人体力不低于0
                if self.mp >=10:#如果气力足够发动技能
                    skill_times -= 1
                    if  target.hp + self.skills[skill_num][1] > 0:#如果这轮攻击后敌人体力仍大于零
                        self.mp -=5#消耗气力
                        self.exp_battle +=int(abs(self.skills[skill_num][1])*0.8)
                        self.exp +=int(abs(self.skills[skill_num][1])*0.8)
                        target.hp += self.skills[skill_num][1]

                        s = self.skills[skill_num][0]+"伤害:"+str(self.skills[skill_num][1])+"\n经验值:"+str(int(abs(self.skills[skill_num][1])*0.8))
                        renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)
                        #renpy.call('round_damage_result')
                    else:
                        target.hp = 0
                        if target.name == right_player_leader.name:

                            renpy.call('battle_victory_result')


        def recover(self,skill_num=2):
            global skill_times
            if self.mp >=10:
                if  self.mp + self.skills[skill_num][1] < self.mp_range:
                    self.mp +=10#增加气力
                else:
                    self.mp =self.mp_range
                if  self.hp + self.skills[skill_num][1] < self.hp_range:
                    self.hp +=abs(self.skills[skill_num][1])#增加体力
                else:
                    self.hp =self.hp_range
                self.exp_battle +=int(abs(self.skills[skill_num][1])*0.8)
                self.exp +=int(abs(self.skills[skill_num][1])*0.8)
                skill_times -= 1
                s = "恢复体力:"+str(self.skills[skill_num][1])+"\n经验值:"+str(int(abs(self.skills[skill_num][1])*0.8))
                renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)
                #renpy.call('round_recover_result')

        def recover_all(self,skill_num = 2):
            global left_player_list,skill_times
            if self.mp >=10:
                for member in  left_player_list:
                    if  member.hp + self.skills[skill_num][1] < member.hp_range:
                        member.hp +=abs(self.skills[skill_num][1])
                    else:
                        member.hp = member.hp_range
                self.exp_battle +=int(abs(self.skills[skill_num][1])*0.8)
                self.exp +=int(abs(self.skills[skill_num][1])*0.8)
                skill_times -= 1
                s = "我方全体体力恢复:"+str(self.skills[skill_num][1])+"\n经验值:"+str(int(abs(self.skills[skill_num][1])*0.8))
                renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)

    class RightPlayer(BattlePlayer):
        def __init__(self, subordinate='无所属',protrait='none',name='player_1',hp=1000,mp=200,skills=(),exp=0):
            self.name = name
            self.subordinate = subordinate
            self.protrait = "gui/protraits/"+str(protrait)+".png"
            self.hp = hp
            self.mp = mp
            self.hp_range = hp
            self.mp_range = mp
            self.skills =skills

        def attack(self,skill_num=0,target=selected_left_player):


            if target.hp > 0:#如果敌人体力不低于0
                if self.mp >=10 or self.mp_range == 0:#角色气力不低于10或者为物品,如果气力足够发动技能
                    selected_right_player = self #使用技能右方系统自动锁定发动技能人
                    if  target.hp + self.skills[skill_num][1] > 0:#如果这轮攻击后敌人体力仍大于零
                        if self.mp_range != 0:
                            self.mp -=5#消耗气力
                        target.hp += self.skills[skill_num][1]
                        s = self.skills[skill_num][0]+"\n伤害:"+str(self.skills[skill_num][1])
                        renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)
                        # renpy.call('round_damage_result')
                    else:
                        target.hp = 0
                        renpy.call('battle_victory_result')



        def recover(self,skill_num=2):
            if self.mp >=10 or self.mp_range == 0:#角色气力不低于10或者为物品
                selected_right_player = self #使用技能右方系统自动锁定发动技能人

                if  self.mp + self.skills[skill_num][1] < self.mp_range:
                    self.mp +=10#增加气力
                else:
                    self.mp =self.mp_range
                if  self.hp + self.skills[skill_num][1] < self.mp_range:
                    self.hp +=abs(self.skills[skill_num][1])#增加体力
                else:
                    self.hp =self.hp_range
                s = "恢复体力:"+str(self.skills[skill_num][1])
                renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)
                #renpy.call('round_recover_result')

        def attack_all(self,skill_num = 0):
            global left_player_list
            if self.mp >=10 or self.mp_range == 0:#角色气力不低于10或者为物品:
                selected_right_player = self #使用技能右方系统自动锁定发动技能人
                for member in  left_player_list:
                    if  member.hp + self.skills[skill_num][1] > 0:
                        member.hp +=self.skills[skill_num][1]
                    else:
                        member.hp = 0
                        if member.name == left_player_leader.name:#队长体力为零
                            renpy.call('battle_fail_result')
                s = self.skills[skill_num][0]+"\n我方全体伤害:"+str(self.skills[skill_num][1])
                renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)

        def recover_all(self,skill_num = 2):
            global right_player_list
            if self.mp >=10 or self.mp_range == 0:
                #角色气力不低于10或者为物品:
                selected_right_player = self #使用技能右方系统自动锁定发动技能人
                for member in  right_player_list:
                    if  member.hp + self.skills[skill_num][1] < member.hp_range:
                        member.hp +=abs(self.skills[skill_num][1])
                    else:
                        member.hp = member.hp_range
            s = "全体恢复:"+str(self.skills[skill_num][1])
            renpy.show_screen("text_title",cps_num=12,s=s,xalign=0.4,yalign=0.5,size=50)




define stage_victory_music = "audio/bgm/victory by Ryuichiro Yamaki.mp3"

default irabu_bs = LeftPlayer(name='知念',subordinate='熊野寮',protrait='irabu_bs',hp=500,mp=200,skills=(('刀光剑雨',-50),('价值重估',-100),('苏生',100)))
default kidoutaityou_normal_bs = RightPlayer(name='机动队小队长',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
default keibisya_mitubishi_bs = RightPlayer(name='三菱普通警备车',subordinate='第一机动队',protrait = 'keibisya_mitubishi_bs',hp=9900,mp=0,skills=(('停止攻击,否则使用武力!',-50),('放下武器,立即投降!',-100)))

default male_student_bs = LeftPlayer(name='男大学生',subordinate='京都大学',protrait='snow1',hp=600,mp=100,skills=(('投掷',-50),('团结',30),('鼓舞',100)))
default female_student_bs = LeftPlayer(name='女大学生',subordinate='京都大学',protrait='snow1',hp=400,mp=100,skills=(('口号',-50),('团结',30),('苏生',100)))





style battle_stage_text is text:
    size 18

transform battle_stage_frame_show_hide(yoffset_start=100,xoffset_start=100):
    on show:
        alpha 0.0
        zoom 0.9
        yoffset yoffset_start
        xoffset xoffset_start
        easein .5 alpha 0.9 yoffset 0 xoffset 0 zoom 1.0
    on hide:
        zoom 1.0
        easein .5 alpha 0.0 yoffset yoffset_start xoffset xoffset_start zoom 0.9


screen battle_stage(stage_title=_('首战'),stage_backround='gokkai',stage_music="audio/bgm/Experimental Weapons Division.mp3"):

    on "hide" action With(Dissolve(1.0))
    on "show" action [With(Dissolve(1.0)),Play("music",stage_music,fadeout=0.5)]

    tag battle

    style_prefix "battle_stage"

    #modal True
    zorder 49#quick_menu100,say50




    add stage_backround



    frame at battle_stage_frame_show_hide(yoffset_start=-100,xoffset_start=0):#上方状态栏
        xsize 1220
        ysize 120
        xpadding 10
        ypadding 5
        align (.5,.05)

        hbox:#人物属性栏:左

            spacing 20
            xalign 0
            yalign .5

            vbox:#头像
                xalign .0
                spacing 5

                yalign .5
                xsize 100


                frame:
                    background  None
                    xsize 100
                    add im.Scale(selected_left_player.protrait, 85, 85) xalign 0.5 yalign 0.5


            vbox:#人物状态
                xalign .0
                spacing 5
                hbox:
                    xalign .0
                    yalign 1.0
                    spacing 5

                    #姓名
                    text "[selected_left_player.name]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 30
                    #所属
                    text "[selected_left_player.subordinate]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 20 yalign 1.0

                hbox:
                    yalign .5
                    xalign .0
                    spacing 5
                    frame:
                        background None
                        xsize 150
                        xalign .5
                        text "体力 "+"[selected_left_player.hp] "+"/"+"[selected_left_player.hp_range] "

                    bar:
                        value AnimatedValue(selected_left_player.hp, range=selected_left_player.hp_range, delay=.5, old_value=None)
                        xalign 0.5
                        yalign 0.5
                        xysize(200,10)
                        xmaximum 200
                hbox:
                    yalign .5
                    xalign .0
                    spacing 5
                    frame:
                        background None
                        xsize 150
                        xalign .5
                        text "气力 "+"[selected_left_player.mp]"

                    bar:
                        value AnimatedValue(selected_left_player.mp, range=selected_left_player.mp_range, delay=.5, old_value=None)
                        xalign 0.5
                        yalign 0.5
                        xysize(200,10)
                        xmaximum 200

        hbox:
            spacing 20
            xalign .5
            yalign .2
            text "本轮我方总计剩余"+"{size=30}[skill_times]{/size}"+"次回合" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 20 yalign 1.0

        hbox:#人物属性栏:右

            spacing 20
            xalign 1.0
            yalign .5




            vbox:#人物状态
                xalign .0
                spacing 5
                hbox:
                    xalign 1.0
                    yalign 1.0
                    spacing 5

                    #所属
                    text "[selected_right_player.subordinate]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 20 yalign 1.0

                    #姓名
                    text "[selected_right_player.name]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 30

                hbox:
                    yalign .5
                    xalign .0
                    spacing 5
                    frame:
                        background None
                        xsize 150
                        xalign .5
                        text "体力 "+"[selected_right_player.hp] "+"/"+"[selected_right_player.hp_range] "

                    bar:
                        value AnimatedValue(selected_right_player.hp, range=selected_right_player.hp_range, delay=.5, old_value=None)
                        xalign 0.5
                        yalign 0.5
                        xysize(200,10)
                        xmaximum 200
                hbox:
                    yalign .5
                    xalign .0
                    spacing 5
                    frame:
                        background None
                        xsize 150
                        xalign .5
                        text "气力 "+"[selected_right_player.mp]"

                    bar:
                        value AnimatedValue(selected_right_player.mp, range=selected_right_player.mp_range, delay=.5, old_value=None)
                        xalign 0.5
                        yalign 0.5
                        xysize(200,10)
                        xmaximum 200
            vbox:#头像
                xalign .0
                spacing 5

                yalign .5
                xsize 100


                frame:
                    background  None
                    xsize 100
                    add im.Scale(selected_right_player.protrait, 85, 85) xalign 0.5 yalign 0.5
    frame at battle_stage_frame_show_hide(yoffset_start=0,xoffset_start=-50):#左侧成员列表
        xalign .05
        ypos 180
        xsize 250
        ysize 400
        vbox:
            spacing 10
            xalign .5
            yalign 0.1
            for player_member in left_player_list:


                button:
                    style 'music_room'
                    xysize 200,50
                    hbox:
                        spacing 5
                        xalign 0.0
                        image im.Scale(player_member.protrait, 40, 40) xalign 0.5 yalign 0.5

                        vbox:
                            spacing 3
                            xalign 0.0

                            text player_member.name size 20 xalign 0.0 yalign 0.5 style 'music_room_text'

                            bar:
                                value AnimatedValue(player_member.hp, range=player_member.hp_range, delay=.5, old_value=None)
                                xalign 0.0
                                yalign 0.5
                                xysize(100,5)
                                xmaximum 100

                    action SetVariable('selected_left_player',player_member)
    frame at battle_stage_frame_show_hide(yoffset_start=0,xoffset_start=50):#右侧成员列表
        xalign .95
        ypos 180
        xsize 250
        ysize 400
        vbox:
            spacing 10
            xalign .5
            yalign 0.1
            for player_member in right_player_list:

                button:
                    style 'music_room'
                    xysize 200,50
                    hbox:
                        spacing 5
                        xalign 1.0

                        vbox:
                            spacing 3
                            xalign 1.0

                            text player_member.name size 20 xalign 1.0 yalign 0.5 style 'music_room_text'

                            bar:
                                value AnimatedValue(player_member.hp, range=player_member.hp_range, delay=.5, old_value=None)
                                xalign 1.0
                                yalign 0.5
                                xysize(100,5)
                                xmaximum 100

                        image im.Scale(player_member.protrait, 40, 40) xalign 0.5 yalign 0.5


                    action SetVariable('selected_right_player',player_member)

    if skill_times > 0:
        frame at battle_stage_frame_show_hide(yoffset_start=100,xoffset_start=0):#下方技能栏
            xalign .5
            yalign .95
            xysize 1200,100
            #background None
            hbox:
                spacing 10
                xalign .5
                yalign .5
                for skill_num in range(len(selected_left_player.skills)):


                    #$ skill_num_this = skill_num
                    textbutton selected_left_player.skills[skill_num][0]:
                        style 'music_room'

                        if selected_left_player.skills[skill_num][1] < 0:#如果为伤害技能



                            action [Function(selected_left_player.attack,skill_num=skill_num,target=selected_right_player)]#按钮攻击右方被选中的敌人

                        elif selected_left_player.hp<selected_left_player.hp_range:

                            if selected_left_player.skills[skill_num][0] == '团结' or selected_left_player.skills[skill_num][0] == '鼓舞':#如果是恢复全体的技能
                                action [Function(selected_left_player.recover_all,skill_num=skill_num)]


                            else:

                                action [Function(selected_left_player.recover,skill_num=skill_num)]


screen battle_briefring(briefring_title=_('首战'),biefring_backround=gui.main_menu_background,briefring_music="audio/bgm/taiko_test.mp3"):

    zorder 51
    tag battle

    on "hide" action With(Dissolve(1.0))
    on "show" action [With(Dissolve(1.0)),Play("music",briefring_music,fadeout=0.5)]

    add biefring_backround

    fixed:
        frame:
            background None
            align(.03,.03)
            text briefring_title:
                size 50
                style "label_text"
    viewport:

        draggable True
        mousewheel True
        scrollbars "vertical"
        ypos 100
        xpos 50
        frame:#左侧成员列表
            xsize 450
            ysize 500
            vbox:
                spacing 10
                xalign .5
                yalign 0.1
                for player_member in left_player_list:


                    button:
                        style 'music_room'
                        xysize 400,80
                        hbox:
                            spacing 5
                            xalign 0.0
                            image im.Scale(player_member.protrait, 60, 60) xalign 0.5 yalign 0.5

                            vbox:
                                spacing 3
                                xalign 0.0

                                hbox:
                                    spacing 5
                                    text "[player_member.name]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 25
                                    #所属
                                    text "[player_member.subordinate]" color '#fff' outlines [(2, "#4f4f4f",absolute(0), absolute(0))] size 15 yalign 1.0
                                hbox:
                                    yalign .5
                                    xalign .0
                                    spacing 5
                                    frame:
                                        background None
                                        xsize 150
                                        xalign .5
                                        text "体力 "+"[player_member.hp] "+"/"+"[player_member.hp_range] " size 20

                                    bar:
                                        value AnimatedValue(player_member.hp, range=player_member.hp_range, delay=.5, old_value=None)
                                        xalign 0.0
                                        yalign 0.5
                                        xysize(100,10)
                                        xmaximum 100

                        action NullAction()#SetVariable('selected_left_player',player_member)
    fixed:

            frame:
                background "#f7f7f7aa"
                yalign .95
                xalign .5
                xysize(1000,60)
                xpadding 100

                text "选择参加战斗的角色…"#current_collection[1]

            textbutton _("开始战斗"):
               style "return_button"
               yalign 0.9
               xalign 0.9
               text_size 50
               action [Hide('battle_briefring'),Return()]

label battle_victory_result:
    show screen text_title(cps_num=12,s="战斗胜利",xalign=0.4,yalign=0.5,size=80)
    $ renpy.play(stage_victory_music,"music")
    $ renpy.pause(2.0,hard=True)
    window show

    "机动队员" "攻势太猛裂了,请求支援,撤退!"
    ir "我们坚持下来了!"
    hide screen text_title
    $ renpy.pause(2.0,hard=True)
    show screen  text_title(cps_num=12,s="战斗总计:\n[left_player.name]经验值获得:[left_player.exp_battle]\n经验值累计:[left_player.exp]",xalign=0.4,yalign=0.5,size=80)
    jump battle_end

label battle_fail_result:
    if left_player_leader.hp <= 0:
        $ s = "战斗失败\n"+"[left_player_leader.name]"+"无法继续战斗"
    else:
        $ s = "战斗失败\n我方成员均无法继续战斗"
    show screen text_title(cps_num=12,s=s,xalign=0.4,yalign=0.5,size=80)
    $ renpy.play("audio/bgm/suzusample.mp3","music")
    $ renpy.pause(1.0,hard=True)
    window show
    ir "我们失败了……"

    hide screen text_title
    show screen  text_title(cps_num=12,s="战斗总计:\n[left_player.name]经验值获得:[left_player.exp_battle]\n经验值累计:[left_player.exp]",xalign=0.4,yalign=0.5,size=80)
    jump battle_end


label battle_stage_01:
    $ quick_menu_enable = False
    $ left_player_list=[irabu_bs,male_student_bs,female_student_bs]
    $ kidoutaiin_normal_1_bs = RightPlayer(name='普通机动队员',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
    $ kidoutaiin_normal_2_bs = RightPlayer(name='普通机动队员',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
    $ kidoutaiin_normal_3_bs = RightPlayer(name='普通机动队员',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
    $ kidoutaiin_normal_4_bs = RightPlayer(name='普通机动队员',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
    # init:
    #     right_player_list=[kidoutaityou_normal_bs]
    #     for team_num in range(3):
    #         teammate_name = "kidoutaiin_normal_"+str(team_num)+"_bs"
    #         teammate_name = RightPlayer(name='普通机动队员',subordinate='京都府警',protrait='kidoutaiin_normal_bs',hp=1000,mp=300,skills=(('警棍压制',-20),('盾形冲刺',-100)))
    #         right_player_list.append()
    $ right_player_list=[kidoutaityou_normal_bs,kidoutaiin_normal_1_bs,kidoutaiin_normal_2_bs,kidoutaiin_normal_3_bs,kidoutaiin_normal_4_bs,keibisya_mitubishi_bs]

    call screen battle_briefring
    stop music fadeout 1.0
    show screen transition_splash(_("正在载入"),xalign=0.9,yalign=0.95,size=25,color="#fff",font="DroidSansFallback.ttf")
    $ renpy.pause(6.0,hard=True)
    hide screen transition_splash

    $ left_player = irabu_bs
    $ left_player_leader = irabu_bs
    $ selected_left_player = irabu_bs

    $ right_player = keibisya_mitubishi_bs
    $ right_player_leader = kidoutaityou_normal_bs
    $ selected_right_player = keibisya_mitubishi_bs

    show screen battle_stage
    $ quick_menu_enable = False

    scene black
#    show
    $ irabu_bs.hp-=10
    $ renpy.pause(1.0, hard=True)
    $ irabu_bs.hp-=10
    $ renpy.pause(1.0, hard=True)
    $ irabu_bs.hp-=100
    $ renpy.pause(1.0, hard=True)
    "机动队员" "你们没有必要再负隅抵抗"
    "机动队员" "停止攻击,否则我们就要使用武力了"
    scene black
    #round 1
    $ right_player = keibisya_mitubishi_bs
    $ selected_right_player = right_player
    "警备车" "开始喊话"
    $ right_player.attack(skill_num=0,target=left_player_leader)
    $ renpy.pause(3.0, hard=True)
    $ right_player.attack_all(skill_num=1)
    $ renpy.pause(3.0, hard=True)

    $ right_player = kidoutaiin_normal_2_bs
    $ selected_right_player = right_player
    "机动队员" "使用武力驱散!"
    $ right_player.attack(skill_num=0,target=left_player_leader)
    $ renpy.pause(3.0, hard=True)

    $ right_player = kidoutaiin_normal_1_bs
    $ selected_right_player = right_player
    $ right_player.attack(skill_num=0,target=left_player_leader)
    $ renpy.pause(3.0, hard=True)

    $ right_player = kidoutaiin_normal_3_bs
    $ selected_right_player = right_player
    $ selected_left_player = male_student_bs
    $ right_player.attack(skill_num=0,target=selected_left_player)
    $ renpy.pause(3.0, hard=True)

    $ right_player = kidoutaityou_normal_bs
    $ selected_right_player = right_player
    $ selected_left_player = female_student_bs
    $ right_player.attack(skill_num=1,target=selected_left_player)
    $ renpy.pause(3.0, hard=True)
    #round 2
    $ skill_times = 15 #我方本轮总共可发动n次技能

    $ renpy.pause(5.0, hard=True)
    $ right_player = kidoutaiin_normal_4_bs
    $ selected_right_player = right_player
    $ right_player.attack(skill_num=1,target=left_player)
    $ renpy.pause(2.0, hard=True)
    "机动队小队长" "全员开始冲刺!"

    $ right_player = kidoutaityou_normal_bs
    $ selected_right_player = right_player
    $ right_player.attack_all(skill_num=1)
    $ renpy.pause(999.0, hard=True)

    "机动队员" "攻势太猛裂了,请求支援,撤退!"
    scene black
    #$ renpy.pause(99.0, hard=True)
    i "这句之后退出battle_stage_01"
    jump battle_fail_result

    return

label battle_end:
    hide screen battle_stage
    e "战斗演示1到此结束"
    i "这句之后退出battle_end"
    jump battle_stage_02
    # $ renpy.show('')
    #$ renpy.pause(99.0, hard=True)

label battle_stage_02:
    i "战斗2从这里开始"
    return



QQ图片20210814220727.png
QQ图片20210814220305.png

评分

参与人数 1干货 +3 收起 理由
BuErShen + 3 鼓励原创!

查看全部评分

发表于 2021-8-18 19:44:55 | 显示全部楼层
请问有scipt端的代码吗
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-8-19 17:00:10 | 显示全部楼层
qwe3147969113 发表于 2021-8-18 19:44
请问有scipt端的代码吗

新建一个rpy文档,复制全部代码到里面,从label start call这里的label
回复 支持 抱歉

使用道具 举报

发表于 2021-8-19 20:17:10 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-8-19 21:29 编辑

[RenPy] 纯文本查看 复制代码
label start:
    call screen ?
萌新表示,不会用,拷贝到一个新的rpy后,script.rpy文件中,call screen 谁?        476行是不是多了一个 / ?


回复 支持 抱歉

使用道具 举报

发表于 2021-8-19 21:30:35 | 显示全部楼层
天使的遗族 发表于 2021-8-19 17:00
新建一个rpy文档,复制全部代码到里面,从label start call这里的label

哈哈,建议博主分两段发出来虽然麻烦了点。。。
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-8-22 13:35:09 | 显示全部楼层
怀念丶落樱 发表于 2021-8-19 20:17
萌新表示,不会用,拷贝到一个新的 ...

jump battle_stage_01 或者 call battle_stage_01
回复 支持 抱歉

使用道具 举报

发表于 2021-8-23 07:19:00 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-8-23 07:30 编辑

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/1.rpy", line 607, in script
    call screen battle_briefring
  File "renpy/common/000statements.rpy", line 570, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
Exception: Style u'music_room' does not exist.


music_room不存在,啥情况,我缺少声音文件?我已经弄了4个音乐文件重命名后放在了audio\bgm
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-8-24 22:09:27 | 显示全部楼层
怀念丶落樱 发表于 2021-8-23 07:19
I'm sorry, but an uncaught exception occurred.

While running game code:

忘记贴上了,你自己看着换成自己写的呗

[RenPy] 纯文本查看 复制代码
style music_room is button:
    xysize (250, 65)
    idle_background "#f7f7f7aa"
    hover_background gui.hover_color
    selected_idle_background  gui.accent_color
    hover_sound "audio/se/808 clav.ogg"
    insensitive_background gui.insensitive_color
    # hover_xsize 255
    # hover_ysize 72


style music_room_text is text:
    size 20
    align(.5,.5)
    hover_color "#FFFFFF"
    selected_idle_color "#FFFFFF"
    color "#555"
回复 支持 抱歉

使用道具 举报

发表于 2021-8-25 21:19:44 | 显示全部楼层
额,代码还是不全,我自己写吧,感谢 天使的遗族 的思路分享!谢谢!
回复 支持 抱歉

使用道具 举报

发表于 2021-11-11 13:33:40 来自手机 | 显示全部楼层
我这提示text_title is not found,然后换成show某张图又可以了,不说清楚是什么原因
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-12-22 19:53 , Processed in 0.136050 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表