| 
 
| 赞 | 0 |  
| VIP | 30 |  
| 好人卡 | 18 |  
| 积分 | 1 |  
| 经验 | 6108 |  
| 最后登录 | 2014-5-20 |  
| 在线时间 | 92 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间92 小时注册时间2013-2-23帖子130 | 
| 本帖最后由 sh0016 于 2014-2-23 04:25 编辑 
 最大HP跟最大MP是param,这个需要用脚本,谷歌下vx ace new param可以找到很多相关脚本。
 
 简单点的方式就是指定最大TP = 6项数值中的一个(比如幸运什么的),或以数值为基础计算(像 MTP = LUK*2 之类的算式)。
 下面这脚本基本算完整了(大概),已经内附在主菜单画面绘制TP条的功能。在第20行可修改公式。
 里面还对怪物的TP也进行设置了,使用的时候注意这点(不需要的话可以删掉那一段)。复制代码#==============================================================================
# ▼ 修改TP,将其变为与HP、MP类似的数值
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 注:请在第 20 行修改计算公式。
#==============================================================================
#==============================================================================
# ■ Game_BattlerBase
#------------------------------------------------------------------------------
#  管理战斗者的类。主要含有能力值计算的方法。Game_Battler 类的父类。
#==============================================================================
class Game_BattlerBase
  #--------------------------------------------------------------------------
  # OverWrite: 获取 TP 的最大值
  #               (注意在所有数值前附加“self.”)
  #--------------------------------------------------------------------------
  def max_tp
    #计算公式。例子:幸运的2倍
    self.luk * 2
  end
  #--------------------------------------------------------------------------
  # OverWrite: 获取 TP 的比率
  #--------------------------------------------------------------------------
  def tp_rate
    @tp.to_f / max_tp
  end
  #--------------------------------------------------------------------------
  # OverWrite: 完全恢复
  #--------------------------------------------------------------------------
  def recover_all
    clear_states
    @hp = mhp
    @mp = mmp
    @tp = max_tp
  end
end
  
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
#  处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
#==============================================================================
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # OverWrite: 战斗开始处理
  #--------------------------------------------------------------------------
  def on_battle_start
  end
  #--------------------------------------------------------------------------
  # OverWrite: 战斗结束处理
  #--------------------------------------------------------------------------
  def on_battle_end
    @result.clear
    remove_battle_states
    remove_all_buffs
    clear_actions
    appear
  end
  #--------------------------------------------------------------------------
  # OverWrite: 被伤害时的处理
  #--------------------------------------------------------------------------
  def on_damage(value)
    remove_states_by_damage
  end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
#  管理敌人的类。本类在 Game_Troop 类 ($game_troop) 的内部使用。
#==============================================================================
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # Alias: 初始化对象
  #--------------------------------------------------------------------------
  alias orig_initialize initialize
  def initialize(index, enemy_id)
    orig_initialize(index, enemy_id)
    @tp = max_tp # 设置敌人的TP,可以无视
  end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中所有窗口的父类
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # OverWrite: 绘制 TP 
  #--------------------------------------------------------------------------
  def draw_actor_tp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::tp_a)
    draw_current_and_max_values(x, y, width, actor.tp.to_i, actor.max_tp.to_i,
      tp_color(actor), normal_color)
  end
  #--------------------------------------------------------------------------
  # OverWrite: 绘制简单的状态
  #--------------------------------------------------------------------------
  def draw_actor_simple_status(actor, x, y)
    y -= line_height / 2
    draw_actor_name(actor, x, y)
    draw_actor_class(actor, x, y + line_height * 1)
    draw_actor_level(actor, x, y + line_height * 2)
    draw_actor_icons(actor, x, y + line_height * 3)
    draw_actor_hp(actor, x + 120, y)
    draw_actor_mp(actor, x + 120, y + line_height * 1)
    draw_actor_tp(actor, x + 120, y + line_height * 2)
  end
end
其他使用方式基本和原本一样,应该不会造成太多麻烦。
 
 顺便说下这是自己写的(虽然不是什么厉害的脚本,但请允许我宣称自己的劳动结果{:2_253:})。
 | 
 评分
查看全部评分
 |