赞 | 669 |
VIP | 62 |
好人卡 | 144 |
积分 | 334 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33442
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
本帖最后由 芯☆淡茹水 于 2014-1-14 09:17 编辑
顺手改写了一个,未测试,目测木有问题。如果测试中发现问题,请@
用法在脚本里。- #=============================================================================
- # ★ 武器自动状态 ★ by -> 芯☆淡茹水
- #=============================================================================
- # 1.复制该脚本,插入到 main 前。
- #---------------------------------------------------------------------------
- # 2.数据库武器的命名 = 武器名字 + 符号半角逗号(,) + 自动状态 ID
- # 比如命名为:铜剑,1 武器名字是:铜剑 ,武器自动状态 ID 是:1 。
- # 如果不写逗号和状态 ID ,默认状态ID为 0 。(也就是没有自动状态)
- #=============================================================================
- module RPG
- class Weapon
- #---------------------------------------------------------------------
- def name
- return @name.split(/,/)[0]
- end
- #---------------------------------------------------------------------
- def auto_state_id
- return @name.split(/,/)[1] != nil ? @name.split(/,/)[1].to_i : 0
- end
- #---------------------------------------------------------------------
- end
- end
- #============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- 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
- @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
- [url=home.php?mod=space&uid=22147]@level[/url] = actor.initial_level
- @exp_list = Array.new(101)
- make_exp_list
- [url=home.php?mod=space&uid=13302]@exp[/url] = @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_weapons[@weapon_id])
- 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 equip(equip_type, id)
- case equip_type
- when 0 # 武器
- if id == 0 or $game_party.weapon_number(id) > 0
- update_auto_state($data_weapons[@weapon_id], $data_weapons[id])
- $game_party.gain_weapon(@weapon_id, 1)
- @weapon_id = id
- $game_party.lose_weapon(id, 1)
- end
- when 1 # 盾
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor1_id], $data_armors[id])
- $game_party.gain_armor(@armor1_id, 1)
- @armor1_id = id
- $game_party.lose_armor(id, 1)
- end
- when 2 # 头
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor2_id], $data_armors[id])
- $game_party.gain_armor(@armor2_id, 1)
- @armor2_id = id
- $game_party.lose_armor(id, 1)
- end
- when 3 # 身体
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor3_id], $data_armors[id])
- $game_party.gain_armor(@armor3_id, 1)
- @armor3_id = id
- $game_party.lose_armor(id, 1)
- end
- when 4 # 装饰品
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor4_id], $data_armors[id])
- $game_party.gain_armor(@armor4_id, 1)
- @armor4_id = id
- $game_party.lose_armor(id, 1)
- end
- end
- end
- end
- #==============================================================================
复制代码 第 40 行改为:@level = actor.initial_level
第 43 行改为:@exp = @exp_list[@level]
|
|