Project1
标题:
被动技能
[打印本页]
作者:
恐惧剑刃
时间:
2014-1-27 02:34
标题:
被动技能
相关脚本。。我承认很简单
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 被动技能
# 设置:
# 可能使用时必须为 【不能使用】
# 除过回避,分散度和威力以外,其余参数都将提升角色的相关能力
# 比如 你设置 速度 F 的值为 100 那么该被动技能就会给角色增加 100 的速度!
# 特殊:
# 消费SP => HP
# 命中率 => MP(SP)
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 获取 MaxHP
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].hit > 0
n += $data_skills[i].hit
end
end
n = [n, 9999].min
return n
end
#--------------------------------------------------------------------------
# ● 获取基本 MaxSP
#--------------------------------------------------------------------------
def base_maxsp
n = $data_actors[@actor_id].parameters[1, @level]
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].sp_cost > 0
n += $data_skills[i].sp_cost
end
end
return n
end
#--------------------------------------------------------------------------
# ● 获取基本力量
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].str_f > 0
n += $data_skills[i].str_f
end
end
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 获取基本灵巧
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].dex_f > 0
n += $data_skills[i].dex_f
end
end
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 获取基本速度
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].agi_f > 0
n += $data_skills[i].agi_f
end
end
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 获取基本魔力
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].int_f > 0
n += $data_skills[i].int_f
end
end
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 获取基本攻击力
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
n = weapon != nil ? weapon.atk : 0
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].atk_f > 0
n += $data_skills[i].atk_f
end
end
return n
end
#--------------------------------------------------------------------------
# ● 获取基本物理防御
#--------------------------------------------------------------------------
def base_pdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
n = pdef1 + pdef2 + pdef3 + pdef4 + pdef5
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].pdef_f > 0
n += $data_skills[i].pdef_f
end
end
return n
end
#--------------------------------------------------------------------------
# ● 获取基本魔法防御
#--------------------------------------------------------------------------
def base_mdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
n = mdef1 + mdef2 + mdef3 + mdef4 + mdef5
@skills.each do |i|
if $data_skills[i].occasion == 3 and
$data_skills[i].mdef_f > 0
n += $data_skills[i].mdef_f
end
end
return n
end
end
复制代码
被动技能.rar
(228.16 KB, 下载次数: 227)
2014-1-27 02:34 上传
点击文件名下载附件
作者:
szzyc0
时间:
2014-1-27 16:42
只是一些提高能力的被动技能……没有更强大的功能了
作者:
玄胄武甲
时间:
2014-2-1 21:05
这玩意儿用处确实不大……不过还是辛苦LZ了
作者:
chd114
时间:
2014-2-2 18:47
···概率触发的被动怎么办···
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1