赞 | 3 |
VIP | 32 |
好人卡 | 0 |
积分 | 1 |
经验 | 14756 |
最后登录 | 2021-5-30 |
在线时间 | 579 小时 |
Lv1.梦旅人 小小的百鬼夜行<
- 梦石
- 0
- 星屑
- 54
- 在线时间
- 579 小时
- 注册时间
- 2010-7-29
- 帖子
- 2682
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 退屈£无聊 于 2011-12-10 13:15 编辑
于是居然到现在才来填坑,亲们我错了。
计划之一:http://rpg.blue/thread-202640-1-1.html
计划之二:http://rpg.blue/thread-202724-1-1.html
计划之三:http://rpg.blue/thread-202972-1-1.html
(立绘要求和外援脚本照旧)
注解:要使用的请务必先看计划之一里的介绍!另外请勿挖坟,对前三版有何意见可以在此提出- -。
Part1:- class Scene_Skill
- def initialize(id = 0)
- @id = id
- @actor = $game_party.actors[@id]
- end
- def main
- @bitmap = Spriteset_Map.new
- @person = Sprite.new
- @person.bitmap = Bitmap.new("Graphics/Menu/#{@actor.name}")
- @name = Sprite.new
- @name.bitmap = Bitmap.new(640,480)
- @name.bitmap.font.size = 30
- @name.bitmap.blur_draw_text(0,10,620,70,"施法者 #{@actor.name}",2,
- Color.new(0,187,240,3),5)
- @name.z = 10
- @hpback = Sprite.new
- @hpback.bitmap = Bitmap.new(200,200)
- @hpback.bitmap.font.size = 14
- @hpback.z = 0
- @hp = Sprite.new
- @hp.bitmap = Bitmap.new(200,200)
- @hp.bitmap.font.name = "Arial"
- @hp.bitmap.blur_draw_text(0,0,200,30,"HP",0,Color.new(0,0,0,10),2)
- @hp.bitmap.blur_draw_text(0,25,200,30,"SP",0,Color.new(0,0,0,10),2)
- @hp.bitmap.blur_draw_text(0,0,200,30,"#{@actor.hp}",1,Color.new(0,0,0,10),2)
- @hp.bitmap.blur_draw_text(0,25,200,30,"#{@actor.sp}",1,Color.new(0,0,0,10),2)
- @hp.z = 2
- @z = Sprite.new
- @z.bitmap = Bitmap.new(640,480)
- for i in 0...52
- @z.bitmap.fill_rect(0,i*4,640,4,Color.new(0,0,0,255-5*i))
- @z.bitmap.fill_rect(0,480-i*4,640,4,Color.new(0,0,0,255-5*i))
- end
- @hpback.bitmap.draw_text(10,13,14,14,"○")
- @hpback.bitmap.draw_text(120,13,14,14,"○")
- @hpback.bitmap.fill_rect(16,15,112,1,Color.new(255,255,255))
- @hpback.bitmap.fill_rect(16,24,112,1,Color.new(255,255,255))
- @hpback.bitmap.font.size = 10
- @hpback.bitmap.font.color = Color.new(0,0,0,150)
- @hpback.bitmap.draw_text(11,14,10,10,"●")
- @hpback.bitmap.draw_text(122,14,10,10,"●")
- @hpback.bitmap.fill_rect(16,16,112,8,Color.new(0,0,0,150))
- # SP
- @hpback.bitmap.font.size = 14
- @hpback.bitmap.font.color = Color.new(255,255,255)
- @hpback.bitmap.draw_text(10,13+25,14,14,"○")
- @hpback.bitmap.draw_text(120,13+25,14,14,"○")
- @hpback.bitmap.fill_rect(16,15+25,112,1,Color.new(255,255,255))
- @hpback.bitmap.fill_rect(16,24+25,112,1,Color.new(255,255,255))
- @hpback.bitmap.font.size = 10
- @hpback.bitmap.font.color = Color.new(0,0,0,150)
- @hpback.bitmap.draw_text(11,14+25,10,10,"●")
- @hpback.bitmap.draw_text(122,14+25,10,10,"●")
- @hpback.bitmap.fill_rect(16,16+25,112,8,Color.new(0,0,0,150))
- @hp.x = 20
- @hpback.x = 15
- @hp.y = 300
- @hpback.y = 302
- #hpspbitmap
- @sp = Sprite.new
- @sp.bitmap = Bitmap.new(200,200)
- @sp.bitmap.font.size = 10
- @sp.bitmap.font.color = Color.new(200,0,0,150)
- @sp.bitmap.draw_text(11,14,10,10,"●")
- @sp.bitmap.font.color = Color.new(88,0,0,150)
- @sp.bitmap.draw_text(122,14,10,10,"●")
- for i in 0...112
- @sp.bitmap.fill_rect(16+i,16,1,8,Color.new(200-i,0,0,150))
- end
- @sp1 = Sprite.new
- @sp1.bitmap = @sp.bitmap
- @sp1.tone = Tone.new(0,100,0,0)
- @sp.x = 15
- @sp.y = 302
- @sp.z = 1
- @sp1.x = 15
- @sp1.y = 302+25
- @sp1.z = 1
- @sp.src_rect = Rect.new(0,0,11+(132*((@actor.hp)*1.0/@actor.maxhp)).to_i,200)
- @sp1.src_rect = Rect.new(0,0,11+(132*((@actor.sp)*1.0/@actor.maxsp)).to_i,200)
- # 人物状态篇结束= =
- # 技能描绘(悲剧地开始
- @help = Sprite.new
- @help.bitmap = Bitmap.new(510, 20)
- @help.x = 65
- @help.y = 450
- @help_text = Sprite.new
- @help_text.bitmap = Bitmap.new(510, 20)
- @help_text.bitmap.font.name = "宋体"
- @help_text.bitmap.font.size = 13
- @help_text.x = 65
- @help_text.y = 450
- for i in 0..255/5
- @help.bitmap.fill_rect(i*5,0,5,20,Color.new(0,0,0,i*5))
- @help.bitmap.fill_rect(510-i*5,0,5,20,Color.new(0,0,0,i*5))
- @help.bitmap.fill_rect(i*5, 0, 5, 1, Color.new(255,255,255,i*5))
- @help.bitmap.fill_rect(510-i*5, 0, 5, 1, Color.new(255,255,255,i*5))
- @help.bitmap.fill_rect(i*5, 19, 5, 1, Color.new(255,255,255,i*5))
- @help.bitmap.fill_rect(510-i*5, 19, 5, 1, Color.new(255,255,255,i*5))
- end
- draw_item
- @help_text.bitmap.clear
- @index = 0
- @page = 0
- if @data[@index] != nil
- @help_text.bitmap.draw_text(0,0,510,20,@data[@index].description,1)
- end
- # 差点忘了……
- @give = 0
- @given = []
- @actorname = []
- @actorhp = []
- @gview = Viewport.new(450,250,200,200)
- for i in 0...$game_party.actors.size
- @given[i] = Sprite.new(@gview)
- @given[i].bitmap = RPG::Cache.character(
- $game_party.actors[i].character_name,$game_party.actors[i].character_hue)
- @given[i].src_rect = Rect.new(0,
- (@given[i].bitmap.height/4.0).to_i,
- (@given[i].bitmap.width/4.0).to_i,(@given[i].bitmap.height/4.0).to_i)
- @given[i].x = 30*i
- @given[i].tone = Tone.new(0,0,0,255) if i != 0
- @actorname[i] = Sprite.new(@gview)
- @actorname[i].y = 60
- @actorname[i].bitmap = Bitmap.new(200,130)
- @actorname[i].bitmap.draw_text(0,0,100,30,$game_party.actors[i].name,
- 0)
- @actorname[i].bitmap.font.size = 13
- @actorhp[i] = Sprite.new(@gview)
- @actorhp[i].y = 80
- @actorhp[i].bitmap = Bitmap.new(200,80)
- @actorhp[i].bitmap.font.size = 11
- @actorhp[i].bitmap.draw_text(0,0,150,30,
- "HP:#{$game_party.actors[i].hp}/#{$game_party.actors[i].maxhp}",2)
- @actorhp[i].bitmap.draw_text(0,15,150,30,
- "SP:#{$game_party.actors[i].sp}/#{$game_party.actors[i].maxsp}",2)
- @actorhp[i].x = 200 if i != 0
- @actorname[i].x = -200 if i != 0
- end
- loop do
- Graphics.update
- update
- break if $scene != self
- end
- @given.each {|a| a.dispose}
- @actorname.each {|a| a.dispose}
- @actorhp.each {|a| a.dispose}
- @item.dispose
- @item_back.dispose
- @iback.dispose
- @z.dispose
- @person.dispose
- @hpback.dispose
- @hp.dispose
- @sp1.dispose
- @sp.dispose
- @bitmap.dispose
- @help.dispose
- @help_text.dispose
- end
- def update
- @iback.update
- actor_choose and return if @chooseactor
- update_input
- end
- def update_input
- Input.update
- index_change(true) if Input.trigger?(Input::DOWN)
- index_change if Input.trigger?(Input::UP)
- $scene = Scene_Menu.new and $game_system.se_play($data_system.cancel_se) if Input.trigger?(Input::B)
- @chooseactor = true and $game_system.se_play($data_system.decision_se) if Input.trigger?(Input::C)
- end
- def index_change(plus=false)
- if plus
- return if @index >= @max - 1
- page(true) if @index >= 9 + @page
- @index += 1
- @iback.y = 4 + @index * 30 - @page * 30
- else
- return if @index <= 0
- page if @index <= @page
- @index -= 1
- @iback.y = 4 + @index * 30 - @page * 30
- end
- $game_system.se_play($data_system.cursor_se)
- @help_text.bitmap.clear
- if @data[@index] != nil
- @help_text.bitmap.draw_text(0,0,510,20,@data[@index].description,1)
- end
- end
- def page(plus=false)
- if plus
- @page += 1
- @item.y -= 30
- @item_back.y -= 30
- else
- return if @page <= 0
- @page -= 1
- @item.y += 30
- @item_back.y += 30
- end
- end
- def draw_item
- @viewport = Viewport.new(170,100,300,300)
- @item = Sprite.new(@viewport)
- @item_back = Sprite.new(@viewport)
- @item_back.bitmap = Bitmap.new(640,480)
- @item.z = 5
- @item_back.z = 3
- @item_back.opacity = 100
- @item.bitmap = Bitmap.new(640,480)
- @item.bitmap.font.size = 14
- @data = []
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- bitmap = Bitmap.new(300,22)
- bitmap.font.size = 22
- bitmap.font.color = Color.new(0,0,0)
- for i in 0...250
- bitmap.draw_text(i,0,22,22,"●")
- end
- @iback = RPG::Sprite.new(@viewport)
- @iback.bitmap = bitmap
- @iback.blink_on
- @iback.z = 8000
- @iback.y = 4
- @iback.z = 3
- d = 0
- @max = 0
- @data.each {|c| @max += 1
- @item_back.bitmap.blt(0,d+4,bitmap,Rect.new(0,0,bitmap.width,bitmap.height))
- @item.bitmap.blt(10,d+2,RPG::Cache.icon(c.icon_name),Rect.new(0,0,32,22))
- if @actor.skill_can_use?(c.id)
- @item.bitmap.font.color = Color.new(255,255,255)
- else
- @item.bitmap.font.color = Color.new(255,255,255,100)
- end
- @item.bitmap.draw_text(40,d,300,30,c.name)
- @item.bitmap.draw_text(0,d,252,30,c.sp_cost.to_s, 2)
- d += 30}
- end
- end
复制代码 Part2:- class Scene_Skill
- def actor_choose
- Input.update
- c_change(true) if Input.trigger?(Input::RIGHT)
- c_change if Input.trigger?(Input::LEFT)
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @chooseactor = false
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 获取特技窗口现在选择的特技的数据
- @skill = @data[@index]
- # 不能使用的情况下
- if @skill == nil or not @actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 效果范围是我方的情况下
- if @skill.scope >= 3
- use_skill
- # 效果在我方以外的情况下
- else
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口的内容
- again_draw
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- return
- end
- end
- def c_change(plus=false)
- if plus
- return if @give >= $game_party.actors.size-1
- @give += 1
- else
- return if @give <= 0
- @give -= 1
- end
- for i in [email protected]
- @actorname[i].visible = false if i != @give
- @actorhp[i].visible = false if i != @give
- @actorname[i].x = -200 if i != @give
- @actorhp[i].x = 200 if i != @give
- @given[i].tone = Tone.new(0,0,0,255) if i != @give
- end
- @actorname[@give].visible = true
- @actorhp[@give].visible = true
- for i in 0...10
- @actorname[@give].x += 20
- @actorhp[@give].x -= 20
- @given[@give].tone = Tone.new(0,0,0,255-30*i)
- Graphics.update
- end
- $game_system.se_play($data_system.cursor_se)
- end
- def use_skill
- # 目标是全体的情况下
- if @skill.scope == 4 || @skill.scope == 6
- # 对同伴全体应用特技使用效果
- used = false
- for i in $game_party.actors
- used |= i.skill_effect(@actor, @skill)
- end
- end
- # 目标是使用者的情况下
- if @skill.scope == 7
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@id]
- used = target.skill_effect(@actor, @skill)
- end
- # 目标是单体的情况下
- if @give >= 0
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@give]
- used = target.skill_effect(@actor, @skill)
- end
- # 使用特技的情况下
- if used
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口内容
- again_draw
- # 全灭的情况下
- if $game_party.all_dead?
- # 切换到游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- # 无法使用特技的情况下
- unless used
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- end
- end
- def again_draw
- rect = Rect.new(0,@index * 30,640,30)
- @item.bitmap.fill_rect(rect, Color.new(0,0,0,0))
- @item.bitmap.blt(10,rect.y+2,
- RPG::Cache.icon(@data[@index].icon_name),Rect.new(0,0,32,22))
- if @actor.skill_can_use?(@data[@index].id)
- @item.bitmap.font.color = Color.new(255,255,255)
- else
- @item.bitmap.font.color = Color.new(255,255,255,100)
- end
- @item.bitmap.draw_text(40,rect.y,300,30,@data[@index].name)
- @item.bitmap.draw_text(0,rect.y,252,30,@data[@index].sp_cost.to_s, 2)
- for i in 0...$game_party.actors.size
- @actorhp[i].bitmap.clear
- @actorhp[i].bitmap.font.size = 11
- @actorhp[i].bitmap.draw_text(0,0,150,30,
- "HP:#{$game_party.actors[i].hp}/#{$game_party.actors[i].maxhp}",2)
- @actorhp[i].bitmap.draw_text(0,15,150,30,
- "SP:#{$game_party.actors[i].sp}/#{$game_party.actors[i].maxsp}",2)
- end
- @sp.src_rect = Rect.new(0,0,11+(132*((@actor.hp)*1.0/@actor.maxhp)).to_i,200)
- @sp1.src_rect = Rect.new(0,0,11+(132*((@actor.sp)*1.0/@actor.maxsp)).to_i,200)
- @hp.bitmap.clear
- @hp.bitmap.blur_draw_text(0,0,200,30,"HP",0,Color.new(0,0,0,20),2)
- @hp.bitmap.blur_draw_text(0,25,200,30,"SP",0,Color.new(0,0,0,20),2)
- @hp.bitmap.blur_draw_text(0,0,200,30,"#{@actor.hp}",1,Color.new(0,0,0,20),2)
- @hp.bitmap.blur_draw_text(0,25,200,30,"#{@actor.sp}",1,Color.new(0,0,0,20),2)
- end
- end
复制代码 欢迎诸位提出BUG和建议- - |
评分
-
查看全部评分
|