Poulet trizo Lv.3
Age : 33 Inscrit le : 25/01/2010 Messages : 40
| Sujet: (combat) choisir le monstre à attaquer avec la souris. Sam 20 Mar 2010 - 23:00 | |
| voila ma demande !
je voudrait un script de combat qui me permette de selectionner le monstre que l'on desire attaquer ou même pour guérir un allier, avec la souris en étant sur pleine écran, merciii !!
amicalemment la casse-pieds de service ! |
|
Poulet trizo Lv.3
Age : 33 Inscrit le : 25/01/2010 Messages : 40
| Sujet: Re: (combat) choisir le monstre à attaquer avec la souris. Lun 31 Jan 2011 - 15:47 | |
| désolée pour le nécro-post mais il faudrait bien qu'on me réponde un jour ou l'autre!!!!
YOUHOU Y'A QUELQUE QU'UN!!! |
|
Habitant Lv.6
Age : 34 Inscrit le : 24/12/2009 Messages : 139
| Sujet: Re: (combat) choisir le monstre à attaquer avec la souris. Mar 1 Fév 2011 - 1:06 | |
| Si en 1 an personne n'a répondu, c'est parce que je pense que ce système n'existe pas encore. En tout cas pas à ma connaissance. |
|
Citadin Lv.7
Age : 123 Inscrit le : 08/04/2010 Messages : 218
| Sujet: Re: (combat) choisir le monstre à attaquer avec la souris. Mar 1 Fév 2011 - 3:26 | |
| Salut dragonflysellen,
Comme Drace l'a déjà dit, il n'y a surement personne qui connait/a fait ce script. Attends encore, peut-être qu'un jour, tu trouveras ton bonheur !
Bonne Chance,
Signer le fanboy de Final Fantasy... |
|
Vache Folle
Age : 29 Inscrit le : 22/05/2010 Messages : 3005
| Sujet: Re: (combat) choisir le monstre à attaquer avec la souris. Mar 1 Fév 2011 - 13:37 | |
| HUm...Il y a un script permettant de faire ce que tu veux mais sans la souris par contre. Le voici: - Code:
-
=begin #================================================================================
Targetting Extended v 1.1
by CrimsonSeas
================================================================================
This is a script I made to extend targettting capabilities.
Features:
+Cibler les alliés ou les ennemis quelque soit l'action. Vous pouvez changer de groupe à cibler
avec les touches L/R lors du choix de la cible.
+Appuyez sur SHIFT pour changer, sélectionner une cible ou le groupe entier.
+Choix des sorts qui ne seront pas concernés.
+Curseurs!! Les curseurs s'affichent lors du choix de cibles multiples.
+Possibilité de réduire les dégâts infligé lorsqu'un sort est appliqué sur un groupe au lieu d'une cible.
================================================================================
Compatibility
================================================================================
I think there may be many issues around this. I'll list rewrites and aliases of
default and Tankentai scripts.
Rewrites:
+Game_Battler
-make_attack_targets
-make_obj_targets
+Sprite_Battler
-moving_anime
Aliases:
+Scene_Battle
-execute_action
+Game_Battler
-make_obj_damage_value
-calc_mp_cost
=================================================================================
CONFIG
================================================================================
=end
module TargetExt
#Attaquer les ennemis ou pas ?
ATTACK_ANY = true
#Compétences qui ne sont pas concernées par le fait de viser alliés ou ennemis. Entrez l'ID du sort dans le [] ( s'il y en a plusieurs, séparez par #une virgule
NO_TARGET_ANY_S = []
#Objets qui ne sont pas concernés par le fait de viser alliés ou ennemis. Entrez l'ID de l'objet dans le [] ( s'il y en a plusieurs, séparez par #une virgule
NO_TARGET_ANY_I = [2]
#Compétences affectées par le fait de passer d'un cible à un groupe ( ou l'inverse ). Entrez l'ID de l'objet dans le [] ( s'il y en a plusieurs, séparez par #une virgule
TARGET_ALL_S = []
#Objets affectés par le fait de passer d'un cible à un groupe ( ou l'inverse ). Entrez l'ID de l'objet dans le [] ( s'il y en a plusieurs, séparez par #une virgule
TARGET_ALL_I = [10,82]
#Définit le pourcentage de dommages qui sera infligé lorsque l'on passera d'un cible unique à un groupe.
DAMAGE_PERCENT = 50
#Pourcentage de MP requis en plus pour cibler le groupe entier.
MP_PERCENT = 175
#Définit le texte qui sera utilisé quand l'on cible plusieurs cibles.
#Le format est : [Texte1, [TexteEquipe, TexteEnnemis]]
#Le texte affiché en combat lorsque le joueur ciblera tous les alliés sera :
# Texte1 TexteEquipe
#Le texte affiché en combat lorsque le joueur ciblera tous les ennemis sera :
# Texte1 TexteEnnemis
TARGET_ALL_VOC = ["Tous les", ["Alliés", "Enemis"]]
#Montrer le cout en MP lors que la commande cibler tous est utilisée
SHOW_MP_ALTER = true
#Réduire les dégats lorsque l'on passe d'une ciblé à plusieurs.
DAMAGE_DIVIDE = true
end
class Game_Battler
def target_all
if @target_all == nil
@target_all = false
end
return @target_all
end
def inverse_target
if @inverse_target == nil
@inverse_target = false
end
return @inverse_target
end
def target_all=(target_all)
@target_all = target_all
end
def inverse_target=(inverse_target)
@inverse_target = inverse_target
end
end
module RPG
class Skill
def all_available
return TargetExt::TARGET_ALL_S.include?(@id)
end
end
class Item
def all_available
return TargetExt::TARGET_ALL_I.include?(@id)
end
end
class UsableItem
def need_selection?
return !(@scope == 11 || @scope == 0)
end
end
end
class Scene_Battle
alias crmsn_end_target end_target_selection
def end_target_selection(*args)
if @cursor2 != nil
dispose_cursor_all
end
crmsn_end_target(*args)
end
def cursor_all_visible(value)
for cursor in @cursor2
cursor.visible = value
end
end
def dispose_cursor_all
return if @cursor2 == nil
for cursor in @cursor2
cursor.dispose
cursor = nil
end
@cursor2 = nil
end
alias targetext_execute_action execute_action
def execute_action
targetext_execute_action
@active_battler.target_all = false
@active_battler.inverse_target = false
end
end
class Game_BattleAction
def make_attack_targets
targets = []
if battler.confusion?
targets.push(friends_unit.random_target)
elsif battler.berserker?
targets.push(opponents_unit.random_target)
else
targets.push(opponents_unit.smooth_target(@target_index)) unless battler.inverse_target
targets.push(friends_unit.smooth_target(@target_index)) if battler.inverse_target
end
if battler.dual_attack # Chain attack
targets += targets
end
return targets.compact
end
#--------------------------------------------------------------------------
# * Create Skill or Item Targets
# obj : Skill or item
#--------------------------------------------------------------------------
def make_obj_targets(obj)
targets = []
if obj.for_opponent?
if obj.for_random?
if obj.for_one? # One random enemy
number_of_targets = 1
elsif obj.for_two? # Two random enemies
number_of_targets = 2
else # Three random enemies
number_of_targets = 3
end
number_of_targets.times do
targets.push(opponents_unit.random_target) unless battler.inverse_target
targets.push(friends_unit.random_target) if battler.inverse_target
end
elsif obj.dual? # One enemy, dual
targets.push(opponents_unit.smooth_target(@target_index)) unless battler.inverse_target
targets.push(friends_unit.smooth_target(@target_index)) if battler.inverse_target
targets += targets
elsif obj.for_one?
if obj.all_available && battler.target_all
targets += opponents_unit.existing_members unless battler.inverse_target
targets += friends_unit.existing_members if battler.inverse_target
else
targets.push(opponents_unit.smooth_target(@target_index)) unless battler.inverse_target
targets.push(friends_unit.smooth_target(@target_index)) if battler.inverse_target
end
else # All enemies
targets += opponents_unit.existing_members unless battler.inverse_target
targets += friends_unit.existing_members if battler.inverse_target
end
elsif obj.for_user? # User
targets.push(battler)
elsif obj.for_dead_friend?
if obj.for_one? # One ally (incapacitated)
targets.push(friends_unit.smooth_dead_target(@target_index)) unless battler.inverse_target
targets.push(opponents_unit.smooth_target(@target_index)) if battler.inverse_target
else # All allies (incapacitated)
targets += friends_unit.dead_members unless battler.inverse_target
targets += opponents_unit.existing_members if battler.inverse_target
end
elsif obj.for_friend?
if obj.for_one? # One ally
if obj.all_available && battler.target_all
targets += friends_unit.existing_members unless battler.inverse_target
targets += opponents_unit.existing_members if battler.inverse_target
else
targets.push(friends_unit.smooth_target(@target_index)) unless battler.inverse_target
targets.push(opponents_unit.smooth_target(@target_index)) if battler.inverse_target
end
else # All allies
targets += friends_unit.existing_members unless battler.inverse_target
targets += opponents_unit.existing_members if battler.inverse_target
end
end
return targets.compact
end
end
class Sprite_Battler
def moving_anime
# まだ�‰�の�‚��ƒ‹�ƒ��›ば�—�Œ�‹って�„�‚‹な�‚‰�ˆ��œŸ�Œ–
@move_anime.action_reset if @anime_moving
@anime_moving = true
# �ƒ��ƒƒ�‚��‚��‚��ƒƒ�‚�中は�‚��ƒ‹�ƒ��€�武�™��”��ƒ�反転
mirror = false
mirror = true if $back_attack
# �‚��ƒ‹�ƒ�ID
id = @active_action[1]
# 対象
target = @active_action[2]
x = y = mem = 0
# 対象�Œ�˜�“の場�ˆ
if target == 0
# �‚��ƒ��‚��ƒƒ�ƒˆ�Œ決まってな�„場�ˆ�€��‡�身に�‰�›
if @target_battler == nil
x = self.x
y = self.y
else
# �‚��ƒ��‚��ƒƒ�ƒˆ�Œ空の場�ˆ�€��‡�身に�‰�›
if @target_battler[0] == nil
x = self.x
y = self.y
else
# �œ€�ˆ�に�…�って�„�‚‹�‚��ƒ��‚��ƒƒ�ƒˆに対象決�š
x = @target_battler[0].position_x
y = @target_battler[0].position_y
end
end
# 対象�Œ�•�の中�ƒの場�ˆ
elsif target == 1
# �‡�身�Œ�‚��‚��‚��ƒ�の場�ˆは�‚��ƒ��ƒŸ�ƒ�の中�ƒ�‚’�ˆ�—
if (@battler.is_a?(Game_Actor) && !@battler.inverse_target)
for target in $game_troop.members
bitmap = Cache.battler(target.battler_name, target.battler_hue)
ox = bitmap.width/2
oy = bitmap.height/2
x += target.position_x + ox
y += target.position_y + oy
mem += 1
end
x /= mem
y /= mem
# �‡�身�Œ�‚��ƒ��ƒŸ�ƒ�の場�ˆは�‚��‚��‚��ƒ�の中�ƒ�‚’�ˆ�—
else
for target in $game_party.members
ox = 16
oy = 16
x += target.position_x + ox
y += target.position_y + oy
mem += 1
end
x /= mem
y /= mem
end
# 対象�Œ�‘��–�の中�ƒの場�ˆ
elsif target == 2
# �‡�身�Œ�‚��‚��‚��ƒ�の場�ˆは�‚��‚��‚��ƒ�の中�ƒ�‚’�ˆ�—
if @battler.is_a?(Game_Actor)
for target in $game_party.members
x += target.position_x
y += target.position_y
mem += 1
end
x = x / mem
y = y / mem
# �‡�身�Œ�‚��ƒ��ƒŸ�ƒ�の場�ˆは�‚��ƒ��ƒŸ�ƒ�の中�ƒ�‚’�ˆ�—
else
for target in $game_troop.members
x += target.position_x
y += target.position_y
mem += 1
end
x = x / mem
y = y / mem
end
# 対象�Œ�‡�身の場�ˆ
else
x = self.x
y = self.y
end
# �–‹�‹位置の微調�•�
plus_x = @active_action[6]
plus_y = @active_action[7]
# �‚��ƒ��ƒŸ�ƒ�はX軸�‚’�€†に
plus_x *= -1 if @battler.is_a?(Game_Enemy)
# �œ€�‚�š„な移�‹•距�›��‚’�—�‡�
distanse_x = x - self.x - plus_x
distanse_y = y - self.y - plus_y
# �›ば�—�‚��‚��ƒ—
type = @active_action[3]
# �€Ÿ度
speed = @active_action[4]
# �Œ�“
orbit = @active_action[5]
# �‡�身�Œ�–‹�‹位置な�‚‰
if @active_action[8] == 0
@move_anime.base_x = self.x + plus_x
@move_anime.base_y = self.y + plus_y
# 対象�Œ�–‹�‹位置な�‚‰
elsif @active_action[8] == 1
@move_anime.base_x = x + plus_x
@move_anime.base_y = y + plus_y
# 距�›��‚’反対に
distanse_y = distanse_y * -1
distanse_x = distanse_x * -1
# �‹•�‹�•な�„な�‚‰
else
@move_anime.base_x = x
@move_anime.base_y = y
distanse_x = distanse_y = 0
end
# 武�™��‚��‚��‚��ƒ��ƒ�な�—は武�™�表示�—な�„
if @active_action[10] == ""
weapon = ""
# �‚��ƒ‹�ƒ�な�—�‚��ƒ��ƒŸ�ƒ�は武�™�表示�—な�„
elsif @anime_flug != true
weapon = ""
# 武�™��‚��‚��‚��ƒ��ƒ��Œ�‚�‚‹場�ˆ
else
# �›ば�™武�™��‚��ƒ��ƒ•�‚��ƒƒ�‚��Œ�Œ‡�š�•�‚Œて�„�‚‹�‹�ƒ��‚��ƒƒ�‚�
if @battler.is_a?(Game_Actor)
battler = $game_party.members[@battler.index]
weapon_id = battler.weapon_id
else
battler = $game_troop.members[@battler.index]
weapon_id = battler.weapon
end
# �‚��‚��ƒ��”��ƒ��ˆ��”��‹武�™��”��ƒ��ˆ��”��‹�ˆ��ˆ�
weapon_act = N01::ANIME[@active_action[10]].dup if @active_action[10] != ""
# 武�™��”��ƒ��ˆ��”�で素�‰‹でな�‘�‚Œば
if weapon_id != 0 && weapon_act.size == 3
weapon_file = $data_weapons[weapon_id].flying_graphic
# �ˆ��”��ƒ��Œ�Œ‡�š�•�‚Œて�„な�‘�‚Œば�—��˜の武�™��‚��ƒ��ƒ•�‚��ƒƒ�‚��‚’�–�—
if weapon_file == ""
weapon_name = $data_weapons[weapon_id].graphic
icon_weapon = false
# �•�‚‰に�Œ‡�š�Œな�‘�‚Œば�‚��‚��‚��ƒ��‚��ƒ��ƒ•�‚��ƒƒ�‚��‚’�ˆ��”�
if weapon_name == ""
weapon_name = $data_weapons[weapon_id].icon_index
icon_weapon = true
end
# �Œ‡�š�•�‚Œて�„�‚Œばその�‚��ƒ��ƒ•�‚��ƒƒ�‚�名�‚’�–�—
else
icon_weapon = false
weapon_name = weapon_file
end
# 武�™��‚��‚��‚��ƒ��ƒ��ƒ…報�‚’�–�—
weapon = @active_action[10]
# 武�™��”��ƒ��ˆ��”�で素�‰‹な�‚‰表示�—な�„
elsif weapon_act.size == 3
weapon = ""
# �‚��‚��ƒ��”��ƒ��ˆ��”�
elsif weapon_act != nil && @battler.action.skill != nil
icon_weapon = false
weapon_name = $data_skills[@battler.action.skill.id].flying_graphic
weapon = @active_action[10]
end
end
# Z座�™�‚’決�š
@move_anime.z = 1
@move_anime.z = 1000 if @active_action[9]
# 以�Šの�ƒ…報�‚’�…�て�‚��ƒ‹�ƒ��›ば�—�‚��ƒ—�ƒ��‚��ƒˆに�€��‚‹
@move_anime.anime_action(id,mirror,distanse_x,distanse_y,type,speed,orbit,weapon,weapon_name,icon_weapon)
end
end
class Game_Battler
alias targetext_make_obj_dmg make_obj_damage_value
def make_obj_damage_value(user, obj)
targetext_make_obj_dmg(user, obj)
if user.target_all && obj.all_available
if @hp_damage != 0
@hp_damage *= TargetExt::DAMAGE_PERCENT
@hp_damage /= 100
@hp_damage /= user.action.make_targets.size if TargetExt::DAMAGE_DIVIDE && user.target_all
end
if @mp_damage != 0
@mp_damage *= TargetExt::DAMAGE_PERCENT
@mp_damage /= 100
@mp_damage /= user.make_targets.size if TargetExt::DAMAGE_DIVIDE && user.target_all
end
end
end
alias targetext_calc_mp_cost calc_mp_cost
def calc_mp_cost(skill)
cost = targetext_calc_mp_cost(skill)
if self.target_all && skill.all_available
cost *= TargetExt::MP_PERCENT
cost /= 100
end
return cost
end end
2° script: - Code:
-
################################################################################
=begin Targetting Extended for Tankentai Non-ATB v1.1
by CrimsonSeas
################################################################################
Use with the base script to enable the targetting extended.
This script adds to the rewrites list of the base script
Rewrites:
+Scene_Battle
-start_target_selection
-select_member =end ################################################################################
class Scene_Battle
def start_target_selection(actor = false)
members = $game_party.members if actor
members = $game_troop.members unless actor
if @active_battler.action.kind == 1
obj = @active_battler.action.skill
elsif @active_battler.action.kind == 2
obj = @active_battler.action.item
end
case obj
when nil
@target_any = TargetExt::ATTACK_ANY
when RPG::Skill
@target_any = !TargetExt::NO_TARGET_ANY_S.include?(@active_battler.action.skill.id)
when RPG::Item
@target_any = !TargetExt::NO_TARGET_ANY_I.include?(@active_battler.action.item.id)
end
if obj != nil && obj.extension.include?("TARGETALL")
members = $game_party.members + $game_troop.members
end
# �‚��ƒ��‚��ƒ��‚��ƒ—�ƒ��‚��ƒˆの�œ�ˆ�
@cursor = Sprite.new
@cursor.bitmap = Cache.character("cursor")
@cursor.src_rect.set(0, 0, 32, 32)
@cursor_flame = 0
@cursor.x = -200
@cursor.y = -200
@cursor.ox = @cursor.width
@cursor.oy = @cursor.height
@all = false
@all = [2, 4, 5, 6, 8, 10].include?(obj.scope) || obj.extension.include?("TARGETALL") if obj != nil
@cursor.visible = !@all
@help_window.visible = false if @help_window != nil
@help_window2 = Window_Help.new if @help_window2 == nil
@actor_command_window.active = false
@skill_window.visible = false if @skill_window != nil
@item_window.visible = false if @item_window != nil
@index = 0
@max_index = members.size - 1
unless actor
members.size.times do
break if members[@index].exist?
@index += 1
end
end
@help_window2.set_text(members[@index].name, 1)
if @all
string1 = TargetExt::TARGET_ALL_VOC[0]
string2 = actor ? TargetExt::TARGET_ALL_VOC[1][0] : TargetExt::TARGET_ALL_VOC[1][1]
string1 += " " + string2 unless obj.extension.include?("TARGETALL")
@help_window2.set_text(string1, 1)
make_cursor_all(members)
end
select_member(members, actor)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def select_member(targets, actor = true)
members = targets
if @active_battler.action.kind == 1
obj = @active_battler.action.skill
elsif @active_battler.action.kind == 2
obj = @active_battler.action.item
end
loop do
update_basic
@cursor_flame = 0 if @cursor_flame == 30
@cursor.src_rect.set(0, 0, 32, 32) if @cursor_flame == 29
@cursor.src_rect.set(0, 32, 32, 32) if @cursor_flame == 15
point = @spriteset.set_cursor(actor, @index)
@cursor.x = point[0]
@cursor.y = point[1]
@cursor_flame += 1
if Input.trigger?(Input::B)
Sound.play_cancel
end_target_selection
break
elsif Input.trigger?(Input::C)
Sound.play_decision
@active_battler.action.target_index = @index
end_target_selection
end_skill_selection
end_item_selection
next_actor
break
end
if Input.repeat?(Input::LEFT) && !(@all || @active_battler.target_all)
if actor
cursor_down(members, actor) if $back_attack
cursor_up(members, actor) unless $back_attack
else
cursor_up(members, actor) if $back_attack
cursor_down(members, actor) unless $back_attack
end
end
if Input.repeat?(Input::RIGHT) && !(@all || @active_battler.target_all)
if actor
cursor_up(members, actor) if $back_attack
cursor_down(members, actor) unless $back_attack
else
cursor_down(members, actor) if $back_attack
cursor_up(members, actor) unless $back_attack
end
end
if (Input.trigger?(Input::L) || Input.trigger?(Input::R)) && @target_any
if members == $game_party.members
members = $game_troop.members
actor = false
elsif members == $game_troop.members
members = $game_party.members
actor = true
end
if @active_battler.inverse_target
@active_battler.inverse_target = false
else
@active_battler.inverse_target = true
end
@index = 0 if @index >= members.size
@max_index = members.size - 1
unless actor
members.size.times do
break if members[@index].exist?
@index += 1
end
end
if @cursor != nil
dispose_cursor_all
make_cursor_all(members)
cursor_all_visible(@active_battler.target_all || @all)
end
if @active_battler.target_all || @all
string1 = TargetExt::TARGET_ALL_VOC[0]
string2 = actor ? TargetExt::TARGET_ALL_VOC[1][0] : TargetExt::TARGET_ALL_VOC[1][1]
string1 += " " + string2 unless obj.extension.include?("TARGETALL")
if TargetExt::SHOW_MP_ALTER && @active_battler.target_all && obj.is_a?(RPG::Skill)
cost = @active_battler.calc_mp_cost(obj)
string1 += ": " + cost.to_s + Vocab::mp
end
@help_window2.set_text(string1, 1)
end
@help_window2.set_text(members[@index].name, 1) if !@active_battler.target_all && !@all
Sound.play_cursor
end
if Input.trigger?(Input::A) && !@all && obj != nil
if obj.all_available
Sound.play_cursor
if @active_battler.target_all
@active_battler.target_all = false
@cursor.visible = true
cursor_all_visible(false) if @cursor2 != nil
@help_window2.set_text(members[@index].name, 1)
else
@active_battler.target_all = true
@cursor.visible = false
make_cursor_all(members) if @cursor2 == nil
cursor_all_visible(true)
string1 = TargetExt::TARGET_ALL_VOC[0]
string2 = actor ? TargetExt::TARGET_ALL_VOC[1][0] : TargetExt::TARGET_ALL_VOC[1][1]
string1 += " " + string2 unless obj.extension.include?("TARGETALL")
if TargetExt::SHOW_MP_ALTER && @active_battler.target_all && obj.is_a?(RPG::Skill)
cost = @active_battler.calc_mp_cost(obj)
string1 += ": " + cost.to_s + Vocab::mp
end
@help_window2.set_text(string1 , 1)
end
end
end
cursor_up(members, actor) if Input.repeat?(Input::UP) && !(@all || @active_battler.target_all)
cursor_down(members, actor) if Input.repeat?(Input::DOWN) && !(@all || @active_battler.target_all)
end
end
def make_cursor_all(members)
@cursor2 = []
for i in 0...members.size
next if members == $game_troop.members && !members[i].exist?
@cursor2[i] = Sprite.new
@cursor2[i].bitmap = Cache.character("cursor")
@cursor2[i].src_rect.set(0, 0, 32, 32)
@cursor2[i].x = members[i].position_x - 48
@cursor2[i].y = members[i].position_y - 48
end
@cursor2.compact!
end
end
|
|
| Sujet: Re: (combat) choisir le monstre à attaquer avec la souris. | |
| |
|