Menu

Connexion



Retenir ?

Mot de passe oublié ?
Eclipso logo
Merry Christmas !
07/06/2020 12:13:27

Une Princesse sans amour est une Princesse oubliée - Brandobscure

Compétence Drain et jet d'armes en combat. XP

Delta

Star
Delta
  • Messages : 2420

Compétence Drain et jet d'armes en combat. XP


mar. 25 févr. 2014 - 18h01

Salut. Voilà j'utilise ce CBS qui me permet d'avoir des combats de côté.

[spoiler][code]#--------------------------------------------------------------------------
# ™Sideview battle simple English version
#
# (C) copyright by http://rye.jp/ Date 2007/01/12 Ver alpha
#--------------------------------------------------------------------------
# Side view battle script walking graphic version Special Thanks by blz
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
# Standard of graphic file
#--------------------------------------------------------------------------
# battler graphics
#
# @Walking graphic is used as it is.
# @
# weapon graphics
#
# @The icon graphic of arms is used as it is.
#


module Side_view
#--------------------------------------------------------------------------
# œ Using together RTAB@™Automatic recognition
#--------------------------------------------------------------------------
if Scene_Battle.method_defined?("synthe?")
RTAB = true
else
RTAB = false
end
#--------------------------------------------------------------------------
# œ Using together RTAB cam ™Automatic recognition
#--------------------------------------------------------------------------
def camera_correctness
return false if !RTAB
begin
return $scene.drive
rescue
return false
end
end
#--------------------------------------------------------------------------
# œ The maximum number of parties
#--------------------------------------------------------------------------
Party_max = 4
#--------------------------------------------------------------------------
# œ Expansion rate of Battler graphic(actor exclusive use)
#--------------------------------------------------------------------------
CHAR_ZOOM = 1.0
#--------------------------------------------------------------------------
# œ Arrow cursor position correction
#--------------------------------------------------------------------------
ARROW_OX = 0
ARROW_OY = 64
#--------------------------------------------------------------------------
# œ State name treated as flight (Array)
#--------------------------------------------------------------------------
FLY_STATES = ["Vol"]
#--------------------------------------------------------------------------
# œ Positional correction of combat screen party
#--------------------------------------------------------------------------
PARTY_X = 480 # X position of party
PARTY_Y = 200 # Y position of party
FORMATION_X = 32 # actor's interval X
FORMATION_Y = 38 # actor's interval Y
#--------------------------------------------------------------------------
# œ ƒJƒXƒ^ƒ}ƒCƒY’萔
#--------------------------------------------------------------------------
NORMAL = "NORMAL"
WALK_R = "WALK_R"
WALK_L = "WALK_L"
ATTACK = "ATTACK"
ATTACK_R = "ATTACK_R"
ATTACK_L = "ATTACK_L"
MAGIC = "MAGIC"
ITEM = "ITEM"
# ƒAƒjƒ‚̐ݒè
ANIME = {
# [id,Loop?,speed,weapon visible,pattern freeze,Weapon Right or Left(using RTAB)]
NORMAL => [1,true , 0,false, true ,"" ], # Standby usually
WALK_R => [2,true , 6,false, false,"" ], # move Right
WALK_L => [1,true , 6,false, false,"" ], # move Left
ATTACK_R => [1,false, 6,true , false,"Right"],# attack by Right hand
ATTACK_L => [1,false, 6,true , false,"Left"], # attack by Left hand
MAGIC => [1,false, 6,false, false,"" ], # spell Magic
ITEM => [1,false, 6,false, false,"" ], # using Item
}

# default (Do not change it)
ANIME.default = [1,false,12,false,"",""]

# ƒAƒNƒVƒ‡ƒ“Ý’è‚ÌŠÖ˜A•t‚¯
ACTION_LIB = {
"Hero Move" => "moving_setup",
"Hero Graphic Change" => "change",
"Throw Animation" => "flying",
"main phase step 3" => "animation1",
"main phase step 4" => "animation2",
"Waiting" => "wait",
"Graphic Reverse" => "reverse",
"Afterimage ON" => "shadow_on",
"Afterimage OFF" => "shadow_off",
"Freeze ON" => "freeze",
"Freeze OFF" => "freeze_lifting",
"Display Animation" => "animation_start",
"Play Sound Effect" => "play_se",
}
ACTION_LIB.default = "finish"

# (Do not change it)
DUAL_WEAPONS_ANIME = [ATTACK]



# Arms display X coordinates
BLZ_X = {
0=>[0,0,0,0], # NO MOTION
1=>[2,2,2,2], # Shake lowering
2=>[15,10,0,0], # Piercing
3=>[2,2,2,2], # Raising
4=>[0,0,3,3], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}
# Arms display Y coordinates
BLZ_Y = {
0=>[0,0,0,0], # NO MOTION
1=>[6,6,6,6], # Shake lowering
2=>[6,6,6,6], # Piercing
3=>[6,6,6,6], # Raising
4=>[8,8,8,8], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}
# Arms display Angle
BLZ_ANGLE = {
0=>[0,0,0,0], # NO MOTION
1=>[75-45*3,75-45*2,75-45*1,75-45*1], # Shake lowering
2=>[45,45,45,45], # Piercing
3=>[100-45*1,100-45*2,100-45*3,00-45*4], # Raising
4=>[45,45,45,45], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}

#--------------------------------------------------------------------------
# œ SHAKE
#--------------------------------------------------------------------------
SHAKE_FILE = "SHAKE" # filename
SHAKE_POWER = 5 # POWER
SHAKE_SPEED = 5 # SPEED
SHAKE_DURATION = 5 # DURATION
#--------------------------------------------------------------------------
# œ UPSIDE_DOWN
#--------------------------------------------------------------------------
UPSIDE_DOWN_FILE = "UPSIDE_DOWN" # filename
#--------------------------------------------------------------------------
# œ REVERSE
#--------------------------------------------------------------------------
REVERSE_FILE = "REVERSE" # filename
#--------------------------------------------------------------------------
# œ ‰ñ“]‚̐ݒè
#--------------------------------------------------------------------------
TURNING_FILE = "ROTATION" # filename
TURNING_DIRECTION = 1 # Directioni1.Anti-clockwise, -1.clockwise)
TURNING_SPEED = 32 # Speed
TURNING_DURATION = 1 # Rotation frequency
#--------------------------------------------------------------------------
# œ ˆÚ“®‚̐ݒè
#--------------------------------------------------------------------------
MOVE_FILE = "MOVE" # filename
MOVE_RETURN = 1 # Do you return to former position?
MOVE_SPEED = 32 # Speed
MOVE_COORDINATES = [0, -640] # Relative coordinates from former position
#--------------------------------------------------------------------------
# œ Add Animation (using RTAB)
#--------------------------------------------------------------------------
ADD_ANIME_FILE = "Add_ANIME" # filename
ADD_ANIME_ID = 0 # Animation ID
#--------------------------------------------------------------------------
# œ using RTAB (Do not change it)
#--------------------------------------------------------------------------
def convert_battler
return RTAB ? @active_actor : @active_battler
end
#--------------------------------------------------------------------------
# œ using RTAB (Do not change it)
#--------------------------------------------------------------------------
def convert_battler2(*arg)
return RTAB ? arg[0] : @active_battler
end
end

#--------------------------------------------------------------------------
# œ action performer
#--------------------------------------------------------------------------
module BattleActions

# Because the one below is one example to the last
# Please make it originally.

Actions = {

"Normal Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#target,32,0,64,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Waiting#5",
"Hero Graphic Change#WALK_L",
"Play Sound Effect#016-Jump02,80,100",
"Hero Move#self,0,0,18,4",
"end"
],


"One step advancement Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,12,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Waiting#5",
"Hero Graphic Change#WALK_L",
"Play Sound Effect#016-Jump02,80,100",
"Hero Move#self,0,0,12,0",
"end"
],


"Enemy Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-36,0,12,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Waiting#5",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,12,0",
"end"
],


"Spell Magic" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,4,0",
"Hero Graphic Change#MAGIC",
"Waiting#15",
"Throw Animation",
"main phase step 4",
"Waiting#5",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,4,2",
"end"
],

"Using Item" => [

"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,4,0",
"main phase step 3",
"Hero Graphic Change#ITEM",
"Waiting#15",
"Throw Animation",
"main phase step 4",
"Waiting#5",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,4,2",
"end"
],

"Using Skill" => [

"Hero Graphic Change#WALK_L",
"Hero Move#target_near,50,0,48,6",
"Graphic Reverse",
"Freeze ON#ATTACK#3",
"main phase step 3",
"Play Sound Effect#135-Light01,100,100",
"Display Animation#self,42",
"Waiting#15",
"Graphic Reverse",
"Afterimage ON",
"Hero Move#target_far,-50,0,48,0",
"main phase step 4",
"Waiting#5",
"Afterimage OFF",
"Freeze OFF",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,48,1,0",
"end"
],
}

end

module RPG

# Because the one below is one example to the last
# Please make it originally.

class Weapon
#--------------------------------------------------------------------------
# Weapon sctions. Set what weapons are a stand still weapon.
#--------------------------------------------------------------------------
def battle_actions
case @id
when 17, 18, 19, 20, 21, 22, 23, 24, 34, 35, 41, 42, 43, 50, 56, 61, 62, 67, 68 # Bronze Gun
return BattleActions::Actions["One step advancement Attack"]
end
return BattleActions::Actions["Normal Attack"] # default
end
end
class Skill
#--------------------------------------------------------------------------
# œ action performer
#--------------------------------------------------------------------------
def battle_actions
if self.magic?
return BattleActions::Actions["Spell Magic"] # default
else
return BattleActions::Actions["Using Skill"] # default
end
end
end
class Item
#--------------------------------------------------------------------------
# œ action performer
#--------------------------------------------------------------------------
def battle_actions
return BattleActions::Actions["Using Item"] # default
end
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# œ action performer
#--------------------------------------------------------------------------
def battle_actions
return BattleActions::Actions["Enemy Attack"] # default
end
end
module RPG
=begin

œ Setting of arms type

The attribute of the name "WeaponType" is made, and it is applied to arms.
The figure is written behind "WeaponType".
@@
Example.@WeaponType1@

=end
class Weapon
#--------------------------------------------------------------------------
# œ WeaponType
#--------------------------------------------------------------------------
def anime
# Elemental
element_name = "WeaponType"
for i in @element_set
if $data_system.elements[i] =~ /#{element_name}([+-]?[0-9]+)?(%)?/
return $1.to_i
end
end
# Weapon ID

# Because the one below is one example to the last
# Please make it originally.

case @id
when 1,2,3,4
return 1 # (WeaponType) Refer from the 115th line to the 150th line.
when 5,6,7,8
return 2 # (WeaponType) Refer from the 115th line to the 150th line.
end
return 1 # defaut
end
end
end
=begin
#--------------------------------------------------------------------------
# œ Throw Animation
#--------------------------------------------------------------------------

@ Animation is thrown out from performar to target.
Please make animation from the data base.

[ Animation ID, Speed, Do you shuttle?, Straight line (false) or curve(true)]
=end
module RPG
class Weapon
#--------------------------------------------------------------------------
# œ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
class Skill
#--------------------------------------------------------------------------
# œ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
class Item
#--------------------------------------------------------------------------
# œ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
end

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# œ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
#==============================================================================
# ¡ Game_Battler
#==============================================================================
class Game_Battler
include Side_view
#--------------------------------------------------------------------------
# œ ’ljÁEŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :height # ‰æ‘œ‚̍‚‚³
attr_accessor :real_x # XÀ•W•â³
attr_accessor :real_y # YÀ•W•â³
attr_accessor :real_zoom # Šg‘å—¦
attr_accessor :wait_count # ƒAƒjƒ[ƒVƒ‡ƒ“ ‘Ò‚¿ŽžŠÔ
attr_accessor :wait_count2 # ƒAƒjƒ[ƒVƒ‡ƒ“ ‘Ò‚¿ŽžŠÔ2
attr_accessor :pattern # ƒAƒjƒ[ƒVƒ‡ƒ“ ƒJƒEƒ“ƒgiƒLƒƒƒ‰)
attr_accessor :shake # ƒVƒFƒCƒNŠJŽnƒtƒ‰ƒbƒO
attr_accessor :reverse # ¶‰E”½“]ƒtƒ‰ƒbƒO
attr_accessor :shadow # Žc‘œƒtƒ‰ƒbƒO
attr_accessor :flash_flag # ‘M‚«ƒtƒ‰ƒbƒO
attr_reader :ox # XÀ•W•â³
attr_reader :oy # YÀ•W•â³
attr_reader :flying_x # ‰“‹——£ƒAƒjƒXÀ•W
attr_reader :flying_y # ‰“‹——£ƒAƒjƒYÀ•W
attr_reader :flying_anime # ‰“‹——£ƒAƒjƒ
attr_reader :animation1_on # s“®ƒAƒjƒŠJŽnƒtƒ‰ƒbƒO
attr_reader :animation2_on # ‘ΏۃAƒjƒŠJŽnƒtƒ‰ƒbƒO
#--------------------------------------------------------------------------
# œ ƒfƒtƒHƒ‹ƒg‚̃Aƒjƒ[ƒVƒ‡ƒ“‘Ò‚¿ŽžŠÔ‚ðŽæ“¾
#--------------------------------------------------------------------------
def animation_duration=(animation_duration)
@_animation_duration = animation_duration
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹ŠJŽnŽž‚̃ZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
def start_battle
@height = 0
@real_x = 0
@real_y = 0
@real_zoom = 1.0
@battler_condition = ""
@action = nil
@battle_actions = []
@battler_action = false
@step = 0
@anime_on = false
@wait_count = 0
@wait_count2 = 0
@ox = 0
@oy = 0
@pattern = 0
@pattern_log = true
@pattern_freeze = false
@condition_freeze = false
@active = false
@move_distance = nil
@move_wait = 0
@move_coordinates = [0,0,0,0]
@flying_distance = nil
@flying_wait = 0
@flying_x = 0
@flying_y = 0
@flash_flag = {}
self.flying_clear
end
#--------------------------------------------------------------------------
# œ ˆÚ“®’†”»’è
#--------------------------------------------------------------------------
def moving?
# XÀ•W•â³‚Ü‚½‚́AYÀ•W•â³‚ª0‚Å‚È‚¯‚ê‚΁AˆÚ“®’†
return (@ox != 0 or @oy != 0)
end
#--------------------------------------------------------------------------
# œ ˆÚ“®I—¹”»’è
#--------------------------------------------------------------------------
def move_end?
return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒVƒ‡ƒ“ŠJŽnÝ’è
#--------------------------------------------------------------------------
def action(flag = true)
@battler_action = flag
@animation1_on = false
@animation2_on = false
@step = "setup"
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒVƒ‡ƒ“’†”»’è
#--------------------------------------------------------------------------
def action?
return @battler_action
end
#--------------------------------------------------------------------------
# œ ‘M‚«”»’è
#--------------------------------------------------------------------------
def flash?
return @flash_flg
end
#--------------------------------------------------------------------------
# œ í“¬•s”\”»’è
#--------------------------------------------------------------------------
def anime_dead?
if $game_temp.in_battle and !RTAB
if [2,3,4,5].include?($scene.phase4_step)
return @last_dead
end
end
return @last_dead = self.dead?
end
#--------------------------------------------------------------------------
# œ ƒsƒ“ƒ`ó‘Ô”»’è
#--------------------------------------------------------------------------
def crisis?
if $game_temp.in_battle and !RTAB
if [2,3,4,5].include?($scene.phase4_step)
return @last_crisis
end
end
return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
end
#--------------------------------------------------------------------------
# œ ƒoƒbƒhƒXƒe[ƒg”»’è
#--------------------------------------------------------------------------
def badstate?
for i in @states
unless $data_states[i].nonresistance
return true
end
end
return false
end
#--------------------------------------------------------------------------
# œ ”òs
#--------------------------------------------------------------------------
def fly
if @fly != nil
return @fly
end
for id in @states
if FLY_STATES.include?($data_states[id].name)
return 60
end
end
return 0
end
#--------------------------------------------------------------------------
# œ ‰“‹——£ƒAƒjƒ–Ú•WÀ•W‚ÌŒvŽZ
#--------------------------------------------------------------------------
def flying_setup
# “ñ“x–Ú‚ÍŽÀs‚µ‚È‚¢
return if @flying_distance != nil && !camera_correctness
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
# –Ú“IÀ•W‚ðŒvŽZ
@f_target_x = 0
@f_target_y = 0
for t in targets
@f_target_x += t.screen_x
@f_target_y += t.screen_y
end
if targets != []
@f_target_x /= targets.size
@f_target_y /= targets.size
else
@flying_distance = 0
return
end
# ‹——£‚ÌŒvŽZ
@flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
@flying_end = false
end
#--------------------------------------------------------------------------
# œ ‰“‹——£ƒAƒjƒ
#--------------------------------------------------------------------------
def flying_animation
# –ß‚é
if @step != "flying" or @flying_distance.nil?
return [false,true]
end
# ‚ ‚ç‚©‚¶‚ߌvŽZ
self_x = self.screen_x
self_y = self.screen_y
@flying_distance = @flying_distance == 0 ? 1 : @flying_distance
n1 = @flying_wait / @flying_distance.to_f
if @flying_distance - @flying_wait > @flying_distance / 2
n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
else
n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
end
if !@flying_anime[4]
# ’¼üˆÚ“®
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
else
# ‹ÈüˆÚ“®
if !@flying_proceed_end
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
else
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
end
end
# À•W‘ã“ü
@flying_x = x
@flying_y = y
# ƒEƒGƒCƒg
if !@flying_proceed_end
# ŠJŽn
@flying_proceed_start = @flying_wait == 0
@flying_wait += @flying_anime[1]
@flying_wait = [@flying_wait,@flying_distance].min
@flying_proceed_end = @flying_wait == @flying_distance
else
# ŠJŽn
@flying_return_start = @flying_wait == @flying_distance
@flying_wait -= @flying_anime[1]
@flying_wait = [@flying_wait,0].max
@flying_return_end = @flying_wait == 0
end
if @flying_anime[1] == 0
@flying_end = true
elsif !@flying_anime[2]
@flying_end = @flying_proceed_end
else
@flying_end = @flying_return_end
end
# ’l‚ð•Ô‚·iƒAƒjƒŠJŽn,ƒAƒjƒI—¹)
return [@flying_proceed_start,@flying_end]
end
#--------------------------------------------------------------------------
# œ ‰“‹——£ƒAƒjƒ‰Šú‰»
#--------------------------------------------------------------------------
def flying_clear
@flying_proceed_start = false
@flying_proceed_end = false
@flying_return_start = false
@flying_return_end = false
@flying_end = true
@flying_anime = [0,0,false,false]
end
#--------------------------------------------------------------------------
# œ ˆÚ“®
#--------------------------------------------------------------------------
def move
# ‹——£‚ÌŒvŽZ
@move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
if @move_distance > 0
return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
array = @move_coordinates
# ƒWƒƒƒ“ƒv•â³’l‚ÌŒvŽZ
n = 100.0 * @move_wait / @move_distance
jump = -@move_action[4] * n * (100 - n) / 100.0
@ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
@oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
# ƒEƒGƒCƒg
@move_wait -= @move_action[3]
@move_wait = [@move_wait,0].max
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®ƒAƒNƒVƒ‡ƒ“‚̎擾
#--------------------------------------------------------------------------
def get_move_action
string = @action.split(/#/)[1]
string = string.split(/,/)
@move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒVƒ‡ƒ“‚̎擾
#--------------------------------------------------------------------------
def get_step
if @action.nil?
@step = "finish"
return
end
return ACTION_LIB[@action.split(/#/)[0]]
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ŽŸ‚̃AƒNƒVƒ‡ƒ“‚Ö)
#--------------------------------------------------------------------------
def update_next
@action = @battle_actions.shift
@step = get_step
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (“®ìŽæ“¾)
#--------------------------------------------------------------------------
def update_setup
# ƒAƒNƒVƒ‡ƒ“‚̎擾
self.get_actions
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ˆÚ“®Žæ“¾)
#--------------------------------------------------------------------------
def update_moving_setup
# ˆÚ“®ƒAƒNƒVƒ‡ƒ“‚̎擾
self.get_move_action
# ˆÚ“®–Ú•W‚̐ݒè
self.move_setup
@step = "moving"
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ˆÚ“®)
#--------------------------------------------------------------------------
def update_moving
# ˆÚ“®
self.move
self.condition = @battler_condition
# ˆÚ“®Š®—¹‚µ‚½‚玟‚̃Xƒeƒbƒv‚Ö
if move_end?
update_next
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒjƒŽÀs)
#--------------------------------------------------------------------------
def update_action
con = @action.split(/#/)[1]
# ‰EŽèE¶Žè‚𕪂¯‚é
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ƒAƒjƒ•ÏX
self.condition = con
# ƒ‹[ƒv‚©”Û‚©
if !ANIME[@battler_condition][1]
self.anime_on
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (‰“‹——£ƒAƒjƒ)
#--------------------------------------------------------------------------
def update_flying
# –Ú•W‚̐ݒè
self.flying_setup
# ‰“‹——£ƒAƒjƒI—¹
if @flying_end or @flying_anime == [0,0,false,false]
self.flying_clear
update_next
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒjƒ•ÏX)
#--------------------------------------------------------------------------
def update_change
con = @action.split(/#/)[1]
# ‰EŽèE¶Žè‚𕪂¯‚é
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ƒAƒjƒ•ÏX
self.condition = con
# ƒ‹[ƒv‚©”Û‚©
if !ANIME[@battler_condition][1]
self.anime_on
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (s“®ƒAƒjƒ)
#--------------------------------------------------------------------------
def update_animation1
@animation1_on = true
# s“®ƒAƒjƒ‚ÌŒã‚ɍs“®‚ðŠJŽn‚·‚é
if $scene.phase4_step == 3
id = RTAB ? @anime1 : $scene.animation1_id
animation = $data_animations[id]
frame_max = animation != nil ? animation.frame_max : 0
@wait_count2 = frame_max * 2
return
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (‘ΏۃAƒjƒ)
#--------------------------------------------------------------------------
def update_animation2
@animation2_on = true
# s“®ƒAƒjƒ‚ÌŒã‚ɍs“®‚ðŠJŽn‚·‚é
if $scene.phase4_step == 4
id = RTAB ? @anime2 : $scene.animation2_id
animation = $data_animations[id]
frame_max = animation != nil ? animation.frame_max : 0
@wait_count2 = frame_max * 2
return
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒEƒGƒCƒg)
#--------------------------------------------------------------------------
def update_wait
@wait_count2 = @action.split(/#/)[1].to_i
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (Žc‘œ•\Ž¦)
#--------------------------------------------------------------------------
def update_shadow_on
@shadow = true
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (Žc‘œÁ‹Ž)
#--------------------------------------------------------------------------
def update_shadow_off
@shadow = false
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (¶‰E”½“])
#--------------------------------------------------------------------------
def update_reverse
@reverse = @reverse ? false : true
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (‘M‚«ƒAƒjƒ)
#--------------------------------------------------------------------------
def update_flash
# ‘M‚«ƒAƒjƒ‚ÌŒã‚ɍs“®‚ðŠJŽn‚·‚é
if @flash_flag["normal"]
@wait_count = $scene.flash_duration
@flash_flag["normal"] = false
return
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (SE‚̉‰‘t)
#--------------------------------------------------------------------------
def update_play_se
data = @action.split(/#/)[1]
data = data.split(/,/)
# SE ‚ð‰‰‘t
Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒAƒjƒŒÅ’è)
#--------------------------------------------------------------------------
def update_freeze
con = @action.split(/#/)[1]
# ‰EŽèE¶Žè‚𕪂¯‚é
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ƒAƒjƒ•ÏX
self.condition = con
@pattern = @action.split(/#/)[2].to_i
@pattern_freeze = true
@condition_freeze = true
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒAƒjƒŒÅ’è‰ðœ)
#--------------------------------------------------------------------------
def update_freeze_lifting
@pattern_freeze = false
@condition_freeze = false
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì•\Ž¦)
#--------------------------------------------------------------------------
def update_animation_start
data = @action.split(/#/)[1]
data = data.split(/,/)
target = data[0]
animation_id = data[1].to_i
if RTAB
case target
when "self"
@animation.push([animation_id,true])
when "target"
for tar in @target
tar.animation.push([animation_id, true])
end
end
else
case target
when "self"
@animation_id = animation_id
@animation_hit = true
when "target"
for tar in $scene.target_battlers
tar.animation_id = animation_id
tar.animation_hit = true
end
end
end
update_next
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (“®ìI—¹)
#--------------------------------------------------------------------------
def update_finish
# “®ìI—¹
@battler_action = false
@step = "setup"
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‰[‚̏ó‘ԁiƒoƒgƒ‰[ƒOƒ‰ƒtƒBƒbƒN‚̃^ƒCƒv)
#--------------------------------------------------------------------------
def condition
return @battler_condition
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‰[‚̏ó‘Ô •ÏXiƒoƒgƒ‰[ƒOƒ‰ƒtƒBƒbƒN‚̃^ƒCƒv)
#--------------------------------------------------------------------------
def condition=(condition)
return if @condition_freeze
if @battler_condition != condition
@wait_count = ANIME[condition][2]
@pattern = 0
end
@battler_condition = condition
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒFƒCƒg’†‚̏ꍇ
if @wait_count == 0
# ƒpƒ^[ƒ“XV
self.char_animation
@wait_count = ANIME[@battler_condition][2]
end
# ƒpƒ^[ƒ“XV
self.char_animation
# ƒEƒFƒCƒg’†‚̏ꍇ
if @wait_count2 > 0
return
end

# s“®ƒAƒjƒ[ƒVƒ‡ƒ“
if @battler_action
method("update_" + @step).call
return
end

# ƒf[ƒ^‰Šú‰»
@animation1_on = false
@animation2_on = false
@action = nil
@battle_actions = []
@move_wait = 0
@move_distance = nil
@flying_wait = 0
@flying_distance = nil
@flash = false

# ’ʏíE‘Ò‹@
return self.condition = NORMAL
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒVƒ‡ƒ“‚̎擾
#--------------------------------------------------------------------------
def get_actions
skill = $data_skills[self.current_action.skill_id]
item = $data_items[self.current_action.item_id]
kind = self.current_action.kind
# “®ìŽæ“¾
@battle_actions = []
# ƒXƒLƒ‹
if skill != nil && kind == 1
@battle_actions = skill.battle_actions.dup
@flying_anime = skill.flying_anime
# ƒAƒCƒeƒ€
elsif item != nil && kind == 2
@battle_actions = item.battle_actions.dup
@flying_anime = item.flying_anime
# ¶ŽèUŒ‚
elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
@battle_actions = self.battle_actions2.dup
@flying_anime = self.flying_anime2
# ‰EŽèUŒ‚
elsif self.current_action.basic == 0 and
self.is_a?(Game_Actor) and self.current_action.kind == 0
@battle_actions = self.battle_actions1.dup
@flying_anime = self.flying_anime1
# ’ʏíUŒ‚
elsif self.current_action.basic == 0 and self.current_action.kind == 0
@battle_actions = self.battle_actions.dup
@flying_anime = self.flying_anime
else
@battle_actions = ["I—¹"]
@flying_anime = [0,0,false,false]
end
end
#--------------------------------------------------------------------------
# œ ƒ‹[ƒv‚µ‚È‚¢ƒAƒjƒ‚̃Zƒbƒg
#--------------------------------------------------------------------------
def anime_on
@pattern = 0
@pattern_log = true
return
end
#--------------------------------------------------------------------------
# œ ƒpƒ^[ƒ“XV
#--------------------------------------------------------------------------
def char_animation
# ƒpƒ^ƒ“ŒÅ’è‚̏ꍇ‚à‚Ç‚é
return if @pattern_freeze
# ƒ‹[ƒv‚µ‚È‚¢ƒAƒjƒ‚̏ꍇ 1234 ‚ÅŽ~‚Ü‚é
if !ANIME[@battler_condition][1] && @pattern == 3
return
end
# ƒAƒjƒ‚³‚¹‚È‚¢ê‡ 1 ‚ÅŽ~‚Ü‚é
if ANIME[@battler_condition][4]
@pattern = 0
return
end
@pattern = (@pattern + 1) % 4
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒƒ^ƒCƒv
#--------------------------------------------------------------------------
def anime_type
return ANIME[@battler_condition] != nil ? ANIME[@battler_condition][0] : 0
end
end
#==============================================================================
# ¡ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
include Side_view
#--------------------------------------------------------------------------
# œ ƒZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
alias side_view_setup setup
def setup(actor_id)
side_view_setup(actor_id)
start_battle
end
#--------------------------------------------------------------------------
# œ “ñ“•Ší‚ÌIDŽæ“¾@¦ƒGƒ‰[‰ñ”ð—p
#--------------------------------------------------------------------------
def weapon2_id
return @weapon2_id != nil ? @weapon2_id : 0
end
#--------------------------------------------------------------------------
# œ X•ûŒü ƒ|ƒWƒVƒ‡ƒ“ Žæ“¾
#--------------------------------------------------------------------------
def position
return $data_classes[@class_id].position
end
#--------------------------------------------------------------------------
# œ Y•ûŒü ƒ|ƒWƒVƒ‡ƒ“ Žæ“¾
#--------------------------------------------------------------------------
def position2
return self.index
end
#--------------------------------------------------------------------------
# œ •ŠíƒAƒjƒƒ^ƒCƒv
#--------------------------------------------------------------------------
def weapon_anime_type(type = @battler_condition)
file_name = weapon_anime_type0(type)
visible = weapon_anime_type1(type)
z = weapon_anime_type2(type)
motion = weapon_anime_type3(type)
return [file_name,visible,z,motion]
end
# •ŠíƒAƒCƒRƒ“Žæ“¾
def weapon_anime_type0(type = @battler_condition)
type = ANIME[type][5]
return weapon_anime1 if type == "Right"
return weapon_anime2 if type == "Left"
return nil
end
# •\Ž¦E”ñ•\Ž¦‚̎擾
def weapon_anime_type1(type = @battler_condition)
return ANIME[type][3]
end
# ƒoƒgƒ‰[‚æ‚èã‚É•\Ž¦‚·‚é‚©‚Ç‚¤‚©
def weapon_anime_type2(type = @battler_condition)
type = ANIME[type][5]
return true if type == "Left"
return false
end
# •Ší‚Ì“®ìNoDŽæ“¾
def weapon_anime_type3(type = @battler_condition)
type = ANIME[type][5]
return extend_weapon_anime1 if type == "Right"
return extend_weapon_anime2 if type == "Left"
return 0
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾(ƒJƒƒ‰•â³–³‚µ)
#--------------------------------------------------------------------------
def true_x
return PARTY_X + position * FORMATION_X + @ox
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾(ƒJƒƒ‰•â³–³‚µ)
#--------------------------------------------------------------------------
def true_y
# ƒp[ƒeƒB“à‚Ì•À‚я‡‚©‚ç Y À•W‚ðŒvŽZ‚µ‚Ä•Ô‚·
if self.index != nil
y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
return y
else
return 0
end
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
def screen_x(true_x = self.true_x)
return 320 + (true_x - 320) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def screen_y(true_y = self.true_y)
return true_y * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Z À•W‚̎擾
#--------------------------------------------------------------------------
def screen_z
return screen_y + 1000
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾(ˆÚ“®‚È‚Ç‚µ‚Ä‚¢‚È‚¢ê‡)
#--------------------------------------------------------------------------
def base_x
return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def base_y
return (true_y - @oy) * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Šg‘å—¦‚̎擾
#--------------------------------------------------------------------------
def zoom
return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
(true_x + @fly) / 480 + $scene.zoom_rate[0]
end
#--------------------------------------------------------------------------
# œ UŒ‚—pAƒoƒgƒ‹‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
def attack_x(z)
return (320 - true_x) * z * 0.75
end
#--------------------------------------------------------------------------
# œ UŒ‚—pAƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def attack_y(z)
return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
end
#--------------------------------------------------------------------------
# œ ‘M‚«‘Ò‚¿ŽžŠÔ
#--------------------------------------------------------------------------
def flash_duration
return $scene.flash_duration
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def battle_actions1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.battle_actions : BattleActions::Actions["’ʏíUŒ‚"]
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def battle_actions2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.battle_actions : BattleActions::Actions["’ʏíUŒ‚"]
end
#--------------------------------------------------------------------------
# œ •ŠíƒAƒjƒ[ƒVƒ‡ƒ“ “®‚«•û Žæ“¾
#--------------------------------------------------------------------------
def extend_weapon_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.anime : 0
end
#--------------------------------------------------------------------------
# œ •ŠíƒAƒjƒ[ƒVƒ‡ƒ“ “®‚«•û Žæ“¾
#--------------------------------------------------------------------------
def extend_weapon_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.anime : 0
end
#--------------------------------------------------------------------------
# œ •ŠíƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def weapon_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.icon_name : ""
end
#--------------------------------------------------------------------------
# œ •ŠíƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def weapon_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.icon_name : ""
end
#--------------------------------------------------------------------------
# œ ‰“‹——£ƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def flying_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.flying_anime : [0,0,false,false]
end
#--------------------------------------------------------------------------
# œ ‰“‹——£ƒAƒjƒ[ƒVƒ‡ƒ“Žæ“¾
#--------------------------------------------------------------------------
def flying_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.flying_anime : [0,0,false,false]
end
#--------------------------------------------------------------------------
# œ ˆÚ“®–Ú•WÀ•W‚ÌŒvŽZ
#--------------------------------------------------------------------------
def move_setup
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
case @move_action[0]
when "self" # Ž©•ª
@target_x = self.base_x
@target_y = self.base_y
when "target_near" # ˆê”Ô‹ß‚­‚̃^[ƒQƒbƒg
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
targets.reverse!
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target_far" # ˆê”Ô‰“‚­‚̃^[ƒQƒbƒg
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target" # ƒ^[ƒQƒbƒg’†‰›
@target_x = 0
@target_y = 0
for t in targets
@target_x += t.screen_x
@target_y += t.screen_y
end
if targets != []
@target_x /= targets.size
@target_y /= targets.size
end
when "troop" # "ƒgƒ‹[ƒv’†‰›"
@target_x = 0
@target_y = 0
for t in $game_troop.enemies
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_troop.enemies != []
@target_x /= $game_troop.enemies.size
@target_y /= $game_troop.enemies.size
end
when "party" # "ƒp[ƒeƒB’†‰›"
@target_x = 0
@target_y = 0
for t in $game_party.actors
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_party.actors != []
@target_x /= $game_party.actors.size
@target_y /= $game_party.actors.size
end
when "screen" # "‰æ–Ê"
@target_x = self.base_x
@target_y = self.base_y
end
# •â³
@target_x += @move_action[1] - self.base_x
@target_y += @move_action[2] - self.base_y
# ˆÚ“®–Ú•W‚̍À•W‚ðƒZƒbƒg
@move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
# ‹——£‚ÌŒvŽZ(ƒEƒGƒCƒg‚̐ݒè)
@move_wait = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
end
end
#==============================================================================
# ¡ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# œ ƒZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
alias side_view_initialize initialize
def initialize(troop_id, member_index)
side_view_initialize(troop_id, member_index)
start_battle
end
def character_name
return battler_name
end
def character_hue
return battler_hue
end
def reverse
return !@reverse
end
#--------------------------------------------------------------------------
# œ ˆÚ“®
#--------------------------------------------------------------------------
def move
# ‹——£‚ÌŒvŽZ
@move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
if @move_distance > 0
return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
array = @move_coordinates
# ƒWƒƒƒ“ƒv•â³’l‚ÌŒvŽZ
n = 100.0 * @move_wait / @move_distance
jump = -@move_action[4] * n * (100 - n) / 100.0
@ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
@oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
# ƒEƒGƒCƒg
@move_wait -= @move_action[3]
@move_wait = [@move_wait,0].max
end
end
#--------------------------------------------------------------------------
# œ ˆÚ“®–Ú•WÀ•W‚ÌŒvŽZ
#--------------------------------------------------------------------------
def move_setup
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
case @move_action[0]
when "self" # Ž©•ª
@target_x = self.base_x
@target_y = self.base_y
when "target_near" # ˆê”Ô‹ß‚­‚̃^[ƒQƒbƒg
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target_far" # ˆê”Ô‰“‚­‚̃^[ƒQƒbƒg
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
targets.reverse!
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target" # ƒ^[ƒQƒbƒg’†‰›
@target_x = 0
@target_y = 0
for t in targets
@target_x += t.screen_x
@target_y += t.screen_y
end
if targets != []
@target_x /= targets.size
@target_y /= targets.size
end
when "party" # "ƒgƒ‹[ƒv’†‰›"
@target_x = 0
@target_y = 0
for t in $game_troop.enemies
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_troop.enemies != []
@target_x /= $game_troop.enemies.size
@target_y /= $game_troop.enemies.size
end
when "troop" # "ƒp[ƒeƒB’†‰›"
@target_x = 0
@target_y = 0
for t in $game_party.actors
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_party.actors != []
@target_x /= $game_party.actors.size
@target_y /= $game_party.actors.size
end
when "screen" # "‰æ–Ê"
@target_x = self.base_x
@target_y = self.base_y
end
# •â³
@target_x -= @move_action[1] + self.base_x
@target_y -= @move_action[2] + self.base_y
# ˆÚ“®–Ú•W‚̍À•W‚ðƒZƒbƒg
@move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
# ‹——£‚ÌŒvŽZ(ƒEƒGƒCƒg‚̐ݒè)
@move_wait = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
end
if RTAB
alias original_x true_x
alias original_y true_y
else
alias original_x screen_x
alias original_y screen_y
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾(ƒJƒƒ‰•â³–³‚µ)
#--------------------------------------------------------------------------
def true_x
return original_x + @ox
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾(ƒJƒƒ‰•â³–³‚µ)
#--------------------------------------------------------------------------
def true_y
return original_y - @height / 2 + @oy
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
def screen_x(true_x = self.true_x)
return true_x * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
def screen_y(true_y = self.true_y)
return true_y * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾(ˆÚ“®‚È‚Ç‚µ‚Ä‚¢‚È‚¢ê‡)
#--------------------------------------------------------------------------
def base_x(true_x = self.true_x)
return (true_x - @ox) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾(ˆÚ“®‚È‚Ç‚µ‚Ä‚¢‚È‚¢ê‡)
#--------------------------------------------------------------------------
def base_y(true_y = self.true_y)
return (true_y - @oy) * @real_zoom + @real_y
end
end
#==============================================================================
# ¡ Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[‚ð‰Á‚¦‚é
# actor_id : ƒAƒNƒ^[ ID
#--------------------------------------------------------------------------
alias side_view_add_actor add_actor
def add_actor(actor_id)
# ƒAƒNƒ^[‚ðŽæ“¾
actor = $game_actors[actor_id]
# ƒTƒCƒhƒrƒ…[ƒf[ƒ^‚̏‰Šú‰»
actor.start_battle
# –ß‚·
side_view_add_actor(actor_id)
end
end
#==============================================================================
# ¡ Scene_Battle
#==============================================================================
class Scene_Battle
include Side_view
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_reader :phase # ƒtƒF[ƒY
attr_reader :phase4_step # ƒtƒF[ƒY‚SƒXƒeƒbƒv
attr_reader :active_battler # ‘Ώۂ̔z—ñ
attr_reader :target_battlers # ‘Ώۂ̔z—ñ
attr_reader :animation1_id # s“®ƒAƒjƒID
attr_reader :animation2_id



Mon site perso et la démo http://deltaproduction.free-h.net/index.html
Téléchargez Yggdrasil la quête du dragon de sang: (05/08/2016) 28 Heures de jeu


Nouvelle démo Sentinelles du (20/07/2016) Environ 6H de jeu


Nouvelle démo La Chute d'Atalanta du (18/06/2016) Environ 1H30 de jeu

Delta

Star
Delta
  • Messages : 2420

Compétence Drain et jet d'armes en combat. XP


jeu. 06 mars 2014 - 02h18

Bon la première partie est résolue. Maintenant j'ai un problème avec mon script de Blue magic.

#_______________________________________________________________________________
# MOG_Blue Magic V1.3
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Permite que os personagens aprendam as magias dos inimigos.
# Para definir quais magias serão aprendidas devemos criar um
# atributo com o nome de "Blue Skill" e atribuir à habilidade
# desejada, e após isso criar uma classe com o nome de "Blue Mage"
# e atribuí-lo aos personagens que poderão aprender as magias.
#_______________________________________________________________________________
module MOG
#Nome da classe que poderá aprender as magias.
CLASS_LEARN = "Famillier"
#Nome do atributo do banco do dados.(Skills que poderão ser
#aprendidas)
ELE_LEARN = "Magie Bleue"
#Texto apresentado quando se aprende a Magia.
TEXT_LEARN = "Appris"
#Definição do som quando se aprende a Magia.
SE_LEARN = "056-Right02"
end
#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# Update Status
#--------------------------------------------------------------------------
alias mog55_update_phase4_step6 update_phase4_step6
def update_phase4_step6
if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.kind == 1
for tr in @target_battlers
if not tr.dead?
learn_skill(tr,@active_battler.current_action.skill_id)
end
end
end
mog55_update_phase4_step6
end
#--------------------------------------------------------------------------
# learn_skill
#--------------------------------------------------------------------------
def learn_skill(tr, skill_id)
unless tr.skill_learn?(skill_id)
if @skill.element_set.include?($data_system.elements.index(MOG::ELE_LEARN)) and
tr.class_name == MOG::CLASS_LEARN
tr.learn_skill(skill_id)
tr.damage = MOG::TEXT_LEARN
tr.damage_pop = true
Audio.se_play("Audio/SE/" + MOG::SE_LEARN, 100, 100) rescue nil
end
return true
end
return false
end
end
$mog_rgss_Blue_Magic = true


Quand un ennemi utilise une compétence contre lui même, un truc regenerateur. Le script blue magic fait buguer et si je le met avant le scene battle là l'ennemi ne peut simplement même pas essayer de faire soin c'est comme si cela n'existait pas. Je ne veux pas abandonner ce système de magie bleue si les ennemis ne peuvent plus se soigner bon ben c'est pas trop grâve mais si quequ'un peut s'y pencher dessus.



Mon site perso et la démo http://deltaproduction.free-h.net/index.html
Téléchargez Yggdrasil la quête du dragon de sang: (05/08/2016) 28 Heures de jeu


Nouvelle démo Sentinelles du (20/07/2016) Environ 6H de jeu


Nouvelle démo La Chute d'Atalanta du (18/06/2016) Environ 1H30 de jeu

Ssozi

Expert
Ssozi
  • Messages : 1166

Compétence Drain et jet d'armes en combat. XP


jeu. 06 mars 2014 - 02h53

Je sais que c'est beaucoup te demander, mais est-ce que ça serait possible que tu transmettes une démo avec les scripts dedans et un exemple please? Je pense que ça m'avancerait beaucoup !



Delta

Star
Delta
  • Messages : 2420

Compétence Drain et jet d'armes en combat. XP


jeu. 06 mars 2014 - 13h11

Je te transmets une démo même avec les script de base cela bugue. Parle au personnage. Lors du combat si les fantômes font vigueur sur eux même ou mur ou barrière cela bugue de la même façon chez moi même avec mon CBS.


https://www.mediafire.com/?s8p98sb6is4z8j9

Ne te fie pas au script défense il ne change rien. Il n'y a que le script Mog Blue Magic qui bugue.



Mon site perso et la démo http://deltaproduction.free-h.net/index.html
Téléchargez Yggdrasil la quête du dragon de sang: (05/08/2016) 28 Heures de jeu


Nouvelle démo Sentinelles du (20/07/2016) Environ 6H de jeu


Nouvelle démo La Chute d'Atalanta du (18/06/2016) Environ 1H30 de jeu

Ssozi

Expert
Ssozi
  • Messages : 1166

Compétence Drain et jet d'armes en combat. XP


jeu. 06 mars 2014 - 17h17

Essaie ça :

Spoiler

#_______________________________________________________________________________
# MOG_Blue Magic V1.3
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Permite que os personagens aprendam as magias dos inimigos.
# Para definir quais magias serão aprendidas devemos criar um
# atributo com o nome de "Blue Skill" e atribuir à habilidade
# desejada, e após isso criar uma classe com o nome de "Blue Mage"
# e atribuí-lo aos personagens que poderão aprender as magias.
#_______________________________________________________________________________
module MOG
#Nome da classe que poderá aprender as magias.
CLASS_LEARN = "Famillier"
#Nome do atributo do banco do dados.(Skills que poderão ser
#aprendidas)
ELE_LEARN = "Magie Bleue"
#Texto apresentado quando se aprende a Magia.
TEXT_LEARN = "Appris"
#Definição do som quando se aprende a Magia.
SE_LEARN = "056-Right02"
end
#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# Update Status
#--------------------------------------------------------------------------
alias mog55_update_phase4_step6 update_phase4_step6
def update_phase4_step6
if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.kind == 1
for tr in @target_battlers
if not tr.dead?
learn_skill(tr,@active_battler.current_action.skill_id)
end
end
end
mog55_update_phase4_step6
end
#--------------------------------------------------------------------------
# learn_skill
#--------------------------------------------------------------------------
def learn_skill(tr, skill_id)
return if tr.is_a?(Game_Enemy)
unless tr.skill_learn?(skill_id)
if @skill.element_set.include?($data_system.elements.index(MOG::ELE_LEARN)) and
tr.class_name == MOG::CLASS_LEARN
tr.learn_skill(skill_id)
tr.damage = MOG::TEXT_LEARN
tr.damage_pop = true
Audio.se_play("Audio/SE/" + MOG::SE_LEARN, 100, 100) rescue nil
end
return true
end
return false
end
end
$mog_rgss_Blue_Magic = true


On est d'accord que le script ne fonctionne que pour les personnages et non les monstres, hein?



Delta

Star
Delta
  • Messages : 2420

Compétence Drain et jet d'armes en combat. XP


jeu. 06 mars 2014 - 17h38

C'est parfait. Merci !

Vous pouvez déplacer à résolu. je préfère pas m'y tenter.



Mon site perso et la démo http://deltaproduction.free-h.net/index.html
Téléchargez Yggdrasil la quête du dragon de sang: (05/08/2016) 28 Heures de jeu


Nouvelle démo Sentinelles du (20/07/2016) Environ 6H de jeu


Nouvelle démo La Chute d'Atalanta du (18/06/2016) Environ 1H30 de jeu