设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1222|回复: 0
打印 上一主题 下一主题

[已经过期] 模范大话飞行旗脚本放在神剑2里有问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
322 小时
注册时间
2011-6-24
帖子
274
跳转到指定楼层
1
发表于 2012-3-7 12:15:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 sblkhgm 于 2012-3-12 03:29 编辑

模范大话飞行旗脚本放在神剑2里有问题,当我在外面插旗子 然后跑到房间里 在飞出来就提示[code]class Scene_Map
  alias old_update update
  def update
  $size = $game_party.instance_variable_get("@items").size+1
  $newid = $game_map.map_id
  if $newid != $game_map.map_id
    $newid = $game_map.map_id
  end
  old_update
  end
end
class Game_Variables
  def initialize
    @data = []
  end
  def [](variable_id)
    if variable_id <= 50000000 and @data[variable_id] != nil
      return @data[variable_id]
    else
      return 0
    end
  end
  def []=(variable_id, value)
    if variable_id <= 50000000
      @data[variable_id] = value
    end
  end
end
class Game_Switches
  def initialize
    @data = []
  end
  def [](switch_id)
    if switch_id <= 50000000 and @data[switch_id] != nil
      return @data[switch_id]
    else
      return false
    end
  end
  def []=(switch_id, value)
    if switch_id <= 50000000
      @data[switch_id] = value
    end
  end
end

class Scene_Title
  alias smn_main main
  def main
    $data_mapinfos = load_data("Data/MapInfos.rxdata")
    smn_main
  end
end
class Game_Party
attr_reader(:items)
attr_reader :item
attr_reader :id
alias old_initialize initialize
def initialize
  @item = item
  @id = id
  old_initialize
end
end
class Interpreter
def command_355
    script = @list[@index].parameters[0] + "\n"
    loop do
      if @list[@index+1].code == 655 or @list[@index+1].code == 355
        script += @list[@index+1].parameters[0] + "\n"
      else
        break
      end
      @index += 1
    end
    result = eval(script)
    if result == false
      return false
    end
    return true
  end
end
def make_fly_1(n)
r = rand(3)
id = $size+700
$data_items[id].name = "散标旗"+"_"+"未标记"+"("+"x"+","+"y"+")"
if r == 0
$data_items[id].icon_name  = "红色"
end
if r == 1
$data_items[id].icon_name  = "蓝色"
end
if r == 2
$data_items[id].icon_name  = "黄色"
end
$data_items[id].description = "记录地点/飞行地点"
$data_items[id].scope = 0
$data_items[id].occasion = 0
$data_items[id].consumable = false
$data_items[id].common_event_id = 25
$data_items[id].hit = 100
$game_party.gain_item(id,n)
end
def make_fly_2(n)
r = rand(3)
id = $size+700
$data_items[id].name = "集标旗"+"_"+"未标记"+"("+"x"+","+"y"+")"
if r == 0
$data_items[id].icon_name  = "红色"
end
if r == 1
$data_items[id].icon_name  = "蓝色"
end
if r == 2
$data_items[id].icon_name  = "黄色"
end
$data_items[id].description = "记录地点/飞行地点"
$data_items[id].scope = 0
$data_items[id].occasion = 0
$data_items[id].consumable = false
$data_items[id].common_event_id = 25
$data_items[id].hit = 100
$game_party.gain_item(id,n)
end
class Window_Item < Window_Selectable
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items)
      end
    end
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons)
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors)
        end
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    self.contents.font.size = 17
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    if item.name.include?("散标旗")
    self.contents.font.color = system_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    end
    if item.name.include?("集标旗")
    self.contents.font.color = crisis_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    end
    if not item.name.include?("标")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  end
  
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
class Scene_Item
  def main
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @item_window.help_window = @help_window
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
  end
  def update
    @help_window.update
    @item_window.update
    @target_window.update
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target
      return
    end
  end
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      $id = @item.id
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = (@item_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-12-1 11:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表