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 6153
401 파티 Party Changer 4.0 by Dargor (SDK2.3 호환) 3 WMN 2008.04.06 1572
400 그래픽 Weather Script(버전 불명) by ccoa 1 file Alkaid 2010.09.08 1571
399 메뉴 스테이터스 화면 from Harts Horn 2 백호 2009.02.22 1571
398 메뉴 Star Ocean 3 형식으로 스테이터스 화면 변경 1 file 백호 2009.02.21 1570
397 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1564
396 이동 및 탈것 텔레포트 마나소비량 수정하기 3 지존!! 2010.07.22 1563
395 그래픽 Composite Window Skins by PK8 (XP/VX/VXA) Alkaid 2012.08.26 1559
394 기타 Advanced Gold Display by Dubealex (돈 액수를 세자리씩 끊어 표기) 2 Alkaid 2010.11.18 1559
393 기타 데미지 출력 스크립트 예제 9 file 백호 2009.02.22 1559
392 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1558
391 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
390 전투 버틀러 색조 변경 5 file 백호 2009.02.21 1552
389 기타 RM2kXP file 습작 2014.03.17 1551
388 기타 Trailing Characters ver.1 by SephirothSpawn 6 file 백호 2009.02.22 1551
387 기타 디버그 윈도우 강화! 3 file 백호 2009.02.21 1550
386 스크립트 호출 명령어 통합버전 / Version 2.21 / 8 WMN 2008.04.06 1543
385 넷플2.0(펌) 1 오동훈 2008.02.25 1543
384 메시지 UCoder's Message System by Mr.Mo file Alkaid 2010.10.05 1542
383 이동 및 탈것 Maplinks - 맵연결을 쉽게 하기 1 백호 2009.02.22 1541
382 이동 및 탈것 점프 높이를 자유자제로 조절하는 스크립트!! 8 file 백호 2009.02.21 1539
Board Pagination Prev 1 ... 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 ... 52 Next
/ 52