Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ╔═══════════════════════════════════════════════╦════════════════════╗
- # ║ Title: Non Combat Actor ║ Version: 1.01 ║
- # ║ Author: Roninator2 ║ ║
- # ╠═══════════════════════════════════════════════╬════════════════════╣
- # ║ Function: ║ Date Created ║
- # ║ ╠════════════════════╣
- # ║ Specify actors to never be in combat ║ 03 Jul 2021 ║
- # ╚═══════════════════════════════════════════════╩════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Requires: nil ║
- # ║ ║
- # ╚════════════════════════════════════════════════════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Brief Description: ║
- # ║ Have Actors that do not fight ║
- # ╚════════════════════════════════════════════════════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Instructions: ║
- # ║ Place note tag on actor note box. <non combat> ║
- # ║ Change number below to Max battle members ║
- # ║ ║
- # ╚════════════════════════════════════════════════════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Updates: ║
- # ║ 1.00 - 03 Jul 2021 - Script finished ║
- # ║ 1.01 - 04 Jul 2021 - updated ║
- # ║ ║
- # ╚════════════════════════════════════════════════════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Credits and Thanks: ║
- # ║ Roninator2 ║
- # ║ ║
- # ╚════════════════════════════════════════════════════════════════════╝
- # ╔════════════════════════════════════════════════════════════════════╗
- # ║ Terms of use: ║
- # ║ Follow the original Authors terms of use where applicable ║
- # ║ - When not made by me (Roninator2) ║
- # ║ Free for all uses in RPG Maker except nudity ║
- # ║ Anyone using this script in their project before these terms ║
- # ║ were changed are allowed to use this script even if it conflicts ║
- # ║ with these new terms. New terms effective 03 Apr 2024 ║
- # ║ No part of this code can be used with AI programs or tools ║
- # ║ Credit must be given ║
- # ╚════════════════════════════════════════════════════════════════════╝
- module R2_Max_Battle_members
- MAX = 4
- end
- # ╔══════════════════════════════════════════════════════════╗
- # ║ No more editing ║
- # ╚══════════════════════════════════════════════════════════╝
- class Game_Followers
- def initialize(leader)
- @visible = $data_system.opt_followers
- @gathering = false
- @data = []
- @data.push(Game_Follower.new(1, leader))
- if SceneManager.scene_is?(Scene_Title)
- (2...R2_Max_Battle_members::MAX).each do |index|
- @data.push(Game_Follower.new(index, @data[-1]))
- end
- else
- (2...$game_party.max_battle_members).each do |index|
- @data.push(Game_Follower.new(index, @data[-1]))
- end
- end
- end
- end
- class Game_Party < Game_Unit
- attr_accessor :btlact
- def battle_members
- ptybtlmem = []
- @actors[0, max_battle_members].select {|id|
- chkact = @btlact
- nonact = $data_actors[id]
- next if nonact.note =~ /<non combat>/i
- actor = $game_actors[id]
- next if !actor.exist?
- chkact -= 1
- ptybtlmem << actor
- break if chkact == 0
- }
- return ptybtlmem
- end
- def max_battle_members
- count = 0
- @btlact = 0
- @actors.each do |i|
- actor = $game_actors[i]
- count += 1
- nonact = $data_actors[actor.id]
- next if nonact.note =~ /<non combat>/i
- @btlact += 1
- return count if @btlact == R2_Max_Battle_members::MAX
- end
- return count
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement