赞 | 0 |
VIP | 2 |
好人卡 | 7 |
积分 | 1 |
经验 | 6051 |
最后登录 | 2015-4-11 |
在线时间 | 140 小时 |
Lv1.梦旅人 月
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 140 小时
- 注册时间
- 2010-7-5
- 帖子
- 98
|
4楼
楼主 |
发表于 2010-11-14 17:01:35
|
只看该作者
#============新套装系统(支持装备扩展)============By 凌冰===================
module SUITS
#==============
#||初始化数组||
#==============
WEAPON = []
ARMORS = []
SKILLS = []
PAR_PLU = []
AUT_STA = []
GUA_ELE = []
GUA_STA = []
ELEMENT = []
PLU_STA = []
MIN_STA = []
#=============================================================================
#设置方法
#=============================================================================
#==============
#||第一套||
#==============
WEAPON[1] = []
#武器本套装的所有武器
#即一套套装里可以有多副武器
ARMORS[1] = [[1,],[5],[13]]
#防具 |盾| |头| |体| |饰(缺省)|
#即一套套装里可以有多副同类防具
#支持装备扩展,可以继续往后写
#如果套装中不包含某类,前面的或者中间的要写成[]或nil,后面的可以缺省
SKILLS[1] = [210]
#技能
PAR_PLU[1] = [0,0,0,0,0,0,0,0,0,0]
# |血|灵|力|敏|速|魔|攻|防|御|敏|
AUT_STA[1] = [0]
#自动状态
GUA_ELE[1] = [0]
#属性防御
GUA_STA[1] = [0]
#状态防御
ELEMENT[1] = [0]
#攻击属性
PLU_STA[1] = [0]
#攻击附加状态
MIN_STA[1] = [0]
#攻击解除状态
#================设置完毕================
end
module RPG
#============================================================================
#补充设置 自定义角色初始扩展装备的ID
#============================================================================
ARMOR5 = [0,0,0,0]#按照角色的ID顺序输入即可
ARMOR6 = [0,0,0,0]
ARMOR7 = [0,0,0,0]
ARMOR8 = [0,0,0,0]
end
module RPG
class Suit
attr_reader :id
attr_reader :weapon_id
attr_reader :armors_id
attr_reader :skills_id
attr_reader :plus
attr_reader :state
attr_reader :guard_e
attr_reader :guard_s
attr_reader :element
attr_reader :state_p
attr_reader :state_m
def initialize(suit_id)
@id = suit_id
@weapon_id = SUITS::WEAPON[@id]
@armors_id = SUITS::ARMORS[@id]
@skills_id = SUITS::SKILLS[@id]
@plus = SUITS::PAR_PLU[@id]
@state = SUITS::AUT_STA[@id]
@guard_e = SUITS::GUA_ELE[@id]
@guard_s = SUITS::GUA_STA[@id]
@element = SUITS::ELEMENT[@id]
@state_p = SUITS::PLU_STA[@id]
@state_m = SUITS::MIN_STA[@id]
end
end
def self.create
all_suits = []
for i in 1...SUITS::WEAPON.size
s = Suit.new(i)
all_suits = s
end
return all_suits
end
end
#=============以上貌似多此一举= =|||==================
class Game_Actor < Game_Battler
alias setup_suit setup
def setup(actor_id)
actor = $data_actors[actor_id]
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@armor5_id = actor.armor5_id if defined?(armor5_id) != nil
@armor6_id = actor.armor6_id if defined?(armor6_id) != nil
@armor7_id = actor.armor7_id if defined?(armor7_id) != nil
@armor8_id = actor.armor8_id if defined?(armor8_id) != nil
@all_suits = RPG::create
refresh_suit
setup_suit(actor_id)
for suit in 1...@all_suits.size
suit_skill_list = suits_plus(suit,16)
for i in suit_skill_list
learn_skill(i) if suit_whole?(suit)
end
state_id = suits_plus(suit,10)
for id in state_id
add_state(id, true) if suit_whole?(suit)
end
end
end
def refresh_suit
@all_armors_id = [@armor1_id,@armor2_id,@armor3_id,@armor4_id]
@all_armors_id.push(@armor5_id) if defined?(armor5_id) != nil
@all_armors_id.push(@armor6_id) if defined?(armor6_id) != nil
@all_armors_id.push(@armor7_id) if defined?(armor7_id) != nil
@all_armors_id.push(@armor8_id) if defined?(armor8_id) != nil
@suits_list = get_suits
if @suits_list == []
@suits_list.push(0)
end
end
def suit_whole?(suit_id)
suit = @all_suits[suit_id]
if suit == nil
return false
end
unless suit.weapon_id.include?(@weapon_id)
return false if !(suit.weapon_id == (nil or []))
end
for j in 0...suit.armors_id.size
if suit.armors_id[j] == (nil or [])
next
end
unless suit.armors_id[j].include?(@all_armors_id[j])
return false
end
end
return true
end
def get_suits
suits = []
for i in 1...@all_suits.size
if suit_whole?(i)
suits.push(i)
end
end
return suits
end
def suits_plus(id,parameter)
if id == 0
if parameter < 10
return 0
else
return []
end
end
suit = @all_suits[id]
if parameter < 10
return suit.plus[parameter]
else
case parameter
when 10
return suit.state
when 11
return suit.guard_e
when 12
return suit.guard_s
when 13
return suit.element
when 14
return suit.state_p
when 15
return suit.state_m
when 16
return suit.skills_id
else
return nil
end
end
end
alias base_maxhp_suit base_maxhp
def base_maxhp
n = base_maxhp_suit
for i in @suits_list
n += suits_plus(i,0)
end
return n
end
alias base_maxsp_suit base_maxsp
def base_maxsp
n = base_maxsp_suit
for i in @suits_list
n += suits_plus(i,1)
end
return n
end
alias base_str_suit base_str
def base_str
n = base_str_suit
for i in @suits_list
n += suits_plus(i,2)
end
return n
end
alias base_dex_suit base_dex
def base_dex
n = base_dex_suit
for i in @suits_list
n += suits_plus(i,3)
end
return n
end
alias base_agi_suit base_agi
def base_agi
n = base_agi_suit
for i in @suits_list
n += suits_plus(i,4)
end
return n
end
alias base_int_suit base_int
def base_int
n = base_int_suit
for i in @suits_list
n += suits_plus(i,5)
end
return n
end
alias base_atk_suit base_atk
def base_atk
n = base_atk_suit
for i in @suits_list
n += suits_plus(i,6)
end
return n
end
alias base_pdef_suit base_pdef
def base_pdef
n = base_pdef_suit
for i in @suits_list
n += suits_plus(i,7)
end
return n
end
alias base_mdef_suit base_mdef
def base_mdef
n = base_mdef_suit
for i in @suits_list
n += suits_plus(i,8)
end
return n
end
alias base_eva_suit base_eva
def base_eva
n = base_eva_suit
for i in @suits_list
n += suits_plus(i,9)
end
return n
end
alias suit_element_rate element_rate
def element_rate(element_id)
result = suit_element_rate(element_id)
for suit in @suits_list
suit_element_guard = suits_plus(suit,11)
result/= 2 if suit_element_guard.include?(element_id)
end
return result
end
alias suit_state_guard? state_guard?
def state_guard?(state_id)
result = suit_state_guard?(state_id)
for suit in @suits_list
suit_state_guard = suits_plus(suit,12)
result = suit_state_guard.include?(state_id)
end
return result
end
alias suit_element_set element_set
def element_set
result = suit_element_set
for suit in @suits_list
suit_element = suits_plus(suit,13)
for i in suit_element
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_plus_state_set plus_state_set
def plus_state_set
result = suit_plus_state_set
for suit in @suits_list
suit_plus_state = suits_plus(suit,14)
for i in suit_plus_state
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_minus_state_set minus_state_set
def minus_state_set
result = suit_minus_state_set
for suit in @suits_list
suit_minus_state = suits_plus(suit,15)
for i in suit_minus_state
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_equip equip
def equip(equip_type, id)
suit_equip(equip_type, id)
refresh_suit
for suit in 1...@all_suits.size
suit_skill_list = suits_plus(suit,16)
for i in suit_skill_list
learn_skill(i) if suit_whole?(suit)
forget_skill(i) if skill_learn?(i) and !suit_whole?(suit)
end
state_id = suits_plus(suit,10)
for id in state_id
add_state(id, true) if suit_whole?(suit)
remove_state(id, true) if state?(id) and !suit_whole?(suit)
end
end
end
end
module RPG
class Actor
def armor5_id
return (ARMOR5[@id-1] == nil ? 0 : ARMOR5[@id-1])
end
def armor6_id
return (ARMOR6[@id-1] == nil ? 0 : ARMOR6[@id-1])
end
def armor7_id
return (ARMOR7[@id-1] == nil ? 0 : ARMOR7[@id-1])
end
def armor8_id
return (ARMOR8[@id-1] == nil ? 0 : ARMOR8[@id-1])
end
end
end |
|