Valentino's Ally System
Descrizione
In sostanza questo script permette di avere un alleato in battaglia che agirà a ogni turno usando o un attacco o una abilità a seconda delle probabilità configurate via script.
L'alleato è invincibile, è come se entrasse e uscisse dalla battaglia ogni volta, però ovviamente se in battaglia il party muore viene game over anche con l'alleato vivo XD è possibile configurare anche degli eventi in modo che si svolgano solo se si ha determinati alleati, trovate tutto nello script comunque ;)
Si può portare un solo alleato alla volta, e si può decidere se fargli prendere EXP o meno. Comunque non è visualizzabile il suo stato perchè sarebbe un po' inutile XD
Autore
Avon Valentino (Io)
Allegati
Screenshots:
L'alleato entrerebbe in slide a sinistra....
Script:
#============================================================ #Script Creato da Avon Valentino se lo usate creditatemi;) #============================================================== #L'alleato in battaglia fornirà supporto a ogni turno con magie o attacchi. #Esso non può essere danneggiato ne curato, e si può decidere se farlo salire #di livello. #Esso non conta come personaggio del party, quindi se morirete ma lui no sarà #comunque Game Over :) #Si può avere solo un alleato per volta #Comandi: #Settare un alleato: set_ally(ACTOR_ID) #rimuovere un alleato: remove_ally #usare tramite conditional branch l'id dell'alleato per creare eventi che #continuano solo se si ha un determinato alleato: id_ally(ACTOR_ID) #probabilità di uso di skill da parte dell'alleato (da 1 a 10) #SKILL_ID => PROBABILITA RATING_SKILL = { 1 => 2, 2 => 3 } RATING_BASE = 4 #probabilità predefinita delle skill sopra non assegnate #probabilità che l'alleato attacchi invece di usare una skill #Actor_ID => probabilità attacco PROB_ATT = { 4=>50 } PROB_ATT_PREDEFINITO = 50 #probabilità predefinita per i non definiti sopra EXP = true #l'alleato può ottenere exp dai combattimenti? (true/false) module RPG class Skill def rating if RATING_SKILL[@id] != nil return RATING_SKILL[@id] else return RATING_BASE end end end end class Game_Actor attr_accessor :actions alias action_initialize initialize def initialize(actor_id) action_initialize(actor_id) @actions = make_actions if self == $game_party.ally @maxsp = 9999 end end def make_actions azioni = [] for i in @skills azioni.push($data_skills[i]) end return azioni end def index if self == $game_party.ally return 0 end return $game_party.actors.index(self) end end class Interpreter def remove_ally $game_party.remove_ally end def set_ally(id) $game_party.set_ally(id) end def id_ally(id) return true if $game_party.ally.id == id return false end end class Game_Party attr_accessor :ally def alleato? return true if @ally != nil return false end def set_ally(ally_id) ally = $game_actors[ally_id] @ally = ally end def remove_ally @ally = nil end def crea_attacco @ally.current_action.kind = 0 @ally.current_action.basic = 0 end def ally_make_action @ally.sp = 9999 @ally.current_action.clear unless @ally.movable? return end num = PROB_ATT_PREDEFINITO num = PROB_ATT[@ally.id] if PROB_ATT[@ally.id] != nil if rand(100) < num crea_attacco else rating_max = 0 ratings_total = 0 for action in @ally.actions if action.rating > rating_max rating_max = action.rating end 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 @ally.actions if action.rating > rating_max - 3 if value < action.rating - (rating_max - 3) @ally.current_action.kind = 1 @ally.current_action.skill_id = action.id @ally.current_action.decide_random_target_for_actor return else value -= action.rating - (rating_max - 3) end end end end end end end class Scene_Battle alias vale_main main def main @alleato = Sprite_Ally.new @alleato.x = -200 @alleato.y = 150 @alleato.z = 400 vale_main @alleato.dispose end alias ally_up update def update @alleato.update ally_up end def phase3_next_actor begin if @active_battler != nil @active_battler.blink = false end if @actor_index == $game_party.actors.size-1 if $game_party.alleato? $game_party.ally_make_action end start_phase4 return else @actor_index += 1 @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end end until @active_battler.inputable? phase3_setup_command_window end def make_action_orders @action_battlers = [] for enemy in $game_troop.enemies @action_battlers.push(enemy) end for actor in $game_party.actors @action_battlers.push(actor) end @action_battlers.push($game_party.ally) #aggiunge l'alleato for battler in @action_battlers battler.make_action_speed end @action_battlers.sort! {|a,b| b.current_action.speed - a.current_action.speed } end alias vale_update_ph4_s2 update_phase4_step2 def update_phase4_step2 if $game_party.alleato? and @active_battler == $game_party.ally @alleato.battler = $game_party.ally for i in 1..10 @alleato.x += 20 @alleato.update @spriteset.update Graphics.update end end vale_update_ph4_s2 end alias update_phase4_step6_ally update_phase4_step6 def update_phase4_step6 if $game_party.alleato? and @active_battler == $game_party.ally for i in 1..10 @alleato.x -= 20 @alleato.update @spriteset.update Graphics.update end end update_phase4_step6_ally end alias start_phase5_ally start_phase5 def start_phase5 start_phase5_ally exp = 0 for enemy in $game_troop.enemies unless enemy.hidden exp += enemy.exp end end actor = $game_party.ally if actor.cant_get_exp? == false actor.exp += exp if EXP end end alias vale_upp4 update_phase4_step4 def update_phase4_step4 if @active_battler == $game_party.ally if @animation1_id != 0 frame = $data_animations[@animation1_id].frame_max else frame = 8 end for i in 1..frame Graphics.update @spriteset.update @alleato.update end end vale_upp4 end end class Sprite_Ally < RPG::Sprite attr_accessor :battler def initialize(viewport=nil, battler = nil) super(viewport) @battler = battler @battler_visible = false end def dispose if self.bitmap != nil self.bitmap.dispose end super end def update super if @battler == nil self.bitmap = nil loop_animation(nil) return end if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue @battler_name = @battler.battler_name @battler_hue = @battler.battler_hue self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue) @width = bitmap.width @height = bitmap.height if @battler.dead? or @battler.hidden self.opacity = 0 end end if @battler.damage == nil and @battler.state_animation_id != @state_animation_id @state_animation_id = @battler.state_animation_id loop_animation($data_animations[@state_animation_id]) end if @battler.is_a?(Game_Actor) and @battler_visible if $game_temp.battle_main_phase self.opacity += 3 if self.opacity < 255 else self.opacity -= 3 if self.opacity > 207 end end # Blink if @battler.blink blink_on else blink_off end # If invisible unless @battler_visible # Appear if not @battler.hidden and not @battler.dead? and (@battler.damage == nil or @battler.damage_pop) appear @battler_visible = true end end # If visible if @battler_visible # Escape if @battler.hidden $game_system.se_play($data_system.escape_se) escape @battler_visible = false end # White flash if @battler.white_flash whiten @battler.white_flash = false end # Animation if @battler.animation_id != 0 animation = $data_animations[@battler.animation_id] animation(animation, @battler.animation_hit) @battler.animation_id = 0 end # Damage if @battler.damage_pop damage(@battler.damage, @battler.critical) @battler.damage = nil @battler.critical = false @battler.damage_pop = false end # Collapse if @battler.damage == nil and @battler.dead? if @battler.is_a?(Game_Enemy) $game_system.se_play($data_system.enemy_collapse_se) else $game_system.se_play($data_system.actor_collapse_se) end collapse @battler_visible = false end end end end
Demo Link:
http://www.mediafire...6eetf884a2c76ca
Istruzioni per l'uso
Trovate tutto all'interno dello script, se lo usate creditatemi
Bugs e Conflitti Noti
N/A