赞 | 3 |
VIP | 32 |
好人卡 | 0 |
积分 | 1 |
经验 | 14756 |
最后登录 | 2021-5-30 |
在线时间 | 579 小时 |
Lv1.梦旅人 小小的百鬼夜行<
- 梦石
- 0
- 星屑
- 54
- 在线时间
- 579 小时
- 注册时间
- 2010-7-29
- 帖子
- 2682
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 退屈£无聊 于 2011-8-29 20:27 编辑
计划之一:http://rpg.blue/thread-202640-1-1.html
计划之二:http://rpg.blue/thread-202724-1-1.html
这次是装备界面- -,各种赶工。
各种外援脚本及立绘照旧。
截图:
正文:
part1:- class Scene_Equip
- def initialize(id=0)
- @id = id
- @actor = $game_party.actors[@id]
- end
- def main
- @bitmap = Spriteset_Map.new
- @back = Sprite.new
- @back.bitmap = Bitmap.new(640,480)
- @back.bitmap.fill_rect(0,0,640,480,Color.new(0,0,0,100))
- @person = Sprite.new
- @person.bitmap = Bitmap.new("Graphics/Menu/#{@actor.name}")
- @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
- rect = Bitmap.new(40,204)
- for i in 0..51
- rect.fill_rect(0,i*2,40,2,Color.new(0,0,0,i*5))
- rect.fill_rect(0,204-i*2,40,2,Color.new(0,0,0,i*5))
- rect.fill_rect(0,i*2,1,2,Color.new(255,255,255,i*5))
- rect.fill_rect(0,204-i*2,1,2,Color.new(255,255,255,i*5))
- rect.fill_rect(39,i*2,1,2,Color.new(255,255,255,i*5))
- rect.fill_rect(39,204-i*2,1,2,Color.new(255,255,255,i*5))
- end
- @equip_rect = []
- @equip = []
- for i in 0...5
- @equip_rect[i] = RPG::Sprite.new
- @equip_rect[i].bitmap = rect
- @equip_rect[i].x = 150 + 44 * i
- @equip_rect[i].y = 200
- @equip[i] = Sprite.new
- @equip[i].bitmap = Bitmap.new(40,204)
- @equip[i].x = 150 + 44 * i
- @equip[i].y = 200
- @equip[i].bitmap.font.size = 12
- if i == 0
- @equip[i].bitmap.blur_draw_text(0,40,40,24,$data_system.words.weapon,1,
- Color.new(0,0,0,10),2)
- next if $data_weapons[@actor.weapon_id].nil?
- @equip[i].bitmap.blt(8,12,
- RPG::Cache.icon($data_weapons[@actor.weapon_id].icon_name),Rect.new(0,0,24,24))
- a = $data_weapons[@actor.weapon_id].name.scan(/./)
- a.each_index {|b| @equip[i].bitmap.blur_draw_text(0,70+16*b,40,16,
- a[b],1,Color.new(0,0,0,10),2)}
- else
- eval "@equip[i].bitmap.blur_draw_text(0,
- 40,40,24,$data_system.words.armor#{i},1,Color.new(0,0,0,10),2)"
- eval "next if $data_armors[@actor.armor#{i}_id].nil?"
- eval "b = RPG::Cache.icon($data_armors[@actor.armor#{i}_id].icon_name)"
- eval "@equip[i].bitmap.blt(8,12,b,Rect.new(0,0,24,24))"
- eval "a = $data_armors[@actor.armor#{i}_id].name.scan(/./)"
- a.each_index {|b| @equip[i].bitmap.blur_draw_text(0,70+16*b,40,16,
- a[b],1,Color.new(0,0,0,10),2)}
- end
- end
- @status_back = Sprite.new
- @status_back.bitmap = Bitmap.new(306,120)
- @status_back.y = 25
- @status_back.x = 300
- for i in 0...52
- @status_back.bitmap.fill_rect(i*3,0,3,200,Color.new(0,0,0,i*5))
- @status_back.bitmap.fill_rect(306-i*3,0,3,200,Color.new(0,0,0,i*5))
- @status_back.bitmap.fill_rect(i*3,0,3,1,Color.new(255,255,255,i*5))
- @status_back.bitmap.fill_rect(306-i*3,0,3,1,Color.new(255,255,255,i*5))
- @status_back.bitmap.fill_rect(i*3,119,3,1,Color.new(255,255,255,i*5))
- @status_back.bitmap.fill_rect(306-i*3,119,3,1,Color.new(255,255,255,i*5))
- @status_back.bitmap.fill_rect(153,40,1,70,Color.new(255,255,255))
- end
- @status = Sprite.new
- @status.bitmap = Bitmap.new(306,120)
- @status.y = 25
- @status.x = 300
- @status.bitmap.font.size = 15
- @status.bitmap.draw_text(50,10,600,15,"#{@actor.name} Lv#{@actor.level}")
- @status.bitmap.font.size = 12
- for i in 0..6
- draw_par(i)
- end
- @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
- @change_equip = Sprite.new
- @change_equip.bitmap = Bitmap.new(204,200)
- @change_equip.x = 400
- @change_equip.y = 200
- @new_equip = []
- @data = [[],[],[],[],[]]
- 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))
- @change_equip.bitmap.fill_rect(2*i,0,2,200,Color.new(0,0,0,50+5*i))
- @change_equip.bitmap.fill_rect(204-2*i,0,2,200,Color.new(0,0,0,50+5*i))
- @change_equip.bitmap.fill_rect(2*i,0,2,1,Color.new(255,255,255,5*i))
- @change_equip.bitmap.fill_rect(2*i,199,2,1,Color.new(255,255,255,5*i))
- @change_equip.bitmap.fill_rect(204-2*i,199,2,1,Color.new(255,255,255,5*i))
- @change_equip.bitmap.fill_rect(204-2*i,0,2,1,Color.new(255,255,255,5*i))
- end
- viewport = Viewport.new(400,200,204,200)
- @equip_choose = RPG::Sprite.new(viewport)
- @equip_choose.bitmap = @help.bitmap.clone
- @equip_choose.zoom_x = 164 / 510.0
- @equip_choose.x = 20
- @equip_choose.zoom_y = 14 / 20.0
- @equip_choose.y = 28
- for i in 0...5
- @new_equip[i] = Sprite.new(viewport)
- @new_equip[i].bitmap = Bitmap.new(204,200)
- @new_equip[i].x = 204 * i
- @new_equip[i].bitmap.font.size = 12
- @new_equip[i].bitmap.draw_text(40,30,184,12,"[脱下装备]")
- @data[i].push(-1)
- y = 44
- if i == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for n in 1...$data_weapons.size
- if $game_party.weapon_number(n) > 0 and weapon_set.include?(n)
- @new_equip[i].bitmap.blt(10,y-6,
- RPG::Cache.icon($data_weapons[n].icon_name),Rect.new(0,0,24,20))
- @new_equip[i].bitmap.draw_text(40,y,184,12,$data_weapons[n].name)
- @new_equip[i].bitmap.draw_text(40,y,140,12,$game_party.weapon_number(n).to_s,2)
- @data[i].push($data_weapons[n])
- y += 14
- end
- end
- end
- if i != 0
- armor_set = $data_classes[@actor.class_id].armor_set
- for n in 1...$data_armors.size
- if $game_party.armor_number(n) > 0 and armor_set.include?(n)
- if $data_armors[n].kind == i-1
- @new_equip[i].bitmap.blt(10,y-6,
- RPG::Cache.icon($data_armors[n].icon_name),Rect.new(0,0,24,20))
- @new_equip[i].bitmap.draw_text(40,y,184,12,$data_armors[n].name)
- @new_equip[i].bitmap.draw_text(40,y,140,12,$game_party.armor_number(n).to_s,2)
- @data[i].push($data_armors[n])
- y += 14
- end
- end
- end
- end
- end
- if !$data_weapons[@actor.weapon_id].nil?
- @help_text.bitmap.draw_text(0,0,510,20,
- $data_weapons[@actor.weapon_id].description,1)
- end
- @equip_choose.visible = false
- @equip_rect[0].blink_on
- @left_index = 0 # 装备位的选择
- @right = false # 右边是否选择
- @right_index = -1 # 新装备的选择
- @page = 0 # 同ITEM
- loop {update; break if $scene != self}
- @equip_rect.each {|a| a.bitmap.dispose ; a.dispose}
- @equip.each {|a| a.bitmap.dispose ; a.dispose}
- @bitmap.dispose
- @back.dispose
- @back.dispose
- @z.bitmap.dispose
- @z.dispose
- @person.dispose
- @change_equip.bitmap.dispose; @change_equip.dispose
- @new_equip.each {|a| a.bitmap.dispose;a.dispose}
- @equip_choose.dispose
- end
- def update
- Graphics.update
- @equip_rect.each {|a| a.update} if !@right
- @equip_choose.visible = true if !@equip_choose.visible && @right
- @equip_choose.visible = false if !@right && @equip_choose.visible
- @equip_choose.blink_on if !@equip_choose.blink? && @equip_choose.visible
- @equip_choose.update if @equip_choose.visible
- update_change if @right
- return if @right
- update_input
- end
- def update_input
- Input.update
- left_index(true) if Input.trigger?(Input::RIGHT)
- left_index if Input.trigger?(Input::LEFT)
- if Input.trigger?(Input::C)
- @right_index = 0
- @right = true
- new_actor
- $game_system.se_play($data_system.decision_se)
- end
- $scene = Scene_Menu.new and $game_system.se_play($data_system.cancel_se) if Input.trigger?(Input::B)
- end
- def left_index(plus=false)
- if plus
- return if @left_index >= 4
- @left_index += 1
- @equip_rect.each {|a| a.blink_off}
- @equip_rect[@left_index].blink_on
- for i in 0...12
- @new_equip.each {|a| a.x -= 17}
- Graphics.update
- end
- else
- return if @left_index <= 0
- @left_index -= 1
- @equip_rect.each {|a| a.blink_off}
- @equip_rect[@left_index].blink_on
- for i in 0...12
- @new_equip.each {|a| a.x += 17}
- Graphics.update
- end
- end
- $game_system.se_play($data_system.cursor_se)
- @help_text.bitmap.clear
- if @left_index == 0
- if !$data_weapons[@actor.weapon_id].nil?
- @help_text.bitmap.draw_text(0,0,510,20,
- $data_weapons[@actor.weapon_id].description,1)
- end
- else
- eval "return if $data_armors[@actor.armor#{@left_index}_id].nil?"
- eval "@help_text.bitmap.draw_text(0,0,510,20,
- $data_armors[@actor.armor#{@left_index}_id].description,1)"
- end
- end
- def draw_par(type)
- @status.bitmap.fill_rect(type / 4 == 0 ? 27 : 170, 40 + (15 * (type % 4)),
- 126,15,Color.new(0,0,0,0))
- case type
- when 0
- parameter_name = $data_system.words.atk
- parameter_value = @actor.atk
- when 1
- parameter_name = $data_system.words.pdef
- parameter_value = @actor.pdef
- when 2
- parameter_name = $data_system.words.mdef
- parameter_value = @actor.mdef
- when 3
- parameter_name = $data_system.words.str
- parameter_value = @actor.str
- when 4
- parameter_name = $data_system.words.dex
- parameter_value = @actor.dex
- when 5
- parameter_name = $data_system.words.agi
- parameter_value = @actor.agi
- when 6
- parameter_name = $data_system.words.int
- parameter_value = @actor.int
- end
- @status.bitmap.draw_text(type / 4 == 0 ? 27 : 170, 40 + (15 * (type % 4)),
- 126,15,"#{parameter_name}:#{parameter_value}")
- end
- def draw_par_new(type)
- @status.bitmap.fill_rect(type / 4 == 0 ? 27 : 170, 40 + (15 * (type % 4)),
- 126,15,Color.new(0,0,0,0))
- case type
- when 0
- parameter_name = $data_system.words.atk
- old_value = @actor.atk
- parameter_value = @new_actor.atk
- when 1
- old_value = @actor.pdef
- parameter_name = $data_system.words.pdef
- parameter_value = @new_actor.pdef
- when 2
- parameter_name = $data_system.words.mdef
- old_value = @actor.mdef
- parameter_value = @new_actor.mdef
- when 3
- parameter_name = $data_system.words.str
- old_value = @actor.str
- parameter_value = @new_actor.str
- when 4
- parameter_name = $data_system.words.dex
- old_value = @actor.dex
- parameter_value = @new_actor.dex
- when 5
- parameter_name = $data_system.words.agi
- old_value = @actor.agi
- parameter_value = @new_actor.agi
- when 6
- parameter_name = $data_system.words.int
- old_value = @actor.int
- parameter_value = @new_actor.int
- end
- if old_value > parameter_value
- updown = "↓"
- elsif old_value < parameter_value
- updown = "↑"
- else
- updown = "→"
- end
- @status.bitmap.draw_text(type / 4 == 0 ? 27 : 170, 40 + (15 * (type % 4)),
- 126,15,"#{parameter_name}:#{old_value} #{updown} #{parameter_value}")
- end
- def new_actor
- @new_actor = @actor.clone
- if @left_index == 0
- old_item = $data_weapons[@new_actor.weapon_id]
- else
- eval "old_item = $data_armors[@new_actor.armor#{@left_index}_id]"
- end
- item = @data[@left_index][@right_index]
- @new_actor.equip(@left_index, (item == nil || item == -1) ? 0 : item.id)
- for i in 0..6
- draw_par_new(i)
- end
- @new_actor.equip(@left_index, (old_item == nil || old_item == -1) ? 0 : old_item.id)
- end
- end
复制代码 part2:- class Scene_Equip
- def update_change
- Input.update
- @help_text.bitmap.clear
- if @data[@left_index][@right_index] != nil && @data[@left_index][@right_index]!= -1
- @help_text.bitmap.draw_text(0,0,510,20,@data[@left_index][@right_index].description,1)
- end
- if Input.trigger?(Input::B)
- @right = false
- @right_index = 0
- @equip_choose.visible = false
- @equip_choose.blink_off
- @page = 0
- @new_equip[@left_index].y = 0
- for i in 0..6
- draw_par(i)
- end
- return
- end
- right_index(true) if Input.trigger?(Input::DOWN)
- right_index if Input.trigger?(Input::UP)
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.equip_se)
- item = @data[@left_index][@right_index]
- @actor.equip(@left_index, (item == nil || item == -1) ? 0 : item.id)
- @new_equip[@left_index].bitmap.clear
- @data[@left_index] = []
- @new_equip[@left_index].bitmap.draw_text(40,30,184,12,"[脱下装备]")
- @data[@left_index].push(-1)
- y = 44
- if @left_index == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for n in 1...$data_weapons.size
- if $game_party.weapon_number(n) > 0 and weapon_set.include?(n)
- @new_equip[@left_index].bitmap.blt(10,y-6,
- RPG::Cache.icon($data_weapons[n].icon_name),Rect.new(0,0,24,20))
- @new_equip[@left_index].bitmap.draw_text(40,y,184,12,$data_weapons[n].name)
- @new_equip[@left_index].bitmap.draw_text(40,y,140,12,$game_party.weapon_number(n).to_s,2)
- @data[@left_index].push($data_weapons[n])
- y += 14
- end
- end
- end
- if @left_index != 0
- armor_set = $data_classes[@actor.class_id].armor_set
- for n in 1...$data_armors.size
- if $game_party.armor_number(n) > 0 and armor_set.include?(n)
- if $data_armors[n].kind == @left_index-1
- @new_equip[@left_index].bitmap.blt(10,y-6,
- RPG::Cache.icon($data_armors[n].icon_name),Rect.new(0,0,24,20))
- @new_equip[@left_index].bitmap.draw_text(40,y,184,12,$data_armors[n].name)
- @new_equip[@left_index].bitmap.draw_text(40,y,140,12,$game_party.armor_number(n).to_s,2)
- @data[@left_index].push($data_armors[n])
- y += 14
- end
- end
- end
- end
- @equip[@left_index].bitmap.clear
- @equip[@left_index].bitmap.font.size = 12
- @right_index = 0
- @page = 0
- @new_equip[@left_index].y = 0
- @equip_choose.y = @right_index * 14 + 28
- @help_text.bitmap.clear
- if @data[@left_index][@right_index] != nil && @data[@left_index][@right_index]!= -1
- @help_text.bitmap.draw_text(0,0,510,20,@data[@left_index][@right_index].description,1)
- end
- for i in 0..6
- draw_par(i)
- end
- if @left_index == 0
- @equip[@left_index].bitmap.blur_draw_text(0,40,40,24,$data_system.words.weapon,1,
- Color.new(0,0,0,10),2)
- return if $data_weapons[@actor.weapon_id].nil?
- @equip[@left_index].bitmap.blt(8,12,
- RPG::Cache.icon($data_weapons[@actor.weapon_id].icon_name),Rect.new(0,0,24,24))
- a = $data_weapons[@actor.weapon_id].name.scan(/./)
- a.each_index {|b| @equip[@left_index].bitmap.blur_draw_text(0,70+16*b,40,16,
- a[b],1,Color.new(0,0,0,10),2)}
- else
- eval "@equip[@left_index].bitmap.blur_draw_text(0,
- 40,40,24,$data_system.words.armor#{@left_index},1,Color.new(0,0,0,10),2)"
- eval "return if $data_armors[@actor.armor#{@left_index}_id].nil?"
- eval "b = RPG::Cache.icon($data_armors[@actor.armor#{@left_index}_id].icon_name)"
- eval "@equip[@left_index].bitmap.blt(8,12,b,Rect.new(0,0,24,24))"
- eval "a = $data_armors[@actor.armor#{@left_index}_id].name.scan(/./)"
- a.each_index {|b| @equip[@left_index].bitmap.blur_draw_text(0,70+16*b,40,16,
- a[b],1,Color.new(0,0,0,10),2)}
- end
- return
- end
- end
- def right_index(plus=false)
- if plus
- return if @right_index >= @data[@left_index].size - 1
- @right_index += 1
- page(true) if @right_index >= @page + 10
- @equip_choose.y = @right_index * 14 - @page * 14 + 28
- else
- return if @right_index <= 0
- @right_index -= 1
- page if @right_index <= @page
- @equip_choose.y = @right_index * 14 - @page * 14 + 28
- end
- $game_system.se_play($data_system.cursor_se)
- new_actor
- @help_text.bitmap.clear
- if @data[@left_index][@right_index] != nil && @data[@left_index][@right_index]!= -1
- @help_text.bitmap.draw_text(0,0,510,20,@data[@left_index][@right_index].description,1)
- end
- end
- def page(plus = false)
- if plus
- @page += 1
- @new_equip[@left_index].y -= 14
- else
- @page -= 1
- @new_equip[@left_index].y += 14
- end
- end
- end
复制代码 各种破限脚本一边凉快去。 |
评分
-
查看全部评分
|