自动战斗(??),战斗行动指令自动输入:可以用来制作一次性召唤兽等等
详见工程
晾晒脚本(才100多行我自豪我骄傲 233333333)[code]class Game_Temp attr_accessor :input_command, :input_skill alias initialize_input_command initialize def initialize initialize_input_command @input_command = [] @input_skill = [] @input_command[1] = "防御" # 1号角色会自动防御 @input_command[2] = "特技" # 2号角色会自动防御 @input_command[7] = "特技" # 3号角色会自动施放(默认)特技 @input_command[8] = "攻击" # 4号角色会自动攻击 @input_skill[1] = 57 #1号角色的默认技能十字斩 @input_skill[2] = 61 #2号角色的默认技能扫荡 @input_skill[7] = [*1..6] #7号角色的默认技能1到6号特技 @input_skill[8] = 7 #8号角色的默认技能火炎 endendclass Scene_Battle def input_command # 输入指令 for actor_index in 0...$game_party.actors.size case $game_temp.input_command[$game_party.actors[actor_index].id] when "防御" # 设置行动 $game_party.actors[actor_index].current_action.kind = 0 $game_party.actors[actor_index].current_action.basic = 1 when "攻击" # 设置行动 $game_party.actors[actor_index].current_action.kind = 0 $game_party.actors[actor_index].current_action.basic = 0 # 随机选择敌人 $game_party.actors[actor_index].current_action.target_index = $game_troop.enemies.index($game_troop.random_target_enemy) when "特技" if $game_temp.input_skill[$game_party.actors[actor_index].id].is_a?(Numeric) skill = $data_skills[$game_temp.input_skill[$game_party.actors[actor_index].id]] # 魔法不足或者无效特技 if (skill.sp_cost > $game_party.actors[actor_index].sp) or ([2, 3].include?(skill.occasion) or skill.scope == 0) # 气血较多自动攻击,较少自动防御 if 1.0 * $game_party.actors[actor_index].hp / $game_party.actors[actor_index].maxhp >= 0.3 # 设置行动 $game_party.actors[actor_index].current_action.kind = 0 $game_party.actors[actor_index].current_action.basic = 0 # 随机选择敌人 $game_party.actors[actor_index].current_action.target_index = $game_troop.enemies.index($game_troop.random_target_enemy) else # 设置行动 $game_party.actors[actor_index].current_action.kind = 0 $game_party.actors[actor_index].current_action.basic = 1 end next end elsif $game_temp.input_skill[$game_party.actors[actor_index].id].is_a?(Array) skill_id = $game_temp.input_skill[$game_party.actors[actor_index].id] # 随机特技 input_id = [] for id in skill_id skill = $data_skills[id] if (skill.sp_cost