#==============================================================================
# ■ Sideview Battle System Configurations [3.3d] (English Translation v2.6)
#------------------------------------------------------------------------------
# Original Script by:
# Enu ( http://rpgex.sakura.ne.jp/home/ )
# English Localization:
# Kylock, Mr. Bubble, Shu
# Contributors & Special Thanks:
# Shu, Moonlight, NightWalker, Enelvon, Atoa, AlphaWhelp,
# blackmorning, Mithran, Kaduki, Enu
# (See [Credits] for more information)
#==============================================================================
#==============================================================================
# ■ module N01
#------------------------------------------------------------------------------
# Sideview Battle System Config
#==============================================================================
module N01
#--------------------------------------------------------------------------
# ● Settings
#--------------------------------------------------------------------------
# Battle member starting positions
# Position 1, Pos. 2, Pos. 3, Pos. 4
# X Y X Y X Y X Y
ACTOR_POSITION = [[415,150],[435,180],[455,210],[475,240]]
# Maximum party members that can fight at the same time.
# Remember to add/remove coordinates in ACTOR_POSITION if you adjust
# the MAX_MEMBER value.
MAX_MEMBER = 4
# Delay after a battler completes an action in frames.
ACTION_WAIT = 12
# Delay before enemy collapse (defeat of enemy) animation in frames.
COLLAPSE_WAIT = 12
# Delay before victory is processed in frames.
WIN_WAIT = 70
# Text that appears in Help Window when Guard is used.
GUARD_HELP_TEXT = "Guards"
# Text that appears in Help Window when escaping from battle.
ESCAPED_HELP_TEXT = "Escaped"
# BattleFloor display options: FLOOR = [ X-pos, Y-pos, Opacity]
FLOOR = [0,96,128]
# BattleFloor image file in the System folder. If "", none is used.
BATTLEFLOOR_GRAPHIC = "BattleFloor"
# Emotion Balloon graphics file in the System folder. Balloons used in battle
# can be different than those used in a game map. Balloon file must be
# 10x8 frames, similar to the RTP Balloons.
BALLOON_GRAPHICS = "Balloon"
# Animation ID for any unarmed attack.
NO_WEAPON = 82
# Damage modifications when using two weapons. Values are percentages.
# 2nd Wpn value will also directly affect skill damage caused by actors
# while wielding two weapons. Be aware of this when adjusting 2nd Wpn value.
# 1st Wpn, 2nd Wpn
TWO_SWORDS_STYLE = [100,100]
# Revivial Animation ID when revived by an Auto-Life State
RESURRECTION = 41
# Damage POP image file name located in the System folder. Numbers are
# arranged 0 to 9.
DAMAGE_GRAPHICS = "Number+"
# Image file for recovery numbers.
RECOVER_GRAPHICS = "Number-"
# true: Use separate number graphics for MP recovery and damage.
# false: Use original method which uses DAMAGE_GRAPHICS and RECOVER_GRAPHICS
# for MP recovery and damage.
USE_MP_POP_GRAPHICS = true
# Image file for MP damage numbers.
MP_DAMAGE_GRAPHICS = "MP_Number+"
# Image file for MP recovery numbers.
MP_RECOVER_GRAPHICS = "MP_Number-"
# Distance adjustment (in pixels) between POP Damage digits. Can be negative.
NUM_INTERBAL = -12
# Duration (in frames) POP numbers are displayed.
NUM_DURATION = 68
# true: Disable Window skin behind the POP Window such as from state names.
# false: POP Window skin is used.
NON_DAMAGE_WINDOW = false
# POP Window indicator text. For no text results, use "".
POP_DAMAGE0 = "" # Attack results 0 damage
POP_MISS = "MISS" # Attack missed
POP_EVA = "EVADE" # Attack avoided
POP_CRI = "CRITICAL" # Attack scored a critical hit
POP_MP_DAM = "MP DAMAGE" # Attack caused MP loss
POP_MP_REC = "MP RECOVER" # Attack restored MP
# Set to false to remove shadow under all battlers in all cases.
SHADOW = true
# true: Use actor's walking graphic.
# false: Don't use actor's walking graphic.
# If false, battler file with "_1" is required since walking graphic file
# is not used. "_1" and subsequent files ("_2", "_3", etc.) must have
# the same length and width as the "_1" file.
WALK_ANIME = true
# Number of vertical columns in an animated battler file.
ANIME_PATTERN = 3
# Number of horizontal rows in an animated battler file.
ANIME_KIND = 4
# Set true to enable back attacks.
BACK_ATTACK = true
# Set true to reverse actors in event of back attack. Not functional.
BACK_ATTACK_NON_BACK_MIRROR = true
# Set equipment and skills to protect against back attacks
# Defined equipment must be equipped to take effect, skills must be aquired
# and switches must be ON.
# For a single weapon: = [1] or Multiple Weapons: = [1,2]
# Weapon IDs
NON_BACK_ATTACK_WEAPONS = []
# Shield IDs
NON_BACK_ATTACK_ARMOR1 = []
# Helmet IDs
NON_BACK_ATTACK_ARMOR2 = []
# Armor IDs
NON_BACK_ATTACK_ARMOR3 = []
# Accessory IDs
NON_BACK_ATTACK_ARMOR4 = []
# Skill IDs
NON_BACK_ATTACK_SKILLS = []
# Switch IDs (takes precedence over everything else) If switch is ON,
# Back attack guaranteed.
BACK_ATTACK_SWITCH = []
# If another Game_Battler method can alter immortality put the name
# here in quotes
# Example: ["my_script_set_immortal"]
# The method will then automatically assign 'non_dead' to the correct value.
# This is unecessary unless another script can change the value of @immortal
# through a nonstandard accessor. Otherwise, ignore this.
IMMORTALITY_CHANGING_METHODS = ["your_method_here"] # (untested)
#==============================================================================
# ■ ANIME Engine
#------------------------------------------------------------------------------
# ANIME hashes are utilized by ACTION sequences and have no utility alone.
#==============================================================================
# An ANIME hash cannot be used by itself unless it is used as part of an
# ACTION sequence.
ANIME = {
#--------------------------------------------------------------------------
# ● Battler Frame Animations
#--------------------------------------------------------------------------
# No. - Battler graphic file used.
# 0: Normal Battler Graphic. In the case of Actors, 0 refers to
# default walking graphic.
# n: "Character Name + _n", where n refers to the file number
# extension. An example file would be "$Ralph_1". These
# files are placed in the Characters folder.
# Use "_1" for non-standard battler, like Minkoff's or Kaduki.
#
# Row - Vertical position (row) of frames in battler graphic file. (0~3)
# Speed - Refresh rate of animation. Lower numbers are faster.
# Loop - [0: "Round-Trip" Loop] Example: 1 2 3 2 1 2 3 2 1 ...
# [1: "One-Way" Loop] Example: 1 2 3 1 2 3 1 2 3 ...
# [2: One Loop, no repeat] Example: 1 2 3 .
# Wait - Time, in frames, before animation loops again.
# Does not apply if Loop=2
# Fixed - Defines loop behavior or specific fixed frame display.
# -2: Reverse Loop Animation. Also reverses weapon animation.
# -1: Normal Loop Animation
# 0~2: Fixed frame display. Refers to frame on character sprite
# sheet starting where 0 = left-most frame.
# Z - Set battler's Z priority.
# Shadow - Set true to display battler shadow during animation; false to hide.
# Weapon - Weapon Animation to play with battler frame animation. For no
# weapon animation, use "".
#--------------------------------------------------------------------------
# ● Weapon Animations
#--------------------------------------------------------------------------
# Weapon Animations can only be used within Battler Frame Animation hashes
# as defined above.
#
# The amount of frames a Weapon Animation has is equal to ANIME_PATTERN.
#
# Xa - Distance weapon sprite is moved on the X-axis.
# Ya - Distance weapon sprite is moved on the Y-axis. Please note that
# the Y-axis is inverted. This means negative values move up, positive
# values move down.
# Za - If true, weapon sprite is displayed over battler sprite.
# If false, weapon sprite is displayed behind battler sprite.
# A1 - Starting angle of weapon sprite rotation. Negative numbers will
# result in counter-clockwise rotation.
# A2 - Ending angle of weapon sprite rotation. Rotation will stop here.
# Or - Rotation Origin - [0: Center] [1: Upper Left] [2: Upper Right]
# [3:Bottom Left] [4:Bottom Right]
# Inv - Invert - If true, horizontally inverts weapon sprite.
# Xs - X scale - Stretches weapon sprite horizontally by a factor of X.
# Values may be decimals. (0.6, 0.9, etc.)
# Ys - Y scale - Stretches weapon sprite vertically by a factor of Y.
# Values may be decimals. (0.6, 0.9, etc.)
# Xp - X pitch - For adjusting the X axis. This number changes the initial
# X coordinate.
# Yp - Y pitch - For adjusting the Y axis. This number changes the initial
# Y coordinate.
# Weapon2 - If set to true, Two Weapon Style's Weapon 2 sprite will be used
# instead.
#--------------------------------------------------------------------------
# ● Battler Movements
#--------------------------------------------------------------------------
# Battler Movement hashes control the movement of battlers in the battle
# scene.
#
# Origin - Defines the origin of movement based on an (x,y) coordinate plane.
# [0: Battler's Current Position]
# [1: Battler's Selected Target]
# [2: Screen; (0,0) is at upper-left of screen]
# [3: Battle Start Position]
# X - X-axis pixels from origin. 1 unit = 1 pixel
# Y - Y-axis pixels from origin. Please note that the Y-axis is
# inverted. This means negative values move up, positive values
# move down. 1 unit = 1 pixel
# Time - Total travel time from starting to end point.
# Larger numbers are slower.
# Accel - Positive values accelerates frames. Negative values decelerates.
# Jump - Negative values produce a jumping arc. Positive values produce
# a reverse arc. [0: No jump]
# Animation - Battler Frame Animation utilized during moving.
#--------------------------------------------------------------------------
# ● Battler Float Animations
#--------------------------------------------------------------------------
# Battler Float Animation hashes define the movement of battlers from their
# own shadows. Note that it is not possible to move horizontally with
# Battler Movements hashes while simultaneously floating from a shadow.
#
# Type - Always "float".
# A - Starting float height. Negative values move up.
# Positive values move down.
# B - Ending float height. This height is maintained until another action
# is used.
# Time - Total duration of movement from point A to point B
# Animation - Specifies the Battler Frame Animation to be used.
#--------------------------------------------------------------------------
# ● Battler Position Reset
#--------------------------------------------------------------------------
# Battler Position Reset hashes define when a battler's turn is over and
# will reset the battler back to its starting coordinates. This type of
# ANIME hash is required in all sequences.
#
# Please note that after a sequence has used a Battler Position Reset hash,
# no more damage can be done by the battler because its turn is over.
#
# Type - Always "reset"
# Time - Total travel time from current location to start coordinates.
# Distance from start coordinates determines visual movement speed.
# Accel - Positive values accelerate. Negative values decelerate.
# Jump - Negative values produce a jumping arc. Positive values produce
# a reverse arc. [0: No jump]
# Animation Key - Specifies the Battler Frame Animation hash to be used.
#--------------------------------------------------------------------------
# ● Forced Battler Actions
#--------------------------------------------------------------------------
# These types of ANIME hash allow forced control of other battler objects
# that you define. This is particuarly used to control battlers when
# it is not their turn.
#
# Type - Specifies action type. "SINGLE" or "SEQUENCE"
#
# Object - The battler(s) that will execute the specific action defined under
# ANIME/ACTION Key. 0 is for selected target. Any other positive
# number is a State ID number (1~999) that will force all battlers
# with that State on them to execute the ANIME/ACTION Key.
# By adding a - (minus sign) followed by a Skill ID number (1~999),
# the actors that know that Skill ID will execute the defined
# ANIME/ACTION Key except the active battler.
# If you want to define a specific actor as the Object,
# add 1000 to their index ID number. If the system cannot designate
# the index number(such as if actor is dead or ran away), it will
# select the nearest one starting from 0. If a response fails,
# the action will be cancelled. (Example: Ylva's actor ID is 4. A
# value of 1004 would define Ylva as the Object.)
#
# Reset Type - Specifies method of returning the battler to its original
# location.
# ANIME/ACTION Key - Specifies action used. If Type is SINGLE,
# must be an ANIME hash key. If Type is SEQUENCE,
# must an ACTION sequence key.
#--------------------------------------------------------------------------
# ● Target Modification
#--------------------------------------------------------------------------
# Changes battler's target in battle. Original target will still be stored.
# Current battler is the only battler capable of causing damage.
#
# Type - Always "target"
#
# Object - The battler that will have its target modified. 0 is selected
# target, any other number is a State ID number (1~999), and
# changes all battlers with that state on them to target the new
# designated target.
# If you want to designate an actor by their index ID number,
# add 1000 to their index ID number. If the system cannot designate
# the index number(such as if actor is dead or ran away), it will
# select the nearest one starting from 0. If a response fails,
# the ACTION will be cancelled. (Example: Ylva's actor ID is 4. A
# value of 1004 would define Ylva as the Object.)
#
# Target - New Target. [0=Self] [1=Self's Target]
# [2=Self's Target After Modification]
# [3=Reset to Previous Target (if 2 was used)]
#--------------------------------------------------------------------------
# ● Link Skills (Derivating Skills)
#--------------------------------------------------------------------------
# Linking to the next skill will stop any current sequence. Linking to the
# next skill will also require and consume MP/HP cost of that skill. If
# the skill link is not successful, the link will be skipped and the
# sequence will continue.
#
# Type - Always "der"
# Chance - Chance, in percent, to link to the defined skill ID. (0~100)
# Learned? - true: actor does not require Skill ID learned to link.
# false: actor requires Skill ID learned.
# Skill ID - ID of the skill that will be linked to.
# ANIME Key Type Chance Learn? Skill ID
"LINK_SKILL_91" => ["der", 100, true, 91],
"LINK_SKILL_92" => ["der", 100, true, 92],
#--------------------------------------------------------------------------
# ● Action Conditions
#--------------------------------------------------------------------------
# If the condition is met, the ACTION sequence will continue processing
# normally. If the condition is not met, the battler's turn will immediately
# be ended and will reset to its start coordinate.
#
# A: Type - always "nece"
# B: Object - Object(s) that Condition refers to. [0=Self] [1=Target]
# [2=All Enemies] [3=All Allies]
# C: Content - [0=State] [1=Parameter] [2=Switch] [3=Variable] [4=Skill]
#
# D: Condition - Condition is determined by the value you set for Content.
# [0] State: State ID Number
# [1] Parameter: [0=Current HP] [1=Current MP] [2=ATK] [3=DEF] [4=SPI] [5=AGI]
# [2] Switch: Game Switch Number
# [3] Variable: Game Variable Number
# [4] Skill: Skill ID Number
#
# E: Condition Value - Value required for the Condition as defined above.
# [0] State: Exact amount of states required. If number is positive, the
# condition is how many have the state, while a negative number
# are those who don't have the state.
# [1] Parameter: If Object is more than one battler, average is used.
# Success if Parameter is greater than value. If Value
# is negative, then success if lower than value.
# [2] Switch: If Condition is 2, Condition Value must be true or false.
# [true: Switch ON succeeds] [false: Switch OFF succeeds]
# [3] Variable: Game Variable value used to determine if condition is met. If
# Condition Value is positive, Game Variable must have more
# than the defined amount to succeed. If Condition Value has a
# minus symbol (-) attached, Game Variable must have less than
# the defined amount to succeed. (Ex: -250 means the Game
# Variable must have a value less than 250 to succeed.)
# [4] Skill: Required amount of battlers that have the specified Skill
# ID learned.
# ANIME Key Type Obj Cont Cond Cond Value
# A B C D E
"2_MAN_ATK_COND" => ["nece", 3, 0, 18, 1],
"4_MAN_ATK_COND" => ["nece", 3, 0, 19, 3],
"FLOAT_STATE" => ["nece", 0, 0, 17, 1],
"LION_STATE" => ["nece", 0, 0, 20, 1],
"WOLF_STATE" => ["nece", 0, 0, 21, 1],
"LALA_STATE" => ["nece", 0, 0, 22, 1],
#--------------------------------------------------------------------------
# ● Battler Sprite Rotation
#--------------------------------------------------------------------------
# Rotates battler sprite image. Weapon Animations do not automatically
# rotate when used in conjunction with Battler Sprite Rotation ANIME hashes.
#
# Type - always "angle"
# Time - Duration duration of rotation animation in frames.
# Start - Starting angle. 0-360 degrees. Can be negative.
# End - Ending Angle. 0-360 degress. Can be negative.
# Return - true: End of rotation is the same as end of duration.
# false: Rotation animation as defined.
# ANIME Key Type Time Start End Return
"FALLEN" => ["angle", 1, -90, -90,false],
"CLOCKWISE_TURN" => ["angle", 48, 0,-360,false],
"COUNTERCLOCKWISE_TURN" => ["angle", 6, 0, 360,false],
#--------------------------------------------------------------------------
# ● Battler Sprite Zoom
#--------------------------------------------------------------------------
# Stretch and shrink battler sprites. Battler zoom is always temporary.
#
# Type - always "zoom"
# Time - Duration of zoom animation in frames.
# X - X scale - Stretches battler sprite horizontally by a factor of X.
# 1.0 is normal size, 0.5 is half size.
# Y - Y scale - Stretches battler sprite vertically by a factor of Y.
# 1.0 would be normal size, 0.5 would be half size.
# Return - true: End of rotation is the same as end of duration.
# false: Zoom animation as defined.
# ANIME Key Type Time X Y Return
"X_SHRINK" => ["zoom", 16, 0.5, 1.0, true],
"Y_SHRINK" => ["zoom", 16, 1.0, 0.5, true],
#--------------------------------------------------------------------------
# ● Damage and Database-Assigned Animations
#--------------------------------------------------------------------------
# These ANIME hashes deal with animations, particularly with those assigned
# in the Database for Weapons, Skills and Items. These are what causes
# any damage/healing/state/etc. application from Weapons, Skills and Items.
#
# A difference between "anime" and "m_a" ANIME hashes is that
# "anime" triggered animations will move with the Object on the screen. The
# Z-axis of animations will always be over battler sprites.
#
# If the "ID" variable is -1 or -2, the ANIME hash will cause damage, etc.
#
# Type - always "anime"
# ID - (-1): Uses assigned animation from game Database.
# (-2): Uses equipped Weapon animation as assigned in the Database.
# (1~999): Database Animation ID.
# Object - [0=Self] [1=Target]
# Invert - If set to true, the animation is inverted horizontally.
# Wait - true: Sequence will not continue until animation is completed.
# false: Sequence will continue regardless of animation length.
# Weapon2 - true: If wielding two weapons, damage and animation will be
# based off Weapon 2.
#--------------------------------------------------------------------------
# ● Movement and Display of Animations
#--------------------------------------------------------------------------
# Movement and Display of Animations hashes provide motion options for
# animations used for effects such as long-ranged attacks and projectiles.
# Weapon sprites can also substitute animations.
#
# A difference between "m_a" and "anime" ANIME hashes is that "m_a"
# animations will stay where the Object was even if the Object moves while
# the animation plays.
#
# Type - always "m_a"
# ID - 1~999: Database Animation ID
# 0: No database animation used.
# Object - Animation's target. [0=Target] [1=Enemy's Area]
# [2=Party's Area] [4=Self]
# Pass - [0: Animation stops when it reaches the Object.]
# [1: Animation passes through the Object and continues.]
# Time - Total travel time of animation from starting to end point. Larger
# values slow down travel speed. This value also determines the length
# of time the animation will display on screen. It is possible for
# animations to get cut short before it completes. Increase this value
# to ensure that animations don't get cut short.
# Arc - Trajectory - Positive values produce a low arc.
# Negative values produce a high arc.
# [0: No Arc]
# Xp - X Pitch - Adjusts the initial X coordinate of the animation.
# Enemy calculation will be automatically inverted.
# Yp - Y Pitch - Adjusts the initial Y coordinate of the animation.
# Start - Defines origin of animation movement.
# [0=Self] [1=Target] [2=No Movement]
# Z-axis - true: Animation will be over the battler sprite.
# false: Animation will be behind battler sprite.
# Weapon - Insert only "Throwing Weapon Rotation" and
# "Throwing Skill Rotation" ANIME keys.
# For no weapon sprite, use "".
#--------------------------------------------------------------------------
# ● Throwing Weapon Sprite Rotation
#--------------------------------------------------------------------------
# These are used to rotate weapon sprites that are "thrown" with Movement of
# Animation ANIME hashes.
# You may assign a different weapon graphic to be thrown in this
# configuration script under Throwing Weapon Graphic Settings.
#
# Start - Starting angle in degrees (0-360)
# End - Ending angle in degrees. (0-360)
# Time - Duration, in frames, of a single rotation. Rotation will continue
# until the animation is complete.
#--------------------------------------------------------------------------
# ● Throwing Skill Rotation
#--------------------------------------------------------------------------
# Different from Throwing Weapon Rotation. These ANIME hashes are used to
# rotate weapon sprites that are "thrown" with Movement of Animation ANIME
# objects. These are specifically used with skills. You may assign a different
# weapon graphic to be thrown in this configuration script under
# Throwing Weapon Graphic Settings.
#
# Start - Starting angle in degrees (0-360)
# End - Ending angle in degrees. (0-360)
# Time - Duration, in frames, of a single rotation. Rotation will continue
# until the animation is complete.
# Type - Always "skill".
# ANIME Key Start End Time Type
"WPN_THROW" => [ 0, 360, 8, "skill"],
#--------------------------------------------------------------------------
# ● Emotion Balloon Animation
#--------------------------------------------------------------------------
# Uses Balloon.png in the System folder.
#
# Type - Always "balloon"
# Row - Determines row from the Balloon.png (0~9)
# Loop - Balloon loop behavior. Balloon disappears when loop is
# complete. [0="One-Way" Loop] [1="Round-Trip" Loop]
#--------------------------------------------------------------------------
# ● Sound Effects
#--------------------------------------------------------------------------
# Provides use of sound effects, background music, and background
# sounds directly through an ACTION sequence.
#
# Type1 - always "sound"
# Type2 - ["se","bgm","bgs"]
# Pitch - Value between 50 and 150.
# Vol - Volume - Value between 0 and 100.
# Filename - Name of the sound to be played.
#--------------------------------------------------------------------------
# ● Game Speed Modifier
#--------------------------------------------------------------------------
# Change the frame rate of the game through an ACTION sequence. Use with
# care as this function modifies FPS directly and will conversly affect
# any active timers or time systems.
#
# Type - always "fps"
# Speed - Speed in Frames Per Second. 60 is normal frame rate.
#--------------------------------------------------------------------------
# ● State Granting Effects
#--------------------------------------------------------------------------
# Provides application of states on battlers directly through
# an ACTION sequence.
#
# Type - always "sta+"
# Object - [0=Self] [1=Target] [2=All Enemies] [3=All Allies]
# [4=All Allies (excluding user)]
# State ID - State ID to be granted.
#--------------------------------------------------------------------------
# ● State Removal Effects
#--------------------------------------------------------------------------
# Provides direct removal of states on battlers directly through
# an ACTION sequence.
#
# Type - always "sta-"
# Object - [0=Self] [1=Target] [2=All Enemies] [3=All Allies]
# [4=All Allies (excluding user)]
# State ID - State ID to be removed.
# ANIME Key Type Object State ID
"2_MAN_TECH_REVOKE" => ["sta-", 3, 18],
"4_MAN_TECH_REVOKE" => ["sta-", 3, 19],
#--------------------------------------------------------------------------
# ● Battler Sprite Transformation
#--------------------------------------------------------------------------
# Type - always "change"
# Reset - true: Battler sprite reverts back to previously used file after
# battle.
# false: Transformation is permanent after battle.
# Filename - Battler graphics file that will be transformed to.
#--------------------------------------------------------------------------
# ● Cut-In Image Effects
#--------------------------------------------------------------------------
# Only one image can be displayed at a time. Image can be removed by using
# "Clear image" within a sequence.
#
# X1 - Image's starting X-coordinate.
# Y1 - Starting Y-coordinate.
# X2 - Ending X-coordinate.
# Y2 - Ending Y-coordinate.
# Time - Total duration of image movement from start to end point.
# Higher values are slower.
# Z-axis - true: Image appears over BattleStatus Window.
# false: Image appears behind BattleStatus Window.
# Filename - Filename from .Graphics/Pictures folder.
#--------------------------------------------------------------------------
# ● Game Switch Settings
#--------------------------------------------------------------------------
# Provides direct control of Game Switches directly through
# an ACTION sequence.
#
# Type - Always "switch"
# Switch - Switch number from the game database.
# ON/OFF - [true:Switch ON] [false:Switch OFF]
#
# ANIME Key Type Switch ON/OFF
"GAME_SWITCH_1_ON" => ["switch", 1, true],
#--------------------------------------------------------------------------
# ● Game Variable Settings
#--------------------------------------------------------------------------
# Provides direct control of Game Variables directly through
# an ACTION sequence.
#
# Type - Always "variable"
# Var - Variable Number from the game database.
# Operand - [0=Set] [1=Add] [2=Sub] [3=Mul] [4=Div] [5=Mod]
# X - value of the operation.
#
# ANIME Key Type Var Oper X
"GAME_VAR_1_+1" => ["variable", 1, 1, 1],
#--------------------------------------------------------------------------
# ● Script Operation Settings
#--------------------------------------------------------------------------
# Type - Always "script"
#
# Inserts a simple script code into the ACTION sequence. The sample,
# where it says p=1, can be replaced with any script. Character strings can
# work if the .to_s method is used rather than quotes. Anything else beyond
# functions will not work.
# ANIME Key Type
"TEST_SCRIPT" => ["script", "
p = 1
"],
#--------------------------------------------------------------------------
# ● Special Modifiers - DO NOT CHANGE THESE NAMES
#--------------------------------------------------------------------------
# Clear image - Clears images such as Cut-in graphics.
# Afterimage ON - Activates Afterimage of battler.
# Afterimage OFF - Deactivates Afterimage.
# Invert - Invert animation. Use Invert again in a sequence to cancel
# because "COORD_RESET" does not reset Invert.
# Don't Wait - Any actions after Don't Wait is applied are done instantly.
# Apply "Don't Wait" again in a sequence to trigger off.
# Can Collapse - Triggers collapse of battler when HP is 0.
# Required in every damage sequence.
# Two Wpn Only - The ANIME key following Two Wpn Only will only execute
# if the actor is wielding two weapons. If the actor is not,
# the ANIME key will be skipped and will move on to the next.
# One Wpn Only - The ANIME key following One Wpn Only will only execute
# if the actor is wielding one weapon. If the actor is not,
# the ANIME key will be skipped and will move on to the next.
# Process Skill - The Return marker for individual processing of a skill.
# Process Skill End - The End marker for individual processing of a skill.
# Start Pos Change - Changes the Start Position to wherever the battler
# currently is on screen.
# Start Pos Return - Returns battler to original Start Position.
# Cancel Action - Trigger the "end" of battler's turn which will cause the
# the next battler's turn to execute.
# This includes the function of Can Collapse, and no
# additional damage can be dealt by the battler after this.
# End - This is used when no action is automatically recognized.
#
# Note: If you wish to understand the Process Skill and Process Skill End
# functions, please examine the "SKILL_ALL" sequence in this Config
# and use the Float All skill provided in the demo to see how it works.
#--------------------------------------------------------------------------
# ● About Sequence Delay
#--------------------------------------------------------------------------
# When there is only a numerical value as an ANIME key, it will be
# considered a delay, in frames, before the ACTION Sequence continues.
# (i.e. "10", "42") Because of this, ANIME keys for the
# effects defined above cannot be entirely numerical. Any Battler
# Frame Animations that have been prompted will persist when Waiting.
}
#==============================================================================
# ■ ACTION Sequences
#------------------------------------------------------------------------------
# ACTION sequences are made of the ANIME keys defined above.
#==============================================================================
# ACTION Sequences defined here can be used for Actor/Enemy actions below
# this section. ACTION sequences consist of ANIME keys which are defined
# in the section above.
# ACTION sequences are processed from left to right in order.
ACTION = {
#------------------------------- Basic Actions --------------------------------
#------------------------- Union Skill Sequences (ATB) ------------------------
# There is a difference between how union skill sequences are made with the
# ATB compared to without the ATB. ATB Union sequences do not require special
# states or "Action Conditions" hashes such as "4_MAN_ATK_COND". "Forced
# Battler Actions", such as "4_MAN_ATK_1", are also not required. You must
# also go in your ATB Configurations script and define your union skills
# under "ATB Union Skills Settings".
#-------------------------------------------------------------------------------
"End" => ["End"]}
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# Actor Basic Action Settings
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Actor Unarmed Attack Action Sequence
#--------------------------------------------------------------------------
# when 1 <- Actor ID number
# return "NORMAL_ATTACK" <- Corresponding ACTION sequence name.
def non_weapon
case @actor_id
when 1 # Actor ID
return "NORMAL_ATTACK"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "NORMAL_ATTACK"
end
#--------------------------------------------------------------------------
# ● Actor Wait/Idle Animation
#--------------------------------------------------------------------------
def normal
case @actor_id
when 1
return "WAIT"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● Actor Critical (1/4th HP) Animation
#--------------------------------------------------------------------------
def pinch
case @actor_id
when 1
return "WAIT-CRITICAL"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "WAIT-CRITICAL"
end
#--------------------------------------------------------------------------
# ● Actor Guarding Animation
#--------------------------------------------------------------------------
def defence
case @actor_id
when 1
return "GUARD_ATTACK"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "GUARD_ATTACK"
end
#--------------------------------------------------------------------------
# ● Actor Damage Taken Animation
#--------------------------------------------------------------------------
def damage_hit
case @actor_id
when 1
return "DAMAGE"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "DAMAGE"
end
#--------------------------------------------------------------------------
# ● Actor Evasion Animation
#--------------------------------------------------------------------------
def evasion
case @actor_id
when 1
return "EVADE_ATTACK"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "EVADE_ATTACK"
end
#--------------------------------------------------------------------------
# ● Actor Command Input Animation
#--------------------------------------------------------------------------
def command_b
case @actor_id
when 1
return "COMMAND_INPUT"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "COMMAND_INPUT"
end
#--------------------------------------------------------------------------
# ● Actor Command Selected Animation
#--------------------------------------------------------------------------
def command_a
case @actor_id
when 1
return "COMMAND_SELECT"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "COMMAND_SELECT"
end
#--------------------------------------------------------------------------
# ● Actor Flee Success Animation
#--------------------------------------------------------------------------
def run_success
case @actor_id
when 1
return "FLEE"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "FLEE"
end
#--------------------------------------------------------------------------
# ● Actor Flee Failure Animation
#--------------------------------------------------------------------------
def run_ng
case @actor_id
when 1
return "FLEE_FAIL"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "FLEE_FAIL"
end
#--------------------------------------------------------------------------
# ● Actor Victory Animation
#--------------------------------------------------------------------------
def win
case @actor_id
when 10
return "VICTORY1"
when 11
return "VICTORY2"
when 17
return "VICTORY3"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "VICTORY"
end
#--------------------------------------------------------------------------
# ● Actor Battle Start Animation
#--------------------------------------------------------------------------
def first_action
case @actor_id
when 1
return "BATTLE_START"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "BATTLE_START"
end
#--------------------------------------------------------------------------
# ● Actor Return ACTION when actions are interuptted/cancelled
#--------------------------------------------------------------------------
def recover_action
case @actor_id
when 1
return "RESET_POSITION"
end
# Default ACTION sequence for all unassigned Actor IDs.
return "RESET_POSITION"
end
#--------------------------------------------------------------------------
# ● Actor Shadow
#--------------------------------------------------------------------------
# return "shadow01" <- Image file name in .Graphics/Characters
# return "" <- No shadow used.
def shadow
case @actor_id
when 1
return "shadow00"
end
# Default shadow for all unassigned Actor IDs.
return "shadow00"
end
#--------------------------------------------------------------------------
# ● Actor Shadow Adjustment
#--------------------------------------------------------------------------
# return [ X-Coordinate, Y-Coordinate]
def shadow_plus
case @actor_id
when 1
return [ 0, 4]
end
# Default shadow positioning for all unassigned Actor IDs.
return [ 0, 4]
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
# Enemy Basic Action Settings
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Enemy Unarmed Attack Action Sequence
#--------------------------------------------------------------------------
# when 1 <- EnemyID#
# return "ENEMY_UNARMED_ATK" <- Corresponding ACTION sequence name.
def base_action
case @enemy_id
when 31
return "ENEMY_UNARMED_ATK"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "ENEMY_UNARMED_ATK"
end
#--------------------------------------------------------------------------
# ● Enemy Wait/Idle Animation
#--------------------------------------------------------------------------
def normal
case @enemy_id
when 31
return "WAIT"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● Enemy Critical (1/4th HP) Animation
#--------------------------------------------------------------------------
def pinch
case @enemy_id
when 31
return "WAIT"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● Enemy Guarding Animation
#--------------------------------------------------------------------------
def defence
case @enemy_id
when 31
return "GUARD_ATTACK"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "GUARD_ATTACK"
end
#--------------------------------------------------------------------------
# ● Enemy Damage Taken Animation
#--------------------------------------------------------------------------
def damage_hit
case @enemy_id
when 31
return "DAMAGE"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "DAMAGE"
end
#--------------------------------------------------------------------------
# ● Enemy Evasion Animation
#--------------------------------------------------------------------------
def evasion
case @enemy_id
when 31
return "ENEMY_EVADE_ATTACK"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "ENEMY_EVADE_ATTACK"
end
#--------------------------------------------------------------------------
# ● Enemy Flee Animation
#--------------------------------------------------------------------------
def run_success
case @enemy_id
when 31
return "ENEMY_FLEE"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "ENEMY_FLEE"
end
#--------------------------------------------------------------------------
# ● Enemy Battle Start Animation
#--------------------------------------------------------------------------
def first_action
case @enemy_id
when 31
return "BATTLE_START"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "BATTLE_START"
end
#--------------------------------------------------------------------------
# ● Enemy Return ACTION when action is interuptted/discontinued
#--------------------------------------------------------------------------
def recover_action
case @enemy_id
when 31
return "RESET_POSITION"
end
# Default ACTION sequence for all unassigned Enemy IDs.
return "RESET_POSITION"
end
#--------------------------------------------------------------------------
# ● Enemy Shadow
#--------------------------------------------------------------------------
# return "shadow01" <- Image file name in .Graphics/Characters
# return "" <- No shadow used.
def shadow
case @enemy_id
when 31
return "shadow01"
when 30
return ""
end
# Default shadow for all unassigned Enemy IDs.
return "shadow01"
end
#--------------------------------------------------------------------------
# ● Enemy Shadow Adjustment
#--------------------------------------------------------------------------
# return [ X-Coordinate, Y-Coordinate]
def shadow_plus
case @enemy_id
when 31
return [ 0, -8]
end
# Default shadow positioning for all unassigned Enemy IDs.
return [ 0, 0]
end
#--------------------------------------------------------------------------
# ● Enemy Equipped Weapon
#--------------------------------------------------------------------------
# return 0 (Unarmed/No weapon equipped.)
# return 1 (Weapon ID number. (1~999))
def weapon
case @enemy_id
when 31 # Enemy ID
return 02 # Weapon ID
when 32 # Enemy ID
return 02# Weapon ID
when 33 # Enemy ID
return 02 # Weapon ID
when 34 # Enemy ID
return 02 # Weapon ID
when 41 # Enemy ID
return 02 # Weapon ID
end
# Default weapon for all unassigned Enemy IDs.
return 0
end
#--------------------------------------------------------------------------
# ● Enemy Screen Positioning Adjustment
#--------------------------------------------------------------------------
# return [ 0, 0] <- [X-coordinate、Y-coordinate]
def position_plus
case @enemy_id
when 31
return [0, 0]
end
# Default positioning for all unassigned Enemy IDs.
return [ 0, 0]
end
#--------------------------------------------------------------------------
# ● Enemy Collapse Animation Settings
#--------------------------------------------------------------------------
# return 1 (Enemy sprite stays on screen after death.)
# return 2 (Enemy disappears from the battle like normal.)
# return 3 (Special collapse animation.) <- Good for bosses.
def collapse_type
case @enemy_id
when 31
return 2
when 30
return 3
end
# Default collapse for all unassigned Enemy IDs.
return 2
end
#--------------------------------------------------------------------------
# ● Enemy Multiple Actions Settings
#--------------------------------------------------------------------------
# Maximum Actions, Probability, Speed Adjustment
# return [ 2, 100, 100]
#
# Maximum Actions - Maximum number of actions enemy may execute in a turn.
# Probability - % value. Chance for a successive action.
# Speed Adjustment - % value that decreases enemy's speed after
# each successive action.
def action_time
case @enemy_id
when 31
return [ 1, 100, 100]
end
# Default multi-action setting for all unassigned Enemy IDs.
return [ 1, 100, 100]
end
#--------------------------------------------------------------------------
# ● Enemy Animated Battler Settings
#--------------------------------------------------------------------------
# return true - Enemy battler uses same animation frames as actor graphics.
# return false - Default enemy battler.
# [Settings]
# 1.Enemy animated battler file must be in .Graphics/Characters folder.
# 2.Enemy battler file names must match between .Graphics/Characters and
# .Graphics/Battlers folders.
def anime_on
case @enemy_id
when 31
return true
end
# Default animation setting for all unassigned Enemy IDs.
return true
end
#--------------------------------------------------------------------------
# ● Enemy Invert Settings
#--------------------------------------------------------------------------
# return false <- Normal
# return true <- Inverts enemy image
def action_mirror
case @enemy_id
when 31
return true
when 32
return true
when 33
return true
when 34
return true
when 38
return true
when 39
return true
when 40
return true
when 41
return true
when 42
return true
when 43
return true
end
# Default invert setting for all unassigned Enemy IDs.
return false
end
end
module RPG
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# State Action Settings
#==============================================================================
class State
#--------------------------------------------------------------------------
# ● State Affliction Wait Sequence Settings
#--------------------------------------------------------------------------
# When a battler is affected by a state, their Wait/Idle sequence will be
# replaced by the ACTION sequence defined for the State IDs below. Only one
# State Affliction Wait Animation can be active at a time. The state with the
# highest Priority rating will take precedence if affected by multiple states.
#
# when 1 <- State ID number
# return "DEAD" <- ACTION sequence when afflicted by specified state.
def base_action
case @id
when 1 # Incapacitated(HP0). Has the highest priority.
return "DEAD"
when 2,3,4,5,7
return "WAIT-NORMAL"
when 6
return "WAIT-SLEEP"
when 17
return "WAIT-FLOAT"
end
# Default ACTION sequence for all unassigned State IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● State Enhancement Extension Settings
#--------------------------------------------------------------------------
# Note about REFLECT and NULL states:
# An item/skill is considered physical if "Physical Attack" is
# checked under "Options" in your Database. Otherwise, it is magical.
#
# "AUTOLIFE/50" - Automatically revives when Incapacitated.
# Value after "/" is % of MAXHP restored when revived.
# "MAGREFLECT/39" - Reflects magical skills to the original caster.
# Value after "/" is Animation ID when triggered.
# "MAGNULL/39" - Nullify magical skills and effects.
# Value after "/" is Animation ID when triggered.
# "PHYREFLECT/39" - Reflects physical skills to the original caster.
# Value after "/" is Animation ID when triggered.
# "PHYNULL/39" - Nullify physical skills and effects.
# Value after "/" is Animation ID when triggered.
# "COSTABSORB" - Absorbs the MP (or HP) cost of an incoming skill when
# affected. This will not appear as POP Damage. This
# function is similar to Celes' "Runic" from FF6.
# "ZEROTURNLIFT" - State is lifted at the end of turn regardless.
# "EXCEPTENEMY" - Enemies will not use ACTION sequence assigned
# under State Affliction Wait Animation Settings when
# afflicted. (Actors still will.)
# "NOPOP" - State name will not appear as POP Window.
# "HIDEICON" - State icon will not appear in the BattleStatus Window.
# "NOSTATEANIME" - State's caster and enemies will not use animation
# sequence assigned under State Affliction Wait Sequence
# Settings when afflicted.
# "SLIPDAMAGE" - Apply slip damage. Assign values under Slip Damage Settings.
# "NONE" - No extension. Used as a default.
def extension
case @id
when 1 # Incapacitated State. Has highest priority.
return ["NOPOP","EXCEPTENEMY"]
when 2 # Poison
return ["SLIPDAMAGE"]
when 18 # 2-Man Tech
return ["ZEROTURNLIFT","HIDEICON"]
when 19 # 4-Man Tech
return ["ZEROTURNLIFT","HIDEICON"]
end
# Default extensions for all unassigned State IDs.
return ["NONE"]
end
#--------------------------------------------------------------------------
# ● Slip Damage Settings
#--------------------------------------------------------------------------
# Also includes regeneration options.
#
# when 1 <- State ID. Slip Damage only applies if "SLIPDAMAGE" is assigned above.
# Multiple settings may be applied. Ex)[["hp",0,5,true],["mp",0,5,true]]
#
# Type, Constant, %, POP?, Allow Death
# return [["hp", 0, 10, true, true]]
#
# Type – "hp" or "mp".
# Constant – Set a constant value to apply each turn.
# Positive values are damage. Negative values are recovery.
# % - Set a percentage value to apply each turn based on MAX HP/MP.
# Positive values are damage. Negative values are recovery.
# POP? - Determines whether or not you want slip damage value to
# appear as POP Damage.
# Allow Death - This function is not working - true: Slip damage can kill.
# false: Slip damage will not kill. (Battler will be left at 1 HP)
def slip_extension
case @id
when 2 # Poison
return [["hp", 0, 10, true, true]]
end
return []
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# Weapon Action Settings
#==============================================================================
class Weapon
#--------------------------------------------------------------------------
# ● Weapon Action Sequence Settings
#--------------------------------------------------------------------------
# Assigns a specific ACTION sequence when using a weapon.
#
# when 1 <- Weapon ID number
# return "NORMAL_ATTACK" <- ACTION sequence for assigned Weapon ID.
def base_action
case @id
when 34
return "THROW_WEAPON"
when 36
return "THROW_WEAPON"
when 37
return "THROW_WEAPON"
when 38
return "THROW_WEAPON"
end
# Default ACTION sequence for unassigned Weapon IDs.
return "NORMAL_ATTACK"
end
#--------------------------------------------------------------------------
# ● Weapon Graphic Settings
#--------------------------------------------------------------------------
# Allows use of a seperate weapon graphic besides the one assigned
# from Iconset.png
#
# return "001-Weapon01" <- Weapon image file name. If "", none is used.
# File must be in the .Graphics/Characters folder
# of your project.
def graphic
case @id
when 1
return ""
end
# Default weapon graphic for unassigned Weapon IDs.
return ""
end
#--------------------------------------------------------------------------
# ● Throwing Weapon Graphic Settings
#--------------------------------------------------------------------------
# Allows use of a seperate throwing weapon graphic besides the one assigned
# from Iconset.png. This is useful for arrows when you don't want the bow
# to be thrown.
#
# return "001-Weapon01" <- Weapon image file name. If "", none is used.
# File must be in the .Graphics/Characters folder
# of your project.
def flying_graphic
case @id
when 1
return ""
end
# Default throwing weapon graphic for unassigned Weapon IDs.
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# Skill Settings
#==============================================================================
class Skill
#--------------------------------------------------------------------------
# ● Skill ID Sequence Assignments
#--------------------------------------------------------------------------
# Assign a Skill ID from the Database to execute a defined ACTION sequence.
# Only ACTION sequence keys can be assigned. ANIME keys cannot
# be directly assigned here.
def base_action
case @id
when 84 # Skill ID
return "THROW_WEAPON" # ACTION Sequence
when 85
return "MULTI_ATTACK"
when 86
return "RAPID_MULTI_ATTACK"
when 87
return "MULTI_SHOCK"
when 88
return "SHOCK_WAVE"
when 89
return "MULTI_ATTACK_RAND"
when 90
return "SKILL_90_SEQUENCE"
when 91
return "SKILL_91_SEQUENCE"
when 92
return "NORMAL_ATTACK"
when 93
return "CUT_IN"
when 94
return "STOMP"
when 95
return "ALL_ATTACK_1"
when 96
return "SKILL_ALL"
when 97
return
when 98
return "2-MAN_UNION_RALPH"
when 99
return "2-MAN_UNION_ULRIKA"
when 100
return "4-MAN_UNION_RALPH"
when 101
return "4-MAN_UNION_ULRIKA"
when 102
return "4-MAN_UNION_BENNETT"
when 103
return "4-MAN_UNION_YLVA"
when 104
return "THROW_FRIEND"
when 105
return "TRANSFORM_WOLF"
when 109
return "TRANSFORM_LION"
when 110
return "TRANSFORM_LALA"
when 108
return "射击"
end
# Default ACTION sequence for unassigned Skill IDs.
return "SKILL_USE"
end
#--------------------------------------------------------------------------
# ● Skill Enhancement Extension Settings
#--------------------------------------------------------------------------
# Multiple extensions may be applied to a skill ID.
# If "CONSUMEHP" is applied along with any other extensions that deal with
# MP Cost, it will be HP instead.
# This script WILL have compatibility issues with KGC_MPCostAlter.
#
# "NOEVADE" -Skill cannot miss or be evaded.
# "CONSUMEHP" -Skill cost consumes HP instead of MP.
# "%COSTMAX" -Skill cost consumes % of MAXMP. % value is defined under
# MP Cost of the skill in the Skills tab.
# "%COSTNOW" -Skill cost consumes % of current MP. % value is defined
# under MP Cost of the skill in the Skills tab.
# "IGNOREREFLECT" -Ignores damage reflection states.
# "%DAMAGEMAX/30" -Changes damage formula of skill to:
# damage = TARGET MAX HP * [Integer] / 100
# [Integer] is the number you apply after "/" and negative
# numbers will result in healing.
# "%DAMAGENOW/30" -Changes damage formula of skill to:
# damage = TARGET CURRENT HP * [Integer] / 100
# [Integer] is the number you apply after "/" and negative
# numbers will result in healing.
# "COSTPOWER" -Changes damage formula of skill to:
# damage = base damage * cost / MAX MP
# The more the skill costs, the more damage it will do.
# "HPNOWPOWER" -Changes damage formula of skill to:
# damage = base damage * CURRENT HP / MAX HP
# The less current HP you have, the less damage.
# "MPNOWPOWER" -Changes damage formula of skill to:
# damage = base damage * CURRENT MP / MAX MP
# The less current MP you have, the less damage.
# "NOHALFMPCOST" -"Half MP Cost" from armor options will not apply.
# "HELPHIDE" -Help window when casting will not appear.
# "TARGETALL" -Will affect all enemies and allies simultaneously.
# "RANDOMTARGET" -Target is chosen at random. Set "Scope" to All Enemies
# or All Allies for this to work correctly.
# "OTHERS" -Skill will not affect caster.
# "NOOVERKILL" -Damage will not be applied after the target reaches zero HP.
# "NOFLASH" -Battler will not flash when taking action.
# "NONE" -No extension. Used as a default.
def extension
case @id
when 86 # Skill ID
return ["NOOVERKILL"] # Extensions
when 89
return ["RANDOMTARGET"]
when 94
return ["NOOVERKILL"]
when 96
return ["TARGETALL"]
when 98
return ["NOOVERKILL"]
when 99
return ["HELPHIDE","NOFLASH"]
when 100
return ["NOOVERKILL"]
when 101
return ["HELPHIDE","NOFLASH"]
when 102
return ["HELPHIDE","NOFLASH"]
when 103
return ["HELPHIDE","NOFLASH"]
end
# Default extensions for unassigned Skill IDs.
return ["NONE"]
end
#--------------------------------------------------------------------------
# ● Skill Throwing Weapon Graphic Settings
#--------------------------------------------------------------------------
# Allows use of a seperate throwing weapon graphic besides the one assigned
# from Iconset.png. This section is specifically for skills.
#
# return "001-Weapon01" <- Weapon image file name. If "", none is used.
# File must be in the .Graphics/Characters folder
# of your project.
def flying_graphic
case @id
when 1
return ""
end
# Default throwing skill graphic for unassigned Weapon IDs.
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# Item Action Settings
#==============================================================================
class Item
#--------------------------------------------------------------------------
# ● Item ID Sequence Assignment
#--------------------------------------------------------------------------
# Assign an Item ID from the Database to execute a defined ACTION sequence.
# Only ACTION sequence keys can be assigned. ANIME keys cannot
# be directly assigned here.
def base_action
case @id
when 1
return "ITEM_USE"
end
# Default ACTION sequence for unassigned Item IDs.
return "ITEM_USE"
end
#--------------------------------------------------------------------------
# ● Item Enhancement Extension Settings
#--------------------------------------------------------------------------
# "NOEVADE" -Item cannot miss or be evaded.
# "IGNOREREFLECT" -Ignores damage reflection states.
# "HELPHIDE" -Help window when casting will not appear.
# "TARGETALL" -Will affect all enemies and allies simultaneously.
# "RANDOMTARGET" -Target is chosen at random. Set "Scope" to All Enemies
# or All Allies for this to work correctly.
# "OTHERS" -Item will not affect caster.
# "NOOVERKILL" -Damage will not be applied after the target reaches zero HP.
# "NOFLASH" -Battler will not flash when taking action.
# "NONE" -No extension. Used as a default.
def extension
case @id
when 1
return ["NONE"]
end
# Default extensions for unassigned Item IDs.
return ["NONE"]
end
end
end
====================================================================================
(下一页 Sideview 1 (3.3d))
#==============================================================================
# ■ Sprite_Battler for Sideview Ver3.3d
#------------------------------------------------------------------------------
# バトラー表示用のスプライトです。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@effect_type = 0 # エフェクトの種類
@effect_duration = 0 # エフェクトの残り時間
@move_x = 0 # 変化したX座標の累計
@move_y = 0 # 変化したY座標の累計
@move_z = 0 # 変化したZ座標の累計
@distanse_x = 0 # X座標の移動距離
@distanse_y = 0 # Y座標の移動距離
@moving_x = 0 #1フレームあたりのX座標移動距離
@moving_y = 0 #1フレームあたりのY座標移動距離
@move_speed_x = 0 # X座標の移動速度
@move_speed_y = 0 # Y座標の移動速度
@move_speed_plus_x = 0 # X座標の加減速時の補足移動速度
@move_speed_plus_y = 0 # Y座標の加減速時の補足移動速度
@move_boost_x = 0 # X座標加速度
@move_boost_y = 0 # Y座標加速度
@jump_time = 0 # ジャンプ時間
@jump_time_plus = 0 # ジャンプ時間補足
@jump_up = 0 # ジャンプ上昇
@jump_down = 0 # ジャンプ下降
@jump_size = 0 # ジャンプ高度
@float_time = 0 # 浮遊時間
@float_up = 0 # 1フレームあたりの浮遊高度
@jump_plus = 0 # ジャンプに対する影位置補正
@angle = 0 # 回転角度
@angling = 0 # 1フレームあたりの回転角度
@angle_time = 0 # 回転時間
@angle_reset = 0 # 角度をリセットするか
@zoom_x = 0 # 横の拡大率
@zoom_y = 0 # 縦の拡大率
@zooming_x = 0 # 1フレームあたりの横拡大率
@zooming_y = 0 # 1フレームあたりの縦拡大率
@zoom_time = 0 # 拡大時間
@zoom_reset = 0 # 拡大をリセットするか
@target_battler = [] # ターゲットバトラー情報
@now_targets = [] # ターゲットバトラー記憶
@pattern = 0 # セル横位置(更新位置)
@pattern_back = false # リピートフラグ
@wait = 0 # 次の動作待ち時間
@unloop_wait = 0 # 非ループ系アニメ終了時の待ち時間
@action = [] # 行動
@anime_kind = 0 # セル縦位置(アニメ種類位置)
@anime_speed = 0 # セル更新速度
@frame = 0 # 消費されるセル更新時間
@anime_loop = 0 # ループ方式
@anime_end = false # バトラーのアニメが終わったか
@anime_freeze = false # 固定アニメか
@anime_freeze_kind = false # 固定するパターン位置
@anime_moving = false # 飛ばしアニメ中か
@base_width = N01::ANIME_PATTERN # セルの横分割数
@base_height = N01::ANIME_KIND # セルの縦分割数
@width = 0 # 横矩形
@height = 0 # 縦矩形
@picture_time = 0 # ピクチャー表示時間
@individual_targets = [] # 個別処理の保持ターゲット
@balloon_duration = 65 # ふきだしアニメ時間
@reverse = false # アニメ逆転再生フラグ
# バトラーがいない場合は処理を中断
return @battler_visible = false if @battler == nil
# バトラーがアクターの場合、またはエネミーアニメがオンの場合
@anime_flug = true if @battler.actor?
@anime_flug = true if [email protected]? && @battler.anime_on
end
#--------------------------------------------------------------------------
# ● バトラー作成
#--------------------------------------------------------------------------
def make_battler
# 初期配置の取得
@battler.base_position
# 色相はバトラーとして認識
@battler_hue = @battler.battler_hue
# バトラーがアクターの場合、またはエネミーアニメがオンの場合
if @anime_flug
# メイン武器を用意
@weapon_R = Sprite_Weapon.new(viewport,@battler)
# 味方はキャラクター名、エネミーはバトラー名を取得
@battler_name = @battler.character_name if @battler.actor?
@battler_name = @battler.battler_name unless @battler.actor?
# エネミー反転がオンの場合、画像を反転させる
self.mirror = true if [email protected]? && @battler.action_mirror
# 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える
if @battler_hue != nil ## blackmorning unofficial code; 3.3c
self.bitmap = Cache.character(@battler_name, @battler_hue) if N01::WALK_ANIME
self.bitmap = Cache.character(@battler_name + "_1", @battler_hue) unless N01::WALK_ANIME
else
self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME
self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME
end ## End blackmorning unofficial code; 3.3c
# 転送元の矩形を取得
@width = self.bitmap.width / @base_width
@height = self.bitmap.height / @base_height
# 矩形を設定
@sx = @pattern * @width
@sy = @anime_kind * @height
# バトラー本体を描画
self.src_rect.set(@sx, @sy, @width, @height)
# アニメしないバトラーの場合
else
# ビットマップを取得、設定
@battler_name = @battler.battler_name
self.bitmap = Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
end
# バックアタック時には画像を反転させる
if $back_attack && @battler.actor?
self.mirror = true
elsif $back_attack && [email protected]?
self.mirror = true
self.mirror = false if @battler.action_mirror
else
self.mirror = false
self.mirror = true if [email protected]? && @battler.action_mirror
end
# 武器画像に反映
@weapon_R.mirroring if self.mirror && @weapon_R != nil
# 位置を初期化
@battler.reset_coordinate
# 原点を決定
self.ox = @width / 2
self.oy = @height * 2 / 3
# スプライトの座標を設定
update_move
# アニメ飛ばし用スプライトを用意
@move_anime = Sprite_MoveAnime.new(viewport,battler)
# ピクチャ用スプライトを用意
@picture = Sprite.new
# ダメージスプライト作成
@damage = Sprite_Damage.new(viewport,battler)
end
#--------------------------------------------------------------------------
# ● 影作成
#--------------------------------------------------------------------------
def make_shadow
@shadow.dispose if @shadow != nil
@battler_hue = @battler.battler_hue
@shadow = Sprite.new(viewport)
@shadow.z = self.z - 4
@shadow.visible = false
# バトラーに当てられた影グラフィックを用意
@shadow.bitmap = Cache.character(@battler.shadow)
@shadow_height = @shadow.bitmap.height
# 影位置の微調整用インスタンス
@shadow_plus_x = @battler.shadow_plus[0] - @width / 2
@shadow_plus_y = @battler.shadow_plus[1]
# バトラー画像のサイズに合わせて影画像をリサイズ
@shadow.zoom_x = @width * 1.0 / @shadow.bitmap.width
# 更新
update_shadow
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose if self.bitmap != nil
@weapon_R.dispose if @weapon_R != nil
@move_anime.dispose if @move_anime != nil
@picture.dispose if @picture != nil
@shadow.dispose if @shadow != nil
@damage.dispose if @damage != nil
@balloon.dispose if @balloon != nil
mirage_off
# 画像変更リセット
@battler.graphic_change(@before_graphic) if @before_graphic != nil
super
end
#--------------------------------------------------------------------------
# ● ダメージアクション action = [アニメID,反転フラグ,リアクション許可]
#--------------------------------------------------------------------------
def damage_action(action)
damage = @battler.hp_damage
damage = @battler.mp_damage if @battler.mp_damage != 0
# HPとMP両方同時にダメージがあるなら
if @battler.hp_damage != 0 && @battler.mp_damage != 0
@battler.double_damage = true
damage = @battler.hp_damage
end
# 吸収攻撃でHP0の処理
if action[0] == "absorb"
absorb = true
action[0] = nil
end
# ヒットしている時のみアニメ実行
unless @battler.evaded or @battler.missed or action[0] == nil
@battler.animation_id = action[0]
@battler.animation_mirror = action[1]
end
# ダメージアクション実行
start_action(@battler.damage_hit) if damage > 0 && action[2]
# 攻撃が当たっていない場合は回避アクション実行
if @battler.evaded or @battler.missed
start_action(@battler.evasion) if action[2]
Sound.play_evasion
end
@damage.damage_pop unless absorb or action[3] != nil
end
#--------------------------------------------------------------------------
# ● ダメージ数値POP
#--------------------------------------------------------------------------
def damage_pop(damage)
@damage.damage_pop(damage)
end
#--------------------------------------------------------------------------
# ● 戦闘開始行動
#--------------------------------------------------------------------------
def first_action
# 行動できるかチェックし、できなければそのステートのアクション開始
action = @battler.first_action unless @battler.restriction >= 4
action = $data_states[@battler.state_id].base_action if @battler.states[0] != nil && @battler.restriction >= 4
start_action(action)
# 影スプライトを用意
make_shadow if N01::SHADOW
end
#--------------------------------------------------------------------------
# ● アクション開始
#--------------------------------------------------------------------------
def start_action(kind)
# 各種動作を初期化
reset
# 現在取っている待機アクションを記憶
stand_by
# 新しいアクション内容の決定
@action = N01::ACTION[kind].dup
# 行動配列の先頭からシフト
active = @action.shift
# 自動で終了を付ける
@action.push("End")
# 現在のアクションを決定
@active_action = N01::ANIME[active]
# ウエイト設定
@wait = active.to_i if @active_action == nil
# 単発アクション開始
action
end
#--------------------------------------------------------------------------
# ● 強制単発アクション開始
#--------------------------------------------------------------------------
def start_one_action(kind,back)
# 各種動作を初期化
reset
# 現在取っている待機アクションを記憶
stand_by
# 座標リセットアクションをセッティング
@action = [back]
# 自動で終了を付ける
@action.push("End")
# 現在のアクションを決定
@active_action = N01::ANIME[kind]
# 単発アクション開始
action
end
#--------------------------------------------------------------------------
# ● 次のアクションへ
#--------------------------------------------------------------------------
def next_action
# ウェイト中の場合キャンセル
return @wait -= 1 if @wait > 0
# まだ全アニメセルが終了していない場合キャンセル
return if @anime_end == false
# 最後のアニメセル表示待ち
return @unloop_wait -= 1 if @unloop_wait > 0
# 行動配列の先頭からシフト
active = @action.shift
# 現在のアクションを決定
@active_action = N01::ANIME[active]
# ウエイト設定
@wait = active.to_i if @active_action == nil
# 単発アクション開始
action
end
#--------------------------------------------------------------------------
# ● 待機アクション
#--------------------------------------------------------------------------
def stand_by
# 通常待機に
@repeat_action = @battler.normal
# HPが1/4でピンチモーションに
@repeat_action = @battler.pinch if @battler.hp <= @battler.maxhp / 4
# 防御中
@repeat_action = @battler.defence if @battler.guarding?
# 何もステートがなければ終了
return if @battler.state_id == nil
for state in @battler.states.reverse
# アクション禁止のステートだったらスキップ
next if state.extension.include?("NOSTATEANIME")
# エネミーで禁止されているステートアクションだったらスキップ
next if @battler.is_a?(Game_Enemy) && state.extension.include?("EXCEPTENEMY")
# ステートのモーションに
@repeat_action = state.base_action
end
end
#--------------------------------------------------------------------------
# ● 待機アクションの割り込み
#--------------------------------------------------------------------------
def push_stand_by
action = @battler.normal
action = @battler.pinch if @battler.hp <= @battler.maxhp / 4
action = @battler.defence if @battler.guarding?
for state in @battler.states.reverse
# アクション禁止のステートだったらスキップ
next if state.extension.include?("NOSTATEANIME")
# エネミーで禁止されているステートアクションだったらスキップ
next if @battler.is_a?(Game_Enemy) && state.extension.include?("EXCEPTENEMY")
# ステートのモーションに
action = state.base_action
end
@repeat_action = action
# 割り込み
@action.delete("End")
act = N01::ACTION[action].dup
for i in 0...act.size
@action.push(act)
end
@action.push("End")
@anime_end = true
end
#--------------------------------------------------------------------------
# ● 各種変化を初期化
#--------------------------------------------------------------------------
def reset
self.zoom_x = self.zoom_y = 1
self.oy = @height * 2 / 3
@angle = self.angle = 0
@anime_end = true
@non_repeat = false
@anime_freeze = false
@unloop_wait = 0
end
#--------------------------------------------------------------------------
# ● ジャンプを初期化
#--------------------------------------------------------------------------
def jump_reset
@battler.jump = @jump_time = @jump_time_plus = @jump_up = @jump_down = 0
@jump_size = @jump_plus = @float_time = @float_up = 0
end
#--------------------------------------------------------------------------
# ● ターゲット情報を受け取る
#--------------------------------------------------------------------------
def get_target(target)
# 個別処理中は中止(全域で自分が巻き込まれた時ターゲット情報が狂わないように)
return if @battler.individual
@target_battler = target
end
#--------------------------------------------------------------------------
# ● アクション情報をバトラーに格納
#--------------------------------------------------------------------------
def send_action(action)
@battler.play = 0
@battler.play = action if @battler.active
end
#--------------------------------------------------------------------------
# ● バトラー追加
#--------------------------------------------------------------------------
def battler_join
if @battler.exist? && !@battler_visible
# 戦闘不能からの復活なら処理をスキップ
if @battler.revival && @anime_flug
return @battler.revival = false
elsif @battler.revival && !@anime_flug
@battler.revival = false
self.visible = true
return
end
@anime_flug = true if @battler.actor?
@anime_flug = true if [email protected]? && @battler.anime_on
make_battler
first_action
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 ※再定義
#--------------------------------------------------------------------------
def update
super
# バトラーがいない場合スキップ
return self.bitmap = nil if @battler == nil
# バトラー追加
battler_join
# 次のアクションへ
next_action
# アニメパターン更新
update_anime_pattern
# ターゲット更新
update_target
# 強制アクション更新
update_force_action
# 座標更新
update_move
# 影更新
update_shadow if @shadow != nil
# 武器更新
@weapon_R.update if @weapon_action
# 浮遊更新
update_float if @float_time > 0
# 回転更新
update_angle if @angle_time > 0
# 拡大縮小更新
update_zoom if @zoom_time > 0
# 残像更新
update_mirage if @mirage_flug
# ピクチャ更新
update_picture if @picture_time > 0
# アニメ飛ばし更新
update_move_anime if @anime_moving
# ふきだしアニメ更新
update_balloon if @balloon_duration <= 64
# ダメージスプライト更新
@damage.update if @damage != nil
setup_new_effect
update_effect
update_battler_bitmap
end
#--------------------------------------------------------------------------
# ● アニメパターン更新
#--------------------------------------------------------------------------
def update_anime_pattern
# 更新時間がくるまでスキップ
return @frame -= 1 if @frame != 0
# 必要な時だけ武器アニメ更新
@weapon_R.action if @weapon_action && @weapon_R != nil
# アニメのコマが最後まで到達したらリピート方法をチェック
if @pattern_back
# 往復ループ
if @anime_loop == 0
# 逆転再生
if @reverse
@pattern += 1
if @pattern == @base_width - 1
@pattern_back = false
@anime_end = true
end
# 通常再生
else
@pattern -= 1
if @pattern == 0
@pattern_back = false
@anime_end = true
end
end
# 片道ループもしくはループしない
else
@anime_end = true
if @anime_loop == 1
@pattern = 0 if !@reverse
@pattern = @base_width - 1 if @reverse
@pattern_back = false
end
end
# アニメのコマを進める
else
if @reverse
@pattern -= 1
@pattern_back = true if @pattern == 0
else
@pattern += 1
@pattern_back = true if @pattern == @base_width - 1
end
end
# 更新時間を初期化
@frame = @anime_speed
# アニメ固定の場合は横矩形を固定
return if @anime_freeze
# 転送元の矩形を設定
return unless @anime_flug
@sx = @pattern * @width
@sy = @anime_kind * @height
self.src_rect.set(@sx, @sy, @width, @height)
end
#--------------------------------------------------------------------------
# ● ターゲット更新 action = ["N01target_change",ターゲット情報]
#--------------------------------------------------------------------------
def update_target
# ターゲットチェック
return if @battler.force_target == 0
# 個別処理中は中止(全域で自分が巻き込まれた時ターゲット情報が狂わないように)
return if @battler.individual
@target_battler = @battler.force_target[1]
@battler.force_target = 0
end
#--------------------------------------------------------------------------
# ● 強制アクション更新 action = [識別,復帰,実行するアクション]
#--------------------------------------------------------------------------
def update_force_action
# 強制アクションチェック
action = @battler.force_action
return if action == 0
@battler.force_action = 0
# アクティブ中は割り込ませない
return if @battler.active
# コラプスならそのまま行動に直結
return collapse_action if action[0] == "N01collapse"
# 単発ならそのまま行動に直結
return start_one_action(action[2],action[1]) if action[0] == "SINGLE"
# 通しはアクションとして扱う
start_action(action[2])
# 座標復帰の有無
return if action[1] == ""
# 終了位置を入れ替えて復帰アクションを入れる
@action.delete("End")
@action.push(action[1])
@action.push("End")
end
#--------------------------------------------------------------------------
# ● 座標更新
#--------------------------------------------------------------------------
def update_move
# 加減速で出る距離の増減を補完
if @move_speed_plus_x > 0
# 移動計算
@move_x += @moving_x
# 移動を実行
@battler.move_x = @move_x
@move_speed_plus_x -= 1
elsif @move_speed_x > 0
# 加速の場合
if @move_boost_x != 0
@moving_x += @move_boost_x
end
# 移動計算
@move_x += @moving_x
# 移動を実行
@battler.move_x = @move_x
@move_speed_x -= 1
end
# 加減速で出る距離の増減を補完
if @move_speed_plus_y > 0
# 移動計算
@move_y += @moving_y
# 移動を実行
@battler.move_y = @move_y
@move_speed_plus_y -= 1
elsif @move_speed_y > 0
# 加速の場合
if @move_boost_y != 0
@moving_y += @move_boost_y
end
# 移動計算
@move_y += @moving_y
# 移動を実行
@battler.move_y = @move_y
@move_speed_y -= 1
end
# ジャンプ上昇
if @jump_up != 0
# 移動計算
@jump_plus += @jump_up
# 移動を実行
@battler.jump = @jump_plus
@jump_up = @jump_up / 2
@jump_time -= 1
# ジャンプが頂点に達したら
if @jump_time == 0 or @jump_up == @jump_sign
@jump_down = @jump_up * 2 * @jump_sign * @jump_sign2
@jump_time_plus += @jump_time * 2
@jump_up = 0
return
end
end
# ジャンプ下降
if @jump_down != 0
if @jump_time_plus != 0
@jump_time_plus -= 1
elsif @jump_down != @jump_size
# 移動計算
@jump_plus += @jump_down
# 移動を実行
@battler.jump = @jump_plus
@jump_down = @jump_down * 2
if @jump_down == @jump_size
if @jump_flug
@jump_flug = false
else
# 移動計算
@jump_plus += @jump_down
# 移動を実行
@battler.jump = @jump_plus
@jump_down = @jump_size = 0
end
end
end
end
# スプライトの座標を設定
self.x = @battler.position_x
self.y = @battler.position_y
self.z = @battler.position_z
end
#--------------------------------------------------------------------------
# ● 影更新
#--------------------------------------------------------------------------
def update_shadow
@shadow.opacity = self.opacity
@shadow.x = @battler.position_x + @shadow_plus_x
@shadow.y = @battler.position_y + @shadow_plus_y - @jump_plus
@shadow.z = @battler.position_z - 4
end
#--------------------------------------------------------------------------
# ● 浮遊更新
#--------------------------------------------------------------------------
def update_float
@float_time -= 1
@jump_plus += @float_up
@battler.jump = @jump_plus
end
#--------------------------------------------------------------------------
# ● 回転更新
#--------------------------------------------------------------------------
def update_angle
# 回転実行
@angle += @angling
self.angle = @angle
@angle_time -= 1
# 回転時間がなくなったら項目をリセット
return @angle = 0 if @angle_time == 0
# 復帰フラグがあれば角度を0に戻す
self.angle = 0 if @angle_reset
end
#--------------------------------------------------------------------------
# ● 拡大縮小更新
#--------------------------------------------------------------------------
def update_zoom
# 拡大縮小実行
@zoom_x += @zooming_x
@zoom_y += @zooming_y
self.zoom_x = @zoom_x
self.zoom_y = @zoom_y
@zoom_time -= 1
# 拡大縮小時間がなくなったら項目をリセット
return if @zoom_time != 0
@zoom_x = @zoom_y = 0
self.oy = @height * 2 / 3
# 復帰フラグがあれば戻す
self.zoom_x = self.zoom_y = 1 if @zoom_reset
end
#--------------------------------------------------------------------------
# ● 残像更新
#--------------------------------------------------------------------------
def update_mirage
# 残像は最大3つまで表示し、2フレームごとに更新
mirage(@mirage0) if @mirage_count == 1
mirage(@mirage1) if @mirage_count == 3
mirage(@mirage2) if @mirage_count == 5
@mirage_count += 1
@mirage_count = 0 if @mirage_count == 6
end
#--------------------------------------------------------------------------
# ● ピクチャ更新
#--------------------------------------------------------------------------
def update_picture
@picture_time -= 1
@picture.x += @moving_pic_x
@picture.y += @moving_pic_y
end
#--------------------------------------------------------------------------
# ● アニメ飛ばし更新
#--------------------------------------------------------------------------
def update_move_anime
@move_anime.update
@anime_moving = false if @move_anime.finish?
@move_anime.action_reset if @move_anime.finish?
end
#--------------------------------------------------------------------------
# ● 崩壊エフェクトの更新 ※再定義
#--------------------------------------------------------------------------
def update_collapse
normal_collapse if @collapse_type == 2
boss_collapse1 if @collapse_type == 3
end
#--------------------------------------------------------------------------
# ● ふきだしアニメ更新
#--------------------------------------------------------------------------
def update_balloon
@balloon_duration -= 1 if @balloon_duration > 0 && !@balloon_back
@balloon_duration += 1 if @balloon_back
if @balloon_duration == 64
@balloon_back = false
@balloon.visible = false
elsif @balloon_duration == 0
@balloon.visible = false if @balloon_loop == 0
@balloon_back = true if @balloon_loop == 1
end
@balloon.x = self.x
@balloon.y = self.y
@balloon.z = 10
@balloon.opacity = self.opacity
sx = 7 * 32 if @balloon_duration < 12
sx = (7 - (@balloon_duration - 12) / 8) * 32 unless @balloon_duration < 12
@balloon.src_rect.set(sx, @balloon_id * 32, 32, 32)
end
#--------------------------------------------------------------------------
# ● 転送元ビットマップの更新 ※再定義
#--------------------------------------------------------------------------
def update_battler_bitmap
if @battler.actor?
if @battler.character_name != @battler_name or @battler.battler_hue != @battler_hue
@battler_name = @battler.character_name
@battler_hue = @battler.battler_hue
end
else
if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
end
if [email protected]?
self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1
end
end
end
#--------------------------------------------------------------------------
# ● アクション実行
#--------------------------------------------------------------------------
def action
return if @active_action == nil
action = @active_action[0]
# 反転の場合
return mirroring if action == "Invert"
# 回転の場合
return angling if action == "angle"
# 拡大縮小の場合
return zooming if action == "zoom"
# 残像ONの場合
return mirage_on if action == "Afterimage ON"
# 残像OFFの場合
return mirage_off if action == "Afterimage OFF"
# ピクチャ表示の場合
return picture if action == "pic"
# ピクチャ消去の場合
return @picture.visible = false && @picture_time = 0 if action == "Clear image"
# グラフィックファイル変更の場合
return graphics_change if action == "change"
# 戦闘アニメ表示の場合
return battle_anime if action == "anime"
# ふきだしアニメ表示の場合
return balloon_anime if action == "balloon"
# BGM/BGS/SE演奏の場合
return sound if action == "sound"
# ゲームスイッチ操作の場合
return $game_switches[@active_action[1]] = @active_action[2] if action == "switch"
# ゲーム変数操作の場合
return variable if action == "variable"
# 二刀限定の場合
return two_swords if action == "Two Wpn Only"
# 非二刀限定の場合
return non_two_swords if action == "One Wpn Only"
# アクション条件の場合
return necessary if action == "nece"
# スキル派生の場合
return derivating if action == "der"
# 個別処理開始の場合
return individual_action if action == "Process Skill"
# 個別処理終了の場合
return individual_action_end if action == "Process Skill End"
# 待機に移行しない場合
return non_repeat if action == "Don't Wait"
# 初期位置変更の場合
return @battler.change_base_position(self.x, self.y) if action == "Start Pos Change"
# 初期位置変更解除の場合
return @battler.base_position if action == "Start Pos Return"
# ターゲット変更の場合
return change_target if action == "target"
# ターゲットのコラプス許可
return send_action(action) if action == "Can Collapse"
# アクティブ解除
return send_action(action) if action == "Cancel Action"
# ステート付与の場合
return state_on if action == "sta+"
# ステート解除の場合
return state_off if action == "sta-"
# ゲーム全体のスピード変更の場合
return Graphics.frame_rate = @active_action[1] if action == "fps"
# 浮遊の場合
return floating if action == "float"
# スクリプト操作の場合
return eval(@active_action[1]) if action == "script"
# 強制アクションの場合
return force_action if @active_action.size == 4
# 座標リセットの場合
return reseting if @active_action.size == 5
# 移動の場合
return moving if @active_action.size == 7
# バトラーアニメの場合
return battler_anime if @active_action.size == 9
# アニメ飛ばしの場合
return moving_anime if @active_action.size == 11
# 終了の場合
return anime_finish if action == "End"
end
#--------------------------------------------------------------------------
# ● 反転実行
#--------------------------------------------------------------------------
def mirroring
# すでに反転されていれば元に戻す
if self.mirror
self.mirror = false
# 武器アニメも反映
@weapon_R.mirroring if @anime_flug
else
self.mirror = true
# 武器アニメも反映
@weapon_R.mirroring if @anime_flug
end
end
#--------------------------------------------------------------------------
# ● 回転実行
#--------------------------------------------------------------------------
def angling
# ジャンプを初期化
jump_reset
# 情報確認
@angle_time = @active_action[1]
start_angle = @active_action[2]
end_angle = @active_action[3]
@angle_reset = @active_action[4]
# バックアタック時には逆に
start_angle *= -1 if $back_attack
end_angle *= -1 if $back_attack
# エネミーは逆に
start_angle *= -1 if @battler.is_a?(Game_Enemy)
end_angle *= -1 if @battler.is_a?(Game_Enemy)
# 時間が0以下なら即座に最終角度へ
if @angle_time <= 0
self.angle = end_angle
return @angle_time = 0
end
# 回転時間から1フレームあたりの角度を出す
@angling = (end_angle - start_angle) / @angle_time
# 割り切れない余りを初期角度に
@angle = (end_angle - start_angle) % @angle_time + start_angle
end
#--------------------------------------------------------------------------
# ● 拡大縮小実行
#--------------------------------------------------------------------------
def zooming
# ジャンプを初期化
jump_reset
# 情報確認
@zoom_time = @active_action[1]
zoom_x = @active_action[2] - 1
zoom_y = @active_action[3] - 1
@zoom_reset = @active_action[4]
@zoom_x = @zoom_y = 1
# 時間が0以下ならスキップ
return @zoom_time = 0 if @zoom_time <= 0
# 拡大時間から1フレームあたりの拡大率を出す
@zooming_x = zoom_x / @zoom_time
@zooming_y = zoom_y / @zoom_time
end
#--------------------------------------------------------------------------
# ● 残像開始
#--------------------------------------------------------------------------
def mirage_on
# 戦闘不能時には残像させない
return if @battler.dead?
@mirage0 = Sprite.new(self.viewport)
@mirage1 = Sprite.new(self.viewport)
@mirage2 = Sprite.new(self.viewport)
@mirage_flug = true
@mirage_count = 0
end
#--------------------------------------------------------------------------
# ● 残像表示
#--------------------------------------------------------------------------
def mirage(body)
body.bitmap = self.bitmap.dup
body.x = self.x
body.y = self.y
body.ox = self.ox
body.oy = self.oy
body.z = self.z
body.mirror = self.mirror
body.angle = @angle
body.opacity = 160
body.zoom_x = self.zoom_x
body.zoom_y = self.zoom_y
body.src_rect.set(@sx, @sy, @width, @height) if @anime_flug
body.src_rect.set(0, 0, @width, @height) unless @anime_flug
end
#--------------------------------------------------------------------------
# ● 残像終了
#--------------------------------------------------------------------------
def mirage_off
@mirage_flug = false
@mirage0.dispose if @mirage0 != nil
@mirage1.dispose if @mirage1 != nil
@mirage2.dispose if @mirage2 != nil
end
#--------------------------------------------------------------------------
# ● ピクチャ表示
#--------------------------------------------------------------------------
def picture
# 移動開始位置を確認
pic_x = @active_action[1]
pic_y = @active_action[2]
# 移動終了位置を確認
pic_end_x = @active_action[3]
pic_end_y = @active_action[4]
@picture_time = @active_action[5]
# 時間で割り、1フレーム当たりの移動速度を計算
@moving_pic_x = (pic_end_x - pic_x)/ @picture_time
@moving_pic_y = (pic_end_y - pic_y)/ @picture_time
# 割り切れない場合最初に加算
plus_x = (pic_end_x - pic_x)% @picture_time
plus_y = (pic_end_y - pic_y)% @picture_time
# ピクチャ表示
@picture.bitmap = Cache.picture(@active_action[7])
@picture.x = pic_x + plus_x
@picture.y = pic_y + plus_y
# Z座標調整
@picture.z = 1
@picture.z = 1000 if @active_action[6]
@picture.visible = true
end
#--------------------------------------------------------------------------
# ● グラフィックファイル変更
#--------------------------------------------------------------------------
def graphics_change
# アクター限定
return if @battler.is_a?(Game_Enemy)
# グラフィック変更
@battler_name = @active_action[2]
# 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える
self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME
self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME
# 転送元の矩形を取得
@width = self.bitmap.width / @base_width
@height = self.bitmap.height / @base_height
# 戦闘後リセットする場合キャラチップ名を記憶
@before_graphic = @battler.character_name if @active_action[1]
@battler.graphic_change(@active_action[2])
end
#--------------------------------------------------------------------------
# ● 戦闘アニメ表示 [判別,ID,対象,反転,ウエイト,二刀フラグ]
#--------------------------------------------------------------------------
def battle_anime
# エネミーの二刀フラグアニメ処理はキャンセル
return if @active_action[5] && [email protected]?
# 二刀ではないアクターの二刀フラグアニメ処理はキャンセル
return if @active_action[5] && @battler.weapons[1] == nil
# 二刀で右(上に配置された)武器がなく左(下に配置)だけ持ってる場合
if @battler.actor?
return if !@active_action[5] && @battler.weapons[0] == nil && @battler.weapons[1] != nil
end
anime_id = @active_action[1]
# バックアタック時にアニメ画像を反転
if $back_attack
mirror = true if @active_action[3] == false
mirror = false if @active_action[3]
end
# 武器とスキルアニメの場合
if anime_id < 0
# 行動の種類でアニメ先を分岐
if @battler.action.skill? && anime_id != -2
### UNOFFICAL CODE v3.3b ###
anime_id = @battler.action.skill.animation_id unless @battler.action.skill.animation_id == -1
if @battler.action.skill.animation_id == -1
anime_id = N01::NO_WEAPON
if @battler.actor?
weapon_id = @battler.weapon_id
anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
anime_id = @battler.atk_animation_id2 if @active_action[5]
else
weapon_id = @battler.weapon
anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
end
end
elsif @battler.action.item? && anime_id != -2
anime_id = 0
anime_id = @battler.action.item.animation_id unless @battler.action.item.animation_id == -1
if @battler.action.item.animation_id == -1
anime_id = N01::NO_WEAPON
weapon_id = @battler.weapon_id
anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
anime_id = @battler.atk_animation_id2 if @active_action[5]
end
### UNOFFICIAL CODE v3.3b END ###
else
# 武器がなければ素手アニメを使用
anime_id = N01::NO_WEAPON
if @battler.actor?
weapon_id = @battler.weapon_id
anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
# 二刀アニメの場合
anime_id = @battler.atk_animation_id2 if @active_action[5]
else
weapon_id = @battler.weapon
anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
end
end
# ウエイト設定
@wait = $data_animations[anime_id].frame_max * 4 if $data_animations[anime_id] != nil && @active_action[4]
waitflug = true
# ダメージ表示のアニメなら、ダメージ計算を先に済ませるため処理を中断
damage_action = [anime_id, mirror, true]
return @battler.play = ["OBJ_ANIM",damage_action] if @battler.active
end
# アニメ実行
if @active_action[2] == 0 && $data_animations[anime_id] != nil
@battler.animation_id = anime_id
@battler.animation_mirror = mirror
elsif $data_animations[anime_id] != nil
for target in @target_battler
target.animation_id = anime_id
target.animation_mirror = mirror
end
end
# ウエイト設定
@wait = $data_animations[anime_id].frame_max * 4 if $data_animations[anime_id] != nil && @active_action[4] && !waitflug
end
#--------------------------------------------------------------------------
# ● ふきだしアニメ表示
#--------------------------------------------------------------------------
def balloon_anime
return if self.opacity == 0
if @balloon == nil
@balloon = Sprite.new
@balloon.bitmap = Cache.system(N01::BALLOON_GRAPHICS) # v3.3a
@balloon.ox = @width / 16
@balloon.oy = @balloon.height / 10 + @height / 3
end
@balloon_id = @active_action[1]
@balloon_loop = @active_action[2]
@balloon_duration = 64
@balloon_back = false
update_balloon
@balloon.visible = true
end
#--------------------------------------------------------------------------
# ● BGM/BGS/SE演奏
#--------------------------------------------------------------------------
def sound
# 情報を取得
pitch = @active_action[2]
vol = @active_action[3]
name = @active_action[4]
# 実行
case @active_action[1]
when "se"
Audio.se_play("Audio/SE/" + name, vol, pitch)
when "bgm"
# 名前指定のない場合、現在のBGMを変えないように
if @active_action[4] == ""
now_bgm = RPG::BGM.last
name = now_bgm.name
end
Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
when "bgs"
# 名前指定のない場合、現在のBGSを変えないように
if @active_action[4] == ""
now_bgs = RPG::BGS.last
name = now_bgs.name
end
Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
end
end
#--------------------------------------------------------------------------
# ● ゲーム変数操作
#--------------------------------------------------------------------------
def variable
# オペランドチェック
operand = @active_action[3]
# 変数操作で分岐
case @active_action[2]
when 0 # 代入
$game_variables[@active_action[1]] = operand
when 1 # 加算
$game_variables[@active_action[1]] += operand
when 2 # 減算
$game_variables[@active_action[1]] -= operand
when 3 # 乗算
$game_variables[@active_action[1]] *= operand
when 4 # 除算
$game_variables[@active_action[1]] /= operand
when 5 # 剰余
$game_variables[@active_action[1]] %= operand
end
end
#--------------------------------------------------------------------------
# ● 二刀限定
#--------------------------------------------------------------------------
def two_swords
# エネミーは処理させない
return @action.shift unless @battler.actor?
# 左(下部表示)に武器がなかったら次のアクションを除く
return @action.shift if @battler.weapons[1] == nil
# 行動配列の先頭からシフト
active = @action.shift
# 現在のアクションを決定
@active_action = N01::ANIME[active]
# ウエイト設定
@wait = active.to_i if @active_action == nil
# 単発アクション開始
action
end
#--------------------------------------------------------------------------
# ● 非二刀限定
#--------------------------------------------------------------------------
def non_two_swords
# エネミーは処理させない
return unless @battler.actor?
# 左(下部表示)に武器があったら次のアクションを除く
return @action.shift if @battler.weapons[1] != nil
# 行動配列の先頭からシフト
active = @action.shift
# 現在のアクションを決定
@active_action = N01::ANIME[active]
# ウエイト設定
@wait = active.to_i if @active_action == nil
# 単発アクション開始
action
end
#--------------------------------------------------------------------------
# ● アクション条件
#--------------------------------------------------------------------------
def necessary
nece1 = @active_action[3]
nece2 = @active_action[4]
# ターゲットチェック
case @active_action[1]
# 0自身 1ターゲット 2敵全体 3味方全体
when 0
target = [$game_party.members[@battler.index]] if @battler.is_a?(Game_Actor)
target = [$game_troop.members[@battler.index]] if @battler.is_a?(Game_Enemy)
when 1
target = @target_battler
when 2
target = $game_troop.members
when 3
target = $game_party.members
end
# ターゲットが空の場合は失敗とみなす
return start_action(@battler.recover_action) if target.size == 0
# 内容チェック
case @active_action[2]
# ステートID指定だった場合
when 0
# 補足が正で「ステートにかかっている」、負は「かかっていない」が条件に
state_on = true if nece2 > 0
# 条件人数を出す
state_member = nece2.abs
# 0は仲間数を出す
if nece2 == 0
state_member = $game_party.members.size if @battler.is_a?(Game_Actor)
state_member = $game_troop.members.size if @battler.is_a?(Game_Enemy)
end
# ターゲットのステートチェックし人数をカウント
for member in target
state_member -= 1 if member.state?(nece1)
end
# 条件が満たされていればアクション続行
if state_member == 0 && state_on
return
elsif state_member == nece2.abs
return if state_on == nil
end
# パラメータ指定だった場合
when 1
# 補足が正で「数値以上」、負は「数値以下」が条件に
num_over = true if nece2 > 0
# 参照数値
num = 0
# ターゲットのパラメータチェック
for member in target
# 参照パラメータで分岐
case nece1
when 0 # 現HP
num += member.hp
when 1 # 現MP
num += member.mp
when 2 # 攻撃力
num += member.atk
when 3 # 防御力
num += member.def
when 4 # 精神力
num += member.spi
when 5 # 敏捷性
num += member.agi
end
end
# 平均を出す
num = num / target.size
# 条件が満たされていればアクション続行
if num > nece2.abs && num_over
return
elsif num < nece2.abs
return if num_over == nil
end
# スイッチ指定だった場合
when 2
# 条件が満たされていればアクション続行
if $game_switches[nece1]
# 補足がtrueで「スイッチON」、falseは「スイッチOFF」が条件に
return if nece2
# スイッチがOFFの場合はON時とは逆に
else
return unless nece2
end
# 変数指定だった場合
when 3
# 補足が正で「数値以上」、負は「数値以下」が条件に
if nece2 > 0
return if $game_variables[nece1] > nece2
else
return unless $game_variables[nece1] > nece2.abs
end
# 習得スキル指定だった場合
when 4
# スキル条件人数を出す
skill_member = nece2.abs
for member in target
skill_member -= 1 if member.skill_learn?(nece1)
# 条件確認
return if skill_member == 0
end
end
# 条件を満たせなければ以降のアクションを中断
return @action = ["End"] if @non_repeat
# 防御中は不自然に見えないように座標復帰させない
action = @battler.recover_action
action = @battler.defence if @battler.guarding?
return start_action(action)
end
#--------------------------------------------------------------------------
# ● Derivating skills (link skills)
#--------------------------------------------------------------------------
def derivating # Redefined 1.1e
return if $game_party.all_dead? or $game_troop.all_dead?
skill = $data_skills[@active_action[3]] # retrive actual skill
# test for skill learning. If not learned and link is not set, stop here
return if @battler.actor? && [email protected]_learn?(skill) && !@active_action[2]
# this takes the actual skill object
return unless @battler.skill_can_use?(skill) # test if skill can be used
# skill fails if the random number is below the given chance
return if rand(100) > @active_action[1]
# sets the derivation
@battler.derivation = @active_action[3]
# sets the current action to ["End"]
@action = ["End"]
end
#--------------------------------------------------------------------------
# ● 個別処理開始
#--------------------------------------------------------------------------
def individual_action
# リピートフラグオン
@battler.individual = true
# リピートアクションを保持
@individual_act = @action.dup
# ターゲットを保持し、行動ターゲットをひとつずつ抜き出す
send_action(["Individual"])
@individual_targets = @target_battler.dup
@target_battler = [@individual_targets.shift]
end
#--------------------------------------------------------------------------
# ● 個別処理終了
#--------------------------------------------------------------------------
def individual_action_end
# ターゲットが残っていないなら行動終了
return @battler.individual = false if @individual_targets.size == 0
@action = @individual_act.dup
@target_battler = [@individual_targets.shift]
end
#--------------------------------------------------------------------------
# ● 待機に移行しない
#--------------------------------------------------------------------------
def non_repeat
@repeat_action = []
@non_repeat = true
anime_finish
end
#--------------------------------------------------------------------------
# ● ターゲット変更 action = [判別, 変更する対象, 変更先]
#--------------------------------------------------------------------------
def change_target
# 自身の変更したターゲットを元に戻す
return @target_battler = @now_targets.dup if @active_action[2] == 3
# 送るターゲット情報
target = [@battler] if @active_action[2] == 0
target = @target_battler.dup if @active_action[2] != 0
# 自身のターゲットを送った相手にする場合、現在のターゲットを記憶
if @active_action[2] == 2
@now_targets = @target_battler.dup
@target_battler = []
end
# 送るターゲットがインデックス指定の場合
if @active_action[1] >= 1000
members = $game_party.members if @battler.actor?
members = $game_troop.members unless @battler.actor?
index = @active_action[1] - 1000
if index < members.size
if members[index].exist? && @battler.index != index
# ターゲット変更
members[index].force_target = ["N01target_change", target]
# 自身のターゲットを送った相手にする場合
@target_battler = [members[index]] if @active_action[2] == 2
change = true
else
for member in members
next if @battler.index == member.index
next unless member.exist?
member.force_target = ["N01target_change", target]
@target_battler = [member] if @active_action[2] == 2
break change = true
end
end
end
# 送るターゲットがステートID指定だった場合
elsif @active_action[1] > 0
for member in $game_party.members + $game_troop.members
if member.state?(@active_action[1])
member.force_target = ["N01target_change", target]
@target_battler.push(member) if @active_action[2] == 2
change = true
end
end
# 送るターゲットが習得スキル指定だった場合
elsif @active_action[1] < 0
skill_id = @active_action[1].abs
for actor in $game_party.members
if actor.skill_id_learn?(skill_id)
actor.force_target = ["N01target_change", target]
@target_battler.push(target) if @active_action[2] == 2
change = true
end
end
# 送るターゲットがターゲットだった場合
else
for member in @target_battler
member.force_target = ["N01target_change", target]
@target_battler.push(member) if @active_action[2] == 2
change = true
end
end
# 条件を満たせなければ以降のアクションを中断
return if change
return @action = ["End"] if @non_repeat
return start_action(@battler.recover_action)
end
#--------------------------------------------------------------------------
# ● ステート付与
#--------------------------------------------------------------------------
def state_on
state_id = @active_action[2]
# 対象で分岐
case @active_action[1]
when 0
@battler.add_state(state_id) if rand(100) < @battler.state_probability(state_id)
when 1
if @target_battler != nil
for target in @target_battler
target.add_state(state_id) if rand(100) < target.state_probability(state_id)
end
end
when 2
for target in $game_troop.members
target.add_state(state_id) if rand(100) < target.state_probability(state_id)
end
when 3
for target in $game_party.members
target.add_state(state_id) if rand(100) < target.state_probability(state_id)
end
when 4
for target in $game_party.members
if target.index != @battler.index
target.add_state(state_id) if rand(100) < target.state_probability(state_id)
end
end
end
end
#--------------------------------------------------------------------------
# ● ステート解除
#--------------------------------------------------------------------------
def state_off
state_id = @active_action[2]
# 対象で分岐
case @active_action[1]
when 0
@battler.remove_state(state_id)
when 1
if @target_battler != nil
for target in @target_battler
target.remove_state(state_id)
end
end
when 2
for target in $game_troop.members
target.remove_state(state_id)
end
when 3
for target in $game_party.members
target.remove_state(state_id)
end
when 4
for target in $game_party.members
if target.index != @battler.index
target.remove_state(state_id)
end
end
end
end
#--------------------------------------------------------------------------
# ● 浮遊実行
#--------------------------------------------------------------------------
def floating
# ジャンプを初期化
jump_reset
# 情報確認
@jump_plus = @active_action[1]
float_end = @active_action[2]
@float_time = @active_action[3]
# 1フレーム当たりの移動高度を計算
@float_up = (float_end - @jump_plus)/ @float_time
# 浮遊が完了するまで次のアクションに行かない
@wait = @float_time
# 浮遊アニメ設定を反映
if @anime_flug
move_anime = N01::ANIME[@active_action[4]]
# グラフィック指定がない場合はスキップ
if move_anime != nil
# 現在のアクションを上書き
@active_action = move_anime
# バトラーアニメ開始
battler_anime
# 浮遊が完了したら即アニメが終わるように
@anime_end = true
end
end
# 初期高度に浮遊
@battler.jump = @jump_plus
end
#--------------------------------------------------------------------------
# ● 強制アクション
#--------------------------------------------------------------------------
def force_action
# アクションが単発か通しか判別
kind = @active_action[0]
# 復帰の有無をチェック
rebirth = @active_action[2]
# 強制アクション内容を取得
play = @active_action[3]
# 上3つの情報をまとめて格納
action = [kind,rebirth,play]
# ターゲットがインデックス指定の場合
if @active_action[1] >= 1000
members = $game_party.members if @battler.actor?
members = $game_troop.members unless @battler.actor?
index = @active_action[1] - 1000
if index < members.size
if members[index].exist? && @battler.index != index
# バトラー情報に渡す
return members[index].force_action = action
else
for target in members
next if @battler.index == target.index
next unless target.exist?
force = true
break target.force_action = action
end
end
end
# 条件を満たせなければ以降のアクションを中断
return if force
return @action = ["End"] if @non_repeat
return start_action(@battler.recover_action)
# ターゲット指定の場合
elsif @active_action[1] == 0
for target in @target_battler
target.force_action = action if target != nil
end
# ステートID指定だった場合
elsif @active_action[1] > 0
for target in $game_party.members + $game_troop.members
target.force_action = action if target.state?(@active_action[1])
end
# 習得スキル指定だった場合
elsif @active_action[1] < 0
# エネミーは処理させない
return if @battler.is_a?(Game_Enemy)
for actor in $game_party.members
# 自分は除く
unless actor.id == @battler.id
# バトラー情報に渡す
actor.force_action = action if actor.skill_id_learn?(@active_action[1].abs)
end
end
end
end
#--------------------------------------------------------------------------
# ● 座標リセット実行
#--------------------------------------------------------------------------
def reseting
# ジャンプを初期化
jump_reset
# 回転を元に戻す
self.angle = 0
# 情報確認
@distanse_x = @move_x * -1
@distanse_y = @move_y * -1
@move_speed_x = @active_action[1]
@move_speed_y = @move_speed_x
@move_boost_x = @active_action[2]
@move_boost_y = @move_boost_x
@jump = @active_action[3]
# 移動計算
move_distance
# 移動アニメ設定を反映
if @anime_flug
move_anime = N01::ANIME[@active_action[4]]
# グラフィック指定がない場合はスキップ
if move_anime != nil
# 現在のアクションを上書き
@active_action = move_anime
# バトラーアニメ開始
battler_anime
end
# 移動が完了したら即アニメが終わるように
@anime_end = true
end
end
#--------------------------------------------------------------------------
# ● 移動実行
#--------------------------------------------------------------------------
def moving
# ジャンプを初期化
jump_reset
# X軸移動を便宜上抜き出す
xx = @active_action[1]
# バックアタック時にはX軸を逆に
xx *= -1 if $back_attack
# 移動目標のターゲットを確認
case @active_action[0]
when 0 # 自身
@distanse_x = xx
@distanse_y = @active_action[2]
when 1 # ターゲット
# ターゲットが決まってない場合、自身に変換
if @target_battler == nil
@distanse_x = xx
@distanse_y = @active_action[2]
else
# ターゲット対象をひとつずつチェック
target_x = 0
target_y = 0
time = 0
for i in 0...@target_battler.size
if @target_battler != nil
time += 1
target_x += @target_battler.position_x
target_y += @target_battler.position_y
end
end
# ターゲットが空だった場合、自身に変換
if time == 0
@distanse_x = xx
@distanse_y = @active_action[2]
else
# 複数ターゲットの中心を計算
target_x = target_x / time
target_y = target_y / time
# 最終的な移動距離を算出
@distanse_y = target_y - self.y + @active_action[2]
# X座標はアクターとエネミーで逆計算
if @battler.is_a?(Game_Actor)
@distanse_x = target_x - self.x + xx
else
@distanse_x = self.x - target_x + xx
end
end
end
when 2 # 画面
# X座標はアクターとエネミーで逆計算
if @battler.is_a?(Game_Actor)
@distanse_x = xx - self.x
@distanse_x = Graphics.width + xx - self.x if $back_attack
else
@distanse_x = self.x - xx
@distanse_x = self.x - (Graphics.width + xx) if $back_attack
end
@distanse_y = @active_action[2] - self.y
when 3 # 初期位置
# X座標はアクターとエネミーで逆計算
if @battler.is_a?(Game_Actor)
@distanse_x = xx + @battler.base_position_x - self.x
else
@distanse_x = xx + self.x - @battler.base_position_x
end
@distanse_y = @active_action[2] + @battler.base_position_y - @battler.position_y
end
@move_speed_x = @active_action[3]
@move_speed_y = @active_action[3]
@move_boost_x = @active_action[4]
@move_boost_y = @active_action[4]
@jump = @active_action[5]
@jump_plus = 0
# 移動計算
move_distance
# 移動アニメ設定を反映
if @anime_flug
move_anime = N01::ANIME[@active_action[6]]
# グラフィック指定がない場合はスキップ
if move_anime != nil
# 現在のアクションを上書き
@active_action = move_anime
# バトラーアニメ開始
battler_anime
end
# 移動が完了したら即アニメが終わるように
@anime_end = true
end
end
#--------------------------------------------------------------------------
# ● 移動計算
#--------------------------------------------------------------------------
def move_distance
# 速度が0の場合、その場に留まる
if @move_speed_x == 0
@moving_x = 0
@moving_y = 0
else
# 1フレームあたりの移動距離を計算
@moving_x = @distanse_x / @move_speed_x
@moving_y = @distanse_y / @move_speed_y
# 余った距離はこの時点で移動し消化
over_x = @distanse_x % @move_speed_x
over_y = @distanse_y % @move_speed_y
@move_x += over_x
@move_y += over_y
@battler.move_x = @move_x
@battler.move_y = @move_y
@distanse_x -= over_x
@distanse_y -= over_y
end
# 移動があるかどうかの判定
if @distanse_x == 0
@move_speed_x = 0
end
if @distanse_y == 0
@move_speed_y = 0
end
# X座標移動計算
# 加減速による移動フレーム数の修正
boost_x = @moving_x
move_x = 0
# 加速がある場合
if @move_boost_x > 0 && @distanse_x != 0
# 加減速の正負を左右移動に合わせて変換
if @distanse_x == 0
@move_boost_x = 0
elsif @distanse_x < 0
@move_boost_x *= -1
end
# 距離の変化を事前計算
for i in 0...@move_speed_x
boost_x += @move_boost_x
move_x += boost_x
# オーバー距離を記録
over_distance = @distanse_x - move_x
# 右移動で距離オーバーする直前が何フレーム目だったか記録
if @distanse_x > 0 && over_distance < 0
@move_speed_x = i
break
# 左移動で距離オーバーする直前が何フレーム目だったか記録
elsif @distanse_x < 0 && over_distance > 0
@move_speed_x = i
break
end
end
# オーバー距離を一回前に戻す
before = over_distance + boost_x
# 余った距離を等速移動させるフレーム数を加算
@move_speed_plus_x = (before / @moving_x).abs
# それでも余った距離はこの時点で移動し消化
@move_x += before % @moving_x
@battler.move_x = @move_x
# 減速がある場合
elsif @move_boost_x < 0 && @distanse_x != 0
# 加減速の正負を左右移動に合わせて変換
if @distanse_x == 0
@move_boost_x = 0
elsif @distanse_x < 0
@move_boost_x *= -1
end
# 距離の変化を事前計算
for i in 0...@move_speed_x
boost_x += @move_boost_x
move_x += boost_x
# 足りない距離を記録
lost_distance = @distanse_x - move_x
before = lost_distance
# 右移動で速度が0になる直前が何フレーム目だったか記録
if @distanse_x > 0 && boost_x < 0
@move_speed_x = i - 1
# 足りない距離を一回前に戻す
before = lost_distance + boost_x
break
# 左移動で速度が0になる直前が何フレーム目だったか記録
elsif @distanse_x < 0 && boost_x > 0
@move_speed_x= i - 1
# 足りない距離を一回前に戻す
before = lost_distance + boost_x
break
end
end
# 足りない距離を等速移動させるフレーム数を加算
plus = before / @moving_x
@move_speed_plus_x = plus.abs
# それでも余った距離はこの時点で移動し消化
@move_x += before % @moving_x
@battler.move_x = @move_x
end
# Y座標移動計算
# 加減速による移動フレーム数の修正
boost_y = @moving_y
move_y = 0
# 加速がある場合
if @move_boost_y > 0 && @distanse_y != 0
# 加減速の正負を左右移動に合わせて変換
if @distanse_y == 0
@move_boost_y = 0
elsif @distanse_y < 0
@move_boost_y *= -1
end
# 距離の変化を事前計算
for i in 0...@move_speed_y
boost_y += @move_boost_y
move_y += boost_y
# オーバー距離を記録
over_distance = @distanse_y - move_y
# 右移動で距離オーバーする直前が何フレーム目だったか記録
if @distanse_y > 0 && over_distance < 0
@move_speed_y = i
break
# 左移動で距離オーバーする直前が何フレーム目だったか記録
elsif @distanse_y < 0 && over_distance > 0
@move_speed_y = i
break
end
end
# オーバー距離を一回前に戻す
before = over_distance + boost_y
# 余った距離を等速移動させるフレーム数を加算
@move_speed_plus_y = (before / @moving_y).abs
# それでも余った距離はこの時点で移動し消化
@move_y += before % @moving_y
@battler.move_y = @move_y
# 減速がある場合
elsif @move_boost_y < 0 && @distanse_y != 0
# 加減速の正負を左右移動に合わせて変換
if @distanse_y == 0
@move_boost_y = 0
elsif @distanse_y < 0
@move_boost_y *= -1
end
# 距離の変化を事前計算
for i in 0...@move_speed_y
boost_y += @move_boost_y
move_y += boost_y
# 足りない距離を記録
lost_distance = @distanse_y - move_y
before = lost_distance
# 右移動で速度が0になる直前が何フレーム目だったか記録
if @distanse_y > 0 && boost_y < 0
@move_speed_y = i
# 足りない距離を一回前に戻す
before = lost_distance + boost_y
break
# 左移動で速度が0になる直前が何フレーム目だったか記録
elsif @distanse_y < 0 && boost_y > 0
@move_speed_y = i
# 足りない距離を一回前に戻す
before = lost_distance + boost_y
break
end
end
# 足りない距離を等速移動させるフレーム数を加算
plus = before / @moving_y
@move_speed_plus_y = plus.abs
# それでも余った距離はこの時点で移動し消化
@move_y += before % @moving_y
@battler.move_y = @move_y
end
# 移動完了時間を算出
x = @move_speed_plus_x + @move_speed_x
y = @move_speed_plus_y + @move_speed_y
if x > y
end_time = x
else
end_time = y
end
# 移動が完了するまで次のアクションに行かない
@wait = end_time
# ジャンプ計算
if @jump != 0
# 移動がなくジャンプのみの場合
if @wait == 0
# 時間に計上
@wait = @active_action[3]
end
# 移動完了時間からジャンプ時間を算出
@jump_time = @wait / 2
# 割り切れない場合の余り時間
@jump_time_plus = @wait % 2
# ジャンプの正負を判別
@jump_sign = 0
@jump_sign2 = 0
if @jump < 0
@jump_sign = -1
@jump_sign2 = 1
@jump = @jump * -1
else
@jump_sign = 1
@jump_sign2 = -1
end
# ジャンプ初速度を決定
@jump_up = 2 ** @jump * @jump_sign
# ジャンプ時間の端数を微調整
if @jump_time == 0
@jump_up = 0
elsif @jump_time != 1
@jump_size = @jump_up * @jump_sign * @jump_sign2
else
@jump_size = @jump_up * 2 * @jump_sign * @jump_sign2
@jump_flug = true
end
end
end
#--------------------------------------------------------------------------
# ● バトラーアニメ開始
#--------------------------------------------------------------------------
def battler_anime
# アニメ設定を反映
@anime_kind = @active_action[1]
@anime_speed = @active_action[2]
@anime_loop = @active_action[3]
# ウエイト時間があれば加算
@unloop_wait = @active_action[4]
@anime_end = true
@reverse = false
# 武器アクションがある場合だけ更新する
if @weapon_R != nil && @active_action[8] != ""
# 武器の設定をチェック
weapon_kind = N01::ANIME[@active_action[8]]
# エネミーと二刀ではないアクターの二刀フラグアニメ処理はキャンセル
two_swords_flug = weapon_kind[11]
return if two_swords_flug && [email protected]?
return if two_swords_flug && @battler.weapons[1] == nil && @battler.actor?
if @battler.actor? && @battler.weapons[0] == nil && !two_swords_flug
@weapon_R.action_reset
elsif @battler.actor? && @battler.weapons[1] == nil && two_swords_flug
@weapon_R.action_reset
elsif [email protected]? && @battler.weapon == 0
@weapon_R.action_reset
else
# 初期化
@weapon_R.action_reset
# アニメパターンが固定だった場合の武器位置を取得
if @active_action[5] != -1
@weapon_R.freeze(@active_action[5])
end
# 武器画像を設定
@weapon_R.weapon_graphics unless two_swords_flug
@weapon_R.weapon_graphics(true) if two_swords_flug
# 武器アクションを渡す
@weapon_R.weapon_action(@active_action[8],@anime_loop)
@weapon_action = true
# 最初の武器アクションを更新
@weapon_R.action
end
elsif @weapon_R != nil
@weapon_R.action_reset
end
@anime_end = false
# アニメパターンが固定だった場合
if @active_action[5] != -1 && @active_action[5] != -2
# フラグオン
@anime_freeze = true
# アニメが常に終了しているとみなす
@anime_end = true
# 片道逆転再生だった場合
elsif @active_action[5] == -2
@anime_freeze = false
# フラグオン
@reverse = true
# 最初のアニメパターンを更新
@pattern = @base_width - 1
# 武器アニメがある時だけフレーム更新
if @weapon_action && @weapon_R != nil
@weapon_R.action
@weapon_R.update
end
# 通常のアニメ更新の場合
else
@anime_freeze = false
# 最初のアニメパターンを更新
@pattern = 0
# 武器アニメがある時だけフレーム更新
if @weapon_action && @weapon_R != nil
@weapon_R.action
@weapon_R.update
end
end
@pattern_back = false
@frame = @anime_speed
# Z座標設定
@battler.move_z = @active_action[6]
# 影の有無
if @shadow != nil
@shadow.visible = true if @active_action[7]
@shadow.visible = false unless @active_action[7]
end
# ナンバリングから読み取るファイル名を分岐
if @active_action[0] == 0
file_name = @battler_name
else
file_name = @battler_name + "_" + @active_action[0].to_s
end
# アニメしないバトラーなら処理終了
return unless @anime_flug
@battler_hue = @battler.battler_hue ## blackmorning unofficial code; 3.3c
if @battler_hue != nil
self.bitmap = Cache.character(file_name, @battler_hue)
else
self.bitmap = Cache.character(file_name)
end ## end blackmorning unofficial code; 3.3c
# 転送元の矩形を設定
@sx = @pattern * @width
@sy = @anime_kind * @height
@sx = @active_action[5] * @width if @anime_freeze
self.src_rect.set(@sx, @sy, @width, @height)
end
#--------------------------------------------------------------------------
# ● アニメ飛ばし
#--------------------------------------------------------------------------
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)
for target in $game_troop.members
x += target.position_x
y += target.position_y
mem += 1
end
x = x / mem
y = y / mem
# 自身がエネミーの場合はアクターの中心を計算
else
for target in $game_party.members
x += target.position_x
y += target.position_y
mem += 1
end
x = x / mem
y = 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
#--------------------------------------------------------------------------
# ● アクション終了
#--------------------------------------------------------------------------
def anime_finish
# 個別処理終了が省略された場合リピートさせる
return individual_action_end if @individual_targets.size != 0
# アクティブバトラーにアクション情報を格納
send_action(@active_action[0]) if @battler.active
# 残像があれば開放
mirage_off if @mirage_flug
# 待機アクションを繰り返す
start_action(@repeat_action) unless @non_repeat
end
#--------------------------------------------------------------------------
# ● コラプスアクション
#--------------------------------------------------------------------------
def collapse_action
@non_repeat = true
@effect_type = COLLAPSE
@collapse_type = @battler.collapse_type unless @battler.actor?
@battler_visible = false unless @battler.actor?
@effect_duration = N01::COLLAPSE_WAIT + 48 if @collapse_type == 2
@effect_duration = 401 if @collapse_type == 3
end
#--------------------------------------------------------------------------
# ● ノーマルコラプス
#--------------------------------------------------------------------------
def normal_collapse
if @effect_duration == 47
Sound.play_enemy_collapse
self.blend_type = 1
self.color.set(255, 128, 128, 128)
end
self.opacity = 256 - (48 - @effect_duration) * 6 if @effect_duration <= 47
end
#--------------------------------------------------------------------------
# ● ボスコラプス
#--------------------------------------------------------------------------
def boss_collapse1
if @effect_duration == 320
Audio.se_play("Audio/SE/Absorb1", 100, 80)
self.flash(Color.new(255, 255, 255), 60)
viewport.flash(Color.new(255, 255, 255), 20)
end
if @effect_duration == 280
Audio.se_play("Audio/SE/Absorb1", 100, 80)
self.flash(Color.new(255, 255, 255), 60)
viewport.flash(Color.new(255, 255, 255), 20)
end
if @effect_duration == 220
Audio.se_play("Audio/SE/Earth4", 100, 80)
reset
self.blend_type = 1
self.color.set(255, 128, 128, 128)
self.wave_amp = 6
end
if @effect_duration < 220
self.src_rect.set(0, @effect_duration / 2 - 110, @width, @height)
self.x += 8 if @effect_duration % 4 == 0
self.x -= 8 if @effect_duration % 4 == 2
self.wave_amp += 1 if @effect_duration % 10 == 0
self.opacity = @effect_duration
return if @effect_duration < 50
Audio.se_play("Audio/SE/Earth4", 100, 50) if @effect_duration % 50 == 0
end
end
end
module Cache ## blackmorning unofficial Code 3.3c
#--------------------------------------------------------------------------
# * Get Character Graphic
# filename : Filename
#--------------------------------------------------------------------------
def self.character(filename, hue = 0)
load_bitmap("Graphics/Characters/", filename, hue)
end
end ## end unofficial Code 3.3c
=======================================================================================
(Sideview 2 (3.3d))
#==============================================================================
# ■ Scene_Battle for Sideview Ver3.3d
#------------------------------------------------------------------------------
# バトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
alias terminate_n01 terminate
def terminate
terminate_n01
# 二刀流の持ち替え処理を戻す
for member in $game_party.members
if member.two_swords_change
member.change_equip_by_id(1, member.weapon_id)
member.change_equip_by_id(0, 0)
member.two_swords_change = false
end
end
end
#--------------------------------------------------------------------------
# ● 戦闘開始の処理
#--------------------------------------------------------------------------
alias process_battle_start_n01 process_battle_start
def process_battle_start
process_battle_start_n01
# 二刀流で左(下部表示)に武器を持ち右(上部表示)に武器を持たないように
# している場合、ここで強制的に持ち替えさせる
for member in $game_party.members
if member.weapons[0] == nil and member.weapons[1] != nil
member.change_equip_by_id(0, member.armor1_id)
member.change_equip_by_id(1, 0)
member.two_swords_change = true
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_n01 update
def update
reset_stand_by_action
super
update_n01
end
#--------------------------------------------------------------------------
# ● イベント操作によるHP変動でキャラクターアクションを再設定
#--------------------------------------------------------------------------
def reset_stand_by_action
if $game_temp.status_window_refresh
$game_temp.status_window_refresh = false
for member in $game_party.members + $game_troop.members
@spriteset.set_stand_by_action(member.actor?, member.index)
# 自動復活チェック
resurrection(member) if member.hp == 0
end
@status_window.refresh
end
end
#--------------------------------------------------------------------------
# ● 敗北の処理
#--------------------------------------------------------------------------
alias process_defeat_n01 process_defeat
def process_defeat
for member in $game_party.members
@spriteset.set_stand_by_action(member.actor?, member.index)
end
process_defeat_n01
end
#--------------------------------------------------------------------------
# ● ヘルプウインドウの表示
#--------------------------------------------------------------------------
def pop_help(obj)
return if obj.extension.include?("HELPHIDE")
@help_window = Window_Help.new if @help_window == nil
@help_window.set_text(obj.name, 1)
@help_window.visible = true
end
#--------------------------------------------------------------------------
# ● 情報表示ビューポートの移動
#--------------------------------------------------------------------------
def move1_info_viewport
@info_viewport.ox = 128
loop do
update_basic
@info_viewport.ox -= 8
@party_command_window.x -= 8
@actor_command_window.x += 8
break if @info_viewport.ox == 64
end
end
#--------------------------------------------------------------------------
# ● 情報表示ビューポートの移動
#--------------------------------------------------------------------------
def move2_info_viewport
@info_viewport.ox = 64
loop do
update_basic
@info_viewport.ox -= 8
@party_command_window.x += 8
@actor_command_window.x -= 8
break if @info_viewport.ox == 0
end
end
#--------------------------------------------------------------------------
# ● 次のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias next_actor_n01 next_actor
def next_actor
# 動けるキャラのみコマンドアクションを
if @active_battler != nil && @active_battler.inputable? && @active_battler.actor?
@spriteset.set_action(true, @actor_index,@active_battler.command_a)
end
# 最後のアクターの場合、アクションが終わるまで待つ
@wait_count = 32 if @actor_index == $game_party.members.size-1
next_actor_n01
# 動けるキャラのみコマンドアクションを
if @active_battler != nil && @active_battler.inputable? && @active_battler.actor?
@spriteset.set_action(true, @actor_index,@active_battler.command_b)
end
end
#--------------------------------------------------------------------------
# ● 前のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias prior_actor_n01 prior_actor
def prior_actor
# 動けるキャラのみコマンドアクションを
if @active_battler != nil && @active_battler.inputable? && @active_battler.actor?
@active_battler.action.clear
@spriteset.set_action(true, @actor_index,@active_battler.command_a)
end
prior_actor_n01
# 動けるキャラのみコマンドアクションを
if @active_battler != nil && @active_battler.inputable? && @active_battler.actor?
@active_battler.action.clear
@spriteset.set_action(true, @actor_index,@active_battler.command_b)
end
end
#--------------------------------------------------------------------------
# ● ターゲット選択の開始 ※再定義
#--------------------------------------------------------------------------
def start_target_enemy_selection
start_target_selection
end
#--------------------------------------------------------------------------
# ● ターゲット選択の開始 ※再定義
#--------------------------------------------------------------------------
def start_target_actor_selection
start_target_selection(true)
end
#--------------------------------------------------------------------------
# ● ターゲット選択の開始
#--------------------------------------------------------------------------
def start_target_selection(actor = false)
members = $game_party.members if actor
members = $game_troop.members unless actor
# カーソルスプライトの作成
@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
# ターゲット名を表示するヘルプウインドウを作成
@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)
select_member(actor)
end
#--------------------------------------------------------------------------
# ● ターゲット選択
#--------------------------------------------------------------------------
def select_member(actor = false)
members = $game_party.members if actor
members = $game_troop.members unless actor
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 # if you get an error on this line, remove the Enemy Gauge Add-on script
end_target_selection
end_skill_selection
end_item_selection
next_actor
break
end
if Input.repeat?(Input::LEFT)
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)
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
cursor_up(members, actor) if Input.repeat?(Input::UP)
cursor_down(members, actor) if Input.repeat?(Input::DOWN)
end
end
#--------------------------------------------------------------------------
# ● カーソルを前に移動
#--------------------------------------------------------------------------
def cursor_up(members, actor)
Sound.play_cursor
members.size.times do
@index += members.size - 1
@index %= members.size
break if actor
break if members[@index].exist?
end
@help_window2.set_text(members[@index].name, 1)
end
#--------------------------------------------------------------------------
# ● カーソルを次に移動
#--------------------------------------------------------------------------
def cursor_down(members, actor)
Sound.play_cursor
members.size.times do
@index += 1
@index %= members.size
break if actor
break if members[@index].exist? && !actor
end
@help_window2.set_text(members[@index].name, 1)
end
#--------------------------------------------------------------------------
# ● ターゲット選択の終了
#--------------------------------------------------------------------------
def end_target_selection
@actor_command_window.active = true if @actor_command_window.index == 0
@skill_window.visible = true if @skill_window != nil
@item_window.visible = true if @item_window != nil
@cursor.dispose
@cursor = nil
if @help_window2 != nil
@help_window2.dispose
@help_window2 = nil
end
@help_window.visible = true if @help_window != nil
end
#--------------------------------------------------------------------------
# ● 逃走の処理 ※再定義
#--------------------------------------------------------------------------
def process_escape
@info_viewport.visible = false
@message_window.visible = true
text = sprintf(Vocab::EscapeStart, $game_party.name)
$game_message.texts.push(text)
if $game_troop.preemptive
success = true
else
success = (rand(100) < @escape_ratio)
end
Sound.play_escape
# 動けないアクターを除いて逃走成功アクション
if success
for actor in $game_party.members
unless actor.restriction >= 4
@spriteset.set_action(true, actor.index,actor.run_success)
end
end
wait_for_message
battle_end(1)
# 動けないアクターを除いて逃走失敗アクション
else
for actor in $game_party.members
unless actor.restriction >= 4
@spriteset.set_action(true, actor.index,actor.run_ng)
end
end
@escape_ratio += 10
$game_message.texts.push('\.' + Vocab::EscapeFailure)
wait_for_message
$game_party.clear_actions
start_main
end
end
#--------------------------------------------------------------------------
# ● 勝利の処理
#--------------------------------------------------------------------------
alias process_victory_n01 process_victory
def process_victory
@status_window.visible = true
@message_window.visible = false
# ボスコラプスはウエイトを長く挟む
for enemy in $game_troop.members
break boss_wait = true if enemy.collapse_type == 3
end
wait(440) if boss_wait
wait(N01::WIN_WAIT) unless boss_wait
# 動けないアクターを除いて勝利アクション
for actor in $game_party.members
unless actor.restriction >= 4
@spriteset.set_action(true, actor.index,actor.win)
end
end
process_victory_n01
end
#--------------------------------------------------------------------------
# ● 戦闘処理の実行開始 ※再定義
#--------------------------------------------------------------------------
def start_main
$game_troop.increase_turn
@info_viewport.visible = true
@info_viewport.ox = 0
@party_command_window.active = false
@actor_command_window.active = false
@status_window.index = @actor_index = -1
@active_battler = nil
@message_window.clear
$game_troop.make_actions
make_action_orders
# 情報表示ビューポートの移動
move1_info_viewport
# スキル名を表示するヘルプウインドウを作成
@help_window = Window_Help.new
@help_window.visible = false
process_battle_event
end
#--------------------------------------------------------------------------
# ● バトルイベントの処理 ※再定義
#--------------------------------------------------------------------------
def process_battle_event
loop do
return if judge_win_loss
return if $game_temp.next_scene != nil
$game_troop.interpreter.update
$game_troop.setup_battle_event
@message_window.update
if $game_message.visible
@message_window.visible = true
@status_window.visible = false
end
wait_for_message
@message_window.visible = false
@status_window.visible = true
if $game_troop.forcing_battler != nil
process_action
end
return unless $game_troop.interpreter.running?
update_basic
end
end
#--------------------------------------------------------------------------
# ● 行動順序作成
#--------------------------------------------------------------------------
alias make_action_orders_n01 make_action_orders
def make_action_orders
make_action_orders_n01
# エネミーの行動回数チェック
for enemy in $game_troop.members
enemy.act_time = 0
if enemy.action_time[0] != 1
action_time = 0
# 確率から回数を取得
for i in 1...enemy.action_time[0]
action_time += 1 if rand(100) < enemy.action_time[1]
end
enemy.act_time = action_time
action_time.times do
enemy_order_time(enemy)
action_time -= 1
break if action_time == 0
end
enemy.adj_speed = nil
end
end
end
#--------------------------------------------------------------------------
# ● エネミーの行動回数作成
#--------------------------------------------------------------------------
def enemy_order_time(enemy)
enemy.make_action_speed2(enemy.action_time[2])
select_time = 0
for member in @action_battlers
select_time += 1
break @action_battlers.push(enemy) if member.action.speed < enemy.adj_speed
break @action_battlers.push(enemy) if select_time == @action_battlers.size
end
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行
#--------------------------------------------------------------------------
alias execute_action_n01 execute_action
def execute_action
# スキル、アイテム拡張で行動前にフラッシュさせない設定があるなら
if @active_battler.action.kind != 0
obj = @active_battler.action.skill if @active_battler.action.kind == 1
obj = @active_battler.action.item if @active_battler.action.kind == 2
if obj.extension.include?("NOFLASH")
@active_battler.white_flash = false
end
end
# バトラーをアクティブ化
@active_battler.active = true
# 強制行動中のスキル派生
@active_battler.derivation = 0 if @active_battler.action.forcing
execute_action_n01
# スキル派生がある場合、行動続行
if @active_battler.derivation != 0
@active_battler.action.kind = 1
@active_battler.action.skill_id = @active_battler.derivation
# we dont need the derivation variable anymore, its already been set
@active_battler.derivation = 0 # Derivation fix, 1.1e
@action_battlers.unshift(@active_battler)
return process_action
end
# 複数回行動のエネミーがいる場合、次の行動を決定
if !@active_battler.actor? && @active_battler.act_time != 0
@active_battler.make_action
@active_battler.act_time -= 1
end
end
#--------------------------------------------------------------------------
# ● ターン終了 ※再定義
#--------------------------------------------------------------------------
def turn_end
for member in $game_party.members + $game_troop.members
member.clear_action_results
next unless member.exist?
member.slip_damage = false
actor = member.actor?
damage = 0
# 0ターン解除のステートがあるかチェック
for state in member.states
member.remove_state(state.id) if state.extension.include?("ZEROTURNLIFT")
# スリップダメージ実行 state = [ 対象, 定数, 割合, POP, 戦闘不能許可]
next unless state.extension.include?("SLIPDAMAGE")
for ext in state.slip_extension
if ext[0] == "hp"
base_damage = ext[1] + member.maxhp * ext[2] / 100
damage += base_damage + base_damage * (rand(5) - rand(5)) / 100
slip_pop = ext[3]
slip_dead = ext[4]
slip_damage_flug = true
member.slip_damage = true
end
end
end
# デフォルトのスリップダメージ
if member.slip_damage? && member.exist? && !slip_damage_flug
damage += member.apply_variance(member.maxhp / 10, 10)
slip_dead = false
slip_pop = true
slip_damage_flug = true
member.slip_damage = true
end
damage = member.hp - 1 if damage >= member.hp && slip_dead = false
member.hp -= damage
@spriteset.set_damage_pop(actor, member.index, damage) if slip_pop
member.perform_collapse if member.dead? && member.slip_damage
member.clear_action_results
end
@status_window.refresh
# HPとMPのタイミングをずらす
wait(55) if slip_damage_flug
slip_damage_flug = false
for member in $game_party.members + $game_troop.members
member.clear_action_results
next unless member.exist?
actor = member.actor?
mp_damage = 0
for state in member.states
next unless state.extension.include?("SLIPDAMAGE")
for ext in state.slip_extension
if ext[0] == "mp"
base_damage = ext[1] + member.maxmp * ext[2] / 100
mp_damage += base_damage + base_damage * (rand(5) - rand(5)) / 100
slip_pop = ext[2]
slip_damage_flug = true
end
end
member.mp_damage = mp_damage
member.mp -= mp_damage
@spriteset.set_damage_pop(actor, member.index, mp_damage) if slip_pop
end
member.clear_action_results
end
@status_window.refresh
# ダメージと回復のタイミングをずらす
wait(55) if slip_damage_flug
# 自動回復があるか
for member in $game_party.members
if member.auto_hp_recover and member.exist?
plus_hp = member.maxhp / 20
member.hp += plus_hp
@spriteset.set_damage_pop(true, member.index, plus_hp * -1)
plus_hp_flug = true
end
member.clear_action_results
end
@status_window.refresh
wait(55) if plus_hp_flug
@help_window.dispose if @help_window != nil
@help_window = nil
move2_info_viewport
$game_troop.turn_ending = true
$game_troop.preemptive = false
$game_troop.surprise = false
process_battle_event
$game_troop.turn_ending = false
start_party_command_selection
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : 攻撃 ※再定義
#--------------------------------------------------------------------------
def execute_action_attack
if @active_battler.actor?
if @active_battler.weapon_id == 0
action = @active_battler.non_weapon
# 行動中に死なないようメンバー全員を不死身化
immortaling
else
action = $data_weapons[@active_battler.weapon_id].base_action
# 戦闘不能付与の武器で不死身設定を分岐
if $data_weapons[@active_battler.weapon_id].state_set.include?(1)
for member in $game_party.members + $game_troop.members
next if member.immortal
next if member.dead?
member.dying = true
end
else
immortaling
end
end
else
if @active_battler.weapon == 0
action = @active_battler.base_action
immortaling
else
action = $data_weapons[@active_battler.weapon].base_action
if $data_weapons[@active_battler.weapon].state_set.include?(1)
for member in $game_party.members + $game_troop.members
next if member.immortal
next if member.dead?
member.dying = true
end
else
immortaling
end
end
end
target_decision
@spriteset.set_action(@active_battler.actor?, @active_battler.index, action)
playing_action
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : 防御 ※再定義
#--------------------------------------------------------------------------
def execute_action_guard
@help_window.set_text(N01::GUARD_HELP_TEXT, 1)
@help_window.visible = true
# バトラーのアクティブ化を解除
@active_battler.active = false
wait(45)
@help_window.visible = false
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : 逃走
#--------------------------------------------------------------------------
def execute_action_escape
@spriteset.set_action(false, @active_battler.index, @active_battler.run_success)
@help_window.set_text(N01::ESCAPED_HELP_TEXT, 1)
@help_window.visible = true
# バトラーのアクティブ化を解除
@active_battler.active = false
@active_battler.escape
Sound.play_escape
wait(45)
@help_window.visible = false
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : 待機 ※再定義
#--------------------------------------------------------------------------
def execute_action_wait
# バトラーのアクティブ化を解除
@active_battler.active = false
wait(45)
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : スキル ※再定義
#--------------------------------------------------------------------------
def execute_action_skill
skill = @active_battler.action.skill
return unless @active_battler.action.valid? # 3.3d, Force action bug fix
# 戦闘不能付与のスキルで不死身設定を分岐
if skill.plus_state_set.include?(1)
for member in $game_party.members + $game_troop.members
next if member.immortal
next if member.dead?
member.dying = true
end
else
# 行動中に死なないようメンバー全員を不死身化
immortaling
end
# ターゲット決定
target_decision(skill)
# アクション開始
@spriteset.set_action(@active_battler.actor?, @active_battler.index, skill.base_action)
# ヘルプウインドウにスキル名表示
pop_help(skill)
# アクション中
playing_action
# スキルコスト消費
@active_battler.consum_skill_cost(skill)
# ステータスウインドウをリフレッシュ
@status_window.refresh
# コモンイベント取得
$game_temp.common_event_id = skill.common_event_id
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : アイテム ※再定義
#--------------------------------------------------------------------------
def execute_action_item
item = @active_battler.action.item
# 戦闘不能付与のアイテムで不死身設定を分岐
if item.plus_state_set.include?(1)
for member in $game_party.members + $game_troop.members
next if member.immortal
next if member.dead?
member.dying = true
end
else
# 行動中に死なないようメンバー全員を不死身化
immortaling
end
$game_party.consume_item(item)
target_decision(item)
@spriteset.set_action(@active_battler.actor?, @active_battler.index, item.base_action)
pop_help(item)
playing_action
$game_temp.common_event_id = item.common_event_id
end
#--------------------------------------------------------------------------
# ● ターゲット決定
#--------------------------------------------------------------------------
def target_decision(obj = nil)
@targets = @active_battler.action.make_targets
# ターゲットがいない場合、アクション中断
if @targets.size == 0
action = @active_battler.recover_action
@spriteset.set_action(@active_battler.actor?, @active_battler.index, action)
end
if obj != nil
# デフォルトの複数回攻撃が設定されていれば単体ターゲットに変換
if obj.for_two? or obj.for_three? or obj.dual?
@targets = [@targets[0]]
end
# ランダムターゲットの場合、一体を選択しランダム範囲を保持
if obj.extension.include?("RANDOMTARGET")
randum_targets = @targets.dup
@targets = [randum_targets[rand(randum_targets.size)]]
end
end
# ターゲット情報をバトラースプライトに送る
@spriteset.set_target(@active_battler.actor?, @active_battler.index, @targets)
end
#--------------------------------------------------------------------------
# ● アクション実行中
#--------------------------------------------------------------------------
def playing_action
loop do
update_basic
# アクティブバトラーに格納されているアクション情報を見る
action = @active_battler.play
next if action == 0
@active_battler.play = 0
if action[0] == "Individual"
individual
elsif action == "Can Collapse"
unimmortaling
elsif action == "Cancel Action"
break action_end
elsif action == "End"
break action_end
elsif action[0] == "OBJ_ANIM"
damage_action(action[1])
end
end
end
#--------------------------------------------------------------------------
# ● 個別処理
#--------------------------------------------------------------------------
def individual
# ターゲット情報を保持
@individual_target = @targets
@stand_by_target = @targets.dup
end
#--------------------------------------------------------------------------
# ● コラプス禁止
#--------------------------------------------------------------------------
def immortaling # for sideview 2
for member in $game_party.members + $game_troop.members
# everyone currently in the battle
next if member.dead? # skip if they are dead
member.set_temp_immortal
# set the immortal flag
end
end
#--------------------------------------------------------------------------
# ● コラプス許可
#--------------------------------------------------------------------------
def unimmortaling
# 個別処理中はコラプス許可しない
return if @active_battler.individual
# 全員の不死身化解除(イベント等で不死身設定がされていれば除く)
for member in $game_party.members + $game_troop.members
if member.dying
member.dying = false
if member.dead? or member.hp == 0
member.add_state(1)
member.perform_collapse
end
end
next if member.non_dead
next if member.dead?
member.set_temp_immortal(false) # only changed this line, 3.3c
member.add_state(1) if member.hp == 0
member.perform_collapse
end
# この時点で待機アクションに即反映させる
@targets = @stand_by_target if @stand_by_target != nil
return if @targets == nil or @targets.size == 0
for target in @targets
@spriteset.set_stand_by_action(target.actor?, target.index)
# 自動復活チェック
next unless target.hp == 0
resurrection(target)
end
end
#--------------------------------------------------------------------------
# ● 自動復活
#--------------------------------------------------------------------------
def resurrection(target)
for state in target.states
for ext in state.extension
name = ext.split('')
next unless name[0] == "A"
wait(50)
name = name.join
name.slice!("AUTOLIFE/")
target.hp = target.maxhp * name.to_i / 100
target.remove_state(1)
target.remove_state(state.id)
target.animation_id = N01::RESURRECTION
target.animation_mirror = true if $back_attack
@status_window.refresh
wait($data_animations[N01::RESURRECTION].frame_max * 4)
end
end
end
#--------------------------------------------------------------------------
# ● 魔法反射・無効
#--------------------------------------------------------------------------
def magic_reflection(target, obj)
return if obj.physical_attack
for state in target.states
for ext in state.extension
name = ext.split('')
next unless name[0] == "M"
if name[3] == "R"
name = name.join
name.slice!("MAGREFLECT/")
target.animation_id = name.to_i
target.animation_mirror = true if $back_attack
@reflection = true
else
name = name.join
name.slice!("MAGNULL/")
target.animation_id = name.to_i
target.animation_mirror = true if $back_attack
@invalid = true
end
end
end
end
#--------------------------------------------------------------------------
# ● 物理反射・無効
#--------------------------------------------------------------------------
def physics_reflection(target, obj)
return if obj != nil && !obj.physical_attack
for state in target.states
for ext in state.extension
name = ext.split('')
next unless name[0] == "P"
if name[3] == "R"
name = name.join
name.slice!("PHYREFLECT/")
target.animation_id = name.to_i
target.animation_mirror = true if $back_attack
@reflection = true
else
name = name.join
name.slice!("PHYNULL/")
target.animation_id = name.to_i
target.animation_mirror = true if $back_attack
@invalid = true
end
end
end
end
#--------------------------------------------------------------------------
# ● スキルコスト吸収
#--------------------------------------------------------------------------
def absorb_cost(target, obj)
for state in target.states
if state.extension.include?("COSTABSORB")
cost = @active_battler.calc_mp_cost(obj)
# SP消費とHP消費で分ける
return target.hp += cost if obj.extension.include?("CONSUMEHP")
return target.mp += cost
end
end
end
#--------------------------------------------------------------------------
# ● 吸収処理
#--------------------------------------------------------------------------
def absorb_attack(obj, target, index, actor)
absorb = target.hp_damage
absorb = target.mp_damage if target.mp_damage != 0
# ターゲットが複数同時の吸収処理
@wide_attack = true if obj.scope == 2 or obj.scope == 4 or obj.scope == 6 or obj.extension.include?("TARGETALL")
if @wide_attack && @absorb == nil && @targets.size != 1
# 吸収した分を戻す
@active_battler.hp -= @active_battler.hp_damage
@active_battler.mp -= @active_battler.mp_damage
# 後で吸い戻す数値として加算
@absorb = absorb
@absorb_target_size = @targets.size - 2
elsif @absorb != nil && @absorb_target_size > 0
@active_battler.hp -= @active_battler.hp_damage
@active_battler.mp -= @active_battler.mp_damage
@absorb += absorb
@absorb_target_size -= 1
# 複数ターゲットの最終吸収処理
elsif @absorb != nil
# 吸収した分を戻す
@active_battler.hp -= @active_battler.hp_damage
@active_battler.mp -= @active_battler.mp_damage
@absorb += absorb
# ここで全吸収分を反映
@active_battler.hp_damage = -@absorb
@active_battler.mp_damage = -@absorb if target.mp_damage != 0
@active_battler.hp -= @active_battler.hp_damage
@active_battler.mp -= @active_battler.mp_damage
# 吸収量が0の場合の吸収者側処理
absorb_action = ["absorb", nil, false] if @absorb == 0
absorb_action = [nil, nil, false] if @absorb != 0
@spriteset.set_damage_action(actor, index, absorb_action)
@active_battler.perform_collapse
@absorb = nil
@absorb_target_size = nil
# 単体での吸収処理
else
# 吸収量が0の場合の吸収者側処理
absorb_action = ["absorb", nil, false] if absorb == 0
absorb_action = [nil, nil, false] if absorb != 0
@spriteset.set_damage_action(actor, index, absorb_action)
# 逆吸収でHP0になった場合
@absorb_dead = true if @active_battler.hp == 0 && !@active_battler.non_dead
end
# 吸収量が0の場合の対象者側処理
return 0 if absorb == 0
end
#--------------------------------------------------------------------------
# ● アクション終了
#--------------------------------------------------------------------------
def action_end
# 初期化
@individual_target = nil
@help_window.visible = false if @help_window != nil && @help_window.visible
@active_battler.active = false
@active_battler.clear_action_results
# 念のため不死身化解除
unimmortaling
# 反射されていた場合
if @active_battler.reflex != nil
if @active_battler.action.skill?
obj = @active_battler.action.skill
@active_battler.perfect_skill_effect(@active_battler, obj)
elsif @active_battler.action.item?
obj = @active_battler.action.item
@active_battler.item_effect(@active_battler, obj)
else
@active_battler.perfect_attack_effect(@active_battler)
end
pop_damage(@active_battler, obj, @active_battler.reflex)
@active_battler.perform_collapse
@active_battler.reflex = nil
wait(N01::COLLAPSE_WAIT)
end
# 逆吸収で戦闘不能になった場合
if @absorb_dead
@active_battler.perform_collapse
@absorb_dead = false
wait(N01::COLLAPSE_WAIT)
end
# 次の行動までウエイトを挟む
wait(N01::ACTION_WAIT)
end
#--------------------------------------------------------------------------
# ● ダメージ処理
#--------------------------------------------------------------------------
def damage_action(action)
# 個別処理の場合ターゲットを一つずつ抜き出す
@targets = [@individual_target.shift] if @active_battler.individual
# スキルの場合
if @active_battler.action.skill?
obj = @active_battler.action.skill
for target in @targets
return if target == nil
return if target.dead? && !obj.for_dead_friend?
# HPが0なら戦闘不能復活以外はミスしない
target.revival = true if obj.for_dead_friend?
if target.hp == 0 && !obj.for_dead_friend?
target.perfect_skill_effect(@active_battler, obj)
# 必中確認
elsif obj.extension.include?("NOEVADE")
target.perfect_skill_effect(@active_battler, obj)
else
# 反射確認
magic_reflection(target, obj) unless obj.extension.include?("IGNOREREFLECT")
physics_reflection(target, obj) unless obj.extension.include?("IGNOREREFLECT")
# ダメージ計算
target.skill_effect(@active_battler, obj) unless @reflection or @invalid
end
pop_damage(target, obj, action) unless @reflection or @invalid
# コスト吸収確認
absorb_cost(target, obj)
# 反射アクション取得
@active_battler.reflex = action if @reflection
@reflection = false
@invalid = false
end
# アイテムの場合
elsif @active_battler.action.item?
obj = @active_battler.action.item
for target in @targets
return if target == nil
return if target.dead? && !obj.for_dead_friend?
target.revival = true if obj.for_dead_friend?
if target.hp == 0 && !obj.for_dead_friend?
target.perfect_item_effect(@active_battler, obj)
elsif obj.extension.include?("NOEVADE")
target.perfect_item_effect(@active_battler, obj)
else
magic_reflection(target, obj) unless obj.extension.include?("IGNOREREFLECT")
physics_reflection(target, obj) unless obj.extension.include?("IGNOREREFLECT")
target.item_effect(@active_battler, obj) unless @reflection or @invalid
end
pop_damage(target, obj, action) unless @reflection or @invalid
@active_battler.reflex = action if @reflection
@reflection = false
@invalid = false
end
# 通常攻撃の場合
else
for target in @targets
return if target == nil or target.dead?
physics_reflection(target, nil)
target.perfect_attack_effect(@active_battler) if target.hp <= 0
target.attack_effect(@active_battler) unless target.hp <= 0 or @reflection or @invalid
pop_damage(target, nil, action) unless @reflection or @invalid
# 反射アクション取得
@active_battler.reflex = action if @reflection
@reflection = false
@invalid = false
end
end
# ステータスウインドウをリフレッシュ
@status_window.refresh
# 連続行動中のランダムターゲットを考慮し、すぐに次のターゲットを選択
return if obj == nil
target_decision(obj) if obj.extension.include?("RANDOMTARGET")
end
#--------------------------------------------------------------------------
# ● ダメージ表示 action = [アニメID,反転フラグ,リアクション許可]
#--------------------------------------------------------------------------
def pop_damage(target, obj, action)
index = @active_battler.index
actor = @active_battler.actor?
if obj != nil
# スキルやアイテムが吸収属性なら
absorb = absorb_attack(obj, target, index, actor) if obj.absorb_damage
action.push(true) if absorb == 0
# 拡張設定でダメージアクション禁止なら
action[2] = false if obj.extension.include?("NOOVERKILL")
end
# 対象のリアクション
@spriteset.set_damage_action(target.actor?, target.index, action)
end
end
#==============================================================================
# ■ Game_BattleAction
#------------------------------------------------------------------------------
# 戦闘行動を扱うクラスです。
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# ● 行動が有効か否かの判定 ※再定義
#--------------------------------------------------------------------------
def valid?
return false if nothing? # 何もしない
return true if @forcing # 行動強制中
return false unless battler.movable? # 行動不能
if skill? # スキル
# if battler.derivation != 0 # Derivation fix, 3.3c/1.1e
# battler.derivation = 0 # 3.3c/1.1e
# return true # 3.3c/1.1e
# end # 3.3c/1.1e
return false unless battler.skill_can_use?(skill)
elsif item? # アイテム
return false unless friends_unit.item_can_use?(item)
end
return true
end
#--------------------------------------------------------------------------
# ● ターゲットの配列作成 ※再定義
#--------------------------------------------------------------------------
def make_targets
if attack?
return make_attack_targets
elsif skill?
targets = make_obj_targets(skill)
targets = make_obj_targets2(skill, targets) if skill.extension != ["NONE"]
return targets
elsif item?
targets = make_obj_targets(item)
targets = make_obj_targets2(item, targets) if item.extension != ["NONE"]
return targets
end
end
#--------------------------------------------------------------------------
# ● スキルまたはアイテムのターゲット作成の拡張
#--------------------------------------------------------------------------
def make_obj_targets2(obj, targets)
if obj.extension.include?("TARGETALL")
targets = []
targets += opponents_unit.existing_members
targets += friends_unit.existing_members
end
if obj.extension.include?("OTHERS")
targets.delete($game_party.members[battler.index]) if battler.actor?
targets.delete($game_troop.members[battler.index]) unless battler.actor?
end
return targets.compact
end
end
#==============================================================================
# ■ Sprite_Base
#------------------------------------------------------------------------------
# アニメーションの表示処理を追加したスプライトのクラスです。
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# ● アニメーションの更新 アニメをスプライトに追従するように
#--------------------------------------------------------------------------
alias update_animation_n01 update_animation
def update_animation ### UNOFFICIAL CODE CHANGE 3.3b ###
@animation_ox = x - ox + width / 2 unless @animation.position == 3 # Screen
@animation_oy = y - oy + height if @animation.position == 2 # Feet
@animation_oy = y - oy + height / 2 if @animation.position == 1 # Center
@animation_oy = y - oy if @animation.position == 0 # Head
update_animation_n01 ### END UNOFFICIAL CODE CHANGE 3.3b ###
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# バトル画面のスプライトをまとめたクラスです。
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● エネミースプライトの作成
#--------------------------------------------------------------------------
def create_enemies
@enemy_sprites = []
for i in 0...$game_troop.members.size
@enemy_sprites.push(Sprite_Battler.new(@viewport1, $game_troop.members))
@enemy_sprites.opacity = 0 if $game_troop.members.hidden
end
end
#--------------------------------------------------------------------------
# ● アクタースプライトの作成
#--------------------------------------------------------------------------
def create_actors
@actor_sprites = []
# メンバー最大数スプライトを用意
for i in 0...N01::MAX_MEMBER
@actor_sprites.push(Sprite_Battler.new(@viewport1, $game_party.members))
if $game_party.members != nil
@actor_sprites.make_battler
@actor_sprites.first_action
end
end
end
#--------------------------------------------------------------------------
# ● バトルフロアスプライトの作成
#--------------------------------------------------------------------------
def create_battlefloor
@battlefloor_sprite = Sprite.new(@viewport1)
@battlefloor_sprite.bitmap = Cache.system(N01::BATTLEFLOOR_GRAPHIC) # v3.3a
@battlefloor_sprite.x = N01::FLOOR[0]
@battlefloor_sprite.y = N01::FLOOR[1]
@battlefloor_sprite.opacity = N01::FLOOR[2]
@battlefloor_sprite.z = 1
# バックアタック時、フロアと背景を反転させる
back_attack
if $back_attack
@battlefloor_sprite.mirror = true
@battleback_sprite.mirror = true
$game_troop.surprise = true
else
$game_troop.surprise = false
end
end
#--------------------------------------------------------------------------
# ● バックアタック
#--------------------------------------------------------------------------
def back_attack
# 強制バックアタックならフラグオン
for i in 0...N01::BACK_ATTACK_SWITCH.size
return $back_attack = true if $game_switches[N01::BACK_ATTACK_SWITCH]
end
# 不意打ちが発生していなければ処理を中断
return $back_attack = false unless $game_troop.surprise && N01::BACK_ATTACK
# 装備等によるバックアタック無効化をチェック
for actor in $game_party.members
return $back_attack = false if N01::NON_BACK_ATTACK_WEAPONS.include?(actor.weapon_id)
return $back_attack = false if N01::NON_BACK_ATTACK_ARMOR1.include?(actor.armor1_id)
return $back_attack = false if N01::NON_BACK_ATTACK_ARMOR2.include?(actor.armor2_id)
return $back_attack = false if N01::NON_BACK_ATTACK_ARMOR3.include?(actor.armor3_id)
return $back_attack = false if N01::NON_BACK_ATTACK_ARMOR4.include?(actor.armor4_id)
for i in 0...N01::NON_BACK_ATTACK_SKILLS.size
return $back_attack = false if actor.skill_id_learn?(N01::NON_BACK_ATTACK_SKILLS)
end
end
# バックアタック発生
$back_attack = true
end
#--------------------------------------------------------------------------
# ● アクタースプライトの更新 ※再定義
#--------------------------------------------------------------------------
def update_actors
for i in 0...@actor_sprites.size
if $party_change
$party_change = false
dispose_actors
return create_actors
end
if @actor_sprites.battler.id != $game_party.members.id
dispose_actors
return create_actors
end
@actor_sprites.update
end
end
#--------------------------------------------------------------------------
# ● ダメージアクションセット
#--------------------------------------------------------------------------
def set_damage_action(actor, index, action)
@actor_sprites[index].damage_action(action) if actor
@enemy_sprites[index].damage_action(action) unless actor
end
#--------------------------------------------------------------------------
# ● ダメージPOPセット
#--------------------------------------------------------------------------
def set_damage_pop(actor, index, damage)
@actor_sprites[index].damage_pop(damage) if actor
@enemy_sprites[index].damage_pop(damage) unless actor
end
#--------------------------------------------------------------------------
# ● ターゲットセット
#--------------------------------------------------------------------------
def set_target(actor, index, target)
@actor_sprites[index].get_target(target) if actor
@enemy_sprites[index].get_target(target) unless actor
end
#--------------------------------------------------------------------------
# ● アクションセット
#--------------------------------------------------------------------------
def set_action(actor, index, kind)
@actor_sprites[index].start_action(kind) if actor
@enemy_sprites[index].start_action(kind) unless actor
end
#--------------------------------------------------------------------------
# ● 待機アクションセット
#--------------------------------------------------------------------------
def set_stand_by_action(actor, index)
@actor_sprites[index].push_stand_by if actor
@enemy_sprites[index].push_stand_by unless actor
end
#--------------------------------------------------------------------------
# ● カーソル移動のセット
#--------------------------------------------------------------------------
def set_cursor(actor, index)
return [@actor_sprites[index].x, @actor_sprites[index].y] if actor
return [@enemy_sprites[index].x, @enemy_sprites[index].y] unless actor
end
end
#==============================================================================
# ■ Sprite_MoveAnime
#------------------------------------------------------------------------------
# アニメ飛ばし用のスプライトです。
#==============================================================================
class Sprite_MoveAnime < Sprite_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :battler
attr_accessor :base_x # 自身の基本X座標
attr_accessor :base_y # 自身の基本Y座標
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(viewport,battler = nil)
super(viewport)
@battler = battler
self.visible = false
@base_x = 0
@base_y = 0
@move_x = 0 # 動かしたX座標
@move_y = 0 # 動かしたY座標
@moving_x = 0 # 1フレーム当たり動かすX座標
@moving_y = 0 # 1フレーム当たり動かすY座標
@orbit = 0 # 円軌道
@orbit_plus = 0 # 加算する円軌道
@orbit_time = 0 # 円軌道計算時間
@through = false # 貫通するかどうか
@finish = false # 移動終了フラグ
@time = 0 # 移動時間
@angle = 0 # 武器の角度
@angling = 0 # 1フレーム当たり動かす武器の角度
end
#--------------------------------------------------------------------------
# ● アクションを取得
#--------------------------------------------------------------------------
def anime_action(id,mirror,distanse_x,distanse_y,type,speed,orbit,weapon,icon_index,icon_weapon)
# 1フレームあたりの移動距離を算出
@time = speed
@moving_x = distanse_x / speed
@moving_y = distanse_y / speed
# 貫通するかどうか
@through = true if type == 1
# 円軌道を取得
@orbit_plus = orbit
@orbit_time = @time
# 武器グラフィックの有無
if weapon != ""
action = N01::ANIME[weapon].dup
@angle = action[0]
end_angle = action[1]
time = action[2]
# 1フレームあたりの回転角度を出す
@angling = (end_angle - @angle)/ time
# 開始角度を取る
self.angle = @angle
# 武器グラフィックを表示
self.mirror = mirror
if icon_weapon
self.bitmap = Cache.system("Iconset")
self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.ox = 12
self.oy = 12
else
self.bitmap = Cache.character(icon_index)
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
end
self.visible = true
# バトラーより手前に表示
self.z = 1000
end
# 最初は動かさず一回だけ表示
self.x = @base_x + @move_x
self.y = @base_y + @move_y + @orbit
if id != 0
animation = $data_animations[id]
start_animation(animation, mirror)
end
end
#--------------------------------------------------------------------------
# ● 変化した動きをリセット
#--------------------------------------------------------------------------
def action_reset
@moving_x = @moving_y = @move_x = @move_y = @base_x = @base_y = @orbit = 0
@orbit_time = @angling = @angle = 0
@through = self.visible = @finish = false
dispose_animation
end
#--------------------------------------------------------------------------
# ● 貫通終了
#--------------------------------------------------------------------------
def finish?
return @finish
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# 時間消費
@time -= 1
# 時間まで指定の動きを
if @time >= 0
@move_x += @moving_x
@move_y += @moving_y
# 円軌道計算
if @time < @orbit_time / 2
@orbit_plus = @orbit_plus * 5 / 4
elsif @time == @orbit_time / 2
@orbit_plus *= -1
else
@orbit_plus = @orbit_plus * 2 / 3
end
@orbit += @orbit_plus
end
# 時間がきても貫通ならそのまま直進
@time = 100 if @time < 0 && @through
@finish = true if @time < 0 && !@through
# スプライトの座標を更新
self.x = @base_x + @move_x
self.y = @base_y + @move_y + @orbit
# 貫通の場合、画面から消えたら終了フラグオン
if self.x < -200 or self.x > 840 or self.y < -200 or self.y > 680
@finish = true
end
# 武器グラフィック更新
if self.visible
@angle += @angling
self.angle = @angle
end
end
end
#==============================================================================
# ■ Sprite_Weapon
#------------------------------------------------------------------------------
# ウエポン表示用のスプライトです。
#==============================================================================
class Sprite_Weapon < Sprite_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(viewport,battler = nil)
super(viewport)
@battler = battler
@action = [] # 武器のアクション情報
@move_x = 0 # 動かしたX座標
@move_y = 0 # 動かしたY座標
@move_z = 0 # 動かしたZ座標
@plus_x = 0 # 微調整分のX座標
@plus_y = 0 # 微調整分のY座標
@angle = 0 # 武器の回転角度
@zoom_x = 1 # 武器の横拡大率
@zoom_y = 1 # 武器の縦拡大率
@moving_x = 0 # 1フレーム当たり動かすX座標
@moving_y = 0 # 1フレーム当たり動かすY座標
@angling = 0 # 1フレーム当たりの回転角度
@zooming_x = 1 # 1フレーム当たりの横拡大率
@zooming_y = 1 # 1フレーム当たりの縦拡大率
@freeze = -1 # 固定アニメ用武器位置
@mirroring = false # バトラーが反転しているか
@time = N01::ANIME_PATTERN + 1 # 更新回数
# 武器を取得
weapon_graphics
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose if self.bitmap != nil
super
end
#--------------------------------------------------------------------------
# ● 武器を取得
#--------------------------------------------------------------------------
def weapon_graphics(left = false)
if @battler.actor?
weapon = @battler.weapons[0] unless left
weapon = @battler.weapons[1] if left
else
weapon = $data_weapons[@battler.weapon]
end
# 武器がなければ処理をキャンセル
return if weapon == nil
# アイコンを利用するなら
if weapon.graphic == ""
icon_index = weapon.icon_index
self.bitmap = Cache.system("Iconset")
self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
@weapon_width = @weapon_height = 24
# ID指定があったら、アイコンではなくそのグラフィックを取得
else
self.bitmap = Cache.character(weapon.graphic)
@weapon_width = self.bitmap.width
@weapon_height = self.bitmap.height
end
end
#--------------------------------------------------------------------------
# ● アニメ固定時の武器位置を取得
#--------------------------------------------------------------------------
def freeze(action)
@freeze = action
end
#--------------------------------------------------------------------------
# ● 武器アクションを取得 freeze
#--------------------------------------------------------------------------
def weapon_action(action,loop)
# 名称がない場合は非表示に
if action == ""
self.visible = false
# 素手なら非表示に
elsif @weapon_id == 0
self.visible = false
# 武器アクション情報を受け取る
else
@action = N01::ANIME[action]
act0 = @action[0]
act1 = @action[1]
act2 = @action[2]
act3 = @action[3]
act4 = @action[4]
act5 = @action[5]
act6 = @action[6]
act7 = @action[7]
act8 = @action[8]
act9 = @action[9]
act10 = @action[10]
# バトラーが反転してる場合、X軸の動きを逆に
if @mirroring
act0 *= -1
act3 *= -1
act4 *= -1
act9 *= -1
end
# キャラのアニメパターン数をチェック
time = N01::ANIME_PATTERN
# Z座標をチェック
if act2
self.z = @battler.position_z + 1
else
self.z = @battler.position_z - 1
end
# 反転はここで実行し、すでに反転している場合は元に戻す
if act6
if self.mirror
self.mirror = false
else
self.mirror = true
end
end
# バトラーの反転を反映
if @mirroring
if self.mirror
self.mirror = false
else
self.mirror = true
end
end
# アニメパターン数で割った変化を計算
@moving_x = act0 / time
@moving_y = act1 / time
# 最初の角度を代入
@angle = act3
self.angle = @angle
# 更新角度を計算
@angling = (act4 - act3)/ time
# 角度が割り切れない場合、ここで余り分を回転加算
@angle += (act4 - act3) % time
# 拡大縮小
@zooming_x = (1 - act7) / time
@zooming_y = (1 - act8) / time
# 反転してる場合、回転元の原点を逆に
if self.mirror
case act5
when 1 # 左上→右上に
act5 = 2
when 2 # 右上→左上に
act5 = 1
when 3 # 左下→右下に
act5 = 4
when 4 # 右下→左下に
act5 = 3
end
end
# 回転元の原点を設定
case act5
when 0 # 中心
self.ox = @weapon_width / 2
self.oy = @weapon_height / 2
when 1 # 左上
self.ox = 0
self.oy = 0
when 2 # 右上
self.ox = @weapon_width
self.oy = 0
when 3 # 左下
self.ox = 0
self.oy = @weapon_height
when 4 # 右下
self.ox = @weapon_width
self.oy = @weapon_height
end
# 座標微調整
@plus_x = act9
@plus_y = act10
# 往復ループならフラグオン
@loop = true if loop == 0
# 初回で0から始まるように、この時点で-1回の動きをさせる
@angle -= @angling
@zoom_x -= @zooming_x
@zoom_y -= @zooming_y
# スプライトの座標を更新
@move_x -= @moving_x
@move_y -= @moving_y
@move_z = 1000 if act2
# 固定アニメの場合、この時点で動きを消化
if @freeze != -1
for i in 0..@freeze + 1
@angle += @angling
@zoom_x += @zooming_x
@zoom_y += @zooming_y
# スプライトの座標を更新
@move_x += @moving_x
@move_y += @moving_y
end
@angling = 0
@zooming_x = 0
@zooming_y = 0
@moving_x = 0
@moving_y = 0
end
# 可視
self.visible = true
end
end
#--------------------------------------------------------------------------
# ● 変化した動きを全部リセット
#--------------------------------------------------------------------------
def action_reset
@moving_x = @moving_y = @move_x = @move_y = @plus_x = @plus_y = 0
@angling = @zooming_x = @zooming_y = @angle = self.angle = @move_z = 0
@zoom_x = @zoom_y = self.zoom_x = self.zoom_y = 1
self.mirror = self.visible = @loop = false
@freeze = -1
@action = []
@time = N01::ANIME_PATTERN + 1
end
#--------------------------------------------------------------------------
# ● 往復ループさせる
#--------------------------------------------------------------------------
def action_loop
# 動きを反対に
@angling *= -1
@zooming_x *= -1
@zooming_y *= -1
@moving_x *= -1
@moving_y *= -1
end
#--------------------------------------------------------------------------
# ● アクターが反転している場合、自身も反転させる
#--------------------------------------------------------------------------
def mirroring
return @mirroring = false if @mirroring
@mirroring = true
end
#--------------------------------------------------------------------------
# ● アクターアニメが更新された時のみ武器アクションの変化を更新
#--------------------------------------------------------------------------
def action
return if @time <= 0
@time -= 1
# 回転、拡大縮小を更新
@angle += @angling
@zoom_x += @zooming_x
@zoom_y += @zooming_y
# スプライトの座標を更新
@move_x += @moving_x
@move_y += @moving_y
# 往復ループなら動きを反転
if @loop && @time == 0
@time = N01::ANIME_PATTERN + 1
action_loop
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# 回転、拡大縮小を更新
self.angle = @angle
self.zoom_x = @zoom_x
self.zoom_y = @zoom_y
# スプライトの座標を更新
self.x = @battler.position_x + @move_x + @plus_x
self.y = @battler.position_y + @move_y + @plus_y
self.z = @battler.position_z + @move_z - 1
end
end
#==============================================================================
# ■ Game_Battler (分割定義 1)
#------------------------------------------------------------------------------
# バトラーを扱うクラスです。
#==============================================================================
class Game_Battler
IMMORTALITY_CHANGING_METHODS = N01::IMMORTALITY_CHANGING_METHODS
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :hp_damage # 行動結果: HP ダメージ
attr_accessor :mp_damage # 行動結果: MP ダメージ
attr_accessor :move_x # X方向の移動補正
attr_accessor :move_y # Y方向の移動補正
attr_accessor :move_z # Z方向の移動補正
attr_accessor :jump # ジャンプ補正
attr_accessor :active # アクティブか
attr_accessor :non_dead # 不死身フラグ
attr_accessor :dying # 即死フラグ
attr_accessor :slip_damage # スリップダメージフラグ
attr_accessor :derivation # スキル派生ID
attr_accessor :individual # スキル派生ID
attr_accessor :play # アクション情報
attr_accessor :force_action # 強制されるアクション情報
attr_accessor :force_target # ターゲット変更情報
attr_accessor :revival # 復活
attr_accessor :double_damage # HPMP両方同時ダメージ
attr_accessor :reflex # スキル反射情報
attr_accessor :absorb # スキルコスト吸収
attr_reader :base_position_x # 初期配置X座標
attr_reader :base_position_y # 初期配置Y座標
attr_accessor :force_damage # イベントでのダメージ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_n01 initialize
def initialize
initialize_n01
@move_x = @move_y = @move_z = @plus_y = @jump = @derivation = @play = 0
@force_action = @force_target = @base_position_x = @base_position_y = 0
@absorb = @act_time = @force_damage = 0
@active = @individual = @slip_damage = @revival = false # removed ref to @non_dead 3.3c
@double_damage = @dying = false
@non_dead = @immortal # object initilization, sync @non_dead and @immortal 3.3c
end
#--------------------------------------------------------------------------
# ● Set Immortality Temporarily
#--------------------------------------------------------------------------
def set_temp_immortal(flag = true) # New method, 3.3c
# set immortality temporarily, used from the SBS scripts
@immortal = flag # ONLY @immortal is set, @non_dead is not touched
end
#--------------------------------------------------------------------------
# ● standard accessor for @immortal
#--------------------------------------------------------------------------
alias immortal_set_SBS immortal=
def immortal=(flag) # standard accessor for @immortal
@immortal = flag
@non_dead = flag # when the standard accessor is used (eg., from OUTSIDE the
# SBS scripts, Game_Troop#setup, etc.), the @non_dead flag is also set.
end
IMMORTALITY_CHANGING_METHODS.each {|m|
aStr = %Q(
if method_defined?(:#{m}) && !method_defined?(:aliased_immortal_#{m})
alias :aliased_immortal_#{m} :#{m}
def #{m}(*args)
val = aliased_immortal_#{m}(*args)
@non_dead = @immortal
return val
end
end
)
module_eval(aStr)
# makes an alias for the given methods, syncs @non_dead with
# @immortal after the method is run, and perserves the return value and argv
}
#--------------------------------------------------------------------------
# ● 一番新しいステートIDを返す
#--------------------------------------------------------------------------
def state_id
return @states[@states.size - 1]
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定 ※再定義
#--------------------------------------------------------------------------
def skill_can_use?(skill)
return false unless skill.is_a?(RPG::Skill)
return false unless movable?
return false if silent? and skill.spi_f > 0
if skill.extension.include?("CONSUMEHP")
return false if calc_mp_cost(skill) > hp
else
return false if calc_mp_cost(skill) > mp
end
if $game_temp.in_battle
return skill.battle_ok?
else
return skill.menu_ok?
end
end
#--------------------------------------------------------------------------
# ● スキルの消費 MP 計算 ※再定義
#--------------------------------------------------------------------------
def calc_mp_cost(skill)
if half_mp_cost && !skill.extension.include?("NOHALFMPCOST")
cost = skill.mp_cost / 2
else
cost = skill.mp_cost
end
if skill.extension.include?("%COSTMAX")
return self.maxhp * cost / 100 if skill.extension.include?("CONSUMEHP")
return self.maxmp * cost / 100
elsif skill.extension.include?("%COSTNOW")
return self.hp * cost / 100 if skill.extension.include?("CONSUMEHP")
return self.mp * cost / 100
end
return cost
end
#--------------------------------------------------------------------------
# ● スキルコスト消費
#--------------------------------------------------------------------------
def consum_skill_cost(skill)
return false unless skill_can_use?(skill)
cost = calc_mp_cost(skill)
return self.hp -= cost if skill.extension.include?("CONSUMEHP")
return self.mp -= cost
end
#--------------------------------------------------------------------------
# ● 通常攻撃によるダメージ計算 二刀流補正
#--------------------------------------------------------------------------
alias make_attack_damage_value_n01 make_attack_damage_value
def make_attack_damage_value(attacker)
make_attack_damage_value_n01(attacker)
# 二本の武器を装備しているときのみ補正を有効に
return unless attacker.actor?
return if attacker.weapons[0] == nil
return if attacker.weapons[1] == nil
@hp_damage = @hp_damage * N01::TWO_SWORDS_STYLE[0] / 100
end
#--------------------------------------------------------------------------
# ● スキルまたはアイテムによるダメージ計算 二刀流補正
#--------------------------------------------------------------------------
alias make_obj_damage_value_n01 make_obj_damage_value
def make_obj_damage_value(user, obj)
make_obj_damage_value_n01(user, obj)
# 二本の武器を装備しているときのみ補正を有効に
return unless user.actor?
return if user.weapons[0] == nil
return if user.weapons[1] == nil
if obj.damage_to_mp
@mp_damage = @mp_damage * N01::TWO_SWORDS_STYLE[1] / 100 # MP にダメージ
else
@hp_damage = @hp_damage * N01::TWO_SWORDS_STYLE[1] / 100 # HP にダメージ
end
end
#--------------------------------------------------------------------------
# ● 通常攻撃の効果適用 すでに戦闘不能で絶対に回避できない処理
#--------------------------------------------------------------------------
def perfect_attack_effect(attacker)
clear_action_results
make_attack_damage_value(attacker) # ダメージ計算
execute_damage(attacker) # ダメージ反映
apply_state_changes(attacker) # ステート変化
end
#--------------------------------------------------------------------------
# ● スキルの効果適用 すでに戦闘不能で絶対に回避できない処理
#--------------------------------------------------------------------------
def perfect_skill_effect(user, skill)
clear_action_results
make_obj_damage_value(user, skill) # ダメージ計算
make_obj_absorb_effect(user, skill) # 吸収効果計算
execute_damage(user) # ダメージ反映
apply_state_changes(skill) # ステート変化
end
#--------------------------------------------------------------------------
# ● アイテムの効果適用 すでに戦闘不能で絶対に回避できない処理
#--------------------------------------------------------------------------
def perfect_item_effect(user, item)
clear_action_results
hp_recovery = calc_hp_recovery(user, item) # HP 回復量計算
mp_recovery = calc_mp_recovery(user, item) # MP 回復量計算
make_obj_damage_value(user, item) # ダメージ計算
@hp_damage -= hp_recovery # HP 回復量を差し引く
@mp_damage -= mp_recovery # MP 回復量を差し引く
make_obj_absorb_effect(user, item) # 吸収効果計算
execute_damage(user) # ダメージ反映
item_growth_effect(user, item) # 成長効果適用
if item.physical_attack and @hp_damage == 0 # 物理ノーダメージ判定
return
end
apply_state_changes(item) # ステート変化
end
#--------------------------------------------------------------------------
# ● ダメージの反映
#--------------------------------------------------------------------------
alias execute_damage_n01 execute_damage
def execute_damage(user)
execute_damage_n01(user)
# 吸収の場合ここで処理を相殺
if @absorbed
user.hp_damage = -@hp_damage
user.mp_damage = -@mp_damage
end
end
#--------------------------------------------------------------------------
# ● スキルの効果適用
#--------------------------------------------------------------------------
alias skill_effect_n01 skill_effect
def skill_effect(user, obj)
# 変化前のHPMPを保持
nowhp = self.hp
nowmp = self.mp
# 現在HPMP威力計算用に変化前の使用者HPMPを取得
if obj.extension.include?("CONSUMEHP")
user_hp = user.hp + user.calc_mp_cost(obj)
user_mp = user.mp
else
user_hp = user.hp
user_mp = user.mp + user.calc_mp_cost(obj)
end
# 拡張設定チェック
check_extension(obj)
# ダメージ計算
skill_effect_n01(user, obj)
# ダメージ系の拡張がある場合ここで処理を相殺
if @extension
self.hp = nowhp
self.mp = nowmp
end
# 攻撃が当たっていない場合は処理中断
return if self.evaded or self.missed
# ダメージ属性変換
damage = @hp_damage unless obj.damage_to_mp
damage = @mp_damage if obj.damage_to_mp
# 割合ダメージ
if @ratio_maxdamage != nil
damage = self.maxhp * @ratio_maxdamage / 100 unless obj.damage_to_mp
damage = self.maxmp * @ratio_maxdamage / 100 if obj.damage_to_mp
damage = damage * elements_max_rate(obj.element_set) / 100 # 3.3c, elemental adjustment
end
if @ratio_nowdamage != nil
damage = self.hp * @ratio_nowdamage / 100 unless obj.damage_to_mp
damage = self.mp * @ratio_nowdamage / 100 if obj.damage_to_mp
damage = damage * elements_max_rate(obj.element_set) / 100 # 3.3c, elemental adjustment
end
# コスト威力
if @cost_damage
cost = user.calc_mp_cost(obj)
if obj.extension.include?("CONSUMEHP")
damage = damage * cost / user.maxhp
else
damage = damage * cost / user.maxmp
end
end
# 現在HP威力
damage = damage * user_hp / user.maxhp if @nowhp_damage
# 現在MP威力
damage = damage * user_mp / user.maxmp if @nowmp_damage
# ダメージ属性変換戻し
@hp_damage = damage unless obj.damage_to_mp
@mp_damage = damage if obj.damage_to_mp
# 拡張反映
if @extension
self.hp -= @hp_damage
self.mp -= @mp_damage
end
# 初期化
@extension = false
@cost_damage = false
@nowhp_damage = false
@nowmp_damage = false
@ratio_maxdamage = nil
@ratio_nowdamage = nil
end
#--------------------------------------------------------------------------
# ● 拡張設定チェック
#--------------------------------------------------------------------------
def check_extension(skill)
for ext in skill.extension
# コスト威力
if ext == "COSTPOWER"
@extension = true
next @cost_damage = true
# 現在HP威力
elsif ext == "HPNOWPOWER"
@extension = true
next @nowhp_damage = true
# 現在MP威力
elsif ext == "MPNOWPOWER"
@extension = true
next @nowmp_damage = true
else
# 割合ダメージ
name = ext.split('')
if name[7] == "M"
name = name.join
name.slice!("%DAMAGEMAX/")
@extension = true
next @ratio_maxdamage = name.to_i
elsif name[7] == "N"
name = name.join
name.slice!("%DAMAGENOW/")
@extension = true
next @ratio_nowdamage = name.to_i
end
end
end
end
#--------------------------------------------------------------------------
# ● 初期配置の変更
#--------------------------------------------------------------------------
def change_base_position(x, y)
@base_position_x = x
@base_position_y = y
end
#--------------------------------------------------------------------------
# ● 初期化
#--------------------------------------------------------------------------
def reset_coordinate
@move_x = @move_y = @move_z = @jump = @derivation = 0
@active = @individual = false # removed reference to non_dead, 3.3c
end
#--------------------------------------------------------------------------
# ● スリップダメージの効果適用
#--------------------------------------------------------------------------
def slip_damage_effect
if slip_damage? and @hp > 0
@hp_damage = apply_variance(maxhp / 10, 10)
@hp_damage = @hp - 1 if @hp_damage >= @hp
self.hp -= @hp_damage
end
end
#--------------------------------------------------------------------------
# ● イベントでのダメージPOP
#--------------------------------------------------------------------------
def damage_num(num = nil)
return if dead? or !$game_temp.in_battle or num == 0
@force_damage = num
end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# アクターを扱うクラスです。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :two_swords_change # 二刀流強制持ち替えフラグ
#--------------------------------------------------------------------------
# ● IDによるスキルの習得済み判定
#--------------------------------------------------------------------------
def skill_id_learn?(skill_id)
return @skills.include?(skill_id)
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定 ※再定義
#--------------------------------------------------------------------------
def skill_can_use?(skill)
return super
end
#--------------------------------------------------------------------------
# ● グラフィックの変更
#--------------------------------------------------------------------------
def graphic_change(character_name)
@character_name = character_name
end
#--------------------------------------------------------------------------
# ● コラプスの実行 ※再定義
#--------------------------------------------------------------------------
def perform_collapse
Sound.play_actor_collapse if $game_temp.in_battle and dead?
end
#--------------------------------------------------------------------------
# ● 初期配置の取得
#--------------------------------------------------------------------------
def base_position
base = N01::ACTOR_POSITION[self.index]
@base_position_x = base[0]
@base_position_y = base[1]
# バックアタック時はX軸を逆に
@base_position_x = Graphics.width - base[0] if $back_attack && N01::BACK_ATTACK
end
#--------------------------------------------------------------------------
# ● バトル画面 X 座標の取得
#--------------------------------------------------------------------------
def position_x
return 0 if self.index == nil
return @base_position_x + @move_x
end
#--------------------------------------------------------------------------
# ● バトル画面 Y 座標の取得
#--------------------------------------------------------------------------
def position_y
return 0 if self.index == nil
return @base_position_y + @move_y + @jump
end
#--------------------------------------------------------------------------
# ● バトル画面 Z 座標の取得
#--------------------------------------------------------------------------
def position_z
return 0 if self.index == nil
return self.index + @base_position_y + @move_y + @move_z - @jump + 200
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
# エネミーを扱うクラスです。
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :adj_speed # 複数回行動の速度補正
attr_accessor :act_time # 行動数回
#--------------------------------------------------------------------------
# ● アクションスピードの決定 複数回行動用
#--------------------------------------------------------------------------
def make_action_speed2(adj)
@adj_speed = self.action.speed if @adj_speed == nil
@adj_speed = @adj_speed * adj / 100
end
#--------------------------------------------------------------------------
# ● コラプスの実行 ※再定義
#--------------------------------------------------------------------------
def perform_collapse
@force_action = ["N01collapse"] if $game_temp.in_battle and dead?
end
#--------------------------------------------------------------------------
# ● 初期配置の取得
#--------------------------------------------------------------------------
def base_position
return if self.index == nil
# バトラー画像のサイズをチェックしY座標を修正
bitmap = Bitmap.new("Graphics/Battlers/" + @battler_name) if !self.anime_on
bitmap = Bitmap.new("Graphics/Characters/" + @battler_name) if self.anime_on && N01::WALK_ANIME
bitmap = Bitmap.new("Graphics/Characters/" + @battler_name + "_1") if self.anime_on && !N01::WALK_ANIME
height = bitmap.height
@base_position_x = self.screen_x + self.position_plus[0]
@base_position_y = self.screen_y + self.position_plus[1] - height / 3
bitmap.dispose
# バックアタック時はX軸を逆に
if $back_attack && N01::BACK_ATTACK
@base_position_x = Graphics.width - self.screen_x - self.position_plus[0]
end
end
#--------------------------------------------------------------------------
# ● バトル画面 X 座標の取得
#--------------------------------------------------------------------------
def position_x
return @base_position_x - @move_x
end
#--------------------------------------------------------------------------
# ● バトル画面 Y 座標の取得
#--------------------------------------------------------------------------
def position_y
return @base_position_y + @move_y + @jump
end
#--------------------------------------------------------------------------
# ● バトル画面 Z 座標の取得
#--------------------------------------------------------------------------
def position_z
return position_y + @move_z - @jump + 200
end
end
#==============================================================================
# ■ Sprite_Damage
#------------------------------------------------------------------------------
# ダメージ表示のスプライトです。
#==============================================================================
class Sprite_Damage < Sprite_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(viewport,battler = nil)
super(viewport)
@battler = battler
@damage = 0
@duration = 0
@x = 0
@y = 0
@z_plus = 0
@minus = false
@num1 = Sprite.new(viewport)
@num2 = Sprite.new(viewport)
@num3 = Sprite.new(viewport)
@num4 = Sprite.new(viewport)
@num5 = Sprite.new(viewport)
@num1.visible = false
@num2.visible = false
@num3.visible = false
@num4.visible = false
@num5.visible = false
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
force_damage
move_damage(@num5, @pop_time) if @num5.visible
move_damage(@num4, @pop_time - 2) if @num4.visible
move_damage(@num3, @pop_time - 4) if @num3.visible
move_damage(@num2, @pop_time - 6) if @num2.visible
move_damage(@num1, @pop_time - 8) if @num1.visible
move_window if @window != nil
@duration -= 1 if @duration > 0
end
#--------------------------------------------------------------------------
# ● イベントでのダメージPOP
#--------------------------------------------------------------------------
def force_damage
if @battler.force_damage != 0
damage_pop(@battler.force_damage)
@battler.hp -= @battler.force_damage
@force_damage = true
@battler.force_damage = 0
$game_temp.status_window_refresh = true
end
end
#--------------------------------------------------------------------------
# ● 数値の動き
#--------------------------------------------------------------------------
def move_damage(num, min)
case @duration
when min-1..min
num.x -= 1
num.y -= 4
when min-3..min-2
num.x -= 1
num.y -= 3
when min-6..min-4
num.y -= 2
when min-14..min-7
num.y += 2
when min-17..min-15
num.y -= 2
when min-23..min-18
num.y += 1
when min-27..min-24
num.y -= 1
when min-30..min-28
num.y += 1
when min-33..min-31
num.y -= 1
when min-36..min-34
num.y += 1
end
next_damage if @battler.double_damage && @duration == min-34
num.opacity = 256 - (12 - @duration) * 32
num.visible = false if @duration == 0
if @force_damage && @duration == 0
@force_damage = false
@battler.perform_collapse
end
end
#--------------------------------------------------------------------------
# ● 文字ウインドウの動き
#--------------------------------------------------------------------------
def move_window
@window.x -= 6 if @window_time > 0 && @window.x > 0
@window_time -= 1
if @duration == 0
@window.dispose
@window = nil
end
end
#--------------------------------------------------------------------------
# ● HPMP両方同時ダメージ
#--------------------------------------------------------------------------
def next_damage
@battler.hp_damage = 0
@battler.double_damage = false
damage_pop
end
#--------------------------------------------------------------------------
# ● ダメージPOP準備
#--------------------------------------------------------------------------
def damage_pop(num = nil)
reset
damage = battler.hp_damage
# ステートの変化を抜き出す
states = battler.added_states
text = ""
# MPダメージ用テキスト(HPMP両方同時ダメージは除く)
if [email protected]_damage && @battler.mp_damage != 0
text = N01::POP_MP_DAM if battler.mp_damage > 0
text = N01::POP_MP_REC if battler.mp_damage < 0
damage = battler.mp_damage
end
# スリップダメージはMPダメージ以外文字を表示させない
if num == nil
text = N01::POP_DAMAGE0 if damage == 0 && states == [] && !battler.revival
text = N01::POP_MISS if battler.missed && states == []
text = N01::POP_EVA if battler.evaded
text = N01::POP_CRI if battler.critical
for state in states
# POPなし設定のステートは表示させない
unless state.extension.include?("NOPOP")
text += " " if text != ""
text += state.name
end
end
else
damage = num
end
# ダメージと回復を分ける
@minus = false
@minus = true if damage < 0
damage = damage.abs
# POP位置微調整
adjust = -16
adjust = 16 if $back_attack
adjust = 0 if damage == 0
@x = battler.position_x + adjust
@y = battler.position_y
window(text) if text != ""
@pop_time = N01::NUM_DURATION
# ダメージがなければ数字のPOPをさせない
return @duration = @pop_time if damage == 0
@num_time = -1
damage_file(@num1, damage % 10, @pop_time - 7) if damage >= 0
damage_file(@num2, (damage % 100)/10, @pop_time - 5) if damage >= 10
damage_file(@num3, (damage % 1000)/100, @pop_time - 3) if damage >= 100
damage_file(@num4, (damage % 10000)/1000, @pop_time - 1) if damage >= 1000
damage_file(@num5, (damage % 100000)/10000, @pop_time + 1) if damage >= 10000
end
#--------------------------------------------------------------------------
# ● 情報ウインドウ準備
#--------------------------------------------------------------------------
def window(text)
@window = Window_Damage.new(@x - 64, @y - 22)
@window.pop_text(text)
@window_time = 5
end
#--------------------------------------------------------------------------
# ● 数字画像準備
#--------------------------------------------------------------------------
def damage_file(num, cw, dur)
num.visible = true
# ファイル判別
file = N01::DAMAGE_GRAPHICS
file = N01::RECOVER_GRAPHICS if @minus
file = N01::MP_DAMAGE_GRAPHICS if battler.mp_damage > 0 && [email protected]_damage && N01::USE_MP_POP_GRAPHICS # v3.3b
file = N01::MP_RECOVER_GRAPHICS if battler.mp_damage < 0 && [email protected]_damage && N01::USE_MP_POP_GRAPHICS# v3.3b
# 数字
num.bitmap = Cache.system(file)
@num_time += 1
sx = num.bitmap.width / 10
num.src_rect.set(cw * sx, 0, sx, num.height)
num.x = @x - (num.width + N01::NUM_INTERBAL) * @num_time
num.y = @y
num.z = 2000 - @num_time
@duration = dur
@window.x = num.x - @window.width + 64 if @window != nil && N01::NON_DAMAGE_WINDOW
@window.x = num.x - @window.width + 26 if @window != nil && !N01::NON_DAMAGE_WINDOW
@window.x = 0 if @window != nil && @window.x < 0
end
#--------------------------------------------------------------------------
# ● ダメージリセット
#--------------------------------------------------------------------------
def reset
@num5.visible = @num4.visible = @num3.visible = @num2.visible = @num1.visible = false
@window.dispose if @window != nil
@window = nil
end
#--------------------------------------------------------------------------
# ● 開放
#--------------------------------------------------------------------------
def dispose
super
@num1.dispose
@num2.dispose
@num3.dispose
@num4.dispose
@num5.dispose
@window.dispose if @window != nil
end
end
#==============================================================================
# ■ Window_Damage
#------------------------------------------------------------------------------
# クリティカル等を表示するウインドウです。
#==============================================================================
class Window_Damage < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 46)
self.opacity = 0 if N01::NON_DAMAGE_WINDOW
end
#--------------------------------------------------------------------------
# ● ウィンドウ内容の作成
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32, height - 32)
end
#--------------------------------------------------------------------------
# ● テキスト設定
#--------------------------------------------------------------------------
def pop_text(text, align = 1)
self.contents.clear
self.width = self.contents.text_size(text).width + 36
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.color = normal_color
self.contents.font.size = 16
self.contents.draw_text(0,-8, width - 32, 32, text, align)
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# ゲーム中のすべてのウィンドウのスーパークラスです。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● ステートの描画 ※再定義(ステートアイコンを表示しない設定を反映)
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 96)
count = 0
for state in actor.states
break if state.extension.include?("HIDEICON")
draw_icon(state.icon_index, x + 24 * count, y)
count += 1
break if (24 * count > width - 24)
end
end
end
#==============================================================================
# ■ Game_Temp
#------------------------------------------------------------------------------
# セーブデータに含まれない、一時的なデータを扱うクラスです。
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :status_window_refresh # ステータスウインドウのリフレッシュフラグ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_n01 initialize
def initialize
initialize_n01
@status_window_refresh = false
end
end
#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
# イベントコマンドを実行するインタプリタです。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ● HP の増減
#--------------------------------------------------------------------------
def command_311
if $game_temp.in_battle
value = operate_value(@params[1], @params[2], @params[3])
iterate_actor_id(@params[0]) do |actor|
next if actor.dead?
if @params[4] == false and actor.hp + value <= 0
actor.damage_num(actor.hp - 1) # 戦闘不能が許可されていなければ 1 にする
else
actor.damage_num(-value)
end
end
return true
else
value = operate_value(@params[1], @params[2], @params[3])
iterate_actor_id(@params[0]) do |actor|
next if actor.dead?
if @params[4] == false and actor.hp + value <= 0
actor.hp = 1 # 戦闘不能が許可されていなければ 1 にする
else
actor.hp += value
end
actor.perform_collapse
end
if $game_party.all_dead?
$game_temp.next_scene = "gameover"
end
return true
end
end
#--------------------------------------------------------------------------
# ● 敵キャラの HP 増減
#--------------------------------------------------------------------------
def command_331
value = operate_value(@params[1], @params[2], @params[3])
iterate_enemy_index(@params[0]) do |enemy|
if enemy.hp > 0
if @params[4] == false and enemy.hp + value <= 0
enemy.damage_num(enemy.hp - 1) # 戦闘不能が許可されていなければ 1 にする
else
enemy.damage_num(-value)
end
end
end
return true
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# パーティを扱うクラスです。
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● アクターを加える
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias add_actor_n01 add_actor
def add_actor(actor_id)
add_actor_n01(actor_id)
$party_change = true if actor_id == 4
end
#--------------------------------------------------------------------------
# ● アクターを外す
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias remove_actor_n01 remove_actor
def remove_actor(actor_id)
remove_actor_n01(actor_id)
$party_change = true if actor_id == 4
end
end