du rufst es auf, indem du einfach einen kampf gegen die truppe, die du bei
Code:
Troop2Save = {
1 => "Save1.rxdata",
2 => "Save2.rxdata",
3 => "Save3.rxdata",
4 => "Save4.rxdata"
}
angegeben hast, startest.
(das andere kampfscript damit ersetzen, falls dus bereits eingebaut hast)
Code:
Troop2Save = {
1 => "Save1.rxdata",
2 => "Save2.rxdata",
3 => "Save3.rxdata",
4 => "Save4.rxdata"
}
HEAL = 100
ATTACK = 1
GOLD = 0
EXP = 0
MINSP = 150
module KI
class <<self
def create_skill_table
@skills = {}
for skill in $data_skills
next if skill.nil?
spell = RPG::Enemy::Action.new
spell.kind = 1
spell.skill_id = skill.id
if skill.power < 0
spell.condition_hp = HEAL
spell.rating = 10
end
@skills[skill.id] = spell
end
end
def skills
return @skills
end
def attack
n = RPG::Enemy::Action.new
n.rating = ATTACK
return n
end
end
end
class Game_Temp
attr_accessor :ki
alias initialize_multi initialize unless defined?(initialize_multi)
def initialize
@ki = true
initialize_multi
end
end
class Scene_Title
alias main_multi main unless defined?(main_multi)
def main
main_multi
KI.create_skill_table
end
end
class Scene_Battle
attr_reader :turn
unless defined?(main_multi)
alias main_multi main
end
def main
@turn = 0
main_multi
end
def start_phase2
@phase = 2
@actor_index = -1
@active_battler = nil
@party_command_window.active = true
@party_command_window.visible = true
@actor_command_window.active = false
@actor_command_window.visible = false
$game_temp.battle_main_phase = false
if @turn % 2 == 0 or $game_temp.ki
$game_party.clear_actions
else
for enemy in $game_troop.enemies
enemy.current_action.clear
end
end
unless $game_party.inputable?
start_phase4
end
end
def start_phase4
@turn += 1
if @turn % 2 == 1 and not $game_temp.ki
start_phase2
return
end
@phase = 4
$game_temp.battle_turn += 1
for index in 0...$data_troops[@troop_id].pages.size
page = $data_troops[@troop_id].pages[index]
if page.span == 1
$game_temp.battle_event_flags[index] = false
end
end
@actor_index = -1
@active_battler = nil
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = false
@actor_command_window.visible = false
$game_temp.battle_main_phase = true
if $game_temp.ki
for enemy in $game_troop.enemies
enemy.make_action
end
end
make_action_orders
@phase4_step = 1
end
def phase3_next_actor
begin
if @active_battler != nil
@active_battler.blink = false
end
if @turn % 2 == 0 or $game_temp.ki
if @actor_index == $game_party.actors.size-1
start_phase4
return
end
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
else
if @actor_index == $game_troop.enemies.size-1
start_phase4
return
end
@actor_index += 1
@active_battler = $game_troop.enemies[@actor_index]
end
@active_battler.blink = true
end until @active_battler.inputable?
phase3_setup_command_window
end
def phase3_prior_actor
begin
if @active_battler != nil
@active_battler.blink = false
end
if @actor_index == 0
start_phase2
return
end
@actor_index -= 1
if @turn % 2 == 0 or $game_temp.ki
@active_battler = $game_party.actors[@actor_index]
else
@active_battler = $game_troop.enemies[@actor_index]
end
@active_battler.blink = true
end until @active_battler.inputable?
phase3_setup_command_window
end
def start_enemy_select
if @turn % 2 == 0 or $game_temp.ki
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
else
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
end
@enemy_arrow.help_window = @help_window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def set_target_battlers(scope)
if $game_troop.enemies.include?(@active_battler)
case scope
when 1 # single enemy
index = @active_battler.current_action.target_index
@target_battlers.push($game_party.smooth_target_actor(index))
when 2 # all enemies
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 3 # single ally
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 4 # all allies
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 5 # single ally (HP 0)
index = @active_battler.current_action.target_index
enemy = $game_troop.enemies[index]
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
when 6 # all allies (HP 0)
for enemy in $game_troop.enemies
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
end
when 7 # user
@target_battlers.push(@active_battler)
end
else
case scope
when 1 # single enemy
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 2 # all enemies
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 3 # single ally
index = @active_battler.current_action.target_index
@target_battlers.push($game_party.smooth_target_actor(index))
when 4 # all allies
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 5 # single ally (HP 0)
index = @active_battler.current_action.target_index
actor = $game_party.actors[index]
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
when 6 # all allies (HP 0)
for actor in $game_party.actors
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
end
when 7 # user
@target_battlers.push(@active_battler)
end
end
end
def make_basic_action_result
if @active_battler.current_action.basic == 0
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
if $game_troop.enemies.include?(@active_battler)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
else
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
@target_battlers = [target]
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
if @active_battler.current_action.basic == 1
@help_window.set_text($data_system.words.guard, 1)
return
end
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
@help_window.set_text("Escape", 1)
@active_battler.escape
return
end
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
end
class Game_Troop
alias setup_multi setup unless defined?(setup_multi)
def setup(id)
if Troop2Save[id].nil? or not File.exists?(Troop2Save[id])
setup_multi(id)
else
load_enemy(Troop2Save[id])
end
end
def load_enemy(filename)
file = File.open(filename, "rb")
muell = Marshal.load(file)
muell = Marshal.load(file)
muell = Marshal.load(file)
muell = Marshal.load(file)
muell = Marshal.load(file)
muell = Marshal.load(file)
muell = Marshal.load(file)
actors = Marshal.load(file)
party = Marshal.load(file)
file.close
muell = nil
@enemies = party.actors
end
end
class Game_Actor
def screen_y
if $game_troop.enemies.include?(self)
return 250
else
return 464
end
end
def treasure_prob
return 0
end
def gold
return GOLD
end
def exp
return EXP
end
def index
if $game_party.actors.index(self).nil?
return $game_troop.enemies.index(self)
else
return $game_party.actors.index(self)
end
end
def make_action
self.current_action.clear
unless self.movable?
return
end
available_actions = []
rating_max = 0
actions = []
for i in 1..$data_skills.size
actions.push(KI.skills[i]) if self.skills.include?(i)
end
actions.push(KI.attack)
actions[-1].rating = 10 if self.sp < MINSP
for action in actions
n = $game_temp.battle_turn
a = action.condition_turn_a
b = action.condition_turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
if self.hp * 100.0 / self.maxhp > action.condition_hp
next
end
if $game_party.max_level < action.condition_level
next
end
switch_id = action.condition_switch_id
if switch_id > 0 and $game_switches[switch_id] == false
next
end
available_actions.push(action)
if action.rating > rating_max
rating_max = action.rating
end
end
ratings_total = 0
for action in available_actions
if action.rating > rating_max - 3
ratings_total += action.rating - (rating_max - 3)
end
end
if ratings_total > 0
value = rand(ratings_total)
for action in available_actions
if action.rating > rating_max - 3
if value < action.rating - (rating_max - 3)
self.current_action.kind = action.kind
self.current_action.basic = action.basic
self.current_action.skill_id = action.skill_id
self.current_action.decide_random_target_for_enemy
return
else
value -= action.rating - (rating_max - 3)
end
end
end
end
end
end
class Window_BattleStatus < Window_Base
unless defined?(initialize_multi)
alias initialize_multi initialize
alias update_multi update
end
def initialize
@old_turn = 0
initialize_multi
end
def refresh
self.contents.clear
a = $game_troop.enemies
a = $game_party.actors if $scene.turn % 2 == 0 or $game_temp.ki
@item_max = a.size
for i in 0...a.size
actor = a[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
def update
if @old_turn != $scene.turn
@old_turn = $scene.turn
refresh
end
update_multi
end
end
class Arrow_Enemy < Arrow_Base
def enemy
if $scene.turn % 2 == 0
return $game_troop.enemies[@index]
else
return $game_party.actors[@index]
end
end
def update
super
if $scene.turn % 2 == 0
a = $game_troop.enemies
else
a = $game_party.actors
end
a.size.times do
break if self.enemy.exist?
@index += 1
@index %= a.size
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
a.size.times do
@index += 1
@index %= a.size
break if self.enemy.exist?
end
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
a.size.times do
@index += a.size - 1
@index %= a.size
break if self.enemy.exist?
end
end
if self.enemy != nil
self.x = self.enemy.screen_x
self.y = self.enemy.screen_y
end
end
end
class Arrow_Actor < Arrow_Base
def actor
if $scene.turn % 2 == 0 or $game_temp.ki
return $game_party.actors[@index]
end
return $game_troop.enemies[@index]
end
def update
super
if $scene.turn % 2 == 0 or $game_temp.ki
a = $game_party.actors
else
a = $game_troop.enemies
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= a.size
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@index += a.size - 1
@index %= a.size
end
if self.actor != nil
self.x = self.actor.screen_x
self.y = self.actor.screen_y
end
end
end
natürlich könnte man ein script machen, dass items oder helden tauscht. man muss sich allerdings überlegen ob das wirklich so praktisch wäre.
so etwas kann zb schnell das balancing des spiels zerstören.
und was ist wenn 2 geschwister das spiel spielen und der bruder/die schwester einfach mal ein paar seltene gegenstände vom spielstand des anderen klaut :/
(das ist echt nicht lustig...ich hab meinem kleinem bruder meine pokemon edition ausgeliehen und er hat meine lv 100er pokemon vertauscht -.-)
auch ein problem ist, dass man spielstände einfach kopieren kann und somit seine items verdoppelt.