bad-end-collector/Scripts/_.17.rb
2024-05-18 13:05:37 -05:00

197 lines
7.9 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#==============================================================================
#◆VXAce用 ウインドウサイズ変更スクリプト
#------------------------------------------------------------------------------
#【最終更新日時】 2013/05/11
#【作者】杉村 祐介
#【サイト】http://hgfactory2011.blog.fc2.com/
#==============================================================================
#
# 【用途】
# ウィンドウサイズを規程のサイズに拡大・縮小します。
# タイトル・ゲームオーバー・バトル背景画像も自動でリサイズされます。
#
#
# 【注意事項】
# ウィンドウサイズを過度に小さくしてしまうと
# エンカウントした際、Window_Baseの470行目でエラー落ちします。
# また640*480より大きな値を指定した際には
# タイトルなどの画像のみ拡大されます。
# X,Yサイズは指定の範囲内でご利用ください。
#
# またトランジション画像の拡大縮小には対応してません。
#
#==============================================================================
#==============================================================================
#◆オプション
#==============================================================================
module Ys_WinSize
# ↓ウインドウサイズ。494640の範囲で指定してください。デフォルト - 544
WinX = 640
# ↓ウインドウサイズ。120460の範囲で指定してください。デフォルト - 416
WinY = 480
end
#==============================================================================
#==============================================================================
#◆定義
#==============================================================================
Graphics.resize_screen(Ys_WinSize::WinX, Ys_WinSize::WinY)
#==============================================================================
#==============================================================================
#◆再定義……競合が起きる場合、ここを編集すると治る場合があります
#==============================================================================
#==============================================================================
# ■ Game_Event
#------------------------------------------------------------------------------
#  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理
# イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ● 画面の可視領域付近にいるか判定
# dx : 画面中央から左右何マス以内を判定するか
# dy : 画面中央から上下何マス以内を判定するか
#--------------------------------------------------------------------------
# 画面外の判定を広げています。
def near_the_screen?(dx = 15, dy = 10)# def near_the_screen?(dx = 12, dy = 8)
ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
end
end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 背景の作成
#--------------------------------------------------------------------------
def create_background
title_gra01 = Cache.title1($data_system.title1_name)
title_gra02 = Cache.title2($data_system.title2_name)
resize = Bitmap.new(Ys_WinSize::WinX,Ys_WinSize::WinY)
resize.stretch_blt( resize.rect, title_gra01, title_gra01.rect )
@sprite1 = Sprite.new
@sprite1.bitmap = resize
resize = Bitmap.new(Ys_WinSize::WinX,Ys_WinSize::WinY)
resize.stretch_blt( resize.rect, title_gra02, title_gra02.rect )
@sprite2 = Sprite.new
@sprite2.bitmap = resize
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
#  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 戦闘背景(床)スプライトの作成
#--------------------------------------------------------------------------
def create_battleback1
battle_gra01 = battleback1_bitmap
# バトル中のエフェクト対策で一回り大きく拡大します。
resize = Bitmap.new( Ys_WinSize::WinX*1.1, Ys_WinSize::WinY*1.1 )
resize.stretch_blt( resize.rect, battle_gra01, battle_gra01.rect )
@back1_sprite = Sprite.new(@viewport1)
@back1_sprite.bitmap = resize
@back1_sprite.z = 0
center_sprite(@back1_sprite)
end
#--------------------------------------------------------------------------
# ● 戦闘背景(壁)スプライトの作成
#--------------------------------------------------------------------------
def create_battleback2
battle_gra02 = battleback2_bitmap
# バトル中のエフェクト対策で一回り大きく拡大します。
resize = Bitmap.new( Ys_WinSize::WinX*1.1, Ys_WinSize::WinY*1.1 )
resize.stretch_blt( resize.rect, battle_gra02, battle_gra02.rect )
@back2_sprite = Sprite.new(@viewport1)
@back2_sprite.bitmap = resize
@back2_sprite.z = 0
center_sprite(@back2_sprite)
end
end
#==============================================================================
# ■ Scene_Gameover [class]
#==============================================================================
class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# ● 背景の作成
#--------------------------------------------------------------------------
def create_background
gameover_gra01 = Cache.system("GameOver")
resize = Bitmap.new( Ys_WinSize::WinX, Ys_WinSize::WinY )
resize.stretch_blt( resize.rect, gameover_gra01, gameover_gra01.rect )
@sprite = Sprite.new
@sprite.bitmap = resize
end
end
#==============================================================================
# ■ Game_Troop
#------------------------------------------------------------------------------
#  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も
# 行います。このクラスのインスタンスは $game_troop で参照されます。
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● セットアップ
#--------------------------------------------------------------------------
def setup(troop_id)
clear
@troop_id = troop_id
@enemies = []
troop.members.each do |member|
next unless $data_enemies[member.enemy_id]
enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
enemy.hide if member.hidden
enemy.screen_x = ( (member.x * Ys_WinSize::WinX) / 544 )
enemy.screen_y = ( (member.y * Ys_WinSize::WinY) / 416 )
@enemies.push(enemy)
end
init_screen_tone
make_unique_names
end
end
#==============================================================================