RPGXP 스크립트
2013.10.01 06:32

레벨업시 능력치 표시

조회 수 1081 추천 수 0 댓글 4
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

#==============================================================================
# ■ Scene_Battle (분할 정의 4)
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Battle
  def main
    # 전투용의 각종 일시 데이터를 초기화
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # 배틀 이벤트용 interpreter를 초기화
    $game_system.battle_interpreter.setup(nil, 0)
    # 무리를 준비
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # 엑터 커멘드 윈도우를 작성
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # 그 외의 윈도우를 작성
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Battle.new
    # 웨이트 카운트를 초기화
    @wait_count = 0
    # 트란지션 실행
    Graphics.transition(20, "Graphics/Transitions/" +
      $data_system.battle_transition)
    # 프레바트르페즈 개시
    start_phase1
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면(자) 루프를 중단
      if $scene != self
        break
      end
    end
    # 맵을 리프레쉬
    $game_map.refresh
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @result_window != nil
      @result_window.dispose
    end
    if @levelup_window != nil
      @levelup_window.dispose
    end
    # 스프라이트 세트를 해방
    @spriteset.dispose
    # 타이틀 화면으로 전환하고 안의 경우
    if $scene.is_a? (Scene_Title)
      # 화면을 용암
      Graphics.transition
      Graphics.freeze
    end
    # 전투 테스트로부터 게임 오버 화면 이외에 변환중의 경우
    if $BTEST and not $scene.is_a? (Scene_Gameover)
      $scene = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● 애프터 배틀 국면 개시
  #--------------------------------------------------------------------------
  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
        #THDO
        $last_str = actor.str
        $last_dex = actor.dex
        $last_agi = actor.agi
        $last_int = actor.int
        #THDO
        actor.exp += exp
        if actor.level > last_level
          @levelup_window = Window_LevelUp.new
          @levelup_window.y = 100
        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
end
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  배틀 화면에서 파티 멤버의 스테이터스를 표시하는 윈도우입니다.
#==============================================================================

class Window_LevelUp < Window_BattleStatus
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
        @strdiff = actor.str - $last_str
        @dexdiff = actor.dex - $last_dex
        @agidiff = actor.agi - $last_agi
        @intdiff = actor.int - $last_int
        self.contents.font.color = system_color
        self.contents.draw_text(actor_x, 0, 120, 32, "레벨 업! ")
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 25, 120, 32, $data_system.words.str + ": +"+ @strdiff.to_s + "을 한다")
        self.contents.draw_text(actor_x, 50, 120, 32, $data_system.words.dex + ": +"+ @dexdiff.to_s + "을 한다")
        self.contents.draw_text(actor_x, 75, 120, 32, $data_system.words.agi + ": +"+ @agidiff.to_s + "을 한다")
        self.contents.draw_text(actor_x, 100, 120, 32, $data_system.words.int + ": +"+ @intdiff.to_s + "을 한다")     
    end
  end
end
#스크립트에서 Main 위에 찔러넣으세요.

?
  • ?
    ↑고수의길↑ 2013.10.05 03:48
    메인 위에 넣으라는 것이 아해가 잘 안됩니다.
    정확히 설명좀 해주실래요?
  • ?
    2013.10.05 06:07
    F11을 눌러 스크립트 에디터를 열면 옆에 섹션이 쭉 있는데, 그 중 가장 아래 섹션이 Main입니다.
    그 위에 우클릭하여 새 섹션을 만든 뒤 스크립트를 복붙해 넣으시면 됩니다.
  • ?
    2013.10.15 03:25
    begin
    $utils.print("흠 루비 스크립트 좀 하시나 봐요?n어디서 배우셨나요?")
    end
  • ?
    2013.10.24 08:21
    제가 만든건 아닙니다.
    루비는 독학했습니다.

  1. 밤낮 설정

    Date2013.10.01 CategoryRPGXP 스크립트 By Views994 Votes0
    Read More
  2. 텔레포트 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views896 Votes0
    Read More
  3. 장비 레벨 제한

    Date2013.10.01 CategoryRPGXP 스크립트 By Views903 Votes1
    Read More
  4. 윈도우 링 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views840 Votes0
    Read More
  5. 현재위치&임무 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views968 Votes0
    Read More
  6. 화면의 쉐이크를 더 어지럽게 바꿔보자!

    Date2013.10.01 CategoryRPGXP 스크립트 By Views986 Votes0
    Read More
  7. 현재 시간 확인

    Date2013.10.01 CategoryRPGXP 스크립트 By Views899 Votes0
    Read More
  8. 레벨업시 능력치 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1081 Votes0
    Read More
  9. 아이템 갯수 제한

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1061 Votes0
    Read More
  10. 복권 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1146 Votes0
    Read More
  11. 대기 회복 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1076 Votes0
    Read More
  12. 상점에서 아이템 능력치를 표시해주는 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1656 Votes0
    Read More
  13. 메뉴 스크립트 Zer0 CMS

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1384 Votes0
    Read More
  14. 발소리 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1730 Votes0
    Read More
  15. 부활 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2765 Votes0
    Read More
  16. 미니맵 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2177 Votes0
    Read More
  17. 파이널 판타지 7 스타일 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2024 Votes0
    Read More
  18. 요청하신 게이지바 스크립트 입니다.

    Date2013.10.04 CategoryRPGXP 스크립트 By소년영남 Views1919 Votes1
    Read More
  19. 맵이름 표시 스크립트

    Date2013.10.05 CategoryRPGXP 스크립트 By 운 Views2244 Votes0
    Read More
  20. 로고를 띄우는 스크립트

    Date2013.10.07 CategoryRPGXP 스크립트 ByXEONSOFT블로그 Views1678 Votes0
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 15 Next
/ 15






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

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