Advertisement
LiTTleDRAgo

[RGSS] DRG - XAS Module Simplifier

Jul 6th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.68 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2. # DRG - XAS Module Simplifier
  3. # Version 1.02
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  6. =begin
  7.  
  8.   Insert a comment in event at tool map, like this
  9.  
  10.   Comment :
  11.         Link_Action_ID = 0
  12.         Suflags = 60
  13.         Durations = 100
  14.         Self_Motions = _SKILL_01                 (dont use quote marks "" / '')
  15.         Attack_ID_Plans = 50
  16.         Attack_Range_Types = SQUARE              (LINE, RHOMBUS or SQUARE)  
  17.         Attack_Range_Plans = 0
  18.         Blow_Powers = 1
  19.         Self_Animation_Hit = 0
  20.         Self_Animation_Plans[60] = 10
  21.         Target_Invincibles_Durations = 10  
  22.         Animation_Speed = 1.5
  23.         Force_Move = nil                         (FORWARD, BACKWARD or nil)
  24.         Player_Cast_Time = 15
  25.        
  26.   Self_Animation_Plans[60] = 10
  27.   -> means in 60 frame, the tool event will activate the animation with ID 10
  28.   -> if you dont want to use animation, just dont insert it in the comment
  29.  
  30. =end
  31. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  32.  
  33. module XAS_SIMPLIFIER
  34.  
  35.   def self.all_tool
  36.     tool_map = XAS::ACTION_TEMPLATE_MAP_ID
  37.     map = sprintf("Data/Map%03d.rxdata", tool_map.to_i)
  38.     map = load_data(map)
  39.     event = map.events.values.find_all {|e| e.pages[0] &&
  40.       e.pages[0].list[0] && e.pages[0].list[0].code == 108}
  41.     return event
  42.   end
  43.  
  44.   def self.notes
  45.     notes = {}
  46.     all_tool.each { |e|
  47.       list =  e.pages[0].list.find_all { |list|[108,408].include?(list.code)}
  48.       notes[e.id] = list.collect { |list| list.parameters[0]}.join("\n") }
  49.     return notes
  50.   end
  51.  
  52. end
  53.  
  54. $imported ||= {}
  55. $imported[:xas_module_simplifier] = $xas_module_simplifier = 1.02
  56.  
  57. if !$xrxs_xas
  58.   raise "This script needs XAS to work"
  59. end
  60. #==============================================================================#
  61. # Ressurection
  62. #==============================================================================#
  63. module Database_Bullet
  64.   XAS_SIMPLIFIER.notes.each {|key,value|
  65.     action_id = key
  66.     next if value == ''
  67.     if value[/LINK_ACTION_ID = (\d+)/i]
  68.       LINK_ACTION_ID[action_id] = $1.to_i
  69.     end
  70.     if value[/SUFLAGS = (\d+)/i]
  71.       SUFLAGS[action_id] = $1.to_i
  72.     end
  73.     if value[/DURATIONS = (\d+)/i]
  74.       DURATIONS[action_id] = $1.to_i
  75.     end
  76.     if value[/SELF_MOTIONS = (\w+)/i]
  77.       SELF_MOTIONS[action_id] = $1.to_s
  78.     end
  79.     ATTACK_ID_PLANS[action_id] = []
  80.     if value[/ATTACK_ID_PLANS = (\d+)/i]
  81.       plan = []
  82.       plan[$1.to_i] = action_id
  83.       ATTACK_ID_PLANS[action_id] = plan  
  84.     end
  85.     if value[/ATTACK_RANGE_TYPES = (\w+)/i]
  86.       ATTACK_RANGE_TYPES[action_id] = eval $1
  87.     end
  88.     if value[/ATTACK_RANGE_PLANS = (\d+)/i]
  89.       ATTACK_RANGE_PLANS[action_id] = [$1.to_i]
  90.     end
  91.     if value[/BLOW_POWERS = (\d+)/i]
  92.       BLOW_POWERS[action_id] = $1.to_i
  93.     end
  94.     SELF_ANIMATION_PLANS[action_id] =  []
  95.     if value[/SELF_ANIMATION_PLANS\[(\d+)\] = (\d+)/i]
  96.       plan = []
  97.       plan[$1.to_i] = $2.to_i
  98.       SELF_ANIMATION_PLANS[action_id] = plan
  99.     end
  100.     if value[/SELF_ANIMATION_HIT = (\d+)/i]
  101.       SELF_ANIMATION_HIT[action_id] = $1.to_i  
  102.     end
  103.     if value[/TARGET_INVINCIBLES_DURATIONS = (\d+)/i]
  104.       TARGET_INVINCIBLES_DURATIONS[action_id] = $1.to_i
  105.     end
  106.     if value[/ANIMATION_SPEED = (\w+)/i]
  107.       ANIMATION_SPEED[action_id] = $1.to_f
  108.     end
  109.     FORCE_MOVE[action_id] = nil
  110.     if value[/FORCE_MOVE = (\w+)/i]
  111.       FORCE_MOVE[action_id] = eval $1
  112.     end
  113.     if value[/PLAYER_CAST_TIME = (\w+)/i]
  114.       PLAYER_CAST_TIME[action_id] = $1.to_i
  115.     end }
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement