RPGXP 스크립트
2013.10.01 06:19

밤낮 설정

조회 수 1030 추천 수 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. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP 스크립트 By조규진1 Views946 Votes0
    Read More
  2. RPG XP Xas액알

    Date2018.10.30 CategoryRPGXP 스크립트 By심심치 Views1161 Votes0
    Read More
  3. Font Setup

    Date2016.07.22 CategoryRPGXP 스크립트 By운님 Views1641 Votes0
    Read More
  4. 대화에 얼굴이 나오는 스크립트 by: killarot(네이버 dust_mite)(수정버전)

    Date2016.02.22 CategoryRPGXP 스크립트 By부초 Views2043 Votes0
    Read More
  5. RPGXP ATB전투 시스템 예제(스크립트는 예제 안에 포함)

    Date2015.11.17 CategoryRPGXP 스크립트 ByMagNesium Views870 Votes0
    Read More
  6. 스테이터스,보수,골드,플레임 타임 삭제

    Date2015.06.02 CategoryRPGXP 스크립트 Byrpgmakingbot Views847 Votes0
    Read More
  7. 헤드 업 디스플레이 스크립트

    Date2015.01.30 CategoryRPGXP 스크립트 By 운 Views958 Votes0
    Read More
  8. 컬러 비트맵 타이틀 스크립트

    Date2015.01.20 CategoryRPGXP 스크립트 By 운 Views912 Votes1
    Read More
  9. 로고 스크립트

    Date2014.12.10 CategoryRPGXP 스크립트 By 운 Views1257 Votes1
    Read More
  10. 타이틀 로딩 스크립트

    Date2014.12.07 CategoryRPGXP 스크립트 By 운 Views1148 Votes0
    Read More
  11. 타이틀 스크립트

    Date2014.12.05 CategoryRPGXP 스크립트 By 운 Views1121 Votes0
    Read More
  12. 액알 스크립트

    Date2014.11.23 CategoryRPGXP 스크립트 By커비♥ Views1527 Votes1
    Read More
  13. 공포게임에 장비착용메뉴

    Date2014.08.24 CategoryRPGXP 스크립트 By 운 Views1506 Votes0
    Read More
  14. 얼굴표시/문장을 한글자씩 나타내주는 스크립트 (출처-히페리온)

    Date2014.06.22 CategoryRPGXP 스크립트 By시르카 Views1285 Votes0
    Read More
  15. 횡스크롤 점프 [버튼허용스위치추가]

    Date2014.06.01 CategoryRPGXP 스크립트 By 운 Views1722 Votes0
    Read More
  16. 말풍선 메세지 스크립트

    Date2014.02.24 CategoryRPGXP 스크립트 By천둥번들 Views1936 Votes0
    Read More
  17. 스텟찍기스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views1921 Votes3
    Read More
  18. 달리기스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views2391 Votes2
    Read More
  19. 8방향 이동스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views1827 Votes6
    Read More
  20. AraLab_MultiStartingPoint (다중 출발점 스크립트, 캐릭터 선택 스크립트) ver.0.2beta

    Date2014.01.21 CategoryRPGXP 스크립트 By 운 Views2065 Votes1
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8


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

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