메뉴관련
2010.01.11 01:39

맵상에서 스테이터스 표시

조회 수 2278 추천 수 1 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form

맵상에서 스테이터스 표시 RGSS2 DAIpage v1.2
 
●기능과 사용법
 MAP상에서 스테이터스를 표시하는 DQ 같은 메뉴입니다.

● 재정의한 곳
  Scene_Map(을)를 앨리어스(alias) : 한번 더 선언하여 추가적으로 변수를 넣겠다는 의미입니다.

 

● 스크립트 
#==============================================================================
# ■ 커스터마이즈 포인트
#==============================================================================
module DAI_Map_Status
  #----------------------------------------------------------------------------
  # ● 기본 설정
  #----------------------------------------------------------------------------
  # 표시 무효 스윗치 번호.(이 스윗치가 온으로 강제비표시)
  OPTION = 1
 
  # 타입.(0:버튼 전환 타입,1:통상시 비표시, 일정시간 조작 없이 표시.)
  TYPE = 1
 
  # 윈도우 투명도
  OPACITY = 255
 
  # 윈도우의 위치.(0:아래,1:위)
  Y = 0
 
  # 스테이트를 표시하지 않는다( true / false )
  ST = false
 
  #----------------------------------------------------------------------------
  # ● 타입 0 의 때의 설정
  #----------------------------------------------------------------------------
  # 표시 전환해에 사용하는 버튼
  B = Input::Y
 
  #----------------------------------------------------------------------------
  # ● 타입 1 의 때의 설정
  #----------------------------------------------------------------------------
  # 표시까지의 시간(60 = 1초)
  TIME = 90
 
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
  #----------------------------------------------------------------------------
  # ●개시 처리(앨리어스(alias))
  #----------------------------------------------------------------------------
  alias start_map_status start
  def start
    @window_map_status = Window_MapStatus.new
    start_map_status
  end
  #----------------------------------------------------------------------------
  # ● 프레임 갱신(앨리어스(alias))
  #----------------------------------------------------------------------------
  alias update_map_status update
  def update
    update_map_status
    map_status_window_update
  end
  #--------------------------------------------------------------------------
  # ● 종료 처리
  #--------------------------------------------------------------------------
  alias terminate_map_status terminate
  def terminate
    terminate_map_status
    @window_map_status.dispose
  end
  #----------------------------------------------------------------------------
  # ● 윈도우의 갱신
  #----------------------------------------------------------------------------
  def map_status_window_update
    @window_map_status.close if $game_map.interpreter.running?
    @window_map_status.update
    if Input.trigger?(DAI_Map_Status::B) && DAI_Map_Status::TYPE != 1
      return if $game_map.interpreter.running?
      return if $game_switches[DAI_Map_Status::OPTION]
      @window_map_status.v ^= true
      @window_map_status.refresh
      Sound.play_decision
      return
    elsif DAI_Map_Status::TYPE == 1
      if $game_map.interpreter.running?
        @window_map_status.count = 0
        @window_map_status.v = false
        return
      end
      unless input?
        @window_map_status.count += 1
        if @window_map_status.count == DAI_Map_Status::TIME
          @window_map_status.v = true
          @window_map_status.refresh
          return
        end
      else
        @window_map_status.count = 0
        @window_map_status.v = false
        return
      end
    end
    if $game_party.members.size > 0 && @window_map_status.v
      map_status_data unless $game_map.interpreter.running?
    end
  end
  #--------------------------------------------------------------------------
  # ● 화면 변환의 실행
  #--------------------------------------------------------------------------
  alias map_status_update_scene_change update_scene_change
  def update_scene_change
    $game_temp.map_s_last_v = @window_map_status.v
    @window_map_status.visible = false unless $game_temp.next_scene.nil?
    map_status_update_scene_change
  end
  #----------------------------------------------------------------------------
  # ● 스테이터스의 감시
  #----------------------------------------------------------------------------
  def map_status_data
    if @window_map_status.map_status.size != $game_party.members.size
      @window_map_status.data
      @window_map_status.refresh
      return
    end
    return if $game_party.members.size == 0
    i = 0
    for a in $game_party.members
      a_s = [a.name, a.hp, a.maxhp, a.mp, a.maxmp, a.states]
      s = @window_map_status.map_status[i]
      if [s[0], s[1], s[2], s[3], s[4], s[5]] != a_s
        @window_map_status.data
        @window_map_status.refresh
        return
      end
      i += 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 어떠한 키 입력이 있었는지 판정
  #--------------------------------------------------------------------------
  def input?
    return (Input.dir4 != 0 or
    Input.trigger?(Input::A) or Input.trigger?(Input::B) or
    Input.trigger?(Input::C) or Input.trigger?(Input::X) or
    Input.trigger?(Input::Y) or Input.trigger?(Input::Z) or
    Input.trigger?(Input::L) or Input.trigger?(Input::R))
  end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor:map_s_last_v            # 화면 전환전의 가시 상태
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias map_status_initialize initialize
  def initialize
    map_status_initialize
    @map_s_last_v = true
  end
end

#==============================================================================
# ■ Window_MapStatus
#==============================================================================
class Window_MapStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor:map_status              # 스테이터스 보관 유지용 변수
  attr_accessor:count                   # 카운트
  attr_accessor:v                       # 가시 상태
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    @count = 0
    w = $game_party.members.size * 136
    w = 136 if $game_party.members.size == 0
    if DAI_Map_Status::Y == 0
      y = DAI_Map_Status::ST ? 312 : 288
    else
      y = 0
    end
    h = DAI_Map_Status::ST ? 104 : 128
    super(0, y, w, h)
    self.openness = 0
    self.opacity = DAI_Map_Status::OPACITY
    @v = $game_temp.map_s_last_v
    if $game_switches[DAI_Map_Status::OPTION] or DAI_Map_Status::TYPE == 1
      @v = false
    end
    data
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    if $game_party.members.size == 0
      close
    elsif @v
      open
    elsif
      close
    end
    close if $game_switches[DAI_Map_Status::OPTION]
    super
  end
  #--------------------------------------------------------------------------
  # ● 윈도우 내용의 작성
  #--------------------------------------------------------------------------
  def create_contents
    self.contents.dispose
    w = $game_party.members.size == 0 ? 1 : 512 / 4 * $game_party.members.size
    self.contents = Bitmap.new(w, height - 32)
  end
  #--------------------------------------------------------------------------
  # ● 파라미터의 기억
  #--------------------------------------------------------------------------
  def data
    @map_status = []
    for a in $game_party.members
      @map_status.push([a.name, a.hp, a.maxhp, a.mp, a.maxmp, a.states])
    end
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    create_contents
    width_refresh
    draw_contents
  end
  #--------------------------------------------------------------------------
  # ● 윈도우 내용의 묘화
  #--------------------------------------------------------------------------
  def draw_contents
    self.contents.clear
    return if $game_party.members.size == 0
    for i in 0...$game_party.members.size
      actor = $game_party.members[i]
      actor_x = i * 512 / 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 25)
      draw_actor_mp(actor, actor_x, 50)
      draw_actor_state(actor, actor_x, 75) unless DAI_Map_Status::ST
    end
  end
  #--------------------------------------------------------------------------
  # ● 윈도우폭의 조정
  #--------------------------------------------------------------------------
  def width_refresh
    self.width = self.contents.width + 32
  end
end


List of Articles
분류 제목 글쓴이 날짜 조회 수 추천 수
KGC 엔진 KGC 스크립트 라이브러리 2 file 독도2005 2010.02.20 2864 0
온라인 RPG 만들기 VX 온라인 소스 3 file 니오티 2010.02.11 5450 2
대화관련 vx 문장의속도를 조절하는방법 1 윳쿠리 2010.02.10 3448 0
전투관련 배틀중 윈도우 투명하게 표시 2 ruby 2010.01.20 1734 0
공통 Script 디버그 창의 수정 1 file ruby 2010.01.12 1798 0
Cacao 엔진 Cacao Base Script 3 file ruby 2010.01.11 1931 0
Cacao 엔진 Bitmap Class EX 1 file ruby 2010.01.11 3637 1
Cacao 엔진 Interpreter 108 EX for VX : RGSS2 Ver 1.01    by CACAO file ruby 2010.01.11 1910 0
애드온 게임 플레이중 음량 설정 2 니오티 2010.01.11 1854 1
제한변경 타이머 비/표시 기능 니오티 2010.01.11 1675 0
시각적효과 장소이동시 페이드인, 페이드 아웃 처리 니오티 2010.01.11 2048 0
메뉴관련 맵상에서 스테이터스 표시 1 니오티 2010.01.11 2278 1
아이템 아이템 화면 확장 (정렬기능 포함) 1 니오티 2010.01.11 1658 0
전투관련 특정 스킬의 타겟을 복수로 설정합니다 ! file ruby 2010.01.09 1837 0
맵관련 특정한 타일에서 미끄러집니다 2 ruby 2010.01.09 2107 0
전투관련 게이지가 차야 행동할수있는 배틀 3 file ruby 2010.01.09 2003 0
맵관련 시스템 문자를, 화상으로 변경합니다 file ruby 2010.01.09 1939 0
전투관련 몬스터가 데미지 받을시 진동 file ruby 2010.01.09 1803 0
전투관련 배틀시 적위에 데미지표시를 팝업시킵니다 1 file ruby 2010.01.09 1876 0
대화관련 메시지가 나올때 효과음이 나도록 합니다 file ruby 2010.01.09 1760 0
Board Pagination Prev 1 2 3 Next
/ 3

Copyright ⓒ Nioting All Rights Reserved. (since 1999)    개인정보
        

Fatal error: Cannot access property sessionController::$lifetime in /web/old/xe/modules/session/session.controller.php on line 45