本帖最后由 alicia 于 2022-9-16 09:03 编辑
[RenPy] 纯文本查看 复制代码
################################################################################
## 战斗场景
################################################################################
default roundvalue = 1
default frightfor = say
default xfightset = 300
default yfightset = 200
default fighttext = " "
default mypartimage = "gui/background/partbutton.png"
default youpartimage = "gui/background/partbutton.png"
default choice_button = False
default my = aliax
default your = police
screen screenfight(ours,yours):
style_prefix "screenfight"
text fighttext:
size 30
align(0.4,0.4)
at frightfor
vbox:
xpos 0
yalign 0.3
spacing 30
for me in ours:
hbox:
button: #这里当点击第一个按钮时改变该数组的其他按钮特性
xsize xfightset
ysize yfightset
text me.name:
size 20
color "#000000"
action[SetVariable("my",me),SetVariable("choice_button",True)]
background Frame(mypartimage)
selected_hover_xysize(320,210)
frame:
xysize(200,100)
background Frame("gui/background/valueframe.png")
vbox:
bar:
value me.hp
range 100
bar_vertical False
left_bar "gui/bar/hp_barleft.png"
right_bar "gui/bar/hp_barright.png"
xysize(70,20)
bar:
value me.mp
range 100
bar_vertical False
left_bar "gui/bar/mp_barleft.png"
right_bar "gui/bar/mp_barright.png"
xysize(70,20)
vbox:
xpos 0.7
yalign 0.3
for you in yours:
hbox:
if choice_button == True:
button: #与上面同理
text you.name:
size 20
color "#000000"
action [SetVariable("your",you),Show("choicescreen")]
background Frame(youpartimage)
else:
frame:
text you.name:
size 20
color "#000000"
background Frame(youpartimage)
frame:
xysize(200,100)
background Frame("gui/background/valueframe.png")
vbox:
bar:
value you.hp
range 100
bar_vertical False
left_bar "gui/bar/hp_barleft.png"
right_bar "gui/bar/hp_barright.png"
xysize(70,20)
bar:
value you.mp
range 100
bar_vertical False
left_bar "gui/bar/mp_barleft.png"
right_bar "gui/bar/mp_barright.png"
xysize(70,20)
screen choicescreen:
frame:
xysize(100,300)
align(0.4,0.4)
background Frame("gui/background/choiceframe.jpg")
vbox:
button:
text "攻击"
action[SetVariable("choice_button",True),SetVariable("frightfor",hit_say),Hide("choicescreen"),Call("attick")]
button:
text "跳过"
action[Call("youattick")]
label start:
call screen screenfight(ours=ourfriends,yours=enemys)
return
label attick:
python:
fighttext = str(my)+"打在了"+str(your)+"的身上"
your.hp -= my.attick
fighttext = str(your)+"被狠狠打了一拳"
jump youattick
label youattick:
python:
attickfor = attacked
fighttext = "使用了警棍挥击"
my.hp -= your.attick
fighttext = "第"+str(roundvalue)+"回合"
roundvalue = roundvalue +1
call screen screenfight(ours=ourfriends,yours=enemys)
|