Project1
标题:
能否将game actor中的被动技变成主动技能
[打印本页]
作者:
巧克力猫咪
时间:
2010-11-20 21:11
标题:
能否将game actor中的被动技变成主动技能
本帖最后由 巧克力猫咪 于 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
我想问下武器防具的也变主动技要这么改啊
作者:
企鹅达达
时间:
2010-11-20 22:03
本帖最后由 企鹅达达 于 2010-11-20 22:05 编辑
我在想,猫咪是不是对KGC的脚本毫无研究?那的被动技能脚本非常全面啊……
p.s. 装备扩张里面的自动状态、状态里面的习得技能状态或者装备习得技能的脚本都可以帮到你
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1