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

场地魔法

parent c94b07d4
#encoding: UTF-8
=begin
alias gbk_puts puts
def puts(*args)
gbk_puts(*(args.collect{|item|item.encode "GBK", :invalid => :replace, :undef => :replace}))
......@@ -8,7 +8,7 @@ end
def p(*args)
print(args.collect{|item|item.inspect.encode "GBK", :invalid => :replace, :undef => :replace}.join("\n")+"\n") rescue print(args.join("\n")+"\n")
end
=end
def filesize_inspect(size)
case size
when 0...1024
......
......@@ -9,6 +9,7 @@ class Scene_Duel < Scene
require_relative 'window_lp'
require_relative 'window_phases'
require_relative 'window_field'
require_relative 'window_fieldback'
require_relative 'card'
require_relative 'deck'
require_relative 'action'
......@@ -17,7 +18,11 @@ class Scene_Duel < Scene
attr_reader :cardinfo_window
attr_reader :action_window
attr_reader :player_field
attr_reader :opponent_field
attr_reader :player_field_window
attr_reader :opponent_field_window
attr_reader :fieldback_window
def initialize(room)
super()
@room = room
......@@ -37,6 +42,8 @@ class Scene_Duel < Scene
@player_field = Game_Field.new Deck.load("test1.TXT")
@opponent_field = Game_Field.new
@fieldback_window = Window_FieldBack.new(128,175)
@player_field_window = Window_Field.new(4, 398, @player_field, true)
@opponent_field_window = Window_Field.new(4, 60, @opponent_field, false)
Action.player_field = @player_field
......@@ -140,7 +147,6 @@ class Scene_Duel < Scene
def handle_iduel(event)
case event
when Iduel::Event::Action
......
......@@ -31,6 +31,9 @@ class Window_Field < Window
refresh
end
def refresh
p $scene.player_field.field[0] rescue nil
p $scene.opponent_field.field[0] rescue nil
$scene.fieldback_window.card = $scene.player_field.field[0] || $scene.opponent_field.field[0] rescue nil
@items.clear
@cards.clear
if !@field.deck.empty?
......
# To change this template, choose Tools | Templates
# and open the template in the editor.
class Window_FieldBack < Window
def initialize(x,y)
super(x,y,457,389,100)
end
def card=(card)
return if @card == card
@card = card
if card and File.file? file = "graphics/fields/#{card.name}.gif"
@contents = Surface.load file
self.visible=true
else
self.visible=false
end
end
end
\ No newline at end of file
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