조회 수 957 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
#┌───────────────────────────────────────
#│
#│  TRCS.17
#│  "Game_Character 修正" ver1.00β (2005.11.05 h12)
#│  by NO
#│  http://chobi.net/~no/
#│  
#└───────────────────────────────────────

#┌───────────────────────────────────────
#│β版仕?
#│  ?マップチップ、キャラクタ?との?たり判定を修正します。
#│  ?イベントとの?たり判定部分が未解決です。
#└───────────────────────────────────────


#==============================================================================
# ■ Game_Character
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def trcs17_initialize initialize
    # キャラクタ?サイズの判定フラグ初期化
    @big = false
    # キャラクタ?グラフィックが表示されているセルの座標
    @x_list = []
    @y_list = []
    # 呼び?す
    trcs17_initialize
  end
  #--------------------------------------------------------------------------
  # ○ キャラクタ?サイズが基準以上か?
  #--------------------------------------------------------------------------
  def big?
    return @big
  end
  #--------------------------------------------------------------------------
  # ○ キャラクタ?グラフィックが表示されているセルの座標
  #--------------------------------------------------------------------------
  def cell_list
    return @x_list, @y_list
  end
  #--------------------------------------------------------------------------
  # ○ 通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 方向 (0,2,4,6,8)  ※ 0 = 全方向通行不可の場合を判定 (ジャンプ用)
  #--------------------------------------------------------------------------
  alias trcs17_passable? passable?
  def passable?(x, y, d)
    # キャラクタ?ファイル名が定義されている場合
    unless @character_name == ""
      # キャラクタ?グラフィックオブジェクトを定義
      character = RPG::Cache.character(@character_name, @character_hue)
      # 倍率計算
      div_x = character.width / (32 * 4)
      div_y = character.height / (48 * 4)
      div_x = 1 if div_x < 1
      div_y = 1 if div_y < 1
      # x, yともに1倍の場合
      if div_x == 1 and div_y == 1
        # 呼び?す
        return trcs17_passable?(x, y, d)
      else
        # [基準サイズ以上である]をセット
        @big = true
        # [キャラクタ?グラフィックが表示されているセルの座標]の配列
        @x_list = [0]
        @y_list = [0]
        # 現位置において、
        # キャラクタ?グラフィックが表示されている全セルのx座標の算出
        # → グラフィックの幅は左右に等しい (基準の3倍ならば □■□)
        for i in 1..div_x / 2
          @x_list.unshift(-i)  if i == 1 and d != 6 # 本?の座標が移動の邪魔になるため
          @x_list.push(i)      if i == 1 and d != 4 # 本?の座標が移動の邪魔になるため
        end
        # 現位置において、
        # キャラクタ?グラフィックが表示されている全セルのy座標の算出
        # → y座標は?方向(負)に[基準のn倍]
        for i in 1...div_y
          @y_list.unshift(-i) if i == 1 and d != 2 # 本?の座標が移動の邪魔になるため
        end
        # 評?値の初期化
        bool = true
        # 二重ル?プで各座標を渡す
        for i in 0...@x_list.size
          for j in 0...@y_list.size
            x2 = @x_list[i]
            y2 = @y_list[j]
            # 呼び?す & ??値の評?
            # → 一度でもfalseになったら通行不可
            bool &= trcs17_passable?(x + x2, y + y2, d)
          end
        end
        # 評?値を返す
        return bool
      end
    else
      # 呼び?す
      return trcs17_passable?(x, y, d)
    end
  end
end

출처: 게임공작소
?

  1. Mog_Battle_hud(MZ버전도 있습니다)

    Date2021.03.05 CategoryRPGMV 플러그인 By스트레이보우 Views1847 Votes0
    Read More
  2. 컷신 플러그인

    Date2020.10.30 CategoryRPGMV 플러그인 By스트레이보우 Views2453 Votes0
    Read More
  3. 업적플러그인

    Date2020.09.02 CategoryRPGMV 플러그인 By스트레이보우 Views2090 Votes0
    Read More
  4. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP 스크립트 By조규진1 Views946 Votes0
    Read More
  5. 게임에서 제공해주는 노래가 아닌 외부에서 다운받고 안에 넣어쓰려면 어떻게 해야하나요?

    Date2019.07.26 CategoryRPGMV 플러그인 ByBigOrca Views1463 Votes0
    Read More
  6. Ghost Effect

    Date2019.01.20 CategoryRPGMV 플러그인 By러닝은빛 Views1156 Votes0
    Read More
  7. RPG XP Xas액알

    Date2018.10.30 CategoryRPGXP 스크립트 By심심치 Views1161 Votes0
    Read More
  8. 커스텀 숫자 입력 패드

    Date2018.10.19 CategoryRPGMV 플러그인 By러닝은빛 Views1222 Votes0
    Read More
  9. 9마리 이상의 몬스터 설정 | More Enemies

    Date2018.08.31 CategoryRPGMV 플러그인 By러닝은빛 Views974 Votes0
    Read More
  10. 동적 맵 타일 수정 플러그인

    Date2018.07.17 CategoryRPGMV 플러그인 By베지테리안카카오 Views1035 Votes0
    Read More
  11. VXA에서 XBOX360 컨트롤러 사용 여부 체크

    Date2018.07.15 CategoryRPGVX Ace 스크립트 By러닝은빛 Views891 Votes0
    Read More
  12. RMMV 옵션 창에 메시지 속도 및 글자 크기 변경 기능 추가

    Date2018.07.15 CategoryRPGMV 플러그인 By러닝은빛 Views1636 Votes0
    Read More
  13. 한글 데미지 표시

    Date2018.07.09 CategoryRPGMV 플러그인 By러닝은빛 Views1420 Votes0
    Read More
  14. [ MV ] 심장[체력표시 하트] 플러그인

    Date2018.07.01 CategoryRPGMV 플러그인 By수성의물 Views2257 Votes0
    Read More
  15. [鳥小屋] 실적 플러그인(인게임 트로피 시스템)

    Date2017.10.31 CategoryRPGMV 플러그인 By이니군 Views1747 Votes0
    Read More
  16. LuD Script Package

    Date2017.08.16 CategoryRPGVX Ace 스크립트 ByLuD Views1674 Votes0
    Read More
  17. [VXAce] 레이어 맵 <layer> 시스템

    Date2017.08.07 CategoryRPGVX Ace 스크립트 ByLuD Views1272 Votes0
    Read More
  18. [RPG MV] 퀘스트 마커 지속 표시 플러그인

    Date2017.04.09 CategoryRPGMV 플러그인 Bylklslel Views1697 Votes0
    Read More
  19. Mirror Area - RPG Maker MV

    Date2017.01.03 CategoryRPGMV 플러그인 By러닝은빛 Views5033 Votes0
    Read More
  20. Keyboard Event - RPG Maker MV

    Date2017.01.03 CategoryRPGMV 플러그인 By러닝은빛 Views2311 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15


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

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