조회 수 624 추천 수 0 댓글 3
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

 
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆전투 난이도 - KGC_BattleDifficulty◆
#_/----------------------------------------------------------------------------
#_/ 전투 난이도의 설정 기능을 추가합니다.
#_/ (기능 자체는 독립형. 메뉴등에 표시하는 경우는[MenuAlter][TitleOption]참조)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ 커스터마이즈 항목 ★
#============================================================================= =

class Game_System
  # 난이도 배열 작성
# ≪"명칭", HP, SP, 타능력치, EXP, 골드, 트레이닝 전기밥통 출현율≫
# 각 항목의 배율을 지정.소수점 사용가능
  DIFFICULTY_LIST = [
    ["Easy",   0.8, 0.8, 0.7, 1.0, 1.0, 1.0],
    ["Normal", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
    ["Hard",   1.5, 1.3, 1.2, 1.0, 1.0, 1.0],
    ["Mania",  2.0, 1.8, 1.5, 1.0, 1.0, 1.0],
    ["Divine", 3.0, 2.6, 2.0, 1.0, 1.0, 1.0]]
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported["BattleDifficulty"] = true

#--------------------------------------------------------------------------
# ●난이도 설정 취득
#--------------------------------------------------------------------------
def get_difficulty
  # 난이도 설정을 돌려준다
  return $game_system.difficulty_list[$game_system.difficulty]
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :difficulty               # 難易度
  attr_accessor :difficulty_list          # 難易度リスト
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KGC_BattleDifficulty initialize
  def initialize
    # 元の処理を実行
    initialize_KGC_BattleDifficulty

    @difficulty = 1
    @difficulty_list = DIFFICULTY_LIST
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● 基本 MaxHP の取得
  #--------------------------------------------------------------------------
  alias base_maxhp_KGC_BattleDifficulty base_maxhp
  def base_maxhp
    n = base_maxhp_KGC_BattleDifficulty
    n *= get_difficulty[1]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxSP の取得
  #--------------------------------------------------------------------------
  alias base_maxsp_KGC_BattleDifficulty base_maxsp
  def base_maxsp
    n = base_maxsp_KGC_BattleDifficulty
    n *= get_difficulty[2]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本腕力の取得
  #--------------------------------------------------------------------------
  alias base_str_KGC_BattleDifficulty base_str
  def base_str
    n = base_str_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本器用さの取得
  #--------------------------------------------------------------------------
  alias base_dex_KGC_BattleDifficulty base_dex
  def base_dex
    n = base_dex_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本素早さの取得
  #--------------------------------------------------------------------------
  alias base_agi_KGC_BattleDifficulty base_agi
  def base_agi
    n = base_agi_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本魔力の取得
  #--------------------------------------------------------------------------
  alias base_int_KGC_BattleDifficulty base_int
  def base_int
    n = base_int_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本攻撃力の取得
  #--------------------------------------------------------------------------
  alias base_atk_KGC_BattleDifficulty base_atk
  def base_atk
    n = base_atk_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本物理防御の取得
  #--------------------------------------------------------------------------
  alias base_pdef_KGC_BattleDifficulty base_pdef
  def base_pdef
    n = base_pdef_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本魔法防御の取得
  #--------------------------------------------------------------------------
  alias base_mdef_KGC_BattleDifficulty base_mdef
  def base_mdef
    n = base_mdef_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● 基本回避修正の取得
  #--------------------------------------------------------------------------
  alias base_eva_KGC_BattleDifficulty base_eva
  def base_eva
    n = base_eva_KGC_BattleDifficulty
    n *= get_difficulty[3]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● EXP の取得
  #--------------------------------------------------------------------------
  alias exp_KGC_BattleDifficulty exp
  def exp
    n = exp_KGC_BattleDifficulty
    n *= get_difficulty[4]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● ゴールドの取得
  #--------------------------------------------------------------------------
  alias gold_KGC_BattleDifficulty gold
  def gold
    n = gold_KGC_BattleDifficulty
    n *= get_difficulty[5]
    return Integer(n)
  end
  #--------------------------------------------------------------------------
  # ● トレジャー出現率の取得
  #--------------------------------------------------------------------------
  alias treasure_prob_KGC_BattleDifficulty treasure_prob
  def treasure_prob
    n = treasure_prob_KGC_BattleDifficulty
    n *= get_difficulty[6]
    return Integer(n)
  end
end

 

 

이 스크립트인데요... 이벤트-스크립트를 통해서 난이도를 조정하는방법을 알고싶은데... 어떻게 해야 조정될려나요...?

  • profile
    천무 2017.02.14 12:51
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
    #_/ ◆戦闘難易度 - KGC_BattleDifficulty◆
    #_/----------------------------------------------------------------------------
    #_/ 戦闘難易度の設定機能を追加します。
    #_/ (メニュー等に表示する場合は[MenuAlter][TitleOption]参照)
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    #==============================================================================
    # ★ カスタマイズ項目 ★
    #==============================================================================

    module KGC
    # ◆難易度配列
    # ≪"名称", HP, SP, 他能力値, EXP, ゴールド, トレジャー出現率≫
    # 各項目の倍率を指定(百分率)。
    BD_DIFFICULTY_LIST = [
    ["Rookie", 60, 50, 60, 100, 100, 100],
    ["Easy", 80, 80, 70, 100, 100, 100],
    ["Normal", 100, 100, 100, 100, 100, 100],
    ["Hard", 150, 130, 120, 100, 100, 100],
    ["Mania", 200, 180, 150, 100, 100, 100],
    ["Unknown", 300, 260, 200, 100, 100, 100],
    ["Divine", 500, 400, 300, 100, 100, 100]
    ]
    # ◆初期難易度
    # BD_DIFFICULTY_LIST のインデックス。
    BD_INITIAL_DIFFICULTY = 2
    end

    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

    $imported = {} if $imported == nil
    $imported["BattleDifficulty"] = true

    module Difficulty
    #--------------------------------------------------------------------------
    # ● 難易度設定取得
    #--------------------------------------------------------------------------
    def self.get
    # 難易度設定を返す
    return KGC::BD_DIFFICULTY_LIST[$game_system.difficulty]
    end
    #--------------------------------------------------------------------------
    # ● 難易度設定変更
    #--------------------------------------------------------------------------
    def self.set(index)
    # 範囲外ならば変更しない
    return if index < 0 || index >= KGC::BD_DIFFICULTY_LIST.size
    $game_system.difficulty = index
    end
    #--------------------------------------------------------------------------
    # ● 能力値補正済みエネミー取得
    #--------------------------------------------------------------------------
    def self.get_revised_enemy(enemy)
    en = enemy.clone
    diff = self.get
    en.maxhp = en.maxhp * diff[1] / 100
    en.maxsp = en.maxsp * diff[2] / 100
    en.str = en.str * diff[3] / 100
    en.dex = en.dex * diff[3] / 100
    en.agi = en.agi * diff[3] / 100
    en.int = en.int * diff[3] / 100
    en.atk = en.atk * diff[3] / 100
    en.pdef = en.pdef * diff[3] / 100
    en.mdef = en.mdef * diff[3] / 100
    en.exp = en.exp * diff[4] / 100
    en.gold = en.gold * diff[4] / 100
    if en.treasure_prob < 100
    en.treasure_prob = [en.treasure_prob * diff[5] / 100, 100].min
    end
    return en
    end
    end

    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

    #==============================================================================
    # ■ Game_System
    #==============================================================================

    class Game_System
    attr_accessor :difficulty # 難易度
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    alias initialize_KGC_BattleDifficulty initialize
    def initialize
    # 元の処理を実行
    initialize_KGC_BattleDifficulty

    @difficulty = KGC::BD_INITIAL_DIFFICULTY
    end
    #--------------------------------------------------------------------------
    # ● 難易度一覧
    #--------------------------------------------------------------------------
    def difficulty_list
    return KGC::BD_DIFFICULTY_LIST
    end
    end

    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

    #==============================================================================
    # ■ Game_Enemy
    #==============================================================================

    class Game_Enemy < Game_Battler
    #--------------------------------------------------------------------------
    # ● 基本 MaxHP の取得
    #--------------------------------------------------------------------------
    alias base_maxhp_KGC_BattleDifficulty base_maxhp
    def base_maxhp
    n = base_maxhp_KGC_BattleDifficulty
    n *= Difficulty.get[1]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本 MaxSP の取得
    #--------------------------------------------------------------------------
    alias base_maxsp_KGC_BattleDifficulty base_maxsp
    def base_maxsp
    n = base_maxsp_KGC_BattleDifficulty
    n *= Difficulty.get[2]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本腕力の取得
    #--------------------------------------------------------------------------
    alias base_str_KGC_BattleDifficulty base_str
    def base_str
    n = base_str_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本器用さの取得
    #--------------------------------------------------------------------------
    alias base_dex_KGC_BattleDifficulty base_dex
    def base_dex
    n = base_dex_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本素早さの取得
    #--------------------------------------------------------------------------
    alias base_agi_KGC_BattleDifficulty base_agi
    def base_agi
    n = base_agi_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本魔力の取得
    #--------------------------------------------------------------------------
    alias base_int_KGC_BattleDifficulty base_int
    def base_int
    n = base_int_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本攻撃力の取得
    #--------------------------------------------------------------------------
    alias base_atk_KGC_BattleDifficulty base_atk
    def base_atk
    n = base_atk_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本物理防御の取得
    #--------------------------------------------------------------------------
    alias base_pdef_KGC_BattleDifficulty base_pdef
    def base_pdef
    n = base_pdef_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本魔法防御の取得
    #--------------------------------------------------------------------------
    alias base_mdef_KGC_BattleDifficulty base_mdef
    def base_mdef
    n = base_mdef_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● 基本回避修正の取得
    #--------------------------------------------------------------------------
    alias base_eva_KGC_BattleDifficulty base_eva
    def base_eva
    n = base_eva_KGC_BattleDifficulty
    n *= Difficulty.get[3]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● EXP の取得
    #--------------------------------------------------------------------------
    alias exp_KGC_BattleDifficulty exp
    def exp
    n = exp_KGC_BattleDifficulty
    n *= Difficulty.get[4]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● ゴールドの取得
    #--------------------------------------------------------------------------
    alias gold_KGC_BattleDifficulty gold
    def gold
    n = gold_KGC_BattleDifficulty
    n *= Difficulty.get[5]
    return n / 100
    end
    #--------------------------------------------------------------------------
    # ● トレジャー出現率の取得
    #--------------------------------------------------------------------------
    alias treasure_prob_KGC_BattleDifficulty treasure_prob
    def treasure_prob
    n = treasure_prob_KGC_BattleDifficulty
    if n < 100
    n *= Difficulty.get[6]
    return [n / 100, 100].min
    else
    return n
    end
    end
    end
  • profile
    천무 2017.02.14 12:57
    우선 위에붙이신 스크립트가 오류가납니다. 누군가 커스트마이징한것 같네요.
    제가 붙인걸 스크립트 main 위에 붙이시고요.

    사용방법은 이벤트의 스크립트 명령어에.
    아래 명령어를 (한줄씩 필요한것) 쓰면됩니다.

     Difficulty.set (0) # Rookie
     Difficulty.set (2) # Normal
     Difficulty.set (3) # Hard

    스크립트상에 보면.
    ["Rookie", 60, 50, 60, 100, 100, 100],
    ["Easy", 80, 80, 70, 100, 100, 100],
    ["Normal", 100, 100, 100, 100, 100, 100],
    ["Hard", 150, 130, 120, 100, 100, 100],
    ["Mania", 200, 180, 150, 100, 100, 100],
    ["Unknown", 300, 260, 200, 100, 100, 100],
    ["Divine", 500, 400, 300, 100, 100, 100]

    가 있는데 Rookie가 0 이고 Divine 가 6 입니다.
    난이도를 만약 제일어렵게 하려면 스크립트명령어를

    Difficulty.set (6)

    으로하면됩니다.

    난이도를 선택형으로 하시려면 선택지를 써서 각 선택지에 따라 명령어를 선택하게 하면됩니다.
  • ?
    달빛날개 2017.02.14 15:06
    오오 감사합니다! 명령어가 Difficulty.set 이였을줄이야... 거기다 오류가 나는 스크립트였다니..ㄷㄷ 아무튼 감사합니다! 잘 되네요!

  1. 민원실에 게임 요청 자제해주세요.

    Date2017.02.19 Category게임다운로드관련 By천무 Views2647
    read more
  2. 저장용량부족 문제 해결하기.(런타임 및 게임)

    Date2017.01.09 Category네코플레이어관련 By천무 Views2500
    read more
  3. 야겜 문의에 관하여(꼭봐주세요!)

    Date2016.04.13 Category기타문의 By천무 Views11543
    read more
  4. 왜 오니 종류 못다운 받나요

    Date2016.11.09 Category기타문의 By시로오니 Views717
    Read More
  5. 세이브가 안되네요

    Date2018.02.25 Category기타문의 By야기분조타딱조타 Views715
    Read More
  6. 트레이시아전기

    Date2017.10.01 Category기타문의 By가쓰나들 Views715
    Read More
  7. 게임압축어디서푸나요?

    Date2017.11.30 Category기타문의 By김도현 Views690
    Read More
  8. 구글 플레이 스토어 오류

    Date2020.04.01 Category기타문의 Byland_tnt Views688
    Read More
  9. MV 한글패치 1.2.0 버전은 언제 지원하나요?

    Date2016.05.30 Category기타문의 ByYanggaeng Views685
    Read More
  10. APK오류

    Date2016.12.27 Category기타문의 By새준 Views685
    Read More
  11. 로그인이 안되요

    Date2018.11.28 Category기타문의 By희정몬 Views683
    Read More
  12. 공모전 결과에 대해 문의드립니다

    Date2018.02.28 Category기타문의 By내루미 Views675
    Read More
  13. 글 삭제 부탁드립니다!!

    Date2016.04.01 Category기타문의 By로에트하이 Views659
    Read More
  14. 이거 rpg 어떻게만들어요?

    Date2016.10.22 Category기타문의 By흐엉ㅜㅠ Views650
    Read More
  15. 3회대회 후원은 언제부터 시작하나요?

    Date2017.01.31 Category기타문의 Bysigtuna Views637
    Read More
  16. apk 시스템에 관해

    Date2017.06.07 Category기타문의 By바른불빛스튜디오 Views629
    Read More
  17. rpg2003 게임 깉은 경우는

    Date2016.09.24 Category기타문의 By드래곤규 Views626
    Read More
  18. 하는법

    Date2016.09.19 Category기타문의 By손지호 Views625
    Read More
  19. rpg xp 를 사용중인데요 이 스크립트의 사용법을 알고싶어요

    Date2017.02.14 Category기타문의 By달빛날개 Views624
    Read More
  20. 광고수익 분배 투명성은 어떻게 되나요?

    Date2016.05.03 Category기타문의 By. Views614
    Read More
  21. 제 작품 오류가 발생했습니다.

    Date2017.01.15 Category기타문의 By누런덧니 Views613
    Read More
  22. 게임보내기문의

    Date2016.04.10 Category기타문의 ByAaa Views613
    Read More
  23. 네코 어떡게 만들어요...

    Date2016.10.16 Category기타문의 By그린세븐 Views610
    Read More
Board Pagination Prev 1 2 3 4 5 6 Next
/ 6






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

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