Connexion
Meilleurs posteurs
Yosura (252) | ||||
L'homme sans visage (225) | ||||
The Best of Maker (196) | ||||
okaya (103) | ||||
kilari (26) | ||||
apocalypse (8) | ||||
Shaymin (6) | ||||
EM!R'Ald (4) | ||||
yojoqc (3) | ||||
fandbz13 (3) |
Horloge Socratienne
Nombre de Visiteurs
Derniers sujets
[Partenaire] Super RPG
Sam 24 Jan 2009 - 0:38 par L\'homme sans visage
Voici le site de nôtre ami The Best of Maker.
Il parle de RPG maker (vous l'aurez sûrement devinez ) :
Super RPG
Il parle de RPG maker (vous l'aurez sûrement devinez ) :
Super RPG
Commentaires: 0
Double action pour les monstres
2 participants
RPG Socrate :: Général :: Scripts :: Combat
Page 1 sur 1
Double action pour les monstres
Auteur: Nikoleis
Il faut copier les variables et les accesseurs dans les classes d'origine
(sinon, il râle avec "current_action2"). Pour le reste, un nouveau script suffit.
Modifier "dual_turn?" dans "Game_Enemy" pour que cela corresponde a vos monstres ayant 2 attaques !
Il faut copier les variables et les accesseurs dans les classes d'origine
(sinon, il râle avec "current_action2"). Pour le reste, un nouveau script suffit.
Modifier "dual_turn?" dans "Game_Enemy" pour que cela corresponde a vos monstres ayant 2 attaques !
- Code:
class Game_Battler
attr_accessor :second_action
@current_action2 = Game_BattleAction.new
@second_action = true
def current_action
return @current_action
end
def current_action2
return @current_action2
end
def second_action
return @second_action
end
def make_action_speed(turn,dual)
m = agi + rand(10 + agi / 3)
n = agi + rand(10 + agi / 3)
if dual
if m > n
@current_action.speed = m
@current_action2.speed = n
else
@current_action.speed = n
@current_action2.speed = m
end
else
@current_action.speed = m
end
end
end
class Game_Actor
def dual_turn?
return false
end
def first_attack
@second_attack = false
end
def second_attack
@second_attack = true
end
end
class Game_Enemy
#-----------------------------------------------
def make_action2
self.current_action2.clear
unless self.movable?
return
end
available_actions = []
rating_max = 0
for action in self.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
if exclude_pointless_actions(action)
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
ratings_total += action.rating
end
if ratings_total > 0
choose_action = []
for action in available_actions
for j in 1..action.rating
choose_action.push(action)
end
end
enemy_action = choose_action[rand(choose_action.size - 1)]
self.current_action2.kind = enemy_action.kind
self.current_action2.basic = enemy_action.basic
self.current_action2.skill_id = enemy_action.skill_id
self.current_action2.decide_random_target_for_enemy
end
end
def dual_turn?
case self.id
when 1
return(true)
end
return(false)
end
end
class Scene_Battle
def start_phase4
@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
for enemy in $game_troop.enemies
enemy.make_action
if enemy.dual_turn?
enemy.second_action = true
enemy.make_action2
end
end
make_action_orders
@phase4_step = 1
end
def make_action_orders
@action_battlers
@action_battlers = []
@action_battlers
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
@action_battlers
for actor in $game_party.actors
@action_battlers.push(actor)
end
for battler in @action_battlers
battler.make_action_speed($game_temp.battle_turn,battler.dual_turn?)
end
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
def update_phase4_step2
unless @active_battler.current_action.forcing
if @active_battler.restriction == 2 or @active_battler.restriction == 3
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
if @active_battler.restriction == 4
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@target_battlers = []
case @active_battler.current_action.kind
when 0
make_basic_action_result
when 1
make_skill_action_result
when 2
make_item_action_result
end
if(@active_battler.is_a?(Game_Enemy) and @active_battler.dual_turn? and @active_battler.second_action == true)
@active_battler.current_action.speed = @active_battler.current_action2.speed
@active_battler.current_action.kind = @active_battler.current_action2.kind
@active_battler.current_action.basic = @active_battler.current_action2.basic
@active_battler.current_action.skill_id = @active_battler.current_action2.skill_id
@active_battler.current_action.item_id = @active_battler.current_action2.item_id
@active_battler.current_action.target_index = @active_battler.current_action2.target_index
@active_battler.current_action.forcing = @active_battler.current_action2.forcing
@active_battler.second_action = false
@action_battlers.push(@active_battler)
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
if @phase4_step == 2
@phase4_step = 3
Yosura- Ambassadeur
-
Nombre de messages : 252
Age : 27
Localisation : dans le chateaux des tenebre de mon cousin Soron
Avertissement :
Points : 12770
Date d'inscription : 19/12/2008
Re: Double action pour les monstres
pratique comme scripts pour faire des monstres très rapide ou bien des boss
Yosura- Ambassadeur
-
Nombre de messages : 252
Age : 27
Localisation : dans le chateaux des tenebre de mon cousin Soron
Avertissement :
Points : 12770
Date d'inscription : 19/12/2008
Sujets similaires
» Double action pour les monstres
» double creux
» Script pour faire suivre vos héros a la FF VIII
» Niveau requis pour port arme/armure et port arme à 1/2 mains
» double creux
» Script pour faire suivre vos héros a la FF VIII
» Niveau requis pour port arme/armure et port arme à 1/2 mains
RPG Socrate :: Général :: Scripts :: Combat
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|
Mar 19 Juin 2012 - 19:07 par apocalypse
» parodie des jeux pokemon
Ven 8 Juin 2012 - 18:56 par apocalypse
» Rpg maker xp
Jeu 14 Juil 2011 - 4:56 par kaplio0777
» Présentation de kaplio0777
Jeu 14 Juil 2011 - 4:43 par kaplio0777
» me presenté
Ven 17 Juin 2011 - 17:12 par apocalypse
» créer un jeu de rôle
Ven 17 Juin 2011 - 17:09 par apocalypse
» se presenter
Mer 19 Jan 2011 - 21:54 par apocalypse
» Serment du Juge actuel
Dim 26 Déc 2010 - 15:52 par Yosura
» Le Réseau Social - Parodie de la BA de The Social Network
Dim 26 Déc 2010 - 15:42 par Yosura