RPGXP 스크립트
2013.10.01 06:19

밤낮 설정

조회 수 994 추천 수 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. 밤낮 설정

    Date2013.10.01 CategoryRPGXP 스크립트 By Views994 Votes0
    Read More
  2. 텔레포트 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views896 Votes0
    Read More
  3. 장비 레벨 제한

    Date2013.10.01 CategoryRPGXP 스크립트 By Views903 Votes1
    Read More
  4. 윈도우 링 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views840 Votes0
    Read More
  5. 현재위치&임무 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views968 Votes0
    Read More
  6. 화면의 쉐이크를 더 어지럽게 바꿔보자!

    Date2013.10.01 CategoryRPGXP 스크립트 By Views986 Votes0
    Read More
  7. 현재 시간 확인

    Date2013.10.01 CategoryRPGXP 스크립트 By Views899 Votes0
    Read More
  8. 레벨업시 능력치 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1081 Votes0
    Read More
  9. 아이템 갯수 제한

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1061 Votes0
    Read More
  10. 복권 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1146 Votes0
    Read More
  11. 대기 회복 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1076 Votes0
    Read More
  12. 상점에서 아이템 능력치를 표시해주는 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1656 Votes0
    Read More
  13. 메뉴 스크립트 Zer0 CMS

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1384 Votes0
    Read More
  14. 발소리 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1730 Votes0
    Read More
  15. 부활 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2765 Votes0
    Read More
  16. 미니맵 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2177 Votes0
    Read More
  17. 파이널 판타지 7 스타일 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2024 Votes0
    Read More
  18. 요청하신 게이지바 스크립트 입니다.

    Date2013.10.04 CategoryRPGXP 스크립트 By소년영남 Views1919 Votes1
    Read More
  19. 맵이름 표시 스크립트

    Date2013.10.05 CategoryRPGXP 스크립트 By 운 Views2244 Votes0
    Read More
  20. 로고를 띄우는 스크립트

    Date2013.10.07 CategoryRPGXP 스크립트 ByXEONSOFT블로그 Views1678 Votes0
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 15 Next
/ 15






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

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