| 赞 | 58 |
| VIP | |
| 好人卡 | |
| 积分 | 12 |
| 经验 | |
| 最后登录 | 2023-5-29 |
| 在线时间 | 1017 小时 |
- 梦石
- 0
- 星屑
- 1232
- 在线时间
- 1017 小时
- 注册时间
- 2011-4-30
- 回帖
- 1464
|
发表于 2015-6-2 16:39:13
|
显示全部楼层
本帖最后由 汪汪 于 2015-6-2 17:42 编辑
hp_store 的值 就是cp 的值
下面这个 ,让 cp 可以实时刷新
[pre lang="ruby"]class Window_ActorStatus < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(id, x)
@actor_num = id
super(x, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.back_opacity = 0
actor = $game_party.actors[@actor_num]
@actor_nm = actor.name
@actor_mhp = actor.maxhp
@actor_msp = actor.maxsp
@actor_hp = actor.hp
@actor_sp = actor.sp
@actor_cp = actor.hp_store #修改的这里
@actor_st = make_battler_state_text(actor, 120, true)
@status_window = []
for i in 0...5
@status_window.push(Window_DetailsStatus.new(actor, i, x))
end
refresh(false)
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
for i in 0...5
@status_window.dispose
end
super
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(level_up_flags)
self.contents.clear
actor = $game_party.actors[@actor_num]
@status_window[0].refresh(actor) if @actor_nm != actor.name
@status_window[1].refresh(actor) if
@actor_mhp != actor.maxhp or @actor_hp != actor.hp
@status_window[2].refresh(actor) if
@actor_msp != actor.maxsp or @actor_sp != actor.sp
@status_window[2].refresh(actor) if
@actor_cp != actor.hp_store #修改的这里
@status_window[3].refresh(actor, level_up_flags) if
@actor_st != make_battler_state_text(actor, 120, true) or level_up_flags
@actor_nm = actor.name
@actor_mhp = actor.maxhp
@actor_msp = actor.maxsp
@actor_hp = actor.hp
@actor_sp = actor.sp
@actor_cp = actor.hp_store #修改的这里
@actor_st = make_battler_state_text(actor, 120, true)
end
#--------------------------------------------------------------------------
# ● ATゲージリフレッシュ
#--------------------------------------------------------------------------
def at_refresh
@status_window[4].refresh($game_party.actors[@actor_num])
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
for window in @status_window
window.update
end
end
end[/pre]
普通攻击击中时
请在Game_Battler中( RTAB战斗系统 Ver 1.16 里 )
把下面 ★ 打中的时候蓄HP储存条 之间的内容添加在相应位置
[pre lang="ruby"] def attack_effect(attacker)
# クリティカルフラグをクリア
self.critical[attacker] = false
state_p[attacker] = []
state_m[attacker] = []
# 第一命中判定
hit_result = (rand(100) < attacker.hit)
# 命中の場合
if hit_result == true
# 基本ダメージを計算
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage[attacker] = atk * (20 + attacker.str) / 20
# 属性修正
self.damage[attacker] *= elements_correct(attacker.element_set)
self.damage[attacker] /= 100
# ダメージの符号が正の場合
if self.damage[attacker] > 0
# クリティカル修正
if rand(100) < 4 * attacker.dex / self.agi
self.damage[attacker] *= 2
self.critical[attacker] = true
end
# 防御修正
if self.guarding?
self.damage[attacker] /= 2
end
end
# 分散
if self.damage[attacker].abs > 0
amp = [self.damage[attacker].abs * 15 / 100, 1].max
self.damage[attacker] += rand(amp+1) + rand(amp+1) - amp
end
# 第二命中判定
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage[attacker] < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# 命中の場合
if hit_result == true
# ステート衝撃解除
remove_states_shock
# HP からダメージを減算
# ステート変化
@state_changed = false
states_plus(attacker, attacker.plus_state_set)
states_minus(attacker, attacker.minus_state_set)
# ★ 打中的时候蓄HP储存条
if attacker.is_a?(Game_Actor)
for i in $game_party.actors
if i == attacker
i.hp_store += 100
i.hp_store = [i.hp_store,300].min
end
end
end # ★ 打中的时候蓄HP储存条
# ミスの場合
else
# ダメージに "Miss" を設定
self.damage[attacker] = "Miss"
# クリティカルフラグをクリア
self.critical[attacker] = false
end
# メソッド終了
return true
end[/pre]
挨打时的添加原脚本有,只是被注释了
搜索
# ★ 挨打的时候蓄HP储存条
然后把英文字母之前的#删去就好
|
评分
-
查看全部评分
|