赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 1 |
经验 | 952 |
最后登录 | 2013-12-27 |
在线时间 | 336 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 336 小时
- 注册时间
- 2010-8-26
- 帖子
- 428
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 巧克力猫咪 于 2010-11-20 23:38 编辑
看了game actor中的,发现有很多被动技能,如容易被瞄准,2刀流,强力防御,药物知识还有防具武器上的回合先制,防止会心,HP回复,2倍经验====,能否将它们做成可以学会某个技能后自动取得这些特殊效果啊,我看到了
#==============================================================================
# 数据库角色选项变为被动技 by 沉影不器
# -----------------------------------------------------------------------------
# 功能描述:
# 把[数据库-角色]右下角某些选项变成角色的被动技,可以学会和遗忘这些技能
# -----------------------------------------------------------------------------
# 使用方法:
# 新建名称为"二刀流"和"药物知识"的属性, 新建"二刀流"和"药物知识"技能
# 技能设为"不可用"(因为被动技),并给技能分别钩选相应属性
# 2008-08-04 新增:
# 角色的"强力防御"和"会心一击"选项也变为被动技,设定方法同上
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 初始化对象
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
@last_skill_id = 0
# 被动技标志
@critical_bonus = false
@two_swords_style = false
@super_guard = false
@pharmacology = false
end
#--------------------------------------------------------------------------
# ◎ 获取会心一击概率
#--------------------------------------------------------------------------
def cri
n = 4
n += 4 if @critical_bonus
for weapon in weapons.compact
n += 4 if weapon.critical_bonus
end
return n
end
#--------------------------------------------------------------------------
# ◎ 获取选项 "二刀流"
#--------------------------------------------------------------------------
def two_swords_style
return @two_swords_style
end
#--------------------------------------------------------------------------
# ◎ 获取选项 "强力防御"
#--------------------------------------------------------------------------
def super_guard
return @super_guard
end
#--------------------------------------------------------------------------
# ◎ 获取选项 "药物知识"
#--------------------------------------------------------------------------
def pharmacology
return @pharmacology
end
#--------------------------------------------------------------------------
# ◎ 觉醒了新的特技
# skill_id : 特技 ID
#--------------------------------------------------------------------------
def learn_skill(skill_id)
unless skill_learn?($data_skills[skill_id])
@skills.push(skill_id)
@skills.sort!
else
# 已学会时返回
return
end
# 更改会心一击标志
if $data_skills[skill_id].element_set.include? critical_bonus_id
@critical_bonus = true
end
# 更改二刀流标志
if $data_skills[skill_id].element_set.include? two_swords_id
@two_swords_style = true
# 强制卸装备
if @armor1_id != 0
item = $data_armors[@armor1_id]
$game_party.gain_item(item, 1)
@armor1_id = 0
end
end
# 更改强力防御标志
if $data_skills[skill_id].element_set.include? super_guard_id
@super_guard = true
end
# 更改药物知识标志
if $data_skills[skill_id].element_set.include? pharmacology_id
@pharmacology = true
end
end
#--------------------------------------------------------------------------
# ◎ 忘记特技
# skill_id : 特技 ID
#--------------------------------------------------------------------------
def forget_skill(skill_id)
# 已忘记时返回
return unless @skills.include?(skill_id)
@skills.delete(skill_id)
# 更改会心一击标志
if $data_skills[skill_id].element_set.include? critical_bonus_id
@critical_bonus = true
end
# 更改二刀流标志
if $data_skills[skill_id].element_set.include? two_swords_id
@two_swords_style = false
# 强制卸装备
if @armor1_id != 0
item = $data_weapons[@armor1_id]
$game_party.gain_item(item, 1)
@armor1_id = 0
end
end
# 更改强力防御标志
if $data_skills[skill_id].element_set.include? super_guard_id
@super_guard = true
end
# 更改药物知识标志
if $data_skills[skill_id].element_set.include? pharmacology_id
@pharmacology = false
end
end
#--------------------------------------------------------------------------
# ○ 获取会心一击被动技 id
#--------------------------------------------------------------------------
def critical_bonus_id
cure = 0
# 遍历属性
for i in 1...$data_system.elements.size
if $data_system.elements =~ /会心一击/
cure = i
break
end
end
return cure
end
#--------------------------------------------------------------------------
# ○ 获取二刀流被动技 id
#--------------------------------------------------------------------------
def two_swords_id
two_swords = 0
# 遍历属性
for i in 1...$data_system.elements.size
if $data_system.elements =~ /二刀流/
two_swords = i
break
end
end
return two_swords
end
#--------------------------------------------------------------------------
# ○ 获取强力防御被动技 id
#--------------------------------------------------------------------------
def super_guard_id
cure = 0
# 遍历属性
for i in 1...$data_system.elements.size
if $data_system.elements =~ /强力防御/
cure = i
break
end
end
return cure
end
#--------------------------------------------------------------------------
# ○ 获取药物知识被动技 id
#--------------------------------------------------------------------------
def pharmacology_id
cure = 0
# 遍历属性
for i in 1...$data_system.elements.size
if $data_system.elements =~ /药物知识/
cure = i
break
end
end
return cure
end
end
我想问下武器防具的也变主动技要这么改啊 |
|