조회 수 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 저번 글들과, 이전 글에 대해 묻고 싶습니다. idtptkd 2005.05.17 1314
8826 이전 작가들은 어떻게 되는 건가요? 아렉스 2005.05.17 1091
8825 이전 작가들은 어떻게 되는 건가요? 영원전설 2005.05.18 1152
8824 프루티룹스 질문... 신승일 2005.05.18 1472
8823 창작글만 있는데 감상문 같은 건 쓸수 없나요? 다르칸 2005.05.18 994
8822 창작글만 있는데 감상문 같은 건 쓸수 없나요? 아렉스 2005.05.18 1031
8821 창작글만 있는데 감상문 같은 건 쓸수 없나요? 천무 2005.05.18 820
8820 창작글만 있는데 감상문 같은 건 쓸수 없나요? 『水』신교 2005.05.18 869
8819 rpg만들기 2000에서 신규프로젝트가 만들어지지 않아요;; 밀크마스터 2005.05.18 1166
8818 rpg만들기 2000에서 신규프로젝트가 만들어지지 않아요;; 나랑놀자 2005.05.18 1111
8817 rpg만들기 2000에서 신규프로젝트가 만들어지지 않아요;; 셉티찡 2005.05.18 1170
8816 릴레이 소설 말인데요... 외로운갈매기 2005.05.18 675
8815 이전의 창작글 게시판의 글은 어케되나요? 천무 2005.05.18 471
8814 이전의 창작글 게시판의 글은 어케되나요? Sir_아사히 2005.05.19 563
8813 윈도우 98에서는 rpgxp안돌아가요 ? 바람을 가르는 자 2005.05.19 767
8812 윈도우 98에서는 rpgxp안돌아가요 ? 미칼렌 2005.05.19 927
8811 패치 요청... Norid 2005.05.19 454
8810 rpg만들기 2000에서 신규프로젝트가 만들어지지 않아요;; black-angel 2005.05.19 1147
8809 [RPG XP] 게임 테스트 오류. 살려주세요// Norid 2005.05.19 939
8808 릴레이소설 사래신장전 완결했는데요.. 적랑 2005.05.20 648
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(김원배) | 사신지(김병국)