蛐蛐儿的简约(渣)菜单计划(三)
计划之一:http://rpg.blue/thread-202640-1-1.html计划之二:http://rpg.blue/thread-202724-1-1.html
这次是装备界面- -,各种赶工。
各种外援脚本及立绘照旧。
截图:
正文:
part1:class Scene_Equipdef initialize(id=0) @id = id @actor = $game_party.actors[@id]enddef 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 = RPG::Sprite.new @equip_rect.bitmap = rect @equip_rect.x = 150 + 44 * i @equip_rect.y = 200 @equip = Sprite.new @equip.bitmap = Bitmap.new(40,204) @equip.x = 150 + 44 * i @equip.y = 200 @equip.bitmap.font.size = 12 if i == 0 @equip.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.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.bitmap.blur_draw_text(0,70+16*b,40,16, a,1,Color.new(0,0,0,10),2)} else eval "@equip.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.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.bitmap.blur_draw_text(0,70+16*b,40,16, a,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 = Sprite.new(viewport) @new_equip.bitmap = Bitmap.new(204,200) @new_equip.x = 204 * i @new_equip.bitmap.font.size = 12 @new_equip.bitmap.draw_text(40,30,184,12,"[脱下装备]") @data.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.bitmap.blt(10,y-6, RPG::Cache.icon($data_weapons.icon_name),Rect.new(0,0,24,20)) @new_equip.bitmap.draw_text(40,y,184,12,$data_weapons.name) @new_equip.bitmap.draw_text(40,y,140,12,$game_party.weapon_number(n).to_s,2) @data.push($data_weapons) 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.kind == i-1 @new_equip.bitmap.blt(10,y-6, RPG::Cache.icon($data_armors.icon_name),Rect.new(0,0,24,20)) @new_equip.bitmap.draw_text(40,y,184,12,$data_armors.name) @new_equip.bitmap.draw_text(40,y,140,12,$game_party.armor_number(n).to_s,2) @data.push($data_armors) 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.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.disposeenddef 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_inputenddef 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)enddef 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_indexparameter_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}")enddef 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)endend复制代码part2:class Scene_Equipdef 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.icon_name),Rect.new(0,0,24,20)) @new_equip[@left_index].bitmap.draw_text(40,y,184,12,$data_weapons.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) 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.kind == @left_index-1 @new_equip[@left_index].bitmap.blt(10,y-6, RPG::Cache.icon($data_armors.icon_name),Rect.new(0,0,24,20)) @new_equip[@left_index].bitmap.draw_text(40,y,184,12,$data_armors.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) 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,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,1,Color.new(0,0,0,10),2)} end return endenddef 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
页:
[1]