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 Views1081 Votes0
    Read More
  2. 현재 시간 확인

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

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

    Date2013.10.01 CategoryRPGXP 스크립트 By Views968 Votes0
    Read More
  5. 윈도우 링 메뉴

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

    Date2013.10.01 CategoryRPGXP 스크립트 By Views903 Votes1
    Read More
  7. 텔레포트 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views896 Votes0
    Read More
  8. 밤낮 설정

    Date2013.10.01 CategoryRPGXP 스크립트 By Views994 Votes0
    Read More
  9. 전메뉴 반투명화

    Date2013.10.01 CategoryRPGXP 스크립트 By Views768 Votes0
    Read More
  10. Initial Switches and Variables

    Date2013.10.01 CategoryRPGXP 스크립트 By Views602 Votes0
    Read More
  11. Switchless Common Events

    Date2013.10.01 CategoryRPGXP 스크립트 By Views588 Votes0
    Read More
  12. Universal Message System 1.8.0 by ccoa

    Date2013.10.01 CategoryRPGXP 스크립트 By Views581 Votes0
    Read More
  13. 아이템 조합 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views890 Votes0
    Read More
  14. 가상 키보드 입력 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1660 Votes0
    Read More
  15. RPG 만들기 XP의 숨겨진 모듈/클래스 재정의 스크립트 모음

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1240 Votes0
    Read More
  16. 빠른 길찾기

    Date2013.09.30 CategoryRPGXP 스크립트 By휴리드 Views1337 Votes0
    Read More
  17. 텍스트 파일생성

    Date2013.09.30 CategoryRPGVX Ace 스크립트 By휴리드 Views654 Votes0
    Read More
  18. 파일 존재의 유무 체크

    Date2013.09.30 CategoryRPGVX Ace 스크립트 By휴리드 Views639 Votes0
    Read More
  19. 네코에서 되는 마우스 스크립트

    Date2013.09.30 CategoryRPGXP 스크립트 By휴리드 Views1675 Votes0
    Read More
  20. 3D 그래픽 파티클 스크립트

    Date2013.09.29 CategoryRPGVX 스크립트 By청담 Views1272 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(김원배) | 사신지(김병국)