赞 | 671 |
VIP | 62 |
好人卡 | 144 |
积分 | 335 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33469
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
下面这个很简易,不显示固定武器,但其属性会加到角色身上。
固定武器为 数据库-角色 里面给角色设置的那把初始的武器。角色初始装备的武器就没有,需在游戏中给予并装备。
因固定武器不显示,所以就没有被取下的情况。数据库-角色 的武器固定就不用打勾。- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- attr_reader :weapon2_id # 武器2 ID
- #--------------------------------------------------------------------------
- def setup(actor_id)
- actor = $data_actors[actor_id]
- @actor_id = actor_id
- @name = actor.name
- @character_name = actor.character_name
- @character_hue = actor.character_hue
- @battler_name = actor.battler_name
- @battler_hue = actor.battler_hue
- @class_id = actor.class_id
- @weapon2_id = actor.weapon_id
- @weapon_id = 0
- @armor1_id = actor.armor1_id
- @armor2_id = actor.armor2_id
- @armor3_id = actor.armor3_id
- @armor4_id = actor.armor4_id
- @level = actor.initial_level
- @exp_list = Array.new(101)
- make_exp_list
- @exp = @exp_list[@level]
- @skills = []
- @hp = maxhp
- @sp = maxsp
- @states = []
- @states_turn = {}
- @maxhp_plus = 0
- @maxsp_plus = 0
- @str_plus = 0
- @dex_plus = 0
- @agi_plus = 0
- @int_plus = 0
- # 学会特技
- for i in 1..@level
- for j in $data_classes[@class_id].learnings
- if j.level == i
- learn_skill(j.skill_id)
- end
- end
- end
- # 刷新自动状态
- update_auto_state(nil, $data_armors[@armor1_id])
- update_auto_state(nil, $data_armors[@armor2_id])
- update_auto_state(nil, $data_armors[@armor3_id])
- update_auto_state(nil, $data_armors[@armor4_id])
- end
- #--------------------------------------------------------------------------
- # ● 获取普通攻击属性
- #--------------------------------------------------------------------------
- def element_set
- set1 = $data_weapons[@weapon_id] != nil ? $data_weapons[@weapon_id].element_set : []
- set2 = $data_weapons[@weapon2_id] != nil ? $data_weapons[@weapon2_id].element_set : []
- return set1 + set2
- end
- #--------------------------------------------------------------------------
- # ● 获取普通攻击状态变化 (+)
- #--------------------------------------------------------------------------
- def plus_state_set
- set1 = $data_weapons[@weapon_id] != nil ? $data_weapons[@weapon_id].plus_state_set : []
- set2 = $data_weapons[@weapon2_id] != nil ? $data_weapons[@weapon2_id].plus_state_set : []
- return set1 + set2
- end
- #--------------------------------------------------------------------------
- # ● 获取普通攻击状态变化 (-)
- #--------------------------------------------------------------------------
- def minus_state_set
- set1 = $data_weapons[@weapon_id] != nil ? $data_weapons[@weapon_id].minus_state_set : []
- set2 = $data_weapons[@weapon2_id] != nil ? $data_weapons[@weapon2_id].minus_state_set : []
- return set1 + set2
- end
- #--------------------------------------------------------------------------
- # ● 获取基本力量
- #--------------------------------------------------------------------------
- def base_str
- n = $data_actors[@actor_id].parameters[2, @level]
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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 += weapon2 != nil ? weapon2.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
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 获取基本灵巧
- #--------------------------------------------------------------------------
- def base_dex
- n = $data_actors[@actor_id].parameters[3, @level]
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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 += weapon2 != nil ? weapon2.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
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 获取基本速度
- #--------------------------------------------------------------------------
- def base_agi
- n = $data_actors[@actor_id].parameters[4, @level]
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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 += weapon2 != nil ? weapon2.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
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 获取基本魔力
- #--------------------------------------------------------------------------
- def base_int
- n = $data_actors[@actor_id].parameters[5, @level]
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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 += weapon2 != nil ? weapon2.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
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 获取基本攻击力
- #--------------------------------------------------------------------------
- def base_atk
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_id]
- return (weapon != nil ? weapon.atk : 0) + (weapon2 != nil ? weapon2.atk : 0)
- end
- #--------------------------------------------------------------------------
- # ● 获取基本物理防御
- #--------------------------------------------------------------------------
- def base_pdef
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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
- pdef6 = weapon2 != nil ? weapon2.pdef : 0
- return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6
- end
- #--------------------------------------------------------------------------
- # ● 获取基本魔法防御
- #--------------------------------------------------------------------------
- def base_mdef
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_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
- mdef6 = weapon2 != nil ? weapon2.mdef : 0
- return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6
- end
- #--------------------------------------------------------------------------
- # ● 普通攻击 获取攻击方动画 ID
- #--------------------------------------------------------------------------
- def animation1_id
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_id]
- return weapon2.animation1_id if weapon2 != nil
- return weapon.animation1_id if weapon != nil
- return 0
- end
- #--------------------------------------------------------------------------
- # ● 普通攻击 获取对像方动画 ID
- #--------------------------------------------------------------------------
- def animation2_id
- weapon = $data_weapons[@weapon_id]
- weapon2 = $data_weapons[@weapon2_id]
- return weapon2.animation2_id if weapon2 != nil
- return weapon.animation2_id if weapon != nil
- return 0
- end
- end
- #==============================================================================
复制代码 |
|