조회 수 277 추천 수 1 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
이밴트의 스크립트에서

$scene = Scene_Levelup.new

라고 설정하시면 될것입니다.

(아래 스크립트일 경우 말이죠..).. 아니라면 낭패;;;

> 스텟조절기를 써보니까 엑티브/턴 전투에서밖에 안나오더군요.
>
> 평소 메인 화면에서도 적용시킬 수 있는 방법이 있나요??
>
>
>
>
> 에에, 그리고-
>
>마사님이 올려주셨다는 srpg 만들기 예제 가지고 계신분 ㅠㅠ




#==============================================================================
# ■ Window_Levelup
#------------------------------------------------------------------------------
#  커스터마이즈       programed by gunmong
#==============================================================================

class Window_Levelup < Window_Base
  LEVELUP_POINT = 10                     # 레벨업시 얻는 포인트
  HP_PER_POINT = 10                       # 보너스 1포인트당 증감되는 HP, SP 포인트
  SKILLUP_POINT = 1
  ACCEPT = 6                                   # 결정의 index

attr_accessor :actor
attr_accessor :present_level
attr_accessor :index  
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------  
  def initialize(actor, last_level)
    # 윈도우 창 초기화
    super(220, 10,200, 300)
    self.contents = Bitmap.new(width - 32, height - 32)
    # 액터 스테이터스 초기화
    @actor = actor
    @name = $data_actors[actor.id].name
    @present_level = actor.level
    @last_level = last_level
    @status = []
    @text_status = []
    @temp_status = []
    @bonus_point = (@present_level - last_level) * LEVELUP_POINT
    for i in 0...6
      @status[i] = $data_actors[actor.id].parameters[i, last_level]
      @temp_status[i] = $data_actors[actor.id].parameters[i, last_level]
    end
    # 액터 그림 로드
    @battler_pic = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    # 인덱스 초기화
    @index = 0
    refresh
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# ● 리프레쉬
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @text_down = "◀"
    @text_up = "▶"
    @text_status[0] = $data_system.words.hp
    @text_status[1] = $data_system.words.sp
    @text_status[2] = $data_system.words.str
    @text_status[3] = $data_system.words.dex
    @text_status[4] = $data_system.words.agi
    @text_status[5] = $data_system.words.int
    @text_bonus_point = "B.point " + @bonus_point.to_s

    self.contents.blt(50, 50, @battler_pic, Rect.new(0, 0, @battler_pic.width, @battler_pic.height),150)
    
    self.contents.draw_text(0,0, 168 , 32, @name.to_s, 1)
    self.contents.draw_text(0, 25, 45, 18, "Lv. ".to_s + @present_level.to_s)  
    
    for i in 0...@status.size
      self.contents.draw_text(0, 50 + i * 30, self.contents.text_size(@text_status[i]).width, 32, @text_status[i].to_s)
      self.contents.draw_text(50, 50 + i * 30, self.contents.text_size(@text_down).width, 32, @text_down)
      self.contents.draw_text(70, 50 + i * 30, 80, 32, @temp_status[i].to_s, 1)
      self.contents.draw_text(150, 50 + i * 30, self.contents.text_size(@text_up).width, 32, @text_up)
    end
    
    self.contents.draw_text(0, 240, 110, 32, @text_bonus_point )
    self.contents.draw_text(130, 240, 40, 32, "결정" )
    
      
  end
  
#--------------------------------------------------------------------------
# ● 커서의 구형 갱신
#--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 [결정]  의 경우
    if @index == ACCEPT
      self.cursor_rect.set(130, 240, 40, 32)
    # 커서 위치가 [결정]  이외의 경우
    else
      x = 50
      y = 50 + @index * 30
      self.cursor_rect.set(x, y, 120, 32)
    end
  end
  
  
#--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 항목 선택
    if Input.trigger?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      @index -=1 if @index > 0
    end
    if Input.trigger?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      @index +=1 if @index < ACCEPT
    end
    # 수치 증감
    if Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      #커서가 [결정]이거나 기존 스테이터스보다 크지 않으면 수행하지 않음.
      if @index != ACCEPT and @temp_status[@index] > @status[@index]  
        # HP 또는 SP는 HP_PER_POINT를 곱한다.
        @temp_status[@index] -= 1 * HP_PER_POINT if @index < 2
        @temp_status[@index] -= 1 if @index >= 2 and @index != ACCEPT
        @bonus_point += 1
        refresh
      end
    end
    if Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      #커서가 [결정]이거나 기존 보너스 포인트가 1이상이 아니면 수행하지 않음.
      if @index != ACCEPT and @bonus_point > 0
        # HP 또는 SP는 HP_PER_POINT를 곱한다.
        @temp_status[@index] += 1 * HP_PER_POINT if @index < 2
        @temp_status[@index] += 1 if @index >=2 and @index != ACCEPT
        @bonus_point -= 1
        refresh
      end    
    end
    update_cursor_rect
  end
  def status(i)
    return @temp_status[i]
  end  
end


  
  
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  alias gunmong_main main
  def main
    #레벨업 데이터 초기화
    @actor_level_list = []
    @actor_last_level = []
    gunmong_main
  end
  
  #==============================================================================
# ■ Scene_Battle (분할 정의 2)
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================
  #--------------------------------------------------------------------------
  # ● 애프터 배틀 국면 개시
  #--------------------------------------------------------------------------
  def start_phase5
    # 국면 5 에 이행
    @phase = 5
    # 배틀 종료 ME 를 연주
    $game_system.me_play($game_system.battle_end_me)
    # 배틀 개시전의 BGM 에 되돌린다
    $game_system.bgm_play($game_temp.map_bgm)
    # EXP, 골드, 트레이닝 전기밥통을 초기화
    exp = 0
    gold = 0
    treasures = []
    # 루프
    for enemy in $game_troop.enemies
      # 에너미가 숨어 상태가 아닌 경우
      unless enemy.hidden
        # 획득 EXP, 골드를 추가
        exp += enemy.exp
        gold += enemy.gold
        # 트레이닝 전기밥통 출현 판정
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # 트레이닝 전기밥통의 수를 6 개까지 한정
    treasures = treasures[0..5]
    # EXP 획득
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
#sssssssssssssssssssssssssssssssssssssssssssssssssss
          @actor_level_list.push(actor)
          @actor_last_level.push(last_level)
#eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
          @status_window.level_up(i)
        end
      end
    end
    # 골드 획득
    $game_party.gain_gold(gold)
    # 트레이닝 전기밥통 획득
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # 배틀 결과 윈도우를 작성
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # 웨이트 카운트를 설정
    @phase5_wait_count = 100
  end

#--------------------------------------------------------------------------
  # ● 프레임 갱신 (애프터 배틀 국면)
  #--------------------------------------------------------------------------
  def update_phase5
    # 웨이트 카운트가 0 보다 큰 경우
    if @phase5_wait_count > 0
      # 웨이트 카운트를 줄인다
      @phase5_wait_count -= 1
      # 웨이트 카운트가 0 이 되었을 경우
      if @phase5_wait_count == 0
        # 결과 윈도우를 표시
        @result_window.visible = true
        # 메인 국면 플래그를 클리어
        $game_temp.battle_main_phase = false
        # 스테이터스 윈도우를 리프레쉬
        @status_window.refresh
      end
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 배틀 종료
      battle_end(0)
    end
  end

    #--------------------------------------------------------------------------
  # ● 배틀 종료
  #     result : 결과 (0:승리 1:패배 2:도주)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # 전투중 플래그를 클리어
    $game_temp.in_battle = false
    # 파티 전원의 액션을 클리어
    $game_party.clear_actions
    # 배틀용 스테이트를 해제
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # 에너미를 클리어
    $game_troop.enemies.clear
    # 배틀 콜백을 부른다
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
#ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
# 레벨업 액터가 있을경우
if not @actor_level_list.empty?
$scene = Scene_Levelup.new(@actor_level_list, @actor_last_level)
return
end
#eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    # 맵 화면으로 전환하고
    $scene = Scene_Map.new
  end
  
end
  
  
    
    
    
    
    
    










    
    
#==============================================================================
# ■ Scene_Levelup
#------------------------------------------------------------------------------
#  레벨업시 스탯포인터를 조절하는 화면을 처리하는 클래스입니다.
#==============================================================================

class Scene_Levelup
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     menu_index : 커멘드의 커서 초기 위치
  #--------------------------------------------------------------------------
  def initialize(actor_level_list, actor_last_level)
    @actor_level_list = actor_level_list
    @actor_last_level = actor_last_level
  end
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Battle.new
    @status_window = Window_BattleStatus.new
    # 초기 윈도우를 작성
    @edit_window = Window_Levelup.new(@actor_level_list.shift, @actor_last_level.shift)

    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면 루프를 중단
      if $scene != self
        break
      end
    end
        # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @spriteset.dispose
    @status_window.dispose
    @edit_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @spriteset.update
    @edit_window.update
    
    # C 버튼이 밀렸을 경우
    if Input.repeat?(Input::C) and @edit_window.index == 6
      for i in 0...6
        $data_actors[@edit_window.actor.id].parameters[i, @edit_window.present_level] = @edit_window.status(i)
      end      
      if @actor_level_list.empty?
        $scene = Scene_Map.new
      else
        @edit_window.dispose
        @edit_window = Window_Levelup.new(@actor_level_list.shift, @actor_last_level.shift)
      end
    end
  end
end




#여기까지가 한 섹션입니다.



출처 : gunmong
?

List of Articles
번호 제목 글쓴이 날짜 조회 수
8827 형제들이여 !!! 나를 구제해다오!! Ress 2006.01.26 223
8826 형제들이여 !!! 나를 구제해다오!! KaSsia 2006.01.25 263
8825 rpg2003에서 music음향이 작업시에는 실행되는데 게임을 실행하면 않되네요 ★샤일☆ 2007.01.03 784
8824 RPG2003의 그림들의 사이즈... MiNi'M' 2006.02.21 821
8823 RPG만들기2003에 관하여...정말 굼금해요~!~부탁드림 ∑☆メ이누∴。』 2005.08.09 577
8822 게이지바 구동 방법좀 <<게이지 유>> file 랑이a 2006.07.03 429
8821 길드는 어떻게 만드나요? 루넨스 2009.06.15 974
8820 길드는 어떻게 만드나요? 제로스 2009.06.15 1232
8819 동영상 관련및.. 급해요 ㅠ RML 2006.07.12 1483
8818 마법 연계 다시 질문!!! 제발 대답부탁!!; file 나르카이제 2005.06.15 331
8817 몬스터가없으면 다른곳으로 자동이동가능? Novelist 2006.08.29 277
8816 몬스터가없으면 다른곳으로 자동이동가능? CredMotion 2006.08.29 341
8815 스크립트로요,, 이동하는걸 보드게임처럼 할순 없나요? XLostTimesX 2006.01.09 429
8814 아이템창 같은 단축창를 만들려고하는데..[rpg2003] ScolPion 2006.04.15 572
8813 아이템창 같은 단축창를 만들려고하는데..[rpg2003] 방콕족의생활 2006.04.15 786
8812 질문! file 『Q트_아키』 2005.05.22 494
8811 "스크립트 데이터 읽기 실패" 라고 뜨는데.. 김세츠나 2009.07.31 1062
8810 "클래스가 등록되지 않았습니다"라니 -0-;;[RPG2003] Chrishyua .E 2007.03.02 700
8809 "클래스가 등록되지 않았습니다"라니 -0-;;[RPG2003] =ROD= 2007.03.07 886
8808 "파일 dmd 은 열지 않습니다" 이리저디 옮겼는데.. 윈드 2006.08.18 208
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 442 Next
/ 442


[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)