Lieber Besucher, herzlich willkommen bei: RPG Studio - Make your World real. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Montag, 1. Juli 2013, 19:20

Probleme mit Techniken (Zauber oder Nahkampf)

Hi, gleich mal vorab: Mein Problem bezieht sich auf das Sideview battlesystem (siehe unten).

Und zwar finde ich einfach nicht heraus, das wenn ich eine Technik erstelle, wie ich entscheiden kann ob es eine Nahkampftechnik werden soll,

oder das der Charakter am Platz stehen bleibt und zaubert!

Bitte um Hilfe^^ ;)

SBS Configurations

Spoiler
#==============================================================================
# ■ Sideview Battle System Configurations (English Translation v2.1)
#------------------------------------------------------------------------------
# Original Script by:
# Enu (RPG探検隊)
# Original translation versions by:
# Kylock
# Translation continued by:
# Mr. Bubble
# Special thanks:
# Shu (for translation help)
# Moonlight (for her passionate bug support for this script)
# NightWalker (for his community support for this script)
#==============================================================================

#==============================================================================
# ■ module N01
#------------------------------------------------------------------------------
# Sideview Battle System Config
#==============================================================================
module N01
#--------------------------------------------------------------------------
# ● Settings
#--------------------------------------------------------------------------
# Battle member starting positions
# X Y X Y X Y X Y
ACTOR_POSITION = [[415,120],[435,150],[455,180],[475,210]]
# 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 time after a battler completes an action in frames.
ACTION_WAIT = 12
# Delay time before enemy collapse (defeat of enemy) animation in frames.
COLLAPSE_WAIT = 12
# Delay before victory is processed in frames.
WIN_WAIT = 70

# BattleFloor display options: FLOOR = [ X-pos, Y-pos, Opacity]
FLOOR = [0,96,128]
# Animation ID for any unarmed attack.
NO_WEAPON = 82
# Damage modifications when using two weapons. Values are percentages.
# 1st Wpn, 2nd Wpn
TWO_SWORDS_STYLE = [100,50]
# Auto-Life State, Revivial Animation ID
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-"
# Distance between Damage POP display numbers.
NUM_INTERBAL = -3
# Duration (in frames) numbers are displayed.
NUM_DURATION = 68
# true: Disable Window graphic behind state names.
NON_DAMAGE_WINDOW = false
# POP Window indicator words. For no word results, use "".
POP_DAMAGE0 = "" # Attack results 0 damage
POP_MISS = "DANEBEN" # Attack missed 
POP_EVA = "AUSGEWICHEN" # Attack avoided
POP_CRI = "KRITISCH" # Attack scored a critical hit
POP_MP_DAM = "MP VERLOREN" # Attack caused MP loss
POP_MP_REC = "MP BEKOMMEN" # Attack restored MP

# Set to false to remove shadow under actors
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 file is not used.
# "_1" and subsequent files ("_2", "_3", etc.) should be uniform in size.
WALK_ANIME = true
# Number of frames in a battler animation file. (horizontal frames)
ANIME_PATTERN = 3
# Number of types of battler animation file. (vertical frames)
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
# Equipment must be equipped for 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 = []
# BODY ARMOR IDs
NON_BACK_ATTACK_ARMOR3 = []
# ACCESSORY IDs
NON_BACK_ATTACK_ARMOR4 = []
# SKILL IDs
NON_BACK_ATTACK_SKILLS = []
# SWITCH Number (takes precedence) If switch is ON, Back attack ensured.
BACK_ATTACK_SWITCH = []

#==============================================================================
# ■ Single Action Engine
#------------------------------------------------------------------------------
# These are utilized by sequenced actions and have no utility alone.
#==============================================================================
# A single-action cannot be used by itself unless it is used as part of a
# sequence.
ANIME = {
#--------------------------------------------------------------------------
# ● Battler 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.
#
# Row - Vertical position (row) of cells 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: "One-Way" Loop] Example: 1 2 3 1 2 3 1 2 ...
# [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 cell display.
# -2: Reverse Loop Animation
# -1: Normal Loop Animation
# 0: No Loop Animation
# 1~3: Refers to cell on character sprite sheet starting
# where 1 = left-most cell.
# 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 animation. For no weapon
# animation, use "".

# Action Name No. Row Speed Loop Wait Fixed Z Shadow Weapon
"WAIT" => [ 0, 1, 15, 0, 0, -1, 0, true,"" ],
"WAIT(FIXED)" => [ 0, 1, 10, 2, 0, 1, 0, true,"" ],
"RIGHT(FIXED)" => [ 0, 2, 10, 1, 2, 1, 0, true,"" ],
"DAMAGE" => [ 0, 3, 4, 2, 0, -1, 0, true,"" ],
"ATTACK_FAIL" => [ 0, 3, 10, 1, 8, 0, 0, true,"" ],
"MOVE_TO" => [ 0, 1, 1, 1, 0, -1, 0, true,"" ],
"MOVE_AWAY" => [ 0, 2, 2, 1, 0, -1, 0, true,"" ],
"ABOVE_DISPLAY" => [ 0, 1, 2, 1, 0, -1, 600, true,"" ],
"WPN_SWING_V" => [ 0, 1, 1, 2, 0, -1, 2, true,"VERT_SWING"],
"WPN_SWING_VL" => [ 0, 1, 1, 2, 0, -1, 2, true,"VERT_SWINGL"],
"WPN_SWING_VS" => [ 0, 1, 6, 2, 0, -1, 2, true,"VERT_SWING"],
"WPN_SWING_UNDER" => [ 0, 1, 2, 2, 0, -1, 2, true,"UNDER_SWING"],
"WPN_SWING_OVER" => [ 0, 1, 2, 2, 0, -1, 2, true,"OVER_SWING"],
"WPN_RAISED" => [ 0, 1, 2, 2, 28, -1, 2, true,"RAISED"],

#--------------------------------------------------------------------------
# ● Weapon Animations
#--------------------------------------------------------------------------
# Weapon Animations can only be used with Battler Animations as seen
# and defined above.
#
# 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.

# Action Name Xa Ya Za A1 A2 Or Inv Xs Ys Xp Yp Weapon2
"VERT_SWING" => [ 6, 8,false,-135, 45, 4,false, 1, 1, -4, -6,false],
"VERT_SWINGL" => [ 6, 8,false,-135, 45, 4,false, 1, 1, -4, -6, true],
"UNDER_SWING" => [ 6, 8,false, 270, 45, 4,false, 1, 1, -4, -6,false],
"OVER_SWING" => [ 6, 8,false, 45,-100, 4,false, 1, 1, -4, -6,false],
"RAISED" => [ 6, -4,false, 90, -45, 4,false, 1, 1, -4, -6,false],

#--------------------------------------------------------------------------
# ● Battler Movements
#--------------------------------------------------------------------------
# Origin - Defines the origin of movement based on an (x,y) coordinate plane.
# 1 unit = 1 pixel
# [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.
# Y - Y-axis pixels from origin. Please note that the Y-axis is
# inverted. This means negative values move up, positive values move down.
# Time - Travel time. Larger numbers are slower. The distance is
# divided by one frame of movement.
# 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 Animation utilized during moving.

# Origin X Y Time Accel Jump Animation
"NO_MOVE" => [ 0, 0, 0, 1, 0, 0, "WAIT(FIXED)"],
"START_POSITION" => [ 0, 54, 0, 1, 0, 0, "MOVE_TO"],
"BEFORE_MOVE" => [ 3, -32, 0, 18, -1, 0, "MOVE_TO"],
"AFTER_MOVE" => [ 0, 32, 0, 8, -1, 0, "MOVE_TO"],
"4_MAN_ATTACK_1" => [ 2, 444, 96, 18, -1, 0, "MOVE_TO"],
"4_MAN_ATTACK_2" => [ 2, 444, 212, 18, -1, 0, "MOVE_TO"],
"4_MAN_ATTACK_3" => [ 2, 384, 64, 18, -1, 0, "MOVE_TO"],
"4_MAN_ATTACK_4" => [ 2, 384, 244, 18, -1, 0, "MOVE_TO"],
"DEAL_DAMAGE" => [ 0, 32, 0, 4, -1, 0, "DAMAGE"],
"EXTRUDE" => [ 0, 12, 0, 1, 1, 0, "DAMAGE"],
"FLEE_SUCCESS" => [ 0, 300, 0,300, 1, 0, "MOVE_AWAY"],
"FLEE_FAIL" => [ 0, 48, 0, 16, 1, 0, "MOVE_AWAY"],
"VICTORY_JUMP" => [ 0, 0, 0, 20, 0, -5, "MOVE_TO"],
"MOVING_TARGET" => [ 1, 0, 0, 18, -1, 0, "MOVE_TO"],
"MOVING_TARGET_FAST" => [ 1, 0, -12, 8, 0, -2, "MOVE_TO"],
"PREV_MOVING_TARGET" => [ 1, 24, 0, 12, -1, 0, "MOVE_TO"],
"PREV_MOVING_TARGET_FAST" => [ 1, 24, 0, 1, 0, 0, "MOVE_TO"],
"MOVING_TARGET_RIGHT" => [ 1, 96, 32, 16, -1, 0, "MOVE_TO"],
"MOVING_TARGET_LEFT" => [ 1, 96, -32, 16, -1, 0, "MOVE_TO"],
"JUMP_TO" => [ 0, -32, 0, 8, -1, -4, "MOVE_TO"],
"JUMP_AWAY" => [ 0, 32, 0, 8, -1, -4, "MOVE_AWAY"],
"JUMP_TO_TARGET" => [ 1, 12, -12, 12, -1, -6, "MOVE_TO"],
"THROW_ALLY" => [ 0, -24, 0, 16, 0, -2, "MOVE_TO"],
"TRAMPLE" => [ 1, 12, -32, 12, -1, -6, "ABOVE_DISPLAY"],
"PREV_JUMP_ATTACK" => [ 0, -32, 0, 12, -1, -2, "WPN_SWING_V"],
"PREV_STEP_ATTACK" => [ 1, 12, 0, 12, -1, -5, "WPN_SWING_VS"],
"REAR_SWEEP_ATTACK" => [ 1, 12, 0, 16, 0, -3, "WPN_SWING_V"],
"JUMP_FIELD_ATTACK" => [ 1, 0, 0, 16, 0, -5, "WPN_SWING_V"],
"DASH_ATTACK" => [ 1, -96, 0, 16, 2, 0, "WPN_SWING_V"],
"RIGHT_DASH_ATTACK" => [ 1, -96, 32, 16, 2, 0, "WPN_SWING_V"],
"LEFT_DASH_ATTACK" => [ 1, -96, -32, 16, 2, 0, "WPN_SWING_V"],
"RIGHT_DASH_ATTACK2" => [ 1,-128, 48, 16, 2, 0, "WPN_SWING_V"],
"LEFT_DASH_ATTACK2" => [ 1,-128, -48, 16, 2, 0, "WPN_SWING_V"],

#--------------------------------------------------------------------------
# ● Battler Float Animations
#--------------------------------------------------------------------------
# These types of single-actions defines the movement of battlers from their
# own shadows.
#
# 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.
# Time - Duration of movement from point A to point B
# Animation - Specifies the Battler Animation to be used.

#  Type A B Time Animation
"FLOAT_" => ["float", -22, -20, 2, "WAIT(FIXED)"],
"FLOAT_2" => ["float", -20, -18, 2, "WAIT(FIXED)"],
"FLOAT_3" => ["float", -18, -20, 2, "WAIT(FIXED)"],
"FLOAT_4" => ["float", -20, -22, 2, "WAIT(FIXED)"],
"JUMP_STOP" => ["float", 0, -80, 4, "WAIT(FIXED)"],
"JUMP_LAND" => ["float", -80, 0, 4, "WAIT(FIXED)"],
"LIFT" => ["float", 0, -30, 4, "WAIT(FIXED)"],

#--------------------------------------------------------------------------
# ● Battler Position Reset
#--------------------------------------------------------------------------
# These types of single-actions define when a battler's turn is over and
# will reset the battler back to its starting coordinates. This type of
# single-action is required in all sequences.
#
# Please note that after a sequence has used this type of single-action,
# no more damage can be done by the battler since its turn is over.
#
# Type - Always "reset"
# Time - Time it takes to return to starting coordinates. Movement speed
# fluctuates depending on distance from start coordinates.
# Accel - Positive values accelerate. Negative values decelerate.
# Jump - Negative values produce a jumping arc. Positive values produce
# a reverse arc. [0: No jump]
# Animation - Specifies the Battler Animation to be used.

# Type Time Accel Jump Animation
"COORD_RESET" => ["reset", 16, 0, 0, "MOVE_TO"],
"FLEE_RESET" => ["reset", 16, 0, 0, "MOVE_AWAY"],

#--------------------------------------------------------------------------
# ● Forced Battler Actions
#--------------------------------------------------------------------------
# These types of single-actions allow forced control of other battlers
# that you define.
#
# Type - Specifies action type. "SINGLE" or "SEQUENCE"
#
# Object - The battler that will execute the action defined under Action
# Name. 0 is for selected target, and any other number is a State
# number (1~999), and affects all battlers with the State on them.
# By adding a - (minus sign) followed by a Skill ID number (1~999),
# it will target the actors that know the specified skill, besides
# the original actor.
# 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 canceled. (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.
# Action Name - Specifies action used. If Type is SINGLE, then Action Name
# must be a single-action function. If Type is SEQUENCE,
# the Action Name must an action sequence name.

# Type Object Reset Type Action Name
"LIGHT_BLOWBACK" => ["SINGLE", 0, "COORD_RESET", "EXTRUDE"],
"RIGHT_TURN" => ["SINGLE", 0, "COORD_RESET", "CLOCKWISE_TURN"],
"DROP_DOWN" => ["SINGLE", 0, "COORD_RESET", "Y_SHRINK"],
"IMPACT_1" => ["SINGLE", 0, "COORD_RESET", "OBJ_TO_SELF"],
"LIFT_ALLY" => ["SINGLE", 0, "", "LIFT"],
"ULRIKA_ATTACK" => ["SEQUENCE", 18, "COORD_RESET", "ULRIKA_ATTACK_1"],
"4_MAN_ATK_1" => ["SEQUENCE", -101, "COORD_RESET", "4_MAN_ATTACK_1"],
"4_MAN_ATK_2" => ["SEQUENCE", -102, "COORD_RESET", "4_MAN_ATTACK_2"],
"4_MAN_ATK_3" => ["SEQUENCE", -103, "COORD_RESET", "4_MAN_ATTACK_3"],
"ALLY_FLING" => ["SEQUENCE", 1000, "COORD_RESET", "THROW"],

#--------------------------------------------------------------------------
# ● 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 canceled. (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)]

# Target Mod name Type Object Target
"REAL_TARGET" => ["target", 0, 0],
"TWO_UNIFIED_TARGETS" => ["target", 18, 1],
"FOUR_UNIFIED_TARGETS" => ["target", 19, 1],
"ALLY_TO_THROW" => ["target", 1000, 2],
"THROW_TARGET" => ["target", 1000, 3],

#--------------------------------------------------------------------------
# ● Skill Linking
#--------------------------------------------------------------------------
# Linking to the next skill will stop any current action. Linking to the
# next skill will also require and consume MP/HP cost of that skill.
#
# Type - Always "der"
# Chance - Chance, in percent, to link to the defined skill ID. (0~100)
# Link - 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.

# Action Name Type Chance Link Skill ID
"LINK_SKILL_91" => ["der", 100, true, 91],
"LINK_SKILL_92" => ["der", 100, true, 92],

#--------------------------------------------------------------------------
# ● Action Conditions
#--------------------------------------------------------------------------
# If the condition is not met, all current actions are canceled.
#
# A: Type - always "nece"
# B: Object - Object 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 - This value is determined by the value you set for Content.
# [0] State: State ID
# [1] Parameter: [0=HP] [1=MP] [2=Atk Pwr] [3=Def Pwr] [4=Spirit] [5=Agility]
# [2] Switch: Game Switch Number
# [3] Variable: Game Variable Number
# [4] Skill: Skill ID
#
# E: Supplement - Supplement for the Condition as defined above.
# [0] State: Amount 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.
# [2] Switch: [true: Switch ON succeeds] [false: Switch OFF succeeds]
# [3] Variable: Game variable value used to determine if condition is met. If
# supplement value is positive, Game Variable must have more
# than the defined amount to succeed. If supplement 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.

# Type Obj Cont Cond Supplement
# 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],
"CAT_STATE" => ["nece", 0, 0, 20, 1],

#--------------------------------------------------------------------------
# ● Battler Rotation
#--------------------------------------------------------------------------
# Rotates battler image. Weapon Animations are not automatically adjusted
# for Battler Rotation like with Invert settings.
#
# Type - always "angle"
# Time - Duration duration of rotation animation in frames.
# Start - Starting angle. 0-360 degrees. Negative values = counter clockwise.
# End - Ending Angle. 0-360 degress. Negative values = counter clockwise.
# Return - true: End of rotation is the same as end of duration.
# false: Rotation animation as defined.

# 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 Zoom
#--------------------------------------------------------------------------
# Stretch and shrink battler sprites with these single-actions.
#
# 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.
# Battler zoom is still temporary.

#   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 single-actions 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" single-actions 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 "OBJ_ANIM"
# is added at the beginning of the name, it will be both damage and defined
# animation.
#
# 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.

# Type ID Object Invert Wait Weapon2
"OBJ_ANIM" => ["anime", -1, 1, false, false, false],
"OBJ_ANIM_WEIGHT" => ["anime", -1, 1, false, true, false],
"OBJ_ANIM_WEAPON" => ["anime", -2, 1, false, false, false],
"OBJ_ANIM_L" => ["anime", -1, 1, false, false, true],
"HIT_ANIM" => ["anime", 1, 1, false, false, false],
"KILL_HIT_ANIM" => ["anime", 11, 1, false, false, false],

#--------------------------------------------------------------------------
# ● Movement and Display of Animations
#--------------------------------------------------------------------------
# These single-actions provide motion options for animations used for
# effects such as long-ranged attacks and projectiles. Weapon sprites
# may also substitute animations.
#
# A difference between "m_a" and "anime" single-actions is that "m_a"
# animations will stay where the Object was even if the Object moved.
#
# Type - always "m_a"
# ID - 1~999: Database Animation ID
# 0: No animation displayed.
# 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 - Duration of animation travel time and display. Larger values
# decrease travel speed. Increase this value if the animation
# being played is cut short.
# Arc - Trajectory - Positive values produce a low arc.
# Negative values produce a high arc.
# [0: No Arc]
# Xp - X Pitch - This value adjusts the initial X coordinate of the
# animation. Enemy calculation will be automatically inverted.
# Yp - Y Pitch - This value adjusts the initial X 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" actions. If ID is not 0, use "".

# Type ID Object Pass Time Arc Xp Yp Start Z Weapon
"START_MAGIC_ANIM" => ["m_a", 44, 4, 0, 52, 0, 0, 0, 2,false,""],
"OBJ_TO_SELF" => ["m_a", 4, 0, 0, 24, 0, 0, 0, 1,false,""],
"START_WEAPON_THROW" => ["m_a", 0, 0, 0, 18, -24, 0, 0, 0,false,"WPN_ROTATION"],
"END_WEAPON_THROW" => ["m_a", 0, 0, 0, 18, 24, 0, 0, 1,false,"WPN_ROTATION"],
"STAND_CAST" => ["m_a", 80, 1, 0, 64, 0, 0, 0, 2, true,""],

#--------------------------------------------------------------------------
# ● Throwing Weapon Rotation
#--------------------------------------------------------------------------
# These are used to rotate weapon sprites that are "thrown" with Movement of
# Animation single-actions. These must be used while the sprite is in flight.
# 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.

# Start Angle Time
"WPN_ROTATION" => [ 0, 360, 8],

#--------------------------------------------------------------------------
# ● Throwing Skill Rotation
#--------------------------------------------------------------------------
# Different from Throwing Weapon Rotation. These single-actions are used to
# rotate weapon sprites that are "thrown" with Movement of Animation single
# actions. These are specifically used with skills. These must be used while
# the sprite is in flight. 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".

# Weapon Action Name   Start End Time Type
"WPN_THROW" => [ 0, 360, 8, "skill"],

#--------------------------------------------------------------------------
# ● Status 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]

# Emote Name   Type Row Loop
"STATUS-NORMAL" => ["balloon", 6, 1],
"STATUS-CRITICAL" => ["balloon", 5, 1],
"STATUS-SLEEP" => ["balloon", 9, 1],

#--------------------------------------------------------------------------
# ● Sound Effect Actions
#--------------------------------------------------------------------------
# Type - always "sound"
# Type - ["se","bgm","bgs"]
# Pitch - Value between 50 and 150.
# Vol - Volume - Value between 0 and 100.
# Filename - Name of the sound to be played.

# Type Type Pitch Vol Filename
"absorb1" => ["sound", "se", 80, 100, "absorb1"],

#--------------------------------------------------------------------------
# ● Game Speed Modifier
#--------------------------------------------------------------------------
# Type - always "fps"
# Speed - Speed in Frames Per Second. 60 is normal frame rate.
# Use with care as this function modifies FPS directly and will conversly
# affect any active timers or time systems.

# Type Speed
"FPS_SLOW" => ["fps", 20],
"FPS_NORMAL" => ["fps", 60],

#--------------------------------------------------------------------------
# ● State Granting Effects
#--------------------------------------------------------------------------
# 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.

# Type Object State ID
"2_MAN_TECH_GRANT" => ["sta+", 0, 18],
"4_MAN_TECH_GRANT" => ["sta+", 0, 19],
"CATFORM_GRANT" => ["sta+", 0, 20],

#--------------------------------------------------------------------------
# ● State Removal Effects
#--------------------------------------------------------------------------
# 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.

# Type Object State ID
"2_MAN_TECH_REVOKE" => ["sta-", 3, 18],
"4_MAN_TECH_REVOKE" => ["sta-", 3, 19],

#--------------------------------------------------------------------------
# ● Battler Transformation Effects
#--------------------------------------------------------------------------
# Type - always "change"
# Reset - true: Battler sprite reverts back to default file after battle.
# false: Transformation is permanent after battle.
# Filename - Battler graphics file that will be transformed to.

# Type Reset Filename
"TRANSFORM_CAT" => ["change", true,"$cat"],
"TRANSFORM_CANCEL" => ["change", true,"$ylva"],

#--------------------------------------------------------------------------
# ● Cut-In Image Effects
#--------------------------------------------------------------------------
# Only one image can be displayed at a time.
#
# X1 - Image's starting X-coordinate.
# Y1 - Starting Y-coordinate.
# X2 - Ending X-coordinate.
# Y2 - Ending Y-coordinate.
# Time - Length of time from start to end. Higher value is slower.
# Z-axis - true: Image appears over BattleStatus Window.
# false: Image appears behind BattleStatus Window.
# Filename - Filename from .Graphics\Pictures folder.

# Type X1 Y1 X2 Y2 Time Z-axis Filename
"CUT_IN_START" => ["pic", -280, 48, 0, 64, 14, false, "Actor2-3"],
"CUT_IN_END" => ["pic", 0, 48, 550, 64, 12, false, "Actor2-3"],

#--------------------------------------------------------------------------
# ● Game Switch Settings
#--------------------------------------------------------------------------
# Type - Always "switch"
# Switch - Switch number from the game database.
# ON/OFF - [true:Switch ON] [false:Switch OFF]
#
# Type Switch ON/OFF
"GAME_SWITCH_1_ON" => ["switch", 1, true],

#--------------------------------------------------------------------------
# ● Game Variable Settings
#--------------------------------------------------------------------------
# Type - Always "variable"
# Var - Variable Number from the game database.
# Oper - [0=Set] [1=Add] [2=Sub] [3=Mul] [4=Div] [5=Mod]
# X - value of the operation.
#
#    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. In the sample,
# where it says p=1 can be replaced with any script. Character strings
# and anything beyond functions will not work. (?)
#      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 Single Action following Two Wpn Only will only execute
# if the actor is wielding two weapons. If the actor is not,
# the Single Action will be skipped and will move on to the next.
# One Wpn Only - The Single Action following One Wpn Only will only execute
# if the actor is wielding one weapon. If the actor is not,
# the Single Action 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 how 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.

"Clear image" => ["Clear image"],
"Afterimage ON" => ["Afterimage ON"],
"Afterimage OFF" => ["Afterimage OFF"],
"Invert" => ["Invert"],
"Don't Wait"=> ["Don't Wait"],
"Can Collapse" => ["Can Collapse"],
"Two Wpn Only" => ["Two Wpn Only"],
"One Wpn Only" => ["One Wpn Only"],
"Process Skill" => ["Process Skill"],
"Process Skill End" => ["Process Skill End"],
"Start Pos Change" => ["Start Pos Change"],
"Start Pos Return"=> ["Start Pos Return"],
"Cancel Action" => ["Cancel Action"],
"End" => ["End"]

#--------------------------------------------------------------------------
# ● About Wait
#--------------------------------------------------------------------------
# When there is only a numerical value as a single-action name, it will be
# considered a delay, in frames, before the Action Sequence continues.
# (i.e. "10", "42") Because of this, single-action function names for the
# effects defined above cannot be entirely numerical. Any Battler Animations
# that have been prompted will persist when Waiting.
}
#==============================================================================
# ■ Action Sequence
#------------------------------------------------------------------------------
# Action sequences are made of the single-action functions defined above.
#==============================================================================
# Action Sequences defined here can be used for Actor/Enemy actions below.
# Sequences are processed left to right in order.
ACTION = {
#------------------------------- Basic Actions --------------------------------

"BATTLE_START" => ["START_POSITION","COORD_RESET"],

"WAIT" => ["WAIT"],

"WAIT-CRITICAL" => ["NO_MOVE","WAIT(FIXED)","STATUS-CRITICAL","22"],

"WAIT-NORMAL" => ["NO_MOVE","WAIT(FIXED)","STATUS-NORMAL","22"],

"WAIT-SLEEP" => ["NO_MOVE","WAIT(FIXED)","STATUS-SLEEP","22"],

"WAIT-FLOAT" => ["WAIT(FIXED)","6","FLOAT_","4",
"FLOAT_2","4","FLOAT_3","4",
"FLOAT_4","4"],

"DEAD" => ["FALLEN","ATTACK_FAIL"],

"DAMAGE" => ["DEAL_DAMAGE","COORD_RESET"],

"FLEE" => ["FLEE_SUCCESS"],

"ENEMY_FLEE" => ["FLEE_SUCCESS","COORD_RESET"],

"FLEE_FAIL" => ["FLEE_FAIL","WAIT(FIXED)","8","COORD_RESET"],

"COMMAND_INPUT" => ["BEFORE_MOVE"],

"COMMAND_SELECT" => ["COORD_RESET"],

"GUARD_ATTACK" => ["WAIT(FIXED)","4","FLOAT_STATE","FLOAT_",
"2","FLOAT_2","2","FLOAT_3","2",
"FLOAT_4","2"],

"EVADE_ATTACK" => ["JUMP_AWAY","JUMP_AWAY","WAIT(FIXED)","16",
"COORD_RESET"],

"ENEMY_EVADE_ATTACK" => ["JUMP_AWAY","WAIT(FIXED)","16","COORD_RESET"],

"VICTORY" => ["WAIT(FIXED)","16","RIGHT(FIXED)","VICTORY_JUMP",
"WAIT(FIXED)","Don't Wait","CAT_STATE",
"START_MAGIC_ANIM","TRANSFORM_CANCEL","WAIT(FIXED)","Don't Wait"],

"RESET_POSITION" => ["COORD_RESET"],

#---------------------- "Forced Action" Sequences --------------------------

"ULRIKA_ATTACK_1" => ["2","MOVING_TARGET_LEFT","WAIT(FIXED)",
"START_MAGIC_ANIM","WPN_SWING_UNDER","WPN_RAISED",
"48","RIGHT_DASH_ATTACK","64","FLEE_RESET"],

"4_MAN_ATTACK_1" => ["2","4_MAN_ATTACK_2","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","90",
"LEFT_DASH_ATTACK","96","FLEE_RESET"],

"4_MAN_ATTACK_2" => ["2","4_MAN_ATTACK_3","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","60","RIGHT_DASH_ATTACK2","RIGHT_TURN",
"OBJ_ANIM","128","FLEE_RESET"],

"4_MAN_ATTACK_3" => ["2","4_MAN_ATTACK_4","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","34","LEFT_DASH_ATTACK2","RIGHT_TURN",
"OBJ_ANIM","144","FLEE_RESET"],

"THROW" => ["CLOCKWISE_TURN","4","MOVING_TARGET_FAST","JUMP_AWAY","4",
"WAIT(FIXED)","JUMP_AWAY","WAIT(FIXED)","32"],

#---------------------- Basic Action Oriented ------------------------------

"NORMAL_ATTACK" => ["PREV_MOVING_TARGET","WPN_SWING_V","OBJ_ANIM_WEIGHT",
"12","WPN_SWING_VL","OBJ_ANIM_L","Two Wpn Only","16",
"Can Collapse","FLEE_RESET"],

"ENEMY_UNARMED_ATK" => ["PREV_MOVING_TARGET","WPN_SWING_V","OBJ_ANIM_WEIGHT",
"Can Collapse","FLEE_RESET"],

"SKILL_USE" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","WPN_SWING_V",
"OBJ_ANIM_WEIGHT","Can Collapse","24","COORD_RESET"],

"SKILL_ALL"=> ["BEFORE_MOVE","START_MAGIC_ANIM","WPN_SWING_UNDER","WPN_RAISED",
"Process Skill","WPN_SWING_V","OBJ_ANIM","24",
"Process Skill End","Can Collapse","COORD_RESET"],

"ITEM_USE" => ["PREV_MOVING_TARGET","WAIT(FIXED)","24","OBJ_ANIM_WEIGHT",
"Can Collapse","COORD_RESET"],

#------------------------------ Skill Sequences -------------------------------

"MULTI_ATTACK" => ["Afterimage ON","PREV_STEP_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"WAIT(FIXED)","16","OBJ_ANIM_WEAPON","WPN_SWING_UNDER",
"WPN_SWING_OVER","4","JUMP_FIELD_ATTACK","WPN_SWING_VL",
"OBJ_ANIM_WEAPON","WAIT(FIXED)","16","OBJ_ANIM_WEAPON",
"Invert","WPN_SWING_V","WPN_SWING_VL","12","Invert",
"JUMP_FIELD_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"JUMP_AWAY","JUMP_AWAY","WAIT(FIXED)",
"OBJ_ANIM_WEAPON","DASH_ATTACK","WPN_SWING_VL","Can Collapse",
"Afterimage OFF","16","FLEE_RESET"],

"MULTI_ATTACK_RAND"=> ["PREV_STEP_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON","WAIT(FIXED)","16",
"PREV_STEP_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON","WAIT(FIXED)","16",
"PREV_STEP_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON","WAIT(FIXED)","16",
"PREV_STEP_ATTACK","WPN_SWING_VL","OBJ_ANIM_WEAPON","Can Collapse","COORD_RESET"],

"RAPID_MULTI_ATTACK" => ["PREV_MOVING_TARGET","WPN_SWING_V","LIGHT_BLOWBACK","OBJ_ANIM_WEAPON",
"PREV_MOVING_TARGET_FAST","WPN_SWING_V","LIGHT_BLOWBACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"PREV_MOVING_TARGET_FAST","WPN_SWING_V","LIGHT_BLOWBACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"PREV_MOVING_TARGET_FAST","WPN_SWING_V","LIGHT_BLOWBACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"PREV_MOVING_TARGET_FAST","WPN_SWING_V","LIGHT_BLOWBACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"PREV_MOVING_TARGET_FAST","WPN_SWING_V","LIGHT_BLOWBACK","WPN_SWING_VL","OBJ_ANIM_WEAPON",
"Can Collapse","12","COORD_RESET"],

"2-MAN_ATTACK" => ["2_MAN_ATK_COND","TWO_UNIFIED_TARGETS","ULRIKA_ATTACK",
"MOVING_TARGET_RIGHT","WAIT(FIXED)","START_MAGIC_ANIM","WPN_SWING_UNDER",
"WPN_RAISED","48","KILL_HIT_ANIM","LEFT_DASH_ATTACK","64","OBJ_ANIM",
"Can Collapse","FLEE_RESET","2_MAN_TECH_REVOKE"],

"2-MAN_ATTACK_ASSIST" => ["2_MAN_TECH_GRANT"],

"4-MAN_ATTACK" => ["4_MAN_ATK_COND","FOUR_UNIFIED_TARGETS","4_MAN_ATK_1",
"4_MAN_ATK_2","4_MAN_ATK_3","4_MAN_ATTACK_1","WAIT(FIXED)",
"START_MAGIC_ANIM","WPN_SWING_UNDER","WPN_RAISED","90",
"KILL_HIT_ANIM","RIGHT_DASH_ATTACK","64","OBJ_ANIM_WEIGHT",
"Can Collapse","FLEE_RESET","4_MAN_TECH_REVOKE"],

"4-MAN_ATTACK_ASSIST" => ["4_MAN_TECH_GRANT"],

"THROW_WEAPON" => ["BEFORE_MOVE","WPN_SWING_V","absorb1","WAIT(FIXED)",
"START_WEAPON_THROW","12","OBJ_ANIM_WEAPON","Can Collapse",
"END_WEAPON_THROW","COORD_RESET"],

"MULTI_SHOCK"=> ["JUMP_TO","JUMP_STOP","Process Skill",
"REAL_TARGET","WPN_SWING_V","IMPACT_1","8",
"OBJ_ANIM_WEAPON","Process Skill End","Can Collapse",
"JUMP_LAND","COORD_RESET"],

"SHOCK_WAVE" => ["REAL_TARGET","WPN_SWING_V","IMPACT_1","20",
"OBJ_ANIM_WEIGHT","Can Collapse"],

"SKILL_90_SEQUENCE" => ["PREV_MOVING_TARGET","OBJ_ANIM","WPN_SWING_V",
"16","LINK_SKILL_91","COORD_RESET"],

"SKILL_91_SEQUENCE" => ["FLEE_FAIL","START_MAGIC_ANIM","WPN_SWING_UNDER","WPN_RAISED",
"8","OBJ_ANIM","LINK_SKILL_92","COORD_RESET"],

"CUT_IN" => ["WAIT(FIXED)","START_MAGIC_ANIM","CUT_IN_START",
"75","CUT_IN_END","8","PREV_MOVING_TARGET",
"WPN_SWING_V","OBJ_ANIM_WEIGHT","Can Collapse",
"Clear image","FLEE_RESET"],

"STOMP" => ["JUMP_TO_TARGET","HIT_ANIM","DROP_DOWN","JUMP_AWAY",
"TRAMPLE","HIT_ANIM","DROP_DOWN","JUMP_AWAY",
"TRAMPLE","OBJ_ANIM","DROP_DOWN","JUMP_AWAY",
"JUMP_AWAY","Can Collapse","WAIT(FIXED)","8","FLEE_RESET"],

"ALL_ATTACK_1" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM","WPN_SWING_UNDER",
"WPN_RAISED","STAND_CAST","WPN_SWING_V","48",
"OBJ_ANIM_WEIGHT","Can Collapse","COORD_RESET"],

"TRANSFORM_CAT" => ["JUMP_TO","WAIT(FIXED)","START_MAGIC_ANIM","32",
"TRANSFORM_CAT","WAIT(FIXED)","CATFORM_GRANT","32","JUMP_AWAY"],

"THROW_FRIEND" => ["ALLY_TO_THROW","MOVING_TARGET","LIFT_ALLY","4",
"absorb1","THROW_TARGET","ALLY_FLING",
"THROW_ALLY","WAIT(FIXED)","OBJ_ANIM","COORD_RESET",
"WAIT(FIXED)","32"],



#-------------------------------------------------------------------------------
"End" => ["End"]}
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  Actor Basic Action Settings
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Actor Unarmed Attack Animation 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 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 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 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 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 for all unassigned Actor IDs.
return "DAMAGE"
end
#--------------------------------------------------------------------------
# ● Actor Evasion Animation
#--------------------------------------------------------------------------
def evasion
case @actor_id
when 1
return "EVADE_ATTACK"
end
# Default action 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 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 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 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 for all unassigned Actor IDs.
return "FLEE_FAIL"
end
#--------------------------------------------------------------------------
# ● Actor Victory Animation
#--------------------------------------------------------------------------
def win
case @actor_id
when 1
return "VICTORY"
end
# Default action 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 for all unassigned Actor IDs.
return "BATTLE_START"
end
#--------------------------------------------------------------------------
# ● Actor Return Action when actions are interuptted/canceled
#--------------------------------------------------------------------------
def recover_action
case @actor_id
when 1
return "RESET_POSITION"
end
# Default action 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 Animation Sequence
#--------------------------------------------------------------------------
# when 1 <- enemyID#
# return "ENEMY_UNARMED_ATK" <- Corresponding action SEQUENCE name.
def base_action
case @enemy_id
when 1
return "ENEMY_UNARMED_ATK"
end
# Default action for all unassigned Enemy IDs.
return "ENEMY_UNARMED_ATK"
end
#--------------------------------------------------------------------------
# ● Enemy Wait/Idle Animation
#--------------------------------------------------------------------------
def normal
case @enemy_id
when 1
return "WAIT"
end
# Default action for all unassigned Enemy IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● Enemy Critical (1/4th HP) Animation
#--------------------------------------------------------------------------
def pinch
case @enemy_id
when 1
return "WAIT"
end
# Default action for all unassigned Enemy IDs.
return "WAIT"
end
#--------------------------------------------------------------------------
# ● Enemy Guarding Animation
#--------------------------------------------------------------------------
def defence
case @enemy_id
when 1
return "GUARD_ATTACK"
end
# Default action for all unassigned Enemy IDs.
return "GUARD_ATTACK"
end
#--------------------------------------------------------------------------
# ● Enemy Damage Taken Animation
#--------------------------------------------------------------------------
def damage_hit
case @enemy_id
when 1
return "DAMAGE"
end
# Default action for all unassigned Enemy IDs.
return "DAMAGE"
end
#--------------------------------------------------------------------------
# ● Enemy Evasion Animation
#--------------------------------------------------------------------------
def evasion
case @enemy_id
when 1
return "ENEMY_EVADE_ATTACK"
end
# Default action for all unassigned Enemy IDs.
return "ENEMY_EVADE_ATTACK"
end
#--------------------------------------------------------------------------
# ● Enemy Flee Animation
#--------------------------------------------------------------------------
def run_success
case @enemy_id
when 1
return "ENEMY_FLEE"
end
# Default action for all unassigned Enemy IDs.
return "ENEMY_FLEE"
end
#--------------------------------------------------------------------------
# ● Enemy Battle Start Animation
#--------------------------------------------------------------------------
def first_action
case @enemy_id
when 1
return "BATTLE_START"
end
# Default action for all unassigned Enemy IDs.
return "BATTLE_START"
end
#--------------------------------------------------------------------------
# ● Enemy Return Action when action is interuptted/discontinued
#--------------------------------------------------------------------------
def recover_action
case @enemy_id
when 1
return "RESET_POSITION"
end
# Default action 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 1
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 1
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 1 # Enemy ID
return 0 # 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 1
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 1
return 2
when 30
return 3
end
# Default collapse for all unassigned Enemy IDs.
return 2
end
#--------------------------------------------------------------------------
# ● Enemy Multiple Action Settings
#--------------------------------------------------------------------------
# Maximum Actions, Probability, Rapidity Adjustment
# return [ 2, 100, 100]
#
# Maximum Actions - Maximum number of actions enemy may execute in a turn.
# Probability - % value. Chance for a successive action.
# Rapidity Adjustment - % value that decreases enemy's rapidity after
# each successive action. [Note: Literal Japanese
# translation.]
def action_time
case @enemy_id
when 1
return [ 1, 100, 100]
end
# Default action for all unassigned Enemy IDs.
return [ 1, 100, 100]
end
#--------------------------------------------------------------------------
# ● Enemy Animated Battler Settings
#--------------------------------------------------------------------------
# return true - Enemy battler uses same animation frames as actors.
# 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 1
return false
end
# Default action for all unassigned Enemy IDs.
return false
end
#--------------------------------------------------------------------------
# ● Enemy Invert Settings
#--------------------------------------------------------------------------
# return false <- Normal
# return true <- Inverts enemy image
def action_mirror
case @enemy_id
when 1
return false
end
# Default action for all unassigned Enemy IDs.
return false
end
end
module RPG
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
#  State Action Settings
#==============================================================================
class State
#--------------------------------------------------------------------------
# ● State Affliction Wait Animation Settings
#--------------------------------------------------------------------------
# when 1 <- State ID number
# return "DEAD" <- SEQUENCE Animation 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 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 animation sequence assigned
# under State Affliction Wait Animation Settings when
# afflicted. (Actors still will.)
# "NOPOP" - State name will not appear as POP Damage.
# "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 Animation
# 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"]
when 20 # Cat Transformation
return ["HIDEICON","NOSTATEANIME"]
end
# Default extension that applies if state is not assigned above.
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 - 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, 4, true, true]]
end
return []
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
#  Weapon Action Settings
#==============================================================================
class Weapon
#--------------------------------------------------------------------------
# ● Weapon Animation Sequence Settings
#--------------------------------------------------------------------------
# Assigns a specific animation sequence when using a weapon.
#
# when 1 <- Weapon ID number
# return "NORMAL_ATTACK" <- SEQUENCE Animation for assigned weaponID
def base_action
case @id
when 1
return "NORMAL_ATTACK"
end
# Default SEQUENCE for unassigned WeaponIDs.
return "NORMAL_ATTACK"
end
#--------------------------------------------------------------------------
# ● Weapon Graphic Assignment 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 WeaponIDs.
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 WeaponIDs.
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
#  Skill Action Settings
#==============================================================================
class Skill
#--------------------------------------------------------------------------
# ● Skill ID Sequence Assignments
#--------------------------------------------------------------------------
def base_action
case @id
when 84
return "THROW_WEAPON"
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 "TRANSFORM_CAT"
when 98
return "2-MAN_ATTACK"
when 99
return "2-MAN_ATTACK_ASSIST"
when 100
return "4-MAN_ATTACK"
when 101
return "4-MAN_ATTACK_ASSIST"
when 102
return "4-MAN_ATTACK_ASSIST"
when 103
return "4-MAN_ATTACK_ASSIST"
when 104
return "THROW_FRIEND"
end
# Default SEQUENCE for unassigned skills.
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 in a forumla, it will be HP instead.
# This script WILL have compatibility issues with KGC_MPCostAlter.
#
# "NOEVADE" -Cannot be evaded regardless.
# "CONSUMEHP" -Consumes HP instead of MP.
# "%COSTMAX" -Consumes % of MAXMP. Example: Actor MAXMP500,
# 10 set in Database, MP50 cost.
# "%COSTNOW" -Consumes % of current MP.
# "IGNOREREFLECT" -Ignores damage reflection states.
# "%DAMAGEMAX/30" -Changes damage formula of skill to:
# damage = ENEMY MAX HP * [Integer] / 100
# [Integer] is the number you apply after "/".
# "%DAMAGENOW/30" -Changes damage formula of skill to:
# damage = ENEMY CURRENT HP * [Integer] / 100
# [Integer] is the number you apply after "/".
# "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.
# "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
return ["NOOVERKILL"]
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 skills.
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 WeaponIDs.
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
#  Item Action Settings
#==============================================================================
class Item
#--------------------------------------------------------------------------
# ● Item ID Sequence Assignment
#--------------------------------------------------------------------------
def base_action
case @id
when 1
return "ITEM_USE"
end
# Default SEQUENCE for unassigned ItemIDs.
return "ITEM_USE"
end
#--------------------------------------------------------------------------
# ● Item Enhancement Extension Settings
#--------------------------------------------------------------------------
# "NOEVADE" -Cannot be evaded regardless.
# "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.
# "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 SEQUENCE for unassigned ItemIDs.
return ["NONE"]
end
end
end
zum Lesen den Text mit der Maus markieren


Sideview 1 (3.3)

Spoiler
#==============================================================================
# ■ Sprite_Battler for Sideview Ver3.3
#------------------------------------------------------------------------------
#  バトラー表示用のスプライトです。
#==============================================================================
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 !@battler.actor? && @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 !@battler.actor? && @battler.action_mirror
# 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える
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
# 矩形を設定
@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 && !@battler.actor?
self.mirror = true
self.mirror = false if @battler.action_mirror
else
self.mirror = false
self.mirror = true if !@battler.actor? && @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 !@battler.actor? && @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 !@battler.exist?
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] && !@battler.actor?
# 二刀ではないアクターの二刀フラグアニメ処理はキャンセル
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
anime_id = @battler.action.skill.animation_id
elsif @battler.action.item? && anime_id != -2
anime_id = @battler.action.item.animation_id
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("Balloon")
@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
#--------------------------------------------------------------------------
# ● スキル派生
#--------------------------------------------------------------------------
def derivating
# 未修得スキルは派生不可なら
return if !@active_action[2] && !@battler.skill_id_learn?(@active_action[3])
# 確率分岐
return if rand(100) > @active_action[1]
# 派生成功
@battler.derivation = @active_action[3]
# 以降のアクションを中断
@action = ["End"]
end
#--------------------------------------------------------------------------
# ● 個別処理開始
#--------------------------------------------------------------------------
def individual_action
# リピートフラグオン
@battler.individual = true
# リピートアクションを保持
@individual_act = @action.dup
# ターゲットを保持し、行動ターゲットをひとつずつ抜き出す
send_action(["個別処理"])
@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[i] != nil
time += 1
target_x += @target_battler[i].position_x
target_y += @target_battler[i].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 && !@battler.actor?
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 !@battler.actor? && @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
self.bitmap = Cache.character(file_name)
# 転送元の矩形を設定
@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
zum Lesen den Text mit der Maus markieren


Sideview 2 (3.3)

Spoiler
#==============================================================================
# ■ Scene_Battle for Sideview Ver3.3
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================
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
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
@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("Verteidigt", 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("Geflohen", 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
# 戦闘不能付与のスキルで不死身設定を分岐
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
# スキル使用可能判定
return unless @active_battler.skill_can_use?(skill)
# ターゲット決定
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
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 member in $game_party.members + $game_troop.members
# 既に戦闘不能ならスキップ
next if member.dead?
# イベント等で不死身設定になっていたら解除を無効にするフラグを立てる
member.non_dead = true if member.immortal
member.immortal = true
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.immortal = false
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
battler.derivation = 0
return true
end
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
@animation_ox = x - ox + width / 2
@animation_oy = y - oy + height / 2
update_animation_n01
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[i]))
@enemy_sprites[i].opacity = 0 if $game_troop.members[i].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[i]))
if $game_party.members[i] != nil
@actor_sprites[i].make_battler
@actor_sprites[i].first_action
end
end
end
#--------------------------------------------------------------------------
# ● バトルフロアスプライトの作成
#--------------------------------------------------------------------------
def create_battlefloor
@battlefloor_sprite = Sprite.new(@viewport1)
@battlefloor_sprite.bitmap = Cache.system("BattleFloor")
@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[i]]
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[i])
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[i].battler.id != $game_party.members[i].id
dispose_actors
return create_actors
end
@actor_sprites[i].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
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
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 = @non_dead = @individual = @slip_damage = @revival = false
@double_damage = @dying = false
end
#--------------------------------------------------------------------------
# ● 一番新しいステート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
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
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 = @non_dead = @individual = false
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 !@battler.double_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
# 数字
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



zum Lesen den Text mit der Maus markieren


Enemy Gauge Addon

Spoiler
#==============================================================================
# ■ module n01
#------------------------------------------------------------------------------
#  ターゲット選択時のヘルプ表示セッティング Ver1.1
#==============================================================================
module N01

# Display the state of the battler.
WORD_STATE_DISPLAY = true

# Name to display when there is no abnormal state.
WORD_NORMAL_STATE = "Normal"

# Displays the HP gauge.
HP_DISPLAY = true

# Displays the HP gauge for actors.
ACTOR_DISPLAY = true

# Do not display the HP gauge and states for the following enemies. ex.[1,2,3]
ENEMY_NON_DISPLAY = []

# Do not display the following states as abnormal. ex.[1,2,3]
STATE_NON_DISPLAY = []


end
#-------------------------------設定ここまで-----------------------------------

#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================

class Window_Help < Window_Base
#--------------------------------------------------------------------------
# ● テキスト設定
#--------------------------------------------------------------------------
def set_text_n01add(member)
self.contents.clear
self.contents.font.color = normal_color
if !member.actor? && N01::ENEMY_NON_DISPLAY.include?(member.enemy_id)
return self.contents.draw_text(4, 0, self.width - 40, WLH, member.name, 1)
elsif member.actor? && !N01::ACTOR_DISPLAY
return self.contents.draw_text(4, 0, self.width - 40, WLH, member.name, 1)
end
if N01::WORD_STATE_DISPLAY && N01::HP_DISPLAY
self.contents.draw_text(0, 0, 180, WLH, member.name, 1)
draw_actor_hp(member, 182, 0, 120)
text = "["
for state in member.states
next if N01::STATE_NON_DISPLAY.include?(state.id)
text += " " if text != "["
text += state.name
end
text += N01::WORD_NORMAL_STATE if text == "["
text += "]"
text = "" if text == "[]"
self.contents.draw_text(315, 0, 195, WLH, text, 0)
elsif N01::WORD_STATE_DISPLAY
text = member.name + " ["
for state in member.states
next if N01::STATE_NON_DISPLAY.include?(state.id)
text += " " if text != member.name + " ["
text += state.name
end
text += N01::WORD_NORMAL_STATE if text == member.name + " ["
text += "]"
text = "" if text == "[]"
self.contents.draw_text(4, 0, self.width - 40, WLH, text, 1)
elsif N01::HP_DISPLAY
self.contents.draw_text(4, 0, 240, WLH, member.name, 1)
draw_actor_hp(member, 262, 0, 120)
end
end
end

#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● ターゲット選択の開始
#--------------------------------------------------------------------------
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_n01add(members[@index])
select_member(actor)
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_n01add(members[@index])
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_n01add(members[@index])
end
end
zum Lesen den Text mit der Maus markieren


Enemy Animated Battlers Addon

Spoiler
#==============================================================================
# ■ Enemy Animated Battlers for RPG Tankentai Sideview Battle System
# 5.10.2008
#------------------------------------------------------------------------------
# Script by: Kylock
#==============================================================================
# Easy to implement interface to specify animated battlers for enemies. Note
# enemy batters must be formatted THE SAME as your character battlers. Also,
# you must have 2 copies of your enemy battler:
# <game folder>\Graphics\Battlers\$<enemy name>.png
# <game folder>\Graphics\Characters\$<enemy name>.png
# When you set up your "troops" for the encounter, you may need to tweak the
# positioning of the enemy as the sprites look funny and the actual placement
# may be slightly off. A few battle tests should be sufficient.
#
# Please read this link for a visual understanding:
# Board Message
#==============================================================================

module K_ENEMY_BATTLERS
ENEMY_ID = [] # list of enemies with batter sprites(ex. [1,24])
end

class Game_Enemy < Game_Battler
alias keb_anime_on anime_on
def anime_on
for x in K_ENEMY_BATTLERS::ENEMY_ID
return true if @enemy_id == x
end
keb_anime_on
end
alias keb_action_mirror action_mirror
def action_mirror
for x in K_ENEMY_BATTLERS::ENEMY_ID
return true if @enemy_id == x
end
keb_action_mirror
end
alias keb_position_plus position_plus
def position_plus
for x in K_ENEMY_BATTLERS::ENEMY_ID
return [0,0] if @enemy_id == x
end
keb_position_plus
end
end
zum Lesen den Text mit der Maus markieren


Bubs' Bow Addon

Spoiler
#==============================================================================
# ■ Bow Attack Animation Sequence for RPG Tankentai SBS
# 9.1.2008
#------------------------------------------------------------------------------
# Script by Mr. Bubble with basis from Kylock's Bow Addon
#==============================================================================
# Adds a new bow animation which allows for a much smoother arrow animation
# compared to Kylock's Bow Addon. This script is designed not to have conflicts
# with Kylock's Bow Addon in case you want to use both.
#==============================================================================
# ■ How to Install
#------------------------------------------------------------------------------
# - Requires Animation 83 from the demo placed in the same ID in your project.
# - Requires "woodarrow.png" in .Graphics\Characters.
#==============================================================================

module N01
# Weapon element that grants a bow animation. Default is 5.
BOW_WEAPON_ELEMENT = 5

#------------------------------------------------------------------------------
# Attack Animation Actions
BOW_ANIME = {
"DRAW_POSE" => [ 0, 1, 1, 2, 0, -1, 0, true,"" ],
"DRAW_BOW" => ["anime", 83, 0, false, false, false],
"ARROW_ANGLE" => [ 30, 60, 11],
# Type ID Object Pass Time Arc Xp Yp Start Z Weapon
"SHOOT_ARROW" => ["m_a", 0, 0, 0, 15, -10, 0, 0, 0,false,"ARROW_ANGLE"],
}
ANIME.merge!(BOW_ANIME)
# Action Sequence
BOW_ATTACK_ACTION = {
"NEW_BOW_ATTACK" => ["BEFORE_MOVE","DRAW_BOW", "DRAW_POSE", "16",
"SHOOT_ARROW", "12","OBJ_ANIM","16",
"Can Collapse","FLEE_RESET"],
}
ACTION.merge!(BOW_ATTACK_ACTION)
end

module RPG
class Weapon
alias bubs_bow_base_action base_action
def base_action
# If "Bow" Element is checked on the weapons tab in the database,
# the new ranged attack action sequence is used.
if $data_weapons[@id].element_set.include?(N01::BOW_WEAPON_ELEMENT)
return "NEW_BOW_ATTACK"
end
bubs_bow_base_action
end
alias bubs_bow_flying_graphic flying_graphic
def flying_graphic
if $data_weapons[@id].element_set.include?(N01::BOW_WEAPON_ELEMENT)
return "woodarrow"
end
bubs_bow_flying_graphic
end
end
end
zum Lesen den Text mit der Maus markieren


Default Scope Options Addon

Spoiler
#==============================================================================
# ■ Default Scope Options Addon for RPG Tankentai Sideview Battle System
# 12.16.2008
#------------------------------------------------------------------------------
# Original Script Addons by Kylock
# Script Overhaul by Mr. Bubble
#==============================================================================
# This script is a single compilation of Kylock's original animation scripts
# which reproduce some "Scope" options for skills. This has been completely
# overhauled from the original script. Not only are you not limited to several
# skill IDs, you no longer need to manually input items into this script. It
# is plug and play which is great for new people.
#
# ▼ How to use:
#
# Several "Scope" options are disabled in the Skills Tab because of this
# script. They are One Enemy Dual, One Random Enemy, 2 Random Enemies and
# 3 Random Enemies. However, with this script all you need to do is assign
# a skill any one of those Scope options to reproduce the same effect for the
# Sideview script.
#
# There are two animations possible for each Scope. A melee attack animation
# and a spell cast animation. If the "Attack F" value is more than 0, it will
# return the melee attack animation. Otherwise, it will be a spell cast
# Animation.
#
# DO NOT use this script with Dual Attack Fix Addon, Double Attack Fix Addon,
# and Triple Attack Fix Addon. You do not need those anymore if you use this.
#
# DO NOT use Animation: "Same as Normal Atk"! It does not function normally
# with the Sideview script. Use any other Animation except "Same as Normal Atk".
#==============================================================================

module N01
new_action_sequence = {
# This sequence is used if Scope is One Enemy Dual and Attack F > 0
"ONE_ENEMY_DUAL_A" => ["PREV_STEP_ATTACK","WPN_SWING_V","OBJ_ANIM_WEAPON",
"WAIT(FIXED)","16", "PREV_STEP_ATTACK","WPN_SWING_V",
"OBJ_ANIM_WEAPON","Can Collapse","COORD_RESET"],

# This sequence is used if Scope is 2 Random Enemies and Attack F > 0
"ONE_RANDOM_ENEMY_A" => ["PREV_STEP_ATTACK","WPN_SWING_V","OBJ_ANIM_WEAPON",
"WAIT(FIXED)","16","Can Collapse","COORD_RESET"],

# This sequence is used if Scope is 2 Random Enemies and Attack F > 0
"2_RANDOM_ENEMIES_A" => ["PREV_STEP_ATTACK","WPN_SWING_V","OBJ_ANIM_WEAPON",
"WAIT(FIXED)","16","PREV_STEP_ATTACK","WPN_SWING_V",
"OBJ_ANIM_WEAPON","Can Collapse","COORD_RESET"],

# This sequence is used if Scope is 3 Random Enemies and Attack F > 0
"3_RANDOM_ENEMIES_A" => ["PREV_STEP_ATTACK","WPN_SWING_V","OBJ_ANIM_WEAPON",
"WAIT(FIXED)","16", "PREV_STEP_ATTACK","WPN_SWING_V",
"OBJ_ANIM_WEAPON","WAIT(FIXED)","16","PREV_STEP_ATTACK",
"WPN_SWING_V","OBJ_ANIM_WEAPON","Can Collapse","COORD_RESET"],

# This sequence is used if Scope is One Enemy Dual
"ONE_ENEMY_DUAL_S" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","WPN_SWING_V",
"OBJ_ANIM_WEIGHT","OBJ_ANIM_WEIGHT",
"Can Collapse","24","COORD_RESET"],

# This sequence is used if Scope is One Enemy Random
"ONE_RANDOM_ENEMY_S" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","WPN_SWING_V",
"OBJ_ANIM_WEIGHT","Can Collapse","24","COORD_RESET"],

# This sequence is used if Scope is 2 Random Enemies
"2_RANDOM_ENEMIES_S" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","WPN_SWING_V",
"OBJ_ANIM_WEIGHT","OBJ_ANIM_WEIGHT",
"Can Collapse","24","COORD_RESET"],

# This sequence is used if Scope is 3 Random Enemies
"3_RANDOM_ENEMIES_S" => ["BEFORE_MOVE","WAIT(FIXED)","START_MAGIC_ANIM",
"WPN_SWING_UNDER","WPN_RAISED","WPN_SWING_V",
"OBJ_ANIM_WEIGHT","OBJ_ANIM_WEIGHT","OBJ_ANIM_WEIGHT",
"Can Collapse","24","COORD_RESET"],
}
# Merges new hash with the script
ACTION.merge!(new_action_sequence)
end

module RPG
class Skill
alias default_scope_options_base_action base_action
def base_action # ● Skill ID Sequence Assignments
if self.scope == 3 # If Scope is set to One Enemy Dual
return "ONE_ENEMY_DUAL_A" if self.atk_f > 0
return "ONE_ENEMY_DUAL_S"
end
if self.scope == 4 # If Scope is set to One Enemy Random
return "ONE_RANDOM_ENEMY_A" if self.atk_f > 0
return "ONE_RANDOM_ENEMY_S"
end
if self.scope == 5 # If Scope is set to 2 Random Enemies
return "2_RANDOM_ENEMIES_A" if self.atk_f > 0
return "2_RANDOM_ENEMIES_S"
end
if self.scope == 6 # If Scope is set to 3 Random Enemies
return "3_RANDOM_ENEMIES_A" if self.atk_f > 0
return "3_RANDOM_ENEMIES_S"
end
default_scope_options_base_action
end
alias default_scope_options_extension extension
def extension # ● Skill Enhancement Extension Settings
if self.scope == 4 # If Scope is set to One Enemy Random
return ["RANDOMTARGET"]
end
if self.scope == 5 # If Scope is set to 2 Random Enemies
return ["RANDOMTARGET"]
end
if self.scope == 6 # If Scope is set to 3 Random Enemies
return ["RANDOMTARGET"]
end
default_scope_options_extension
end
end
end
zum Lesen den Text mit der Maus markieren


Danke schon mal im voraus^^

Ähnliche Themen

Social Bookmarks