查看: 3905|回复: 7

[已经解决] 有什么办法可以限制主角等级上限,之后能提高等级上限

[复制链接]
梦石
0
星屑
8009
在线时间
1320 小时
注册时间
2006-7-18
回帖
459
发表于 2015-2-7 15:27:23 | 显示全部楼层 |阅读模式

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

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

×
就是设定人物初期等级上限只有10级,10级后等级封顶!之后必须转职,转职以后等级上限+10达到20。

闇吼者の災悪眷族

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
回帖
6408
发表于 2015-2-7 15:28:39 | 显示全部楼层

点评

给的例子有点没看懂!他似乎是把当前角色情报用变量储存起来了???  发表于 2015-2-7 17:56
回复

使用道具 举报

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-2-7 16:16:41 | 显示全部楼层
重定义 Game_Actor#max_level 方法,别超过 99 就行
回复

使用道具 举报

梦石
0
星屑
8009
在线时间
1320 小时
注册时间
2006-7-18
回帖
459
 楼主| 发表于 2015-2-7 16:24:06 | 显示全部楼层
taroxd 发表于 2015-2-7 16:16
重定义 Game_Actor#max_level 方法,别超过 99 就行

要怎么定义??

点评

和你刚刚另一个问题的重定义方式一样  发表于 2015-2-7 16:27
回复

使用道具 举报

闇吼者の災悪眷族

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
回帖
6408
发表于 2015-2-7 18:15:32 | 显示全部楼层
和那个帖子几乎完全一样的。

你把def end的部分换成
  1.   def max_level
  2.     return 5 if actor.id == 1
  3.     actor.max_level
  4.   end
复制代码
就是艾里克的等级上限是5。

点评

我想先自己试着写一下!有不懂的再问!  发表于 2015-2-7 19:41
actor.class应该就是职业的。  发表于 2015-2-7 19:28
似乎有点想法了!判断角色当前职业改变等级上限!和以前提的几个问题(不同人物装备武器获得能力不同)和(人物说明随故事进度改变)方式类似..  发表于 2015-2-7 19:09

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-2-7 19:08:20 | 显示全部楼层
本帖最后由 tseyik 于 2015-2-7 19:12 编辑

レベル一時制限
  1. #==============================================================================
  2. # □ レベル一時制限 (for VX Ace)
  3. #------------------------------------------------------------------------------
  4. # Version : 2_20120701
  5. # by サリサ・タイクーン
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # □ 素材スイッチ
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["レベル一時制限"] = true

  13. if $rgsslab["レベル一時制限"]

  14. #==============================================================================
  15. # □ カスタマイズポイント
  16. #==============================================================================
  17. module RGSSLAB end
  18. module RGSSLAB::Level_Temporary_Limit
  19.   #--------------------------------------------------------------------------
  20.   # ○ レベル一時制限時のレベルの値の色の設定
  21.   #    一時制限されている間、レベルの色を変更します。
  22.   #
  23.   #    色を変更する色番号(ウィンドウスキンに依存)を記述して下さい。
  24.   #--------------------------------------------------------------------------
  25.   COLOR = 10
  26.   #--------------------------------------------------------------------------
  27.   # ○ レベル一時制限時のレベルの描画の反映
  28.   #    trueにすると、一時制限時でもそのレベルとして描画されます。
  29.   #--------------------------------------------------------------------------
  30.   DRAW = true
  31. end

  32. # カスタマイズポイントは、ここまで

  33. #==============================================================================
  34. # □ RGSSLAB::Level_Temporary_Limit [module]
  35. #==============================================================================
  36. module RGSSLAB::Level_Temporary_Limit
  37.   #--------------------------------------------------------------------------
  38.   # ○ 素材設定用の定数定義
  39.   #--------------------------------------------------------------------------
  40.   MATERIAL_NAME = "レベル一時制限"
  41.   VERSION       = 2
  42.   RELEASE       = 20120701
  43.   #--------------------------------------------------------------------------
  44.   # ○ 操作エラー
  45.   #     error_number : エラー番号
  46.   #--------------------------------------------------------------------------
  47.   def self.operate_error(error_number)
  48.     text = "【RGSS研究所:#{MATERIAL_NAME}】"
  49.     case error_number
  50.     when 1
  51.       msgbox_p text,
  52.       "この操作を行うには、パーティ編成システム(RGSS研究所)が必要です。"
  53.     end
  54.   end
  55. end

  56. #==============================================================================
  57. # ■ Game_Actor [class]
  58. #==============================================================================
  59. class Game_Actor < Game_Battler
  60.   #--------------------------------------------------------------------------
  61.   # ● 公開インスタンス変数
  62.   #--------------------------------------------------------------------------
  63.   attr_reader   :temp_level
  64.   #--------------------------------------------------------------------------
  65.   # ● セットアップ [エイリアス]
  66.   #     actor_id : アクター ID
  67.   #--------------------------------------------------------------------------
  68.   alias level_temporary_limit_setup setup
  69.   def setup(actor_id)
  70.     @temp_level = 0
  71.     level_temporary_limit_setup(actor_id)
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 通常能力値の基本値取得 [再構築]
  75.   #     param_id : パラメータID
  76.   #--------------------------------------------------------------------------
  77.   def param_base(param_id)
  78.     n = 0
  79.     if $rgsslab["パラメータの追加"] && param_id > 7
  80.       n = param_base_parameter_append(param_id)
  81.     else
  82.       n = $rgsslab["レベル拡張"] ? gpb_rgsslab_level_extension(param_id) : self.class.params[param_id, get_use_level]
  83.     end
  84.     if $rgsslab["パラメータ構築設定"]
  85.       array = []
  86.       for t in RGSSLAB_145::ARRAY do array.push(t) if !array.include?(t) && check_array(t) end
  87.       for t in array
  88.         case t
  89.         when "陣形ボーナス"     ; n =  get_battle_lines_bonus(param_id, n) if $rgsslab["陣形ボーナス"]
  90.         when "性格補正"         ; n += party_bonus(param_id)               if $rgsslab["パーティボーナス"]
  91.         when "パーティボーナス" ; n += character_compensation(param_id)    if $rgsslab["パラメータ性格補正"]
  92.         end
  93.       end
  94.     else
  95.       n =  get_battle_lines_bonus(param_id, n) if $rgsslab["陣形ボーナス"]
  96.       n += party_bonus(param_id)               if $rgsslab["パーティボーナス"]
  97.       n += character_compensation(param_id)    if $rgsslab["パラメータ性格補正"]
  98.     end
  99.     return n
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ○ 使用レベルの取得
  103.   #--------------------------------------------------------------------------
  104.   def get_use_level
  105.     return level_temporary_limit if $rgsslab["レベル一時制限"]
  106.     return @level
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ○ レベル一時制限判定
  110.   #--------------------------------------------------------------------------
  111.   def level_temporary_limit
  112.     return @level      if @temp_level <= 0
  113.     return @temp_level if @level > @temp_level
  114.     return @level
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ○ レベル一時制限の設定
  118.   #     temp_level_value : 一時制限を行うレベルの値
  119.   #--------------------------------------------------------------------------
  120.   def temp_level=(temp_level_value)
  121.     final = get_final_level
  122.     @temp_level = [temp_level_value, final].min
  123.     refresh
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ○ 最終レベルの取得
  127.   #--------------------------------------------------------------------------
  128.   def get_final_level
  129.     return @now_maxlevel     if $rgsslab["最終レベル設定"]
  130.     return $data_actors[@actor_id].max_level
  131.   end
  132. end

  133. #==============================================================================
  134. # ■ Game_Actors [class]
  135. #==============================================================================
  136. class Game_Actors
  137.   #--------------------------------------------------------------------------
  138.   # ○ アクター全員のレベル一時制限リスト表示
  139.   #--------------------------------------------------------------------------
  140.   def temp_level
  141.     actors_temp_level = []
  142.     for i in 1...$data_actors.size
  143.       if self[i].temp_level != 0
  144.         actors_temp_level.push(self[i].temp_level)
  145.       else
  146.         actors_temp_level.push("false")
  147.       end
  148.     end
  149.     actors_name = {}
  150.     for i in 0...actors_temp_level.size
  151.       actors_name[$data_actors[i + 1].name] = actors_temp_level[i]
  152.     end
  153.     return actors_name
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ○ アクター全員のレベル一時制限
  157.   #     temp_level : レベル一時制限を行う値
  158.   #--------------------------------------------------------------------------
  159.   def temp_level=(temp_level)
  160.     for i in 1...$data_actors.size
  161.       $game_actors[i].temp_level = temp_level
  162.     end
  163.   end
  164. end

  165. #==============================================================================
  166. # ■ Game_Party [class]
  167. #==============================================================================
  168. class Game_Party < Game_Unit
  169.   #--------------------------------------------------------------------------
  170.   # ○ モジュールの設定
  171.   #--------------------------------------------------------------------------
  172.   RGSSLAB_032 = RGSSLAB::Level_Temporary_Limit
  173.   #--------------------------------------------------------------------------
  174.   # ○ パーティ全員のレベル一時制限リスト表示
  175.   #--------------------------------------------------------------------------
  176.   def temp_level
  177.     party_temp_level = []
  178.     for i in 0...self.members.size
  179.       if self.members[i].temp_level != 0
  180.         party_temp_level.push(self.members[i].temp_level)
  181.       else
  182.         party_temp_level.push("false")
  183.       end
  184.     end
  185.     party_name = {}
  186.     for i in 0...party_temp_level.size
  187.       party_name[self.members[i].name] = party_temp_level[i]
  188.     end
  189.     return party_name
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ○ パーティ全員のレベル一時制限
  193.   #     temp_level : レベル一時制限を行う値
  194.   #--------------------------------------------------------------------------
  195.   def temp_level=(temp_level)
  196.     for i in 0...self.members.size
  197.       self.members[i].temp_level = temp_level
  198.     end
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ○ 待機メンバー全員のレベル一時制限リスト表示
  202.   #--------------------------------------------------------------------------
  203.   def standby_temp_level
  204.     unless $rgsslab["パーティ編成システム"]
  205.       RGSSLAB_032.operate_error(1)
  206.       return
  207.     end
  208.     standby_temp_level = []
  209.     for i in 0...self.standby.size
  210.       if self.standby[i].temp_level != 0
  211.         standby_temp_level.push(self.standby[i].temp_level)
  212.       else
  213.         standby_temp_level.push("false")
  214.       end
  215.     end
  216.     standby_name = {}
  217.     for i in 0...standby_temp_level.size do standby_name[self.standby[i].name] = standby_temp_level[i] end
  218.     return standby_name
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ○ 待機メンバー全員のレベル一時制限
  222.   #     temp_level : レベル一時制限を行う値
  223.   #--------------------------------------------------------------------------
  224.   def standby_temp_level=(temp_level)
  225.     unless $rgsslab["パーティ編成システム"]
  226.       RGSSLAB_032.operate_error(1)
  227.       return
  228.     end
  229.     for i in 0...self.standby.size do self.standby[i].temp_level = temp_level end
  230.   end
  231. end

  232. #==============================================================================
  233. # ■ Window_Base [class]
  234. #==============================================================================
  235. class Window_Base < Window
  236.   #--------------------------------------------------------------------------
  237.   # ○ モジュールの設定
  238.   #--------------------------------------------------------------------------
  239.   RGSSLAB_032 = RGSSLAB::Level_Temporary_Limit
  240.   #--------------------------------------------------------------------------
  241.   # ● レベルの描画 [再構築]
  242.   #     actor : アクター
  243.   #     x     : 描画先 X 座標
  244.   #     y     : 描画先 Y 座標
  245.   #--------------------------------------------------------------------------
  246.   def draw_actor_level(actor, x, y)
  247.     change_color(system_color)
  248.     draw_text(x, y, 32, line_height, Vocab::level_a)
  249.     if actor.temp_level != 0
  250.       change_color(text_color(RGSSLAB_032::COLOR))
  251.     else
  252.       change_color(normal_color)
  253.     end
  254.     if RGSSLAB_032::DRAW and actor.temp_level != 0
  255.       if actor.level > actor.temp_level
  256.         draw_text(x + 32, y, 24, line_height, actor.temp_level, 2)
  257.       else
  258.         draw_text(x + 32, y, 24, line_height, actor.level, 2)
  259.       end
  260.     else
  261.       draw_text(x + 32, y, 24, line_height, actor.level, 2)
  262.     end
  263.   end
  264. end

  265. end
复制代码
一部分功能要以下脚本
パーティ編成システム

[pre lang="ruby" line="1"]#==============================================================================
# □ パーティ編成システム (for VX Ace)
#------------------------------------------------------------------------------
# Version : 1_20120731
# by サリサ・タイクーン
# http://www.tycoon812.com/rgss/
#==============================================================================

#==============================================================================
# □ 素材スイッチ
#==============================================================================
$rgsslab = {} if $rgsslab == nil
$rgsslab["パーティ編成システム"] = true

if $rgsslab["パーティ編成システム"]

#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module RGSSLAB end
module RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ 待機メンバーのソート機能
  #    trueにすると、待機メンバーの加入・離脱・パーティ編成システム画面において
  #    常にID順にソートされるようになります。
  #--------------------------------------------------------------------------
  SORT = true
  #--------------------------------------------------------------------------
  # ○ 強制フラグ
  #    trueにすると、待機メンバーに加える際に、パーティメンバーにいる場合は
  #    強制的に待機メンバーへ移動させます。
  #    (falseにすると、移動しない代わりに待機メンバーに加える事ができません)
  #--------------------------------------------------------------------------
  FORCE = true
  #--------------------------------------------------------------------------
  # ○ パーティ編成画面の一行辺りの待機メンバーの人数
  #    横に並べる際に、何人目で改行するのかを設定します。
  #
  #    空欄(それを選ぶと外れると言う意味)の分も含まれる為
  #    正確には、現在の待機メンバー+1の数で割り当てられる事に
  #    ご注意下さい。
  #--------------------------------------------------------------------------
  COLUMN_MAX = 9
  #--------------------------------------------------------------------------
  # ○ 外す事のできないアクターの設定
  #    IMPOSSIBLLITYに外す事のできないアクターIDを記述します。
  #
  #    ここに記述されたアクターIDは、編成画面において
  #    選択する事ができなくなります。
  #
  #    ・イベントコマンドのスクリプトでの変更方法
  #     $game_system.rgsslab028.impossibillity = [アクターID, …]
  #--------------------------------------------------------------------------
  IMPOSSIBILLITY = []
end

# カスタマイズポイントは、ここまで

#==============================================================================
# □ RGSSLAB::Party_Organization_System [module]
#==============================================================================
module RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ 素材設定用の定数定義
  #--------------------------------------------------------------------------
  MATERIAL_NAME = "パーティ編成システム"
  VERSION       = 1
  RELEASE       = 20120731
end

#==============================================================================
# ■ Game_System [class]
#==============================================================================
class Game_System
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :rgsslab028
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化 [エイリアス]
  #--------------------------------------------------------------------------
  alias party_organization_initialize initialize
  def initialize
    party_organization_initialize
    @rgsslab028 = RgssLab_028.new
  end
end

#==============================================================================
# □ RgssLab_028 [class]
#==============================================================================
class RgssLab_028
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_028 = RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :impossibillity
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    @impossibillity = RGSSLAB_028::IMPOSSIBILLITY
  end
end

#==============================================================================
# ■ Game_Party [class]
#==============================================================================
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_028 = RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader :standby
  attr_reader :actors
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化 [エイリアス]
  #--------------------------------------------------------------------------
  alias party_organization_initialize initialize
  def initialize
    party_organization_initialize
    @standby = []
  end
  #--------------------------------------------------------------------------
  # ○ メンバーの入れ替え
  #     new_members : 新しいパーティメンバーの配列
  #--------------------------------------------------------------------------
  def all_members=(new_members)
    @actors.clear
    count = 0
    for i in new_members
      @actors[count] = i
      count += 1
    end
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーを加える
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  def add_actor_organization_system(actor_id)
    @standby.push(actor_id) unless @standby.include?(actor_id) && @actors.include?(actor_id)
    @standby.uniq!
    standby_sort
    $game_player.refresh
    setup_pos if $rgsslab["陣形導入"] && $rgsslab["アクターバトラー実装"]
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーを外す
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  def remove_actor_organization_system(actor_id)
    @standby.delete(actor_id)
    standby_sort
    $game_player.refresh
    setup_pos if $rgsslab["陣形導入"] && $rgsslab["アクターバトラー実装"]
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーのソート
  #--------------------------------------------------------------------------
  def standby_sort
    return unless RGSSLAB_028::SORT
    @standby.sort!{|a, b|
      a <=> b
    }
  end
end

#==============================================================================
# ■ Game_Interpreter [class]
#==============================================================================
class Game_Interpreter
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_028 = RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ 待機メンバーを加える
  #     actor_id : アクターID
  #--------------------------------------------------------------------------
  def add_standby(actor_id)
    return if actor_id < 1
    $game_party.remove_actor(actor_id) if $game_party.actors.include?(actor_id) && RGSSLAB_028::FORCE && $game_party.actors.size > 1
    $game_party.add_actor_organization_system(actor_id)
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーを外す
  #     actor_id : アクターID
  #     back     : パーティ加入フラグ
  #--------------------------------------------------------------------------
  def remove_standby(actor_id, back = true)
    return if actor_id < 1
    $game_party.add_actor(actor_id) if back && $game_party.standby.include?(actor_id)
    $game_party.remove_actor_organization_system(actor_id)
  end
  #--------------------------------------------------------------------------
  # ○ パーティ編成システムの呼び出し
  #--------------------------------------------------------------------------
  def call_standby
    SceneManager.call(Scene_Party_Organization_System)
    Fiber.yield
  end
end

#==============================================================================
# □ Window_Party_Organization_Help [class]
#==============================================================================
class Window_Party_Organization_Help < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :text_index
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化 [オーバーライド]
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    @text_index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    case @text_index
    when 0
      str  = "Cボタン:決定 Bボタン:編成終了"
      rect = contents.text_size(str)
    when 1
      str  = "Cボタン:決定 Bボタン:キャンセル"
      rect = contents.text_size(str)
    end
    contents.draw_text(4, 0, rect.width, line_height, str)
  end
end

#==============================================================================
# □ Window_Party_Member
#==============================================================================
class Window_Party_Member < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    max = $game_party.all_members.size + 1
    @column_max   = max
    @item_max     = max
    super(0, 96, Graphics.width, 80)
    self.opacity  = 0
    self.index    = 0
    self.z        = 101
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ 桁数の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def col_max
    return @column_max
  end
  #--------------------------------------------------------------------------
  # ○ 項目数の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def item_max
    return @item_max
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ [オーバーライド]
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    for actor in $game_party.all_members do draw_actor(actor, actor.index) end
  end
  #--------------------------------------------------------------------------
  # ○ アクターグラフィックの描画
  #     actor : アクター
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_actor(actor, index)
    if $game_system.rgsslab028.impossibillity.include?(actor.id)
      draw_actor_graphic_impossibillity(actor, 24 + 48 * index, 40)
    else
      draw_actor_graphic(actor, 24 + 48 * index, 40)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 入れ替えのできないアクターの歩行グラフィック描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_actor_graphic_impossibillity(actor, x, y)
    return if actor.name == nil
    bitmap = Cache.character(actor.character_name)
    sign = actor.name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = actor.character_index
    src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, 64)
  end
  #--------------------------------------------------------------------------
  # ○ カーソルの更新 [オーバーライド]
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(@index * 48, 0, 48, 48)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 最大値の再設定
  #--------------------------------------------------------------------------
  def max_reset
    @item_max = $game_party.members.size + 1
  end
end

#==============================================================================
# □ Window_Standby_Member [class]
#==============================================================================
class Window_Standby_Member < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_028 = RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化 [オーバーライド]
  #--------------------------------------------------------------------------
  def initialize
    max = $game_party.standby.size
    if max == 0
      max = 1
    else
      max += 1
    end
    @column_max   = RGSSLAB_028::COLUMN_MAX
    @item_max     = max
    super(0, 208, Graphics.width, 128)
    self.opacity  = 0
    self.index    = -1
    self.active   = false
    self.z        = 101
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ 桁数の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def col_max
    return @column_max
  end
  #--------------------------------------------------------------------------
  # ○ 項目数の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def item_max
    return @item_max
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ [オーバーライド]
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 48)
    end
    count = 0
    for actor in $game_party.standby
      draw_actor($game_actors[actor], count)
      count += 1
    end
  end
  #--------------------------------------------------------------------------
  # ○ アクターグラフィックの描画
  #     actor : アクター
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_actor(actor, index)
    draw_actor_graphic(actor, 24 + 48 * (index % @column_max), 40 + (index / @column_max * 48))
  end
  #--------------------------------------------------------------------------
  # ○ 先頭の行の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / line_height
  end
  #--------------------------------------------------------------------------
  # ○ 先頭の行の設定 [オーバーライド]
  #     row : 先頭に表示する行
  #--------------------------------------------------------------------------
  def top_row=(row)
    row = 0 if row < 0
    row = row_max - 1 if row > row_max - 1
    self.oy = row * line_height
  end
  #--------------------------------------------------------------------------
  # ○ 1 ページに表示できる行数の取得 [オーバーライド]
  #--------------------------------------------------------------------------
  def page_row_max
    return height / line_height
  end
  #--------------------------------------------------------------------------
  # ○ カーソルの更新 [オーバーライド]
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    if row < self.top_row
      self.top_row = row
    end
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    x = @index % @column_max * 48
    y = @index / @column_max * 48 - self.oy
    self.cursor_rect.set(x, y, 48, 48)
  end
  #--------------------------------------------------------------------------
  # ○ 最大値の再設定
  #--------------------------------------------------------------------------
  def max_reset
    max = $game_party.standby.size
    if max == 0
      max = 1
    else
      max += 1
    end
    @item_max     = max
  end
end

#==============================================================================
# □ Window_Actor_Information [class]
#==============================================================================
class Window_Actor_Information < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化 [オーバーライド]
  #     actor : 一番最初のアクター情報
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 322, Graphics.width, 78)
    refresh(actor)
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #     actor : アクター情報
  #--------------------------------------------------------------------------
  def refresh(actor)
    contents.clear
    if actor != nil
      actor = $game_actors[actor] if actor.is_a?(Numeric)
      draw_actor_graphic(actor, 22, 48)
      draw_actor_name(actor, 64, 0)
      draw_actor_class(actor, 208, 0)
      draw_actor_level(actor, 64, 24)
      draw_actor_hp(actor, 208, 24)
      draw_actor_mp(actor, 336, 24)
    end
  end
end

#==============================================================================
# □ Window_Party_Organization [class]
#==============================================================================
class Window_Party_Organization < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化 [オーバーライド]
  #--------------------------------------------------------------------------
  def initialize
    super(0, 48, Graphics.width, 274)
    self.opacity = 255
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    contents.draw_text(4,   0, 155, line_height, "パーティメンバー")
    contents.draw_text(4, 112, 155, line_height, "待機メンバー" )
  end
end

#==============================================================================
# □ Scene_Party_Organization_System [class]
#==============================================================================
class Scene_Party_Organization_System < Scene_Base
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_028 = RGSSLAB::Party_Organization_System
  #--------------------------------------------------------------------------
  # ○ 開始処理
  #--------------------------------------------------------------------------
  def start
    super
    create_windows
    @temporary_actor = nil
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_windows
    @help_window                = Window_Party_Organization_Help.new
    @party_member_window        = Window_Party_Member.new
    @standby_member_window      = Window_Standby_Member.new
    @information_window         = Window_Actor_Information.new($game_party.all_members[0])
    @organization_window        = Window_Party_Organization.new
    @party_member_window.active = true
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if @party_member_window.active
      update_party_member_window
      return
    end
    if @standby_member_window.active
      update_standby_member_window
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新:パーティメンバーウィンドウ
  #--------------------------------------------------------------------------
  def update_party_member_window
    @information_window.refresh($game_party.members[@party_member_window.index])
    if Input.trigger?(Input::B)
      Sound.play_cancel
      SceneManager.return
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.members[@party_member_window.index]
        if $game_system.rgsslab028.impossibillity.include?($game_party.members[@party_member_window.index].id)
          Sound.play_buzzer
          return
        end
      end
      Sound.play_ok
      @temporary_actor = $game_party.members[@party_member_window.index]
      @party_member_window.active = false
      @standby_member_window.active = true
      @standby_member_window.index = 0
      @help_window.text_index = 1
      @help_window.refresh
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新:待機メンバーウィンドウ
  #--------------------------------------------------------------------------
  def update_standby_member_window
    @information_window.refresh($game_party.standby[@standby_member_window.index])
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_party_member_process
      return
    end
    if Input.trigger?(Input::C)
      temp = $game_party.standby[@standby_member_window.index]
      if @temporary_actor != nil
        if $game_party.standby[@standby_member_window.index] != nil
          $game_party.standby[@standby_member_window.index] = @temporary_actor.id
          temp_members = []
          for i in $game_party.all_members
            temp_members.push(i.id)
          end
          temp_members[@party_member_window.index] = temp
          $game_party.all_members = temp_members
        else         
          if $game_party.members.size == 1
            Sound.play_buzzer
            return
          end
          temp = $game_party.members[@party_member_window.index]
          $game_party.remove_actor($game_party.members[@party_member_window.index].id)
          $game_party.add_actor_organization_system(temp.id)
        end
      else
        if $game_party.standby[@standby_member_window.index] == nil
          Sound.play_buzzer
          return
        end
        $game_party.add_actor($game_party.standby[@standby_member_window.index])
        $game_party.remove_actor_organization_system($game_party.standby[@standby_member_window.index])
      end
      Sound.play_ok
      $game_party.standby_sort
      $game_player.refresh
      @party_member_window.refresh
      @standby_member_window.refresh
      return_party_member_process
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ パーティメンバーウィンドウ復帰処理
  #--------------------------------------------------------------------------
  def return_party_member_process
    @temporary_actor = nil
    @party_member_window.active = true
    @standby_member_window.active = false
    @standby_member_window.index = -1
    @party_member_window.max_reset
    @standby_member_window.max_reset
    @help_window.text_index = 0
    @help_window.refresh
  end
end

end[/pre]
回复

使用道具 举报

梦石
0
星屑
8009
在线时间
1320 小时
注册时间
2006-7-18
回帖
459
 楼主| 发表于 2015-2-8 15:12:08 | 显示全部楼层
自己写了一下意外的简单啊!
唯一的遗憾是转职后等级是1,却保留原职业等级
这部分要在转职的时候用变量来储存等级,然后赋给新职业的等级上面!
  1. class Game_Actor
  2.   #--------------------------------------------------------------
  3.   #人物等级上限受职业限制
  4.   #--------------------------------------------------------------
  5.   def max_level
  6.       return 10 if class_id==1#当角色为第1个职业时,角色等级上限为10级,以下类同
  7.       return 20 if class_id==2
  8.       return 30 if class_id==3
  9.       return 40 if class_id==4
  10.       return 50 if class_id==5
  11.       return 60 if class_id==6
  12.       actor.max_level
  13.     end
  14. end
复制代码

点评

加一行 recover_all  发表于 2015-2-9 19:21
原来如此!转职后人物血魔不满了,有什么办法转职同时补满血蓝么?虽然也可以在转职时用事件来做到  发表于 2015-2-9 18:41
把 def change_class(class_id, keep_exp = false) 中的 false 改成 true 就好了...  发表于 2015-2-9 11:54
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2015-2-9 10:28:55 | 显示全部楼层
三途亚梦 发表于 2015-2-7 01:15
和那个帖子几乎完全一样的。

你把def end的部分换成就是艾里克的等级上限是5。 ...

楼主的等级上限只针对职业吧···
  1.   def max_level
  2.     return 5 if actor.class_id == 1
  3.     actor.max_level
  4.   end
复制代码
或者
  1.   def max_level
  2.     case actor.class_id
  3.    when 1,2; return 5#职业ID为1、2则最大等级为5
  4.    when 10; return 20#职业ID为10则最大等级为20
  5.   else
  6.     actor.max_level
  7.   end
复制代码
不就好了吗···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部