RPG-Forum: Script s'équiper de deux armes et/ou d'une arme à deux main - RPG-Forum

Aller au contenu

Page 1 sur 1

Script s'équiper de deux armes et/ou d'une arme à deux main

#1 L'utilisateur est hors-ligne   Saga_fire Icône

  • Villageois
  • PipPip
  • Groupe : Membres +
  • Messages : 69
  • Inscrit(e) : 28-janvier 07
  • Gender:Male
  • Location:Rouen

Posté 20 mai 2007 - 17:40

Salut
Comme tout est dit dans le titre je rajouterais juste qu'il faut mettre ce script au dessus de main et de lire les commentaires car tout y est expliqué.
#==============================================================================
# ** Deux armes
#------------------------------------------------------------------------------
#  Pour s'équiper d'une deuxième arme
# Auteur : Makeamidget
# Modifié et édité par Saga_fire
=begin
Utilisation :
Si vous voulez vous équiper de deux armes allez a la l.1071 et mettez le nom de votre
personnage entre les guillemets.Si vous voulez plusieurs personnages avec deux armes,
rajouter sur cette ligne : and @actor.name != "nomdupersonnage"

L'arme 1 est l'arme de la main droite, le bouclier 1 est le bouclier de la main droite,
l'arme 2 est l'arme de la main gauche, le bouclier 2 est le bouclier de la main gauche.
Si vous voulez lors d'un nouveau jeu changer l'accessibilitée des armes et boucliers,
changer les valeurs avec "true" pour non équipable et false pour "équipable"
aux lignes 62 a 65.
ATTENTION : lorsque qu'un personnage entre en cours de jeu, l'accessibilitée des
armes et boucliers sera comme si c'est un nouveau jeu (pour lui).
=end
#==============================================================================
# ** Arme a deux mains
#------------------------------------------------------------------------------
#  Pour s'équiper d'une arme à deux mains
# Auteur : Saga_fire
=begin
Utilisation :
Si vous voulez équiper une arme a deux mains, allez dans base de donnée,
arme, description et mettez "deux main" ou vous voulez (les guillemets ne sont pas
obligatoire et vous pouvez écrire par exemple dans description : une épée a deux mains.
=end
#==============================================================================

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :weapon_type
  attr_accessor :armor_type
  attr_accessor :sec_attack
  attr_accessor :arme1
  attr_accessor :bouclier1
  attr_accessor :arme2
  attr_accessor :bouclier2
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 actor_id : actor ID
  #--------------------------------------------------------------------------
  alias double_weapons_initialize initialize
  def initialize(actor_id)
	double_weapons_initialize(actor_id)
	@weapon_type = $data_weapons[@weapon_id]
	@armor_type = $data_armors[@armor1_id]
	@sec_attack = nil
	@arme1 = false # L'arme 1 est équipable
	@bouclier1 = true # Le bouclier 1 n'est pas équipable
	@arme2 = true # L'arme 2 n'est pas équipable
	@bouclier2 = false # Le bouclier 2 est équipable
  end
  #--------------------------------------------------------------------------
  # * Get Element Revision Value
  #	 element_id : element ID
  #--------------------------------------------------------------------------
  def element_rate(element_id)
	# Get values corresponding to element effectiveness
	table = [0,200,150,100,50,0,-100]
	result = table[$data_classes[@class_id].element_ranks[element_id]]
	if self.armor_type.is_a?(RPG::Weapon)
	  # If this element is protected by armor, then it's reduced by half
	  for i in [@armor2_id, @armor3_id, @armor4_id]
		armor = $data_armors[i]
		if armor != nil and armor.guard_element_set.include?(element_id)
		  result /= 2
		end
	  end
	else
	  for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
		armor = $data_armors[i]
		if armor != nil and armor.guard_element_set.include?(element_id)
		  result /= 2
		end
	  end
	end
	# If this element is protected by states, then it's reduced by half
	for i in @states
	  if $data_states[i].guard_element_set.include?(element_id)
		result /= 2
	  end
	end
	# End Method
	return result
  end
  #--------------------------------------------------------------------------
  # * Determine State Guard
  #	 state_id : state ID
  #--------------------------------------------------------------------------
  def state_guard?(state_id)
	if self.armor_type.is_a?(RPG::Weapon)
	  for i in [@armor2_id, @armor3_id, @armor4_id]
		armor = $data_armors[i]
		if armor != nil
		  if armor.guard_state_set.include?(state_id)
			return true
		  end
		end
	  end
	else  
	  return false
	  for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
		armor = $data_armors[i]
		if armor != nil
		  if armor.guard_state_set.include?(state_id)
			return true
		  end
		end
	  end
	  return false
	end
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack Element
  #--------------------------------------------------------------------------
  def element_set
	n = []
	unless self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_weapons[@weapon_id]
	  n += weapon != nil ? weapon.element_set : []
	end
	unless self.armor_type.is_a?(RPG::Armor)
	  weapon2 = $data_weapons[@armor1_id]
	  n += weapon2 != nil ? weapon2.element_set : []
	end
	n.flatten!
	n.uniq!
	return n
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack State Change (+)
  #--------------------------------------------------------------------------
  def plus_state_set
	n = []
	unless self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_weapons[@weapon_id]
	  n += weapon != nil ? weapon.plus_state_set : []
	end
	unless self.armor_type.is_a?(RPG::Armor)
	  weapon2 = $data_weapons[@armor1_id]
	  n += weapon2 != nil ? weapon2.plus_state_set : []
	end
	n.flatten!
	n.uniq!
	return n
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack State Change (-)
  #--------------------------------------------------------------------------
  def minus_state_set
	n = []
	unless self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_weapons[@weapon_id]
	  n += weapon != nil ? weapon.minus_state_set : []
	end
	unless self.armor_type.is_a?(RPG::Armor)
	  weapon2 = $data_weapons[@armor1_id]
	  n += weapon2 != nil ? weapon2.minus_state_set : []
	end
	n.flatten!
	n.uniq!
	return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Strength
  #--------------------------------------------------------------------------
  def base_str
	#took out the armor1 addition to the base_str
	n = $data_actors[@actor_id].parameters[2, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.str_plus : 0
	n += armor1 != nil ? armor1.str_plus : 0
	n += armor2 != nil ? armor2.str_plus : 0
	n += armor3 != nil ? armor3.str_plus : 0
	n += armor4 != nil ? armor4.str_plus : 0
	return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Dexterity
  #--------------------------------------------------------------------------
  def base_dex
	n = $data_actors[@actor_id].parameters[3, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.dex_plus : 0
	n += armor1 != nil ? armor1.dex_plus : 0
	n += armor2 != nil ? armor2.dex_plus : 0
	n += armor3 != nil ? armor3.dex_plus : 0
	n += armor4 != nil ? armor4.dex_plus : 0
	return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
	n = $data_actors[@actor_id].parameters[4, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.agi_plus : 0
	n += armor1 != nil ? armor1.agi_plus : 0
	n += armor2 != nil ? armor2.agi_plus : 0
	n += armor3 != nil ? armor3.agi_plus : 0
	n += armor4 != nil ? armor4.agi_plus : 0
	return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Intelligence
  #--------------------------------------------------------------------------
  def base_int
	n = $data_actors[@actor_id].parameters[5, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.int_plus : 0
	n += armor1 != nil ? armor1.int_plus : 0
	n += armor2 != nil ? armor2.int_plus : 0
	n += armor3 != nil ? armor3.int_plus : 0
	n += armor4 != nil ? armor4.int_plus : 0
	return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def base_atk
	n = 0
	unless self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_weapons[@weapon_id]
	  n += weapon != nil ? weapon.atk : 0
	end
	unless self.armor_type.is_a?(RPG::Armor)
	  weapon2 = $data_weapons[@armor1_id]
	  n += weapon2 != nil ? weapon2.atk : 0
	end
	return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Physical Defense
  #--------------------------------------------------------------------------
  def base_pdef
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	pdef1 = weapon != nil ? weapon.pdef : 0
	pdef2 = armor1 != nil ? armor1.pdef : 0
	pdef3 = armor2 != nil ? armor2.pdef : 0
	pdef4 = armor3 != nil ? armor3.pdef : 0
	pdef5 = armor4 != nil ? armor4.pdef : 0
	return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  end
  #--------------------------------------------------------------------------
  # * Get Basic Magic Defense
  #--------------------------------------------------------------------------
  def base_mdef
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	mdef1 = weapon != nil ? weapon.mdef : 0
	mdef2 = armor1 != nil ? armor1.mdef : 0
	mdef3 = armor2 != nil ? armor2.mdef : 0
	mdef4 = armor3 != nil ? armor3.mdef : 0
	mdef5 = armor4 != nil ? armor4.mdef : 0
	return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  end
  #--------------------------------------------------------------------------
  # * Get Offensive Animation ID for Normal Defense
  #--------------------------------------------------------------------------
  def animation3_id
	weapon = $data_weapons[@armor1_id]
	return (weapon != nil ? weapon.animation1_id : 0)
  end
  #--------------------------------------------------------------------------
  # * Get Target Animation ID for Normal defense
  #--------------------------------------------------------------------------
	def animation4_id
	weapon = $data_weapons[@armor1_id]
	return (weapon != nil ? weapon.animation2_id : 0)
  end
  def two_shields
	if (self.weapon_type.is_a?(RPG::Armor) and self.armor_type.is_a?(RPG::Armor)) and
	(self.weapon_id != 0 and self.armor1_id != 0)
	  return true
	else
	  return false
	end
  end
  def two_weapons
	if (self.weapon_type.is_a?(RPG::Weapon) and self.armor_type.is_a?(RPG::Weapon)) and
	(self.weapon_id != 0 and self.armor1_id != 0)
	  return true
	else
	  return false
	end
  end
  #--------------------------------------------------------------------------
  # * Change Equipment
  #	 equip_type : type of equipment
  #	 id	: weapon or armor ID (If 0, remove equipment)
  #--------------------------------------------------------------------------
  def equip(equip_type, id, item = RPG::Armor)
	case equip_type
	when 0  # Arme ou bouclier
	  # Si rien n'est équipé
	  if @weapon_id == 0
		# Si on équipe une arme
		if item.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			self.weapon_type = $data_weapons[id]
			@weapon_id = id
			$game_party.lose_weapon(id, 1)
		  end
		# Si on équipe un bouclier
		elsif item.is_a?(RPG::Armor)
		  if id == 0 or $game_party.weapon_number(id) > 0
			self.weapon_type = $data_armors[id]
			@weapon_id = id
			$game_party.lose_armor(id, 1)
		  end
		end
	  end
	  # Si on déséquipe l'arme ou l'armure
	  if item == nil
		# Si une arme est équipée
		if self.weapon_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_weapon(@weapon_id, 1)
			@weapon_id = id
		  end
		# Sinon si un bouclier est équipé
		elsif self.weapon_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_armor(@weapon_id, 1)
			@weapon_id = id
		  end
		end
	  #Sinon si on équipe une arme
	  elsif item.is_a?(RPG::Weapon)
		# Si une arme est équipée
		if self.weapon_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_weapon(@weapon_id, 1)
			self.weapon_type = $data_weapons[id]
			@weapon_id = id
			$game_party.lose_weapon(id, 1)
		  end
		# Sinon si un bouclier est équipé
		elsif self.weapon_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_armor(@weapon_id, 1)
			self.weapon_type = $data_weapons[id]
			@weapon_id = id
			$game_party.lose_weapon(id, 1)
		  end
		end
	  # Sinon si on équipe un bouclier
	  elsif item.is_a?(RPG::Armor)
		# Si un bouclier est équipé
		if self.weapon_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_armor(@weapon_id, 1)
			self.weapon_type = $data_armors[id]
			@weapon_id = id
			$game_party.lose_armor(id, 1)
		  end
		# Sinon si une arme est équipée
		elsif self.weapon_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_weapon(@weapon_id, 1)
			self.weapon_type = $data_armors[id]
			@weapon_id = id
			$game_party.lose_armor(id, 1)
		  end
		end
	  end
	when 1  # Bouclier et arme
	  # Si rien n'est équipé
	  if @armor1_id == 0
		# Si on équipe une arme
		if item.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			self.armor_type = $data_weapons[id]
			@armor1_id = id
			$game_party.lose_weapon(id, 1)
		  end
		# Sinon si on équipe un bouclier
		elsif item.is_a?(RPG::Armor)
		  if id == 0 or $game_party.armor_number(id) > 0
			self.armor_type = $data_armors[id]
			@armor1_id = id
			$game_party.lose_armor(id, 1)
		  end
		end
	  end
	  # Si on déséquipe
	  if item == nil
		# Si une arme est équipée
		if self.armor_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_weapon(@armor1_id, 1)
			@armor1_id = id
		  end
		# Sinon si un bouclier est équipé
		elsif self.armor_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_armor(@armor1_id, 1)
			@armor1_id = id
		  end
		end
	  # Sinon si on équipe une arme
	  elsif item.is_a?(RPG::Weapon)
		# Si une arme est équipée
		if self.armor_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_weapon(@armor1_id, 1)
			self.armor_type = $data_weapons[id]
			@armor1_id = id
			$game_party.lose_weapon(id, 1)
		  end
		# Sinon si un bouclier est équipé
		elsif self.armor_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.weapon_number(id) > 0
			$game_party.gain_armor(@armor1_id, 1)
			self.armor_type = $data_weapons[id]
			@armor1_id = id
			$game_party.lose_weapon(id, 1)
		  end
		end
	  # Sinon si on équipe un bouclier
	  elsif item.is_a?(RPG::Armor)
		# Si un bouclier est équipé
		if self.armor_type.is_a?(RPG::Armor)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_armor(@armor1_id, 1)
			self.armor_type = $data_armors[id]
			@armor1_id = id
			$game_party.lose_armor(id, 1)
		  end
		# Sinon si une arme est équipée
		elsif self.armor_type.is_a?(RPG::Weapon)
		  if id == 0 or $game_party.armor_number(id) > 0
			$game_party.gain_weapon(@armor1_id, 1)
			self.armor_type = $data_armors[id]
			@armor1_id = id
			$game_party.lose_armor(id, 1)
		  end
		end
	  end
	when 2  # Head
	  if id == 0 or $game_party.armor_number(id) > 0
		update_auto_state($data_armors[@armor2_id], $data_armors[id])
		$game_party.gain_armor(@armor2_id, 1)
		@armor2_id = id
		$game_party.lose_armor(id, 1)
	  end
	when 3  # Body
	  if id == 0 or $game_party.armor_number(id) > 0
		update_auto_state($data_armors[@armor3_id], $data_armors[id])
		$game_party.gain_armor(@armor3_id, 1)
		@armor3_id = id
		$game_party.lose_armor(id, 1)
	  end
	when 4  # Accessory
	  if id == 0 or $game_party.armor_number(id) > 0
		update_auto_state($data_armors[@armor4_id], $data_armors[id])
		$game_party.gain_armor(@armor4_id, 1)
		@armor4_id = id
		$game_party.lose_armor(id, 1)
	  end
	end
  end
  # -------------------------------------
  def base_str
	if $game_temp.god_mode
	  return 999
	end
	#took out the armor1 addition to the base_str
	n = $data_actors[@actor_id].parameters[2, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.str_plus : 0
	n += armor1 != nil ? armor1.str_plus : 0
	n += armor2 != nil ? armor2.str_plus : 0
	n += armor3 != nil ? armor3.str_plus : 0
	n += armor4 != nil ? armor4.str_plus : 0
	return [[n, 1].max, 999].min
  end
  # -------------------------------------
  def base_dex
	if $game_temp.god_mode
	  return 999
	end
	n = $data_actors[@actor_id].parameters[3, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.dex_plus : 0
	n += armor1 != nil ? armor1.dex_plus : 0
	n += armor2 != nil ? armor2.dex_plus : 0
	n += armor3 != nil ? armor3.dex_plus : 0
	n += armor4 != nil ? armor4.dex_plus : 0
	return [[n, 1].max, 999].min
  end
  # -------------------------------------
  def base_agi
	if $game_temp.god_mode
	  return 999
	end
	n = $data_actors[@actor_id].parameters[4, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.agi_plus : 0
	n += armor1 != nil ? armor1.agi_plus : 0
	n += armor2 != nil ? armor2.agi_plus : 0
	n += armor3 != nil ? armor3.agi_plus : 0
	n += armor4 != nil ? armor4.agi_plus : 0
	return [[n, 1].max, 999].min
  end
  # -------------------------------------
  def base_int
	if $game_temp.god_mode
	  return 999
	end
	n = $data_actors[@actor_id].parameters[5, @level]
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	n += weapon != nil ? weapon.int_plus : 0
	n += armor1 != nil ? armor1.int_plus : 0
	n += armor2 != nil ? armor2.int_plus : 0
	n += armor3 != nil ? armor3.int_plus : 0
	n += armor4 != nil ? armor4.int_plus : 0
	return [[n, 1].max, 999].min
  end
  # -------------------------------------
  def base_atk
	if $game_temp.god_mode
	  return 9999999
	end
	n = 0
	unless self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_weapons[@weapon_id]
	  n += weapon != nil ? weapon.atk : 0
	end
	unless self.armor_type.is_a?(RPG::Armor)
	  weapon2 = $data_weapons[@armor1_id]
	  n += weapon2 != nil ? weapon2.atk : 0
	end
	return n
  end
  # -------------------------------------
  def base_pdef
	if $game_temp.god_mode
	  return 999999
	end
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	pdef1 = weapon != nil ? weapon.pdef : 0
	pdef2 = armor1 != nil ? armor1.pdef : 0
	pdef3 = armor2 != nil ? armor2.pdef : 0
	pdef4 = armor3 != nil ? armor3.pdef : 0
	pdef5 = armor4 != nil ? armor4.pdef : 0
	return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  end
  # -------------------------------------
  def base_mdef
	if $game_temp.god_mode
	  return 999999
	end
	if self.weapon_type.is_a?(RPG::Weapon)
	  weapon = $data_weapons[@weapon_id]
	elsif self.weapon_type.is_a?(RPG::Armor)
	  weapon = $data_armors[@weapon_id]
	end
	if self.armor_type.is_a?(RPG::Armor)
	  armor1 = $data_armors[@armor1_id]
	elsif self.armor_type.is_a?(RPG::Weapon)
	  armor1 = $data_weapons[@armor1_id]
	end
	armor2 = $data_armors[@armor2_id]
	armor3 = $data_armors[@armor3_id]
	armor4 = $data_armors[@armor4_id]
	mdef1 = weapon != nil ? weapon.mdef : 0
	mdef2 = armor1 != nil ? armor1.mdef : 0
	mdef3 = armor2 != nil ? armor2.mdef : 0
	mdef4 = armor3 != nil ? armor3.mdef : 0
	mdef5 = armor4 != nil ? armor4.mdef : 0
	return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  end
end


#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command
  #--------------------------------------------------------------------------
  # * Enable Item
  #	 index : item number
  #--------------------------------------------------------------------------
  def enable_item(index)
	draw_item(index, normal_color)
  end
end


#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
#  This window displays items the actor is currently equipped with on the
#  equipment screen.
#==============================================================================

class Window_EquipRight < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	@data = []
	@data.push($data_weapons[@actor.weapon_id])
	@data.push($data_armors[@actor.armor1_id])
	if @actor.weapon_type.is_a?(RPG::Weapon)
	  @data[0] = $data_weapons[@actor.weapon_id]
	elsif @actor.weapon_type.is_a?(RPG::Armor)
	  @data[0] = $data_armors[@actor.weapon_id]
	end
	if @actor.armor_type.is_a?(RPG::Weapon)
	  @data[1] = $data_weapons[@actor.armor1_id]
	elsif @actor.armor_type.is_a?(RPG::Armor)
	  @data[1] = $data_armors[@actor.armor1_id]
	end
	@data.push($data_armors[@actor.armor2_id])
	@data.push($data_armors[@actor.armor3_id])
	@data.push($data_armors[@actor.armor4_id])
	@item_max = @data.size
	self.contents.font.color = system_color
	self.contents.draw_text(4, 32 * 0, 92, 32, "Main droite")
	self.contents.draw_text(4, 32 * 1, 92, 32, "Main gauche")
	self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
	self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
	self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
	draw_item_name(@data[0], 92, 32 * 0)
	draw_item_name(@data[1], 92, 32 * 1)
	draw_item_name(@data[2], 92, 32 * 2)
	draw_item_name(@data[3], 92, 32 * 3)
	draw_item_name(@data[4], 92, 32 * 4)
  end
end


#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_EquipItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	if self.contents != nil
	  self.contents.dispose
	  self.contents = nil
	end
	@data = []
	# Add equippable weapons
	if @equip_type == 0
	  weapon_set = $data_classes[@actor.class_id].weapon_set
	  for i in 1...$data_weapons.size
		if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
		  @data.push($data_weapons[i])
		end
	  end
	  armor_set = $data_classes[@actor.class_id].armor_set
	  for i in 1...$data_armors.size
		if $game_party.armor_number(i) > 0 and armor_set.include?(i)
		  if $data_armors[i].kind == 0
			@data.push($data_armors[i])
		  end
		end
	  end
	end
	if @equip_type != 0
	  if @equip_type == 1
		weapon_set = $data_classes[@actor.class_id].weapon_set
		for i in 1...$data_weapons.size
		  if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
			@data.push($data_weapons[i])
		  end
		end
	  end
	  armor_set = $data_classes[@actor.class_id].armor_set
	  for i in 1...$data_armors.size
		if $game_party.armor_number(i) > 0 and armor_set.include?(i)
		  if $data_armors[i].kind == @equip_type-1
			@data.push($data_armors[i])
		  end
		end
	  end
	end
	# Add blank page
	@data.push(nil)
	# Make a bit map and draw all items
	@item_max = @data.size
	self.contents = Bitmap.new(width - 32, row_max * 32)
	self.contents.font.name = $fontface
	self.contents.font.size = $fontsize
	for i in 0...@item_max-1
	  draw_item(i)
	end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #	 index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
	item = @data[index]
	x = 4 + index % 2 * (288 + 32)
	y = index / 2 * 32
	case item
	when RPG::Weapon
	  number = $game_party.weapon_number(item.id)
	when RPG::Armor
	  number = $game_party.armor_number(item.id)
	end
	bitmap = RPG::Cache.icon(item.icon_name)
	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
	if @equip_type == 0
	  if item.is_a?(RPG::Weapon)
		if @actor.arme1 == false
		  self.contents.font.color = normal_color
		elsif @actor.arme1 == true
		  self.contents.font.color = disabled_color
		end
	  end
	  if item.is_a?(RPG::Armor)
		if @actor.bouclier1 == false
		  self.contents.font.color = normal_color
		elsif @actor.bouclier1 == true
		  self.contents.font.color = disabled_color
		end
	  end
	elsif @equip_type == 1
	  if item.is_a?(RPG::Weapon)
		if @actor.arme2 == false
		  self.contents.font.color = normal_color
		elsif @actor.arme2 == true
		  self.contents.font.color = disabled_color
		end
	  end
	  if item.is_a?(RPG::Armor)
		if @actor.bouclier2 == false
		  self.contents.font.color = normal_color
		elsif @actor.bouclier2 == true
		  self.contents.font.color = disabled_color
		end
	  end
	else
	  self.contents.font.color = normal_color
	end
	self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
	self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
	self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
end


#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	# Set item window to visible
	@item_window1.visible = (@right_window.index == 0)
	@item_window2.visible = (@right_window.index == 1)
	@item_window3.visible = (@right_window.index == 2)
	@item_window4.visible = (@right_window.index == 3)
	@item_window5.visible = (@right_window.index == 4)
	# Get currently equipped item
	item1 = @right_window.item
	# Set current item window to @item_window
	case @right_window.index
	when 0
	  @item_window = @item_window1
	when 1
	  @item_window = @item_window2
	when 2
	  @item_window = @item_window3
	when 3
	  @item_window = @item_window4
	when 4
	  @item_window = @item_window5
	end
	# If right window is active
	if @right_window.active
	  # Erase parameters for after equipment change
	  @left_window.set_new_parameters(nil, nil, nil)
	end
	# If item window is active
	if @item_window.active
	  # Get currently selected item
	  item2 = @item_window.item
	  # Change equipment
	  last_hp = @actor.hp
	  last_sp = @actor.sp
	  @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id, item2)
	  # Get parameters for after equipment change
	  new_atk = @actor.atk
	  new_pdef = @actor.pdef
	  new_mdef = @actor.mdef
	  # Return equipment
	  @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id, item1)
	  @actor.hp = last_hp
	  @actor.sp = last_sp
	  # Draw in left window
	  @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	# Update windows
	@left_window.update
	@right_window.update
	@item_window.update
	# Remake item window1 and item window2 contents
	@item_window1.refresh
	@item_window2.refresh
	refresh
	# If right window is active: call update_right
	if @right_window.active
	  update_right
	  return
	end
	# If item window is active: call update_item
	if @item_window.active
	  update_item
	  return
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
	# If B button was pressed
	if Input.trigger?(Input::B)
	  # Play cancel SE
	  $game_system.se_play($data_system.cancel_se)
	  # Switch to menu screen
	  $scene = Scene_Menu.new(2)
	  return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
	  # If equipment is fixed
	  if @actor.equip_fix?(@right_window.index)
		# Play buzzer SE
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  #----------Edition arme a deux mains----------
	  # Si on est dans la main droite et...
	  if @item_window == @item_window1 and
		# ...que l'arme 1 et le bouclier 1 ne sont pas équipable
		@actor.arme1 == true and @actor.bouclier1 == true
		# Play buzzer SE
		$game_system.se_play($data_system.buzzer_se)
		return
	  # Sinon si on est dans la main gauche et...
	  elsif @item_window == @item_window2 and
		# ...que l'arme 2 et le bouclier 2 ne sont pas équipables
		@actor.arme2 == true and @actor.bouclier2 == true
		# Play buzzer SE
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  #----------FIN---------
	  # Play decision SE
	  $game_system.se_play($data_system.decision_se)
	  # Activate item window
	  @right_window.active = false
	  @item_window.active = true
	  @item_window.index = 0
	  return
	end
	# If R button was pressed
	if Input.trigger?(Input::R)
	  # Play cursor SE
	  $game_system.se_play($data_system.cursor_se)
	  # To next actor
	  @actor_index += 1
	  @actor_index %= $game_party.actors.size
	  # Switch to different equipment screen
	  $scene = Scene_Equip.new(@actor_index, @right_window.index)
	  return
	end
	# If L button was pressed
	if Input.trigger?(Input::L)
	  # Play cursor SE
	  $game_system.se_play($data_system.cursor_se)
	  # To previous actor
	  @actor_index += $game_party.actors.size - 1
	  @actor_index %= $game_party.actors.size
	  # Switch to different equipment screen
	  $scene = Scene_Equip.new(@actor_index, @right_window.index)
	  return
	end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
	# If B button was pressed
	if Input.trigger?(Input::B)
	  # Play cancel SE
	  $game_system.se_play($data_system.cancel_se)
	  # Activate right window
	  @right_window.active = true
	  @item_window.active = false
	  @item_window.index = 0
	  @item_window.index = -1
	  return
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
	  # Get currently selected data on the item window
	  item = @item_window.item
	  #----------Edition deux armes----------
	  if @actor.name != "Arshes"
		# Si on est dans la main droite
		if @item_window == @item_window1
		  #----------Edition arme a deux mains----------
		  #Si on équipe une arme et que c'est écrit dans description deux mains
		  if item != nil and item.description.include?("deux mains")
			# Si l'arme 1 n'est pas équipable
			if @actor.arme1 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			end
			# Change equipment
			@actor.equip(1, 0, item)
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 1 est équipable
			@actor.bouclier1 = false
			# L'arme 2 n'est pas équipable
			@actor.arme2 = true
			# Le bouclier 2 n'est pas équipable
			@actor.bouclier2 = true
		  #----------FIN----------
		  #Sinon si on équipe une arme
		  elsif item.is_a?(RPG::Weapon)
			# Si l'arme 1 n'est pas équipable
			if @actor.arme1 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			# Sinon si le bouclier 1 n'est pas équipable
			elsif @actor.bouclier1 == true
			  # L'arme 1 est équipable
			  @actor.arme1 = false
			  # L'arme 2 n'est pas équipable
			  @actor.arme2 = true
			# Sinon
			else
			  # L'arme 1 est équipable
			  @actor.arme1 = false
			  # Le bouclier 1 est équipable
			  @actor.bouclier1 = false
			end
			# Si l'arme 1 est équipable
			if @actor.arme1 == false
			  # L'arme 2 n'est pas équipable
			  @actor.arme2 = true
			  # Le bouclier 2 est équipable
			  @actor.bouclier2 = false
			end
		  # Sinon si on équipe un bouclier
		  elsif item.is_a?(RPG::Armor)
			# Si le bouclier 1 n'est pas équipable
			if @actor.bouclier1 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			# Sinon si l'arme 1 n'est pas équipable
			elsif @actor.arme1 == true
			  # Le bouclier 1 est équipable
			  @actor.bouclier1 = false
			  # Le bouclier 2 n'est pas équipable
			  @actor.bouclier2 = true
			# Sinon
			else
			  # L'arme 1 est équipable
			  @actor.arme1 = false
			  # Le bouclier 1 est équipable
			  @actor.bouclier1 = false
			end
			# Si le bouclier 1 est équipable
			if @actor.bouclier1 == false
			  # L'arme 2 est équipable
			  @actor.arme2 = false
			  # Le bouclier 2 n'est pas équipable
			  @actor.bouclier2 = true
			end
		  # Sinon si on déséquipe et que l'arme 1 et le bouclier 1 sont équipables
		  elsif item == nil and @actor.arme1 == false and @actor.bouclier1 == false
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
		  # Sinon si on déséquipe et que l'arme 2 est équipable
		  elsif item == nil and @actor.arme2 == false
			# L 'arme 1 n'est  pas équipable
			@actor.arme1 = true
			# Le bouclier est équipable
			@actor.bouclier1 = false
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
		  # Sinon si on déséquipe et que le bouclier 2 est équipable
		  elsif item == nil and @actor.bouclier2 == false
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 1 n'est pas équipable
			@actor.bouclier1 = true
			# L'arme 2 est équipable
			@actor.arme2 = false
		  end
		# Sinon si on est dans la mains gauche
		elsif @item_window == @item_window2
		  #----------Edition arme a deux mains----------
		  #Si on équipe une arme et que c'est écrit dans description deux mains
		  if item != nil and item.description.include?("deux mains")
			# Si l'arme 2 n'est  pas équipable
			if @actor.arme2 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			end
			# Change equipment
			@actor.equip(0, 0, item)
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
			# L'arme 1 n'est pas équipable
			@actor.arme1 = true
			# Le bouclier 1 n'est pas équipable
			@actor.bouclier1 = true
		  #----------FIN----------
		  #Sinon si on équipe une arme
		  elsif item.is_a?(RPG::Weapon)
			# Si l'arme 2 n'est  pas équipable
			if @actor.arme2 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			# Sinon si le bouclier 2 n'est pas équipable
			elsif @actor.bouclier2 == true
			  # L'arme 2 est équipable
			  @actor.arme2 = false
			  # L'arme 1 n'est pas équipable
			  @actor.arme1 = true
			# Sinon
			else
			  # L'arme 2 est équipable
			  @actor.arme2 = false
			  # Le bouclier 2 est équipable
			  @actor.bouclier2 = false
			end
			# Si l'arme 2 est équipable
			if @actor.arme2 == false
			  # L'arme 1 n'est pas équipable
			  @actor.arme1 = true
			  # Le bouclier 1 est équipable
			  @actor.bouclier1 = false
			end
		  # Sinon si on équipe un bouclier
		  elsif item.is_a?(RPG::Armor)
			# Si le bouclier 2 n'est pas équipable
			if @actor.bouclier2 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			# Sinon si l'arme 2 n'est pas équipable
			elsif @actor.arme2 == true
			  # Le bouclier 2 est équipable
			  @actor.bouclier2 = false
			  # Le bouclier 1 n'est pas équipable
			  @actor.bouclier1 = true
			# Sinon
			else
			  # L'arme 2 est équipable
			  @actor.arme2 = false
			  # Le bouclier 2 est équipable
			  @actor.bouclier2 = false
			end
			# Si le bouclier 2 est équipable
			if @actor.bouclier2 == false
			  # L'arme 1 est équipable
			  @actor.arme1 = false
			  # Le bouclier 1 n'est pas équipable
			  @actor.bouclier1 = true
			end
		  # Sinon si on déséquipe et que l'arme 2 et le bouclier 2 sont équipables
		  elsif item == nil and @actor.arme2 == false and @actor.bouclier2 == false
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 1 est équipable
			@actor.bouclier1 = false
		  # Sinon si on déséquipe et que l'arme 1 est équipable
		  elsif item == nil and @actor.arme1 == false
			# L 'arme 2 n'est  pas équipable
			@actor.arme2 = true
			# Le bouclier est équipable
			@actor.bouclier2 = false
			# Le bouclier 1 est équipable
			@actor.bouclier1 = false
		  # Sinon si on déséquipe et que le bouclier 1 est équipable
		  elsif item == nil and @actor.bouclier1 == false
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 n'est pas équipable
			@actor.bouclier2 = true
			# L'arme 1 est équipable
			@actor.arme1 = false
		  end
		end
	  # Sinon
	  else
		# Si on est dans la main droite
		if @item_window == @item_window1
		  #----------Edition arme a deux mains----------
		  #Si on équipe une arme et que c'est écrit dans description deux mains
		  if item != nil and item.description.include?("deux mains")
			# Change equipment
			@actor.equip(1, 0, item)
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 2 est équipable
			@actor.bouclier1 = false
			# L'arme 2 n'est pas équipable
			@actor.arme2 = true
			# Le bouclier 2 n'est pas équipable
			@actor.bouclier2 = true
		  #----------FIN----------
		  # Sinon si on équipe une arme
		  elsif item.is_a?(RPG::Weapon)
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
		  # Sinon si on équipe un bouclier
		  elsif item.is_a?(RPG::Armor)
			# Si le bouclier 1 n'est pas équipable
			if @actor.bouclier1 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			end
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 n'est pas équipable
			@actor.bouclier2 = true
		  # Sinon si on déséquipe et que le bouclier 2 n'est pas équipable
		  elsif item == nil and @actor.bouclier2 == true
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
		  end
		# Sinon si on est dans la main gauche
		elsif @item_window == @item_window2
		  #----------Edition arme a deux mains----------
		  #Si on équipe une arme et que c'est écrit dans description deux mains
		  if item != nil and item.description.include?("deux mains")
			# Change equipment
			@actor.equip(0, 0, item)
			# L'arme 2 est équipable
			@actor.arme2 = false
			# Le bouclier 2 est équipable
			@actor.bouclier2 = false
			# L'arme 1 n'est pas équipable
			@actor.arme1 = true
			# Le bouclier 1 n'est pas équipable
			@actor.bouclier1 = true
		  #----------FIN----------
		  # Sinon si on équipe une arme
		  elsif item.is_a?(RPG::Weapon)
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 1 est équipable
			@actor.bouclier1 = false
		  # Sinon si on équipe un bouclier
		  elsif item.is_a?(RPG::Armor)
			# Si le bouclier 2 n'est pas équipable
			if @actor.bouclier2 == true
			  # Play buzzer SE
			  $game_system.se_play($data_system.buzzer_se)
			  return
			end
			# L'arme 1 est équipable
			@actor.arme1 = false
			# Le bouclier 1 n'est pas équipable
			@actor.bouclier1 = true
		  # Sinon si on déséquipe et que le bouclier 1 n'est pas équipable
		  elsif item == nil and @actor.bouclier1 == true
			# Le bouclier 1 est équipable
			@actor.bouclier1 = false
		  end
		end
	  end
	  # Change equipment
	  @actor.equip(@right_window.index, item == nil ? 0 : item.id, item)
	  #----------FIN----------
	  # Play equip SE
	  $game_system.se_play($data_system.equip_se)
	  # Activate right window
	  @right_window.active = true
	  @item_window.active = false
	  @item_window.index = 0
	  @item_window.index = -1
	  # Remake right window and item window contents
	  @right_window.refresh
	  @item_window1.refresh
	  @item_window2.refresh
	  @item_window.refresh
	  return
	end
  end
end


#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : basic command)
  #--------------------------------------------------------------------------
  def update_phase3_basic_command
	# If B button was pressed
	if Input.trigger?(Input::B)
	  # Play cancel SE
	  $game_system.se_play($data_system.cancel_se)
	  # Go to command input for previous actor
	  phase3_prior_actor
	  return
	end
	if @active_battler.two_shields 
	  @actor_command_window.disable_item(0)
	else
	  @actor_command_window.enable_item(0)
	end
	# If C button was pressed
	if Input.trigger?(Input::C)
	  # Branch by actor command window cursor position
	  case @actor_command_window.index
	  when 0  # attack
		if @active_battler.two_shields
		  # Play decision SE
		  $game_system.se_play($data_system.buzzer_se)
		  return		  
		end
		if @active_battler.two_weapons == true
		  # Set action
		  @active_battler.current_action.kind = 0
		  @active_battler.current_action.basic = 4
		else
		  # Set action
		  @active_battler.current_action.kind = 0
		  @active_battler.current_action.basic = 0
		end	  
		$game_system.se_play($data_system.decision_se)
		start_enemy_select
	  when 1  # skill
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Set action
		@active_battler.current_action.kind = 1
		# Start skill selection
		start_skill_select
	  when 2  # guard
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Set action
		@active_battler.current_action.kind = 0
		@active_battler.current_action.basic = 1
		# Go to command input for next actor
		phase3_next_actor
	  when 3  # item
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Set action
		@active_battler.current_action.kind = 2
		# Start item selection
		start_item_select
	  end
	  return
	end
  end
  #--------------------------------------------------------------------------
  # * Make Basic Action Results
  #--------------------------------------------------------------------------
  def make_basic_action_result
	# If attack
	if @active_battler.current_action.basic == 0
	  # Set anaimation ID
	  @animation1_id = @active_battler.animation1_id
	  @animation2_id = @active_battler.animation2_id
	  # If action battler is enemy
	  if @active_battler.is_a?(Game_Enemy)
		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
	  end
	  # If action battler is actor
	  if @active_battler.is_a?(Game_Actor)
		if @active_battler.armor_type.is_a?(RPG::Weapon)
		  @animation1_id = @active_battler.animation3_id
		  @animation2_id = @active_battler.animation4_id
		end
		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
	  # Set array of targeted battlers
	  @target_battlers = [target]
	  # Apply normal attack results
	  for target in @target_battlers
		target.attack_effect(@active_battler)
	  end
	  return
	end
	# If guard
	if @active_battler.current_action.basic == 1
	  # Display "Guard" in help window
	  @help_window.set_text($data_system.words.guard, 1)
	  return
	end
	# If escape
	if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.basic == 2
	  # Display "Escape" in help window
	  @help_window.set_text("Escape", 1)
	  # Escape
	  @active_battler.escape
	  return
	end
	# If doing nothing
	if @active_battler.current_action.basic == 3
	  # Clear battler being forced into action
	  $game_temp.forcing_battler = nil
	  # Shift to step 1
	  @phase4_step = 1
	  return
	end
	if @active_battler.current_action.basic == 4
	  @animation1_id = @active_battler.animation1_id
	  @animation2_id = @active_battler.animation2_id
	  @animation3_id = @active_battler.animation3_id
	  @animation4_id = @active_battler.animation4_id
	  if @active_battler.is_a?(Game_Actor)
		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
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 4 : animation for target)
  #--------------------------------------------------------------------------
  def update_phase4_step4
	if @active_battler.is_a?(Game_Actor)  
	  if @active_battler.two_weapons == true && @active_battler.sec_attack == 0
		for target in @target_battlers
		  target.animation_id = @animation4_id
		  target.animation_hit = (target.damage != "Raté")
		  @phase4_step = 5
		  return
		end
	  end
	end
	# Animation for target
	for target in @target_battlers
	  target.animation_id = @animation2_id
	  target.animation_hit = (target.damage != "Raté")
	end
	# Animation has at least 8 frames, regardless of its length
	@wait_count = 8
	# Shift to step 5
	@phase4_step = 5
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 5 : damage display)
  #--------------------------------------------------------------------------
  def update_phase4_step5
	# Hide help window
	@help_window.visible = false
	# Refresh status window
	@status_window.refresh
	if @active_battler.is_a?(Game_Actor)	
	  if @active_battler.current_action.basic == 4	 
		if @active_battler.two_weapons == true && @active_battler.sec_attack == nil
		  @active_battler.sec_attack = 0
		  @phase4_step = 3
		  return
		else
		  @active_battler.sec_attack = nil
		end
	  end
	end
	# Display damage
	for target in @target_battlers
	  if target.damage != nil
		target.damage_pop = true
	  end
	end
	# Shift to step 6
	@phase4_step = 6
  end
end

Faire une erreur et ne pas réviser son jugement, c'est ce que l'on apelle une erreur.
Image IPB
0

#2 L'utilisateur est hors-ligne   zachdu59 Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 286
  • Inscrit(e) : 25-novembre 06
  • Gender:Male
  • Location:Lille, au bdm le quartier de tout les probleme

Posté 20 mai 2007 - 20:09

EDIT : Tu as commencé le Rubis quand?
Aller sur ce forum, inscrivez-vous !
http://www.rpgmaking.free.fr/

OU ALLER SUR LE TOPIC DE MON PROJET "DARK AND LIGHT"
http://www.rpg-legen...?showtopic=9310

Vous savez ce que c'est le freestyle football, non? Alors allez voir mes vidéo :
http://komball.com/f...tyler/zachdu59/

ZaCh and zAcH
0

#3 L'utilisateur est hors-ligne   Anuvico Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 337
  • Inscrit(e) : 06-mai 07
  • Gender:Male
  • Location:66

Posté 20 mai 2007 - 20:17

Citation

Je ne suis pas un expert. Je pratique la programation que depuis deux mois et je me suis m'y au ruby que récement pour rpg maker mais le ruby et le c++ sont pareil sauf qu'il diffère des syntaxes de codes.


Voilà un extrait de son autre post pour répondre à ta question.

(Désolé de poster pour ca mais j'en ai marre d'envoyer de MP toutes les 5 min)
0

#4 L'utilisateur est hors-ligne   zachdu59 Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 286
  • Inscrit(e) : 25-novembre 06
  • Gender:Male
  • Location:Lille, au bdm le quartier de tout les probleme

Posté 20 mai 2007 - 20:24

C'est pas grave, tu pouvais aussi répondre ici. C'est que je suis perplexe.
J'ai essayé pendant des mois d'apprendre le RUBY, et je suis un bosseur. A part quelques petits truc, je ne connais pratiquement rien en RUBY.
C'est pour ça, je me méfi un peu des imposteur qui essai de voler le travail des autres et de le redistribuer à leur nom. Ca ne me Plairé pas moi, qu'on me vole tout mon travail.
Et comme ce qu'il a ajouté est complexe, et que ca fait 2 mois qu'il apprends le RUBY, je ne suis pas à 100% sur que c'est lui qu'il les a ajouté, désolé Saga_Fire, je suis trés méfiant ;)

Si c'est bien toi qui les a fait Saga_Fire, escuse moi d'avoir dit ça, il y a tellement de monde qui vole le travail des autres :(

Edit Quelqu'un: Je suis d'accord avec Zach sur ce point ;)
Aller sur ce forum, inscrivez-vous !
http://www.rpgmaking.free.fr/

OU ALLER SUR LE TOPIC DE MON PROJET "DARK AND LIGHT"
http://www.rpg-legen...?showtopic=9310

Vous savez ce que c'est le freestyle football, non? Alors allez voir mes vidéo :
http://komball.com/f...tyler/zachdu59/

ZaCh and zAcH
0

#5 L'utilisateur est hors-ligne   Saga_fire Icône

  • Villageois
  • PipPip
  • Groupe : Membres +
  • Messages : 69
  • Inscrit(e) : 28-janvier 07
  • Gender:Male
  • Location:Rouen

Posté 22 mai 2007 - 18:27

Voir le messagezachdu59, le 20/05/2007 à 21:24, dit :

C'est pas grave, tu pouvais aussi répondre ici. C'est que je suis perplexe.
J'ai essayé pendant des mois d'apprendre le RUBY, et je suis un bosseur. A part quelques petits truc, je ne connais pratiquement rien en RUBY.
C'est pour ça, je me méfi un peu des imposteur qui essai de voler le travail des autres et de le redistribuer à leur nom. Ca ne me Plairé pas moi, qu'on me vole tout mon travail.
Et comme ce qu'il a ajouté est complexe, et que ca fait 2 mois qu'il apprends le RUBY, je ne suis pas à 100% sur que c'est lui qu'il les a ajouté, désolé Saga_Fire, je suis trés méfiant ;)

Si c'est bien toi qui les a fait Saga_Fire, escuse moi d'avoir dit ça, il y a tellement de monde qui vole le travail des autres :(

Edit Quelqu'un: Je suis d'accord avec Zach sur ce point ;)

Je vais t'avouer que je n'ai pas aimé ta méfiance à mon égard mais pour te prouver que je ne suis pas rancunier, je vais te donner mon secret comment aprendre le ruby en seulement deux (attention je n'ai pas dit que je le maitrisais). Va d'abord sur le site www.siteduzero.com et regarde bien les cours de M@teo21 (je site son nom car il est trop fort dans sa manière d'aprendre) sur le language C et C++. La déja ça ne t'aprendras pas le ruby mais t'oras des très bonne base sur le fonctionnement de la programmation. Ensuite cherche un peu dans le site, il y aura un moment des cours sur le ruby fait par un certain Loktar (je t'avourais qu'à mon goût, il n'explique pas aussi bien que M@teo21 mais comme je t'ai qu'avec ses cours sur le C/C++, tu comprends bien le fonctionnement de la programmation) qui t'aprennes les syntaxe utilisé en ruby. Après ta lecture des cours que tu auras faits attentivement jusqu'a ce que tu comprenne et que tu ais bien observé les codes de chaque script reviens me dire qu'il n'est pas possibles d'aprendre le ruby en deux mois et je te répondrais que tu n'est pas fait pour la programmation.
Ensuite (ouai mon pote, j'en ai pas fini avec toi), pour essayer de te convaincre que je ne vole pas le travail d'autruis (je m'adresse aussi a toi fameux Quelqu'un), je vais t'expliquer ce que j'ai modifié (ou plutot corrigé) et édité sur ce script :
_ Tout d'abord, au début, quand j'équipais un bouclier dans la main droite la défense n'augmentait pas (sauf si j'équipais dans la main gauche par exemple un bouclier de bronze et là dans la main droite, la défense aumentait comme le si le bouclier de bronze et ceci pour n'importe quel bouclier) donc j'ai corrigé ce problème (je dis corriger car je pense que c'est une erreur de la part su scripteur).
_ Ensuite, comme je trouvais ça nul que l'on puisse équiper deux boucliers et que tous les personnages pouvaient s'équiper de deux armes, j'ai fait en sorte que l'on ne puisse pas s'équiper de deux bouclier et que le type qui fait son jeu choisis qui à le droit de porter deux armes.
_ Enfin j'ai aussi fait en sorte que l'on puisse s'équiper d'une arme à deux mains.
Voilà, après ça si je ne mérite pas tes félicitations, je n'y comprend rien (c'est ironique).
Faire une erreur et ne pas réviser son jugement, c'est ce que l'on apelle une erreur.
Image IPB
0

#6 L'utilisateur est hors-ligne   Anuvico Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 337
  • Inscrit(e) : 06-mai 07
  • Gender:Male
  • Location:66

Posté 22 mai 2007 - 18:44

Je comprends la perpecité (le doute) que zachdu59 a. Car bien que je ne connaisse rien en programmation, j'arrive à corriger et à modifier certains scripts. Quand on entend que tu as appris la programmation en 2 mois excuse le (ou les apparaments ils sont plusieurs) d'émettre des doutes; tu peux aussi leur envoyer le script d'origine pour qu'ils voit par eux même ce que tu as fait.
Pour ma part je préfère donner le bénéfice du doute, car ce que tu dis est possible, car si tu voulais devenir programmeur ce devais être depuis un moment donc tu devais avoir des motions et puis à coeur vaillant rien d'impossible, moi j'ai tous appris tous seul, et j'arrive presque à reproduire certain scripts en évènement commun.
Et puis si tu étais un imposteur, le meilleur moyen pour le découvrir est de te laisser grossir jusqu'à ce que tu commette une erreur (comme dans la vrai vie, le gars se la "pète" on le ^pousse un peu et il se dégonfle très vite).

Mais bon espérons que ta remarque leur fera changer d'avis, pour l'instant je reste sur ma 1er impression, post ceux d'origine et les modif pour que tous le monde puisse bien voir la différence.
0

#7 L'utilisateur est hors-ligne   zachdu59 Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 286
  • Inscrit(e) : 25-novembre 06
  • Gender:Male
  • Location:Lille, au bdm le quartier de tout les probleme

Posté 22 mai 2007 - 20:45

Alors là, je dis respect. Je te fait mes sincère excuse Saga_Fire.
C'est qu'il y a plein de monde qui mette des script sur des sites, et écrit dedans "modifié par..." et il mettent leur nom...
Par conséquent, je m'excuse. C'est rare, des amateurs (comme toi et moi) qui apprenne si vite le RUBY. Alors j'ai eu un petit doute.

PS : je penserais à aller sur ton site, merci pour ton aide, lol ;)
Aller sur ce forum, inscrivez-vous !
http://www.rpgmaking.free.fr/

OU ALLER SUR LE TOPIC DE MON PROJET "DARK AND LIGHT"
http://www.rpg-legen...?showtopic=9310

Vous savez ce que c'est le freestyle football, non? Alors allez voir mes vidéo :
http://komball.com/f...tyler/zachdu59/

ZaCh and zAcH
0

#8 L'utilisateur est hors-ligne   Quelqu'un Icône

  • Inconu au bataillon ...
  • PipPipPipPipPip
  • Groupe : Membres ++
  • Messages : 705
  • Inscrit(e) : 01-août 06
  • Gender:Male
  • Location:Quelquepart O_O

Posté 22 mai 2007 - 22:06

On a déjà eu des problèmes avec des gens qui mettent "Modifié par ..." comme l'a dit Zach donc ... (Et puis être trop naïf n'arrange pas les choses non plus :rolleyes: )

J'ai entendu parlé récemment que le Ruby ressemblait au C/C++ donc je m'y suis mis(Site du zéro, biensûr ;) ) et j'ai vite remarqué qu'il y avait des commandes qui était les même c'est pourquoi:

J'encourage ceux qui veulent apprendre le Ruby à faire des cours sur le C/C++. ^^

Je rajoute tes scripts dans le topic épinglé .
Image IPB
---------------------------------------------------------------------------------------------
Si vous n'avez jamais lu les rêgles du forum avant de poster, ne vous étonnez pas que vous êtes traité de boulet.
-Les rêgles de la section RPG-Making, sont >>>ICI<<<
---------------------------------------------------------------------------------------------
Et n'oubliez jamais que Google est votre ami ! ;)
0

#9 L'utilisateur est hors-ligne   Saga_fire Icône

  • Villageois
  • PipPip
  • Groupe : Membres +
  • Messages : 69
  • Inscrit(e) : 28-janvier 07
  • Gender:Male
  • Location:Rouen

Posté 23 mai 2007 - 03:20

Je comprend les gars mais c'est pas mon but. Figurez vous que j'ai déja vu ces script là sur d'autres forum et que moi j'avais super besoin de ces scripts. C'étais des versions toute fausse donc moi j'en avais mare que des gens poste des script qui ne marchent qu'a moitié et donc j'ai recherchais ces script (hors de question de les refaire RPG maker XP est trop vaste) et j'y ai ajouté ma touche personnelle (en même temps, le script deux armes m'a beaucoups apris sur RGP maker XP). Je vais vous donnez les codes des script originaux juste pour que vous vous fassiez une petite idée de ce qu'endure un aprenti scripteur. Vous verrez que c'est pas grand chose mais que ça prend la tête quand on connait rien a RPG maker.
Faire une erreur et ne pas réviser son jugement, c'est ce que l'on apelle une erreur.
Image IPB
0

#10 L'utilisateur est hors-ligne   Saga_fire Icône

  • Villageois
  • PipPip
  • Groupe : Membres +
  • Messages : 69
  • Inscrit(e) : 28-janvier 07
  • Gender:Male
  • Location:Rouen

Posté 24 mai 2007 - 00:51

Voila l'original comme promis
#=================================
# class Game_Actor mod's... -Midge-
#=================================
# This is where the meat of the script takes place...
# there is alot to be accounted for here too.. 
# i had to make sure that all the stat stuff was being 
# from all the right things... in fact i think most of the 
# original class has been modded here... not sure on that
# and too lazy to check and see... let's hope that you haven't
# made any forgetable changes to this before...
#=================================
class Game_Actor < Game_Battler

 attr_accessor :weapon_type
 attr_accessor :armor_type
 attr_accessor :sec_attack
 
 alias double_weapons_initialize initialize

 def initialize(actor_id)
   double_weapons_initialize(actor_id)
   @weapon_type = $data_weapons[@weapon_id]
   @armor_type = $data_armors[@armor1_id]
   @sec_attack = nil
 end
 
def animation3_id
  weapon = $data_weapons[@armor1_id]
  return (weapon != nil ? weapon.animation1_id : 0)
end

def animation4_id
  weapon = $data_weapons[@armor1_id]
  return (weapon != nil ? weapon.animation2_id : 0)
end

 def two_shields
   if (self.weapon_type.is_a?(RPG::Armor) and self.armor_type.is_a?(RPG::Armor)) and
	 (self.weapon_id != 0 and self.armor1_id != 0)
	 return true
   else
	 return false
   end
 end
 
 def two_weapons
   if (self.weapon_type.is_a?(RPG::Weapon) and self.armor_type.is_a?(RPG::Weapon)) and
	 (self.weapon_id != 0 and self.armor1_id != 0)
	 return true
   else
	 return false
   end
 end
   
 def equip(equip_type, id, item = RPG::Armor)
   case equip_type
   
   when 0
	 
	 if @weapon_id == 0
	   if item.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   self.weapon_type = $data_weapons[id]
		   @weapon_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   elsif item.is_a?(RPG::Armor)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   self.weapon_type = $data_armors[id]
		   @weapon_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   end
	 end
	 
	 if item == nil
	   if self.weapon_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_weapon(@weapon_id, 1)
		   @weapon_id = id
		 end
	   elsif self.weapon_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_armor(@weapon_id, 1)
		   @weapon_id = id
		 end
	   end
	 end
	 
	 if item.is_a?(RPG::Weapon)
	   if self.weapon_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_weapon(@weapon_id, 1)
		   self.weapon_type = $data_weapons[id]
		   @weapon_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   elsif self.weapon_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_armor(@weapon_id, 1)
		   self.weapon_type = $data_weapons[id]
		   @weapon_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   end
	   
	  elsif item.is_a?(RPG::Armor)
	   if self.weapon_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_armor(@weapon_id, 1)
		   self.weapon_type = $data_armors[id]
		   @weapon_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   elsif self.weapon_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_weapon(@weapon_id, 1)
		   self.weapon_type = $data_armors[id]
		   @weapon_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   end	 
	 end

   when 1  

	 if @armor1_id == 0
	   if item.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   self.armor_type = $data_weapons[id]
		   @armor1_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   elsif item.is_a?(RPG::Armor)
		 if id == 0 or $game_party.armor_number(id) > 0
		   self.armor_type = $data_armors[id]
		   @armor1_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   end
	 end
	 
	 if item == nil
	   if self.armor_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_weapon(@armor1_id, 1)
		   @armor1_id = id
		 end
	   elsif self.armor_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_armor(@armor1_id, 1)
		   @armor1_id = id
		 end
	   end
	 end
	 
	 if item.is_a?(RPG::Weapon)
	   if self.armor_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_weapon(@armor1_id, 1)
		   self.armor_type = $data_weapons[id]
		   @armor1_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   elsif self.armor_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.weapon_number(id) > 0
		   $game_party.gain_armor(@armor1_id, 1)
		   self.armor_type = $data_weapons[id]
		   @armor1_id = id
		   $game_party.lose_weapon(id, 1)
		 end
	   end
	   
	  elsif item.is_a?(RPG::Armor)
	   if self.armor_type.is_a?(RPG::Armor)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_armor(@armor1_id, 1)
		   self.armor_type = $data_armors[id]
		   @armor1_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   elsif self.armor_type.is_a?(RPG::Weapon)
		 if id == 0 or $game_party.armor_number(id) > 0
		   $game_party.gain_weapon(@armor1_id, 1)
		   self.armor_type = $data_armors[id]
		   @armor1_id = id
		   $game_party.lose_armor(id, 1)
		 end
	   end	 
	 end
	 
   when 2  
	 if id == 0 or $game_party.armor_number(id) > 0
	   update_auto_state($data_armors[@armor2_id], $data_armors[id])
	   $game_party.gain_armor(@armor2_id, 1)
	   @armor2_id = id
	   $game_party.lose_armor(id, 1)
	 end
   when 3 
	 if id == 0 or $game_party.armor_number(id) > 0
	   update_auto_state($data_armors[@armor3_id], $data_armors[id])
	   $game_party.gain_armor(@armor3_id, 1)
	   @armor3_id = id
	   $game_party.lose_armor(id, 1)
	 end
   when 4 
	 if id == 0 or $game_party.armor_number(id) > 0
	   update_auto_state($data_armors[@armor4_id], $data_armors[id])
	   $game_party.gain_armor(@armor4_id, 1)
	   @armor4_id = id
	   $game_party.lose_armor(id, 1)
	 end
   end
 end

 def element_rate(element_id)
   table = [0,200,150,100,50,0,-100]
   result = table[$data_classes[@class_id].element_ranks[element_id]]
   if self.armor_type.is_a?(RPG::Weapon)
	 for i in [@armor2_id, @armor3_id, @armor4_id]
	   armor = $data_armors[i]
	   if armor != nil and armor.guard_element_set.include?(element_id)
		 result /= 2
	   end
	 end
   else  
	 for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
	   armor = $data_armors[i]
	   if armor != nil and armor.guard_element_set.include?(element_id)
		 result /= 2
	   end
	 end
   end
   for i in @states
	 if $data_states[i].guard_element_set.include?(element_id)
	   result /= 2
	 end
   end
   return result
 end

 def state_guard?(state_id)
   if self.armor_type.is_a?(RPG::Weapon)
	 for i in [@armor2_id, @armor3_id, @armor4_id]
	   armor = $data_armors[i]
	   if armor != nil
		 if armor.guard_state_set.include?(state_id)
		   return true
		 end
	   end
	 end
   else  
	 return false
	 for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
	   armor = $data_armors[i]
	   if armor != nil
		 if armor.guard_state_set.include?(state_id)
		   return true
		 end
	   end
	 end
	 return false
   end
 end
 
 def element_set
   n = []
   unless self.weapon_type.is_a?(RPG::Armor)
   weapon = $data_weapons[@weapon_id]
   n += weapon != nil ? weapon.element_set : []
   end
   unless self.armor_type.is_a?(RPG::Armor)
   weapon2 = $data_weapons[@armor1_id]
   n += weapon2 != nil ? weapon2.element_set : []
   end
   n.flatten!
   n.uniq!
   return n
 end

 
 def plus_state_set
   n = []
   unless self.weapon_type.is_a?(RPG::Armor)
   weapon = $data_weapons[@weapon_id]
   n += weapon != nil ? weapon.plus_state_set : []
   end
   unless self.armor_type.is_a?(RPG::Armor)
   weapon2 = $data_weapons[@armor1_id]
   n += weapon2 != nil ? weapon2.plus_state_set : []
   end
   n.flatten!
   n.uniq!
   return n
 end

 def minus_state_set
   n = []
   unless self.weapon_type.is_a?(RPG::Armor)
   weapon = $data_weapons[@weapon_id]
   n += weapon != nil ? weapon.minus_state_set : []
   end
   unless self.armor_type.is_a?(RPG::Armor)
   weapon2 = $data_weapons[@armor1_id]
   n += weapon2 != nil ? weapon2.minus_state_set : []
   end
   n.flatten!
   n.uniq!
   return n
 end

 def base_str
   n = $data_actors[@actor_id].parameters[2, @level]
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.str_plus : 0
   n += armor1 != nil ? armor1.str_plus : 0
   n += armor2 != nil ? armor2.str_plus : 0
   n += armor3 != nil ? armor3.str_plus : 0
   n += armor4 != nil ? armor4.str_plus : 0
   return [[n, 1].max, 999].min
 end

 def base_dex
   n = $data_actors[@actor_id].parameters[3, @level]
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.dex_plus : 0
   n += armor1 != nil ? armor1.dex_plus : 0
   n += armor2 != nil ? armor2.dex_plus : 0
   n += armor3 != nil ? armor3.dex_plus : 0
   n += armor4 != nil ? armor4.dex_plus : 0
   return [[n, 1].max, 999].min
 end

 def base_agi
   n = $data_actors[@actor_id].parameters[4, @level]
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.agi_plus : 0
   n += armor1 != nil ? armor1.agi_plus : 0
   n += armor2 != nil ? armor2.agi_plus : 0
   n += armor3 != nil ? armor3.agi_plus : 0
   n += armor4 != nil ? armor4.agi_plus : 0
   return [[n, 1].max, 999].min
 end

 def base_int
   n = $data_actors[@actor_id].parameters[5, @level]
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.int_plus : 0
   n += armor1 != nil ? armor1.int_plus : 0
   n += armor2 != nil ? armor2.int_plus : 0
   n += armor3 != nil ? armor3.int_plus : 0
   n += armor4 != nil ? armor4.int_plus : 0
   return [[n, 1].max, 999].min
 end

 def base_atk
   n = 0
   unless self.weapon_type.is_a?(RPG::Armor)
   weapon = $data_weapons[@weapon_id]
   n += weapon != nil ? weapon.atk : 0
   end
   unless self.armor_type.is_a?(RPG::Armor)
   weapon2 = $data_weapons[@armor1_id]
   n += weapon2 != nil ? weapon2.atk : 0
   end
   return n
 end

 def base_pdef
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   pdef1 = weapon != nil ? weapon.pdef : 0
   pdef2 = armor1 != nil ? armor1.pdef : 0
   pdef3 = armor2 != nil ? armor2.pdef : 0
   pdef4 = armor3 != nil ? armor3.pdef : 0
   pdef5 = armor4 != nil ? armor4.pdef : 0
   return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
 end

 def base_mdef
   if self.weapon_type.is_a?(RPG::Weapon)
	 weapon = $data_weapons[@weapon_id]
   elsif self.weapon_type.is_a?(RPG::Armor)
	 weapon = $data_armors[@armor1_id]
   end
   if self.armor_type.is_a?(RPG::Armor)
	 armor1 = $data_armors[@armor1_id]
   elsif self.armor_type.is_a?(RPG::Weapon)
	 armor1 = $data_weapons[@armor1_id]
   end
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   mdef1 = weapon != nil ? weapon.mdef : 0
   mdef2 = armor1 != nil ? armor1.mdef : 0
   mdef3 = armor2 != nil ? armor2.mdef : 0
   mdef4 = armor3 != nil ? armor3.mdef : 0
   mdef5 = armor4 != nil ? armor4.mdef : 0
   return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
 end

 def base_eva
   armor1 = $data_armors[@armor1_id]
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   eva1 = armor1 != nil ? armor1.eva : 0
   eva2 = armor2 != nil ? armor2.eva : 0
   eva3 = armor3 != nil ? armor3.eva : 0
   eva4 = armor4 != nil ? armor4.eva : 0
   return eva1 + eva2 + eva3 + eva4
 end
 
end
#=================================
# end -O- Game_Actor changes -Midge-
#=================================


#=================================
# class Window_EquipRight mods... -Midge-
#=================================
# this is just so that it will display the right stuff that 
# you have equipped in the two hands...
#=================================

class Window_EquipRight < Window_Selectable
 def refresh
   self.contents.clear
   @data = []
   @data.push($data_weapons[@actor.weapon_id])
   @data.push($data_armors[@actor.armor1_id])
   if @actor.weapon_type.is_a?(RPG::Weapon)
	 @data[0] = $data_weapons[@actor.weapon_id]
   elsif @actor.weapon_type.is_a?(RPG::Armor)
	 @data[0] = $data_armors[@actor.weapon_id]
   end
   if @actor.armor_type.is_a?(RPG::Weapon)
	 @data[1] = $data_weapons[@actor.armor1_id]
   elsif @actor.armor_type.is_a?(RPG::Armor)
	 @data[1] = $data_armors[@actor.armor1_id]
   end
   @data.push($data_armors[@actor.armor2_id])
   @data.push($data_armors[@actor.armor3_id])
   @data.push($data_armors[@actor.armor4_id])
   @item_max = @data.size
   self.contents.font.color = system_color
   self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
   self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
   self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
   self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
   self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
   draw_item_name(@data[0], 92, 32 * 0)
   draw_item_name(@data[1], 92, 32 * 1)
   draw_item_name(@data[2], 92, 32 * 2)
   draw_item_name(@data[3], 92, 32 * 3)
   draw_item_name(@data[4], 92, 32 * 4)
 end
end
#=================================
# End -O- Window_EquipRight Mods... -Midge-
#=================================


#=================================
# class Window_EquipItem mods... -Midge-
#=================================
# basically i just made it so that both the weapons and 
# sheilds would be displayed in the weapon and shield
# hands... both of them... so you can equip either in 
# either hand... anyway.. its all cool and stuff... 
#=================================

class Window_EquipItem < Window_Selectable

 def refresh
   if self.contents != nil
	 self.contents.dispose
	 self.contents = nil
   end
   @data = []
   if @equip_type == 0
	 weapon_set = $data_classes[@actor.class_id].weapon_set
	 for i in 1...$data_weapons.size
	   if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
		 @data.push($data_weapons[i])
	   end
	 end
	 armor_set = $data_classes[@actor.class_id].armor_set
	 for i in 1...$data_armors.size
	   if $game_party.armor_number(i) > 0 and armor_set.include?(i)
		 if $data_armors[i].kind == 0
		   @data.push($data_armors[i])
		 end
	   end
	 end
   end
   if @equip_type != 0
	 if @equip_type == 1
	   weapon_set = $data_classes[@actor.class_id].weapon_set
	   for i in 1...$data_weapons.size
		 if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
		   @data.push($data_weapons[i])
		 end
	   end
	 end
	 armor_set = $data_classes[@actor.class_id].armor_set
	 for i in 1...$data_armors.size
	   if $game_party.armor_number(i) > 0 and armor_set.include?(i)
		 if $data_armors[i].kind == @equip_type-1
		   @data.push($data_armors[i])
		 end
	   end
	 end
   end
   
   @data.push(nil)
   @item_max = @data.size
   self.contents = Bitmap.new(width - 32, row_max * 32)
   self.contents.font.name = $defaultfonttype 
   self.contents.font.size = $defaultfontsize
   for i in 0...@item_max-1
	 draw_item(i)
   end
 end

end
#=================================
# End -O- Window_EquipItem mod's... -Midge-
#=================================


class Scene_Equip
 
 def refresh
   @item_window1.visible = (@right_window.index == 0)
   @item_window2.visible = (@right_window.index == 1)
   @item_window3.visible = (@right_window.index == 2)
   @item_window4.visible = (@right_window.index == 3)
   @item_window5.visible = (@right_window.index == 4)
   item1 = @right_window.item
   case @right_window.index
   when 0
	 @item_window = @item_window1
   when 1
	 @item_window = @item_window2
   when 2
	 @item_window = @item_window3
   when 3
	 @item_window = @item_window4
   when 4
	 @item_window = @item_window5
   end
   if @right_window.active
	 @left_window.set_new_parameters(nil, nil, nil)
   end
   if @item_window.active
	 item2 = @item_window.item
	 last_hp = @actor.hp
	 last_sp = @actor.sp
	 @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id, item2)
	 new_atk = @actor.atk
	 new_pdef = @actor.pdef
	 new_mdef = @actor.mdef
	 @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id, item1)
	 @actor.hp = last_hp
	 @actor.sp = last_sp
	 @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
   end
 end
 
 def update_item
   if Input.trigger?(Input::B)
	 $game_system.se_play($data_system.cancel_se)
	 @right_window.active = true
	 @item_window.active = false
	 @item_window.index = -1
	 return
   end
   if Input.trigger?(Input::C)
	 $game_system.se_play($data_system.equip_se)
	 item = @item_window.item
	 @actor.equip(@right_window.index, item == nil ? 0 : item.id, item)
	 @right_window.active = true
	 @item_window.active = false
	 @item_window.index = -1
	 @right_window.refresh
	 @item_window.refresh
	 return
   end
 end
 
 def update
   @left_window.update
   @right_window.update
   @item_window.update
   @item_window1.refresh
   @item_window2.refresh
   refresh
   if @right_window.active
	 update_right
	 return
   end
   if @item_window.active
	 update_item
	 return
   end
 end
end

class Scene_Battle

 
 def update_phase3_basic_command
   if Input.trigger?(Input::B)
	 $game_system.se_play($data_system.cancel_se)
	 phase3_prior_actor
	 return
   end
   if @active_battler.two_shields 
	 @actor_command_window.disable_item(0)
   else
	 @actor_command_window.enable_item(0)
   end

   
   if Input.trigger?(Input::C)
	 case @actor_command_window.index
	 when 0
	   if @active_battler.two_shields
		 $game_system.se_play($data_system.buzzer_se)
		 return		  
	   end
	   if @active_battler.two_weapons == true
		 @active_battler.current_action.kind = 0
		 @active_battler.current_action.basic = 4
	   else
		 @active_battler.current_action.kind = 0
		 @active_battler.current_action.basic = 0
	   end	  
	   $game_system.se_play($data_system.decision_se)
	   start_enemy_select
	 when 1 
	   $game_system.se_play($data_system.decision_se)
	   @active_battler.current_action.kind = 1
	   start_skill_select
	 when 2 
	   $game_system.se_play($data_system.decision_se)
	   @active_battler.current_action.kind = 0
	   @active_battler.current_action.basic = 1
	   phase3_next_actor
	 when 3 
	   $game_system.se_play($data_system.decision_se)
	   @active_battler.current_action.kind = 2
	   start_item_select
	 end
	 return
   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 @active_battler.is_a?(Game_Enemy)
	   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
	 end
	 if @active_battler.is_a?(Game_Actor)
	   if @active_battler.armor_type.is_a?(RPG::Weapon)
		 @animation1_id = @active_battler.animation3_id
		 @animation2_id = @active_battler.animation4_id
	   end
	   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("逃げる", 1)
	 @active_battler.escape
	 return
   end
   
   if @active_battler.current_action.basic == 3
	 $game_temp.forcing_battler = nil
	 @phase4_step = 1
	 return
   end
   
   if @active_battler.current_action.basic == 4
	 @animation1_id = @active_battler.animation1_id
	 @animation2_id = @active_battler.animation2_id
	 @animation3_id = @active_battler.animation3_id
	 @animation4_id = @active_battler.animation4_id
	 if @active_battler.is_a?(Game_Actor)
	   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
 end
 
 
 
def update_phase4_step4 
  if @active_battler.is_a?(Game_Actor)	
	if @active_battler.two_weapons == true && @active_battler.sec_attack == 0
	  for target in @target_battlers
		target.animation_id = @animation4_id
		target.animation_hit = (target.damage != "Miss")
		@phase4_step = 5
		return
	  end
	end
  end
  for target in @target_battlers
	target.animation_id = @animation2_id
	target.animation_hit = (target.damage != "Miss")
  end
  @wait_count = 8
  @phase4_step = 5
end  

def update_phase4_step5
  @help_window.visible = false
  @status_window.refresh
  if @active_battler.is_a?(Game_Actor)	
	if @active_battler.current_action.basic == 4	 
	  if @active_battler.two_weapons == true && @active_battler.sec_attack == nil
		@active_battler.sec_attack = 0
		@phase4_step = 3
		return
	  else
		@active_battler.sec_attack = nil
	  end
	end
  end
  for target in @target_battlers
	if target.damage != nil
	  target.damage_pop = true
	end
  end
  @phase4_step = 6
end
end


class Window_Command

 def enable_item(index)
   draw_item(index, normal_color)
 end
end

Faire une erreur et ne pas réviser son jugement, c'est ce que l'on apelle une erreur.
Image IPB
0

#11 L'utilisateur est hors-ligne   le mexicain2 Icône

  • Au bistrot du coin
  • Pip
  • Groupe : Membres
  • Messages : 8
  • Inscrit(e) : 19-août 07
  • Gender:Male

Posté 06 septembre 2007 - 18:17

slt
heu sur le premier j'ai une erreur a la ligne 655 et avec le segond je peux plus rien équiper.
peut etre parce que je fait un a-rpg
0

#12 L'utilisateur est hors-ligne   Sweet-Darkness Icône

  • Villageois
  • PipPip
  • Groupe : Membres +
  • Messages : 39
  • Inscrit(e) : 23-septembre 07

Posté 26 septembre 2007 - 13:35

En fait, j'ai pas bien compris quel est le vrai sujet de ce Sujet :)
0

#13 L'utilisateur est hors-ligne   Anuvico Icône

  • Chevalier
  • PipPipPipPip
  • Groupe : Membres ++
  • Messages : 337
  • Inscrit(e) : 06-mai 07
  • Gender:Male
  • Location:66

Posté 26 septembre 2007 - 18:04

Avoir un script qui permet d'équiper 2 armes en même temps avec RPG maker
0

Page 1 sur 1


Réponse rapide

  

1 utilisateur(s) en train de lire ce sujet
0 membre(s), 1 invité(s), 0 utilisateur(s) anonyme(s)