赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 2418 |
最后登录 | 2024-3-20 |
在线时间 | 62 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 143
- 在线时间
- 62 小时
- 注册时间
- 2015-5-24
- 帖子
- 56
|
5楼
楼主 |
发表于 2017-4-28 14:17:55
|
只看该作者
本帖最后由 梦想始终会醒 于 2017-4-28 14:27 编辑
@芯☆淡茹水
就是如何在Input.trigger?(Input::C)中对应修炼的各个角色.
不知如何判断修炼图中对应上面的角色, 所以相当于修炼图是个摆设.
以下代码.有点乱.毕竟新手
class Team # by GKK def initialize [url=home.php?mod=space&uid=2667520]@view[/url] = Viewport.new(12,89,617,302) @view.z = 9998 @back = Sprite.new(@view) @back.bitmap = RPG::Cache.picture("角色队列.png") @vieww = Viewport.new(0,0,640,480) @vieww.z = 9999 @sprite = Sprite.new(@vieww) @sprite.bitmap = Bitmap.new(640,480) @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @当前金钱 = $game_party.gold #@当前经验 = $game_party.actors[0].exp [url=home.php?mod=space&uid=315698]@wenzi[/url] = Sprite.new @wenzi.z = 9999 @wenzi.bitmap = Bitmap.new(200,100) @wenzi.bitmap.font.name = "黑体" @wenzi.bitmap.font.size = 15 @wenzi.bitmap.font.color = Color.new(255,0,0,255) @wenzi.bitmap.draw_text(0,0,200,100,"当前金钱:"+@当前金钱.to_s) # @wenzi.bitmap.draw_text(0,0,100,100,"当前金钱:"+@当前经验.exp_s) @wenzi.x = 50 @wenzi.y = 100 s1 = "" s2 = "" s3 = "" s4 = "" s5 = "" @command_window = Window_Command.new(530,[s1,s2,s3,s4,s5]) @command_window.visible = false @选中 = 0 @角色 = [] for i in 0...$game_party.actors.size @角色[i] = Renwu.new(i) end Graphics.transition loop do Graphics.update Input.update update if Input.trigger?(Input::B) break end end @back.bitmap.dispose @back.dispose @sprite.dispose @sprite.bitmap.dispose @wenzi.bitmap.dispose for i in 0...$game_party.actors.size @角色[i].dispose end end def update @command_window.update @command_window.index != @选中 @选中 = @command_window.index case @command_window.index when 0 @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) when 1 @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) when 2 @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) when 3 @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) when 4 @sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93)) @sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93)) end if Input.trigger?(Input::C) case @command_window.index when 0 p "阿尔西斯" when 1 p“帕吉尔“ when 2 p""塞拉斯"" when 3 p "特萝西" when 4 p "空" end end for i in 0...$game_party.actors.size @角色[i].update end end def refresh for i in 0...$game_party.actors.size @角色[i].update end end end class Renwu def initialize(num) @偏移 = { "阿尔西斯" => "100", "帕吉尔" => "0", "塞拉斯" => "40", "特萝西" => "40", "" => "0", } @人 = num @view = Viewport.new(12,89,617,302) @view.z = 9999 @s = RPG::Cache.character($game_party.actors[@人].character_name+"_W",0) [url=home.php?mod=space&uid=51411]@精灵[/url] = Sprite.new(@view) @精灵.bitmap = Bitmap.new(617,302) @文字 = Sprite.new(@view) @文字.bitmap = Bitmap.new(617,302) @文字.bitmap.font.size = 15 @文字.bitmap.font.name = ["黑体"] @文字.bitmap.font.color = Color.new(0,0,0) @wenzi = Sprite.new @wenzi.z = 9999 @wenzi.bitmap = Bitmap.new(200,100) @@当前金钱 = $game_party.gold @文字.bitmap.draw_text(@人*121+30,218,80,20,$game_party.actors[@人].name) @文字.bitmap.draw_text(@人*121+30,240,80,20,$game_party.actors[@人].class_name) @文字.bitmap.draw_text(@人*121+30,262,80,20,$game_party.actors[@人].level.to_s) @width = @s.width/4 [url=home.php?mod=space&uid=291977]@height[/url] = @s.height/4 [url=home.php?mod=space&uid=134219]@Time[/url] = 0 @i = 0 end def update if @time%5 == 0 @i +=1 end if @i >=4 @i = 0 end @time += 1 @rect = Rect.new(@i*@width,0,@width,@height) refresh end def refresh 消耗 @wenzi.bitmap.clear @wenzi.bitmap.font.name = "黑体" @wenzi.bitmap.font.size = 15 @wenzi.bitmap.draw_text(0,0,200,100,"所需金钱:"+@@当前金钱.to_s,0) @wenzi.x = 300 @wenzi.y = 100 @精灵.bitmap.clear @精灵.bitmap.blt(@人*110+40,50,@s,@rect) end def 消耗 @@当前金钱 = $game_party.gold*2.4 end def dispose @view.dispose @精灵.dispose @文字.dispose @wenzi.bitmap.dispose end end
class Team # by GKK
def initialize
[url=home.php?mod=space&uid=2667520]@view[/url] = Viewport.new(12,89,617,302)
@view.z = 9998
@back = Sprite.new(@view)
@back.bitmap = RPG::Cache.picture("角色队列.png")
@vieww = Viewport.new(0,0,640,480)
@vieww.z = 9999
@sprite = Sprite.new(@vieww)
@sprite.bitmap = Bitmap.new(640,480)
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@当前金钱 = $game_party.gold
#@当前经验 = $game_party.actors[0].exp
[url=home.php?mod=space&uid=315698]@wenzi[/url] = Sprite.new
@wenzi.z = 9999
@wenzi.bitmap = Bitmap.new(200,100)
@wenzi.bitmap.font.name = "黑体"
@wenzi.bitmap.font.size = 15
@wenzi.bitmap.font.color = Color.new(255,0,0,255)
@wenzi.bitmap.draw_text(0,0,200,100,"当前金钱:"+@当前金钱.to_s)
# @wenzi.bitmap.draw_text(0,0,100,100,"当前金钱:"+@当前经验.exp_s)
@wenzi.x = 50
@wenzi.y = 100
s1 = ""
s2 = ""
s3 = ""
s4 = ""
s5 = ""
@command_window = Window_Command.new(530,[s1,s2,s3,s4,s5])
@command_window.visible = false
@选中 = 0
@角色 = []
for i in 0...$game_party.actors.size
@角色[i] = Renwu.new(i)
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if Input.trigger?(Input::B)
break
end
end
@back.bitmap.dispose
@back.dispose
@sprite.dispose
@sprite.bitmap.dispose
@wenzi.bitmap.dispose
for i in 0...$game_party.actors.size
@角色[i].dispose
end
end
def update
@command_window.update
@command_window.index != @选中
@选中 = @command_window.index
case @command_window.index
when 0
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
when 1
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
when 2
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
when 3
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
when 4
@sprite.bitmap.blt(15,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(140,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(280,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(420,380,RPG::Cache.picture("修炼未选中"),Rect.new(0,0,150,93))
@sprite.bitmap.blt(550,380,RPG::Cache.picture("修炼选中"),Rect.new(0,0,150,93))
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
p "阿尔西斯"
when 1
p“帕吉尔“
when 2
p""塞拉斯""
when 3
p "特萝西"
when 4
p "空"
end
end
for i in 0...$game_party.actors.size
@角色[i].update
end
end
def refresh
for i in 0...$game_party.actors.size
@角色[i].update
end
end
end
class Renwu
def initialize(num)
@偏移 = {
"阿尔西斯" => "100",
"帕吉尔" => "0",
"塞拉斯" => "40",
"特萝西" => "40",
"" => "0",
}
@人 = num
@view = Viewport.new(12,89,617,302)
@view.z = 9999
@s = RPG::Cache.character($game_party.actors[@人].character_name+"_W",0)
[url=home.php?mod=space&uid=51411]@精灵[/url] = Sprite.new(@view)
@精灵.bitmap = Bitmap.new(617,302)
@文字 = Sprite.new(@view)
@文字.bitmap = Bitmap.new(617,302)
@文字.bitmap.font.size = 15
@文字.bitmap.font.name = ["黑体"]
@文字.bitmap.font.color = Color.new(0,0,0)
@wenzi = Sprite.new
@wenzi.z = 9999
@wenzi.bitmap = Bitmap.new(200,100)
@@当前金钱 = $game_party.gold
@文字.bitmap.draw_text(@人*121+30,218,80,20,$game_party.actors[@人].name)
@文字.bitmap.draw_text(@人*121+30,240,80,20,$game_party.actors[@人].class_name)
@文字.bitmap.draw_text(@人*121+30,262,80,20,$game_party.actors[@人].level.to_s)
@width = @s.width/4
[url=home.php?mod=space&uid=291977]@height[/url] = @s.height/4
[url=home.php?mod=space&uid=134219]@Time[/url] = 0
@i = 0
end
def update
if @time%5 == 0
@i +=1
end
if @i >=4
@i = 0
end
@time += 1
@rect = Rect.new(@i*@width,0,@width,@height)
refresh
end
def refresh
消耗
@wenzi.bitmap.clear
@wenzi.bitmap.font.name = "黑体"
@wenzi.bitmap.font.size = 15
@wenzi.bitmap.draw_text(0,0,200,100,"所需金钱:"+@@当前金钱.to_s,0)
@wenzi.x = 300
@wenzi.y = 100
@精灵.bitmap.clear
@精灵.bitmap.blt(@人*110+40,50,@s,@rect)
end
def 消耗
@@当前金钱 = $game_party.gold*2.4
end
def dispose
@view.dispose
@精灵.dispose
@文字.dispose
@wenzi.bitmap.dispose
end
end
|
|