XP 스크립트

#=======================================#
# â–¦nbsp; class Game_Title                                                                #
#    written by Deke
#    Rewiten by Near Fantastica
#    Tweaked by Silentdragon
#------------------------------------------------------------------------------#
#=======================================#
class Game_Time

attr_accessor :minute_length
attr_accessor :hours
attr_accessor :minutess
attr_accessor :timess

def initialize
@minute_length=2.0      #length of game minute in real seconds
@hour_length= 60.0      #minute in an hour
@day_length=24.0        #hours in a day
@month_length=30.0    #days in a month
@year_length=12.0      #months in a year
@minutes=0                #starting minute count
@timess=Time.now          #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end

def get_time
@timess=Time.now          #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_tone
get_time
hour=hours
minutes=minutess + hour*@hour_length
phase_shift=Math::PI*(minutes/(@hour_length*@day_length))
illumination=  -150+ 165*Math.sin(phase_shift)
tone=Tone.new(illumination,illumination,illumination,0)
return tone
end

end # of class Game_Time 

#=======================================#
# â–¦nbsp; class Window_Time                                                            #
# written by Deke                                                                      #
#------------------------------------------------------------------------------#
#=======================================#
class Window_Time < Window_Base

#--------------------------------------------------------------------------
def initialize
 super(0, 0, 160, 96)
 self.contents = Bitmap.new(width - 32, height - 32)
 self.contents.font.name = $defaultfonttype  # "Time" window font
 self.contents.font.size = $defaultfontsize
 refresh
end

#--------------------------------------------------------------------------
def refresh
 $game_time.get_time
 self.contents.clear
 @total_sec = Graphics.frame_count / Graphics.frame_rate
 @minute=$game_time.minutess
 hour = $game_time.hours
 pm_flag= hour >=12 ? true : false
 hour= hour >= 12 ? hour-12 : hour
 if hour.floor==0
  text=sprintf("%02d:%02d",12,@minute)
 else
  text=sprintf("%02d:%02d",hour,@minute)
 end
 if pm_flag
  text += " PM"
 else
  text += " AM"
 end
 self.contents.font.color = normal_color
 self.contents.draw_text(4, 0, 120, 32, text, 2)
end

#--------------------------------------------------------------------------
def update
 $game_time.get_time
 if $game_time.minutess != @minute
  refresh
 end
end
end # of class

#=======================================
class Game_Temp
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Game Temp
#--------------------------------------------------------------------------
alias dns_game_temp_initalize initialize
#--------------------------------------------------------------------------
# &acirc;—? Refer the Attr
#--------------------------------------------------------------------------
attr_reader    :map_infos  #Added Lines
attr_reader    :outside_array  #Added Lines
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Scene Map
#--------------------------------------------------------------------------
def initialize
  dns_game_temp_initalize
  @outside_array = Array.new
  @map_infos = load_data("Data/MapInfos.rxdata")
  for key in @map_infos.keys
      @outside_array[key] = @map_infos[key].name.include?("*")
  end
end
end

#=======================================
class Scene_Map
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_map_main main
alias dns_scene_map_update update
#--------------------------------------------------------------------------
# &acirc;—? Main
#--------------------------------------------------------------------------
def main
  if $game_temp.outside_array[$game_map.map_id]
    tone=$game_time.get_tone
  $game_time.get_time
    @minute=$game_time.minutess
    $game_screen.start_tone_change(tone, 0)
  end
      # &atilde;‚¹&atilde;&#402;—&atilde;&#402;&copy;&atilde;‚¤&atilde;&#402;&#710;&atilde;‚&raquo;&atilde;&#402;&#402;&atilde;&#402;&#710;&atilde;‚’&auml;½œæ&#710;?
  @spriteset = Spriteset_Map.new
  # &atilde;&#402;¡&atilde;&#402;&#402;&atilde;‚&raquo;&atilde;&#402;¼&atilde;‚¸&atilde;‚&brvbar;&atilde;‚&pound;&atilde;&#402;³&atilde;&#402;‰&atilde;‚&brvbar;&atilde;‚’&auml;½œ
æ&#710;?
  @message_window = Window_Message.new
  # &atilde;&#402;&#710;&atilde;&#402;&copy;&atilde;&#402;³&atilde;‚¸&atilde;‚·&atilde;&#402;§&atilde;&#402;³&aring;®&#376;&egrave;¡Œ
  Graphics.transition
  # &atilde;&#402;¡&atilde;‚¤&atilde;&#402;³&atilde;&#402;&laquo;&atilde;&#402;¼&atilde;&#402;—
  loop do
    $light_effects.refresh
    # &atilde;‚²&atilde;&#402;¼&atilde;&#402; &ccedil;”&raquo;&eacute;?&cent;&atilde;‚’æ›´æ–°
    Graphics.update
    # &aring;…&yen;&aring;&#352;›æ&#402;…&aring; ±&atilde;‚’æ›´æ–°
    Input.update
    # &atilde;&#402;•&atilde;&#402;&not;&atilde;&#402;¼&atilde;&#402; æ›´æ–°
    update
    # &ccedil;”&raquo;&eacute;?&cent;&atilde;?Œ&aring;&#710;‡&atilde;‚&#352;替&atilde;‚?&atilde;?&pound;&atilde;?&#376;&atilde;‚‰&atilde;&#402;&laquo;&atilde;&#402;¼&atilde;&#402;—&atilde;‚’&auml;¸­æ–­
    if $scene != self
      break
    end
  end
  # &atilde;&#402;&#710;&atilde;&#402;&copy;&atilde;&#402;³&atilde;‚¸&atilde;‚·&atilde;&#402;§&atilde;&#402;³æº–&aring;‚™
  Graphics.freeze
  # &atilde;‚¹&atilde;&#402;—&atilde;&#402;&copy;&atilde;‚¤&atilde;&#402;&#710;&atilde;‚&raquo;&atilde;&#402;&#402;&atilde;&#402;&#710;&atilde;‚’&egrave;§&pound;放
  @spriteset.dispose
  # &atilde;&#402;¡&atilde;&#402;&#402;&atilde;‚&raquo;&atilde;&#402;¼&atilde;‚¸&atilde;‚&brvbar;&atilde;‚&pound;&atilde;&#402;³&atilde;&#402;‰&atilde;‚&brvbar;&atilde;‚’&egrave;§&pound;
放
  @message_window.dispose
  # &atilde;‚¿&atilde;‚¤&atilde;&#402;&#710;&atilde;&#402;&laquo;&ccedil;”&raquo;&eacute;?&cent;&atilde;?&laquo;&aring;&#710;‡&atilde;‚&#352;替&atilde;?&#710;&auml;¸­&atilde;?®&aring; ´&aring;?&#710;
  if $scene.is_a?(Scene_Title)
    # &ccedil;”&raquo;&eacute;?&cent;&atilde;‚’&atilde;&#402;•&atilde;‚§&atilde;&#402;¼&atilde;&#402;‰&atilde;‚&cent;&atilde;‚&brvbar;&atilde;&#402;&#710;
    Graphics.transition
    Graphics.freeze
  end
  $light_effects.hide
end
#--------------------------------------------------------------------------
# &acirc;—? Update
#--------------------------------------------------------------------------
def update
  $game_time.get_time
  $light_effects.update
  conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.minutess != @minute
  conditional2 =$game_temp.outside_array[$game_map.map_id] and @current_id != $game_map.map_id
  if  conditional1 or conditional2   
        tone=$game_time.get_tone
        $game_screen.start_tone_change(tone, 0)
        @minute = $game_time.minutess
        $game_map.need_refresh=true
        @current_id=$game_map.map_id
  end
  if $game_temp.outside_array[$game_map.map_id] == false and @current_id != $game_map.map_id
      $game_screen.start_tone_change(Tone.new(0,0,0,0),0)
      @current_id=$game_map.map_id
  end
  dns_scene_map_update
end
end

#======================================================
class Scene_Title
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_title_update update
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Scene Map
#--------------------------------------------------------------------------
def update
 $game_time=Game_Time.new
  #Dubealex Addition (from XRXS) to show Map Name on screen
 dns_scene_title_update
end
end

class Game_Map
#--------------------------------------------------------------------------
# &acirc;—? Refer the attr
#--------------------------------------------------------------------------
attr_reader  :outside
attr_reader  :map_id
#--------------------------------------------------------------------------
# &acirc;—? Outside
#--------------------------------------------------------------------------
def outside
  return $game_temp.outside_array[@map_id]
end
end

#==============================================================================
# &acirc;–&brvbar;nbsp; Light Effect System
#------------------------------------------------------------------------------
# &atilde;€€By: Near Fantastica
#  Date: 13/2/05
#
#  Addes light Effects to the DNS so objects glow and have ground effect lighting...
#==============================================================================

class Light_Effect_System
#--------------------------------------------------------------------------
# &acirc;—? Refer the attr
#--------------------------------------------------------------------------
attr_accessor    :picture_le
attr_accessor    :event_list
attr_accessor    :type_list
#--------------------------------------------------------------------------
# &acirc;—? Initialization
#--------------------------------------------------------------------------
def initialize
  @event_counter = 0
  @picture_le = Array.new
  @event_list = Array.new
  @type_list = Array.new
end
#--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects on Map Change
#--------------------------------------------------------------------------
def setup
  # Setup Event Max
  @event_counter = 0
  for i in 1..999
    if $game_map.map.events[i].id > @event_counter
      @event_counter = $game_map.map.events[i].id
    end
  end
  #
  for i in 1..@event_counter
    if  $game_map.map.events[i] == nil
      next
    end
    case $game_map.map.events[i].name
    when "Ground"
      ground(i)
    when "Fire"
      fire(i)
    when "Lamp Post"
      lamp(i)
    when "Left Lantern"
      left_lantern(i)
    when "Right Lantern"
      right_lantern(i)
    end
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Updates the Array based on time of day
#--------------------------------------------------------------------------
def update
  $game_time.get_time
  if $game_time.hours > 7 and $game_time.hours < 14
    hide
  else
    show
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Updates the XY of the sprites
#--------------------------------------------------------------------------
def refresh
  for i in 0..$light_effects.picture_le.size - 1
    case $light_effects.type_list[i]
    when "Ground"
      $light_effects.picture_le[i].x = ($game_map.events[$light_effects.event_list[i]].real_x - 200 - $game_map.display_x) / 4
      $light_effects.picture_le[i].y = ($game_map.events[$light_effects.event_list[i]].real_y - 200 - $game_map.display_y) / 4
      $light_effects.picture_le[i].visible = true
    when "Fire"
      $light_effects.picture_le[i].x = ($game_map.events[$light_effects.event_list[i]].real_x - 300 - $game_map.display_x) / 4
      $light_effects.picture_le[i].y = ($game_map.events[$light_effects.event_list[i]].real_y - 300 - $game_map.display_y) / 4
      $light_effects.picture_le[i].visible = true
    when "Left Lamp Post"
      $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 5
      $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 15
    when "Right Lamp Post"
      $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 25
      $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 15
      $light_effects.picture_le[i].visible = true
    when "Left Lantern"
      $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 20
        $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 5
        $light_effects.picture_le[i].visible = true
    when "Right Lantern"
      $light_effects.picture_le[i].x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list[i]].x * 32) - 10
      $light_effects.picture_le[i].y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list[i]].y * 32) - 5
      $light_effects.picture_le[i].visible = true
    end
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Redraws the Array
#--------------------------------------------------------------------------
def redraw
  if @picture_le != []
    for i in 0..@picture_le.size - 1
      @picture_le[i].bitmap.dispose
    end
    @picture_le = Array.new
    @event_list = Array.new
    @type_list = Array.new
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Shows Array
#--------------------------------------------------------------------------
def show
  if @picture_le != []
    for i in 0..@picture_le.size - 1
      @picture_le[i].visible = true
    end
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Hides Array
#--------------------------------------------------------------------------
def hide
  if @picture_le != []
    for i in 0..@picture_le.size - 1
      @picture_le[i].visible = false
    end
  end
end
#--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects for Ground
#--------------------------------------------------------------------------
def ground(event_index)
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.zoom_x = 200 / 100.0
  light_effects.zoom_y = 200 / 100.0
  light_effects.z = 1000
  light_effects.opacity = 50
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Ground")
end
#--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects for Fire
#--------------------------------------------------------------------------
def fire(event_index)
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.zoom_x = 300 / 100.0
  light_effects.zoom_y = 300 / 100.0
  light_effects.z = 1000
  light_effects.opacity = 100
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Fire")
end
#--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects for Lamp
#--------------------------------------------------------------------------
def lamp(event_index)
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.z = 1000
  light_effects.opacity = 100
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Left Lamp Post")
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.z = 1000
  light_effects.opacity = 100
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Right Lamp Post")
end
#--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def left_lantern(event_index)
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.z = 1000
  light_effects.opacity = 150
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Left Lantern")
end
  #--------------------------------------------------------------------------
# &acirc;—? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def right_lantern(event_index)
  light_effects = Sprite.new
  light_effects.bitmap = RPG::Cache.picture("LE.PNG")
  light_effects.z = 1000
  light_effects.opacity = 150
  light_effects.visible = false
  @picture_le.push(light_effects)
  @event_list.push(event_index)
  @type_list.push("Right Lantern")
end
end

#==============================================================================
# &acirc;–&brvbar;nbsp; Game_Map
#------------------------------------------------------------------------------
# &atilde;€€Add defenision of the names to Game Map Class
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# &acirc;—? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :map
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Game Map
#--------------------------------------------------------------------------
alias les_game_map_setup setup
#--------------------------------------------------------------------------
# &acirc;—? Refers the Map Setup
#--------------------------------------------------------------------------
def setup(map_id)
  $light_effects.redraw
  les_game_map_setup(map_id)
  $light_effects.setup
end
end

#==============================================================================
# &acirc;–&brvbar;nbsp; Scene_Title
#------------------------------------------------------------------------------
# &atilde;€€It is the class which processes the title picture
#==============================================================================

class Scene_Title
#--------------------------------------------------------------------------
# &acirc;—? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias les_scene_title_update update
#--------------------------------------------------------------------------
# &acirc;—? Sets up the ABS
#--------------------------------------------------------------------------
def update
 $light_effects = Light_Effect_System.new
 les_scene_title_update
end
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '3'
  • ?
    내로미 2010.05.09 01:07

    뭔 스크립트인진 설명을 해야죠!

  • ?
    Som Worker 2010.05.09 01:13

    내용상 시간하고 날짜를 관리하는 스크립트인것같은데..


    자세한건 모르겠네요

  • ?
    Som Worker 2010.05.09 01:13

    아 , 낮과 밤인것같습니다


    왠만하면 설명도 넣어주심이..


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6202
254 기타 액알 30 지존!! 2010.07.26 5099
253 기타 쓸만한스크립트61개포함 28 file 궭크이 2012.01.09 4298
252 기타 XP 각종 스크립트입니다. 36 file 쿠도신이치 2009.04.26 4272
251 기타 말풍선 스크립트. 62 file 『동그라미』♥ 2010.02.04 4254
250 기타 [게이지바]게이지바 스크립트 2.5 (실용적?) 17 file 코아 코스튬 2010.12.05 4219
249 기타 [Game_Actor] 게이지바 표시 스크립트 8 file - 하늘 - 2009.08.03 4174
248 기타 대화창에 얼굴그래픽 스크립트 25 file 백호 2009.02.21 4137
247 기타 캐릭터 소개 화면 22 file 독도2005 2008.10.05 4100
246 기타 8방향 마우스 스크립트 10 file 아방스 2009.02.28 4063
245 기타 몬스터 게이지바 턴알 22 file 키라링 2009.01.22 4016
244 기타 [자작]데미지표시 19 file JACKY 2012.02.15 3844
243 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
242 기타 [게이지바]HelloCoaVer4.0 업데이트 속도 변경 [오랜만의 업데이트] 30 file 코아 코스튬 2011.04.02 3791
241 기타 만화형태 말칸 스크립트 28 file 백호 2009.02.22 3706
240 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3637
239 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
238 기타 FPLE 2 - First Person Labyrinth Explorer by MGC 1 Alkaid 2012.01.17 3415
237 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3400
236 기타 레벨9999만들기스크립 23 해파리 2009.04.10 3344
235 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3315
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13