284.87 KB, 下载次数: 57
class Game_Party attr_reader :actors2 attr_reader :chaochao#不能从队伍向备用角色移动的角色ID attr_reader :chaochao2#不能从备用角色向队伍移动的角色ID def initialize @actors = [] @gold = 0 @steps = 0 @items = {} @weapons = {} @armors = {} @actors2 = [] @chaochao = [] @chaochao2 = [] end #add变成了add(actor_id)(宝箱君) def add(actor_id) if $game_actors[actor_id] != nil actor = $game_actors[actor_id] #如果角色不在队伍中和不在备用角色队伍中的情况下 #向备用角色中添加角色 if @actors2.push(actor) and not @actors2.include?(actor) $game_player.refresh end end end #以上是我添加的 def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。 case type when 1 if $game_actors[actor_id] != nil actor = $game_actors[actor_id] #如果队伍没有满和队伍中没有此角色 if @actors.size < 4 and not @actors.include?(actor) and not @actors2.include?(actor) @actors.push(actor) $game_player.refresh else #如果队伍全满和队伍中没有此角色(宝箱君) if not @actors.include?(actor) and not @actors2.include?(actor) add(actor_id) end end #分割线===========(宝箱君) end when 2 if $game_actors[actor_id] != nil actor = $game_actors[actor_id] #如果角色不在队伍中和不在备用角色队伍中的情况下 #向备用角色中添加角色 if @actors2.push(actor) and not @actors2.include?(actor) $game_player.refresh end end end end
1103123301 发表于 2020-8-30 23:57
改过的地方加了注释,对照一下就能看出来
class Game_Party
attr_reader :actors2
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |