Últimos temas
» Script de menupor maxi Jue 04 Dic 2014, 1:44 pm
» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm
» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am
» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am
» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm
» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm
» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am
» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am
» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am
» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am
» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am
» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm
» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am
» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am
» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm
¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado Ninguno
El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm
[Aporte]Script Espada y escudo[VX]
RPG maker VX :: Scripts ::
Página 1 de 1.
[Aporte]Script Espada y escudo[VX]
este script te permite romper la regla de el arma en una sola mano te permite equiparte un escudo en la segunda mano inclusive en el lugar de el arma principal
CREDITOS:POKETHOUSE
- Código:
#==============================================================================
# ** ExEquip_SwordAndShield (AEROGP)
#------------------------------------------------------------------------------
# This script changes the rules of "two swords style" so that an actor is
# still allowed to equip a shield, even in the weapon slot.
#==============================================================================
$imported = {} if $imported == nil
$imported["ExEquip_SwordAndShield"] = true
module EXEQP_SWRDSHLD
#------------------------------------------------------------------------------
# *** CUSTOMIZATION SECTION ***
#------------------------------------------------------------------------------
# Actor exception array.
# Actors whose ID is specified here will NOT follow the rules defined
# by this script. (Use [] for none)
EXCEPTION = []
#------------------------------------------------------------------------------
# !!! IT IS NOT ADVISED TO EDIT BEYOND THIS PORTION OF THE SCRIPT !!!
#------------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Get Armor ID of Shield
#--------------------------------------------------------------------------
def self.shield_kind
if $imported["EquipmentOverhaul"]
type = YEM::EQUIP::TYPE_LIST[0]
return YEM::EQUIP::TYPE_RULES[type][1]
end
return 0
end
end
#------------------------------------------------------------------------------
# ** Game_Actor
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
alias _exeswsh_initialize initialize unless $@
alias _exeswsh_weapons weapons unless $@
alias _exeswsh_armors armors unless $@
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :equip_class # equip class
#--------------------------------------------------------------------------
# * Object Initialization (Definition Added)
# actor_id : actor ID
#--------------------------------------------------------------------------
def initialize(actor_id)
_exeswsh_initialize(actor_id)
@equip_class = [RPG::Weapon, two_swords_style ? RPG::Weapon : RPG::Armor]
end
#--------------------------------------------------------------------------
# * Get Weapon Object Array (Redefined)
#--------------------------------------------------------------------------
def weapons
if @equip_class == nil
_exeswsh_weapons
else
result = []
if @equip_class[0] == RPG::Weapon
result.push($data_weapons[@weapon_id])
end
if @equip_class[1] == RPG::Weapon
result.push($data_weapons[@armor1_id])
end
return result
end
end
#--------------------------------------------------------------------------
# * Get Armor Object Array (Redefined)
#--------------------------------------------------------------------------
def armors
if @equip_class == nil
_exeswsh_armors
else
result = []
if @equip_class[0] == RPG::Armor
result.push($data_armors[@weapon_id])
end
if @equip_class[1] == RPG::Armor
result.push($data_armors[@armor1_id])
end
result.push($data_armors[@armor2_id])
result.push($data_armors[@armor3_id])
result.push($data_armors[@armor4_id])
return result
end
end
#--------------------------------------------------------------------------
# * Get Left-Hand Object (For Equip Screen)
#--------------------------------------------------------------------------
def left_hand
if @equip_class == nil
return [$data_weapons[@weapon_id]]
elsif @equip_class[0] == RPG::Weapon
return [$data_weapons[@weapon_id]]
elsif @equip_class[0] == RPG::Armor
return [$data_armors[@weapon_id]]
end
return [nil]
end
#--------------------------------------------------------------------------
# * Get Right-Hand Object (For Equip Screen)
#--------------------------------------------------------------------------
def right_hand
if @equip_class == nil
if two_swords_style
return [$data_weapons[@armor1_id]]
else
return [$data_armors[@armor1_id]]
end
elsif @equip_class[1] == RPG::Weapon
return [$data_weapons[@armor1_id]]
elsif @equip_class[1] == RPG::Armor
return [$data_armors[@armor1_id]]
end
return [nil]
end
#--------------------------------------------------------------------------
# * Get Body Armor Object Array (For Equip Screen)
#--------------------------------------------------------------------------
def body_armors
result = []
result.push($data_armors[@armor2_id])
result.push($data_armors[@armor3_id])
result.push($data_armors[@armor4_id])
return result
end
#--------------------------------------------------------------------------
# * Get Equipped Item Object Array (Redefined)
#--------------------------------------------------------------------------
def equips
return left_hand + right_hand + body_armors
end
#--------------------------------------------------------------------------
# * Determine if Shield can still be equipped
#--------------------------------------------------------------------------
def sword_and_shield?
return (not EXEQP_SWRDSHLD::EXCEPTION.include?(id))
end
#--------------------------------------------------------------------------
# * Change Equipment (designate object) (Definition Added)
# equip_type : Equip region (0..4)
# item : Weapon or armor (nil is used to unequip)
# test : Test flag (for battle test or temporary equipment)
#--------------------------------------------------------------------------
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
unless test
return if $game_party.item_number(item) == 0 if item != nil
$game_party.gain_item(last_item, 1)
$game_party.lose_item(item, 1)
end
item_id = item == nil ? 0 : item.id
case equip_type
when 0 # Weapon
@weapon_id = item_id
if two_swords_style and item_id != 0
@equip_class[0] = item.class
unless shield_legal? # If shield is not allowed
change_equip(1, nil, test) # Unequip from other hand
end
end
unless two_hands_legal? # If two hands is not allowed
change_equip(1, nil, test) # Unequip from other hand
end
when 1 # Weapon / Shield
@armor1_id = item_id
if two_swords_style and item_id != 0
@equip_class[1] = item.class
unless shield_legal? # If shield is not allowed
change_equip(0, nil, test) # Unequip from other hand
end
end
unless two_hands_legal? # If two hands is not allowed
change_equip(0, nil, test) # Unequip from other hand
end
when 2 # Head
@armor2_id = item_id
when 3 # Body
@armor3_id = item_id
when 4 # Accessory
@armor4_id = item_id
end
end
#--------------------------------------------------------------------------
# * Discard Equipment (Redefined)
# item : Weapon or armor to be discarded.
# Used when the "Include Equipment" option is enabled.
#--------------------------------------------------------------------------
def discard_equip(item)
if @weapon_id == item.id and @equip_class[0] == item.class
@weapon_id = 0
@equip_class[0] = nil
elsif @armor1_id == item.id and @equip_class[1] == item.class
@armor1_id = 0
@equip_class[1] = nil
elsif item.is_a?(RPG::Armor)
if @armor2_id == item.id
@armor2_id = 0
elsif @armor3_id == item.id
@armor3_id = 0
elsif @armor4_id == item.id
@armor4_id = 0
end
end
end
#--------------------------------------------------------------------------
# * Determine if Shield is Usable
#--------------------------------------------------------------------------
def shield_legal?
return true if @weapon_id == 0 or @armor1_id == 0
return @equip_class.include?(RPG::Weapon)
end
#--------------------------------------------------------------------------
# * Determine if Equippable
# item : item
#--------------------------------------------------------------------------
def equippable?(item)
if item.is_a?(RPG::Weapon)
return self.class.weapon_set.include?(item.id)
elsif item.is_a?(RPG::Armor)
if item.kind == EXEQP_SWRDSHLD::shield_kind and two_swords_style
return false unless sword_and_shield?
end
return self.class.armor_set.include?(item.id)
end
return false
end
end
#------------------------------------------------------------------------------
# ** Window_EquipItem
#------------------------------------------------------------------------------
class Window_EquipItem < Window_Item
#--------------------------------------------------------------------------
# * Whether to include item in list (Redefined)
# item : item
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
if @equip_type == 0
if item.is_a?(RPG::Armor)
return false if item.kind != EXEQP_SWRDSHLD::shield_kind
return false unless @actor.two_swords_style
return false unless @actor.sword_and_shield?
end
else
return false unless item.is_a?(RPG::Armor)
return false unless item.kind == @equip_type - 1
end
return @actor.equippable?(item)
end
end
#------------------------------------------------------------------------------
# ** Scene_Equip
#------------------------------------------------------------------------------
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# * Update Status Window (Redefined)
# Clone doesn't duplicate the equip_class array, so it must be cloned
# individually and then reapplied after equip changes have been made.
#--------------------------------------------------------------------------
def update_status_window
if @equip_window.active
@status_window.set_new_parameters(nil, nil, nil, nil)
elsif @item_window.active
temp_class = @actor.equip_class.clone
temp_actor = @actor.clone
temp_actor.change_equip(@equip_window.index, @item_window.item, true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@actor.equip_class = temp_class
@status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
end
@status_window.update
end
end
#------------------------------------------------------------------------------
# ** Yanfly Engine Zealous - Equipment Overhaul (Redefined)
#------------------------------------------------------------------------------
if $imported["EquipmentOverhaul"]
#------------------------------------------------------------------------------
# ** Window_Equip_Item
#------------------------------------------------------------------------------
class Window_Equip_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh (Redefined)
#--------------------------------------------------------------------------
def refresh(type, debug = false)
debug = false unless $TEST
@data = []; @type = type
if @type == :weapon
equips = $game_party.equip_weapons
if @actor.two_swords_style and @actor.sword_and_shield?
equips += $game_party.equip_armours(EXEQP_SWRDSHLD::shield_kind)
end
equips = $data_weapons if debug
else
equips = $game_party.equip_armours(@type)
equips = $data_armors if debug
end
@data += [nil] if YEM::EQUIP::TYPE_RULES[@type][2]
for item in equips
@data.push(item) if include?(item)
end
@data += [nil] if YEM::EQUIP::TYPE_RULES[@type][2] and @data.size > 8
@item_max = @data.size
create_contents
for i in 0..(@item_max-1); draw_item(i); end
end
#--------------------------------------------------------------------------
# * Whether or not to include in item list (Redefined)
# item : item
#--------------------------------------------------------------------------
def include?(item)
return false if item == nil
case @type
when :weapon
if item.is_a?(RPG::Armor)
return false if item.kind != EXEQP_SWRDSHLD::shield_kind
return false unless @actor.two_swords_style
return false unless @actor.sword_and_shield?
end
else
kind = YEM::EQUIP::TYPE_RULES[@type][1]
return false unless item.kind == kind
end
return class_equippable?(item)
end
end
#------------------------------------------------------------------------------
# ** Scene_Equip
#------------------------------------------------------------------------------
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# * Optimize Equipment (Redefined)
#--------------------------------------------------------------------------
def perform_optimize
Sound.play_equip
last_hp = @actor.maxhp
last_mp = @actor.maxmp
types = [:weapon] + @actor.equip_type
slot = -1
for type in types
if slot == 1 and @actor.two_swords_style and not @actor.sword_and_shield?
type = :weapon
end
slot += 1
next unless YEM::EQUIP::TYPE_RULES[type][3]
item = optimal_equip(slot, type)
next if item == nil
@actor.change_equip(slot, item)
end
@status_window.refresh(@equip_window.index)
@equip_window.refresh
@stat_window.refresh
@actor.hp += @actor.maxhp - last_hp
@actor.mp += @actor.maxmp - last_mp
end
end
end # Equipment Overhaul
CREDITOS:POKETHOUSE
luistop12- 500
-
33
759
944
42
Temas similares
» Scipt de escudo y espada
» [Aporte]Script cambio de mapa
» [Aporte]Script Menu Plus[VX]
» [Aporte]Script de foto
» [Aporte]Script OverKill[VX]
» [Aporte]Script cambio de mapa
» [Aporte]Script Menu Plus[VX]
» [Aporte]Script de foto
» [Aporte]Script OverKill[VX]
RPG maker VX :: Scripts ::
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.