Commit aab554d9 authored by 神楽坂玲奈's avatar 神楽坂玲奈

决斗盘布局更换,卡片效果文字描绘加入动画,一帧一个字

parent acef34a4
...@@ -202,11 +202,9 @@ class Action ...@@ -202,11 +202,9 @@ class Action
ChangePhase.new(from_player, parse_phase($1)) ChangePhase.new(from_player, parse_phase($1))
else else
p str, 1 p str, 1
#system("pause")
end end
else else
p str, 2 p str, 2
#system("pause")
end end
result.id = id result.id = id
result result
...@@ -387,7 +385,7 @@ end ...@@ -387,7 +385,7 @@ end
class Game_Field class Game_Field
def escape def escape
"LP:#{@lp}\r\n手卡:#{@hand.size}\r\n卡组:#{@deck.size}\r\n墓地:#{@graveyard.size}\r\n除外:#{@removed.size}\r\n前场:\r\n" + "LP:#{@lp}\r\n手卡:#{@hand.size}\r\n卡组:#{@deck.size}\r\n墓地:#{@graveyard.size}\r\n除外:#{@removed.size}\r\n前场:\r\n" +
@field[6..10].collect{|card|" <#{"#{escape_position_short(card)}|#{card.position == :set ? '??' : "[#{card.card_type}][#{card.name}] #{card.atk}#{' '+card.def.to_s}"}" if card}>\r\n"}.join + @field[6..10].collect{|card|" <#{"#{Action.escape_position_short(card)}|#{card.position == :set ? '??' : "[#{card.card_type}][#{card.name}] #{card.atk}#{' '+card.def.to_s}"}" if card}>\r\n"}.join +
"后场:" + "后场:" +
@field[1..5].collect{|card|"<#{card.position == :set ? '??' : card.escape if card}>"}.join + @field[1..5].collect{|card|"<#{card.position == :set ? '??' : card.escape if card}>"}.join +
"\r\n场地|<#{@field[0] ? @field[0].escape : '无'}>\r\n" + "\r\n场地|<#{@field[0] ? @field[0].escape : '无'}>\r\n" +
......
...@@ -51,9 +51,9 @@ class Scene_Duel < Scene ...@@ -51,9 +51,9 @@ class Scene_Duel < Scene
Action.player_field = @player_field Action.player_field = @player_field
Action.opponent_field = @opponent_field Action.opponent_field = @opponent_field
@cardinfo_window = Window_CardInfo.new(1024-160, 0) @cardinfo_window = Window_CardInfo.new(715, 0)
@action_window = Window_Action.new @action_window = Window_Action.new
@chat_window = Window_RoomChat.new(716, 567, 307, 203) @chat_window = Window_RoomChat.new(@cardinfo_window.x, @cardinfo_window.height, 1024-@cardinfo_window.x, 768-@cardinfo_window.height)
end end
def change_phase(phase) def change_phase(phase)
...@@ -75,7 +75,6 @@ class Scene_Duel < Scene ...@@ -75,7 +75,6 @@ class Scene_Duel < Scene
def first_to_go def first_to_go
Action::FirstToGo.new(true).run Action::FirstToGo.new(true).run
end end
def handle(event) def handle(event)
case event case event
when Event::MouseMotion when Event::MouseMotion
...@@ -157,10 +156,11 @@ class Scene_Duel < Scene ...@@ -157,10 +156,11 @@ class Scene_Duel < Scene
end end
end end
def update def update
super @cardinfo_window.update
while event = Iduel::Event.poll while event = Iduel::Event.poll
handle_iduel(event) handle_iduel(event)
end end
super
end end
def refresh_rect(x, y, width, height) def refresh_rect(x, y, width, height)
return unless $scene == self #线程的情况 return unless $scene == self #线程的情况
......
...@@ -6,7 +6,7 @@ class Window_Action < Window_List ...@@ -6,7 +6,7 @@ class Window_Action < Window_List
Color_Disabled = [0x66,0x66,0x66] Color_Disabled = [0x66,0x66,0x66]
Color_Selected = [0x00,0x00,0xFF] Color_Selected = [0x00,0x00,0xFF]
def initialize#,list,list_available=Array.new(list.size, true)) def initialize#,list,list_available=Array.new(list.size, true))
super(0,0,100,20*WLH,300) super(0,0,96,20*WLH,300)
@background.fill_rect(0,0,@width, @height, 0xCC555500) @background.fill_rect(0,0,@width, @height, 0xCC555500)
@contents.fill_rect(0,0,@width, @height, 0xCC555500) @contents.fill_rect(0,0,@width, @height, 0xCC555500)
@font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16) @font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class Window_CardInfo < Window class Window_CardInfo < Window
WLH = 20 WLH = 20
def initialize(x,y) def initialize(x,y)
super(x,y,160,768,300) super(x,y,1024-x,530,300)
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16) @font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
self.card = nil self.card = nil
end end
...@@ -12,22 +12,38 @@ class Window_CardInfo < Window ...@@ -12,22 +12,38 @@ class Window_CardInfo < Window
@card = card || Card.find(nil) @card = card || Card.find(nil)
refresh refresh
end end
def refresh def update
@contents.put @card.image,0,0 if @lore_start
@contents.fill_rect(0,230, @width, @height-230,0xCC005555) if @lore_start >= @card.lore.size
@font.draw_blended_utf8(@contents, "[#{@card.name}]", 0, 230, 0xFF, 0xFF, 0x55) @lore_start = nil #停止描绘
return
start = 0
line = 0
@card.lore.size.times do |char|
if @font.text_size(@card.lore[start..char])[0] > @width
@font.draw_blended_utf8(@contents, @card.lore[start...char], 0, 254+line*WLH, 0xFF, 0xFF, 0xFF)
start = char
line = line.next
end end
char = @card.lore[@lore_start]
width = @font.text_size(char)[0]
if @lore_pos[0] + width > @width
@lore_pos[0] = 0
@lore_pos[1] += WLH
end
@font.draw_blended_utf8(@contents, char, @lore_pos[0], @lore_pos[1], 0xFF, 0xFF, 0xFF)
@lore_pos[0] += width
@lore_start += 1
end end
if start <= @card.lore.size - 1 end
@font.draw_blended_utf8(@contents, @card.lore[start...@card.lore.size], 0, 254+line*WLH, 0xFF, 0xFF, 0xFF) def refresh
@contents.fill_rect(0,0, @width, @height,0xCC005555)
@contents.put @card.image,0,0
@font.draw_blended_utf8(@contents, "[#{@card.name}]", 160, 0, 0xFF, 0xFF, 0x55)
@font.draw_blended_utf8(@contents, "卡类: #{@card.card_type}", 160, WLH, 0xFF, 0xFF, 0x55)
if @card.monster?
@font.draw_blended_utf8(@contents, "种族: #{@card.type}", 160, WLH*2, 0xFF, 0xFF, 0xFF)
@font.draw_blended_utf8(@contents, "星级: #{@card.level}", 160, WLH*3, 0xFF, 0xFF, 0xFF)
@font.draw_blended_utf8(@contents, "攻击力: #{@card.atk}", 160, WLH*4, 0xFF, 0xFF, 0xFF)
@font.draw_blended_utf8(@contents, "防御力: #{@card.def}", 160, WLH*5, 0xFF, 0xFF, 0xFF)
end end
@lore_start = 0
@lore_pos = [0, 234]
end end
end end
...@@ -6,10 +6,10 @@ class Window_RoomChat < Window ...@@ -6,10 +6,10 @@ class Window_RoomChat < Window
Player_Color = [0,0,0xFF] Player_Color = [0,0,0xFF]
Opponent_Color = [0x66,0x66,0] Opponent_Color = [0x66,0x66,0]
def initialize(x, y, width, height) def initialize(x, y, width, height)
super(x,y,width,height) super(x,y,width,height-WLH)
@chat_input = Widget_InputBox.new(416,723,586,24){|text|Action::Chat.new(true, text).run} @chat_input = Widget_InputBox.new(@x,@y+@height,@width,WLH){|text|Action::Chat.new(true, text).run}
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16) @font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
@contents.fill_rect(0,0,@width, @height, 0xFFFFFFFF) @contents.fill_rect(0,0,@width, @height, 0x99FFFFFF)
@scroll = Widget_ScrollBar.new(@x+@width-20,@y,@height,0) @scroll = Widget_ScrollBar.new(@x+@width-20,@y,@height,0)
@list = [] @list = []
$chat_window = self $chat_window = self
...@@ -19,7 +19,7 @@ class Window_RoomChat < Window ...@@ -19,7 +19,7 @@ class Window_RoomChat < Window
refresh refresh
end end
def refresh def refresh
@contents.fill_rect(0,0,@width, @height, 0x66FFFFFF) @contents.fill_rect(0,0,@width, @height, 0x99FFFFFF)
@list.last(7).each_with_index do |chat, index| @list.last(7).each_with_index do |chat, index|
player, content = chat player, content = chat
@font.draw_blended_utf8(@contents, content, 0, index*WLH, *(player ? Player_Color : Opponent_Color)) @font.draw_blended_utf8(@contents, content, 0, index*WLH, *(player ? Player_Color : Opponent_Color))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment