class Game_Battler
#--------------------------------------------------------------------------
# ● 可以使用特技的判定
# skill_id : 特技 ID
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
#############角色技能###################
if $game_party.item_number(130) < 5 and skill_id == 120
return false
end
if skill_id == 116 or skill_id == 118 or skill_id == 119 or skill_id == 121 or skill_id == 644 or skill_id == 125 or skill_id == 126 or skill_id == 127 and $game_party.item_number(130) < 1
return false
end
if skill_id == 168 or skill_id == 143 or skill_id == 142 or skill_id == 141 or skill_id == 117 or skill_id == 325 or skill_id == 326 or skill_id == 327 and $game_party.item_number(130) < 1
return false
end
if skill_id == 94 or skill_id == 99 or skill_id == 100 or skill_id == 101 and $game_party.item_number(130) < 1
return false
end
if skill_id == 148 or skill_id == 149 or skill_id == 150 or skill_id == 169 and $game_party.item_number(130) < 2
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==87
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==235
return false
end
#if not self.state?(52) and skill_id==235
#return false
#end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==290
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==291
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==318
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==257 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==88 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==89 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==90 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==91 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==92 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==93 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==258 #那个258是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==39 #漫天过海L1
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==40 #漫天过海L2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==42 #漫天过海L2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==59 #漫天过海L2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==266 #那个266是指技能ID,改成需要的数字。
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==36 #连续斩1
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==38 #连续斩2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==41 #连续斩2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==43#连续斩2
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==37#移形换影
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==632#移形换影
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==633#移形换影
return false
end
if self.hp > self.maxhp/5 or self.fennu < 50 or self.state?(72) and skill_id==634#移形换影
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==281#灭绝2
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==282#灭绝3
return false
end
if self.hp > self.maxhp/5 or self.state?(72) and skill_id==271#灭绝4
return false
end
if self.hp <= self.maxhp/2 and skill_id==145 #横扫千军or self.state?(12) or self.state?(2)
return false
end
if self.hp <= self.maxhp/2 and skill_id==146 #横扫千军or self.state?(12) or self.state?(2)
return false
end
if self.hp <= self.maxhp/2 and skill_id==97 #横扫千军or self.state?(12) or self.state?(2)
return false
end
if self.hp <= self.maxhp/2 and skill_id==98 #横扫千军or self.state?(12) or self.state?(2)
return false
end
if self.hp < self.maxhp/1.3 and skill_id==124#连劈1 or self.state?(12) or self.state?(2)
return false
end
if self.hp < self.maxhp/1.3 and skill_id==128#连劈3 or self.state?(12) or self.state?(2)
return false
end
if self.hp < self.maxhp/1.3 and skill_id==113#连劈4 or self.state?(12) or self.state?(2)
return false
end
if self.hp < self.maxhp/1.3 and skill_id==144#连劈2 or self.state?(12) or self.state?(2)
return false
end
if self.fennu < 5 and skill_id ==250 #神圣之光1
return false
end
if self.fennu < 5 and skill_id ==279 #神圣之光2
return false
end
if self.fennu < 10 and skill_id ==3 #星光
return false
end
if self.fennu < 5 and skill_id ==4 #席雨火
return false
end
if self.fennu < 50 and skill_id ==134 #贼证
return false
end
if self.fennu < 10 and skill_id ==262 #三花聚顶
return false
end
if self.fennu < 20 and skill_id ==99 #魔盾
return false
end
if self.fennu < 20 and skill_id ==100 #魔盾
return false
end
if self.fennu < 20 and skill_id ==101 #魔盾
return false
end
if self.fennu < 15 and skill_id ==256 #回魂
return false
end
if self.fennu < 80 and skill_id ==255 #圣灵
return false
end
if self.fennu < 50 and skill_id ==122 #神佑
return false
end
if self.fennu < 5 and skill_id ==260 #光之箭2
return false
end
if self.fennu < 15 and skill_id ==259
return false
end
if self.fennu < 15 and skill_id ==307
return false
end
if self.fennu < 15 and skill_id ==308
return false
end
#################召唤兽#####################
if self.fennu < 50 and skill_id ==153 #斩铁
return false
end
if self.fennu < 30 and skill_id ==154 #地狱火
return false
end
if self.fennu < 30 and skill_id ==155 #冰女
return false
end
if self.fennu < 30 and skill_id ==156
return false
end
if self.fennu < 50 and skill_id ==157
return false
end
if self.fennu < 50 and skill_id ==158
return false
end
if self.fennu < 50 and skill_id ==159
return false
end
if self.fennu < 40 and skill_id ==161
return false
end
##################SP特技##################
if self.fennu < 275 and skill_id ==8
return false
end
if self.fennu < 50 and skill_id ==20
return false
end
if self.fennu < 750 and skill_id ==9
return false
end
if self.fennu < 450 and skill_id ==10
return false
end
if self.fennu < 950 and skill_id ==11
return false
end
if self.fennu < 150 and skill_id ==12
return false
end
if self.fennu < 750 and skill_id ==13
return false
end
if self.fennu < 150 and skill_id ==14
return false
end
if self.fennu < 750 and skill_id ==15
return false
end
if self.fennu < 110 and skill_id ==16
return false
end
if self.fennu < 450 and skill_id ==17
return false
end
if self.fennu < 110 and skill_id ==18
return false
end
if self.fennu < 450 and skill_id ==19
return false
end
if self.fennu < 50 and skill_id ==267
return false
end
if self.fennu < 50 and skill_id ==268
return false
end
if self.fennu < 50 and skill_id ==269
return false
end
if self.fennu < 50 and skill_id ==270
return false
end
if self.fennu < 50 and skill_id ==132
return false
end
if self.fennu < 50 and skill_id ==135
return false
end
if self.fennu < 50 and skill_id ==626
return false
end
if self.fennu < 5 and skill_id ==273
return false
end
if self.fennu < 5 and skill_id ==275
return false
end
if self.fennu < 5 and skill_id ==276
return false
end
if self.fennu < 5 and skill_id ==278
return false
end
################################################
# 战斗不能的情况下不能使用
if dead?
return false
end
# 限制为"不能使用魔法"的情况下
#if self.restriction == 1
# 魔法禁锢, 纯魔法特技不能使用
if self.state?(5) and $data_skills[skill_id].atk_f == 0 and self.restriction == 1 and $data_skills[skill_id].agi_f != 1
return false
end
# 特技禁锢, 非魔法特技不能使用
if self.state?(12) and $data_skills[skill_id].atk_f != 0 and self.restriction == 1 and $data_skills[skill_id].agi_f != 1
return false
end
# 虚脱, HP在一半以下时不能使用特技
if self.state?(10) and self.hp < self.maxhp / 2 and self.restriction == 1 and $data_skills[skill_id].agi_f != 1
return false
end
# 遗忘, 学会的技能有一定的概率不能使用
if self.state?(11) and self.restriction == 1 and $data_skills[skill_id].agi_f != 1
return rand(100) < 50 ? true : false
end
# 诅咒, 任何消耗SP的技能都不能使用
if self.state?(2) and $data_skills[skill_id].sp_cost != 0 and self.restriction == 1
return false
end
#end
# SP 不足的情况下不能使用
if $data_skills[skill_id].sp_cost > self.sp
return false
end
# 获取可以使用的时机
occasion = $data_skills[skill_id].occasion
# 战斗中的情况下
if $game_temp.in_battle
# [平时] 或者是 [战斗中] 可以使用
return (occasion == 0 or occasion == 1)
# 不是战斗中的情况下
else
# [平时] 或者是 [菜单中] 可以使用
return (occasion == 0 or occasion == 2)
end
end
end
#--------------------------------------------------------------------------
# ● 应用通常攻击效果
# attacker : 攻击者 (battler)
#--------------------------------------------------------------------------
def attack_effect(attacker)
# 清除会心一击标志
self.critical = false
# 第一命中判定
if attacker.is_a?(Game_Actor)
hit_result = (rand(100) < 80 + attacker.agi/20 + attacker.str/20)
else
hit_result = (rand(100) > self.agi/5)
# 命中的情况下
end
if hit_result == true
# 计算基本伤害
#########################普通攻击伤害计算式改###########################
atk = [attacker.atk-self.pdef, 0].max
if attacker.is_a?(Game_Actor)
else
if rand(100) < 4
self.damage *= 2
self.critical = true
self.fennu += (1 + rand(10))
end
end
end
# 防御修正
if self.guarding?
self.damage /= 2
self.fennu += 1
end
end
# 分散
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 第二命中判定
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
#end
end
# 命中的情况下
if hit_result == true
# 状态冲击解除
remove_states_shock
# HP 的伤害计算
if not self.state?(95) and not self.state?(94) and not self.state?(93) and not self.state?(91)
self.hp -= self.damage
end
if self.state?(95)
if self.sp >= self.damage*2
self.sp -= self.damage*2
else
self.damage -= self.sp/2
self.sp = 0
self.remove_state(95)
self.hp -= self.damage
end
#else
#self.hp -= self.damage
end
if self.state?(94)
if self.sp >= self.damage
self.sp -= self.damage
else
self.damage -= self.sp
self.sp = 0
self.remove_state(94)
self.hp -= self.damage
end
end
if self.state?(93)
if self.sp >= self.damage/2
self.sp -= self.damage/2
else
self.damage -= self.sp*2
self.sp = 0
self.remove_state(93)
self.hp -= self.damage
end
end
if self.state?(91)
if self.sp >= self.damage/3
self.sp -= self.damage/3
else
self.damage -= self.sp*3
self.sp = 0
self.remove_state(91)
self.hp -= self.damage
end
end
#############################吸血#####################
if self.state?(190) and $game_actors[7].weapon_id == 130 and not $game_actors[7].state?(1)
$game_actors[7].hp += self.damage
self.remove_state(190)
end
#############################吸血完######################
# effective |= self.hp != last_hp
# effective |= self.sp != last_sp
if self.hp < 0
self.hp = 0
end
# 状态变化
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
#end
#################丢瓶神功######################
if self.damage>0 and self.state?(21) and self.damage < self.hp and not self.state?(95) and $game_party.item_number(62)>0
$game_party.gain_item(62,-1)
self.animation_id = 15
self.hp += 150
elsif self.damage>0 and self.state?(21) and self.damage < self.hp and not self.state?(95) and $game_party.item_number(62)==0 and $game_party.item_number(63)>0
$game_party.gain_item(63,-1)
self.animation_id = 16
self.hp+=450
end
###########################丢瓶神功完###########
# Miss 的情况下
else
# 伤害设置为 "Miss"
self.damage = "Miss"
#self.fennu -= rand(5)
# 清除会心一击标志
self.critical = false
end
# 过程结束
return true
end
#--------------------------------------------------------------------------
# ● 应用特技效果
# user : 特技的使用者 (battler)
# skill : 特技
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# 清除会心一击标志
self.critical = false
# 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
# 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
####################火神挂坠火系伤害调整#################
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==122
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==133
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==266
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==267
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==268
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==270
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(1) and user.armor4_id ==269
self.damage *= 1.5
self.damage = self.damage.round
end
#################七星耳环冰系伤害调整##########################
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==121
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==261
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==262
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==263
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==264
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==265
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(2) and user.armor4_id ==132
self.damage *= 1.5
self.damage = self.damage.round
end
#######################九天仙铃雷系伤害调整#########################
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==123
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==134
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==271
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==272
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==273
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==274
self.damage *= 1.5
self.damage = self.damage.round
end
if user.is_a?(Game_Actor) and skill.element_set.include?(3) and user.armor4_id ==275
self.damage *= 1.5
self.damage = self.damage.round
end
############################装备影响魔法威力改完###########################
# 过程结束
return false
end
# 清除有效标志
effective = false
# 公共事件 ID 是有效的情况下,设置为有效标志
effective |= skill.common_event_id > 0
# 第一命中判定
################必中#########333
if user.state?(49)
hit = 101
hit_result = (rand(100) < hit)
else
##########################
hit = skill.hit
if skill.atk_f > 0 and not user.state?(49)
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
end
# 不确定的特技的情况下设置为有效标志
effective |= hit < 100
# 命中的情况下
if hit_result == true
# 计算威力
power = skill.power
#if user.is_a?(Game_Actor)
if skill.atk_f > 50
power += user.atk
#power += user.str * 5
power -= self.pdef * skill.pdef_f / 100
power -= self.mdef * skill.mdef_f / 100
power -= self.dex * skill.dex_f / 100
power = [power, 0].max
end
if skill.int_f > 50 #and power > 0
power += user.int*5
power -= self.mdef * skill.mdef_f / 100
power -= self.pdef * skill.pdef_f / 100
power -= self.dex * skill.dex_f / 100
power = [power, 0].max
end
if skill.dex_f > 50 and power > 0
power += user.dex*5
power -= self.dex * skill.dex_f / 100
power -= self.mdef * skill.mdef_f / 100
power -= self.pdef * skill.pdef_f / 100
end
if skill.dex_f > 50 and power < 0
power -= user.dex*5
end
self.damage = power
# 属性修正
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# 伤害符号正确的情况下
if self.damage > 0
if user.is_a?(Game_Actor)
self.damage = power* (10+$game_variables[251])/10
else
self.damage = power / (1 + $game_variables[254]/10)
self.fennu += (1 + rand(10))
end
# 修正会心一击
if user.is_a?(Game_Actor) #and rand(100) < 4+$game_variables[254]/10
if rand(100) < 4+$game_variables[254]/10
self.damage *= 2
self.critical = true
end
else
if rand(100) < 4
self.damage *= 2
self.critical = true
self.fennu += (1 + rand(10))
end
end
else
if user.is_a?(Game_Actor)
if rand(101) < $game_variables[252]
self.damage = power*2
self.critical = true
end
end
self.hp -= self.damage
#if self.guarding?
#self.fennu -= 1
#end
end
# 分散
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 第二命中判定
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# 不确定的特技的情况下设置为有效标志
effective |= hit < 100
end
# 命中的情况下
if hit_result == true
# 威力 0 以外的物理攻击的情况下
if skill.power != 0 and skill.atk_f > 0
# 状态冲击解除
remove_states_shock
# 设置有效标志
effective = true
end
#################丢瓶神功######################
if self.damage>0 and self.state?(21) and self.damage < self.hp and not self.state?(95) and not self.state?(104) and $game_party.item_number(62)>0
$game_party.gain_item(62,-1)
self.animation_id = 15
self.hp += 150
elsif self.damage>0 and self.state?(21) and self.damage < self.hp and not self.state?(95) and not self.state?(104) and $game_party.item_number(62)==0 and $game_party.item_number(63)>0
$game_party.gain_item(63,-1)
self.animation_id = 16
self.hp+=450
end
###########################丢瓶神功完###########
# 状态变化###############冰封改#################
@state_changed = false
if not self.state?(104)#如果不是冰封状态
effective |= states_plus(skill.plus_state_set)#附加状态正常
end
effective |= states_minus(skill.minus_state_set)#不附加任何状态
# 如果没有解除冰封
if self.state?(104)
self.damage = 0 #特技伤害值为0
end
####################冰封改完##################
# HP 的伤害减法运算#########################
if self.damage < 0 and self.state?(41)
self.damage = -0
last_hp = self.hp
self.hp -= 0
else
last_hp = self.hp
########################魔力护盾##################
if self.damage > 0
if not self.state?(95) and not self.state?(94) and not self.state?(93) and not self.state?(91)
self.hp -= self.damage
end
if self.state?(95)
if self.sp >= self.damage*2
self.sp -= self.damage*2
else
self.damage -= self.sp/2
self.hp -= self.damage
self.remove_state(95)
self.sp = 0
effective |= self.hp != last_hp
end
#else
#self.hp -= self.damage
#effective |= self.hp != last_hp
end
end
if self.state?(94)
if self.sp >= self.damage
self.sp -= self.damage
else
self.damage -= self.sp
self.sp = 0
self.remove_state(94)
self.hp -= self.damage
end
end
if self.state?(93)
if self.sp >= self.damage/2
self.sp -= self.damage/2
else
self.damage -= self.sp*2
self.sp = 0
self.remove_state(93)
self.hp -= self.damage
end
end
if self.state?(91)
if self.sp >= self.damage/3
self.sp -= self.damage/3
else
self.damage -= self.sp*3
self.sp = 0
self.remove_state(91)
self.hp -= self.damage
end
end
#################3##
# 威力为 0 的场合
if skill.power == 0
# 伤害设置为空的字串
#self.damage = 1+rand(9)
# 状态没有变化的情况下
unless @state_changed
# 伤害设置为空
#self.damage = "防御"
end
end
# Miss 的情况下
else
# 伤害设置为 "Miss"
self.damage = "Miss"
#self.fennu -= rand(5)
end
#end
# 不在战斗中的情况下
unless $game_temp.in_battle
# 伤害设置为 nil
self.damage = nil
end
# 过程结束
return effective
end
#--------------------------------------------------------------------------
# ● 应用物品效果
# item : 物品
#--------------------------------------------------------------------------
def item_effect(item)
# 清除会心一击标志
self.critical = false
# 物品的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
# 或者物品的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
((item.scope == 5 or item.scope == 6) and self.hp >= 1)
# 过程结束
return false
end
# 清除有效标志
effective = false
# 公共事件 ID 是有效的情况下,设置为有效标志
effective |= item.common_event_id > 0
# 命中判定
hit_result = (rand(100) < item.hit)
# 不确定的特技的情况下设置为有效标志
effective |= item.hit < 100
# 命中的情况
if hit_result == true
# 计算回复量
recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp+item.recover_hp*$game_variables[252]/100
recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp+item.recover_sp*$game_variables[252]/100
if recover_hp < 0
recover_hp += self.pdef * item.pdef_f / 20
recover_hp += self.mdef * item.mdef_f / 20
recover_hp = [recover_hp, 0].min
end
# 属性修正
recover_hp *= elements_correct(item.element_set)
recover_hp /= 100
recover_sp *= elements_correct(item.element_set)
recover_sp /= 100
# 分散
if item.variance > 0 and recover_hp.abs > 0
amp = [recover_hp.abs * item.variance / 100, 1].max
recover_hp += rand(amp+1) + rand(amp+1) - amp
end
if item.variance > 0 and recover_sp.abs > 0
amp = [recover_sp.abs * item.variance / 100, 1].max
recover_sp += rand(amp+1) + rand(amp+1) - amp
end
# 回复量符号为负的情况下
#if recover_hp < 0
# 防御修正
# if self.guarding?
# recover_hp /= 2
#end
#end
# HP 回复量符号的反转、设置伤害值
self.damage = -recover_hp
# HP 以及 SP 的回复
##########################禁疗############################
if self.damage < 0 and self.state?(41)# and not self.state?(1)
self.damage = -0
last_hp = self.hp
self.hp -= 0
last_hp = self.hp
last_sp = self.sp
else
self.hp += recover_hp
self.sp += recover_sp
#########
if recover_sp != 0 #如果补SP的量不等于0
self.damage = -recover_sp #伤害=SP恢复量的倒数
if self.hp > self.maxhp
self.hp = self.maxhp
end
if self.sp > self.maxsp
self.sp = self.maxsp
end
end#################
effective |= self.hp != last_hp
effective |= self.sp != last_sp
# 状态变化
@state_changed = false
effective |= states_plus(item.plus_state_set)
effective |= states_minus(item.minus_state_set)
end
# 能力上升值有效的情况下
if item.parameter_type > 0 and item.parameter_points != 0
# 能力值的分支
case item.parameter_type
when 1 # MaxHP
@maxhp_plus += item.parameter_points
when 2 # MaxSP
@maxsp_plus += item.parameter_points
when 3 # 力量
@str_plus += item.parameter_points
when 4 # 灵巧
@dex_plus += item.parameter_points
when 5 # 速度
@agi_plus += item.parameter_points
when 6 # 魔力
@int_plus += item.parameter_points
end
# 设置有效标志
effective = true
end
# HP 回复率与回复量为 0 的情况下
if item.recover_hp_rate == 0 and item.recover_hp == 0 and item.recover_sp_rate == 0 and item.recover_sp == 0
# 设置伤害为空的字符串
self.damage = ""
# SP 回复率与回复量为 0、能力上升值无效的情况下
if item.recover_sp_rate == 0 and item.recover_sp == 0 and
(item.parameter_type == 0 or item.parameter_points == 0)
# 状态没有变化的情况下
unless @state_changed
# 伤害设置为 "Miss"
#self.damage = " "
end
end
end
# Miss 的情况下
else
# 伤害设置为 "Miss"
self.damage = "Miss"
end
# 不在战斗中的情况下
unless $game_temp.in_battle
# 伤害设置为 nil
self.damage = nil
end
# 过程结束
return effective
end
#--------------------------------------------------------------------------
# ● 应用连续伤害效果
#--------------------------------------------------------------------------
def slip_damage_effect
# 设置伤害
######炎灼##################################
if self.state?(102)
if self.hp >= 10000
self.damage = [self.damage,1000].max
else
self.damage = self.maxhp/10 + self.maxsp/10
end
end
######敌毒
if self.state?(3)
if self.hp >= 2000
self.damage = [self.damage,200].max
else
self.damage = self.hp / 10
end
end###########
# 分散
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# HP/MP 的伤害减法运算
#if self.state?(3) and @active_battler.is_a?(Game_Actor) and @active_battler.armor4_id ==89
#self.hp += self.damage
#else
if self.state?(3) and self.state?(53)
self.hp += self.damage
else
if self.state?(3) and not self.state?(53)
if not self.state?(95) and not self.state?(94) and not self.state?(93) and not self.state?(91)
self.hp -= self.damage
self.sp -= self.maxsp/10
end
if self.state?(95)
if self.sp >= self.damage*2
self.sp -= self.damage*2
else
self.damage -= self.sp/2
self.sp = 0
self.remove_state(95)
self.hp -= self.damage
end
#else
#self.hp -= self.damage
end
if self.state?(94)
if self.sp >= self.damage
self.sp -= self.damage
else
self.damage -= self.sp
self.sp = 0
self.remove_state(94)
self.hp -= self.damage
end
end
if self.state?(93)
if self.sp >= self.damage/2
self.sp -= self.damage/2
else
self.damage -= self.sp*2
self.sp = 0
self.remove_state(93)
self.hp -= self.damage
end
end
if self.state?(91)
if self.sp >= self.damage/3
self.sp -= self.damage/3
else
self.damage -= self.sp*3
self.sp = 0
self.remove_state(91)
self.hp -= self.damage
end
end
end
self.fennu += 3
end
if self.state?(102)
if self.hp >= 10000
self.damage = [self.damage,1000].max
end
if not self.state?(95) and not self.state?(94) and not self.state?(93) and not self.state?(91)
self.hp -= self.damage
end
if self.state?(95)
if self.sp >= self.damage*2
self.sp -= self.damage*2
else
self.damage -= self.sp/2
self.sp = 0
self.remove_state(95)
self.hp -= self.damage
end
end
if self.state?(94)
if self.sp >= self.damage
self.sp -= self.damage
else
self.damage -= self.sp
self.sp = 0
self.remove_state(94)
self.hp -= self.damage
end
end
if self.state?(93)
if self.sp >= self.damage/2
self.sp -= self.damage/2
else
self.damage -= self.sp*2
self.sp = 0
self.remove_state(93)
self.hp -= self.damage
end
end
if self.state?(91)
if self.sp >= self.damage/3
self.sp -= self.damage/3
else
self.damage -= self.sp*3
self.sp = 0
self.remove_state(91)
self.hp -= self.damage
end
end
self.fennu += 3
end
return true
end
#--------------------------------------------------------------------------
# ● 属性修正计算
# element_set : 属性
#--------------------------------------------------------------------------
def elements_correct(element_set)
# 無属性的情况
if element_set == []
# 返回 100
return 100
end
# 在被赋予的属性中返回最弱的
# ※过程 element_rate 是、本类以及继承的 Game_Actor
# 和 Game_Enemy 类的定义
weakest = -100
for i in element_set
weakest = [weakest, self.element_rate(i)].max
end
return weakest
end
2、我用了仓库脚本,里面添加了“仓库容积”限制,变量102号就是仓库能存入物品的数量,但是按照我的设置,第1个存入的物品到达上限时就无法存入另外的物品。并且始终只能读取第一个存入物品的数值,比如第一个存了3,上限是6,就算仓库里没有第二个物品,那么第二个物品1次也只能存3个(因为读取的是第一个物品的数量)。
脚本如下,请各位大侠帮忙出出主意。
PS:我不是伸手党,实在是解决不了了,困扰了个把星期,哎!只好麻烦大家。。。我会努力学习的^_^
#==============================================================================