查看: 2393|回复: 7

[已经过期] 各位,请问游戏难度是怎么制作的?

[复制链接]
梦石
0
星屑
50
在线时间
29 小时
注册时间
2017-4-9
回帖
25
发表于 2017-4-24 13:07:10 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
需要脚本吗?我的小游戏差不多完工了,才想起来没难度选项。
要脚本的话,里面的事件要不要改?

点评

再一次你就永远不用再来了  发表于 2017-5-8 11:48
【警告2】版规A-8 弃帖/提问后不管  发表于 2017-5-8 11:48
梦石
0
星屑
50
在线时间
29 小时
注册时间
2017-4-9
回帖
25
 楼主| 发表于 2017-4-24 13:10:15 | 显示全部楼层
如果做好了  比如有 简单, 困难的难度选择
怎么做成 困难的比简单难度多一点道具?
回复

使用道具 举报

梦石
0
星屑
644
在线时间
830 小时
注册时间
2016-7-24
回帖
644

开拓者

发表于 2017-4-24 14:47:31 | 显示全部楼层
設個選項再用選再設定個變數
之後依照這個變數來分歧難易度
2016/07/17 加入RPG製作,勿忘初衷!
回复

使用道具 举报

梦石
0
星屑
2019
在线时间
940 小时
注册时间
2015-10-26
回帖
293

开拓者

发表于 2017-4-24 15:56:26 | 显示全部楼层
难度体现在怪物属性上的话可以在game_enemy里面改
怪物属性哪里用变量区分
回复

使用道具 举报

职业の水客

梦石
2
星屑
16989
在线时间
7497 小时
注册时间
2010-6-16
回帖
3464

极短27评委MZ评测员极短26评委开拓者

发表于 2017-4-24 16:13:39 | 显示全部楼层
难度脚本#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/     ◆                Battle Difficulty - KGC_BattleDifficulty Ace
#_/     ◇                                Last Update: 2008/05/09                              ◇
#_/     ◇                                Converted: 2012/09/06
#_/     ◆                          Translation by Mr. Anonymous                            ◆
#_/     ◇                          Converted by Tsukihime
#_/----------------------------------------------------------------------------
#_/  This script adds battle difficulty settings to your game.
#_/============================================================================
#_/  Installation: Insert below KGC_ExtraDropItem and KGC_CustomMenuCommand.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================#
#                                                       ★ Customization ★                                                                #
#==============================================================================#

module KGC
module BattleDifficulty
  #                                        ◆ Difficulty Variable ◆
  #  Change the variable the difficulty setting is stored in.
  DIFFICULTY_VARIABLE = 944

  #                              ◆ Add Difficulty Command to Main Menu ◆
  #  This toggle enables/disables the difficulty command selection to be added
  #   to the main command menu.
  USE_MENU_DIFFICULTY_COMMAND = true

  #                                       ◆ Difficulty Initialization ◆
  #  DIFFICULTY Index
  #  By default, 1 = Normal
  INITIAL_DIFFICULTY = 1

  #                                                ◆ Difficulty ◆
  #  Difficulty Format:
  #   DIFFICULTY << {
  #      :name  => "Difficulty Name",
  #      :maxhp => MaxHP,
  #      :maxmp => MaxMP,
  #      :atk   => Attack,
  #      :def   => Defense,
  #      :mat   => Magic Attack,
  #      :mdf   => Magic Defense,
  #      :agi   => Agility,
  #      :luk   => Luck
  #      :param => Attack ・ Defense ・ Mat, Mdf ・ Agility, Luck (Batch Specification),
  #      :exp   => Experience,
  #      :gold  => Gold,
  #      :drop  => Item Drop Rate,
  #   }
  #  Create by the format
  #  (:atk, :def, :spi, :agi (The :param field takes highest priority)
  #  The unit is a percentile of a each item.
  #  :name is not optional
  #  An omitted item is treated as a default of 100
  DIFFICULTY = [] # Do not remove or modify this line!
  # 〜 Custom Difficulty Settings Inserted Below Here 〜
  DIFFICULTY << {               # Difficulty Level: 0
        :name  => "简单",
        :maxhp => 80,
        :maxmp => 80,
        :param => 80,
        :cri   => 50,
        :drop  => 80,
  }  # ← Do not remove!
  DIFFICULTY << {               # Difficulty Level: 1
        :name  => "普通",
  }
  DIFFICULTY << {               # Difficulty Level: 2
        :name  => "困难",
        :maxhp => 150,   #150
        :maxmp => 130,
        :atk   => 120,
        :mat   => 120,
        :mdf   => 120,
        :agi   => 105,
        :luk   => 110,
        :exp   => 150,
        :drop  => 150,
  }

end
end

#------------------------------------------------------------------------------#

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

module KGC::BattleDifficulty
  # Parameters
  PARAMS = [
        :maxhp, :maxmp, :atk, :def, :mat, :mdf, :agi, :luk,
        :exp, :gold, :drop
  ]

  module_function
  #--------------------------------------------------------------------------
  # ○ 難易度補正値作成
  #--------------------------------------------------------------------------
  def create_param_revs
        @@param_revs = []
        DIFFICULTY.each { |d|
          rev = {}
          rev[:name] = d[:name]
          # 一括指定を適用
          if d[:param] != nil
                rev[:atk] = rev[:def] = rev[:mat] = rev[:mdf] = rev[:agi] = rev[:luk] = d[:param]
          end
          # パラメータ指定を適用
          PARAMS.each { |par|
                if d[par] != nil
                  rev[par] = d[par]
                else
                  rev[par] = 100 if rev[par] == nil
                end
          }
          # リストに追加
          @@param_revs << rev
        }
  end
  #--------------------------------------------------------------------------
  # ○ 難易度補正値取得
  #--------------------------------------------------------------------------
  def param_revs
        return @@param_revs
  end
  #--------------------------------------------------------------------------
  # ○ 難易度インデックス取得
  #--------------------------------------------------------------------------
  def get_index
        vid = DIFFICULTY_VARIABLE
        if $game_variables[vid] < 0 || DIFFICULTY.size <= $game_variables[vid]
          $game_variables[vid] = INITIAL_DIFFICULTY
        end
        return $game_variables[vid]
  end
  #--------------------------------------------------------------------------
  # ○ 難易度取得
  #--------------------------------------------------------------------------
  def get
        return @@param_revs[get_index]
  end
  #--------------------------------------------------------------------------
  # ○ 難易度変更
  #      index : 難易度インデックス
  #--------------------------------------------------------------------------
  def set(index)
        index = [[index, DIFFICULTY.size - 1].min, 0].max
        $game_variables[DIFFICULTY_VARIABLE] = index
  end

  create_param_revs
end

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

#==============================================================================
# ■ RPG::Enemy::DropItem
#==============================================================================

unless $@
class RPG::Enemy::DropItem
  #--------------------------------------------------------------------------
  # ● 出現率 1/N の分母 N
  #--------------------------------------------------------------------------
  alias denominator_KGC_BattleDifficulty denominator
  def denominator
    n = @denominator
    if n > 1
      n = [n * 100 / KGC::BattleDifficulty.get[:drop], 1].max
    end
    return n
  end

end  # class
end  # unless $@

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

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

class Game_Enemy < Game_Battler


  # Ace defines one method for accessing all basic parameters
  alias :th_kgc_difficulty_param_base :param_base
  def param_base(i)
    th_kgc_difficulty_param_base(i) * KGC::BattleDifficulty.get[:maxhp] / 100
  end


  #--------------------------------------------------------------------------
  # ● 経験値の取得
  #--------------------------------------------------------------------------
  alias :th_KGC_BattleDifficulty_exp :exp
  def exp
    th_KGC_BattleDifficulty_exp * KGC::BattleDifficulty.get[:exp] / 100
  end
  #--------------------------------------------------------------------------
  # ● お金の取得
  #--------------------------------------------------------------------------
  alias :th_KGC_BattleDifficulty_gold :gold
  def gold
    th_KGC_BattleDifficulty_gold * KGC::BattleDifficulty.get[:gold] / 100
  end
end

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

#==============================================================================
# ■ Scene_Title
#==============================================================================

module DataManager

  class << self
    alias :th_KGC_BattleDifficulty_create_game :create_game_objects
  end

  def self.create_game_objects
    th_KGC_BattleDifficulty_create_game
    variable_id = KGC::BattleDifficulty::DIFFICULTY_VARIABLE
    p variable_id
    $game_variables[variable_id] = KGC::BattleDifficulty::INITIAL_DIFFICULTY
  end
end





=begin



#==============================================================================
# ■ Scene_Menu
#==============================================================================


# new window for Ace, moving it out of Scene_Menu
class Window_BattleDifficulty < Window_Command
  
  def make_command_list
    KGC::BattleDifficulty::param_revs.each { |d|
      add_command(d[:name], d[:name].to_sym)
    }
  end
end

class Window_MenuCommand
  
  alias :th_kgc_battle_difficulty_add_main_commands :add_main_commands
  def add_main_commands
    th_kgc_battle_difficulty_add_main_commands
    if KGC::BattleDifficulty::USE_MENU_DIFFICULTY_COMMAND
      add_command("Difficulty", :difficulty, main_commands_enabled)
    end
  end
end

class Scene_Menu
  
  # add new menu to the scene
  
  alias :th_kgc_battle_difficulty_start :start
  def start
    th_kgc_battle_difficulty_start
    create_difficulty_window
  end
  
  alias :th_kgc_battle_difficulty_cmd_window :create_command_window
  def create_command_window
    th_kgc_battle_difficulty_cmd_window
    @command_window.set_handler(:difficulty,      method(:command_difficulty))
  end
  
  def create_difficulty_window
    @difficulty_window = Window_BattleDifficulty.new(80, 100)
    @difficulty_window.set_handler(:ok, method(:on_difficulty_ok))
    @difficulty_window.set_handler(:cancel, method(:on_difficulty_cancel))
    @difficulty_window.hide.deactivate
  end
  
  def command_difficulty
    @difficulty_window.show.open.activate
  end
  
  def on_difficulty_ok
    KGC::BattleDifficulty.set(@difficulty_window.index)
    end_difficulty_selection
  end
  
  def on_difficulty_cancel
    end_difficulty_selection
  end
  
  def end_difficulty_selection
    @difficulty_window.close
    @command_window.activate
  end
end


=end
游戏开发工具集,一站式AI生图+图片完美像素化及相关处理网站。
群爆炸重建后状态:论坛老人最多(只剩下了活跃的老人),技术力很强(依旧不变)的编程灌水群:901540785
专门讨论RM相关的Q群:56875149
PS:第一个群不是专门讨论RM的,第二个才是哦。
PS2:接受MV/MZ插件定制(QQ763992443)
回复

使用道具 举报

梦石
0
星屑
946
在线时间
158 小时
注册时间
2016-8-25
回帖
92
发表于 2017-5-4 09:46:44 | 显示全部楼层
是我的話我直接用選項設定簡單和普通、困難……之類的選項設定可以用變數量或開關來設定玩家選擇了哪種難度
比較說簡單就比較簡單探索但不不會有完整的資源
普通和困難則相關等等…(說了這麼久也是在說廢話)
別名:黑幽。
一個社恐的遊戲與畫圖愛好者。
路過的各位請關注一下~感謝~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部