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 6153
174 기타 몬스터 도감 7 file 백호 2009.02.21 1834
173 기타 몬스터 도감 18 file 백호 2009.02.22 2667
172 기타 몬스터 게이지바 턴알 22 file 키라링 2009.01.22 4015
171 기타 모험일기 5 키라링 2009.01.18 1825
170 기타 모험 일기 스크립트 2 file 백호 2009.02.21 1433
169 기타 명령어들 6 지존!! 2010.07.24 2288
168 기타 멤버 교체 11 file 백호 2009.02.22 2525
167 기타 메세지창의 위치 변동 자동화 file 백호 2009.02.21 1138
166 기타 메세지를 분출해 표시 백호 2009.02.22 1169
165 기타 멋진...제작자 정보를 그림으로 1 백호 2009.02.22 1233
164 기타 맵처리를 가볍게 1 백호 2009.02.21 1147
163 기타 맵 이동시 로딩 그림 표시 14 file 백호 2009.02.21 2479
162 기타 말풍선 스크립트. 62 file 『동그라미』♥ 2010.02.04 4254
161 기타 말걸면그림천천히뜨기 4 file 백호 2009.02.21 1102
160 기타 만화형태 말칸 스크립트 28 file 백호 2009.02.22 3705
159 기타 마우스로 길찾기 스크립트 예제 file 백호 2009.02.21 1168
158 기타 마법반사스크립트 4 *ps인간 2009.01.26 1403
157 기타 레벨을 표시해주는 스크립트 5 백호 2009.02.22 2403
» 기타 레벨업포인트 3 백호 2009.02.22 1692
155 기타 레벨업시 전회복 by ccoa 8 백호 2009.02.22 2514
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13