Partagez
Aller en bas
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Faire un boomerang (arme).

le Lun 5 Oct 2009 - 9:35
Bonjour !

Je voudrais faire un boomerang, donc une arme qui touche tous les ennemis quand on choisit "attaquer".
J'imagine qu'il faut faire une animation de combat, ça, ok, je gère... Là où je bloque, c'est comment faire pour que l'option "attaquer" pour cette arme touche tous les ennemis..
J'utilise le sbs takentai 2.6 et j'imagine qu'il est possible d'y arriver avec ce script mais je suis une huitre en codage...
avatar
Invité
Invité

Re: Faire un boomerang (arme).

le Lun 5 Oct 2009 - 10:57
Postes ici ton image de boomerang, j'essairais de créer ton animation
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Re: Faire un boomerang (arme).

le Lun 5 Oct 2009 - 11:44
Celle-ci te suffit-elle ?

Sinon, de quoi as-tu besoin ?Une animation ? Un charset ?
En tout cas, merci d'avance !
Ca pourra être utile pour d'autres Smile
avatar
Invité
Invité

Re: Faire un boomerang (arme).

le Lun 5 Oct 2009 - 20:18
C'est bon, ca suffira, je penses.

Au pire je rp si j'ai besoin d'autre chose. J'essaierai de te faire ca pour mercredi ^^
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Re: Faire un boomerang (arme).

le Lun 5 Oct 2009 - 20:34
Nickel chrome ! Un grand merci, mec !
avatar
Invité
Invité

Re: Faire un boomerang (arme).

le Mer 7 Oct 2009 - 14:47
Bon, désolé, j'ai réussi à créer le boomerang, le son, l'animation et tout ca, mais malheureusement, je ne suis pas parvenu à faire en sorte que l'on puisse toucher plusieurs cible

Au début je croyais que tu voulais faire une compétence :p

Je penses qu'il faudrait créer un script comme celui de la harpe, du gun, ou de l'arc, où il y aurait peut être moyen de faire que l'on puisse viser plusieurs cibles. Peut être pourrais-tu voir cela avec un scripteur.

Quoi qu'il en soit, désolé de n'avoir pas pu être d'une grande utilité...

Bonne continuation
avatar
dricc
Membre

Nombre de messages : 2756
Localisation : Lille
Distinction : Altruiste - Incarnation de la Patience [Mist']
Date d'inscription : 10/08/2009

Re: Faire un boomerang (arme).

le Mer 7 Oct 2009 - 17:30
Bon , ça a été chaud mais j'ai réussi ....

J'ai adapté 2 scripts de yanfly .

script numéro 1
appele le par exemple "Extra equipement" .

Spoiler:
#===============================================================================
#
# Yanfly Engine RD - Extra Equipment Options ReDONE
# Last Date Updated: 2009.06.14
# Level: Normal, Hard
#
# This is a rewrite of my former Extra Equipment Options script so if you have
# that one, discard it and use this one. This script provides equipment more
# flexibility and options.
#
# BONUS STATS
# By default, VX gave equipment a maximum stat increase of 500. For those who
# love insanely huge numbers or has a game that provides insanely huge numbers,
# equipment creation becomes a problem. The script allows you to bypass the
# maximum increase and also allows you to give equipment stat boosts to MaxHP,
# MaxMP, Hit, Eva, Cri, and Odds, which weren't originally available.
#
# TRAITS
# Some equipment traits were limited to just weapons or armours. Some weren't
# even available at all. Equipment traits will allow you give weapons and armour
# more traits than what was originally available for them such as autobattling
# and auto-states.
#
# REQUIREMENTS
# If you don't want equipment to be worn immediately right away, you can set
# certain requirements on them to be met first before allowing actors to wear
# them. Should at any time the actor fall below the requirements, the pieces
# of unwearable equipment will be purged.
#
# CURSED ITEMS
# Some items can now curse equipment slots. If a piece of equipment is cursed,
# the player cannot unequip it until the actor is purified or an event manually
# changes the equipment worn.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.06.06 - Improved efficiency when checking equipment purging.
# o 2009.06.02 - Added percentile increase.
# o 2009.06.01 - Started version 2.0 and finished.
# o 2009.04.26 - Temporarily removed buggy features.
# o 2009.04.23 - Started on script and finished.
#===============================================================================
# Instructions
#===============================================================================
#
# The following tags go into your weapon and armour's noteboxes.
#
#
# This will raise the stat by x value. If "+" then x will increase. If "-"
# then x will decrease. The "stat" can be replaced by maxhp, maxmp, atk, def,
# spi, agi, hit, eva, cri, or odds. This also lets you surpass the default 500
# value limit when using x.

#
# This will raise the stat by x percent. If "+" then x will increase. If "-"
# then x will decrease. The "stat" can be replaced by maxhp, maxmp, atk, def,
# spi, agi, hit, eva, cri, or odds. will raise atk by 5%.
#
#
# This will allow you to give your actors specific traits when equipping a piece
# of equipment. Add more of the tag to have more traits. Traits are as follows:
# auto battle => Makes the actor automatically fight in battle
# super guard => Gives the actor more damage reduction when guarding
# pharmacology => Items used by the actor give double effect
# fast attack => Actor attacks faster in battle
# dual attack => Actor attacks twice in battle
# prevent cri => Actor cannot suffer critical hits
# half mp cost => Actor consumes half mp when casting skills
# double exp => Actor gains double exp in battle
# auto hp rec => Actor regenerates HP in battle
#
# or
# This will automatically place state x on your actors when that piece of
# equipment is worn. To make a piece of equipment have more than one auto state,
# place more of the autostate tags or use the x,x tag.
#
#
# This will cause the piece of equipment to require more than x amount of stat
# before it can be worn. The "stat" can be replaced by maxhp, maxmp, atk, def,
# spi, agi, hit, eva, cri, or odds.
#
#
# This will cause the piece of equipment to require less than x amount of stat
# before it can be worn. The "stat" can be replaced by maxhp, maxmp, atk, def,
# spi, agi, hit, eva, cri, or odds.
#
# or
# This will cause the piece of equipment to requires the switches x to be on
# before it can be worn. To require multiple switches, add more tags or use the
# x,x tag instead.
#
#
# When the actor equips this item, the equipment slot will become cursed until
# the item is unequipped through an event or a purifying item is used on the
# actor. Once purified, the cursed equipment will still be on the actor, still
# provide stat bonuses, but can be finally unequipped. Note that actors only
# become cursed when the player equips the item. If the item is equipped via
# event, it will not be cursed. You can also force curse a slot by using the
# following event script: $game_actors[1].set_cursed_slot(0)
#
#
# NOTE: This is for usable items only. This will completely uncurse the target
# ally and any cursed equipment previously on the before-cursed ally can now be
# unequipped. Cursed equipment stat bonuses still remain. For those who would
# like to event script purification, it's $game_actors[1].purify_curses
#
#===============================================================================
#
# Compatibility
# - Works With: KGC's EquipExtension, ExtendedEquipScene
# - Alias: Game_Battler: states, stats=, item_effect, item_test
# - Alias: Game_Actor: base_stats, HECO, level_up, level_down, traits
# - Alias: Game_Actor: change_equip
# - Alias: Game_Interpreter: command_121
# - Alias: Scene_Equip: update, update_equip_selection, update_item_selection
#
#===============================================================================

$imported = {} if $imported == nil
$imported["ExtraEquipmentOptions"] = true

module YE
module EQUIP

# Set this option to true if you want unequippable items to be purged
# each time after a change in levels, stats, or switches.
PURGE_UNEQUIPPABLE_ITEMS = true

# This determines whether or not equipment will purge in battle. I highly
# recommend that you don't enable this.
ALLOW_PURGE_IN_BATTLE = false

# This pops up a window to alert the player that a cursed item has been
# equipped on the actor. Also, you may adjust other settings here, too.
CURSED_WINDOW = true
CURSED_SOUND = RPG::SE.new("Down", 80, 150)
CURSED_WIDTH = 360
CURSED_WIN_Y = 180
CURSED_MESSAGE = "%s equips a cursed item!"

end # EQUIP
end # YE

#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================

module YE
module REGEXP
module EQUIP

if $imported["LimitBreak"]
HECOLIMIT = KGC::LimitBreak::ACTOR_PARAMETER_LIMIT
else
HECOLIMIT = 999
end
BONUS_PARAM = /^<(?:BONUS|bonus)[ ]*(.*)[ ]([\+\-]\d+)>/i
BONUS_PARAMP = /^<(?:BONUS|bonus)[ ]*(.*)[ ]([\+\-]\d+)([%%])>/i

REQUIRE_MORE = /^<(?:REQUIRE_MORE|require more)[ ]*(.*)[ ](\d+)>/i
REQUIRE_LESS = /^<(?:REQUIRE_LESS|require less)[ ]*(.*)[ ](\d+)>/i
REQUIRE_SWITCH = /^<(?:REQUIRE_SWITCH|require switch)[ ]*(\d+(?:\s*,\s*\d+)*)>/i

AUTO_STATE = /<(?:AUTO_STATE|auto state|autostate)[ ]*(\d+(?:\s*,\s*\d+)*)>/i

AUTO_BATTLE = /^<(?:TRAIT|trait|bonus trait)[ ](?:AUTO_BATTLE|auto battle)>/i
SUPER_GUARD = /^<(?:TRAIT|trait|bonus trait)[ ](?:SUPER_GUARD|super guard)>/i
ITEM_BOOST = /^<(?:TRAIT|trait|bonus trait)[ ](?:PHARMACOLOGY|item boost)>/i
FAST_ATTACK = /^<(?:TRAIT|trait|bonus trait)[ ](?:FAST_ATTACK|fast attack)>/i
ATTACK_ALL = /^<(?:TRAIT|trait|bonus trait)[ ](?:ATTACK_ALL|attack all)>/i
DUAL_ATTACK = /^<(?:TRAIT|trait|bonus trait)[ ](?:DUAL_ATTACK|dual attack)>/i
PREVENT_CRI = /^<(?:TRAIT|trait|bonus trait)[ ](?:PREVENT_CRI|prevent cri)>/i
HALF_MP_COST = /^<(?:TRAIT|trait|bonus trait)[ ](?:HALF_MP_COST|half mp cost)>/i
DOUBLE_EXP = /^<(?:TRAIT|trait|bonus trait)[ ](?:DOUBLE_EXP|double exp)>/i
AUTO_HP_REC = /^<(?:TRAIT|trait|bonus trait)[ ](?:AUTO_HP_REC|auto_hp_rec)>/i

CURSED_ITEM = /^<(?:CURSED_ITEM|cursed item|cursed)>/i
PURIFY_ITEM = /^<(?:PURIFY_ITEM|purify item|purify)>/i

end
end
end

#===============================================================================
# RPG::BaseItem
#===============================================================================

class RPG::BaseItem

#--------------------------------------------------------------------------
# Yanfly_Cache_BaseItem_EEO
#--------------------------------------------------------------------------
def yanfly_cache_baseitem_eeo
@requirements = false
@bonus_param = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0, :spi => 0,
:agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0 }
@bonus_paramp = { :maxhp => 100, :maxmp => 100, :atk => 100, :def => 100,
:spi => 100, :agi => 100, :hit => 100, :eva => 100, :cri => 100, :odds => 100 }
@require_more = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0, :spi => 0,
:agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0, :level => 0, :switch => false }
@require_less = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0, :spi => 0,
:agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0, :level => 0, :switch => false }
@bonus_trait = []; @require_switch = []; @auto_state = []; @cursed = false
@purify = false

self.note.split(/[\r\n]+/).each { |line|
case line
when YE::REGEXP::EQUIP::BONUS_PARAM
case $1.to_s
when "maxhp","MAXHP"; @bonus_param[:maxhp] += $2.to_i
when "maxmp","MAXMP"; @bonus_param[:maxmp] += $2.to_i
when "atk","ATK"; @bonus_param[:atk] += $2.to_i
when "def","DEF"; @bonus_param[:def] += $2.to_i
when "spi","SPI"; @bonus_param[:spi] += $2.to_i
when "agi","AGI"; @bonus_param[:agi] += $2.to_i
when "hit","HIT"; @bonus_param[:hit] += $2.to_i
when "eva","EVA"; @bonus_param[:eva] += $2.to_i
when "cri","CRI"; @bonus_param[:cri] += $2.to_i
when "odds","ODDS"; @bonus_param[:odds] += $2.to_i
end
when YE::REGEXP::EQUIP::BONUS_PARAMP
case $1.to_s
when "maxhp","MAXHP"; @bonus_paramp[:maxhp] += $2.to_i
when "maxmp","MAXMP"; @bonus_paramp[:maxmp] += $2.to_i
when "atk","ATK"; @bonus_paramp[:atk] += $2.to_i
when "def","DEF"; @bonus_paramp[:def] += $2.to_i
when "spi","SPI"; @bonus_paramp[:spi] += $2.to_i
when "agi","AGI"; @bonus_paramp[:agi] += $2.to_i
when "hit","HIT"; @bonus_paramp[:hit] += $2.to_i
when "eva","EVA"; @bonus_paramp[:eva] += $2.to_i
when "cri","CRI"; @bonus_paramp[:cri] += $2.to_i
when "odds","ODDS"; @bonus_paramp[:odds] += $2.to_i
end

when YE::REGEXP::EQUIP::AUTO_BATTLE
@bonus_trait.push("auto battle")
when YE::REGEXP::EQUIP::SUPER_GUARD
@bonus_trait.push("super guard")
when YE::REGEXP::EQUIP::ITEM_BOOST
@bonus_trait.push("item boost")
when YE::REGEXP::EQUIP::FAST_ATTACK
@bonus_trait.push("fast attack")
when YE::REGEXP::EQUIP::ATTACK_ALL
@bonus_trait.push("attack all")
when YE::REGEXP::EQUIP::DUAL_ATTACK
@bonus_trait.push("dual attack")
when YE::REGEXP::EQUIP::PREVENT_CRI
@bonus_trait.push("prevent cri")
when YE::REGEXP::EQUIP::HALF_MP_COST
@bonus_trait.push("half mp cost")
when YE::REGEXP::EQUIP::DOUBLE_EXP
@bonus_trait.push("double exp")
when YE::REGEXP::EQUIP::AUTO_HP_REC
@bonus_trait.push("auto hp rec")

when YE::REGEXP::EQUIP::REQUIRE_MORE
@requirements = true
@require_more[:switch] = true
case $1.to_s
when "level","LEVEL"; @require_more[:level] = $2.to_i
when "maxhp","MAXHP"; @require_more[:maxhp] = $2.to_i
when "maxmp","MAXMP"; @require_more[:maxmp] = $2.to_i
when "atk","ATK"; @require_more[:atk] = $2.to_i
when "def","DEF"; @require_more[:def] = $2.to_i
when "spi","SPI"; @require_more[:spi] = $2.to_i
when "agi","AGI"; @require_more[:agi] = $2.to_i
when "hit","HIT"; @require_more[:hit] = $2.to_i
when "eva","EVA"; @require_more[:eva] = $2.to_i
when "cri","CRI"; @require_more[:cri] = $2.to_i
when "odds","ODDS"; @require_more[:odds] = $2.to_i
end
when YE::REGEXP::EQUIP::REQUIRE_LESS
@requirements = true
@require_less[:switch] = true
case $1.to_s
when "level","LEVEL"; @require_less[:level] = $2.to_i
when "maxhp","MAXHP"; @require_less[:maxhp] = $2.to_i
when "maxmp","MAXMP"; @require_less[:maxmp] = $2.to_i
when "atk","ATK"; @require_less[:atk] = $2.to_i
when "def","DEF"; @require_less[:def] = $2.to_i
when "spi","SPI"; @require_less[:spi] = $2.to_i
when "agi","AGI"; @require_less[:agi] = $2.to_i
when "hit","HIT"; @require_less[:hit] = $2.to_i
when "eva","EVA"; @require_less[:eva] = $2.to_i
when "cri","CRI"; @require_less[:cri] = $2.to_i
when "odds","ODDS"; @require_less[:odds] = $2.to_i
end
when YE::REGEXP::EQUIP::REQUIRE_SWITCH
$1.scan(/\d+/).each { |num|
if num.to_i > 0
@require_switch.push(num.to_i)
end }
when YE::REGEXP::EQUIP::AUTO_STATE
$1.scan(/\d+/).each { |num|
if num.to_i > 0
@auto_state.push(num.to_i)
end }
when YE::REGEXP::EQUIP::CURSED_ITEM
@cursed = true
when YE::REGEXP::EQUIP::PURIFY_ITEM
@purify = true
end
}
end

#--------------------------------------------------------------------------
# Definitions
#--------------------------------------------------------------------------
def bonus_param
yanfly_cache_baseitem_eeo if @bonus_param == nil
return @bonus_param
end
def bonus_paramp
yanfly_cache_baseitem_eeo if @bonus_paramp == nil
return @bonus_paramp
end
def bonus_trait
yanfly_cache_baseitem_eeo if @bonus_trait == nil
return @bonus_trait
end
def requirements
yanfly_cache_baseitem_eeo if @requirements == nil
return @requirements
end
def require_more
yanfly_cache_baseitem_eeo if @require_more == nil
return @require_more
end
def require_less
yanfly_cache_baseitem_eeo if @require_less == nil
return @require_less
end
def require_switch
yanfly_cache_baseitem_eeo if @require_switch == nil
return @require_switch
end
def auto_state
yanfly_cache_baseitem_eeo if @auto_state == nil
return @auto_state
end
def cursed
yanfly_cache_baseitem_eeo if @cursed == nil
return @cursed
end
def purify
yanfly_cache_baseitem_eeo if @purify == nil
return @purify
end

end # RPG::BaseItem

#===============================================================================
# Game Battler
#===============================================================================

class Game_Battler

#--------------------------------------------------------------------------
# alias states
#--------------------------------------------------------------------------
alias states_eeo states unless $@
def states
result = states_eeo
if self.actor?
for state_id in self.equipment_auto_states
unless result.include?($data_states[state_id])
result.push($data_states[state_id])
end
end
end
result.sort! { |a, b| b.priority <=> a.priority }
return result
end

#--------------------------------------------------------------------------
# alias remove_state
#--------------------------------------------------------------------------
alias remove_state_eeo remove_state unless $@
def remove_state(state_id)
return if self.actor? and self.equipment_auto_states.include?(state_id)
remove_state_eeo(state_id)
end

#--------------------------------------------------------------------------
# overwrite state?
#--------------------------------------------------------------------------
def state?(state_id)
return states.include?($data_states[state_id])
end

#--------------------------------------------------------------------------
# alias maxhp=
#--------------------------------------------------------------------------
alias maxhpset_eeo maxhp= unless $@
def maxhp=(newvalue)
maxhpset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias maxmp=
#--------------------------------------------------------------------------
alias maxmpset_eeo maxmp= unless $@
def maxmp=(newvalue)
maxmpset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias atk=
#--------------------------------------------------------------------------
alias atkset_eeo atk= unless $@
def atk=(newvalue)
atkset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias def=
#--------------------------------------------------------------------------
alias defset_eeo def= unless $@
def def=(newvalue)
defset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias spi=
#--------------------------------------------------------------------------
alias spiset_eeo spi= unless $@
def spi=(newvalue)
spiset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias agi=
#--------------------------------------------------------------------------
alias agiset_eeo agi= unless $@
def agi=(newvalue)
agiset_eeo(newvalue)
self.purge_unequippables if self.actor?
end

#--------------------------------------------------------------------------
# alias item_effect
#--------------------------------------------------------------------------
alias item_effect_eeo item_effect unless $@
def item_effect(user, item)
clear_action_results
if item.purify and self.actor?
self.purify_curses
end
item_effect_eeo(user, item)
end

#--------------------------------------------------------------------------
# alias item_test
#--------------------------------------------------------------------------
alias item_test_eeo item_test unless $@
def item_test(user, item)
return true if item.purify and self.actor?
return item_test_eeo(user, item)
end

end

#===============================================================================
# Game Actor
#===============================================================================

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------
# alias base maxhp
#--------------------------------------------------------------------------
alias base_maxhp_eeo base_maxhp unless $@
def base_maxhp
n = base_maxhp_eeo
equips.compact.each { |item|
n += item.bonus_param[:maxhp]
n *= item.bonus_paramp[:maxhp] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias base maxmp
#--------------------------------------------------------------------------
alias base_maxmp_eeo base_maxmp unless $@
def base_maxmp
n = base_maxmp_eeo
equips.compact.each { |item|
n += item.bonus_param[:maxmp]
n *= item.bonus_paramp[:maxmp] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias base atk
#--------------------------------------------------------------------------
alias base_atk_eeo base_atk unless $@
def base_atk
n = base_atk_eeo
equips.compact.each { |item|
n += item.bonus_param[:atk]
n *= item.bonus_paramp[:atk] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias base def
#--------------------------------------------------------------------------
alias base_def_eeo base_def unless $@
def base_def
n = base_def_eeo
equips.compact.each { |item|
n += item.bonus_param[:def]
n *= item.bonus_paramp[:def] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias base spi
#--------------------------------------------------------------------------
alias base_spi_eeo base_spi unless $@
def base_spi
n = base_spi_eeo
equips.compact.each { |item|
n += item.bonus_param[:spi]
n *= item.bonus_paramp[:spi] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias base agi
#--------------------------------------------------------------------------
alias base_agi_eeo base_agi unless $@
def base_agi
n = base_agi_eeo
equips.compact.each { |item|
n += item.bonus_param[:agi]
n *= item.bonus_paramp[:agi] / 100.0
}
return Integer(n)
end

#--------------------------------------------------------------------------
# alias hit
#--------------------------------------------------------------------------
alias hit_eeo hit unless $@
def hit
n = hit_eeo
equips.compact.each { |item|
n += item.bonus_param[:hit]
n *= item.bonus_paramp[:hit] / 100.0
}
limit = YE::REGEXP::EQUIP::HECOLIMIT
n = [[Integer(n), 0].max, limit].min
return n
end

#--------------------------------------------------------------------------
# alias eva
#--------------------------------------------------------------------------
alias eva_eeo eva unless $@
def eva
n = eva_eeo
equips.compact.each { |item|
n += item.bonus_param[:eva]
n *= item.bonus_paramp[:eva] / 100.0
}
limit = YE::REGEXP::EQUIP::HECOLIMIT
n = [[Integer(n), 0].max, limit].min
return n
end

#--------------------------------------------------------------------------
# alias cri
#--------------------------------------------------------------------------
alias cri_eeo cri unless $@
def cri
n = cri_eeo
equips.compact.each { |item|
n += item.bonus_param[:cri]
n *= item.bonus_paramp[:cri] / 100.0
}
limit = YE::REGEXP::EQUIP::HECOLIMIT
n = [[Integer(n), 0].max, limit].min
return n
end

#--------------------------------------------------------------------------
# alias odds
#--------------------------------------------------------------------------
alias odds_eeo odds unless $@
def odds
n = odds_eeo
equips.compact.each { |item|
n += item.bonus_param[:odds]
n *= item.bonus_paramp[:odds] / 100.0
}
limit = YE::REGEXP::EQUIP::HECOLIMIT
n = [[Integer(n), 0].max, limit].min
return n
end

#--------------------------------------------------------------------------
# alias level_up
#--------------------------------------------------------------------------
alias level_up_eeo level_up unless $@
def level_up
level_up_eeo
purge_unequippables
end

#--------------------------------------------------------------------------
# alias level_down
#--------------------------------------------------------------------------
alias level_down_eeo level_down unless $@
def level_down
level_down_eeo
purge_unequippables
end

#--------------------------------------------------------------------------
# alias auto_battle
#--------------------------------------------------------------------------
alias auto_battle_eeo auto_battle unless $@
def auto_battle
for item in equips.compact
return true if item.bonus_trait.include?("auto battle")
end
return auto_battle_eeo
end

#--------------------------------------------------------------------------
# alias super_guard
#--------------------------------------------------------------------------
alias super_guard_eeo super_guard unless $@
def super_guard
for item in equips.compact
return true if item.bonus_trait.include?("super guard")
end
return super_guard_eeo
end

#--------------------------------------------------------------------------
# alias pharmacology
#--------------------------------------------------------------------------
alias pharmacology_eeo pharmacology unless $@
def pharmacology
for item in equips.compact
return true if item.bonus_trait.include?("item boost")
end
return pharmacology_eeo
end

#--------------------------------------------------------------------------
# alias fast_attack
#--------------------------------------------------------------------------
alias fast_attack_eeo fast_attack unless $@
def fast_attack
for item in equips.compact
return true if item.bonus_trait.include?("fast attack")
end
return fast_attack_eeo
end

#--------------------------------------------------------------------------
# alias attack_all
#--------------------------------------------------------------------------
# alias fast_attack_eeo fast_attack unless $@
def attack_all
for item in equips.compact
return true if item.bonus_trait.include?("attack all")
end
return false
end

#--------------------------------------------------------------------------
# alias dual_attack
#--------------------------------------------------------------------------
alias dual_attack_eeo dual_attack unless $@
def dual_attack
for item in equips.compact
return true if item.bonus_trait.include?("dual attack")
end
return dual_attack_eeo
end

#--------------------------------------------------------------------------
# alias prevent_critical
#--------------------------------------------------------------------------
alias prevent_critical_eeo prevent_critical unless $@
def prevent_critical
for item in equips.compact
return true if item.bonus_trait.include?("prevent cri")
end
return prevent_critical_eeo
end

#--------------------------------------------------------------------------
# alias half_mp_cost
#--------------------------------------------------------------------------
alias half_mp_cost_eeo half_mp_cost unless $@
def half_mp_cost
for item in equips.compact
return true if item.bonus_trait.include?("half mp cost")
end
return half_mp_cost_eeo
end

#--------------------------------------------------------------------------
# alias double_exp_gain
#--------------------------------------------------------------------------
alias double_exp_gain_eeo double_exp_gain unless $@
def double_exp_gain
for item in equips.compact
return true if item.bonus_trait.include?("double exp")
end
return double_exp_gain_eeo
end

#--------------------------------------------------------------------------
# alias auto_hp_recover
#--------------------------------------------------------------------------
alias auto_hp_recover_eeo auto_hp_recover unless $@
def auto_hp_recover
for item in equips.compact
return true if item.bonus_trait.include?("auto hp rec")
end
return auto_hp_recover_eeo
end

#--------------------------------------------------------------------------
# alias equippable?
#--------------------------------------------------------------------------
alias equippable_eeo equippable? unless $@
def equippable?(item)
if item.is_a?(RPG::Weapon) or item.is_a?(RPG::Armor)
return false unless meet_requirements(item)
end
return equippable_eeo(item)
end

#--------------------------------------------------------------------------
# meet_requirements
#--------------------------------------------------------------------------
def meet_requirements(item)
return true unless item.requirements
for switch_id in item.require_switch
return false unless $game_switches[switch_id]
end
if item.require_more[:switch] = true
return false if self.level <= item.require_more[:level]
return false if self.maxhp <= item.require_more[:maxhp]
return false if self.maxmp <= item.require_more[:maxmp]
return false if self.atk <= item.require_more[:atk]
return false if self.def <= item.require_more[:def]
return false if self.spi <= item.require_more[:spi]
return false if self.agi <= item.require_more[:agi]
return false if self.hit <= item.require_more[:hit]
return false if self.eva <= item.require_more[:eva]
return false if self.odds <= item.require_more[:odds]
end
#---
if item.require_less[:switch] = true
return false if self.level >= item.require_less[:level] and
item.require_less[:level] != 0
return false if self.maxhp >= item.require_less[:maxhp] and
item.require_less[:maxhp] != 0
return false if self.maxmp >= item.require_less[:maxmp] and
item.require_less[:maxmp] != 0
return false if self.atk >= item.require_less[:atk] and
item.require_less[:atk] != 0
return false if self.def >= item.require_less[:def] and
item.require_less[:def] != 0
return false if self.spi >= item.require_less[:spi] and
item.require_less[:spi] != 0
return false if self.agi >= item.require_less[:agi] and
item.require_less[:agi] != 0
return false if self.hit >= item.require_less[:hit] and
item.require_less[:hit] != 0
return false if self.eva >= item.require_less[:eva] and
item.require_less[:eva] != 0
return false if self.cri >= item.require_less[:cri] and
item.require_less[:cri] != 0
return false if self.odds >= item.require_less[:odds] and
item.require_less[:odds] != 0
end
#---
return true
end

#--------------------------------------------------------------------------
# purge_unequippables
#--------------------------------------------------------------------------
def purge_unequippables(test = false)
return unless YE::EQUIP::PURGE_UNEQUIPPABLE_ITEMS
return if $game_temp.in_battle and !YE::EQUIP::ALLOW_PURGE_IN_BATTLE
@purge_on = true
for i in 0..4
change_equip(i, nil, test) unless equippable?(equips[i])
end
if $imported["EquipExtension"]
return if extra_armor_number == 0
for i in 5..armor_number
change_equip(i, nil, test) unless equippable?(equips[i])
end
end
@purge_on = nil
end

#--------------------------------------------------------------------------
# alias change_equip
#--------------------------------------------------------------------------
alias change_equip_eeo change_equip unless $@
def change_equip(equip_type, item, test = false)
change_equip_eeo(equip_type, item, test)
if $imported["ExtendedEquipScene"] or $imported["SceneEquipReDux"]
purge_unequippables(test) if @purge_on != true and !test
else
purge_unequippables(test) if @purge_on != true and !test
end
end

#--------------------------------------------------------------------------
# equipment_auto_states
#--------------------------------------------------------------------------
def equipment_auto_states
result = []
if $game_temp.in_battle
for item in equips.compact
for state_id in item.auto_state
result.push(state_id)
end
end
else
for item in equips.compact
for state_id in item.auto_state
result.push(state_id) unless $data_states[state_id].battle_only
end
end
end
return result.uniq
end

#--------------------------------------------------------------------------
# cursed_slot
#--------------------------------------------------------------------------
def cursed_slot?(slot)
@cursed_slot = {} if @cursed_slot == nil
@cursed_slot[slot] = false if @cursed_slot[slot] == nil
return @cursed_slot[slot]
end

#--------------------------------------------------------------------------
# set_cursed_slot
#--------------------------------------------------------------------------
def set_cursed_slot(slot, curse = true)
@cursed_slot = {} if @cursed_slot == nil
@cursed_slot[slot] = curse
end

#--------------------------------------------------------------------------
# purify_curses
#--------------------------------------------------------------------------
def purify_curses
@cursed_slot = {}
end

end # Game_Actor

#===============================================================================
# Scene_Equip
#===============================================================================

class Scene_Equip < Scene_Base

#--------------------------------------------------------------------------
# alias update
#--------------------------------------------------------------------------
alias update_equip_eeo update unless $@
def update
if @cursed_window != nil
update_cursed_window
else
update_equip_eeo
end
end

#--------------------------------------------------------------------------
# alias update_equip_selection
#--------------------------------------------------------------------------
alias update_equip_selection_eeo update_equip_selection unless $@
def update_equip_selection
if Input.trigger?(Input::C) and cursed_slot?
Sound.play_buzzer
return
elsif Input.trigger?(Input::A) and cursed_slot?
Sound.play_buzzer
return
end
update_equip_selection_eeo
end

#--------------------------------------------------------------------------
# alias update_item_selection
#--------------------------------------------------------------------------
alias update_item_selection_eeo update_item_selection unless $@
def update_item_selection
if Input.trigger?(Input::C)
if @item_window.item != nil and @item_window.item.cursed
@actor.set_cursed_slot(@equip_window.index)
create_cursed_window
end
end
update_item_selection_eeo
end

#--------------------------------------------------------------------------
# update_cursed_window
#--------------------------------------------------------------------------
def update_cursed_window
if Input.trigger?(Input::C) or Input.trigger?(Input::B)
@cursed_window.dispose
@cursed_window = nil
end
end

#--------------------------------------------------------------------------
# cursed_slot?
#--------------------------------------------------------------------------
def cursed_slot?
if @equip_window.item == nil
@actor.set_cursed_slot(@equip_window.index, false)
end
if @actor.cursed_slot?(@equip_window.index)
if @equip_window.item.cursed
return true
else
@actor.set_cursed_slot(@equip_window.index, false)
end
end
return false
end

#--------------------------------------------------------------------------
# create_cursed_window
#--------------------------------------------------------------------------
def create_cursed_window
return unless YE::EQUIP::CURSED_WINDOW
dx = (544 - YE::EQUIP::CURSED_WIDTH) / 2
dy = YE::EQUIP::CURSED_WIN_Y
dw = YE::EQUIP::CURSED_WIDTH
text = sprintf(YE::EQUIP::CURSED_MESSAGE, @actor.name)
@cursed_window = Window_Base.new(dx, dy, dw, 56)
@cursed_window.back_opacity = 255
@cursed_window.contents.draw_text(4, 0, dw-40, 24, text, 1)
YE::EQUIP::CURSED_SOUND.play if YE::EQUIP::CURSED_SOUND != nil
end

end # Scene_Equip

#===============================================================================
#
# END OF FILE
#
#===============================================================================

Voila le script d'origine :
http://pockethouse.wordpress.com/vx/extra-equipment-options/
Comme tu peux voir , en utilisant la zone "Commentaires" d'une arme ou armure , tu peux faire plein de trucs .
J'ai ajouté une option : met "bonus trait attack all" (Avec <> à la place de "") dans le commentaire de ton boomerang et ça marche (testé!!) .


Spoiler:

#===============================================================================
#
# Yanfly Engine RD - Custom Battle Actions
# Last Date Updated: 2009.06.25
# Level: Normal
#
# For those who would like to have more than just Attack, Skill, Guard, and
# Item for their actions in their list, this script allows just that. You can
# rearrange the ordering of the actions, bind new custom actions to skills,
# and even incorporate subskill actions into the individual command lists.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.06.25 - Bug fix for enemy targetting cancel selection.
# o 2009.06.23 - Compatibility update with Custom Skill Effects Upgrade 3.
# o 2009.06.21 - Bug fix for ally targetting custom skill cancel.
# o 2009.05.28 - Started script and finished.
#===============================================================================
# Instructions
#===============================================================================
#
# Scroll down below and modify the module to reflect how you would like the
# battle commands to appear for each class-type.
#
#===============================================================================
#
# Compatibility
# - Works With: Yanfly Custom Skill Effects
# - Alias: Game_Actor: skill_can_use?
# - Overwrites: Scene_Battle, execute_action_wait, update_actor_command
# - Overwrites: Window_ActorCommand: all of it
#
#===============================================================================

$imported = {} if $imported == nil
$imported["CustomBattleActions"] = true

module YE
module BATTLE
module COMMANDS

ATTACK_ALL_SKILL = 83

#------------------------------------------------------------------------
# CLASS COMMANDS
#------------------------------------------------------------------------
# This following section will adjust commands for individual classes. If
# a class ID is not included, it will take out the commands from class 0.
# With that said, do not remove class 0.
#
# There are a few commands verbal commands reserved for the command hash.
# "-Attack" - Reserved for basic attacking.
# "-Skill" - Reserved for selecting skills.
# "-Guard" - Reserved for guarding.
# "-Item" - Reserved for using items.
# "-Wait" - Reserved for the wait command.
# "-Subclass" - Reserved for subclass skills.
# "" - If empty, skip it.
#
# If you input other commands, be sure to spell them correctly as they
# will reflect upon how it appears in game.
#------------------------------------------------------------------------
# Note that class commands will be determined by the character's primary
# class if you're using the Subclass Selection System.
#------------------------------------------------------------------------
CLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO!
# ClassID => [ Actions, Actions, Actions...]
0 => ["-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
1 => ["All-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
#1 => ["X-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
} # Do not remove this.

# This following hash will determine what commands to replace when the
# "-Subclass" command is inputted into the array of commands. If the
# subclass's ID does not appear in this array, then it will return 0.
SUBCLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO!
# ClassID => Name
0 => "",
2 => "X-Attack",
5 => "Light",
6 => "Darkness",
7 => "3-Attack",
} # Do not remove this.

# The following hash allows you to adjust which custom commands to bind
# to which skills for the actions to come out of. The custom actions will
# still consume HP/MP/Rage. If it's unusable, then it'll be greyed out.
CUSTOM_COMMANDS ={ # Follow the example.
# -Command Name- => Skill.ID
"All-Attack" => 83,
} # Do not remove this.

# For those who use "-Wait" and would like to change how Wait appears,
# adjust the value below. Also following is how the action takes place.
WAIT_VOCAB = "Attendre"
ACTION_WAIT = "%s Attends." # Set to nil to not show wait.

end # COMMANDS
end # BATTLE
end # YE

#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================

module Vocab
DoWait = YE::BATTLE::COMMANDS::ACTION_WAIT
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------
# Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :custom_action_flag

#--------------------------------------------------------------------------
# alias skill_can_use?
#--------------------------------------------------------------------------
alias skill_can_use_cba skill_can_use? unless $@
def skill_can_use?(skill)
if @custom_action_flag == true
return super
else
return skill_can_use_cba(skill)
end
end

end

#===============================================================================
# Scene_Battle
#===============================================================================

class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# alias execute_action_wait
#--------------------------------------------------------------------------
alias execute_action_wait_cba execute_action_wait unless $@
def execute_action_wait
if Vocab::DoWait != nil
execute_action_wait_cba
end
end

#--------------------------------------------------------------------------
# alias end_target_enemy_selection
#--------------------------------------------------------------------------
alias end_target_enemy_selection_cba end_target_enemy_selection unless $@
def end_target_enemy_selection
end_target_enemy_selection_cba
if @skill_window == nil
@actor_command_window.active = true
end
end

#--------------------------------------------------------------------------
# alias end_target_actor_selection
#--------------------------------------------------------------------------
alias end_target_actor_selection_cba end_target_actor_selection unless $@
def end_target_actor_selection
end_target_actor_selection_cba
if @skill_window == nil
@actor_command_window.active = true
end
end

#--------------------------------------------------------------------------
# alias update actor command selection
#--------------------------------------------------------------------------
alias update_actor_command_selection_cba update_actor_command_selection unless $@
def update_actor_command_selection
if Input.trigger?(Input::C)
if $imported["CustomSkillEffects"]
@active_battler.reset_mix_items
@active_battler.subskill_flag = nil
@active_battler.set_chain
end
determine_actor_command
else
update_actor_command_selection_cba
end
end

#--------------------------------------------------------------------------
# new method determine actor command
#--------------------------------------------------------------------------
def determine_actor_command
@active_battler.custom_action_flag = false
command = @actor_command_window.command
case command
when "-Attack"
Sound.play_decision
@active_battler.action.set_attack
start_target_enemy_selection
when "-Skill"
Sound.play_decision
start_skill_selection
when "-Guard"
Sound.play_decision
@active_battler.action.set_guard
next_actor
when "-Item"
Sound.play_decision
start_item_selection
when "-Wait"
Sound.play_decision
@active_battler.action.kind = 0
@active_battler.action.basic = 3
next_actor
else
unless YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(command)
Sound.play_buzzer
else
@active_battler.custom_action_flag = true
@skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[command]]
if @active_battler.skill_can_use?(@skill)
Sound.play_decision
if $imported["CustomSkillEffects"] and @skill.mix_items
start_skill_selection
create_mix_item_windows
elsif $imported["CustomSkillEffects"] and @skill.subskills != []
start_skill_selection
create_subskill_windows
elsif $imported["CustomSkillEffects"] and @skill.chain_type > 0
start_skill_selection
create_chain_windows
elsif $imported["CustomSkillEffects"] and @skill.throw_skill
start_skill_selection
create_throw_windows
else
determine_custom_action
end
else
Sound.play_buzzer
end
end
end
end

#--------------------------------------------------------------------------
# determine_custom_action
#--------------------------------------------------------------------------
def determine_custom_action
@active_battler.action.set_skill(@skill.id)
if @skill.need_selection?
if @skill.for_opponent?
start_target_enemy_selection
else
start_target_actor_selection
end
else
next_actor
end
end

end # Scene_Battle

#===============================================================================
# Window_ActorCommand
#===============================================================================

class Window_ActorCommand < Window_Selectable

#--------------------------------------------------------------------------
# overwrite initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, 128, 128)
self.active = false
end

#--------------------------------------------------------------------------
# overwrite setup
#--------------------------------------------------------------------------
def setup(actor)
@actor = actor
@commands = []
if @actor.attack_all == true
array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[1]
else
array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[0]
end
for command in array
if command == "-Subclass"
if subclass_check?
command = YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS[@actor.subclass.id]
else
command = ""
end
end
@commands.push(command) unless command == ""
end
@item_max = @commands.size
refresh
self.index = 0
end

#--------------------------------------------------------------------------
# subclass check
#--------------------------------------------------------------------------
def subclass_check?
return false unless $imported["SubclassSelectionSystem"]
return false if @actor.subclass == nil
sub_id = @actor.subclass_id
return false if !YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS.include?(sub_id)
return true
end

#--------------------------------------------------------------------------
# overwrite refresh
#--------------------------------------------------------------------------
def refresh
create_contents
for i in 0...@item_max
draw_item(i)
end
end

#--------------------------------------------------------------------------
# return command
#--------------------------------------------------------------------------
def command
return @commands[self.index]
end

#--------------------------------------------------------------------------
# new method draw item
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
cmd = @commands[index]
#---
case cmd
when "-Attack"
text = Vocab::attack
when "-Skill"
if @actor.class.skill_name_valid
text = @actor.class.skill_name
else
text = Vocab::skill
end
when "-Guard"
text = Vocab::guard
when "-Item"
text = Vocab::item
when "-Wait"
text = YE::BATTLE::COMMANDS::WAIT_VOCAB
else
text = cmd
if YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(cmd)
skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[cmd]]
@actor.custom_action_flag = true
enabled = @actor.skill_can_use?(skill)
@actor.custom_action_flag = false
else
enabled = false
end
end
#---
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text)
end

end # Window_ActorCommand

#===============================================================================
#
# END OF FILE
#
#===============================================================================

Le deuxieme appele le par exemple "Custom battle action"


Par contre , je ne sais pas si ça marche avec le SBS ou avec un autre script ... à tes risques et périls !!!
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Re: Faire un boomerang (arme).

le Mer 7 Oct 2009 - 17:51
Là je ne suis pas chez moi, je testerai demain...
En tout cas les mecs, un grand merci à vous deux !
avatar
dricc
Membre

Nombre de messages : 2756
Localisation : Lille
Distinction : Altruiste - Incarnation de la Patience [Mist']
Date d'inscription : 10/08/2009

Re: Faire un boomerang (arme).

le Ven 9 Oct 2009 - 13:47
Alors , ça marche ?

A propos , je me suis aperçu que j'avais oublié de traduire pas mal de truc ...

Notemment dans le deuxieme script :
1 => ["All-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
devient
1 => ["Attaque tous", "-Skill", "-Subclass", "-Guard", "-Item"],

et
"All-Attack" => 83,
devient
"Attaque tous" => 83,

Et j'ai oublié aussi de dire que tu dois créer une nouvelle compétence appelée "Attaque tous" en position 83 (oui , le meme 83 que précédement que tu peux donc changer) .
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Re: Faire un boomerang (arme).

le Mer 14 Oct 2009 - 9:00
Bon alors. Désolé pour ce long silence mais j'ai pas eu trop le temps de "maker" ces derniers temps...
Merci pour ton aide, j'ai tout fait comme tu m'a dit, j'ai aussi fait une anim de combat (un boomerang qui va vers les ennemis, les coups recus et le boomerang qui reviens...) et je l'ai appliqué aussi bien à l'arme qu'a la compétence "attaque tous". La commande "Attaque tous" marche bien. Petit hic, lorsque je lance l'attaque, si il y a plusieurs ennemis, on voit plusieurs boomerangs (un par ennemi) et l'attaque n'aboutit jamais (ils esquivent à chaque fois)... Je ne sais pas où je pourrai régler ça. Une idée ?
avatar
Joeypixel
Membre

Nombre de messages : 172
Distinction : aucune
Date d'inscription : 09/04/2008

Re: Faire un boomerang (arme).

le Mer 28 Oct 2009 - 11:00
Toujours pas ?
Contenu sponsorisé

Re: Faire un boomerang (arme).

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum