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
21 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
20 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
19 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4205
18 키입력 한글입력기 6 백호 2009.02.22 4298
17 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
16 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
15 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 3001
14 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 495
13 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
12 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2528
11 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2592
10 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
9 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
8 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2560
7 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
6 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
5 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
4 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
3 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2972
2 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52