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
1021 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
1020 온라인 채팅 가능 온라인 스크립트 배포 107 file 아방스 2009.01.03 10680
1019 온라인 RPG 만들기 xp 온라인 스크립트 33 아방스 2007.11.09 9592
1018 맵/타일 [유니크급] RPG XP 게임을 3D화로 보자! Neo Mode7 script / 52 file 쉴더 2009.02.28 9442
1017 온라인 온라인 스크립트 Unis Net RMXP 공식 배포! 25 file 뮤바보 2011.12.25 9400
1016 온라인 광넷[ 광땡 온라인 + 넷플레이 ] 62 - 하늘 - 2009.08.02 9003
1015 전투 [액알]neo_a-rpg_module_1[1][1].2 스크립트 83 file 은빛바람 2009.10.03 8298
1014 이름입력 대화창에 얼굴, 이름 띄우기 37 킬라롯 2008.11.09 7496
1013 온라인 넷플레이1.7.0+abs5.5+한챗 49 쀍뛝쒧 2009.01.24 7286
1012 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 7141
1011 메시지 대화창에 얼굴 그래픽 띠우기 73 아방스 2007.11.09 7119
1010 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6919
1009 전투 [신기술 체험] 강회된 횡스크롤 액알 13 file 백호 2009.02.22 6841
1008 메뉴 온라인메뉴처럼!! 메이플 메뉴처럼!! 변신~스크립트 33 WMN 2008.03.17 6816
1007 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
1006 온라인 Mr.Metring NPE 1.0 [RPG XP 온라인 스크립트] 35 아방스 2009.01.07 6535
1005 이름입력 케릭터 위에 또는 NPC 위에 이름 뛰우기 [헬악이님 제공] 49 file 아방스 2007.11.09 6407
1004 액터 시트르산의 XP용 감정 말풍선 표시 스크립트 37 file 시트르산 2011.01.25 6110
1003 HUD 주인공,NPC이름 머리 나타내기 49 file 송긔 2010.11.28 6060
1002 전투 액알 스크립트 24 백호 2009.02.22 6013
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52