Tổng số bài gửi : 145 MGV Xu : 597 Danh tiếng : 4 Ngày tham gia : 12/12/2010
Tiêu đề: Hướng dẫn takentai 1/2/2011, 17:12
Để sử dụng takentai, các bạn phải copy tất cả những cái script tôi nêu ở đây và phải đặt đúng trình tự: - [SBS] General Settings (cái này ko cần quan tâm) - [SBS] Battler Configuration (cái này mới quan trọng. Từ nay, các bạn muốn tạo các dạng skill sẽ tạo ở đây.) - Sideview 1 (3.4d) (cái này cũng quan trọng, nhưng ko cần quan tâm) - Sideview 2 (3.4d) (cái này cũng quan trọng, nhưng ko cần quan tâm) Những script phụ: (cái này cũng cần thiết) - Notetags for Tankentai Add-on (cái này cần thiết phải có) - Old Vers. Compatibility (cái này ko cần để ý vì ko biết, hahaha) Script hỗ trợ: (ko có cũng được) - Hiện lệnh tấn công (cái này tôi tự đặt tên, các bạn tưởng tượng nha, những dòng tấn công đơn giản biến thành những tấm hình minh họa đẹp mắt) - Skill từ trang bị (cái này ví dụ ta tạo 1 skill mà chỉ khi sử dụng 1 trang bị duy nhất mới xài được) - Kẻ thù trang bị vũ khí (các bạn nghĩ xem, mình xài vũ khí tấn công kẻ thù còn kẻ thù chỉ biết dùng tay ko, hỏi có chán ko chứ) Những script sơ lược thì là nhiêu đó, nếu muốn biết taketai ra sao thì hãy chơi game Superheroes: Chaos của mình để xem nó có tác dụng như thế nào. Đầu tiên, các bạn vào [SBS] Battler Configuration, đến dòng 1062, đó là những dòng mô tả các hành động của skill, mấy cái skill đó mình chưa nghiêm cứu, nhưng mình đã tạo vài hành động để các bạn ko biết làm hành động thì có thể dựa vào đó mà làm. Nào, giờ kéo xuống 1 chút các bạn có thấy những lệnh “THUONG”, “THUONG 2”, “DANH 2x”, “MULTI_ATTACK_RAND 2x” và còn vài cái nữa, đó là những hành động mình đã làm trước cho các bạn, mình sẽ giải thích từng lệnh hành động. - dòng 1094 "MULTI_ATTACK_RAND 3x" đó là đánh random 3 lần bất kì con quái nào. - Dòng 1177 "CHEM LOAN XA" đó là đánh liên hoàn nhiều cú 1 con quái đã chọn (chiêu này mạnh nên lát nữa phải đễ damage ít thôi) - Dòng 1187 "THUONG" đây là lên thường dùng nhất vì nó mang tính khái quát nhất, với hành động này, player sẽ nhảy lên 1 bước và tấn công, có thể gọi đây là tấn công tầm xa, hoặc tấn công bằng phép. - Dòng 1189 "THUONG 2" đây là lên thường dùng nhất vì nó mang tính khái quát nhất, với hành động này, player sẽ chạy đến gần quái và dùng vũ khí đánh trực tiếp, vì vậy các skill phù hợp là các skill mạng tính giáp chiến. Vd: dùng kiếm lửa chẳng hạn. - Dòng 1191 "DANH 2x" đây là dòng lệnh giúp cho quái đánh 2 lần liên tiếp vào 1 quái đã chỉ định - Dòng 1194 "MULTI_ATTACK_RAND 2x" đó là đánh random 2 lần bất kì con quái nào. Đó là tất cả những hành động mình làm, nãy gì chỉ là giải nghĩ, bây giờ mới làm đây, đầu tiên các bạn lựa hành động thích hợp và nhớ cái tên. Sau đó bấm F9 để vào database, vào mục skill, cứ tự tạo skill như bình thường, chỉ cần quan tâm cái animation (đó là hiệu ứng khi xài skill, muốn biết nó ra sao qua mục animation trong database để xem cho dể lựa). tiếp theo bước này mới quan trọng. Sau khi tạo skill, các bạn nhìn về bên phải ở dưới bảng, thấy cái mục note ko, đây là nơi các bạn cho dòng lệnh kích hoạt hành động vào. Các bạn thêm dòng lệnh này vào: <action tên hành động> Vd: <action THUONG 2> Vậy chưa phải xong, các bạn hãy nhớ số ID của skill mới tạo, sau đó bấm “ok”. Bấm F11, lại vào cái [SBS] Battler Configuration, đến dòng 2031, bắt đầu từ đây, nhưng đừng động vào mấy cái đó, xuống cho đến hết cái đó sau đó chèn theo vào: when ID (cái ID thây bằng số ID của skill các bạn tạo) return “tên hành động đã gắn vào skill lúc nãy” Vd: when 97 return "THUONG 2" nhớ là thêm vào dưới mấy cái lên giống như vậy ở trên và trên chữ end đó nha. Xong. Mời các bạn thưởng thúc game. (đây là hướng dẫn cho những script chính và phụ, còn hỗ trợ để sau, hahaha) Tác giả: voanhhung64 (muốn có script thì vào diễn đàn ta mà lấy, kakaka)
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:29
Giúp voanhhung add script này - [SBS] General Settings:
Code:
#============================================================================== # ■ Sideview Battle System General Settings [3.4d] #------------------------------------------------------------------------------ # Original Script by: # Enu ( http://rpgex.sakura.ne.jp/home/ ) # English Localization: # Kylock, Mr. Bubble, Shu # Contributors & Special Thanks: # Shu, Moonlight, NightWalker, Enelvon, Atoa, AlphaWhelp, # blackmorning, Mithran, Kaduki, Enu # (See [Credits] for more information) #==============================================================================
$imported = {} if $imported == nil $imported["TankentaiSideview"] = true
#============================================================================== # ■ module N01 #------------------------------------------------------------------------------ # Sideview Battle System General Settings #============================================================================== module N01 #-------------------------------------------------------------------------- # ● Party Members Settings #-------------------------------------------------------------------------- # Battle member starting positions. Extra positions beyond 4 actors are # added in case one uses another script that increases the party size. # Extra coordinates will not adversely affect your game, otherwise. # # Position 1, Pos. 2, Pos. 3, Pos. 4 Pos. 5 Pos. 6 # X Y X Y X Y X Y X Y X Y ACTOR_POSITION = [[415,170],[435,200],[455,230],[475,260],[495,290],[515,310]] # Maximum party members that can fight at the same time. # Remember to add coordinates in the ACTOR_POSITION array if you # change the MAX_MEMBER value higher than 4. MAX_MEMBER = 4 #-------------------------------------------------------------------------- # * Battle Tempo Settings #-------------------------------------------------------------------------- # Delay after a battler completes an action in 1/60 sec. increments. ACTION_WAIT = 12 # Delay before enemy collapse animation in 1/60 sec. increments. COLLAPSE_WAIT = 12 # Delay before victory is processed in 1/60 sec. increments. WIN_WAIT = 70 #-------------------------------------------------------------------------- # * Help Window Settings #-------------------------------------------------------------------------- # Text that appears in Help Window when Guard is used. GUARD_HELP_TEXT = "Guard" # Text that appears in Help Window when escaping from battle. ESCAPED_HELP_TEXT = "Escaped" #-------------------------------------------------------------------------- # ● HP Gauge and Status Display Settings #-------------------------------------------------------------------------- # true: Display the state icons of the highlighted battlers in Help Window. # # To hide an individual enemy's states, type <hide states> into the Notebox # of the enemy in the Database. WORD_STATE_DISPLAY = true # true: Display the HP gauge of highlighted battlers in Help Window. # # To hide an individual enemy's states, type <hide hp> into the Notebox # of the enemy in the Database. HP_DISPLAY = true # true: Display the HP gauge and states of highlighted actor in Help Window. ACTOR_DISPLAY = false # Name to display when there is no abnormal state. WORD_NORMAL_STATE = "Normal" # Do not display the HP gauge and states for the following enemies: ENEMY_NON_DISPLAY = [] # ex.[1,2,3] # Do not display the following states ID as abnormal: STATE_NON_DISPLAY = [] # ex.[1,2,3] #-------------------------------------------------------------------------- # * BattleFloor Settings #-------------------------------------------------------------------------- # BattleFloor display options. # FLOOR = [ X-position, Y-positon, Opacity] # BattleFloor can be hidden if opacity is set to 0. FLOOR = [0,96,128] #-------------------------------------------------------------------------- # * Targeting Cursor Position Settings #-------------------------------------------------------------------------- # Adjust the targeting cursor position CURSOR_X_PLUS = 0 CURSOR_Y_PLUS = 0 #-------------------------------------------------------------------------- # * Balloon Setting #-------------------------------------------------------------------------- # Emotion Balloon graphics file in the System folder. Balloons used in battle # can be different than those used in a game map. Balloon file must be # 10x8 frames, similar to the RTP Balloons. BALLOON_GRAPHICS = "Balloon" #-------------------------------------------------------------------------- # * Unarmed Animation Setting #-------------------------------------------------------------------------- # Defines Animation ID for any unarmed attack made by a battler. NO_WEAPON = 82 #-------------------------------------------------------------------------- # * Auto-Life Animation Setting #-------------------------------------------------------------------------- # Define the Animation ID used when a battler is revived # with an Auto-Life state. RESURRECTION = 41 #-------------------------------------------------------------------------- # * Damage Pop-up Settings #-------------------------------------------------------------------------- # Damage Pop-up image file name located in the Graphics/System folder. # Numbers in the image file must be arranged 0 to 9. See demo's number # graphics for an example. DAMAGE_GRAPHICS = "Number+" # Image file for HP recovery numbers. RECOVER_GRAPHICS = "Number-" # true: Allow use of separate number graphics for MP recovery and damage. # false: Use the same number graphics for MP recovery/damage as # HP recovery/damage. USE_MP_POP_GRAPHICS = true # Image file for MP damage numbers. MP_DAMAGE_GRAPHICS = "MP_Number+" # Image file for MP recovery numbers. MP_RECOVER_GRAPHICS = "MP_Number-" # Distance adjustment (in pixels) between Damage Pop-up digits. # Can be negative. NUM_INTERBAL = -12 # Duration (in frames) POP numbers are displayed. NUM_DURATION = 68 #-------------------------------------------------------------------------- # * Pop-up Window Settings #-------------------------------------------------------------------------- # true: Window skin used for Pop-up Window is not seen. # false: Pop-up Window skin is used. NON_DAMAGE_WINDOW = true # Pop-up Window text. For no text results, use "". POP_DAMAGE0 = "" # Attack results 0 damage POP_MISS = ("HỤT!") # Attack missed POP_EVA = ("NÉ!") # Attack avoided POP_CRI = ("SIÊU MẠNH!") # Attack scored a critical hit POP_MP_DAM = ("THIỆT HẠI MP") # Attack caused MP loss POP_MP_REC = ("HỒI PHỤC MP") # Attack restored MP #-------------------------------------------------------------------------- # * Battler Graphics Display Settings #-------------------------------------------------------------------------- # true: Allow the appearance shadows under battlers. # false: Disable the appearance of shadows in all cases. SHADOW = true # true: Use actor's Walking Graphic assigned in the Database. # false: Actor's Walking Graphic from the Database is not used. # If false, battler file with "<filename>_1" is required in the # Graphics/Characters. "<filename>_1" and subsequent files # ("_2", "_3", etc.) must have the same image length and width as # the "<filename>_1" file. WALK_ANIME = true # Number of columns in an animated battler graphics file. ANIME_PATTERN = 3 # Number of rows in an animated battler graphics file. ANIME_KIND = 4 #-------------------------------------------------------------------------- # * Back Attack Settings #-------------------------------------------------------------------------- # true: Allow back attacks to occur. # false: Disable all chance for back attacks to occur. BACK_ATTACK = true # Define whether back attacks will mirror battler positions. (true/false) # Not yet implemented. BACK_ATTACK_NON_BACK_MIRROR = true # Set equipment and skills to protect against back attacks # Defined equipment must be equipped to take effect, skills must be aquired # and switches must be ON. # For a single weapon: = [1] or Multiple Weapons: = [1,2] # Weapon IDs NON_BACK_ATTACK_WEAPONS = [] # Shield IDs NON_BACK_ATTACK_ARMOR1 = [] # Helmet IDs NON_BACK_ATTACK_ARMOR2 = [] # Armor IDs NON_BACK_ATTACK_ARMOR3 = [] # Accessory IDs NON_BACK_ATTACK_ARMOR4 = [] # Skill IDs NON_BACK_ATTACK_SKILLS = [] # Switch IDs (takes precedence over everything else) If switch is ON, # Back attack guaranteed. BACK_ATTACK_SWITCH = [] #-------------------------------------------------------------------------- # * Immortality Changing Method Setting #-------------------------------------------------------------------------- # If another Game_Battler method can alter immortality put the name # here in quotes # Example: ["my_script_set_immortal"] # The method will then automatically assign 'non_dead' to the correct value. # This is unecessary unless another script can change the value of @immortal # through a nonstandard accessor. Otherwise, ignore this setting. IMMORTALITY_CHANGING_METHODS = ["your_method_here"] # (untested) end
còn nữa...
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:31
- [SBS] Battler Configuration: (Part 1) đây là phần đầu của script này tí mình post phần 2 thì các bạn add vào sau phần 1 nhé
Code:
#============================================================================== # ■ Sideview Battle System Battler Configuration [3.4d] #------------------------------------------------------------------------------ # Original Script by: # Enu ( http://rpgex.sakura.ne.jp/home/ ) # English Localization: # Kylock, Mr. Bubble, Shu # Contributors & Special Thanks: # Shu, Moonlight, NightWalker, Enelvon, Atoa, AlphaWhelp, # blackmorning, Mithran, Kaduki, Enu # (See [Credits] for more information) #==============================================================================
module N01 #============================================================================== # ■ ANIME Hashes #------------------------------------------------------------------------------ # ANIME hashes are utilized by ACTION sequences and have no utility alone. #==============================================================================
ANIME = { # <- Do not delete this line.
#---------------------------------------------------------------------------- # * About Anime Hashes #---------------------------------------------------------------------------- # Think of Anime Hashes as predefined orders/commands that are given to a # battler to make it perform a single desired action/effect in battle. By # utilizing multiple Anime Hashes and listing their keys in an action # sequence, you are able create your own unique battler actions. # Anime Hashes are utilized by listing Anime Keys within an action sequence. # # Please read "About Action Sequences" for specific information on # how to use Anime Hashes in Action Sequences. # #---------------------------------------------------------------------------- # * Creating Anime Hashes #---------------------------------------------------------------------------- # ANIME Hashes in this section are defined with the following syntax:
# ANIME Key - Can be any name you want as long as it does not # contain only numbers such as "5" or "42". # Remember that ANIME Keys are case-sensitive # when they are used. If an ANIME Key is not defined when # used within an action sequence, the ANIME Key will simply # be skipped and the action sequence will continue. # When creating names for your Keys, do not use the # same name as an existing Key. # # => - Must be between the ANIME Key and the Hash Array. # # Hash Array - Contents of the Hash Array differ depending on the type of # battler action you want when the ANIME Key is used in an action # sequence. Please read through the SBS Configuration script # to learn the requirements for each type of Anime Hash. # # Comma - All Anime hashes must end with a comma after the # closing square bracket. Forgetting to include the comma will # result in a syntax error.
#-------------------------------------------------------------------------- # ● Battler Poses #-------------------------------------------------------------------------- # Command a battler to display specific frames from the battler's # assigned character graphic file. # # File No. - File number of battler graphic file used. # 0: Walking Graphic. In the case of Actors, 0 refers to # default walking graphic as assigned in the Actors tab. # n: "Character Name + _n", where n refers to the file number # extension. # Example: If Ralph has a character graphic of "$Ralph.png" # assigned to him in the Actors tab of the Database, # "$Ralph_1" can instead be used if File No. equals 1. # # Row - Row to be used from the character graphic, where the value 0 # refers to the topmost row. (0~3) # Speed - Frame change rate of battler graphic. Lower numbers are faster. # Loop - [0: "Round-Trip" Loop] Example: 1 2 3 2 1 2 3 2 1 ... # [1: "One-Way" Loop] Example: 1 2 3 1 2 3 1 2 3 ... # [2: One Loop, no repeat] Example: 1 2 3 . # Wait - Time, in frames, before animation loops again. # This value does not apply if Loop=2 # Fixed - Defines loop behavior or specific fixed frame display. # [ -2: Reverse Loop Animation. Also reverses weapon animation.] # [ -1: Normal Loop Animation] # [0~2: Fixed frame display. Refers to frame on character sprite # sheet starting where 0 = left-most frame.] # Z - Value added to battler's Z priority. # Shadow - true: Display battler shadow. # false: Does not display battler shadow. # Weapon - Weapon Sprite Animation to be used with battler frame animation. # For no weapon animation, use "".
#-------------------------------------------------------------------------- # ++ Weapon Sprite Animation #-------------------------------------------------------------------------- # Weapon Sprite Animation keys are not to be used directly within action # sequences. Instead, they are utilized in Battler Frame Animation hash # arrays. # # The amount of frames a Weapon Sprite Animation has from start to finish # is equal to the number of frames in a row of a character graphic. # # 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 - true: Weapon sprite is displayed over battler sprite. # 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 will stop here. # Or - Rotation Origin - [0: Center] [1: Upper Left] [2: Upper Right] # [3:Bottom Left] [4:Bottom Right] # Inv - Invert - If true, horizontally inverts weapon sprite. # Xs - X scale - Stretches weapon sprite horizontally by a factor of X. # Values may be decimals. (0.6, 0.9, etc.) # Ys - Y scale - Stretches weapon sprite vertically by a factor of Y. # Values may be decimals. (0.6, 0.9, etc.) # Xp - X pitch - For adjusting the X axis. This number changes the initial # X coordinate. # Yp - Y pitch - For adjusting the Y axis. This number changes the initial # Y coordinate. # Weapon2 - If set to true, Two Weapon Style's Weapon 2 sprite will be used # instead.
#-------------------------------------------------------------------------- # ++ Battler Movement #-------------------------------------------------------------------------- # Command a battler to move to a specified point on the battle field. # # Origin - Defines the origin of movement based on an (x,y) coordinate plane. # [0: Battler's Current Position] # [1: Center of Battler's Selected Target] # [2: Screen; (0,0) is at upper-left of screen] # [3: Battler's Start Position] # [4: "Head" of Battler's Selected Target] # [5: "Feet" of Battler's Selected Target] # X - X-axis pixels from origin. 1 unit = 1 pixel # Y - Y-axis pixels from origin. Please note that the Y-axis is # inverted. This means negative values move up, positive values # move down. 1 unit = 1 pixel # Time - Total travel time from starting to end point. # Larger numbers are slower. # Accel - Positive values accelerates frames. Negative values decelerates. # Jump - Negative values produce a jumping arc. Positive values produce # a reverse arc. [0: No jump] # Animation - Battler Frame Animation utilized during moving.
#-------------------------------------------------------------------------- # ++ Battler Float Movement #-------------------------------------------------------------------------- # Battler Float Animation hashes define the movement of battlers from their # own shadows. Note that it is not possible to move horizontally with # Battler Movements hashes while simultaneously floating from a shadow. # # Type - Always "float". # A - Starting float height. Negative values move up. # Positive values move down. # B - Ending float height. This height is maintained until another action # is used. # Time - Total duration of movement from point A to point B # Animation - Specifies the Battler Frame Animation to be used.
#-------------------------------------------------------------------------- # ++ Battler Position Reset #-------------------------------------------------------------------------- # Battler Position Reset hashes define when a battler's turn is over and # will reset the battler back to its starting coordinates. This type of # ANIME hash is required in all sequences. # # Please note that after a sequence has used a Battler Position Reset hash, # no more damage can be done by the battler because its turn is over. # # Type - Always "reset" # Time - Total travel time from current location to start coordinates. # Distance from start coordinates determines visual movement speed. # Accel - Positive values accelerate. Negative values decelerate. # Jump - Negative values produce a jumping arc. Positive values produce # a reverse arc. [0: No jump] # Animation Key - Specifies the Battler Frame Animation hash to be used.
#-------------------------------------------------------------------------- # ++ Force Battler Action #-------------------------------------------------------------------------- # These types of ANIME hash allow forced control of other battler objects # that you define. This is particuarly used to control battlers when # it is not their turn. # # Type - Specifies action type. "SINGLE" or "SEQUENCE" # # Object - The battler(s) that will execute the specific action defined under # ANIME/ACTION Key. 0 is for selected target. Any other positive # number is a State ID number (1~999) that will force all battlers # with that State on them to execute the ANIME/ACTION Key. # By adding a - (minus sign) followed by a Skill ID number (1~999), # the actors that know that Skill ID will execute the defined # ANIME/ACTION Key except the active battler. # If you want to define a specific actor as the Object, # add 1000 to their index ID number. If the system cannot designate # the index number(such as if actor is dead or ran away), it will # select the nearest one starting from 0. If a response fails, # the action will be cancelled. (Example: Ylva's actor ID is 4. A # value of 1004 would define Ylva as the Object.) # # Reset Type - Specifies method of returning the battler to its original # location. # ANIME/ACTION Key - Specifies action used. If Type is SINGLE, # must be an ANIME hash key. If Type is SEQUENCE, # must an ACTION sequence key.
#-------------------------------------------------------------------------- # ++ Target Modification #-------------------------------------------------------------------------- # Changes battler's target in battle. Original target will still be stored. # Current battler is the only battler capable of causing damage. # # Type - Always "target" # # Object - The battler that will have its target modified. 0 is selected # target, any other number is a State ID number (1~999), and # changes all battlers with that state on them to target the new # designated target. # If you want to designate an actor by their index ID number, # add 1000 to their index ID number. If the system cannot designate # the index number(such as if actor is dead or ran away), it will # select the nearest one starting from 0. If a response fails, # the ACTION will be cancelled. (Example: Ylva's actor ID is 4. A # value of 1004 would define Ylva as the Object.) # # Target - New Target. [0=Self] [1=Self's Target] # [2=Self's Target After Modification] # [3=Reset to Previous Target (if 2 was used)]
#-------------------------------------------------------------------------- # ++ Skill Link (Derivating Skills) #-------------------------------------------------------------------------- # Allows you use another skill directly from an action sequence. # # Linking to another skill will immediately terminate the action sequence # the Skill Link was used in. Linking to the next skill will also # require and consume the MP/HP cost of that skill. # # You can also define the probability of a successful Skill Link. If the # skill link is not successful, the link will be skipped and the sequence # will continue as normal. # # Type - Always "der" # Chance - Percentage chance for a successful skill link. (0~100) # Learned? - true: actor does not require Skill ID learned to link. # false: actor requires Skill ID learned. # Skill ID - ID of the skill that will be linked to.
# ANIME Key Type Chance Learned? Skill ID "LINK_SKILL_91" => ["der", 100, true, 91], "LINK_SKILL_92" => ["der", 100, true, 92],
#-------------------------------------------------------------------------- # ++ Action Sequence Conditions #-------------------------------------------------------------------------- # Allows you to create a conditional statement within an action sequence. # # If the condition is met, the ACTION sequence will continue processing # normally. If the condition is not met, the battler's turn will immediately # be ended and will reset to its start coordinate. # # A: Type - always "nece" # B: Object - Object(s) that Condition refers to. [0=Self] [1=Target] # [2=All Enemies] [3=All Allies] # C: Content - [0=State] [1=Parameter] [2=Switch] [3=Variable] [4=Skill] # # D: Condition - Condition is determined by the value you set for Content. # [0] State: State ID Number # [1] Parameter: [0=Current HP] [1=Current MP] [2=ATK] [3=DEF] [4=SPI] [5=AGI] # [2] Switch: Game Switch Number # [3] Variable: Game Variable Number # [4] Skill: Skill ID Number # # E: Condition Value - Value required for the Condition as defined above. # [0] State: Exact amount of states required. If number is positive, the # condition is how many have the state, while a negative number # are those who don't have the state. # [1] Parameter: If Object is more than one battler, average is used. # Success if Parameter is greater than value. If Value # is negative, then success if lower than value. # [2] Switch: If Condition is 2, Condition Value must be true or false. # [true: Switch ON succeeds] [false: Switch OFF succeeds] # [3] Variable: Game Variable value used to determine if condition is met. If # Condition Value is positive, Game Variable must have more # than the defined amount to succeed. If Condition Value has a # minus symbol (-) attached, Game Variable must have less than # the defined amount to succeed. (Ex: -250 means the Game # Variable must have a value less than 250 to succeed.) # [4] Skill: Required amount of battlers that have the specified Skill # ID learned.
# ANIME Key Type Obj Cont Cond Cond Value # A B C D E "CONDITION_STATE_18" => ["nece", 3, 0, 18, 1], "CONDITION_STATE_19" => ["nece", 3, 0, 19, 3], "CONDITION_STATE_17" => ["nece", 0, 0, 17, 1], "CONDITION_STATE_CAT" => ["nece", 0, 0, 20, 1],
#-------------------------------------------------------------------------- # ++ Battler Sprite Angle #-------------------------------------------------------------------------- # Rotates battler sprite image. Weapon Animations do not automatically # rotate with the battler when used in conjunction with Battler Sprite # Rotation ANIME Keys. # # Type - always "angle" # Time - Duration duration of rotation animation in frames. # Start - Starting angle. 0-360 degrees. Can be negative. # End - Ending Angle. 0-360 degress. Can be negative. # Return - true: End of rotation is the same as end of duration. # false: Rotation animation as defined.
# ANIME Key Type Time Start End Return "DEAD_ANGLE" => ["angle", 1, -90, -90,false], "CLOCKWISE_TURN" => ["angle", 48, 0,-360,false], "COUNTERCLOCKWISE_TURN" => ["angle", 6, 0, 360,false],
#-------------------------------------------------------------------------- # ++ Battler Sprite Zoom #-------------------------------------------------------------------------- # Stretch and shrink battler sprites. Battler zoom is always temporary. # # Type - always "zoom" # Time - Duration of zoom animation in frames. # X - X scale - Stretches battler sprite horizontally by a factor of X. # 1.0 is normal size, 0.5 is half size. # Y - Y scale - Stretches battler sprite vertically by a factor of Y. # 1.0 would be normal size, 0.5 would be half size. # Return - true: End of rotation is the same as end of duration. # false: Zoom animation as defined.
# ANIME Key Type Time X Y Return "X_SHRINK" => ["zoom", 16, 0.5, 1.0, true], "Y_SHRINK" => ["zoom", 16, 1.0, 0.5, true],
#-------------------------------------------------------------------------- # ++ Battle Animation (Damage) #-------------------------------------------------------------------------- # These ANIME hashes deal with animations, particularly with those assigned # in the Database for Weapons, Skills and Items. These are what causes # any damage/healing/state/etc. application from Weapons, Skills and Items. # # A difference between "anime" and "m_a" ANIME hashes is that # "anime" triggered animations will move with the Object on the screen. The # Z-axis of animations will always be over battler sprites. # # If the "ID" variable is -1, -2, or -3 the ANIME hash will cause damage # and attempt to apply any states assigned to the weapon, skill, or item. # # If the "ID" variable is -3, it will only cause object damage with no # associated animation. # # If the "ID" variable is -4, it will only produce an animation (if any). # # Type - always "anime" # ID: [1~999: Database Animation ID.] # [-1: Deal damage and uses item/skill/weapon animation in game Database.] # [-2: Deal damage and uses equipped Weapon's animation.] # [-3: Deal damage and not use any animation.] # [-4: Uses item/skill/weapon assigned database animation. No damage.] # 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, animation is used from Weapon 2.
# It is best to explain what each anime key listed above does since # they are often used and are very important. # 'object animation' refers to what the defined database animation is as # assigned in the database (i.e. Item animation, Skill animation or # Weapon animation) # # "DAMAGE_ANIM" # - Deal damage AND plays object animation. # "DAMAGE_ANIM_WAIT" # - Deal damage AND plays object animation AND delays the sequence # until animation is finished. This DOES NOT delay the damage. # "WEAPON_DAMAGE" # - Deal damage AND plays equipped Weapon animation (even if a skill # or item is used) # "WEAPON2_DAMAGE" # - Deal damage AND plays equipped Weapon 2 animation (even if a skill # or item is used) # "WEAPON_DAMAGE_WAIT" # - Deal damage AND plays equipped Weapon animation (even if a skill # or item is used). Delays sequence. # "WEAPON2_DAMAGE_WAIT" # - Deal damage AND plays equipped Weapon 2 animation (even if a skill # or item is used). Delays sequence. # "DAMAGE" # - Deals damage ONLY. Does not play object animation. # "ANIM" # - Only plays object animation. Does not delay sequence. # DOES NOT deal damage. # "ANIM_WAIT" # - Plays object animation AND delays the sequence until the animation # is finished. DOES NOT deal damage. # "ANIM_ON_SELF_WAIT" # - Always plays object animation on self AND delays the sequence # until the animation is finished. DOES NOT deal damage. # Positive ID numbers # - "anime" hashes with a positive ID number refers to the animation ID # in the Animations tab in your Database. These will never cause damage.
#-------------------------------------------------------------------------- # ++ Moving Animations #-------------------------------------------------------------------------- # Allows extended control of database animations when they are used in battle. # # Moving Animation keys provide motion options for animations made in the # database. Used for effects such as long-ranged attacks and projectiles. # Weapon sprites can also substitute animations. # # A difference between Moving Animation and Battle Animation hashes is that # Moving Animations will stay where the Object was even if the Object moves # while the animation plays. # # Moving Animation hashes are the only way to utilize the flying graphics # assigned to skills, items, and weapons. If the Flying Graphic Angle # is left blank (i.e. "") then no flying graphic will be used. # # Type - always "m_a" # ID - 1~999: Database Animation ID # 0: No database animation used. # Object - Animation's target. [0=Target] [1=Enemy's Area] # [2=Party's Area] [4=Self] # Pass - [0: Animation stops when it reaches the Object.] # [1: Animation passes through the Object and continues.] # Time - Total travel time of animation from starting to end point. Larger # values slow down travel speed. This value also determines the length # of time the animation will display on screen. It is possible for # animations to get cut short before it completes. Increase this value # to ensure that animations don't get cut short. # Arc - Trajectory - Positive values produce a low arc. # Negative values produce a high arc. # [0: No Arc] # Xp - X Pitch - Adjusts the initial X coordinate of the animation. # Enemy calculation will be automatically inverted. # Yp - Y Pitch - Adjusts the initial Y coordinate of the animation. # Start - Defines origin of animation movement. # [0=Self] [1=Target] [2=No Movement] # Z-axis - true: Animation will be over the battler sprite. # false: Animation will be behind battler sprite. # Flying Graphic Angle - Insert only "Flying Graphic Angle" and # "Flying Graphic Skill Angle" ANIME keys. # For no weapon sprite, use "".
#-------------------------------------------------------------------------- # ++ Flying Graphic Angle #-------------------------------------------------------------------------- # Allows rotation of weapon sprites that are utilized within Animation # Movement hashes. # # You can 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.
#-------------------------------------------------------------------------- # ++ Flying Graphic Angle (Skill) #-------------------------------------------------------------------------- # Different from Throwing Weapon Rotation. These ANIME hashes are used to # rotate weapon sprites that are "thrown" with Movement of Animation ANIME # objects. These are specifically used with skills. You may assign a different # weapon graphic to be thrown in this configuration script under # Throwing Weapon Graphic Settings. # # Start - Starting angle in degrees (0-360) # End - Ending angle in degrees. (0-360) # Time - Duration, in frames, of a single rotation. Rotation will continue # until the animation is complete. # Type - Always "skill".
# ANIME Key Start End Time Type "WPN_ROTATION(SKILL)" => [ 0, 360, 8, "skill"],
#-------------------------------------------------------------------------- # ++ Emotion Balloon Animation #-------------------------------------------------------------------------- # Uses Balloon.png in the System folder. # # Type - Always "balloon" # Row - Determines row from the Balloon.png (0~9) # Loop - Balloon loop behavior. Balloon disappears when loop is # complete. [0="One-Way" Loop] [1="Round-Trip" Loop]
#-------------------------------------------------------------------------- # ++ Sound Effects #-------------------------------------------------------------------------- # Provides use of sound effects, background music, and background # sounds directly through an ACTION sequence. # # Type1 - always "sound" # Type2 - ["se","bgm","bgs"] # Pitch - Value between 50 and 150. # Vol - Volume - Value between 0 and 100. # Filename - Name of the sound to be played.
#-------------------------------------------------------------------------- # ++ Game Speed Modifier #-------------------------------------------------------------------------- # Change the frame rate of the game through an ACTION sequence. Use with # care as this function modifies FPS directly and will conversly affect # any active timers or time systems. # # Type - always "fps" # Speed - Speed in Frames Per Second. 60 is normal frame rate.
#-------------------------------------------------------------------------- # ++ State Granting Effects #-------------------------------------------------------------------------- # Provides application of states on battlers directly through # an Action Sequence. # # Type - always "sta+" # Object - [0=Self] [1=Target] [2=All Enemies] [3=All Allies] # [4=All Allies (excluding user)] # State ID - State ID to be granted.
# ANIME Key Type Object State ID "APPLY_STATE_18" => ["sta+", 0, 18], "APPLY_STATE_19" => ["sta+", 0, 19], "APPLY_CAT_STATE" => ["sta+", 0, 20],
#-------------------------------------------------------------------------- # ++ State Removal Effects #-------------------------------------------------------------------------- # Provides direct removal of states on battlers directly through # an Action Sequence. # # Type - always "sta-" # Object - [0=Self] [1=Target] [2=All Enemies] [3=All Allies] # [4=All Allies (excluding user)] # State ID - State ID to be removed.
# ANIME Key Type Object State ID "REMOVE_STATE_18" => ["sta-", 3, 18], "REMOVE_STATE_19" => ["sta-", 3, 19],
#-------------------------------------------------------------------------- # ++ Change Actor Graphic #-------------------------------------------------------------------------- # Type - always "change" # Reset - true: Battler sprite reverts back to previously used file after # battle. # false: Transformation is permanent after battle. # Filename - Battler graphics file that will be transformed to.
#-------------------------------------------------------------------------- # ++ Cut-In Image #-------------------------------------------------------------------------- # Only one image can be displayed at a time. Image can be removed by using # "Clear image" within a sequence. # # X1 - Image's starting X-coordinate. # Y1 - Starting Y-coordinate. # X2 - Ending X-coordinate. # Y2 - Ending Y-coordinate. # Time - Total duration of image movement from start to end point. # Higher values are slower. # Z-axis - true: Image appears over BattleStatus Window. # false: Image appears behind BattleStatus Window. # Filename - Filename from .Graphics/Pictures folder.
#-------------------------------------------------------------------------- # ++ Game Switch Control #-------------------------------------------------------------------------- # Provides direct control of Game Switches directly through # an Action Sequence. # # Type - Always "switch" # Switch - Switch number from the game database. # ON/OFF - [true:Switch ON] [false:Switch OFF] # # ANIME Key Type Switch ON/OFF "GAME_SWITCH_1_ON" => ["switch", 1, true],
#-------------------------------------------------------------------------- # ++ Game Variable Control #-------------------------------------------------------------------------- # Provides direct control of Game Variables directly through # an Action Sequence. # # Type - Always "variable" # Var - Variable Number from the game database. # Operand - [0=Set] [1=Add] [2=Sub] [3=Mul] [4=Div] [5=Mod] # X - value of the operation. # # ANIME Key Type Var Oper X "GAME_VAR_1_+1" => ["variable", 1, 1, 1],
#-------------------------------------------------------------------------- # ++ Script Operation #-------------------------------------------------------------------------- # Type - Always "script" # # Inserts a simple script code into the Action Sequence utilizing the eval() # method. The sample, where it says p = 1, can be replaced with any script. # Character strings can work if the .to_s method is used rather than quotes. # Anything else beyond functions will not work.
# ANIME Key Type "TEST_SCRIPT" => ["script", "
p = 1
"],
#-------------------------------------------------------------------------- # ++ Special Modifiers Keys - 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 "RESET" does not reset Invert. # "Don't Wait" - Any actions after Don't Wait is applied are done instantly. # Apply "Don't Wait" again in a sequence to trigger off. # "Can Collapse" - Triggers collapse of battler when HP is 0. # Required in every damage sequence. # "Two Wpn Only" - The ANIME key following Two Wpn Only will only execute # if the actor is wielding two weapons. If the actor is not, # the ANIME key will be skipped and will move on to the next. # "One Wpn Only" - The ANIME key following One Wpn Only will only execute # if the actor is wielding one weapon. If the actor is not, # the ANIME key will be skipped and will move on to the next. # "Process Skill" - The Return marker for individual processing of a skill. # "Process Skill End" - The End marker for individual processing of a skill. # "Start Pos Change" - Changes the Start Position to wherever the battler # currently is on screen. # "Start Pos Return" - Returns battler to original Start Position. # "Cancel Action" - Trigger the "end" of battler's turn which will cause the # the next battler's turn to execute. # This includes the function of Can Collapse, and no # additional damage can be dealt by the battler after this. # "End" - This is used when no action is automatically recognized. # # Note: If you wish to understand the Process Skill and Process Skill End # functions, please examine the "SKILL_ALL" sequence in this Config # and use the Float All skill provided in the demo to see how it works.
#-------------------------------------------------------------------------- # ++ Delay Sequence Processing #-------------------------------------------------------------------------- # When there is only a numerical value as an ANIME key, it will be # considered a delay, in frames, before the Action Sequence continues. # (i.e. "10", "42") Because of this, ANIME keys for the # effects defined above cannot be entirely numerical. Any Battler # Frame Animations that have been prompted will persist when Waiting.
} # <- Do not delete this line.
#============================================================================== # * RPG Tankentai Sideview Battle System # [SBS]Action Sequences #------------------------------------------------------------------------------ # Action Sequences consist of the ANIME keys defined in [. #==============================================================================
ACTION = { # <- Do not delete this line. #---------------------------------------------------------------------------- # * About Action Sequences #---------------------------------------------------------------------------- # Think of Action Sequences as a list of orders/commands given to a battler # in a given situation. Battlers are *always* using an Action Sequence even # when you think they are doing nothing. A battler can only process one # Action Sequence at a time. # # Action Sequences can be assigned to skills, items, weapons, and certain # types of actions in sections of the SBS Configuration script. # #---------------------------------------------------------------------------- # * Defining Action Sequences #---------------------------------------------------------------------------- # Action Sequences in this section are defined with the following syntax: # # Action Sequence Key => Hash Array Comma "EXAMPLE_ACTION_SEQUENCE" => ["ANIME_KEY_1", "30", "ANIME_KEY_2"], # # Action Sequence Key - Can be any name you want as long as it does not # contain only numbers such as "5" or "42". # Remember that Action Sequence Keys are case-sensitive # when they are used. If an Action Sequence Key is # mispelled or does not exist when used, it will result # in an error. # # => - Must be between the Action Sequence Key and the Hash Array. # # Hash Array - Consists of the pre-defined ANIME Keys from the ANIME section # of the SBS Configuration script. You can list as many # ANIME Keys within a hash array as you like as long as they # are separated by commas and are between the square brackets. # When the Action Sequence Key is used, the script will process # any keys in the hash array from left to right, in order. # If an ANIME Key contains only an integer (such as "30"), it # will delay the processing of the Action Sequence by # 1/60 second increments depending on the integer value of # the key. # # Comma - All Action Sequences must end with a comma after the # closing square bracket. Forgetting to include the comma will # result in a syntax error. #---------------------------------------------------------------------------- # TIP: I recommend that you copy an existing action sequence, change the # name of the Action Sequence Key and modify the sequence from there.
#------------ Create your own custom Action Sequences BELOW this line ---------
#------------ Create your own custom Action Sequences ABOVE this line ---------
#--------------------------- Default Action Sequences ------------------------- # Default Action Sequences used when certain actions are not defined to # another specific Action Sequence. #---------------------------------------------------------------------------- # "ENEMY_UNARMED_ATK" is the most basic action sequence you can try to # understand. It is an action sequence used by enemies when they attack # without an equipped weapon. I have formatted the anime keys within the # action sequence as a vertical list. It does not matter how much whitespace # there is between each key as long as it is in the hash format as explained # above.
# Action Sequence Key "ENEMY_UNARMED_ATK" => [ # Anime Keys "MOVE_TO_TARGET", # Move to the selected target "WPN_SWING_V", # Swing weapon/play attack pose "DAMAGE_ANIM_WAIT", # Do damage and wait for animation "Can Collapse", # Allow targets to die if at 0 HP "FLEE_RESET" # Return to original battle coordinates ], # <-- Don't forget the closing bracket and comma!
# Even though the use of "WPN_SWING_V" in this sequence is kind of strange # since this sequence is used for when enemies don't have weapons, it will # still play the battler's attack pose (if they are animated). # # When you go into battle with an unarmed enemy, examine their actions. # You will see that they will follow this exact sequence. #---------------------------------------------------------------------------- # "NORMAL_ATTACK" is the action sequence used when an actor uses the attack # command. It is also the default sequence used when using a weapon that # does not have a specific action sequence assigned to it. # It is similar to "ENEMY_UNARMED_ATK" except that it also takes into # consideration if the actor is wielding two weapons.
# Action Sequence Key "NORMAL_ATTACK" => [ # Remember the => and [ # Anime Keys "MOVE_TO_TARGET", # Move to selected target "WPN_SWING_V", # Swing weapon & do attack pose "DAMAGE_ANIM_WAIT", # Do damage/healing and wait for animation "12", # Delay sequence for 12 frames "WPN_SWING_VL", # Swing Weapon 2 (if they have one) "WEAPON2_DAMAGE", # Do damage and animation of Weapon 2 "Two Wpn Only", # Special sequence modifier "16", # Delay for 16 frames (if dual-wielding) "Can Collapse", # Allow targets to die if at 0 HP "FLEE_RESET" # Return to original battle coordinates ], # <-- Don't forget the closing bracket and comma!
# "Two Wpn Only" is a special modifier that checks if the actor is holding # two weapons. If the actor is not holding two weapons, it will ignore the # NEXT immediate key and the sequence will continue normally. #---------------------------------------------------------------------------- # "SKILL_USE" is the default action sequence used for skills that do not # have a specific action sequence assigned to it. It is very basic as it # only hits once. Damage is dealt at the end of the animation.
# Action Sequence Key "SKILL_USE" => [ # Remember the => and [ # Anime Keys "STEP_FORWARD", # Step forward from current position "STAND_POSE", # Play wait pose (replaces the pose "STEP_FORWARD" used) "CAST_ANIMATION", # Play cast animation on self "WPN_SWING_UNDER", # Swing weapon (this does not do damage!) "WPN_RAISED", # Swing weapon (in a different way) "WPN_SWING_V", # Swing weapon (in another different way) "ANIM_WAIT", # Play skill/weapon/item animation, wait until it's done "4", # Delay sequence for 4 frames "DAMAGE", # Deal damage "Can Collapse", # Allow targets to die if at 0 HP "24", # Delay sequence for 24 frames "RESET" # Return to original battle coordinates ], # <-- Don't forget the closing bracket and comma!
# A problem many users have with "SKILL_USE" is that it is obviously a # ranged attack and does not take into account if you want the skill # to be close-ranged. To assign another action sequence to a skill, read the # section called Skill Action Sequence Settings. #---------------------------------------------------------------------------- # "ITEM_USE" is the default action sequence for usable items in battle. # It is a very simple action sequence so there isn't much to say.
# Action Sequence Key "ITEM_USE" => [ # Remember the => and [ # Anime Keys "MOVE_TO_TARGET", # Move to selected target "STAND_POSE", # Play wait pose "24", # Delay sequence for 24 frames "DAMAGE_ANIM_WAIT", # Do damage/healing "Can Collapse", # Allow targets to die if at 0 HP "RESET" # Reset to original battle coordinates ], # <-- Don't forget the closing bracket and comma!
#------------------------------- Basic Actions -------------------------------- # These sequences that are used for various states and situations, but are # not meant to be used directly such as by skills, items, and such. # # Basic Actions are grouped into two categories: looped sequences # and non-looped sequences. # # Keep in mind that even though these are default sequences, you can freely # edit them to suit your needs. # # The action sequences here are not formatted in a vertical list like the # ones above, but will process their keys in the same exact way.
# Used when battler uses the Guard command. "GUARDING" => ["STAND_POSE","4","CONDITION_STATE_17","FLOAT_", "2","FLOAT_2","2","FLOAT_3","2", "FLOAT_4","2"],
# "ENTER_BATTLE" - Used at the start of battle when battlers enter the # battlefield. They will start a small length away from their start position # before stepping forward. This sequence will also be used when battlers # join in the middle of battle. "BATTLE_START" => ["BATTLE_ENTRANCE","RESET"],
# Used when the battler is incapacitated and not immortal. "DEAD" => ["DEAD_ANGLE","DEAD_POSE"],
# Used when a battler is hurt by damage "HURT" => ["KNOCKBACK","RESET"],
# Used when actors successfully escape battle. "FLEE" => ["FLEE_SUCCESS"],
# Used when enemies successfully escape battle. "ENEMY_FLEE" => ["FLEE_SUCCESS","RESET"],
# Used when actors fail to escape. "FLEE_FAIL" => ["FLEE_FAIL","STAND_POSE","8","RESET"],
# Used when an actor is selecting a command "COMMAND_INPUT" => ["STEP_FORWARD"],
# Used when an actor has selected a command "COMMAND_SELECT" => ["RESET"],
# Used when an actor evades damage. "EVADE_ATTACK" => ["JUMP_BACK","JUMP_BACK","STAND_POSE","16", "RESET"],
# Used when an enemy evades damage. "ENEMY_EVADE_ATTACK" => ["JUMP_BACK","STAND_POSE","16","RESET"],
# Used by actors when they win a battle. # If the actor is inflicted with the cat state (state ID 20) at the end of # battle, they will revert to the graphic of Ylva. "VICTORY" => ["STAND_POSE","16","FACE_RIGHT_POSE","VICTORY_JUMP", "STAND_POSE","Don't Wait","CONDITION_STATE_CAT", "CAST_ANIMATION","TRANSFORM_YLVA","STAND_POSE","Don't Wait"],
# Used by battlers when their action sequence is interrupted. "RESET_POSITION" => ["RESET"],
#----------------------- Force Battler Action Sequences ----------------------- # Sequences that are utilized through Force Battler Action ANIME keys.
#-------------------------- Advanced Action Sequences ------------------------- # Examples of advanced action sequences. You can use these as examples on how # to create your own custom action sequences. # # The action sequences below are not formatted in a vertical list, but they # are still processed from left to right, top to bottom.
# "SKILL_ALL" - Example of how to use "Process Skill" and # "Process Skill End" within Action Sequences. Used by the Float # All spell in the demo. "SKILL_ALL"=> ["STEP_FORWARD","CAST_ANIMATION","WPN_SWING_UNDER","WPN_RAISED", "Process Skill","WPN_SWING_V","DAMAGE_ANIM","24", "Process Skill End","Can Collapse","RESET"],
# "MULTI_ATTACK" - Example of a multi-attack Action Sequence that utilizes # effects such as afterimages and jumping. It is also # made to use Weapon 2 for Two Swords Style actors. # Damage is caused by "WEAPON_DAMAGE". "MULTI_ATTACK" => ["Afterimage ON","STEP_ATTACK","WPN_SWING_VL", "WEAPON_DAMAGE", "STAND_POSE","16","WEAPON_DAMAGE","WPN_SWING_UNDER", "WPN_SWING_OVER","4","LONG_JUMP_ATTACK","WPN_SWING_VL", "WEAPON_DAMAGE","STAND_POSE","16","WEAPON_DAMAGE", "Invert","WPN_SWING_V","WPN_SWING_VL","12","Invert", "LONG_JUMP_ATTACK","WPN_SWING_VL","WEAPON_DAMAGE", "JUMP_BACK","JUMP_BACK","STAND_POSE", "WEAPON_DAMAGE","DASH_ATTACK","WPN_SWING_VL","Can Collapse", "Afterimage OFF","16","FLEE_RESET"],
# "MULTI_ATTACK_RAND" - Example of a simple multi-hit skill using the # animation of the equipped weapon rather than # database assigned animation of the skill. "MULTI_ATTACK_RAND 3x"=> ["STEP_ATTACK","WPN_SWING_VL","WEAPON_DAMAGE","STAND_POSE","16", "STEP_ATTACK","WPN_SWING_VL","WEAPON_DAMAGE","STAND_POSE","16", "STEP_ATTACK","WPN_SWING_VL","WEAPON_DAMAGE","Can Collapse","RESET"],
# "RAPID_MULTI_ATTACK" - A multi-hit Action Sequence that hits quickly. # "FORCE_KNOCKBACK" is used to "RAPID_MULTI_ATTACK" => ["MOVE_TO_TARGET","WPN_SWING_V","FORCE_KNOCKBACK","WEAPON_DAMAGE", "MOVE_TO_TARGET_FAST","WPN_SWING_V","FORCE_KNOCKBACK","WPN_SWING_VL","WEAPON_DAMAGE", "MOVE_TO_TARGET_FAST","WPN_SWING_V","FORCE_KNOCKBACK","WPN_SWING_VL","WEAPON_DAMAGE", "MOVE_TO_TARGET_FAST","WPN_SWING_V","FORCE_KNOCKBACK","WPN_SWING_VL","WEAPON_DAMAGE", "MOVE_TO_TARGET_FAST","WPN_SWING_V","FORCE_KNOCKBACK","WPN_SWING_VL","WEAPON_DAMAGE", "MOVE_TO_TARGET_FAST","WPN_SWING_V","FORCE_KNOCKBACK","WPN_SWING_VL","WEAPON_DAMAGE", "Can Collapse","12","RESET"],
# "THROW_WEAPON" - An Action Sequence that demonstrates the function to # 'throw' a weapon sprite at an enemy. "THROW_WEAPON" => ["STEP_FORWARD","WPN_SWING_V","absorb1","STAND_POSE", "START_WEAPON_THROW","12","WEAPON_DAMAGE","Can Collapse", "END_WEAPON_THROW","RESET"],
# "MULTI_SHOCK" - An example of having animations travel from one battler # to another. Also utilizes "Process Skill" and # "Process Skill End". "REAL_TARGET" is used to set # the origin of "IMPACT_1" to the user's targets. "MULTI_SHOCK"=> ["JUMP_FORWARD","FLOAT_STOP","Process Skill", "REAL_TARGET","WPN_SWING_V","IMPACT_1","8", "WEAPON_DAMAGE","Process Skill End","Can Collapse", "FLOAT_LAND","RESET"],
# "SHOCK_WAVE" - A simple example of having animations travel from one point # to another. Unlike "MULTI_SHOCK", this sequence makes # multiple moving animations appear for each target. "SHOCK_WAVE" => ["REAL_TARGET","WPN_SWING_V","IMPACT_1","20", "DAMAGE_ANIM_WAIT","Can Collapse"],
# "SKILL_90_SEQUENCE" - Example of using Link Skills. When the sequence # processes to "LINK_SKILL_91", it will link to # the defined skill ID. In this case, it will link # to skill ID 91. "SKILL_90_SEQUENCE" => ["MOVE_TO_TARGET","DAMAGE_ANIM","WPN_SWING_V", "16","Can Collapse","LINK_SKILL_91","RESET"],
# "SKILL_91_SEQUENCE" - Another example of using Link Skills. When the # Action Sequence reaches "LINK_SKILL_92", it will # link to skill ID 92. This essentially makes # a chain of three linked skills used in succession. "SKILL_91_SEQUENCE" => ["FLEE_FAIL","CAST_ANIMATION","WPN_SWING_UNDER","WPN_RAISED", "8","DAMAGE_ANIM","Can Collapse","LINK_SKILL_92","RESET"],
# "CUT_IN" - Simple example of using a cut-in image during an Action Sequence. # "Clear image" is used to remove the image from screen. "CUT_IN" => ["STAND_POSE","CAST_ANIMATION","CUT_IN_START", "75","CUT_IN_END","8","MOVE_TO_TARGET", "WPN_SWING_V","DAMAGE_ANIM_WAIT","Can Collapse", "Clear image","FLEE_RESET"],
# "STOMP" - An example of using "ANIMATION_1", a type of anime hash that uses a # database animation that does not cause damage. Damage is only # caused when the sequence reaches "DAMAGE_ANIM". "STOMP" => ["JUMP_TO_TARGET","ANIMATION_1","FORCE_SHRINK","JUMP_BACK", "TRAMPLE","ANIMATION_1","FORCE_SHRINK","JUMP_BACK", "TRAMPLE","DAMAGE_ANIM","FORCE_SHRINK","JUMP_BACK", "JUMP_BACK","Can Collapse","STAND_POSE","8","FLEE_RESET"],
# "ALL_ATTACK_1" - Similar in structure to "SKILL_USE", but made to # demonstrate "PLAY_AREA_ANIM". "ALL_ATTACK_1" => ["STEP_FORWARD","STAND_POSE","CAST_ANIMATION", "WPN_SWING_UNDER","WPN_RAISED","PLAY_AREA_ANIM", "WPN_SWING_V","48","DAMAGE_ANIM_WAIT","Can Collapse", "RESET"],
# "TRANSFORM_CAT" - Made to demonstrate sprite transformation through # an action sequence. "TRANSFORM_CAT" => ["JUMP_FORWARD","STAND_POSE","CAST_ANIMATION","32", "TRANSFORM_CAT","STAND_POSE","APPLY_CAT_STATE","32","JUMP_BACK"],
# "THROW_FRIEND" - Demonstrates using a Force Battler Action key to # move another battler when it's not their turn. "THROW_FRIEND" => ["ALLY_TO_THROW","MOVE_ON_TARGET","FORCE_LIFT_ALLY","4", "absorb1","THROW_TARGET","ALLY_FLING", "MOVE_THROWING_ALLY","STAND_POSE","DAMAGE_ANIM","RESET", "STAND_POSE","32"],
#------------------------- Union Skill Sequences ------------------------ # There is a difference between how union skill sequences are made with the # ATB compared to without the ATB. ATB Union sequences do not require special # states or "Action Conditions" hashes such as "CONDITION_STATE_19". "Forced # Battler Actions", such as "FORCE_ULRIKA", are also not required. You must # also go in your ATB Configurations script and define your union skills # under "ATB Union Skills Settings". # # Target modification keys are used to set the correct target for # assist actors.
# Main action sequence of the union skill. Damage can only be caused by # this skill. "2-MAN_ATK_RALPH" => ["CONDITION_STATE_18","TWO_UNIFIED_TARGETS","ULRIKA_ATTACK", "MOVE_RIGHT_OF_TARGET","STAND_POSE","CAST_ANIMATION","WPN_SWING_UNDER", "WPN_RAISED","48","KILL_HIT_ANIM","LEFT_DASH_ATTACK","64","DAMAGE_ANIM", "Can Collapse","FLEE_RESET","REMOVE_STATE_18"],
# Assist actors apply a dummy state to themselves. "2-MAN_ATK_ASSIST" => ["APPLY_STATE_18"],
# Ulrika runs her sequence through use of "ULRIKA_ATTACK" key from # Ralph's sequence. "ULRIKA_ATTACK_1" => ["2","MOVE_LEFT_OF_TARGET","STAND_POSE", "CAST_ANIMATION","WPN_SWING_UNDER","WPN_RAISED", "48","RIGHT_DASH_ATTACK","64","FLEE_RESET"],
#------------------------- Union Skill Sequences ------------------------ # Assist actors apply a dummy state to themselves. "4-MAN_ATK_ASSIST" => ["APPLY_STATE_19"],
# Main action sequence of the union skill. Damage can only be caused by # this skill. "4-MAN_ATK-RALPH"=> ["CONDITION_STATE_19","FOUR_UNIFIED_TARGETS","FORCE_ULRIKA", "FORCE_BENNETT","FORCE_YLVA","4_MAN_MOVE-RALPH","STAND_POSE", "CAST_ANIMATION","WPN_SWING_UNDER","WPN_RAISED","90", "ANIMATION_11","RIGHT_DASH_ATTACK","64","DAMAGE_ANIM_WAIT", "Can Collapse","FLEE_RESET","REMOVE_STATE_18"],
# Ulrika runs her sequence through use of "FORCE_ULRIKA" key from # Ralph's sequence. "4_MAN_ATK-ULRIKA" => ["2","4_MAN_MOVE-ULRIKA","STAND_POSE","CAST_ANIMATION", "WPN_SWING_UNDER","WPN_RAISED","90", "LEFT_DASH_ATTACK","96","FLEE_RESET"],
# Bennett runs his sequence through use of "FORCE_BENNETT" key from # Ralph's sequence. "4_MAN_ATK-BENNETT" => ["2","4_MAN_MOVE-BENNETT","STAND_POSE","CAST_ANIMATION", "WPN_SWING_UNDER","WPN_RAISED","60","RIGHT_DASH_ATTACK2","FORCE_ROTATION", "DAMAGE_ANIM","128","FLEE_RESET"],
# Ylva runs her sequence through use of "FORCE_YLVA" key from # Ralph's sequence. "4_MAN_ATK-YLVA" => ["2","4_MAN_MOVE-YLVA","STAND_POSE","CAST_ANIMATION", "WPN_SWING_UNDER","WPN_RAISED","34","LEFT_DASH_ATTACK2","FORCE_ROTATION", "DAMAGE_ANIM","144","FLEE_RESET"],
#---------------------------------------------------------------------------- # "End" - An important action sequence that works behind the scenes. # Do not edit this action sequence key or its contents. "End" => ["End"]}
end
#============================================================================== # * Game_Actor #------------------------------------------------------------------------------ # Actor Basic Action Settings #------------------------------------------------------------------------------ # This page is used to define what Action Sequence Actors should use when # specific conditions are met. Each actor can have their own unique action # sequence that you can define in the appropriate section. For example, # each actor can have its own unique Action Sequence when a battle is won. # # Since actors do not have a Notebox in the database, all customization # for actors must be done manually in Ruby syntax. #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ++ Actor Unarmed Attack Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is unarmed. # # If Actor is equipped with any weapon then this Action Sequence will # not be used. def non_weapon case @actor_id when 1 # Actor ID return "NORMAL_ATTACK" # Action Sequence Key end # Default Action Sequence for all unassigned Actor IDs. return "NORMAL_ATTACK" end #-------------------------------------------------------------------------- # ++ Actor Wait/Idle Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is doing nothing else in # battle and is not inflicted with special states. def normal case @actor_id when 1 return "WAIT" end # Default Action Sequence for all unassigned Actor IDs. return "WAIT" end #-------------------------------------------------------------------------- # ++ Actor Critical (1/4th HP) Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is at 25% or lower HP. def pinch case @actor_id when 1 return "WAIT-CRITICAL" end # Default Action Sequence for all unassigned Actor IDs. return "WAIT-CRITICAL" end #-------------------------------------------------------------------------- # ++ Actor Guarding Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor uses the Guard command. def defence case @actor_id when 1 return "GUARDING" end # Default Action Sequence for all unassigned Actor IDs. return "GUARDING" end #-------------------------------------------------------------------------- # ++ Actor Damage Hit Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is hit by damage. def damage_hit case @actor_id when 1 return "HURT" end # Default Action Sequence for all unassigned Actor IDs. return "HURT" end #-------------------------------------------------------------------------- # ++ Actor Evasion Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor evades an attack. def evasion case @actor_id when 1 return "EVADE_ATTACK" end # Default Action Sequence for all unassigned Actor IDs. return "EVADE_ATTACK" end #-------------------------------------------------------------------------- # ++ Actor Command Input Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is having a command # selected by the player, but has not selected a command yet. def command_b case @actor_id when 1 return "COMMAND_INPUT" end # Default Action Sequence for all unassigned Actor IDs. return "COMMAND_INPUT" end #-------------------------------------------------------------------------- # ++ Actor Command Selected Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor has a command selected # the player. def command_a case @actor_id when 1 return "COMMAND_SELECT" end # Default Action Sequence for all unassigned Actor IDs. return "COMMAND_SELECT" end #-------------------------------------------------------------------------- # ++ Actor Flee Success Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor successfully escapes battle. def run_success case @actor_id when 1 return "FLEE" end # Default Action Sequence for all unassigned Actor IDs. return "FLEE" end #-------------------------------------------------------------------------- # ++ Actor Flee Failure Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor fails to escape battle. def run_ng case @actor_id when 1 return "FLEE_FAIL" end # Default Action Sequence for all unassigned Actor IDs. return "FLEE_FAIL" end #-------------------------------------------------------------------------- # ++ Actor Victory Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor at the end of a # victorious battle. def win case @actor_id when 1 return "VICTORY" end # Default Action Sequence for all unassigned Actor IDs. return "VICTORY" end #-------------------------------------------------------------------------- # ++ Actor Battle Start Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor first enters the battlefield. def first_action case @actor_id when 1 return "BATTLE_START" end # Default Action Sequence for all unassigned Actor IDs. return "BATTLE_START" end #-------------------------------------------------------------------------- # ++ Actor Interrupt Reset Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor's Action Sequence is # somehow interrupted. def recover_action case @actor_id when 1 return "RESET_POSITION" end # Default Action Sequence for all unassigned Actor IDs. return "RESET_POSITION" end #-------------------------------------------------------------------------- # ++ Actor Incapacitated Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Actor is dead. def incapacitated case @actor_id when 1 # Actor ID return "" # Action Sequence Key end # Default Action Sequence for all unassigned Actor IDs. return "" end #-------------------------------------------------------------------------- # ++ Actor Shadow #-------------------------------------------------------------------------- # Define filename of shadow graphic used by an Actor. # # 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 #-------------------------------------------------------------------------- # Adjusts the coordinates of Actor shadow graphics. # # return [ X-Coordinate, Y-Coordinate] def shadow_plus case @actor_id when 1 return [ 0, 4] # [ X, Y] end # Default shadow positioning for all unassigned Actor IDs. return [ 0, 4] end end #============================================================================== # * Game_Enemy #------------------------------------------------------------------------------ # Enemy Basic Action Settings #------------------------------------------------------------------------------ # This section is used to define what Action Sequence enemies should use under # specific conditions. Each enemy can have their own unique action # sequence that you can define in the appropriate section. # # Notetags are available for use if using the Notetags for Tankentai Add-on. # # Terms: # key - Refers to the name of an action sequence key. # Do not use quotation marks for notetags. # value - A numerical value # value% - A numerical value used as a percentage of something, but # the percent sign is usually optional # id - ID number from the database # type - Differs depending on tag (see specific tag for information) # filename - A filename from the Graphics/Characters folder #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ++ Enemy Unarmed Attack Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy is unarmed. # # If Enemy is equipped with any weapon then this Action Sequence will # not be used. # # Notetag: <unarmed: key> def base_action case @enemy_id when 1 # Enemy ID return "ENEMY_UNARMED_ATK" # Action Sequence Key end # Default Action Sequence for all unassigned Enemy IDs. return "ENEMY_UNARMED_ATK" end #-------------------------------------------------------------------------- # ++ Enemy Standby Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy is doing nothing else in # battle and is not inflicted with special states. # # Notetag: <standby: key> def normal case @enemy_id when 1 return "WAIT" end # Default Action Sequence for all unassigned Enemy IDs. return "WAIT" end #-------------------------------------------------------------------------- # ++ Enemy Critical (1/4th HP) Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy is at 25% or lower HP. # # Notetag: <pinch: key> def pinch case @enemy_id when 1 return "WAIT" end # Default Action Sequence for all unassigned Enemy IDs. return "WAIT" end #-------------------------------------------------------------------------- # ++ Enemy Guarding Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy uses the Guard command. # # Notetag: <guard: key> def defence case @enemy_id when 1 return "GUARDING" end # Default Action Sequence for all unassigned Enemy IDs. return "GUARDING" end #-------------------------------------------------------------------------- # ++ Enemy Hurt Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy is hit by damage. # # Notetag: <hurt: key> def damage_hit case @enemy_id when 1 return "HURT" end # Default Action Sequence for all unassigned Enemy IDs. return "HURT" end #-------------------------------------------------------------------------- # ++ Enemy Evasion Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy evades an attack. # # Notetag: <evade: key> def evasion case @enemy_id when 1 return "ENEMY_EVADE_ATTACK" end # Default Action Sequence for all unassigned Enemy IDs. return "ENEMY_EVADE_ATTACK" end #-------------------------------------------------------------------------- # ++ Enemy Escape Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy runs away from battle. # # Notetag: <escape: key> def run_success case @enemy_id when 1 return "ENEMY_FLEE" end # Default Action Sequence for all unassigned Enemy IDs. return "ENEMY_FLEE" end #-------------------------------------------------------------------------- # ++ Enemy Battle Start Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy first enters the battlefield. # # Notetag: <start: key> def first_action case @enemy_id when 1 return "BATTLE_START" end # Default Action Sequence for all unassigned Enemy IDs. return "BATTLE_START" end #-------------------------------------------------------------------------- # ++ Enemy Interrupt Reset Action Sequence #-------------------------------------------------------------------------- # Define the Action Sequence key used when an enemy's action sequence is # somehow interrupted and cannot be completed normally. # # Notetag: <interrupt: key> def recover_action case @enemy_id when 1 return "RESET_POSITION" end # Default Action Sequence for all unassigned Enemy IDs. return "RESET_POSITION" end #-------------------------------------------------------------------------- # ++ Enemy Incapacitated Action Sequence #-------------------------------------------------------------------------- # Define Action Sequence key used when an Enemy is dead. If left blank ("") # then incapacitated sequence is not used. # # Notetag: <dead: key> def incapacitated case @enemy_id when 1 # Enemy ID return "" # Action Sequence Key end # Default Action Sequence for all unassigned Enemy IDs. return "" end #-------------------------------------------------------------------------- # ++ Enemy Shadow #-------------------------------------------------------------------------- # Define the filename of the shadow graphic used by an Enemy. # # Filename must be in quotes, but does not need the file extension. # # Notetag: <shadow: filename> 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] # # Notetag: <move shadow: x, y> 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 #-------------------------------------------------------------------------- # Equip a weapon on an enemy. Enemy receives any effects when equipped with # the weapon such as status increases. Enemy will also follow the action # sequence assigned to the weapon. Enemies can only equip one weapon. # # If Weapon ID is set to 0, enemy will be unarmed. # # Notetag: <weapon: id> 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 #-------------------------------------------------------------------------- # Adjusts the position of enemies in battle. # Positive Y-values move the enemy down. Negative Y-values move the enemy up. # # return [ 0, 0] <- [X-value、Y-value] # # Notetag: <position: x, y> 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 #-------------------------------------------------------------------------- # Define which collapse animation an enemy uses when killed. The collapse # type is defined by using a numerical value. # # 1 - Enemy sprite stays on screen after death. # 2 - Enemy fades from the battle normally # 3 - Special collapse animation. Good for bosses. # # Notetag: <collapse: type> 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 Actions Settings #-------------------------------------------------------------------------- # Define how many times an enemy can attack in a single turn. # # Maximum Actions, Probability, Speed Adjustment # return [ 2, 100, 100] # # Maximum Actions - Maximum number of actions enemy may execute in a turn. # Probability - % value. Chance for enemy to do another action. # Speed Adjustment - % value that decreases enemy's bonus speed from skills # after each successive action. # # Notetag: <multiact: maximum actions, chance%, speed adjust> def action_time case @enemy_id when 1 return [ 1, 100, 100] end # Default multi-action setting for all unassigned Enemy IDs. return [ 1, 100, 100] end #-------------------------------------------------------------------------- # ++ Enemy Animated Battler Settings #-------------------------------------------------------------------------- # true: Enemy battler uses files from Graphics/Characters folder like actors. # false: Default enemy battler image from Graphics/Battlers folder. # [File 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. # # Notetag: <animate> OR <-animate> OR <+animate> # Prefixing animate with a minus sign will return false. def anime_on case @enemy_id when 1 return false end # Default animation setting for all unassigned Enemy IDs. return false end #-------------------------------------------------------------------------- # ++ Enemy Mirror Settings #-------------------------------------------------------------------------- # Mirrors the enemy battler's graphic and any animations they produce. # # false: Normal # true: Mirrors enemy image and animations # # Notetag: <mirror> OR <-mirror> OR <+mirror> # Prefixing mirror with a minus sign will return false.
def action_mirror case @enemy_id when 1 return false end # Default invert setting for all unassigned Enemy IDs. return false end end
module RPG #============================================================================== # ■ module RPG #------------------------------------------------------------------------------ # State Action Settings # # Notetags are available for use if using the Notetags for Tankentai Add-on. # # Terms: # key - Refers to the name of an action sequence key. # Do not use quotation marks for notetags. # value - A numerical value # value% - A numerical value used as a percentage of something, but # the percent sign is usually optional # id - ID number from the database # type - Differs depending on tag (see specific tag for information) # filename - A filename from the Graphics/Characters folder #============================================================================== class State #-------------------------------------------------------------------------- # ++ State Affliction Wait Sequence Settings #-------------------------------------------------------------------------- # When a battler is affected by a state, their Wait/Idle sequence will be # replaced by the Action Sequence defined for the State IDs below. Only one # State Affliction Wait Animation can be active at a time. The state with the # highest Priority rating will take precedence if affected by multiple states. # # when 1 <- State ID number # return "DEAD" <- Action Sequence when afflicted by specified state. # # Notetag: <action: key> def base_action case @id when 1 # Incapacitated(HP0). Has the highest priority. return "DEAD" when 2,3,4,5,7,8 return "WAIT-DEBUFF" when 6 return "WAIT-SLEEP" when 17 return "WAIT-FLOAT" end # Default Action Sequence for all unassigned State IDs. return "WAIT" end #-------------------------------------------------------------------------- # ++ State Enhancement Extension Settings #-------------------------------------------------------------------------- # Note about REFLECT and NULL states: # An item/skill is considered physical if "Physical Attack" is # checked under "Options" in your Database. Otherwise, it is magical. # # "AUTOLIFE/50" - Automatically revives when Incapacitated. # Value after "/" is % of MAXHP restored when revived. # "MAGREFLECT/39" - Reflects magical skills to the original caster. # Value after "/" is Animation ID when triggered. # "MAGNULL/39" - Nullify magical skills and effects. # Value after "/" is Animation ID when triggered. # "PHYREFLECT/39" - Reflects physical skills to the original caster. # Value after "/" is Animation ID when triggered. # "PHYNULL/39" - Nullify physical skills and effects. # Value after "/" is Animation ID when triggered. # "COSTABSORB" - Absorbs the MP (or HP) cost of an incoming skill when # affected. This will not appear as POP Damage. This # function is similar to Celes' "Runic" from FF6. # "ZEROTURNLIFT" - State is lifted at the end of turn regardless. # "EXCEPTENEMY" - Enemies will not use Action Sequence assigned # under State Affliction Wait Animation Settings when # afflicted. (Actors still will.) # "NOPOP" - State name will not appear as POP Window. # "NOSTATEANIME" - State's caster and enemies will not use animation # sequence assigned under State Affliction Wait Sequence # Settings when afflicted. # "SLIPDAMAGE" - Apply slip damage. Assign values under Slip Damage Settings. # "NONE" - No extension. Used as a default. def extension case @id when 1 # Incapacitated State. Has highest priority. return ["NOPOP","EXCEPTENEMY"] when 18 # 2-Man Tech return ["ZEROTURNLIFT"] when 19 # 4-Man Tech return ["ZEROTURNLIFT"] when 20 # Cat Transformation return ["NOSTATEANIME"] end # Default extensions for all unassigned State IDs. return ["NONE"] end #-------------------------------------------------------------------------- # ++ Slip Damage Settings #-------------------------------------------------------------------------- # Also includes regeneration options. # # when 1 <- State ID. Slip Damage only applies if "SLIPDAMAGE" is assigned above. # Multiple settings may be applied. Ex)[["hp",0,5,true],["mp",0,5,true]] # # Type, Constant, %, POP?, Allow Death # return [["hp", 0, 10, true, true]] # # Type – "hp" or "mp". # Constant – Set a constant value to apply each turn. # Positive values are damage. Negative values are recovery. # % - Set a percentage value to apply each turn based on MAX HP/MP. # Positive values are damage. Negative values are recovery. # POP? - Determines whether or not you want slip damage value to # appear as POP Damage. # Allow Death - This function is not working - true: Slip damage can kill. # false: Slip damage will not kill. (Battler will be left at 1 HP) # # Notetags: <slip: hp/mp, value, value%> # <cannot kill> (Optional) # <cannot pop> (Optional)
def slip_extension case @id when 2 # Poison return [["hp", 0, 10, true, true]] end return [] end end #============================================================================== # * module RPG #------------------------------------------------------------------------------ # Weapon Action Settings # # Notetags are available for use if using the Notetags for Tankentai Add-on. # # Terms: # key - Refers to the name of an action sequence key. # Do not use quotation marks for notetags. # value - A numerical value # value% - A numerical value used as a percentage of something, but # the percent sign is usually optional # id - ID number from the database # type - Differs depending on tag (see specific tag for information) # filename - A filename from the Graphics/Characters folder #============================================================================== class Weapon #-------------------------------------------------------------------------- # ++ Weapon Action Sequence Settings #-------------------------------------------------------------------------- # Assigns a specific Action Sequence when using a weapon. # # when 1 <- Weapon ID number # return "NORMAL_ATTACK" <- Action Sequence for assigned Weapon ID. # # Notetag: <action: key> def base_action case @id when 1 return "NORMAL_ATTACK" end # Default Action Sequence for unassigned Weapon IDs. return "NORMAL_ATTACK" end #-------------------------------------------------------------------------- # ++ Weapon Graphic Settings #-------------------------------------------------------------------------- # Allows use of a seperate weapon graphic besides the one assigned # from Iconset.png # # return "001-Weapon01" <- Weapon image file name. If "", none is used. # File must be in the .Graphics/Characters folder # of your project. # # Notetag: <graphic: filename> def graphic case @id when 1 return "" end # Default weapon graphic for unassigned Weapon IDs. return "" end #-------------------------------------------------------------------------- # ++ Throwing Weapon Graphic Settings #-------------------------------------------------------------------------- # Allows use of a seperate throwing weapon graphic besides the one assigned # from Iconset.png. This is useful for arrows when you don't want the bow # to be thrown. # # Flying Graphics can only be utilized through use of Moving Animation # hashes. # # return "001-Weapon01" <- Weapon image file name. If "", none is used. # File must be in the .Graphics/Characters folder # of your project. # # Notetags: <flygraphic: filename> def flying_graphic case @id when 1 return "" end # Default throwing weapon graphic for unassigned Weapon IDs. return "" end end #============================================================================== # * module RPG #------------------------------------------------------------------------------ # Skill Settings # # Notetags are available for use if using the Notetags for Tankentai Add-on. # # Terms: # key - Refers to the name of an action sequence key. # Do not use quotation marks for notetags. # value - A numerical value # value% - A numerical value used as a percentage of something, but # the percent sign is usually optional # id - ID number from the database # type - Differs depending on tag (see specific tag for information) # filename - A filename from the Graphics/Characters folder #============================================================================== class Skill #-------------------------------------------------------------------------- # ++ Skill Action Sequence Settings #-------------------------------------------------------------------------- # Assign a Skill ID from the Database to execute a defined Action Sequence. # Only Action Sequence keys can be assigned. ANIME keys cannot # be directly assigned here. # # Notetag: <action: key> def base_action =begin case @id when 84 # Skill ID return "THROW_WEAPON" # Action Sequence Key when 85 return "MULTI_ATTACK" when 86 return "RAPID_MULTI_ATTACK" when 87 return "MULTI_SHOCK" when 88 return "SHOCK_WAVE" when 3 return "MULTI_ATTACK_RAND 3x" when 2 return "MULTI_ATTACK_RAND 2x" 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_ATK_RALPH" when 99 return "2-MAN_ATK_ASSIST" when 100 return "4-MAN_ATK-RALPH" when 101 return "4-MAN_ATK_ASSIST" when 102 return "4-MAN_ATK_ASSIST" when 103 return "4-MAN_ATK_ASSIST" when 104 return "THROW_FRIEND" when 100 return "CHEM LOAN XA" when 98 return "THUONG" when 99 return "THUONG 2" when 97 return "THUONG 2" when 1 return "DANH 2x"
end =end # Default Action Sequence for unassigned Skill IDs. return "SKILL_USE" end #-------------------------------------------------------------------------- # ++ Skill Extension Settings #-------------------------------------------------------------------------- # Allows you to add special effexts to skills. # Multiple extensions may be applied to a skill ID. # # "PERFECTHIT" -Skill cannot miss or be evaded. # "IGNOREREFLECT" -Ignores damage reflection states. # "HELPHIDE" -Help window when casting will not appear. # "TARGETALL" -Will affect all enemies and allies simultaneously. # "RANDOMTARGET" -Target is chosen at random. Set "Scope" to All Enemies # or All Allies for this to work correctly. # "OTHERS" -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" -Used as a default. def extension case @id when 86 # Skill ID return ["NOOVERKILL"] # Extensions when 89 return ["RANDOMTARGET"] when 94 return ["NOOVERKILL"] when 96 return ["TARGETALL"] when 98 return ["NOOVERKILL"] when 99 return ["HELPHIDE","NOFLASH"] when 100 return ["NOOVERKILL"] when 101 return ["HELPHIDE","NOFLASH"] when 102 return ["HELPHIDE","NOFLASH"] when 103 return ["HELPHIDE","NOFLASH"] end # Default extensions for unassigned Skill IDs. return ["NONE"] end #-------------------------------------------------------------------------- # ++ Skill Flying Graphic Settings #-------------------------------------------------------------------------- # Allows use of a seperate throwing weapon graphic besides the one assigned # from Iconset.png. # # Flying Graphics can only be utilized through use of Moving Animation # hashes. # # return "001-Weapon01" <- Weapon image file name. If "", none is used. # File must be in the .Graphics/Characters folder # of your project. # # Notetag: <flygraphic: filename> def flying_graphic case @id when 1 return "" end # Default throwing skill graphic for unassigned Weapon IDs. return "" end end #============================================================================== # * module RPG #------------------------------------------------------------------------------ # Item Action Settings # # Notetags are available for use if using the Notetags for Tankentai Add-on. # # Terms: # key - Refers to the name of an action sequence key. # Do not use quotation marks for notetags. # value - A numerical value # value% - A numerical value used as a percentage of something, but # the percent sign is usually optional # id - ID number from the database # type - Differs depending on tag (see specific tag for information) # filename - A filename from the Graphics/Characters folder #============================================================================== class Item #-------------------------------------------------------------------------- # ++ Item ID Sequence Assignment #-------------------------------------------------------------------------- # Assign an Item ID from the Database to execute a defined Action Sequence. # Only Action Sequence keys can be assigned. ANIME keys cannot # be directly assigned here. # # Notetag: <action: key> def base_action case @id when 1 # Item ID return "ITEM_USE" # Action Sequence Key end # Default Action Sequence for unassigned Item IDs. return "ITEM_USE" end #-------------------------------------------------------------------------- # ++ Item Enhancement Extension Settings #-------------------------------------------------------------------------- # Allows you to add special effexts to skills. # Multiple extensions may be applied to a skill ID. # # "PERFECTHIT" -Item cannot miss or be evaded. # "IGNOREREFLECT" -Ignores damage reflection states. # "HELPHIDE" -Help window when casting will not appear. # "TARGETALL" -Will affect all enemies and allies simultaneously. # "RANDOMTARGET" -Target is chosen at random. Set "Scope" to All Enemies # or All Allies for this to work correctly. # "OTHERS" -Item will not affect caster. # "NOOVERKILL" -Damage will not be applied after the target reaches zero HP. # "NOFLASH" -Battler will not flash when taking action. def extension case @id when 1 # Item ID return ["IGNOREREFLECT"] # Extensions end # Default extensions for unassigned Item IDs. return ["IGNOREREFLECT"] end #-------------------------------------------------------------------------- # ++ Item Flying Graphic Settings #-------------------------------------------------------------------------- # Allows use of a seperate throwing weapon graphic besides the one assigned # from Iconset.png. # # Flying Graphics can only be utilized through use of Moving Animation # hashes. # # return "001-Weapon01" <- Weapon image file name. If "", none is used. # File must be in the .Graphics/Characters folder # of your project. # # Notetag: <flygraphic: key> def flying_graphic case @id when 1 return "" end # Default throwing skill graphic for unassigned Weapon IDs. return "" end end end
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:33
Đây là script 3 đây là phần 1 tí các bạn add thêm phần 2 vào phía sau chung 1 script nhé - Sideview 1 (3.4d):
Code:
#============================================================================== # ■ Sprite_Battler for Sideview Ver3.4d #------------------------------------------------------------------------------ # This sprite is used to display battlers. It observes a instance of the # Game_Battler class and automatically changes sprite conditions. #============================================================================== class Sprite_Battler < Sprite_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(viewport, battler = nil) super(viewport) @battler = battler @battler_visible = false @effect_type = 0 # Effect type @effect_duration = 0 # Effect duration @move_x = 0 # X-coord movement @move_y = 0 # Y-coord movement @move_z = 0 # Z priority @distanse_x = 0 # X distance (to another point) @distanse_y = 0 # Y distance (to another point) @moving_x = 0 # X distance travelled per frame @moving_y = 0 # Y distance travelled per frame @move_speed_x = 0 # X movement speed @move_speed_y = 0 # Y movement speed @move_speed_plus_x = 0 # Added X speed during movement @move_speed_plus_y = 0 # Added Y speed during movement @move_boost_x = 0 # X acceleration @move_boost_y = 0 # Y acceleration @jump_time = 0 # Jump duration @jump_time_plus = 0 # Added jump duration @jump_up = 0 # Jump up @jump_down = 0 # Jump down @jump_size = 0 # jump height @float_time = 0 # Float time @float_up = 0 # Float movement per frame @jump_plus = 0 # Battler shadow position while jumping @angle = 0 # Angle of rotation (of battler sprite) @angling = 0 # Angle of rotation per frame @angle_time = 0 # Angle duration @angle_reset = 0 # Angle reset check @zoom_x = 0 # X zoom (of battler sprite) @zoom_y = 0 # Y zoom @zooming_x = 0 # X zoom adjusted per frame @zooming_y = 0 # Y zoom adjusted per frame @zoom_time = 0 # Duration of zoom @zoom_reset = 0 # Zoom reset check @target_battler = [] # Battler targets @now_targets = [] # Memorized/Stored targets @pattern = 0 # Row of battler file @pattern_back = false # Row loop flag @wait = 0 # Delay (before next operation) @unloop_wait = 0 # Delay end of a non-looped battler row @action = [] # Action @anime_kind = 0 # Vertical frame position of battler file @anime_speed = 0 # Battler frame update speed @frame = 0 # Frame update time that is removed @anime_loop = 0 # Loop type @anime_end = false # Did battler animation end? @anime_freeze = false # Fixed animation? @anime_freeze_kind = false # Fixed frame position? @anime_moving = false # Throwing animation? @base_width = N01::ANIME_PATTERN # Horizontal frames in battler file @base_height = N01::ANIME_KIND # Vertical frames in battler file @width = 0 # Pixel width of battler frame @height = 0 # Pixel height of battler frame @picture_time = 0 # Cut-in picture duration @individual_targets = [] # Preserve targets for individual processing @balloon_duration = 65 # Balloon duration @reverse = false # Mirror animation flag # end if battler does not exist return @battler_visible = false if @battler == nil # Animated battler flag @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 # 歩行グラフィックを利用するかどうかで転送元の矩形サイズの認識先を変える if @battler_hue != nil ## blackmorning unofficial code; 3.3c self.bitmap = Cache.character(@battler_name, @battler_hue) if N01::WALK_ANIME self.bitmap = Cache.character(@battler_name + "_1", @battler_hue) unless N01::WALK_ANIME else self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME end ## End blackmorning unofficial code; 3.3c # 転送元の矩形を取得 @width = self.bitmap.width / @base_width @height = self.bitmap.height / @base_height # 矩形を設定 @sx = @pattern * @width @sy = @anime_kind * @height # バトラー本体を描画 self.src_rect.set(@sx, @sy, @width, @height) # アニメしないバトラーの場合 else # ビットマップを取得、設定 @battler_name = @battler.battler_name self.bitmap = Cache.battler(@battler_name, @battler_hue) @width = bitmap.width @height = bitmap.height end # バックアタック時には画像を反転させる if $back_attack && @battler.actor? self.mirror = true elsif $back_attack && !@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 #-------------------------------------------------------------------------- # ● Damage Action action = [animation ID, mirror flag, allow reaction] #-------------------------------------------------------------------------- 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 || @battler.missed || 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 || @battler.missed start_action(@battler.evasion) if action[2] Sound.play_evasion end @damage.damage_pop unless absorb || 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 #-------------------------------------------------------------------------- # ● Start Action #-------------------------------------------------------------------------- def start_action(kind) # Initializes various operations reset # 現在取っている待機アクションを記憶 stand_by begin @action = N01::ACTION[kind].dup rescue p ("An error has occurred.", "Action Sequence Key #{kind} does not exist.", "Define it first or make sure it is spelled correctly.") exit end # 新しいアクション内容の決定 # 行動配列の先頭からシフト 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 # Set battler normal wait action sequence @repeat_action = @battler.normal # Set battler 1/4th HP (pinch) action sequence @repeat_action = @battler.pinch if @battler.hp <= @battler.maxhp / 4 # Set battler guard action sequence @repeat_action = @battler.defence if @battler.guarding? # end if battler has no states and not dead return if @battler.state_id == nil && !@battler.dead? for state in @battler.states.reverse # Next state if battler shouldn't run a state action sequence. next if state.extension.include?("NOSTATEANIME") # Next state if enemy shouldn't run a state action sequence. next if @battler.is_a?(Game_Enemy) && state.extension.include?("EXCEPTENEMY") # Set battler state affliction action sequence @repeat_action = state.base_action end # Set actor incapacitated action sequence dead_action = @battler.incapacitated @repeat_action = dead_action if (@battler.dead? && @anime_flug) && dead_action != "" end #-------------------------------------------------------------------------- # ● Push Stand By (Interrupt Wait Action) #-------------------------------------------------------------------------- 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 state if battler shouldn't run a state action sequence. next if state.extension.include?("NOSTATEANIME") # Next state if enemy shouldn't run a state action sequence. next if @battler.is_a?(Game_Enemy) && state.extension.include?("EXCEPTENEMY") # Set battler state affliction action sequence action = state.base_action end dead_action = @battler.incapacitated action = dead_action if (@battler.dead? && @anime_flug) && dead_action != "" @repeat_action = action # Interrupt @action.delete("End") act = N01::ACTION[action].dup for i in 0...act.size @action.push(act[i]) 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 #-------------------------------------------------------------------------- # ++ Update Transfer Origin Bitmap #-------------------------------------------------------------------------- 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 # 3.4a restored original bitmap update # Bitmap updates itself when enemy transforms if !@battler.anime_on self.bitmap = Cache.battler(@battler_name, @battler_hue) @width = bitmap.width @height = bitmap.height self.ox = @width / 2 self.oy = @height * 2 / 3 make_shadow end end if !@battler.exist? self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1 end end end #-------------------------------------------------------------------------- # ● Action Processing #-------------------------------------------------------------------------- def action return if @active_action == nil action = @active_action[0] # Invert battler sprite return mirroring if action == "Invert" # Rotate battler sprite return angling if action == "angle" # Zoom battler sprite return zooming if action == "zoom" # Afterimage effects ON return mirage_on if action == "Afterimage ON" # Afterimage effects OFF return mirage_off if action == "Afterimage OFF" # Display picture return picture if action == "pic" # Delete displayed picture return @picture.visible = false && @picture_time = 0 if action == "Clear image" # Change battler graphic return graphics_change if action == "change" # Display battle animations return battle_anime if action == "anime" # Animated balloon display return balloon_anime if action == "balloon" # Play BGM/BGS/SE return sound if action == "sound" # Game Switch operation return $game_switches[@active_action[1]] = @active_action[2] if action == "switch" # Game Variable operation return variable if action == "variable" # if battler has two weapons, execute next defined ANIME key return two_swords if action == "Two Wpn Only" # if battler has one weapon, execute next defined ANIME key return non_two_swords if action == "One Wpn Only" # Determine necessary conditions and continues sequence or not. return necessary if action == "nece" # Execute skill from within another skill. return derivating if action == "der" # Start individual processing of actions on target objects return individual_action if action == "Process Skill" # End individual processing of actions return individual_action_end if action == "Process Skill End" # 待機に移行しない場合 return non_repeat if action == "Don't Wait" # Change Start Position of battlers return @battler.change_base_position(self.x, self.y) if action == "Start Pos Change" # Revert to original start position coordinates return @battler.base_position if action == "Start Pos Return" # Change target objects return change_target if action == "target" # Allow collapse of targets. return send_action(action) if action == "Can Collapse" # Cancel active action return send_action(action) if action == "Cancel Action" # Add state to target objects return state_on if action == "sta+" # Remove state from target objects return state_off if action == "sta-" # Change game frame rate return Graphics.frame_rate = @active_action[1] if action == "fps" # Float battler sprite from shadow return floating if action == "float" # Run string through eval() method return eval(@active_action[1]) if action == "script" # Force battler actions of non-active battlers return force_action if @active_action.size == 4 # Reset battlers to start coordinates return reseting if @active_action.size == 5 # Move battler sprites return moving if @active_action.size == 7 # Determines battler frame animation return battler_anime if @active_action.size == 9 # Move database animation on screen return moving_anime if @active_action.size == 11 # "End" 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 # Limit method to actors only 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 #-------------------------------------------------------------------------- # ● Show Battle Animation [判別,ID, target, mirror, wait, Weapon 2 flag] #-------------------------------------------------------------------------- def battle_anime # return if enemy and processing animation for Weapon 2 return if @active_action[5] && !@battler.actor? # return if trying to process Weapon 2 animation with no Weapon 2 equipped. return if @active_action[5] && @battler.weapons[1] == nil # return if actor has Weapon 2 equipped, but not Weapon 1 if @battler.actor? return if !@active_action[5] && @battler.weapons[0] == nil && @battler.weapons[1] != nil end anime_id = @active_action[1] # 3.4a properly mirror animations if enemy is manually set to be mirroed if @battler.is_a?(Game_Enemy) mirror = false mirror = true if @battler.action_mirror end # Mirror animation when in back attack if $back_attack mirror = true if !@active_action[3] # 3.4a mirror = false if @active_action[3] || (@battler.is_a?(Game_Enemy) && @battler.action_mirror) # 3.4a end # 3.4c # Damage with no animation if anime_id == -3 # No animation if anime ID is -3 anime_id = 0 # ダメージ表示のアニメなら、ダメージ計算を先に済ませるため処理を中断 damage_action = [anime_id, mirror, true] return @battler.play = ["OBJ_ANIM",damage_action] if @battler.active end # For skill, item, and weapon animations if anime_id < 0 # Branches from here depending on type of action if @battler.action.skill? && anime_id != -2 ### UNOFFICAL CODE v3.3b ### anime_id = @battler.action.skill.animation_id unless @battler.action.skill.animation_id == -1 if @battler.action.skill.animation_id == -1 anime_id = N01::NO_WEAPON if @battler.actor? weapon_id = @battler.weapon_id anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0 anime_id = @battler.atk_animation_id2 if @active_action[5] else weapon_id = @battler.weapon anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0 end end elsif @battler.action.item? && anime_id != -2 anime_id = 0 anime_id = @battler.action.item.animation_id unless @battler.action.item.animation_id == -1 if @battler.action.item.animation_id == -1 anime_id = N01::NO_WEAPON weapon_id = @battler.weapon_id anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0 anime_id = @battler.atk_animation_id2 if @active_action[5] end ### UNOFFICIAL CODE v3.3b END ### else # Unarmed attack animation 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 # For Two Swords Style animation 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 # Set wait value, temporarily delays action sequence processing @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 && @active_action[1] != -4 # 3.4a end # アニメ実行 if @active_action[2] == 0 && $data_animations[anime_id] != nil @battler.animation_id = anime_id @battler.animation_mirror = mirror elsif $data_animations[anime_id] != nil for target in @target_battler target.animation_id = anime_id target.animation_mirror = mirror end end # ウエイト設定 @wait = $data_animations[anime_id].frame_max * 4 if $data_animations[anime_id] != nil && @active_action[4] && !waitflug end #-------------------------------------------------------------------------- # ● ふきだしアニメ表示 #-------------------------------------------------------------------------- def balloon_anime return if self.opacity == 0 if @balloon == nil @balloon = Sprite.new @balloon.bitmap = Cache.system(N01::BALLOON_GRAPHICS) # v3.3a @balloon.ox = @width / 16 @balloon.oy = @balloon.height / 10 + @height / 3 end @balloon_id = @active_action[1] @balloon_loop = @active_action[2] @balloon_duration = 64 @balloon_back = false update_balloon @balloon.visible = true end #-------------------------------------------------------------------------- # ● BGM/BGS/SE演奏 #-------------------------------------------------------------------------- def sound # 情報を取得 pitch = @active_action[2] vol = @active_action[3] name = @active_action[4] # 実行 case @active_action[1] when "se" Audio.se_play("Audio/SE/" + name, vol, pitch) when "bgm" # 名前指定のない場合、現在のBGMを変えないように if @active_action[4] == "" now_bgm = RPG::BGM.last name = now_bgm.name end Audio.bgm_play("Audio/BGM/" + name, vol, pitch) when "bgs" # 名前指定のない場合、現在のBGSを変えないように if @active_action[4] == "" now_bgs = RPG::BGS.last name = now_bgs.name end Audio.bgs_play("Audio/BGS/" + name, vol, pitch) end end #-------------------------------------------------------------------------- # ● ゲーム変数操作 #-------------------------------------------------------------------------- def variable # オペランドチェック operand = @active_action[3] # 変数操作で分岐 case @active_action[2] when 0 # 代入 $game_variables[@active_action[1]] = operand when 1 # 加算 $game_variables[@active_action[1]] += operand when 2 # 減算 $game_variables[@active_action[1]] -= operand when 3 # 乗算 $game_variables[@active_action[1]] *= operand when 4 # 除算 $game_variables[@active_action[1]] /= operand when 5 # 剰余 $game_variables[@active_action[1]] %= operand end end #-------------------------------------------------------------------------- # ● 二刀限定 #-------------------------------------------------------------------------- def two_swords # エネミーは処理させない return @action.shift unless @battler.actor? # 左(下部表示)に武器がなかったら次のアクションを除く return @action.shift if @battler.weapons[1] == nil # 行動配列の先頭からシフト active = @action.shift # 現在のアクションを決定 @active_action = N01::ANIME[active] # ウエイト設定 @wait = active.to_i if @active_action == nil # 単発アクション開始 action end #-------------------------------------------------------------------------- # ● 非二刀限定 #-------------------------------------------------------------------------- def non_two_swords # エネミーは処理させない return unless @battler.actor? # 左(下部表示)に武器があったら次のアクションを除く return @action.shift if @battler.weapons[1] != nil # 行動配列の先頭からシフト active = @action.shift # 現在のアクションを決定 @active_action = N01::ANIME[active] # ウエイト設定 @wait = active.to_i if @active_action == nil # 単発アクション開始 action end #-------------------------------------------------------------------------- # ● アクション条件 #-------------------------------------------------------------------------- def necessary nece1 = @active_action[3] nece2 = @active_action[4] # ターゲットチェック case @active_action[1] # 0自身 1ターゲット 2敵全体 3味方全体 when 0 target = [$game_party.members[@battler.index]] if @battler.is_a?(Game_Actor) target = [$game_troop.members[@battler.index]] if @battler.is_a?(Game_Enemy) when 1 target = @target_battler when 2 target = $game_troop.members when 3 target = $game_party.members end # ターゲットが空の場合は失敗とみなす return start_action(@battler.recover_action) if target.size == 0 # 内容チェック case @active_action[2] # ステートID指定だった場合 when 0 # 補足が正で「ステートにかかっている」、負は「かかっていない」が条件に state_on = true if nece2 > 0 # 条件人数を出す state_member = nece2.abs # 0は仲間数を出す if nece2 == 0 state_member = $game_party.members.size if @battler.is_a?(Game_Actor) state_member = $game_troop.members.size if @battler.is_a?(Game_Enemy) end # ターゲットのステートチェックし人数をカウント for member in target state_member -= 1 if member.state?(nece1) end # 条件が満たされていればアクション続行 if state_member == 0 && state_on return
Được sửa bởi duongtiep ngày 2/2/2011, 09:35; sửa lần 1.
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:34
Phần 2 của script 3 (Các bạn add vô phía sau script trên)
Code:
elsif state_member == nece2.abs return if state_on == nil end # パラメータ指定だった場合 when 1 # 補足が正で「数値以上」、負は「数値以下」が条件に num_over = true if nece2 > 0 # 参照数値 num = 0 # ターゲットのパラメータチェック for member in target # 参照パラメータで分岐 case nece1 when 0 # 現HP num += member.hp when 1 # 現MP num += member.mp when 2 # 攻撃力 num += member.atk when 3 # 防御力 num += member.def when 4 # 精神力 num += member.spi when 5 # 敏捷性 num += member.agi end end # 平均を出す num = num / target.size # 条件が満たされていればアクション続行 if num > nece2.abs && num_over return elsif num < nece2.abs return if num_over == nil end # スイッチ指定だった場合 when 2 # 条件が満たされていればアクション続行 if $game_switches[nece1] # 補足がtrueで「スイッチON」、falseは「スイッチOFF」が条件に return if nece2 # スイッチがOFFの場合はON時とは逆に else return unless nece2 end # 変数指定だった場合 when 3 # 補足が正で「数値以上」、負は「数値以下」が条件に if nece2 > 0 return if $game_variables[nece1] > nece2 else return unless $game_variables[nece1] > nece2.abs end # 習得スキル指定だった場合 when 4 # スキル条件人数を出す skill_member = nece2.abs for member in target skill_member -= 1 if member.skill_learn?(nece1) # 条件確認 return if skill_member == 0 end end # 条件を満たせなければ以降のアクションを中断 return @action = ["End"] if @non_repeat # 防御中は不自然に見えないように座標復帰させない action = @battler.recover_action action = @battler.defence if @battler.guarding? return start_action(action) end #-------------------------------------------------------------------------- # ● Derivating skills (link skills) #-------------------------------------------------------------------------- def derivating # Redefined 1.1e return if $game_party.all_dead? or $game_troop.all_dead? skill = $data_skills[@active_action[3]] # retrive actual skill # test for skill learning. If not learned and link is not set, stop here return if @battler.actor? && !@battler.skill_learn?(skill) && !@active_action[2] # this takes the actual skill object return unless @battler.skill_can_use?(skill) # test if skill can be used # skill fails if the random number is below the given chance return if rand(100) > @active_action[1] # sets the derivation @battler.derivation = @active_action[3] # sets the current action to ["End"] @action = ["End"] end #-------------------------------------------------------------------------- # ● 個別処理開始 #-------------------------------------------------------------------------- def individual_action # リピートフラグオン @battler.individual = true # リピートアクションを保持 @individual_act = @action.dup # ターゲットを保持し、行動ターゲットをひとつずつ抜き出す send_action(["Individual"]) @individual_targets = @target_battler.dup @target_battler = [@individual_targets.shift] end #-------------------------------------------------------------------------- # ● 個別処理終了 #-------------------------------------------------------------------------- def individual_action_end # ターゲットが残っていないなら行動終了 return @battler.individual = false if @individual_targets.size == 0 @action = @individual_act.dup @target_battler = [@individual_targets.shift] end #-------------------------------------------------------------------------- # ● 待機に移行しない #-------------------------------------------------------------------------- def non_repeat @repeat_action = [] @non_repeat = true anime_finish end #-------------------------------------------------------------------------- # ● ターゲット変更 action = [判別, 変更する対象, 変更先] #-------------------------------------------------------------------------- def change_target # 自身の変更したターゲットを元に戻す return @target_battler = @now_targets.dup if @active_action[2] == 3 # 送るターゲット情報 target = [@battler] if @active_action[2] == 0 target = @target_battler.dup if @active_action[2] != 0 # 自身のターゲットを送った相手にする場合、現在のターゲットを記憶 if @active_action[2] == 2 @now_targets = @target_battler.dup @target_battler = [] end # 送るターゲットがインデックス指定の場合 if @active_action[1] >= 1000 members = $game_party.members if @battler.actor? members = $game_troop.members unless @battler.actor? index = @active_action[1] - 1000 if index < members.size if members[index].exist? && @battler.index != index # ターゲット変更 members[index].force_target = ["N01target_change", target] # 自身のターゲットを送った相手にする場合 @target_battler = [members[index]] if @active_action[2] == 2 change = true else for member in members next if @battler.index == member.index next unless member.exist? member.force_target = ["N01target_change", target] @target_battler = [member] if @active_action[2] == 2 break change = true end end end # 送るターゲットがステートID指定だった場合 elsif @active_action[1] > 0 for member in $game_party.members + $game_troop.members if member.state?(@active_action[1]) member.force_target = ["N01target_change", target] @target_battler.push(member) if @active_action[2] == 2 change = true end end # 送るターゲットが習得スキル指定だった場合 elsif @active_action[1] < 0 skill_id = @active_action[1].abs for actor in $game_party.members if actor.skill_id_learn?(skill_id) actor.force_target = ["N01target_change", target] @target_battler.push(target) if @active_action[2] == 2 change = true end end # 送るターゲットがターゲットだった場合 else for member in @target_battler member.force_target = ["N01target_change", target] @target_battler.push(member) if @active_action[2] == 2 change = true end end # 条件を満たせなければ以降のアクションを中断 return if change return @action = ["End"] if @non_repeat return start_action(@battler.recover_action) end #-------------------------------------------------------------------------- # ● ステート付与 #-------------------------------------------------------------------------- def state_on state_id = @active_action[2] # 対象で分岐 case @active_action[1] when 0 @battler.add_state(state_id) if rand(100) < @battler.state_probability(state_id) when 1 if @target_battler != nil for target in @target_battler target.add_state(state_id) if rand(100) < target.state_probability(state_id) end end when 2 for target in $game_troop.members target.add_state(state_id) if rand(100) < target.state_probability(state_id) end when 3 for target in $game_party.members target.add_state(state_id) if rand(100) < target.state_probability(state_id) end when 4 for target in $game_party.members if target.index != @battler.index target.add_state(state_id) if rand(100) < target.state_probability(state_id) end end end end #-------------------------------------------------------------------------- # ● ステート解除 #-------------------------------------------------------------------------- def state_off state_id = @active_action[2] # 対象で分岐 case @active_action[1] when 0 @battler.remove_state(state_id) when 1 if @target_battler != nil for target in @target_battler target.remove_state(state_id) end end when 2 for target in $game_troop.members target.remove_state(state_id) end when 3 for target in $game_party.members target.remove_state(state_id) end when 4 for target in $game_party.members if target.index != @battler.index target.remove_state(state_id) end end end end #-------------------------------------------------------------------------- # ● 浮遊実行 #-------------------------------------------------------------------------- def floating # ジャンプを初期化 jump_reset # 情報確認 @jump_plus = @active_action[1] float_end = @active_action[2] @float_time = @active_action[3] # 1フレーム当たりの移動高度を計算 @float_up = (float_end - @jump_plus)/ @float_time # 浮遊が完了するまで次のアクションに行かない @wait = @float_time # 浮遊アニメ設定を反映 if @anime_flug move_anime = N01::ANIME[@active_action[4]] # グラフィック指定がない場合はスキップ if move_anime != nil # 現在のアクションを上書き @active_action = move_anime # バトラーアニメ開始 battler_anime # 浮遊が完了したら即アニメが終わるように @anime_end = true end end # 初期高度に浮遊 @battler.jump = @jump_plus end #-------------------------------------------------------------------------- # ● 強制アクション #-------------------------------------------------------------------------- def force_action # アクションが単発か通しか判別 kind = @active_action[0] # 復帰の有無をチェック rebirth = @active_action[2] # 強制アクション内容を取得 play = @active_action[3] # 上3つの情報をまとめて格納 action = [kind,rebirth,play] # ターゲットがインデックス指定の場合 if @active_action[1] >= 1000 members = $game_party.members if @battler.actor? members = $game_troop.members unless @battler.actor? index = @active_action[1] - 1000 if index < members.size if members[index].exist? && @battler.index != index # バトラー情報に渡す return members[index].force_action = action else for target in members next if @battler.index == target.index next unless target.exist? force = true break target.force_action = action end end end # 条件を満たせなければ以降のアクションを中断 return if force return @action = ["End"] if @non_repeat return start_action(@battler.recover_action) # ターゲット指定の場合 elsif @active_action[1] == 0 for target in @target_battler target.force_action = action if target != nil end # ステートID指定だった場合 elsif @active_action[1] > 0 for target in $game_party.members + $game_troop.members target.force_action = action if target.state?(@active_action[1]) end # 習得スキル指定だった場合 elsif @active_action[1] < 0 # エネミーは処理させない return if @battler.is_a?(Game_Enemy) for actor in $game_party.members # 自分は除く unless actor.id == @battler.id # バトラー情報に渡す actor.force_action = action if actor.skill_id_learn?(@active_action[1].abs) end end end end #-------------------------------------------------------------------------- # ● 座標リセット実行 #-------------------------------------------------------------------------- def reseting # ジャンプを初期化 jump_reset # 回転を元に戻す self.angle = 0 # 情報確認 @distanse_x = @move_x * -1 @distanse_y = @move_y * -1 @move_speed_x = @active_action[1] @move_speed_y = @move_speed_x @move_boost_x = @active_action[2] @move_boost_y = @move_boost_x @jump = @active_action[3] # 移動計算 move_distance # 移動アニメ設定を反映 if @anime_flug move_anime = N01::ANIME[@active_action[4]] # グラフィック指定がない場合はスキップ if move_anime != nil # 現在のアクションを上書き @active_action = move_anime # バトラーアニメ開始 battler_anime end # 移動が完了したら即アニメが終わるように @anime_end = true end end #-------------------------------------------------------------------------- # ● 移動実行 #-------------------------------------------------------------------------- def moving # Initialize jump values jump_reset # X-coordinate destination xx = @active_action[1] # Invert xx when in back attack xx *= -1 if $back_attack # Verify target of moving battler case @active_action[0] when 0 # Self @distanse_x = xx @distanse_y = @active_action[2] when 1 # Target # ターゲットが決まってない場合、自身に変換 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 # Screen # 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 # Start Position # 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 when 4 # Head 3.4b # ターゲットが決まってない場合、自身に変換 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 shift_y = @target_battler[i].graphics_height * 2 / 3 target_x += @target_battler[i].position_x target_y += @target_battler[i].position_y - shift_y # 3.4b 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 5 # Feet 3.4b # ターゲットが決まってない場合、自身に変換 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 shift_y = @target_battler[i].graphics_height / 3 target_x += @target_battler[i].position_x target_y += @target_battler[i].position_y + shift_y # 3.4b 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 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 #-------------------------------------------------------------------------- # ++ Battler Frame Animation Setup #-------------------------------------------------------------------------- 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 @battler.move_z = @active_action[6] # 影の有無 if @shadow != nil @shadow.visible = true if @active_action[7] @shadow.visible = false unless @active_action[7] end # ナンバリングから読み取るファイル名を分岐 if @active_action[0] == 0 file_name = @battler_name else file_name = @battler_name + "_" + @active_action[0].to_s end # アニメしないバトラーなら処理終了 return unless @anime_flug @battler_hue = @battler.battler_hue ## blackmorning unofficial code; 3.3c if @battler_hue != nil self.bitmap = Cache.character(file_name, @battler_hue) else self.bitmap = Cache.character(file_name) end ## end blackmorning unofficial code; 3.3c # 転送元の矩形を設定 @sx = @pattern * @width @sy = @anime_kind * @height @sx = @active_action[5] * @width if @anime_freeze self.src_rect.set(@sx, @sy, @width, @height) end #-------------------------------------------------------------------------- # ++ Moving Animations #-------------------------------------------------------------------------- def moving_anime # まだ前のアニメ飛ばしが残っているなら初期化 # If the previous animation exists, initialize actions @move_anime.action_reset if @anime_moving @anime_moving = true # Mirror when in a surprise encounter mirror = false mirror = true if $back_attack # Animation ID id = @active_action[1] # Object/Target target = @active_action[2] x = y = mem = 0 # If object is a single unit if target == 0 # ターゲットが決まってない場合、自身に変換 # If target is not decided, change target to self if @target_battler == nil x = self.x y = self.y else # ターゲットが空の場合、自身に変換 # If target is nil, change target to self if @target_battler[0] == nil x = self.x y = self.y else # 最初に入っているターゲットに対象決定 # If target is confirmed, get position x = @target_battler[0].position_x y = @target_battler[0].position_y end end # 対象が敵の中心の場合 # When the object/targets is a group of enemies elsif target == 1 # 自身がアクターの場合はエネミーの中心を計算 # Calculate the center position of the party 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 # 自身がエネミーの場合はアクターの中心を計算 # Calculate the center position of the enemy targets 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 # 対象が味方の中心の場合 # When the object/targets are a group of actors elsif target == 2 # 自身がアクターの場合はアクターの中心を計算 # Calculate center of actor party 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 # 自身がエネミーの場合はエネミーの中心を計算 # Calculate cetner of enemy troop 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 # Object is self else x = self.x y = self.y end # 開始位置の微調整 # Adjust position of animation plus_x = @active_action[6] plus_y = @active_action[7] # エネミーはX軸を逆に # x-axis is reversed for enemies plus_x *= -1 if @battler.is_a?(Game_Enemy) # 最終的な移動距離を算出 # Calculate distance from source to target distanse_x = x - self.x - plus_x distanse_y = y - self.y - plus_y # 飛ばしタイプ # Get animation pass-through value type = @active_action[3] # Speed of animation speed = @active_action[4] # 軌道 # Orbit/arc orbit = @active_action[5] # 自身が開始位置なら # If origin is self if @active_action[8] == 0 @move_anime.base_x = self.x + plus_x @move_anime.base_y = self.y + plus_y # 対象が開始位置なら # If origin is target 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 # 動かさないなら # If other origin else @move_anime.base_x = x @move_anime.base_y = y distanse_x = distanse_y = 0 end # 武器アクションなしは武器表示しない # Flying graphic is nothing if @active_action[10] == "" weapon = "" # アニメなしエネミーは武器表示しない # No flying graphic if not animated # elsif @anime_flug != true # 3.4a # weapon = "" ## 武器アクションがある場合 # If there is a weapon action else # 飛ばす武器グラフィックが指定されているかチェック # Check if weapon has a flying graphic 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 # スキル画像利用か武器画像利用か判別 # Determine use of equipped weapon graphic or other graphic weapon_act = N01::ANIME[@active_action[10]].dup if @active_action[10] != "" # 3.4a # Moved the priority of skill flying graphic use_skill_item_graphic = false # Set skill flying graphic, 3.4a if weapon_act != nil && @battler.action.skill != nil skill_flygraphic = $data_skills[@battler.action.skill.id].flying_graphic # If skill has flying graphic if skill_flygraphic.downcase == "icon" icon_weapon = true use_skill_item_graphic = true weapon = @active_action[10] weapon_name = $data_skills[@battler.action.skill.id].icon_index elsif skill_flygraphic != "" icon_weapon = false use_skill_item_graphic = true weapon = @active_action[10] weapon_name = skill_flygraphic end # Set item flying graphic, 3.4a elsif weapon_act != nil && @battler.action.item != nil item_flygraphic = $data_items[@battler.action.item.id].flying_graphic # if item has a flying graphic if item_flygraphic.downcase == "icon" icon_weapon = true use_skill_item_graphic = true weapon = @active_action[10] weapon_name = $data_items[@battler.action.item.id].icon_index elsif item_flygraphic != "" icon_weapon = false use_skill_item_graphic = true weapon = @active_action[10] weapon_name = item_flygraphic end end # 武器画像利用で素手でなければ # If user has a weapon, utilize graphics if weapon_id != 0 && weapon_act.size == 3 && !use_skill_item_graphic # 3.4a weapon_file = $data_weapons[weapon_id].flying_graphic weapon_file = "" if weapon_file.downcase == "icon" # 3.4a # If a flying graphic is not given, get weapon graphic if weapon_file == "" weapon_name = $data_weapons[weapon_id].graphic icon_weapon = false # さらに指定がなければアイコングラフィックを利用 # If weapon graphic is not found, get Iconset graphic. if weapon_name == "" weapon_name = $data_weapons[weapon_id].icon_index icon_weapon = true end # 指定されていればそのグラフィック名を取得 # If there is a specified graphics else icon_weapon = false weapon_name = weapon_file end # 武器アクション情報を取得 # Get weapon action weapon = @active_action[10] # 武器画像利用で素手なら表示しない elsif weapon_act.size == 3 && !use_skill_item_graphic # 3.4a 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 # 3.4a removed battler reset out if @effect_duration == 220 Audio.se_play("Audio/SE/Earth4", 100, 80) 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 if @effect_duration == 0 # 3.4a reset end end end
module Cache ## blackmorning unofficial Code 3.3c #-------------------------------------------------------------------------- # * Get Character Graphic # filename : Filename #-------------------------------------------------------------------------- def self.character(filename, hue = 0) load_bitmap("Graphics/Characters/", filename, hue) end end ## end unofficial Code 3.3c
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:36
Phần 1 script 4
Code:
#============================================================================== # ■ Scene_Battle for Sideview Ver3.4d #------------------------------------------------------------------------------ # バトル画面の処理を行うクラスです。 #============================================================================== 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) # 3.4a @help_window2.set_text_n01add(members[@index]) 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) # point is the screen coordinate of the target @cursor.x = point[0] # Cursor X @cursor.y = point[1] # Cursor Y @cursor_flame += 1 if Input.trigger?(Input::B) Sound.play_cancel end_target_selection break elsif Input.trigger?(Input::C) Sound.play_decision @active_battler.action.target_index = @index # if you get an error on this line, remove the Enemy Gauge Add-on script end_target_selection end_skill_selection end_item_selection next_actor break end if Input.repeat?(Input::LEFT) if actor cursor_down(members, actor) if $back_attack cursor_up(members, actor) unless $back_attack else cursor_up(members, actor) if $back_attack cursor_down(members, actor) unless $back_attack end end if Input.repeat?(Input::RIGHT) if actor cursor_up(members, actor) if $back_attack cursor_down(members, actor) unless $back_attack else cursor_down(members, actor) if $back_attack cursor_up(members, actor) unless $back_attack end end cursor_up(members, actor) if Input.repeat?(Input::UP) cursor_down(members, actor) if Input.repeat?(Input::DOWN) end end #-------------------------------------------------------------------------- # ● Move Cursor Target Up #-------------------------------------------------------------------------- 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 #-------------------------------------------------------------------------- # ● Move Cursor Target Down #-------------------------------------------------------------------------- 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 #-------------------------------------------------------------------------- # ● ターゲット選択の終了 #-------------------------------------------------------------------------- def end_target_selection @actor_command_window.active = true if @actor_command_window.index == 0 @skill_window.visible = true if @skill_window != nil @item_window.visible = true if @item_window != nil @cursor.dispose @cursor = nil if @help_window2 != nil @help_window2.dispose @help_window2 = nil end @help_window.visible = true if @help_window != nil end #-------------------------------------------------------------------------- # ● 逃走の処理 ※再定義 #-------------------------------------------------------------------------- def process_escape @info_viewport.visible = false @message_window.visible = true text = sprintf(Vocab::EscapeStart, $game_party.name) $game_message.texts.push(text) if $game_troop.preemptive success = true else success = (rand(100) < @escape_ratio) end Sound.play_escape # 動けないアクターを除いて逃走成功アクション if success for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.run_success) end end wait_for_message battle_end(1) # 動けないアクターを除いて逃走失敗アクション else for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.run_ng) end end @escape_ratio += 10 $game_message.texts.push('\.' + Vocab::EscapeFailure) wait_for_message $game_party.clear_actions start_main end end #-------------------------------------------------------------------------- # ● 勝利の処理 #-------------------------------------------------------------------------- alias process_victory_n01 process_victory def process_victory @status_window.visible = true @message_window.visible = false # ボスコラプスはウエイトを長く挟む for enemy in $game_troop.members break boss_wait = true if enemy.collapse_type == 3 end wait(440) if boss_wait wait(N01::WIN_WAIT) unless boss_wait # 動けないアクターを除いて勝利アクション for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.win) end end process_victory_n01 end #-------------------------------------------------------------------------- # ● 戦闘処理の実行開始 ※再定義 #-------------------------------------------------------------------------- def start_main $game_troop.increase_turn @info_viewport.visible = true @info_viewport.ox = 0 @party_command_window.active = false @actor_command_window.active = false @status_window.index = @actor_index = -1 @active_battler = nil @message_window.clear $game_troop.make_actions make_action_orders # 情報表示ビューポートの移動 move1_info_viewport # スキル名を表示するヘルプウインドウを作成 @help_window = Window_Help.new @help_window.visible = false process_battle_event end #-------------------------------------------------------------------------- # ● バトルイベントの処理 ※再定義 #-------------------------------------------------------------------------- def process_battle_event loop do return if judge_win_loss return if $game_temp.next_scene != nil $game_troop.interpreter.update $game_troop.setup_battle_event @message_window.update if $game_message.visible @message_window.visible = true @status_window.visible = false end wait_for_message @message_window.visible = false @status_window.visible = true if $game_troop.forcing_battler != nil process_action end return unless $game_troop.interpreter.running? update_basic end end #-------------------------------------------------------------------------- # ● 行動順序作成 #-------------------------------------------------------------------------- alias make_action_orders_n01 make_action_orders def make_action_orders make_action_orders_n01 # エネミーの行動回数チェック for enemy in $game_troop.members enemy.act_time = 0 if enemy.action_time[0] != 1 action_time = 0 # 確率から回数を取得 for i in 1...enemy.action_time[0] action_time += 1 if rand(100) < enemy.action_time[1] end enemy.act_time = action_time action_time.times do enemy_order_time(enemy) action_time -= 1 break if action_time == 0 end enemy.adj_speed = nil end end end #-------------------------------------------------------------------------- # ● エネミーの行動回数作成 #-------------------------------------------------------------------------- def enemy_order_time(enemy) enemy.make_action_speed2(enemy.action_time[2]) select_time = 0 for member in @action_battlers select_time += 1 break @action_battlers.push(enemy) if member.action.speed < enemy.adj_speed break @action_battlers.push(enemy) if select_time == @action_battlers.size end end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 #-------------------------------------------------------------------------- alias execute_action_n01 execute_action def execute_action # スキル、アイテム拡張で行動前にフラッシュさせない設定があるなら if @active_battler.action.kind != 0 obj = @active_battler.action.skill if @active_battler.action.kind == 1 obj = @active_battler.action.item if @active_battler.action.kind == 2 if obj.extension.include?("NOFLASH") @active_battler.white_flash = false end end # バトラーをアクティブ化 @active_battler.active = true # 強制行動中のスキル派生 @active_battler.derivation = 0 if @active_battler.action.forcing execute_action_n01 # スキル派生がある場合、行動続行 if @active_battler.derivation != 0 @active_battler.action.kind = 1 @active_battler.action.skill_id = @active_battler.derivation # we dont need the derivation variable anymore, its already been set @active_battler.derivation = 0 # Derivation fix, 1.1e @action_battlers.unshift(@active_battler) return process_action end # 複数回行動のエネミーがいる場合、次の行動を決定 if !@active_battler.actor? && @active_battler.act_time != 0 @active_battler.make_action @active_battler.act_time -= 1 end end #-------------------------------------------------------------------------- # ● ターン終了 ※再定義 #-------------------------------------------------------------------------- def turn_end for member in $game_party.members + $game_troop.members member.clear_action_results next unless member.exist? member.slip_damage = false actor = member.actor? damage = 0 slip_pop = true slip_dead = true # 0ターン解除のステートがあるかチェック for state in member.states member.remove_state(state.id) if state.extension.include?("ZEROTURNLIFT") # スリップダメージ実行 state = [ 対象, 定数, 割合, POP, 戦闘不能許可] next unless state.slip_damage #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 / 100 # * (rand(5) - rand(5)) / 100 slip_pop = ext[3] unless ext[3] == nil slip_dead = ext[4] unless ext[4] == nil 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.slip_damage #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 / 100 # * (rand(5) - rand(5)) / 100 slip_pop = ext[2] slip_damage_flug = true end end member.mp_damage = mp_damage member.mp -= mp_damage @spriteset.set_damage_pop(actor, member.index, mp_damage) if slip_pop end member.clear_action_results end @status_window.refresh # ダメージと回復のタイミングをずらす wait(55) if slip_damage_flug # 自動回復があるか for member in $game_party.members if member.auto_hp_recover and member.exist? plus_hp = member.maxhp / 20 member.hp += plus_hp @spriteset.set_damage_pop(true, member.index, plus_hp * -1) plus_hp_flug = true end member.clear_action_results end @status_window.refresh wait(55) if plus_hp_flug @help_window.dispose if @help_window != nil @help_window = nil move2_info_viewport $game_troop.turn_ending = true $game_troop.preemptive = false $game_troop.surprise = false process_battle_event $game_troop.turn_ending = false start_party_command_selection end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : 攻撃 ※再定義 #-------------------------------------------------------------------------- def execute_action_attack if @active_battler.actor? if @active_battler.weapon_id == 0 action = @active_battler.non_weapon # 行動中に死なないようメンバー全員を不死身化 immortaling else action = $data_weapons[@active_battler.weapon_id].base_action # 戦闘不能付与の武器で不死身設定を分岐 if $data_weapons[@active_battler.weapon_id].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end else if @active_battler.weapon == 0 action = @active_battler.base_action immortaling else action = $data_weapons[@active_battler.weapon].base_action if $data_weapons[@active_battler.weapon].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end end target_decision @spriteset.set_action(@active_battler.actor?, @active_battler.index, action) playing_action end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : 防御 ※再定義 #-------------------------------------------------------------------------- def execute_action_guard @help_window.set_text(N01::GUARD_HELP_TEXT, 1) @help_window.visible = true # バトラーのアクティブ化を解除 @active_battler.active = false wait(45) @help_window.visible = false end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : 逃走 #-------------------------------------------------------------------------- def execute_action_escape @spriteset.set_action(false, @active_battler.index, @active_battler.run_success) @help_window.set_text(N01::ESCAPED_HELP_TEXT, 1) @help_window.visible = true # バトラーのアクティブ化を解除 @active_battler.active = false @active_battler.escape Sound.play_escape wait(45) @help_window.visible = false end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : 待機 ※再定義 #-------------------------------------------------------------------------- def execute_action_wait # バトラーのアクティブ化を解除 @active_battler.active = false wait(45) end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : スキル ※再定義 #-------------------------------------------------------------------------- def execute_action_skill skill = @active_battler.action.skill return unless @active_battler.action.valid? # 3.3d, Force action bug fix # 戦闘不能付与のスキルで不死身設定を分岐 if skill.plus_state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else # 行動中に死なないようメンバー全員を不死身化 immortaling end # ターゲット決定 target_decision(skill) # アクション開始 @spriteset.set_action(@active_battler.actor?, @active_battler.index, skill.base_action) # ヘルプウインドウにスキル名表示 pop_help(skill) # アクション中 playing_action # Calculate skill cost and remove MP. 3.4a @active_battler.mp -= @active_battler.calc_mp_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 order is stored from the active battler action = @active_battler.play next if action == 0 @active_battler.play = 0 if action[0] == "Individual" individual elsif action == "Can Collapse" unimmortaling elsif action == "Cancel Action" break action_end elsif action == "End" break action_end elsif action[0] == "OBJ_ANIM" damage_action(action[1]) end end end #-------------------------------------------------------------------------- # ● 個別処理 #-------------------------------------------------------------------------- def individual # ターゲット情報を保持 @individual_target = @targets @stand_by_target = @targets.dup end #-------------------------------------------------------------------------- # ● コラプス禁止 #-------------------------------------------------------------------------- def immortaling # for sideview 2 for member in $game_party.members + $game_troop.members # everyone currently in the battle next if member.dead? # skip if they are dead member.set_temp_immortal # set the immortal flag end end #-------------------------------------------------------------------------- # ● コラプス許可 #-------------------------------------------------------------------------- def unimmortaling # 個別処理中はコラプス許可しない return if @active_battler.individual # 全員の不死身化解除(イベント等で不死身設定がされていれば除く) for member in $game_party.members + $game_troop.members if member.dying member.dying = false if member.dead? or member.hp == 0 member.add_state(1) member.perform_collapse end end next if member.non_dead next if member.dead? member.set_temp_immortal(false) # only changed this line, 3.3c member.add_state(1) if member.hp == 0 member.perform_collapse end # この時点で待機アクションに即反映させる @targets = @stand_by_target if @stand_by_target != nil return if @targets == nil or @targets.size == 0 for target in @targets @spriteset.set_stand_by_action(target.actor?, target.index) # 自動復活チェック next unless target.hp == 0 resurrection(target) end end #-------------------------------------------------------------------------- # ● 自動復活 #-------------------------------------------------------------------------- def resurrection(target) for state in target.states for ext in state.extension name = ext.split('') next unless name[0] == "A" wait(50) name = name.join name.slice!("AUTOLIFE/") target.hp = target.maxhp * name.to_i / 100 target.remove_state(1) target.remove_state(state.id) target.animation_id = N01::RESURRECTION target.animation_mirror = true if $back_attack @status_window.refresh wait($data_animations[N01::RESURRECTION].frame_max * 4) end end end #-------------------------------------------------------------------------- # ● 魔法反射・無効 #-------------------------------------------------------------------------- def magic_reflection(target, obj) return if obj.physical_attack for state in target.states for ext in state.extension name = ext.split('') next unless name[0] == "M" if name[3] == "R" name = name.join name.slice!("MAGREFLECT/") target.animation_id = name.to_i target.animation_mirror = true if $back_attack @reflection = true else name = name.join name.slice!("MAGNULL/") target.animation_id = name.to_i target.animation_mirror = true if $back_attack @invalid = true end end end end #-------------------------------------------------------------------------- # ● 物理反射・無効 #-------------------------------------------------------------------------- def physics_reflection(target, obj) return if obj != nil && !obj.physical_attack for state in target.states for ext in state.extension name = ext.split('') next unless name[0] == "P" if name[3] == "R" name = name.join name.slice!("PHYREFLECT/") target.animation_id = name.to_i target.animation_mirror = true if $back_attack @reflection = true else name = name.join name.slice!("PHYNULL/") target.animation_id = name.to_i target.animation_mirror = true if $back_attack @invalid = true end end end end #-------------------------------------------------------------------------- # ● Absorb Skill MP/HP Cost #-------------------------------------------------------------------------- def absorb_cost(target, obj) for state in target.states if state.extension.include?("COSTABSORB") cost = @active_battler.calc_mp_cost(obj) if $imported["MPCostAlter"] # KGC_MPCostAlter hp_cost = @active_battler.calc_hp_cost(obj) # Return cost of skill if has an HP cost return target.hp += hp_cost if hp_cost > 0 end # Return MP cost of skill that battler was hit by 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?("PERFECTHIT") 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?("PERFECTHIT") 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 #-------------------------------------------------------------------------- # ● Pop Damage action = [Animation ID, Invert Flag, Allow Reaction] #-------------------------------------------------------------------------- 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 #-------------------------------------------------------------------------- # * Game_BattleAction#valid? is no longer redefined #--------------------------------------------------------------------------
#-------------------------------------------------------------------------- # * Create Target Array -redefinition #-------------------------------------------------------------------------- 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 #------------------------------------------------------------------------------ # A sprite class with animation display processing added. #============================================================================== class Sprite_Base < Sprite #-------------------------------------------------------------------------- # ● Update Animation -aliased # Allows animation to follow target if animation position is "Center" #-------------------------------------------------------------------------- alias update_animation_n01 update_animation def update_animation if @animation.position == 1 # 3.4a @animation_ox = x - ox + width / 2 @animation_oy = y - oy + height / 2 end update_animation_n01 end end #============================================================================== # ■ Spriteset_Battle #------------------------------------------------------------------------------ # This class brings together battle screen sprites. It's used within the # Scene_Battle class. #============================================================================== 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 #-------------------------------------------------------------------------- # * Create Battlefloor Sprite -aliased #-------------------------------------------------------------------------- alias create_battlefloor_n01 create_battlefloor def create_battlefloor create_battlefloor_n01 @battlefloor_sprite.x = N01::FLOOR[0] @battlefloor_sprite.y = N01::FLOOR[1] @battlefloor_sprite.opacity = N01::FLOOR[2] # Mirror BattleFloor and Battleback when a surprise attack back_attack if $back_attack @battlefloor_sprite.mirror = true @battleback_sprite.mirror = true $game_troop.surprise = true else $game_troop.surprise = false end end #-------------------------------------------------------------------------- # ● Back Attack #-------------------------------------------------------------------------- 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 #-------------------------------------------------------------------------- # ● Update Actors -redefined #-------------------------------------------------------------------------- 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 + N01::CURSOR_X_PLUS, @actor_sprites[index].y + N01::CURSOR_Y_PLUS] if actor return [@enemy_sprites[index].x + N01::CURSOR_X_PLUS, @enemy_sprites[index].y + N01::CURSOR_Y_PLUS] unless actor end end #============================================================================== # ■ Sprite_MoveAnime #------------------------------------------------------------------------------ # アニメ飛ばし用のスプライトです。 #============================================================================== class Sprite_MoveAnime < Sprite_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :battler attr_accessor :base_x # Base X coordinate attr_accessor :base_y # Base Y coordinate #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- 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) # Distance calculation per frame @time = speed @moving_x = distanse_x / speed @moving_y = distanse_y / speed # Can animation can pass through target? @through = true if type == 1 # 円軌道を取得 @orbit_plus = orbit @orbit_time = @time # If a weapon graphic is used if weapon != "" action = N01::ANIME[weapon].dup @angle = action[0] end_angle = action[1] time = action[2] # if battler is an enemy and not in a back attack 3.4a if !battler.actor? && !$back_attack # Invert angles of flying graphic and mirror it @angle *= -1 end_angle *= -1 mirror = true end # if back attack, invert defined angles 3.4a if $back_attack @angle *= -1 unless !battler.actor? end_angle *= -1 unless !battler.actor? mirror = true if battler.actor? mirror = false if !battler.actor? end # 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座標
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
class Window_Help < Window_Base #-------------------------------------------------------------------------- # ● テキスト設定 #-------------------------------------------------------------------------- def set_text_n01add(member) self.contents.clear return if member == nil || member.dead? 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
#============================================================================== # ■ Sprite_Battler #------------------------------------------------------------------------------ # This sprite is used to display battlers. It observes a instance of the # Game_Battler class and automatically changes sprite conditions. #============================================================================== class Sprite_Battler < Sprite_Base #------------------------------------------------------------------------------ # This method was taken from the ATB and moved to Sideview 2 to help # enable head and feet targeting. #------------------------------------------------------------------------------ alias make_battler_hw_from_atb make_battler def make_battler make_battler_hw_from_atb
@battler.graphics_width = @width @battler.graphics_height = @height 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
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:38
Script 5 phần 1 (Các bạn nhớ add phần 2 phía sau nha) - Notetags for Tankentai Add-on:
Code:
#============================================================================== # + Notetags Add-on for RPG Tankentai Sideview Battle System # v1.1 (June 29, 2010) #------------------------------------------------------------------------------ # By Mr. Bubble # Special thanks to Mithran & Yanfly #============================================================================== # + Installation # Place below the Sideview and ATB scripts in the script editor. # # + Please read the Notetag comments for information on available Notetags. #==============================================================================
=begin
Tankentai Notetags Add-on
Terms: key - Refers to the name of an action sequence key. Do not use quotation marks for notetags. value - A numerical value value% - A numerical value used as a percentage of something, but the percent sign is usually optional type - Differs depending on tag (see specific tag for information) filename - A filename from the Graphics/Characters folder
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ SKILLS, ITEMS, & WEAPONS ++ The following tags can be used for skills, items, and weapons. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Skill, Item, or Weapon Notetag:
<action: key>
Assigns an action sequence to the skill, item, or weapon. Remember that keys are case-sensitive and you do not need quotes. You will receive an error if you try to use an action sequence key that does not exist.
EXAMPLE: <action: NORMAL_ATTACK> The skill, item, or weapon execute the "NORMAL_ATTACK" action sequence rather than the default. #============================================================================= Skill, Item, or Weapon Notetag:
<flygraphic: filename>
Assigns a flying graphic to the skill, item, or weapon. The flying graphic is utilized through 'Moving Animation' types of anime hashes.
EXAMPLE 1: <flygraphic: woodarrow> The skill, item, or weapon will use the 'woodarrow' flying graphic. Flying graphic must be in the Graphics/Characters folder.
EXAMPLE 2: <flygraphic: icon> Uses the icon of the skill or item as the flying graphic.
#============================================================================= Weapon Notetag (WEAPON TAG ONLY):
<graphic: filename>
Assigns a specific weapon graphic to the weapon from the Graphics/Characters folder. This graphic will replace the weapon icon graphic from the Iconset when weapon animations are used.
EXAMPLE: <graphic: big_sword> The weapon will use the big_sword graphic from the Characters folder and it will replace the weapon icon used from the Iconset.
#============================================================================= Skill and Item Notetag:
<graphic: filename>
<extensions> (add extension tags in here) </extensions>
Define various extensions for a skill or item. Extensions must be defined between the <extensions> and </extensions> tags, each on its own line. A single extension may have multiple names, but will do the same thing. Choose whichever. Multiple extensions may be listed for a single state. The following extensions are available:
perfect hit ignore reflect hide help window OR hide help target all random target no flash OR flash off
<ext> and </ext> can be used instead of <extensions> and </extensions> respectively.
EXAMPLE 1: <extensions> perfect hit </extensions> The skill or item will always hit regardless of hit or evade.
EXAMPLE 2: <extensions> ignore reflect </extensions> The skill or item will always hit regardless of reflect states.
EXAMPLE 3: <ext> ignore reflect hide help window target all </ext> The skill or item will always hit regardless of reflect states, will not display the help window, and will target all enemies and allies.
EXAMPLE 4: <ext> random target no flash </ext> The skill or item will pick a random target and the battler will not flash when executing an action. For random target to work correctly, you must set the default scope of the skill to "All Enemies" or "All Allies".
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ STATE NOTETAGS ++ The following tags are used for states. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
State Notetag:
<slip: type, value, value%>
Defines the amount of slip damage the state causes after each turn. Multiple slip values can be defined for a single state. In order for a state to uses these slip values, the "Slip Damage" checkbox must be marked in the "Options" box of the state.
type: "hp" or "mp" (no quotation marks). value: A constant value. Negative values heal. value%: A percentage value based off MAXHP or MAXMP. Negative values heal.
EXAMPLE 1: <slip: hp, 15, 10%> The state will cause 15 damage plus 10% of the battler's MAXHP after every turn.
EXAMPLE 2: <slip: hp, 0, -5%> The state will heal 5% of the battler's MAXHP after every turn.
EXAMPLE 3: <slip: mp, -12, 0> The state will heal 12 MP after every turn.
EXAMPLE 4: <slip: mp, 5, 0> <slip: hp, -50, 0> The state will cause 5 damage to the battler's MP and will heal 50 HP after every turn. #============================================================================= State Notetag:
<action: key>
Assigns an action sequence to a state. When a battler is inflicted by the state, the battler will replace its standby action sequence with the action sequence assigned to the state.
EXAMPLE: <action: WAIT-SLEEP> The state will make the battler use the "WAIT-SLEEP" action sequence rather than its default standby action sequence.
#============================================================================= State Notetag:
<extensions> (add extension tags in here) </extensions>
Define various extensions for a state. Extensions must be defined between the <extensions> and </extensions> tags, each on its own line. A single extensions may have multiple names, but will do the same thing. Choose whichever. Multiple extensions may be listed for a single state. The following extensions are available:
autolife: value OR rebirth: value magic reflect: id physical reflect: id magic null: id physical null: id absorb cost zero turn lift enemy off OR enemy action off no pop OR hide pop window action off OR state action off
id: Refers to an animation ID from the Database.
<ext> and </ext> can be used instead of <extensions> and </extensions> respectively.
EXAMPLE 1: <extensions> autolife: 51 </extensions> The state will automatically revive the user when they die and will restore 51% of their MAXHP when triggered. Do not use a percent sign here.
EXAMPLE 2: <extensions> physical reflect: 39 </extensions> The state will reflect physical effects back at attackers and will play animation ID 39 when triggered.
EXAMPLE 3: <extensions> physical null: 23 magic null: 39 </extensions> The state will nullify physical and magical effects and will play animation ID 39 or animation ID 23 when triggered.
EXAMPLE 4: <ext> state action off </ext> The state will not use a State Infliction Action Sequence when a battler is affected.
EXAMPLE 5: <ext> hide pop window </ext> The state's name will not appear in a pop window when the state is applied to a battler.
EXAMPLE 6: <ext> absorb cost </ext> The state will absorb the MP cost of skills when hit.
EXAMPLE 7: <ext> zero turn lift enemy action off </ext> The state will be removed instantly at the end of the turn and enemies will not use a State Infliction Action Sequence when they are affected.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ ENEMY NOTETAGS ++ The following tags are used for enemies. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Enemy Notetag:
<unarmed: key>
Define the action sequence used when an enemy executes an unarmed attack. This tag will have no effect if the enemy is holding a weapon.
EXAMPLE: <unarmed: SKILL_USE> The enemy will use the "SKILL_USE" action sequence when they execute a normal attack with no weapon.
Define the amount of pixels the shadow is moved based on the origin of the enemy battler. Positive y values move the shadow down. Negative y values move the shadow up.
EXAMPLE: <move shadow: 0, -50> The enemy's shadow will move up 50 pixels
Define the equipped weapon of the enemy battler. If the enemy does not have a weapon, it will use its unarmed action sequence instead. The enemy will execute whatever action sequence is assigned to the weapon when using a normal attack.
EXAMPLE: <weapon: 4> The enemy will equip weapon ID 4 in battle.
Define the amount of times an enemy can act in a single turn.
times: The maximum number of times an enemy can act in a turn. chance%: The chance, out of 100%, an enemy will get another action. Percent sign (%) is optional. speed reduction: The amount, out of 100%, an enemy's speed rating (from skills) is reduced after each successive action. Percent sign (%) is optional.
EXAMPLE: <multiact: 3, 50%, 70%> The enemy has a 50% chance to gain another action up to a maximum of 3 actions for a single turn. The enemy's speed bonus from skills is reduced by 70% after each action.
Define whether an enemy is animated. Enemy battlers will instead use files from the Graphics/Characters folder rather than the Graphics/Battlers folder. Adding a minus sign (-) at the beginning will disable animation if it is turned on elsewhere.
EXAMPLE 1: <animate> The enemy will be animated.
EXAMPLE 2: <-animate> The enemy will not be animated.
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ Tankentai ATB Notetags ++ #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Terms: key - Refers to the name of an action sequence key value - A numerical value value% - A percentage value, but the percent sign is optional id - An ID number from your database. type - Differs depending on tag (see specific tag for information) filename - A filename from the Graphics/Characters folder
The following tags are to be used with the Tankentai ATB installed only. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ ATB SKILLS, ITEMS, & WEAPONS ++ The following tags can be used for skills, items, and weapons. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Skill, Item, or Weapon Notetag (WITH ATB ONLY):
<charge: type, gauge%, fixed value)
Defines the charge time of a skill, item, or weapon.
type: Base AGI calculation used for charge time. 0: Fixed Value 1: Battler with the highest AGI 2: Battler with the lowest AGI 3: Average AGI of all battlers 4: Battler's own AGI gauge(%): The amount of charge time, in percent, based on the user's gauge. Percent sign (%) is optional 200% will be twice the amount the battler normally needs for full ATB gauge. 10% will be 1/10 of what the battler needs for a full ATB gauge. 0% is instant. fixed value: Only used if type is set to 0. Used in charge time calculation as if the battler has the AGI of what you define.
EXAMPLE 1: <charge: 4, 50%, 0) The skill, item, or weapon will have a 50% gauge charge time. The speed of charging is based off the user's own AGI stat. Since the type is not 0, the fixed value is not used. However, you still need a value there.
EXAMPLE 2: <charge: 0, 125%, 60) The skill, item, or weapon will have a 125% gauge charge time.Since the type is 0, the fixed value is used. This means the user charging speed will be as if the user has a stat of 60 AGI for the duration of the charge.
#============================================================================= Skill, Item, or Weapon Notetag (WITH ATB ONLY):
<charge action: key>
Defines the action sequence used while charging the skill, item, or weapon. Only used if a '<charge: >' Notetag is used in the same Notebox. Quotes are not needed.
EXAMPLE: <charge action: CHARGING> The user will use the "CHARGING" action sequence when the user is charging a skill, item, or weapon.
#============================================================================= Skill, Item, or Weapon Notetag (WITH ATB ONLY):
<recharge: value%>
Defines the total amount of ATB gauge the user is left with after using the skill, item, or weapon. Percent sign (%) is optional.
EXAMPLE: <recharge: 25%> The skill, item, or weapon will reset the user's gauge to 25% after being used.
#============================================================================= Weapon and Armor Notetag (WITH ATB ONLY):
<atb base: value%>
Defines the bonus amount of ATB gauge the armor or weapon gives to the user at the start of battle. Value can be negative. Percent sign (%) is optional. Effect is cumulative.
EXAMPLE 1: <atb base: 60%> The armor or weapon will grant a 60% bonus to the user's initial ATB gauge at the start of battle when equipped.
EXAMPLE 2: <atb base: -15%> The armor or weapon will grant a -15% penalty to the user's initial ATB gauge at the start of battle when equipped.
#============================================================================= Weapon and Armor Notetag (WITH ATB ONLY):
<charge bonus: value%>
Defines the charge bonus a weapon or armor gives to the user when equipped. value% is the amount of charge time reduced. Value can be negative. Percent sign (%) is optional. Effect is cumulative.
EXAMPLE 1: <charge bonus: 30%> The weapon or armor will reduce all the user's charge times by 30% when equipped.
EXAMPLE 2: <charge bonus: -10%> The weapon or armor will increase all the user's charge times by 10%.
#============================================================================= Weapon and Armor Notetag (WITH ATB ONLY):
<atb base: value%>
Defines the bonus amount of ATB gauge the armor or weapon gives to the user at the start of battle. Value can be negative. Percent sign (%) is optional. Effect is cumulative.
EXAMPLE 1: <atb base: 60%> The armor or weapon will grant a 60% bonus to the user's initial ATB gauge at the start of battle when equipped.
EXAMPLE 2: <atb base: -15%> The armor or weapon will grant a -15% penalty to the user's initial ATB gauge at the start of battle when equipped.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ ATB STATES ++ The following tags can be used for states in the ATB. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
State Notetag (WITH ATB ONLY):
<atb damage: value%>
Define the amount of ATB gauge damage a state causes when initially applied. Positive values increase gauges and negative values decrease gauges. Damaging the ATB gauge of a battler that is charging a skill, item, or weapon will immediately interrupt the charge. Percent sign (%) is optional.
EXAMPLE 1: <atb damage: -25%> The state will decrease the ATB gauge of battlers by 25% when inflicted.
EXAMPLE 2: <atb damage: 80%> The state will increase the ATB gauge of battlers by 80% when inflicted.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ ++ ATB ENEMIES ++ The following tags can be used for enemies in the ATB. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ Enemy Notetag (WITH ATB ONLY):
<charge: type, gauge%, fixed value)
Defines the charge time for an enemy's unarmed attack.
type: Base AGI calculation used for charge time. 0: Fixed Value 1: Battler with the highest AGI 2: Battler with the lowest AGI 3: Average AGI of all battlers 4: Battler's own AGI gauge(%): The amount of charge time, in percent, based on the user's gauge. Percent sign (%) is optional 200% will be twice the amount the battler normally needs for full ATB gauge. 10% will be 1/10 of what the battler needs for a full ATB gauge. 0% is instant. fixed value: Only used if type is set to 0. Used in charge time calculation as if the battler has the AGI of what you define.
EXAMPLE 1: <charge: 4, 50%, 0) The enemy will have a 50% gauge charge time. The speed of charging is based off the user's own AGI stat. Since the type is not 0, the fixed value is not used. However, you still need a value there.
EXAMPLE 2: <charge: 0, 125%, 60) The enemy will have a 125% gauge charge time. Since the type is 0, the fixed value is used. This means the user charging speed will be as if the user has a stat of 60 AGI for the duration of the charge.
Defines the action sequence used while an enemy is charging an unarmed attack. Only used if a '<charge: >' type Notetag is used.
EXAMPLE: <charge action: CHARGING> The user will use the "CHARGING" action sequence when the user is charging a skill, item, or weapon. #============================================================================= Enemy Notetag (WITH ATB ONLY):
<charge action: key>
Defines the action sequence used while an enemy is charging an unarmed attack. Only used if a '<charge: >' type Notetag is used.
EXAMPLE: <charge action: CHARGING> The user will use the "CHARGING" action sequence when the user is charging a skill, item, or weapon.
#============================================================================= #----------------------------------------------------------------------------- # Do not edit anything below this line unless you know what you're doing. #----------------------------------------------------------------------------- #=============================================================================
# ATB Base def atb_base_noteread @atb_base ||= note =~ ATB_BASE_TAG ? $1.to_i : :nothing end
#-------------------------------------------------------------------------- # Skill and Item Extensions #-------------------------------------------------------------------------- def skill_item_extension_noteread return @extensions if @extensions != nil @extensions = [] ext_reading = false self.note.split(/[\r\n]+/).each { |line| case line when /<(?:EXTENSION[S]?|ext)>/i ext_reading = true when /<\/(?:EXTENSION[S]?|ext)>/i ext_reading = false when /([\w\s]+)/i next unless ext_reading case $1.upcase when "PERFECTHIT", "PERFECT HIT", "NOEVADE", "NO EVADE" @extensions.push("PERFECTHIT")
when "IGNOREREFLECT", "IGNORE REFLECT" @extensions.push("IGNOREREFLECT")
when "HELPHIDE", "HELP HIDE", "HIDEHELP", "HIDE HELP", "HIDE HELP WINDOW" @extensions.push("HELPHIDE")
when "TARGETALL", "TARGET ALL" @extensions.push("TARGETALL")
when "RANDOMTARGET", "RANDOM TARGET", "RANDOM" @extensions.push("RANDOMTARGET")
when "OTHERS", "REMOVE SELF", "NOT SELF" @extensions.push("OTHERS")
when "NOOVERKILL", "NO OVERKILL" @extensions.push("NOOVERKILL")
when "NOFLASH", "NO FLASH", "DON'T FLASH" @extensions.push("NOFLASH")
when "NONE" @extensions.push("NONE")
end # end case $1.upcase end # end case line } #p @extensions return @extensions end # end def skill_item_extension_noteread end # end module TankentaiBaseItemTags
#========================================================================= # State Tags #========================================================================= module TankentaiStateTags #-------------------------------------------------------------------------- # State Extensions #-------------------------------------------------------------------------- # <extensions> # tags # </extensions> def state_extension_noteread return @extensions if @extensions != nil @extensions = [] ext_reading = false self.note.split(/[\r\n]+/).each { |line| case line when /<(?:extensions|EXTENSION)>/i ext_reading = true when /<\/(?:extensions|EXTENSION)>/i ext_reading = false when /([\w\s]+)[:]?\s*([\d]+)/i next unless ext_reading case $1.upcase when "AUTOLIFE", "REBIRTH" @extensions.push("AUTOLIFE/" + $2)
when "MAGREFLECT", "MAGIC REFLECT", "REFLECT MAGIC" @extensions.push("MAGREFLECT/" + $2)
when "PHYREFLECT", "PHYSICAL REFLECT", "REFLECT PHYSICAL" @extensions.push("PHYREFLECT/" + $2)
when "MAGNULL", "MAGIC NULL", "NULL MAGIC" @extensions.push("MAGNULL/" + $2)
when "PHYNULL", "PHYSICAL NULL", "NULL PHYSICAL" @extensions.push("PHYNULL/" + $2)
end # end case $1.upcase
when /([\w\s]+)/i next unless ext_reading case $1.upcase when "COSTABSORB", "COST ABSORB", "ABSORB COST" @extensions.push("COSTABSORB")
when "ZEROTURNLIFT", "ZERO TURN LIFT", "TURN END LIFT" @extensions.push("ZEROTURNLIFT")
when "EXCEPTENEMY", "ENEMY OFF", "ENEMY ACTION OFF" @extensions.push("EXCEPTENEMY")
when "NOSTATEANIME", "ACTION OFF", "STATE ACTION OFF" @extensions.push("NOSTATEANIME")
when "NOPOP", "NO POP" "HIDE POP", "HIDE POP WINDOW", @extensions.push("NOPOP")
when "NONE" @extensions.push("NONE") end # end case $1.upcase end # end when /([\w\s]+)/i } return @extensions end # end def state_extension_noteread
#-------------------------------------------------------------------------- # State Extensions #-------------------------------------------------------------------------- def state_slip_extension_all_noteread return @slip_extensions if @slip_extensions != nil @slip_extensions = [] self.note.split(/[\r\n]+/).each { |line| case line when SLIP_DAMAGE_TAG # ["hp", value, value(%), bool, bool] @slip_extensions.push(state_slip_extension_noteread) end } @slip_extensions end # end def state_extension_all_noteread
#========================================================================== # * Game_Enemy < Game_Battler #========================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ++ Enemy Base Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_base_action base_action unless $@ def base_action return @action_key if @action_key != nil action = enemy.enemy_base_action_noteread if action != :nothing @action_key = action else @action_key = bubs_tsbs_notetags_enemy_base_action # alias end @action_key end #-------------------------------------------------------------------------- # ++ Enemy Standby Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_normal normal unless $@ def normal return @enemy_standby if @enemy_standby != nil action = enemy.enemy_normal_noteread if action != :nothing @enemy_standby = action else @enemy_standby = bubs_tsbs_notetags_enemy_normal # alias end @enemy_standby end #-------------------------------------------------------------------------- # ++ Enemy Pinch Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_pinch pinch unless $@ def pinch return @enemy_pinch if @enemy_pinch != nil action = enemy.enemy_pinch_noteread if action != :nothing @enemy_pinch = action else @enemy_pinch = bubs_tsbs_notetags_enemy_pinch # alias end @enemy_pinch end #-------------------------------------------------------------------------- # ++ Enemy Guard Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_defence defence unless $@ def defence return @enemy_guard if @enemy_guard != nil action = enemy.enemy_guard_noteread if action != :nothing @enemy_guard = action else @enemy_guard = bubs_tsbs_notetags_enemy_defence # alias end @enemy_guard end #-------------------------------------------------------------------------- # ++ Enemy Hurt Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_damage_hit damage_hit unless $@ def damage_hit return @enemy_hurt if @enemy_hurt != nil action = enemy.enemy_hurt_noteread if action != :nothing @enemy_hurt = action else @enemy_hurt = bubs_tsbs_notetags_enemy_damage_hit # alias end @enemy_hurt end #-------------------------------------------------------------------------- # ++ Enemy Evade Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_evasion evasion unless $@ def evasion return @enemy_evade if @enemy_evade != nil action = enemy.enemy_evade_noteread if action != :nothing @enemy_evade = action else @enemy_evade = bubs_tsbs_notetags_enemy_evasion # alias end @enemy_evade end #-------------------------------------------------------------------------- # ++ Enemy Escape Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_run_success run_success unless $@ def run_success return @enemy_escape if @enemy_escape != nil action = enemy.enemy_escape_noteread if action != :nothing @enemy_escape = action else @enemy_escape = bubs_tsbs_notetags_enemy_run_success # alias end @enemy_escape end #-------------------------------------------------------------------------- # ++ Enemy Enter Battle Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_first_action first_action unless $@ def first_action return @enemy_start if @enemy_start != nil action = enemy.enemy_start_noteread if action != :nothing @enemy_start = action else @enemy_start = bubs_tsbs_notetags_enemy_first_action # alias end @enemy_start end #-------------------------------------------------------------------------- # Enemy Interrupt Recover Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_recover_action recover_action unless $@ def recover_action return @enemy_interrupt if @enemy_interrupt != nil action = enemy.enemy_interrupt_noteread if action != :nothing @enemy_interrupt = action else @enemy_interrupt = bubs_tsbs_notetags_enemy_recover_action # alias end @enemy_interrupt end #-------------------------------------------------------------------------- # ++ Enemy Dead Pose #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_incapacitated incapacitated unless $@ def incapacitated return @enemy_dead if @enemy_dead != nil action = enemy.enemy_incapacitated_noteread if action != :nothing @enemy_dead = action else @enemy_dead = bubs_tsbs_notetags_enemy_incapacitated # alias end @enemy_dead end #-------------------------------------------------------------------------- # ++ Enemy Mirror #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_action_mirror action_mirror unless $@ def action_mirror return @enemy_mirror if @enemy_mirror != nil # simple 'once' constructor value = enemy.enemy_mirror_noteread # check the value taken from data object note if value != :nothing # if the note tag was not found, value would be :nothing, if it was, value is true @enemy_mirror = value # use note tag setting (true) else @enemy_mirror = bubs_tsbs_notetags_action_mirror #otherwise, use original end @enemy_mirror # return this value for sure end #-------------------------------------------------------------------------- # ++ Enemy Animation #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_anime_on anime_on unless $@ def anime_on return @enemy_animate if @enemy_animate != nil value = enemy.enemy_animate_noteread if value != :nothing @enemy_animate = value else @enemy_animate = bubs_tsbs_notetags_anime_on # alias end @enemy_animate end #-------------------------------------------------------------------------- # ++ Enemy Shadow #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_shadow shadow unless $@ def shadow return @shadow_name if @shadow_name != nil file = enemy.enemy_shadow_noteread if file != :nothing @shadow_name = file @shadow_name = "" if file.upcase == "OFF" else @shadow_name = bubs_tsbs_notetags_shadow # alias end @shadow_name end #-------------------------------------------------------------------------- # ++ Enemy Shadow Position #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_shadow_plus shadow_plus unless $@ def shadow_plus return @shadow_plus if @shadow_plus != nil coordinate = enemy.enemy_shadow_plus_noteread if coordinate != :nothing @shadow_plus = coordinate else @shadow_plus = bubs_tsbs_notetags_shadow_plus # alias end @shadow_plus end #-------------------------------------------------------------------------- # ++ Enemy Position #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_position_plus position_plus unless $@ def position_plus return @position_plus if @position_plus != nil coordinate = enemy.enemy_position_plus_noteread if coordinate != :nothing @position_plus = coordinate else @position_plus = bubs_tsbs_notetags_position_plus # alias end @position_plus end #-------------------------------------------------------------------------- # ++ Enemy Equipped Weapon #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_weapon weapon unless $@ def weapon return @enemy_weapon if @enemy_weapon != nil id = enemy.enemy_weapon_noteread if id != :nothing @enemy_weapon = id else @enemy_weapon = bubs_tsbs_notetags_enemy_weapon # alias end @enemy_weapon end #-------------------------------------------------------------------------- # ++ Enemy Collapse Type #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_collapse_type collapse_type unless $@ def collapse_type return @enemy_collapse if @enemy_collapse != nil num = enemy.enemy_collapse_noteread if num != :nothing @enemy_collapse = num else @enemy_collapse = bubs_tsbs_notetags_enemy_collapse_type # alias end @enemy_collapse end #-------------------------------------------------------------------------- # ++ Enemy Multi Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_action_time action_time unless $@ def action_time return @multiact if @multiact != nil array = enemy.enemy_action_time_noteread if array != :nothing @multiact = array else @multiact = bubs_tsbs_notetags_action_time # alias end @multiact end #-------------------------------------------------------------------------- # ++ Enemy Unarmed Charge Time Settings #-------------------------------------------------------------------------- if $imported["TankentaiATB"] alias bubs_tsbs_notetags_enemy_charge charge unless $@ def charge return @charge_values if @charge_values != nil action = enemy.enemy_charge_noteread if action != :nothing @charge_values = action else @charge_values = bubs_tsbs_notetags_enemy_charge # alias end @charge_values end #-------------------------------------------------------------------------- # ++ Enemy Recharge Value Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_recharge recharge unless $@ def recharge return @recharge_value if @recharge_value != nil value = enemy.enemy_recharge_noteread if value != :nothing @recharge_value = value else @recharge_value = bubs_tsbs_notetags_enemy_recharge # alias end @recharge_value end #-------------------------------------------------------------------------- # ++ Enemy ATB Base Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_atb_base atb_base unless $@ def atb_base return @atb_base if @atb_base != nil value = enemy.enemy_atb_base_noteread if value != :nothing @atb_base = value else @atb_base = bubs_tsbs_notetags_enemy_atb_base # alias end @atb_base end #-------------------------------------------------------------------------- # ++ Enemy ATB Gauge Visibility Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_enemy_atb_on atb_on unless $@ def atb_on return @atb_on if @atb_on != nil value = enemy.enemy_atb_on_noteread if value != :nothing @atb_on = value else @atb_on = bubs_tsbs_notetags_enemy_atb_on # alias end @atb_on end
end # if $imported["TankentaiATB"] end # end class Game_Enemy < Game_Battler
#========================================================================== # * RPG::Skill #========================================================================== class RPG::Skill #-------------------------------------------------------------------------- # ++ Skill Action Sequence Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_skill_base_action base_action unless $@ def base_action return @action_key if @action_key != nil action = base_action_noteread if action != :nothing @action_key = action else @action_key = bubs_tsbs_notetags_skill_base_action # alias end @action_key end #-------------------------------------------------------------------------- # ++ Set Skill Extensions #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_skill_extension extension unless $@ def extension return @extensions if @extensions != nil ext = skill_item_extension_noteread if !ext.empty? @extensions = ext else @extensions = bubs_tsbs_notetags_skill_extension # alias end @extensions end #-------------------------------------------------------------------------- # ++ Set Skill Flying Graphic #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_skill_flying_graphic flying_graphic unless $@ def flying_graphic file = flying_graphic_noteread if file != :nothing @flygraphic = file else @flygraphic = bubs_tsbs_notetags_skill_flying_graphic # alias end @flygraphic end #-------------------------------------------------------------------------- # ++ Skill Charge Time Settings #-------------------------------------------------------------------------- if $imported["TankentaiATB"]
alias bubs_tsbs_notetags_skill_charge charge unless $@ def charge return @charge_values if @charge_values != nil value = charge_noteread if value != :nothing @charge_values = value else @charge_values = bubs_tsbs_notetags_skill_charge # alias end @charge_values end #-------------------------------------------------------------------------- # ++ Skill Recharge Value Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_skill_recharge recharge unless $@ def recharge return @recharge_value if @recharge_value != nil value = recharge_noteread if value != :nothing @recharge_value = value else @recharge_value = bubs_tsbs_notetags_skill_recharge # alias end @recharge_value end
end # if $imported["TankentaiATB"] end
#=========================================================================== # * RPG::Item #=========================================================================== class RPG::Item #-------------------------------------------------------------------------- # ++ Item Action Sequence Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_item_base_action base_action unless $@ def base_action return @action_key if @action_key != nil action = base_action_noteread if action != :nothing @action_key = action else @action_key = bubs_tsbs_notetags_item_base_action # alias end @action_key end #-------------------------------------------------------------------------- # ++ Set Item Flying Graphic #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_item_flying_graphic flying_graphic unless $@ def flying_graphic return @flygraphic if @flygraphic != nil file = flying_graphic_noteread if file != :nothing @flygraphic = file else @flygraphic = bubs_tsbs_notetags_item_flying_graphic # alias end @flygraphic end #-------------------------------------------------------------------------- # ++ Item Charge Time Settings #-------------------------------------------------------------------------- if $imported["TankentaiATB"]
alias bubs_tsbs_notetags_item_charge charge unless $@ def charge return @charge_values if @charge_values != nil array = charge_noteread if array != :nothing @charge_values = array else @charge_values = bubs_tsbs_notetags_item_charge # alias end @charge_values end #-------------------------------------------------------------------------- # ++ Item Recharge Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_item_recharge recharge unless $@ def recharge return @recharge_value if @recharge_value != nil value = recharge_noteread if value != :nothing @recharge_value = value else @recharge_value = bubs_tsbs_notetags_item_recharge # alias end @recharge_value end
end # if $imported["TankentaiATB"]
end # end class RPG::Item #========================================================================== # * RPG::Weapon #========================================================================== class RPG::Weapon #-------------------------------------------------------------------------- # ++ Set Weapon Action Sequence #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_base_action base_action unless $@ def base_action return @action_key if @action_key != nil action = base_action_noteread if action != :nothing @action_key = action else @action_key = bubs_tsbs_notetags_weapon_base_action # alias end @action_key end #-------------------------------------------------------------------------- # ++ Set Weapon Graphic #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_graphic graphic unless $@ def graphic return @weapon_graphic if @weapon_graphic != nil file = weapon_graphic_noteread if file != :nothing @weapon_graphic = file else @weapon_graphic = bubs_tsbs_notetags_weapon_graphic # alias end @weapon_graphic end #-------------------------------------------------------------------------- # ++ Set Weapon Flying Graphic #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_flying_graphic flying_graphic unless $@ def flying_graphic return @flygraphic if @flygraphic != nil flying = flying_graphic_noteread if flying != :nothing @flygraphic = flying else @flygraphic = bubs_tsbs_notetags_weapon_flying_graphic # alias end @flygraphic end #-------------------------------------------------------------------------- # ++ Weapon Charge Time Settings #-------------------------------------------------------------------------- if $imported["TankentaiATB"]
alias bubs_tsbs_notetags_weapon_charge charge unless $@ def charge return @charge_values if @charge_values != nil value = charge_noteread if value != :nothing @charge_values = value else @charge_values = bubs_tsbs_notetags_weapon_charge # alias end @charge_values end #-------------------------------------------------------------------------- # ++ Weapon Recharge Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_recharge recharge unless $@ def recharge return @recharge_value if @recharge_value != nil value = recharge_noteread if value != :nothing @recharge_value = value else @recharge_value = bubs_tsbs_notetags_weapon_recharge # alias end @recharge_value end #-------------------------------------------------------------------------- # ++ Weapon Charge Bonus Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_charge_bonus charge_bonus unless $@ def charge_bonus return @charge_bonus if @charge_bonus != nil value = charge_bonus_noteread if value != :nothing @charge_bonus = value else @charge_bonus = bubs_tsbs_notetags_weapon_charge_bonus # alias end @charge_bonus end #-------------------------------------------------------------------------- # ++ Weapon ATB Base Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_weapon_atb_base atb_base unless $@ def atb_base return @atb_base if @atb_base != nil value = atb_base_noteread if value != :nothing @atb_base = value else @atb_base = bubs_tsbs_notetags_weapon_atb_base # alias end @atb_base end
end # if $imported["TankentaiATB"]
end
class RPG::Armor #-------------------------------------------------------------------------- # ++ Armor Charge Bonus Settings #-------------------------------------------------------------------------- if $imported["TankentaiATB"]
alias bubs_tsbs_notetags_armor_charge_bonus charge_bonus unless $@ def charge_bonus return @charge_bonus if @charge_bonus != nil value = charge_bonus_noteread if value != :nothing @charge_bonus = value else @charge_bonus = bubs_tsbs_notetags_armor_charge_bonus # alias end @charge_bonus end #-------------------------------------------------------------------------- # ++ Armor ATB Base Settings #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_armor_atb_base atb_base unless $@ def atb_base return @atb_base if @atb_base != nil value = atb_base_noteread if value != :nothing @atb_base = value else @atb_base = bubs_tsbs_notetags_armor_atb_base # alias end @atb_base end
end # if $imported["TankentaiATB"] end
#========================================================================== # * RPG::State #========================================================================== class RPG::State #-------------------------------------------------------------------------- # ++ Set State Base Action #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_state_base_action base_action unless $@ def base_action return @state_action if @state_action != nil action = state_base_action_noteread if action != :nothing @state_action = action else @state_action = bubs_tsbs_notetags_state_base_action # alias end @state_action end #-------------------------------------------------------------------------- # ++ Set State Extensions #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_state_extension extension unless $@ def extension return @extensions if @extensions != nil ext = state_extension_noteread if !ext.empty? @extensions = ext else @extensions = bubs_tsbs_notetags_state_extension # alias end @extensions end #-------------------------------------------------------------------------- # ++ Set State Slip Damage Values #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_state_slip_extension slip_extension unless $@ def slip_extension return @slip_values if @slip_values != nil array = state_slip_extension_all_noteread if !array.empty? @slip_values = array else @slip_values = bubs_tsbs_notetags_state_slip_extension # alias end @slip_values end #-------------------------------------------------------------------------- # ++ Set State ATB Damage Values #-------------------------------------------------------------------------- if $imported["TankentaiATB"]
alias bubs_tsbs_notetags_atb_damage atb_damage unless $@ def atb_damage return @atb_damage if @atb_damage != nil value = atb_damage_noteread if value != :nothing @atb_damage = value else @atb_damage = bubs_tsbs_notetags_atb_damage # alias end @atb_damage end #-------------------------------------------------------------------------- # ++ Set State ATB Damage Threshold Values #-------------------------------------------------------------------------- alias bubs_tsbs_notetags_atb_minus_damage atb_minus_damage unless $@ def atb_minus_damage return @atb_minus_damage if @atb_minus_damage != nil value = atb_minus_damage_noteread if value != :nothing @atb_minus_damage = value else @atb_minus_damage = bubs_tsbs_notetags_atb_minus_damage # alias end @atb_minus_damage end
end # end if $imported["TankentaiATB"] end
#========================================================================== # * RPG::BaseItem # * RPG::Enemy # * RPG::State #========================================================================== module RPG class BaseItem; include Bubs::TankentaiBaseItemTags; end class Enemy; include Bubs::TankentaiEnemyTags; end class State; include Bubs::TankentaiStateTags; end end
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Hướng dẫn takentai 2/2/2011, 09:39
Script 6 (Cuối) - Old Vers. Compatibility:
Code:
#============================================================================== # + Sideview Battle System Old Version Compatibility Script # v1.0 #------------------------------------------------------------------------------ # Due to the revised key names in the Battler Configuration script, old # keys have been moved to a separate script. It is recommended that you # keep this script page installed in order to avoid errors with old # action sequence scripts and such. # # The contents of each hash have not been changed. #==============================================================================