RPGXP 스크립트
2013.10.01 06:19

밤낮 설정

조회 수 996 추천 수 0 댓글 3
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆?夜切り替え - KGC_DayNight◆
#_/----------------------------------------------------------------------------
#_/ ゲ?ム中に?夜の?念を作成します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

# 導入?みフラグをオン

#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================

class Game_Screen
# ?夜切り替え方式(0:時間?過 1:?? 2:現?時間)
DAYNIGHT_METHOD = 0

# ★☆以下の3項目は全て同じ個?にしてください☆★
# ?理の都合上、最初を?にするのがベスト(違っても大きな問題は無し)

# ?夜の名?(あまり意味は無い)
DAYNIGHT_NAME = ["noon", "night", "mid-night", "morning"]

# ?夜の色調(よく分からない場合はこのまま)
DAYNIGHT_TONE = [Tone.new(0, 0, 0),
Tone.new(-32, -96, -96),
Tone.new(-128, -128, -32),
Tone.new(-48, -48, -16)]

# ?夜切り替え時間(次の?態へ移るまでの期間)
# 切り替え方式が時間の場合は秒?、??の場合は??そのまま
# ??中は切り替え時間が10倍(1/10の速度)
# 現?時間の場合、次の?態へ切り替える時刻(24時間方式)
DAYNIGHT_TIME = [30, 10, 25, 10]

# DAYNIGHT_TIME = [16, 20, 6, 10]
# ↑現?時間用のサンプル。試す場合はコメントを解除
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#--------------------------------------------------------------------------
# ● 現在の?態
#--------------------------------------------------------------------------
def now_daynight
# 現在の?態を返す
return $game_system.daynight_phase
end
#--------------------------------------------------------------------------
# ● ?態名取得
#--------------------------------------------------------------------------
def now_daynight_name
# 現在の?態名を返す
return DAYNIGHT_NAME[now_daynight]
end
#--------------------------------------------------------------------------
# ● ?夜手動切り替え
# phase : 切り替え後の?態INDEX
# duration : 切り替え時間(フレ?ム) (省略時:40)
#--------------------------------------------------------------------------
def change_daynight(phase, duration = 40)
# カウント初期化
$game_system.daynight_count = 0
# フェ?ズ更新
$game_system.daynight_phase = phase
# 手動切り替え有?
$manual_daynight_change = duration
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_System
#------------------------------------------------------------------------------
#  システム周りのデ?タを扱うクラスです。BGM などの管理も行います。このクラス
# のインスタンスは $game_system で?照されます。
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス??
#--------------------------------------------------------------------------
attr_accessor :daynight_count # ?夜判定用カウント
attr_accessor :daynight_phase # 現在の?態
attr_accessor :daynight_change # ?夜?更可否フラグ
attr_accessor :daynight_change_battle # ??中の?夜?更可否フラグ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_DayNight initialize
def initialize
# 元の?理を?行
initialize_KGC_DayNight

@daynight_count = 0
@daynight_phase = 0
@daynight_change = true
@daynight_change_battle = true
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Screen
#------------------------------------------------------------------------------
#  色調?更やフラッシュなど、?面全?に?係する?理のデ?タを保持するクラスで
# す。このクラスのインスタンスは $game_screen で?照されます。
#==============================================================================

class Game_Screen
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_DayNight initialize
def initialize
# 元の?理を?行
initialize_KGC_DayNight

# とりあえず現在の?態に設定
@tone = DAYNIGHT_TONE[$game_system.daynight_phase].clone
# 移動判定用座標
@x = 0
@y = 0
end
#--------------------------------------------------------------------------
# ● フレ?ム更新
#--------------------------------------------------------------------------
alias update_KGC_DayNight update
def update
# 元の?理を?行
update_KGC_DayNight

# ?夜切り替え判定
if (!$game_temp.in_battle && $game_system.daynight_change) ||
($game_temp.in_battle && $game_system.daynight_change &&
$game_system.daynight_change_battle)
case DAYNIGHT_METHOD
when 0 # 時間判定
# カウント加算
if $game_temp.in_battle
$game_system.daynight_count += 0.1
else
$game_system.daynight_count += 1
end
# ?態移行判定
count = $game_system.daynight_count / Graphics.frame_rate
if count >= DAYNIGHT_TIME[$game_system.daynight_phase]
# 次の?態へ移行
$game_system.daynight_count = 0
$game_system.daynight_phase += 1
# 最後の?態に達した場合
if $game_system.daynight_phase >= DAYNIGHT_TONE.size
# 最初の?態に?す
$game_system.daynight_phase = 0
end
# 色調切り替え
start_tone_change(DAYNIGHT_TONE[$game_system.daynight_phase], 40)
end
when 1 # ??判定
# 移動判定
if @x != $game_player.x || @y != $game_player.y
# 座標更新
@x = $game_player.x
@y = $game_player.y
# カウント加算
$game_system.daynight_count += 1
# ?態移行判定
count = $game_system.daynight_count
if count >= DAYNIGHT_TIME[$game_system.daynight_phase]
# 次の?態へ移行
$game_system.daynight_count = 0
$game_system.daynight_phase += 1
# 最後の?態に達した場合
if $game_system.daynight_phase >= DAYNIGHT_TONE.size
# 最初の?態に?す
$game_system.daynight_phase = 0
end
# 色調切り替え
start_tone_change(DAYNIGHT_TONE[$game_system.daynight_phase], 40)
end
end
when 2 # 現?時間
# 現在の時間を取得
time = Time.now
# ?態移行判定
time1 = DAYNIGHT_TIME[$game_system.daynight_phase]
time2 = DAYNIGHT_TIME[$game_system.daynight_phase - 1]
if time2 != nil && time2 > time1
change = time.hour < time2 && time.hour >= time1
else
change = time.hour >= time1
end
if change
# 次の?態へ移行
$game_system.daynight_count = 0
$game_system.daynight_phase += 1
# 最後の?態に達した場合
if $game_system.daynight_phase >= DAYNIGHT_TONE.size
# 最初の?態に?す
$game_system.daynight_phase = 0
end
# 色調切り替え
start_tone_change(DAYNIGHT_TONE[$game_system.daynight_phase], 40)
end
end
end
# 手動切り替えが行われた場合
if $manual_daynight_change != nil
# 色調切り替え
start_tone_change(DAYNIGHT_TONE[$game_system.daynight_phase], $manual_daynight_change)
# 手動切り替え解除
$manual_daynight_change = nil
end
end
end

 

?

  1. 전투 도중 멤버교체가 가능해지는 플러그인

    Date2016.01.13 CategoryRPGMV 플러그인 ByWailer Views1306 Votes0
    Read More
  2. Wave Filter

    Date2016.01.14 CategoryRPGMV 플러그인 By러닝은빛 Views968 Votes0
    Read More
  3. Bind Pictures To Map (이미지 결합 플러그인)

    Date2015.10.30 CategoryRPGMV 플러그인 By이녕 Views1062 Votes0
    Read More
  4. 특정범위내에들어오면이동하기

    Date2010.10.14 CategoryRPGXP 스크립트 ByA.M.S Views3086 Votes0
    Read More
  5. Custom Icon Sheets (커스텀 아이콘 적용 스크립트)

    Date2016.01.10 CategoryRPGVX Ace 스크립트 Byplam Views478 Votes0
    Read More
  6. Damage Popup by Dargor (데미지 수치 팝업하는 스크립트)

    Date2016.01.10 CategoryRPGVX Ace 스크립트 Byplam Views624 Votes0
    Read More
  7. 아이템소지 한계돌파

    Date2010.10.24 CategoryRPGXP 스크립트 ByA.M.S Views1964 Votes0
    Read More
  8. 상점에서 상세정보보여주기

    Date2010.10.24 CategoryRPGXP 스크립트 ByA.M.S Views1820 Votes0
    Read More
  9. 부드러운화면이동

    Date2010.10.24 CategoryRPGXP 스크립트 ByA.M.S Views2047 Votes0
    Read More
  10. 직업명 표시

    Date2010.10.24 CategoryRPGXP 스크립트 ByA.M.S Views1790 Votes0
    Read More
  11. 8방향이동

    Date2010.10.14 CategoryRPGXP 스크립트 ByA.M.S Views2155 Votes0
    Read More
  12. 반칸이동

    Date2010.07.18 CategoryRPGXP 스크립트 ByA.M.S Views2185 Votes0
    Read More
  13. 그레고리우스력 원리.

    Date2011.06.22 CategoryRPGXP 스크립트 By협객 Views2509 Votes0
    Read More
  14. vx 전용 오토세이브<자동저장>

    Date2011.08.31 CategoryRPGVX 스크립트 By고진수 Views2730 Votes0
    Read More
  15. 1인용메뉴

    Date2010.07.18 CategoryRPGVX Ace 스크립트 ByA.M.S Views2615 Votes0
    Read More
  16. 아이템획득 표시

    Date2010.10.14 CategoryRPGXP 스크립트 ByA.M.S Views2278 Votes0
    Read More
  17. 구간 루프 음악 스크립트

    Date2015.08.24 Category유니티 스크립트 By맛난호빵 Views240 Votes0
    Read More
  18. UNR (아시려나... ) - 상태 이상

    Date2013.01.20 CategoryRPGXP 스크립트 By동동주 Views937 Votes0
    Read More
  19. vx 전용 오토세이브<자동저장>

    Date2011.08.31 CategoryRPGVX 스크립트 By고진수 Views2803 Votes0
    Read More
  20. 1인용메뉴

    Date2010.07.18 CategoryRPGVX 스크립트 ByA.M.S Views2565 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)