赞 | 3 |
VIP | 0 |
好人卡 | 39 |
积分 | 1 |
经验 | 101436 |
最后登录 | 2017-9-1 |
在线时间 | 2276 小时 |
Lv1.梦旅人 路人党员
- 梦石
- 0
- 星屑
- 52
- 在线时间
- 2276 小时
- 注册时间
- 2010-12-30
- 帖子
- 3225
|
回复 阿猫一号 的帖子
用脚本吧,简单易用,插入main之前即可- class Scene_Battle
- alias old_item_result make_item_action_result
- def make_item_action_result
- old_item_result
- index = @active_battler.current_action.target_index
- target = $game_troop.smooth_target_enemy(index)
- @catch_item = [33] # 捕捉物品的 ID
- @catch_enemy = [1,2,3,4,5,6,7,8,9,10,11,12,13,14] # 可被捕捉的怪物的 ID
- if rand(100) < @item.hit and @catch_item.include?(@item.id) and
- $game_party.actors.size < 4 and @catch_enemy.include?(target.id)
- set_pet(target)
- target.hp = 0
- end
- end
- def set_pet(target)
- @pet = RPG::Actor.new
- @pet.id = $data_actors.size
- @pet.name = target.name
- @pet.class_id = 10
- @pet.initial_level = 1
- @pet.final_level = 1 + rand(10)
- @pet.exp_basis = 20 + rand(20)
- @pet.exp_inflation = 20 + rand(20)
- @pet.character_name = target.battler_name
- @pet.character_hue = target.battler_hue
- @pet.battler_name = target.battler_name
- @pet.battler_hue = target.battler_hue
- @pet.parameters = Table.new(6,100)
- for i in [email protected]_level
- @pet.parameters[0,i] = target.maxhp + (i*(target.maxhp/2))
- @pet.parameters[1,i] = target.maxsp + (i*(target.maxsp/2))
- @pet.parameters[2,i] = target.str + (i*(target.str/2))
- @pet.parameters[3,i] = target.dex + (i*(target.dex/2))
- @pet.parameters[4,i] = target.agi + (i*(target.agi/2))
- @pet.parameters[5,i] = target.int + (i*(target.int/2))
- end
- @pet.weapon_id = 0
- @pet.armor1_id = 0
- @pet.armor2_id = 0
- @pet.armor3_id = 0
- @pet.armor4_id = 0
- @pet.weapon_fix = false
- @pet.armor1_fix = false
- @pet.armor2_fix = false
- @pet.armor3_fix = false
- @pet.armor4_fix = false
- $data_actors.push(@pet)
- $game_party.add_actor(@pet.id)
- $game_party.refresh
- end
- end
- class Scene_Save
- def write_save_data(file)
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- Marshal.dump(characters, file)
- Marshal.dump(Graphics.frame_count, file)
- $game_system.save_count += 1
- $game_system.magic_number = $data_system.magic_number
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- Marshal.dump($data_actors, file)
- end
- end
- class Scene_Load
- def read_save_data(file)
- characters = Marshal.load(file)
- Graphics.frame_count = Marshal.load(file)
- $game_system = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_screen = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- $data_actors = Marshal.load(file)
- if $game_system.magic_number != $data_system.magic_number
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- $game_party.refresh
- end
- end
复制代码 |
|