#============================================================================== # ■ 画面外での自律移動 (VX Ace用) #------------------------------------------------------------------------------ # 製作者 : CanariAlternate # サイト名 : カルトの鳥篭 # サイトURL : [url]http://canarialt.blog.fc2.com[/url] #------------------------------------------------------------------------------ # ■ 概要 : 画面外での自律移動を許可する。 # # ■ 必須 : 「注釈取得スクリプト」 # # ■ 位置 : 「注釈取得スクリプト」より下 #------------------------------------------------------------------------------ # 更新履歴 : 2012/10/01 Ver1.00 当スクリプトを作成した。 # 2012/10/08 Ver1.01 注釈で個別に設定可能に変更 # 2013/02/19 Ver1.02 共通処理スクリプトの廃止による変更を施した。 #============================================================================== $imported ||= {} $imported[:CanariAlternate_MoveOutScreen] = true #============================================================================== # ■ Calt #------------------------------------------------------------------------------ # CanariAlternateが製作したスクリプト用のモジュールです。 #============================================================================== module Calt #----------------------------------------------------------------------------- # 1. 注釈で画面外での移動を設定するキーワード MOVE_OUT_SCREEN_EVENT_NOTE = /\[画面外での自律移動\]/ # 記述した頁に適用 # 在事件页注释 [画面外での自律移動] 则当事件在该页的时候允许自律移动 MOVE_OUT_SCREEN_WHOLE_NOTE = /\<画面外での自律移動\>/ # 全ての頁に適用(1頁目に記述) # 在事件第一页注释 <画面外での自律移動> 则该事件全部页面都允许自律移动 MOVE_OUT_SCREEN_REVERSE = false # 全てのイベントの初期状態を反転 # 把这个false设定为true,则将所有事件的初始状态设定为允许在画面外自律移动 #----------------------------------------------------------------------------- end #============================================================================== # ■ Game_Event #------------------------------------------------------------------------------ # イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理 # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。 #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # ● 自律移動の更新 [◆再定義] #-------------------------------------------------------------------------- def update_self_movement if (near_the_screen? || @move_out_screen) && @stop_count > stop_count_threshold case @move_type when 1; move_type_random when 2; move_type_toward_player when 3; move_type_custom end end end #-------------------------------------------------------------------------- # ● 画面外での自律移動の設定を取得 [新規] #-------------------------------------------------------------------------- def get_move_out_screen_note event_result = event_note_include?(Calt::MOVE_OUT_SCREEN_EVENT_NOTE) whole_result = whole_note_include?(Calt::MOVE_OUT_SCREEN_WHOLE_NOTE) return event_result ^ whole_result ^ Calt::MOVE_OUT_SCREEN_REVERSE end #-------------------------------------------------------------------------- # ● イベントページ更新時に注釈から設定を取得 [追加] #-------------------------------------------------------------------------- alias setup_note_settings_MoveOutScreen setup_note_settings def setup_note_settings setup_note_settings_MoveOutScreen @move_out_screen = get_move_out_screen_note end end
#============================================================================== # ** Window_TitleCommand #============================================================================== class Window_TitleCommand #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- alias :make_command_list_20140907_M :make_command_list def make_command_list make_command_list_20140907_M add_command("制作名单", :credits) # 在这里调整选项名字 end end #============================================================================== # ** Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias :create_command_window_20140907_M :create_command_window def create_command_window create_command_window_20140907_M @command_window.set_handler(:credits, method(:command_credits)) end #-------------------------------------------------------------------------- # * [Credit] Command #-------------------------------------------------------------------------- def command_credits Win32API.new("shell32","ShellExecute","pppppi","i").call(0,"open", "Credits.txt",0,0,1) # 在这里调整文件名 @command_window.activate end end
#============================================================================== # ** CreditsInTitleCommand #============================================================================== module CreditsInTitleCommand # 按钮名 CommandName = "制作名单" # 内容 Credits = <<Orz 编剧……………………A 图像……………………B 脚本……………………C 音效……………………D 随你发挥了 下面这个Orz不要删 Orz end #============================================================================== # ** Window_Credits #============================================================================== class Window_Credits < Window_Base attr_accessor :to_active #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize bitmap = Bitmap.new Graphics.width, Graphics.height width = height = 0 CreditsInTitleCommand::Credits.each_line do |line| line.chomp! rect = bitmap.text_size(line).tap{|r| r.y = height width = [width, r.width += 2].max height += r.height += 2 } end width += standard_padding * 2 height += standard_padding * 2 x = (Graphics.width - width) / 2 y = (Graphics.height - height) / 2 super x, y, width, height width -= standard_padding * 2 height = 0 CreditsInTitleCommand::Credits.each_line do |line| line.chomp! rect = bitmap.text_size(line).tap{|r| r.y = height r.width = width height += r.height += 2 } contents.draw_text rect, line, 1 end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super process_handling end #-------------------------------------------------------------------------- # * Handling Processing for OK and Cancel Etc. #-------------------------------------------------------------------------- def process_handling return unless open? && active return on_exit if Input.trigger?(:C) || Input.trigger?(:B) end #-------------------------------------------------------------------------- # * On Exit #-------------------------------------------------------------------------- def on_exit Sound.play_ok Input.update close deactivate to_active.activate end end #============================================================================== # ** Window_TitleCommand #============================================================================== class Window_TitleCommand #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- alias :make_command_list_20140907_M :make_command_list def make_command_list make_command_list_20140907_M add_command(CreditsInTitleCommand::CommandName, :credits) end end #============================================================================== # ** Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias :create_command_window_20140907_M :create_command_window def create_command_window create_command_window_20140907_M @command_window.set_handler(:credits, method(:command_credits)) @credits_window = Window_Credits.new @credits_window.to_active = @command_window @credits_window.openness = 0 end #-------------------------------------------------------------------------- # * [Credit] Command #-------------------------------------------------------------------------- def command_credits @credits_window.open @credits_window.activate end end
余烬之中 发表于 2014-9-7 16:22
#==============================================================================
# ** CreditsInTitleC ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |