Project1
标题:
每回合自动回血回蓝或损血的脚本跳字問題
[打印本页]
作者:
mmm999xp
时间:
2020-3-31 15:33
标题:
每回合自动回血回蓝或损血的脚本跳字問題
以下是我使用的每回合自动回血回蓝或损血的脚本,但是有个问题,这个脚本若是同时有回血跟损血的状态,战斗中跳字会变成只有损血,没有回血字样(绿色的数字),经过测试跟脚本的放置顺序有关
# HP回復小
if battler.state?(3) and battler.hp >0 #-恢复生命
battler.hp_recover_effect_10
battler.damage_pop["hp_plus"] = true
end #HP傷害小
if battler.state?(3) and battler.hp >0 #-生命傷害
battler.hp_recover_effect_14
battler.damage_pop["hp_plus"] = true
end
复制代码
如果说HP伤害放置在 HP回复的下面,战斗跳字就会只显示损血,反之跳字就会是回血字样,游戏中计算血量的方式是正常的,只是跳字问题
有办法能解决吗?
以下完整脚本
#==============================================================================
# ■ Scene_Battle (分割定义 4)
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh_phase(battler)
battler.at -= @max
if battler.movable?
battler.atp = 100 * battler.at / @max
end
spell_reset(battler)
#########################狀態判斷#################################
# 連續傷害
if battler.hp > 0 and battler.slip_damage?
battler.slip_damage_effect
battler.damage_pop["slip"] = true
end
# HP回復小
if battler.state?(3) and battler.hp >0 #-恢复生命
battler.hp_recover_effect_10
battler.damage_pop["hp_plus"] = true
end
# SP回復小
if battler.state?(3) and battler.hp >0 #-SP恢復
battler.sp_recover_effect_11
battler.damage_pop["sp_plus"] = true
end
# HP傷害小
if battler.state?(3) and battler.hp >0 #-生命傷害
battler.hp_recover_effect_14
battler.damage_pop["hp_plus"] = true
end
# SP傷害小
if battler.state?(3) and battler.hp >0 #-SP傷害
battler.sp_recover_effect_15
battler.damage_pop["sp_plus"] = true
end
#####################狀態判斷結束###################################
# ステート自然解除
battler.remove_states_auto
# ステータスウィンドウをリフレッシュ
status_refresh(battler, true)
unless battler.movable?
return
end
# ターン数カウント
@turn_cnt += 1
end
end
class Game_Battler
# HP
def hp_common
# 分散
if self.damage["hp_plus"].abs > 0
amp = [self.damage["hp_plus"].abs * 15 / 100, 1].max
self.damage["hp_plus"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.hp -= self.damage["hp_plus"]
end
######################定義HP傷害#######################################
def hp_recover_effect_10
# ダメージを設定
self.damage["hp_plus"] = -self.maxhp / 5
# 分散 and 減算
hp_common
# メソッド終了
return true
end
def hp_recover_effect_14
# ダメージを設定
self.damage["hp_plus"] = self.maxhp / 10
# 分散 and 減算
hp_common
# メソッド終了
return true
end
#####################定義HP傷害結束####################################
# SP
def sp_common
# 分散
if self.damage_sp["sp_plus"].abs > 0
amp = [self.damage_sp["sp_plus"].abs * 15 / 100, 1].max
self.damage_sp["sp_plus"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.sp -= self.damage_sp["sp_plus"]
end
#####################定義SP傷害########################################
def sp_recover_effect_11
# ダメージを設定
self.damage_sp["sp_plus"] = -self.maxsp / 10
# SP からダメージを減算
sp_common
# メソッド終了
return true
end
def sp_recover_effect_15
# ダメージを設定
self.damage_sp["sp_plus"] = self.maxsp / 15
# SP からダメージを減算
sp_common
# メソッド終了
return true
end
########################定義SP傷害結束######################################
end
复制代码
作者:
灯笼菜刀王
时间:
2020-3-31 18:29
本帖最后由 灯笼菜刀王 于 2020-3-31 18:31 编辑
搜索 "sp_plus" "hp_plus" 把加和减用不同的KEY就OK拉, 可能
作者:
灯笼菜刀王
时间:
2020-3-31 20:44
本帖最后由 灯笼菜刀王 于 2020-3-31 20:47 编辑
#==============================================================================
# ■ Scene_Battle (分割定义 4)
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh_phase(battler)
battler.at -= @max
if battler.movable?
battler.atp = 100 * battler.at / @max
end
spell_reset(battler)
#########################狀態判斷#################################
# 連續傷害
if battler.hp > 0 and battler.slip_damage?
battler.slip_damage_effect
battler.damage_pop["slip"] = true
end
# HP回復小
if battler.state?(3) and battler.hp >0 #-恢复生命
battler.hp_recover_effect_10
battler.damage_pop["hp_plus1"] = true
end
# SP回復小
if battler.state?(3) and battler.hp >0 #-SP恢復
battler.sp_recover_effect_11
battler.damage_pop["sp_plus1"] = true
end
# HP傷害小
if battler.state?(3) and battler.hp >0 #-生命傷害
battler.hp_recover_effect_14
battler.damage_pop["hp_plus"] = true
end
# SP傷害小
if battler.state?(3) and battler.hp >0 #-SP傷害
battler.sp_recover_effect_15
battler.damage_pop["sp_plus"] = true
end
#####################狀態判斷結束###################################
# ステート自然解除
battler.remove_states_auto
# ステータスウィンドウをリフレッシュ
status_refresh(battler, true)
unless battler.movable?
return
end
# ターン数カウント
@turn_cnt += 1
end
end
class Game_Battler
# HP
def hp_common
# 分散
if self.damage["hp_plus"].abs > 0
amp = [self.damage["hp_plus"].abs * 15 / 100, 1].max
self.damage["hp_plus"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.hp -= self.damage["hp_plus"]
end
def hp_common1
# 分散
if self.damage["hp_plus1"].abs > 0
amp = [self.damage["hp_plus1"].abs * 15 / 100, 1].max
self.damage["hp_plus1"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.hp -= self.damage["hp_plus1"]
end
######################定義HP傷害#######################################
def hp_recover_effect_10
# ダメージを設定
self.damage["hp_plus1"] = -self.maxhp / 5
# 分散 and 減算
hp_common1
# メソッド終了
return true
end
def hp_recover_effect_14
# ダメージを設定
self.damage["hp_plus"] = self.maxhp / 10
# 分散 and 減算
hp_common
# メソッド終了
return true
end
#####################定義HP傷害結束####################################
# SP
def sp_common
# 分散
if self.damage_sp["sp_plus"].abs > 0
amp = [self.damage_sp["sp_plus"].abs * 15 / 100, 1].max
self.damage_sp["sp_plus"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.sp -= self.damage_sp["sp_plus"]
end
def sp_common1
# 分散
if self.damage_sp["sp_plus1"].abs > 0
amp = [self.damage_sp["sp_plus1"].abs * 15 / 100, 1].max
self.damage_sp["sp_plus1"] += rand(amp+1) + rand(amp+1) - amp
end
# HP からダメージを減算
self.sp -= self.damage_sp["sp_plus1"]
end
#####################定義SP傷害########################################
def sp_recover_effect_11
# ダメージを設定
self.damage_sp["sp_plus1"] = -self.maxsp / 10
# SP からダメージを減算
sp_common1
# メソッド終了
return true
end
def sp_recover_effect_15
# ダメージを設定
self.damage_sp["sp_plus"] = self.maxsp / 15
# SP からダメージを減算
sp_common
# メソッド終了
return true
end
########################定義SP傷害結束######################################
end
复制代码
你的这段脚本只是进行伤害计算, 并没有显示伤害的处理,如果这样改可以那就没事,如果还不行那就要继续去 sprite battler 里去给它们做区分
作者:
mmm999xp
时间:
2020-3-31 21:55
灯笼菜刀王 发表于 2020-3-31 20:44
你的这段脚本只是进行伤害计算, 并没有显示伤害的处理,如果这样改可以那就没事,如果还不行那 ...
谢谢你提供的方法,虽然解决了我文中的问题,但是有一个新问题,就是同时持有多种补血状态时,只显示一种回血跳字,例如我设定3号跟4号状态都是每回合回血,角色同时持有3号跟4号状态时,似乎只显示4号状态的回血
作者:
mmm999xp
时间:
2020-4-2 00:42
灯笼菜刀王 发表于 2020-3-31 20:44
你的这段脚本只是进行伤害计算, 并没有显示伤害的处理,如果这样改可以那就没事,如果还不行那 ...
太谢谢你了 问题解决了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1