XP 스크립트

#==============================================================================
# ■ 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 위에 찔러넣으세요.


>만약↓창(꼭밑에것처럼안해주되여..음...딴말을넣어서해주시두되고딴능력티두되구여..)
>ㅣ---------------------------------------ㅣ
>ㅣ  레벨업!!                                            ㅣ
>ㅣ  힘:+1을한다                                      ㅣ
>ㅣ  스피드:+1을한다                                ㅣ
>ㅣ  지능:+1을한다                                    ㅣ
>ㅣ  포인트:x                                          ㅣ
>ㅣ---------------------------------------ㅣ

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '3'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6202
174 기타 Shift Puzzles by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 1390
173 기타 Shift Puzzles v2 by SephirothSpawn (SDK호환) 3 file 백호 2009.02.22 1170
172 기타 Sized Events 0.1 by Toby@rmxp.org file 백호 2009.02.22 848
171 기타 Sphere Grid System file 백호 2009.02.21 765
170 기타 Steal Script (SDK Required) file 백호 2009.02.21 1182
169 기타 Tax Script 1.2 by The Darklord@rmxp.org 2 file 백호 2009.02.22 1130
168 기타 Terrain Encounter Areas by SephirothSpawn 백호 2009.02.22 778
167 기타 Tetris Attack by trickster 1 file 백호 2009.02.22 986
166 기타 Text Scroll by Dubealex (Release 3) 2 file 백호 2009.02.22 940
165 기타 Text to RGSS by DerVVulfman Alkaid 2011.04.18 1319
164 기타 The General Monster Generator 1.1 by DerVVulfman 1 file Alkaid 2011.03.02 1496
163 기타 Trailing Characters ver.1 by SephirothSpawn 6 file 백호 2009.02.22 1551
162 기타 Upload & Download files with RGSS 2.1 by berka (XP/VX 공용) 5 Alkaid 2010.11.20 2138
161 기타 Weather Script 1.02 by ccoa 1 file 백호 2009.02.22 810
160 기타 XP 각종 스크립트입니다. 36 file 쿠도신이치 2009.04.26 4272
159 기타 [All RGSS] File-Ex file Cheapmunk 2014.12.29 964
158 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 614
157 기타 [All RGSS] 게임 다중 실행 방지 스크립트 1 file Cheapmunk 2014.05.24 1381
156 기타 [All RGSS] 윈도우 메세지박스 스크립트 (Completed ver) 5 file Cheapmunk 2014.06.22 2186
155 기타 [All RGSS] 윈도우 커서 숨기기/보이기 1 file Cheapmunk 2014.03.02 1963
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13