Project1

标题: 水面动态倒影,求解 [打印本页]

作者: 禺谷皓月    时间: 2014-6-25 11:31
标题: 水面动态倒影,求解
代码复制
  1.  

1 a0 v4 v$ H, ~4 f. ^这个代码怎么用啊,有大神知道吗。我从国外找的。
: \, f3 x% S9 ^* I* c* m" P  U6 Z0 @http://galvs-scripts.com/2013/02/21/character-effects/( {9 Y; p' s3 g: R# T
是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    2 ?- F7 g% b3 l) m% h* e
  2. #  Galv's Character Effects
    & _1 Q* e% e# ], _0 l+ e
  3. #------------------------------------------------------------------------------#9 e# e1 f7 M6 u3 o9 h
  4. #  For: RPGMAKER VX ACE
    5 u1 O0 G/ k% X) x/ K
  5. #  Version 2.1
    . [) ?) g; n3 N
  6. #------------------------------------------------------------------------------#6 Z6 k. G# O* L
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows) s. n+ v9 M2 _* P- j9 t
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    9 R4 O# M+ M/ m; v3 n: e
  9. #                           - Fixed shadow facing bug+ I) a5 ^1 l( c+ X' h* j/ w
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows! D: ^5 D$ D, D$ T, n- T0 B- s
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
      E+ c+ m, d" T9 c
  12. #  2013-02-22 - Version 1.7 - bug fixes
      z" A. @5 ~2 p- q$ V, y, p
  13. #  2013-02-22 - Version 1.6 - added icon effect$ T. n+ Z( ]0 c- {$ h. {
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    % v" r5 g; z1 n7 R; z, B8 e; x
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles7 [& @1 Y8 ?/ p# [
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    ) W7 V' y# ?) y
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    ; w9 ]1 |9 m- @6 K0 Q# {
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    & W1 Q8 c! m/ r* {: C% z
  19. #  2013-02-21 - Version 1.0 - release
    & t$ Z% b5 i' ]0 f2 s7 @1 u
  20. #------------------------------------------------------------------------------#
    7 I: S4 ?* V, k; ~
  21. #  This script was made to provide some additional effects for characters such
    4 S7 |& h" B+ D4 I
  22. #  as events, followers and the player on the map.
    % J: {" x0 j  c" t$ X( z9 y
  23. #  Currently it includes:
    6 R: U' Y3 \8 K! q% c
  24. #
    ! p; h) a7 ?4 U3 _8 H0 }
  25. #  Shadows
    , D' D8 v  O- d  ^: Q
  26. #  Shadows that appear under player and events in a directions depending on) h* {! ~0 D% p
  27. #  a light source that you choose.
    5 R) R8 `% V% {2 y
  28. #
    + W8 ?  K* ^7 ?" c! R- h
  29. #  Parallax Reflect- k& N' m# Z/ x% O7 h, S
  30. #  Reflections that appear on the parallax layer for events and actors to be
    * H6 g2 f' T/ Y5 h2 z
  31. #  used for things like reflections in the water or glass floor etc. To get0 z4 N( n2 q5 k! h2 l: n
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    . i9 r3 g# K4 X% z3 J
  33. #  partially transparent.
    / N" C, N$ [% l8 h- K# l
  34. #
    : b  [9 H, l5 I" o: v
  35. #  Parallax Mirrors- f/ |4 H3 t/ N, i5 u
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    * N% g, q/ b+ c( i0 ^% ]
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    8 x5 G, ~8 @+ \. S
  38. #  changed so actors and events can use different charsets for their reflections$ {8 z! T% [0 `9 n+ Q: G$ ^
  39. #
    ) v  ?3 t7 {, a  r  N1 ~7 G
  40. #------------------------------------------------------------------------------#
    # u" Q# l" T4 r# n- s
  41.   
    6 x* ]2 i+ \5 `5 }  ]/ a+ V
  42. ; d+ b$ V9 z* t# U6 g" z0 O
  43. #------------------------------------------------------------------------------#
    # ?- v! W9 E+ M2 |6 B" r
  44. #  NEW - First event command as a COMMENT
    / \6 E& R6 S' {% o8 d6 r/ o# q
  45. #------------------------------------------------------------------------------#, d9 D7 M+ V2 ?
  46. #  You can add a comment as the first event command on an event page to set if
    , ~3 u1 I" T3 C+ P3 c
  47. #  that event has an icon, shadow or reflection active. The tags to use are+ x# e3 S1 F' L3 s
  48. #  below, all must be on the same line in the comment.+ E, f3 ^  e$ g0 i& N
  49. #. X$ y; K0 K2 Z; N+ Q' r
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)( }8 q' H* V( J. C
  51. # <shadow>           # set the event to display a shadow4 c# x0 P% s9 s6 o" j
  52. # <reflect>          # set the event to display reflections
    2 c7 @1 a8 @5 L% @! l
  53. #
    % ~8 \- q: C% C0 ~& V9 N7 @
  54. #------------------------------------------------------------------------------#; G3 V. \  A% B
  55. #  EXAMPLE:
    ' ^& m, U: }1 H
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    0 _% O. N6 L9 d: z  @
  57. #------------------------------------------------------------------------------#
    ) q) T' D  A! A; i, l- K
  58. , _9 @% s0 a' }) r, r+ ~
  59. # i" R" N+ w( C9 _* a
  60. #------------------------------------------------------------------------------#
    & y% I2 P0 {. p* x" y& ^. t
  61. #  SCRIPT CALLS:
    ; W4 I2 [, |+ x/ R! l
  62. #------------------------------------------------------------------------------#
    * T$ I+ Z& d; w  _
  63. #4 d8 ^# Z$ }  Z) t- Q. a9 T" d
  64. #  char_effects(x,x,x,status)+ ~/ @" t. _2 n- W) h
  65. #/ {0 x' a( f- H/ F1 k" l. r; w6 u# v
  66. #------------------------------------------------------------------------------#
    8 I: Q' {1 ^! W5 U9 q
  67. #  # each effect can be true or false to enable/disable them during the game.
    ; R; I- j, @. W  b* `
  68. #  # you can change multiples of effects at once, x being the effect number
    1 _5 O" n" F7 k5 F/ I! n3 J
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    3 F- [' J) A1 m8 U
  70. #------------------------------------------------------------------------------#
    : J3 m7 G# Q" T7 R- Y: f
  71. #  EXAMPLES:$ U) u/ T& @+ L1 [9 j2 Q  f+ {
  72. #  char_effects(0,true)              # turn reflections on
    3 J$ m; z1 q' A7 B
  73. #  char_effects(0,2,true)            # turn reflections and mirror on' Q! O6 M, V9 j5 m- k! `9 X
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    : l+ j) W# F* B% U0 \% l
  75. #------------------------------------------------------------------------------#; k, r: c+ p+ y7 y5 k/ F" G+ a
  76. #
    : {. [0 L9 ^, o6 Y9 w
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    9 G: ^3 ~9 e+ h: ^
  78. ## ~: u5 P8 I  R8 _: O1 E
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    " u+ e& j( D5 i% D5 `1 @
  80. #3 V8 N; m/ e8 a) A
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset: F, [4 a4 I, A7 {7 R
  82. #$ O* T# v# X+ h5 e* J- U& J
  83. #------------------------------------------------------------------------------#
    , Y3 r' r; q& R5 c' `
  84. #  EXAMPLES:
    , d- _% p, |! ?! c6 m# n/ v" S8 S: W
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    # U8 |2 j$ {) b: ]* N
  86. #                                    # in position 2 of "Actor2" charset.
    7 w8 j& a: ?5 @+ y$ r# k
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of. a4 |" A% N) T( T* T8 w
  88. #                                    # "Actor4" charset.
    6 ~) T% z) c" j& p4 j8 A: A  k/ {2 I
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    5 g  z$ R1 E! d% p6 a$ i  I
  90. #                                    # "Vehicle" charset.$ Z4 S% h7 G3 H( W7 z7 |
  91. #------------------------------------------------------------------------------#5 y  u& t/ h7 i' A' I/ Y
  92.   
    : M" v- H) C) I; _; T
  93. #------------------------------------------------------------------------------#
    ! C& _  o  R/ J; r
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    6 Z. P3 h! _$ O$ R- [3 _2 }: D
  95. #------------------------------------------------------------------------------#
    1 n' n" x6 c  u; E+ c
  96. #
    ( U3 r6 S/ `' u4 x0 K7 t6 B
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    " ?+ i. c+ s' q( Y8 l+ |
  98. #                          # use this to specify for mirror and reflect.  q: s8 Y$ @0 S6 p" @! O" @) K+ r
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    - N7 M! z/ c) h; F/ j. V- _
  100. #                          # to change all events use :all. O0 f% q9 Z7 ^: j& A! B
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    * w1 R. a1 p" H; R; I/ o
  102. #                          # it 0 for no icon.7 R1 ^/ w( ]* r8 _/ r! O& K) J
  103. #
    1 G5 ?1 l: R$ l+ j( ~
  104. #------------------------------------------------------------------------------#
    ' \% C3 n4 h8 P7 z6 H5 r6 L
  105. #  EXAMPLES:# e3 y7 N6 v/ Q# o
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    " a# ^* a% t$ M& N; s
  107. #  shadow(1,false)         # Turn event 1 shadow OFF' o6 P: y0 E7 @' U6 d3 u1 G
  108. #  reflect(:all,true)      # Turn all event reflections ON
    3 ^: G! o' U- {9 G
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    6 }& S4 q3 ?* [3 U* U- x
  110. #; z: j( X$ ~: [9 D
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering, `1 A' `- w$ P
  112. #        a map. This is a design decision to try to keep lag to a minimum. You9 d% X5 S& y8 T4 d9 i; A
  113. #        should use these effects sparingly and only activate them on events# Z* K: C" l( {9 a7 u
  114. #        that require them.4 N" d3 J5 X2 T
  115. #------------------------------------------------------------------------------#
    0 C5 ~, b: `. \; X2 {! S
  116.   * P5 p) @5 p/ w
  117. #------------------------------------------------------------------------------#
    6 Z; K. e1 \- L4 v, M+ D6 d0 l
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    7 R5 g8 E& m8 s  v7 P6 e& n
  119. #------------------------------------------------------------------------------## W4 I: a  v3 C0 P9 U0 b9 L/ z
  120. #4 u: _" c; f' ^0 u8 h
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    4 p" a! [. x! R2 U
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    - h5 G. n0 M* F" [% E9 [. W" M
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    ) H( _( A  o6 e: ~/ @' @& }! @. M
  124. #
    " ~& [( L6 p% L6 o
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects) F1 B0 \! Y2 b2 ~. d3 g# C
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.3 W2 a" T4 R6 a: H
  127. #  v_icon(x,x,x,icon_id)
    8 R$ u1 K6 z/ E+ ]5 L: g; w& {5 M
  128. #6 f: h" L5 c2 t; D' U: s  a
  129. #------------------------------------------------------------------------------#
    0 v: h& \" A! B- p3 i1 ~
  130.   - u/ r+ L  _' F0 n
  131. #------------------------------------------------------------------------------#- c7 n* K1 w1 o  k; ]
  132. #  SCRIPT CALLS for shadow options
    8 V) ^' ^6 d+ r+ ?( N' B
  133. #------------------------------------------------------------------------------#
    ; z$ ~- W. D' K; k7 u# [: ~" n8 ~  n0 i
  134. #
    & n% _. f6 Q4 s0 d7 B. u1 a
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the . T! Y8 X2 u; z( A3 x! o# U
  136. #                              # light source number you wish to change (for# Q( O# Z; u  J8 q, t: P2 C  q
  137. #                              # more than one). These are reset on map change.& v5 U: G' n" c
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    ) ?0 r% N7 k& W
  139. #                              # This will need to be in parallel process if you
    : [5 D! c; d- i7 k
  140. #                              # want it to be a moving light.
    6 p, A' a' T2 |
  141. #1 P4 Q5 T0 U+ j
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below  E* L! T) r, s0 O, u
  143. #! ?5 A) v7 h" i
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    & m5 @. ?+ p: J) z
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    : h7 v6 r! N" H. n4 b6 B
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.1 P! d. E' w, ]' \4 d
  147. #
    . e: M# E$ T/ @8 J
  148. #------------------------------------------------------------------------------#( O+ ?2 A! e/ R+ C
  149. #  EXAMPLE:
    6 s+ a0 e% u) @1 W5 f& Y& Z
  150. #  shadow_options(80,10,false)    # This is the default setting.0 `- |/ {/ L- g7 t  W
  151. #------------------------------------------------------------------------------#
    & Y3 i# m" _+ I  t& R* G: V' P
  152.   
    8 N! M8 Y" q8 i% k
  153. #------------------------------------------------------------------------------#' L, ]3 `; a' K# Y/ N/ f+ ~
  154. #  SCRIPT CALLS for reflect options
    % R# I) m* K. J2 s3 M
  155. #------------------------------------------------------------------------------#/ r+ t9 `1 z" i' S7 z1 m1 G8 e
  156. #- B4 G  }! l/ |* x) |( Y8 H. s4 |
  157. #  reflect_options(wave_pwr) 9 X# u( O8 H& n+ a7 Q
  158. #5 [& ?0 m( _' s! V0 [! L( O" T
  159. #    # wave_pwr = how strong the wave movement is. 0 is off5 G; O& `7 R% v) Y8 c
  160. #/ b) p6 |, F. ~- A. @- Y
  161. #------------------------------------------------------------------------------#
    % t0 N/ V) a, ^: n$ G: H
  162. #  EXAMPLE:
    1 x, \, u# c4 }3 p5 `
  163. #  reflect_options(1) # Turn wave power to 1
      U! N9 N; y  Y8 ?) z5 u8 Y: E
  164. #------------------------------------------------------------------------------#% j- s& _6 A0 z  S1 Q  z( @
  165.   
    + V# }) s3 U, X7 k8 N7 z
  166.   * H( K0 J' a' h/ A  R0 ^% T/ A( b6 q3 y
  167. #------------------------------------------------------------------------------#
    & P# H; d% n* L" ?9 N4 s6 H% c: r
  168. #  NOTETAG for ACTORS
    + D' E8 Q2 h+ K* v3 r
  169. #------------------------------------------------------------------------------#
    0 i/ }7 Z2 E9 G
  170. #
    : S% S$ h- }6 m$ G0 U( v
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    ! ?8 ^' y- v7 `# A
  172. #
    # @+ t4 K8 m/ R/ ^, v
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections! |5 ]: [7 [# V
  174. #                                  # and use the character in position 'pos'! C$ g& U) ]! S7 I$ ^
  175. #
    # o( @9 h' ^$ {6 y' Z9 U
  176. #------------------------------------------------------------------------------#6 M& ~( k3 u; f& I: e5 i
  177. #  EXAMPLES:
    0 E( t1 ^" |: {& X! c" z
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset4 p, V) x; k1 F" {% u
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset. _* K- j+ ?; A" n! V
  180. #------------------------------------------------------------------------------#
    & e' P. c5 z: q$ B- f& G
  181.   
    8 G! Q. j( L* g9 E  R# j
  182.   
    9 y2 g" m" x, V$ Y5 R- M; p: d
  183. ($imported ||= {})["Galv_Character_Effects"] = true4 Q, Y2 }' K* U# R6 ^: [
  184. module Galv_CEffects& v- ?+ C% e/ A+ m6 v
  185.   6 c8 K: Y5 n0 {/ `1 _6 L
  186. #------------------------------------------------------------------------------#  
    7 n+ g6 s7 [9 K  g
  187. #  SETUP OPTIONS
    7 t2 o; C' w) s% M# O
  188. #------------------------------------------------------------------------------#
    8 E+ P, I9 t8 P# m; h: Q
  189.   
    8 H* P* k/ e; I
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the$ N( N' S, N6 E6 |, ]4 Y
  191.                         # region on the wall you want to make reflective (and, x" H  ?9 d/ l
  192.                         # then use tiles/mapping that make the parallax visible). J% G; v" _+ n% K8 Q: h# }4 Q8 p( x+ z
  193.   % v7 V  |  v  I5 q6 T6 A8 r) R) m
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters5 S& x/ v% w0 v7 m; k
  195.    
    8 A9 |. k! j1 ^. Q
  196.   REFLECT_Z = -10       # Z level of reflections
    + k; F1 R! [8 R8 f
  197.   SHADOW_Z = 0          # Z level of shadows( ~# X6 F- a3 t) X
  198.   ) z! E* D& Z3 X" n
  199. #------------------------------------------------------------------------------#  
    ( m  b5 ~) b  T8 b2 x7 D6 `
  200. #  END SETUP OPTIONS6 J  ~# E' Z0 q4 p6 T
  201. #------------------------------------------------------------------------------#
    7 Q1 L. O; G- ]8 v2 |6 c& V
  202. end
    4 u" V5 G# _3 H1 r# X5 f) T
  203.   
    ! q7 |4 s( l8 b1 q" M4 U* R- \- U6 X
  204.   
    ; o, N7 \* |! ^; y6 w9 ]

  205. 4 ?/ J0 ?! d- w% M1 q

  206. ) ~* C9 i: ?1 Z" J/ E" V& I
  207. class Game_Map
    6 C2 h* ^8 q7 p8 h' \
  208.   def do_icons(refresh = true)
    4 h9 U2 @4 ?, B
  209.     @events.values.each { |e|
    - [0 G. Q, p* |5 r
  210.       next if !e.list; z* x1 g: h% C- d4 P! M
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    2 `7 G6 U. |4 |* C: J0 f; e6 X9 H$ w
  212.         e.icon = $1.to_i
    % F! ^# R4 x3 A! n- L5 P$ T
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    & h" E' Y' w  D' a/ z, Z/ q
  214.       else& ~; a+ B( y: [6 B$ r! S& p  q
  215.         e.icon = 0  Y5 N5 n$ P& s* Z
  216.         e.icon_offset = [0,0]! Q7 t- m- v2 G6 I; c2 n7 B% Z6 j
  217.       end
    % V5 s& q) K' e% a; W2 Q# ~
  218.     }
    ' t7 E: T. z7 S% n
  219.     SceneManager.scene.spriteset.refresh_effects if refresh) z6 u7 n3 B( L6 b! O9 E# m) J
  220.   end$ Q4 T0 U- ~# O0 o" W
  221.      f' Z0 g8 ^9 J/ H! P% A. e
  222.    
    9 i* l: B2 i" u# t4 w, j3 a
  223.   def do_shadows(refresh = true)
    $ ^; d7 m3 O$ I/ r3 y/ z6 e. A9 N# G
  224.     @events.values.each { |e|
    # ^, ]( Y7 K* d$ w
  225.       next if !e.list% [2 X! c+ H4 S/ Q: Q8 H
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    ' F/ }7 p) r7 b: r) B: i9 A
  227.         e.shadow = true1 B2 G) C& a7 m' {' P3 h
  228.       else
      @. o+ m/ b! U1 l; r, ^( b
  229.         e.shadow = false% Z) H& V3 m. F9 s
  230.       end
    - C  O6 ?9 ]1 u$ @* ?
  231.     }2 l8 r$ B& x  G$ W6 O8 |1 ]4 a! ^
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    + N$ g% S0 \. j
  233.   end7 ]$ Y3 F: u% {: `  c0 X
  234.    
    4 i: W+ V. f( }& B0 H9 Z$ n
  235.   def do_reflects(refresh = true)
    ! Y8 s+ E/ A5 n5 l6 m( q0 V  ?
  236.     @events.values.each { |e|
    # Z7 Y5 F+ f# z  A
  237.       next if !e.list
    6 C4 [5 \0 [2 q; f/ M  A: C8 s0 y0 K
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/. _! o! N' `6 Y4 J+ ~6 F
  239.         e.reflect = true
    . r$ [8 K" d' \. Y
  240.       else
    ) \. \; ~' ]3 L# H/ v* v' V4 O$ {
  241.         e.reflect = false
    " c+ z" o" T* z- q2 J- q; b
  242.       end; E6 ]6 T8 Q7 S& @
  243.     }
      T1 v8 a9 a0 u) @; I
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    : ]3 a! ]: p/ i7 e$ }5 m$ ?0 I
  245.   end' i' e9 V: O) W- k% v
  246.    # Y, }# y2 O6 E
  247.   def do_all_chareffects# L( t2 \& |6 l
  248.     do_icons(false)
    0 R- O% j$ z/ ~/ p5 T3 n* X8 v7 f
  249.     do_shadows(false)
    6 v& k/ z- t9 t0 g5 G7 Z2 a% s
  250.     do_reflects(false)
    + E6 m, u. M3 ]. K9 d
  251.   end
    / {3 I6 N- u7 a3 i
  252.    $ M- _+ Z: w4 O/ S' H
  253. end # Game_Map/ r, P5 ]" V$ G' E: z

  254. ! }" l9 ~7 d8 N6 K% ?0 a6 W

  255. + l) h: X( |4 O- y+ A. I

  256. 6 E: `6 T/ L% Q( m5 O1 G% i
  257.     O- P  q3 h2 j5 ^0 Y
  258. class Game_Interpreter
    1 r/ B2 W+ Y4 N- ~" {
  259.    
    6 }2 ^# H4 }- q
  260.   def remove_icon. X5 {; x& \4 L
  261.     icon(@event_id,0)
    # t' g0 M( q/ A+ I1 ]7 w2 ?
  262.   end$ O. l9 A$ I( |% N
  263.   8 }; G' H. S) M9 v6 k
  264. #-----------------------------------#4 E* k# o* P* o8 O* H
  265. #  REFLECTIONS
    $ A+ H' x1 d! Y4 z2 N
  266. #-----------------------------------#
    ' c6 }( d* e, }9 }; s# Q0 U* k3 Q: g
  267.   
    / Q! Y( D! V( a% ]2 i; P; e; b
  268.   # Add/Remove Reflections from selected events
    $ L& O6 K7 Y4 Z- r# m
  269.   def reflect(*args,status)6 ~3 x3 G0 d, u5 I: x
  270.     char_ids = [*args]  o- t7 z2 j8 P8 ?2 n
  271.     if char_ids == [:all]$ k; a; d. C/ m" }  Y
  272.       $game_map.events.values.each { |e| e.reflect = status }
    : g! h  J9 q; ?* M
  273.     else
    5 h) R' l: O% d. G; m
  274.       char_ids.each {|c| $game_map.events[c].reflect = status }* p6 |0 u- R$ ~( `
  275.     end
    ' i5 H$ k. {, ^& f$ X6 e2 U
  276.     SceneManager.scene.spriteset.refresh_effects% B: Z. b7 O0 [% K4 `  |
  277.   end  r% s% x- _+ K1 y+ a, W
  278.     2 r. f3 n2 L' D: j; U
  279.   # Change forever actor's reflect status# `2 i" i- M* a( K7 N3 W
  280.   def actor_reflect(actor_id,status)
      b2 @! r! C' \2 u8 M( h* p1 w! I- ^
  281.     $game_actors[actor_id].reflect = status
    3 Z0 s* z, C/ D% n  \  Z; |" T
  282.     $game_player.refresh9 Q3 y! e, V- |, G4 @
  283.   end+ c6 i* B( Z7 |. G: e; w
  284.     + C; N9 y  }* j9 W2 M  q! N
  285.   # Change forever vehicle's reflect status1 s" V$ Q; M$ B1 W& @, }
  286.   def v_reflect(*args,status)% Y2 V8 [+ @7 E5 r& q$ K" E1 W! c; c
  287.     char_ids = [*args]5 P( q+ F8 d; O
  288.     if char_ids == [:all]! F" m/ I7 N2 S
  289.       $game_map.vehicles.each { |v| v.reflect = status }4 _' ^: R% [5 M: X4 }
  290.     else# U2 T  _! y& a! \9 k2 a. ]
  291.       char_ids.each { |v| $game_map.vehicles[v].reflect = status }6 Z$ j, j! }! p8 ]+ ?9 @# l, l
  292.     end3 a' a0 A: G0 Z$ M# a. s
  293.     SceneManager.scene.spriteset.refresh_effects7 }  ~4 n( Z7 I% V6 Q8 K5 G( b
  294.   end' y3 c( v4 |# a/ c+ O0 @. v7 {
  295.   
    : b0 W/ ]# g# ^6 _5 N
  296.   def reflect_options(*args)
    4 g0 S/ s7 B' q$ N9 p
  297.     $game_map.reflect_options = [*args]
    7 q! K4 f8 m- u; ?( T
  298.     SceneManager.scene.spriteset.refresh_effects
    ! Z" e) t$ A, L+ ]4 Z
  299.   end
    6 \( U! k; N8 S1 I: l
  300.     * i, f& I) L5 G) C% e, o/ }
  301.   # Actor reflect sprite change; {% N' T8 ^; }$ b: q
  302.   def reflect_sprite(actor_id,filename,pos)
    ) a0 ^4 S# G' |" q
  303.     $game_actors[actor_id].reflect_sprite = [filename,pos]
    ; H% O# a- O$ \
  304.     $game_player.refresh
    4 q$ G' J+ x. j8 N# v8 U
  305.   end
    " k. E$ n4 s/ d- v& d7 p, W- O& b* }% M
  306.     & r3 e0 w* }  `# f' i
  307.   # Event reflect sprite change
    7 }: A- d+ }8 @9 ]6 ^
  308.   def reflect_esprite(event_id,filename,pos)
    - ?2 @4 i8 ?  r% u. K- w
  309.     $game_map.events[event_id].reflect_sprite = [filename,pos]* ^5 T  n: M0 S
  310.     $game_map.events[event_id].reflect = true
    4 u6 c* _: P6 k% i; Z, @0 m
  311.     SceneManager.scene.spriteset.refresh_characters$ P) ~3 ]7 T, v8 n" S
  312.   end
    : B+ A& h2 x) _' c, |
  313.     ( L4 C" l. a! F" C3 Z% k
  314.   # Vehicle reflect sprite change
    , F4 I/ I6 z  Z+ ]# T" F
  315.   def reflect_vsprite(v_id,filename,pos)/ B) O5 G2 ?* H) f/ U
  316.     $game_map.vehicles[v_id].reflect_sprite = [filename,pos]
    8 |' ~' n. G7 x& K- k* X
  317.     SceneManager.scene.spriteset.refresh_characters& H4 c+ f# c' V7 e# N6 v0 K
  318.   end
    % F1 {7 z6 G' W" z0 \! N- B' z) F' U* }
  319.   
    / v8 {# ~- v9 q! z, p: ]
  320. #-----------------------------------#
    " G1 D3 C/ {7 u9 U" q2 C2 ]
  321. #  SHADOWS
    - C' D- l6 g- d. t
  322. #-----------------------------------#
    ( n+ U) M4 [& [. t1 y5 i
  323.   4 e' c0 H5 q0 D7 ^
  324.   # Add/Remove Shadows from selected characters! h1 M8 N1 @9 R& B
  325.   def shadow(*args,status)
    4 Z& P3 U; m8 J1 ^) z
  326.     char_ids = [*args]
    ( K: c) K% W$ [* i% U
  327.     if char_ids == [:all]
    4 u4 U+ R1 o. M" G9 |' j& f
  328.       $game_map.events.values.each { |e| e.shadow = status }
    0 A" k: t$ k( s1 F2 r" i
  329.     else( ?( K1 x. H) M
  330.       char_ids.each {|c| $game_map.events[c].shadow = status }( e/ h$ x( i3 X% N" v  U$ o! z  [$ q
  331.     end0 K9 n% Z4 j2 e, x
  332.     SceneManager.scene.spriteset.refresh_effects; x  {0 z6 f) |8 u/ d' t5 u& _$ ?
  333.   end
    ; s' K: Q( ^* H7 m2 z
  334.    
    8 }+ F% O+ B! \3 e
  335.   # Change player and follower shadows" w7 w+ c) \# s& ?4 C
  336.   def actor_shadows(status)
    6 w* n& q- K- u- r0 d
  337.     $game_player.shadow = status
    ( \) n2 X$ _: H6 h: |) V
  338.     $game_player.followers.each { |f| f.shadow = status }
    4 C6 j% t/ P, W8 L- b9 e. c
  339.     SceneManager.scene.spriteset.refresh_effects1 t+ e+ u+ T2 p3 R" c, l5 a
  340.   end2 F- h/ Q0 M- B. g/ ]2 {  d% U+ m$ M
  341.     ' t6 g. U- E$ x5 Q* j0 w5 F; R
  342.   # Change vehicle's shadow status+ L7 T# ]. _5 ?4 A
  343.   def v_shadow(*args,status)7 m! y6 z  S% }  }% r
  344.     char_ids = [*args]8 D5 p  p, K' Y. Z; ?/ z
  345.     if char_ids == [:all]
    7 v( ~2 \6 c4 q( z
  346.       $game_map.vehicles.each { |v| v.shadow = status }
    ; D% J2 V; k6 l9 B4 `7 \
  347.     else0 [7 A+ v5 [8 t* v( b7 `* g- @
  348.       char_ids.each { |v| $game_map.vehicles[v].shadow = status }
    " [6 b+ ^. c5 [
  349.     end
    ; G, z1 D: e  n$ v6 _( y
  350.     SceneManager.scene.spriteset.refresh_effects
    8 z/ w, N/ N) M- B5 P
  351.   end
    , W% ^2 ]0 R: {' B9 _; ~
  352.    
    ! C0 C& G+ A0 U, n- F2 ]
  353.   def shadow_options(*args)7 `8 z" x9 A/ E' z/ m
  354.     $game_map.shadow_options = [*args]
    4 |) Y- B2 h6 D; m
  355.     SceneManager.scene.spriteset.refresh_effects5 U- g- Z9 {+ {/ X& E9 O
  356.   end
    3 N# {1 i! \6 j% X2 h6 d
  357.   1 b9 H4 \" i) d8 y) h' Z
  358.   def shadow_source(*args,shad_id)
    ) n- w$ I- ^' M; I4 D
  359.     shadsource = [*args]" H. ]; C% _- y  E% Y
  360.   7 e% u# g8 u+ m! A; x$ A  p
  361.     if shadsource.count == 11 M4 P% s; Z, q
  362.       $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,
    6 O6 V! x# U0 x* g
  363.         $game_map.events[shadsource[0]].real_y]
    / e6 C, V0 ?9 a' x6 z* s2 o
  364.     elsif shadsource.count > 1
    . `' M& W6 f& S+ t3 G5 C+ M
  365.       $game_map.light_source[shad_id] = shadsource
    - g# j  S5 b5 t4 W  R3 H
  366.     else
    8 D) Z" d1 V/ g  s9 y
  367.       $game_map.light_source = []
    0 g1 A! }2 o+ C% k8 n
  368.     end
    3 _4 s& M: }& ?; E, M- Q
  369.   end1 I; c# v$ B: \( Q" `" s/ p
  370.   % s3 t4 c2 \( b; w' O0 `9 F% V
  371.   
    6 {/ B8 p: F. E/ N9 K
  372. #-----------------------------------#
    3 x1 k6 A( \+ q6 p  Q/ ~1 @, S1 b# w
  373. #  ICONS) |+ V- ~; E' A3 |0 p3 m
  374. #-----------------------------------#
    & t, s9 }3 ?1 j, g* h
  375.   + _7 |" s; s  T" e: Y+ i; J. H
  376.   # Add/Remove Icons from selected events
    % @( u7 c# d& F6 @& q
  377.   def icon(*args,icon_id)
    & R% B- J9 k7 w3 i; e. S
  378.     char_ids = [*args]
    7 w* g  H, d1 i0 Y
  379.     if char_ids == [:all]
    " G. d) K- p) T! j. p- x
  380.       $game_map.events.values.each { |e|2 V! l# W; U& q! e  o
  381.       if e.icon <= 09 \" H+ a2 v1 Q7 E6 v4 C5 M
  382.         e.icon = nil1 d' {0 k. v2 d, h
  383.       else
    . ^% P8 a# K6 W) A
  384.         e.icon = icon_id% Y7 P& d- i1 L- n) x1 K
  385.       end
    9 ~; I, M4 `7 ~  ?
  386.     }
    ) q1 F+ o0 E- A$ f; `% e
  387.     else
    6 b) g8 {) c9 Y+ T" X$ z4 N, J4 l
  388.       char_ids.each {|c| $game_map.events[c].icon = icon_id }: B3 U4 j3 R' B2 R+ {
  389.     end" }5 Q1 s2 h2 R+ I6 e7 K
  390.     SceneManager.scene.spriteset.refresh_effects6 `: s" R# K  i" r/ P
  391.   end  l0 s$ {% D' p9 l0 ?
  392.    
    0 t9 Q1 v% ~. w: H  X, G
  393.   # Change forever actor's icon6 r7 [, w# f  ?0 O* ]% J, F
  394.   def actor_icon(actor_id,icon_id)
    ( h4 u2 n% O5 T+ @
  395.     $game_actors[actor_id].icon = icon_id/ t: x& `# b% k. u0 C; Z3 q8 R5 s. ^
  396.     $game_player.refresh2 R9 b' o9 k* B3 T! @# W: L
  397.   end. ]% g; B; S& I! J/ a1 k; [
  398.    
    : `8 L' h3 D1 P' B7 d9 s
  399.   # Change forever vehicle's icon
    ( S' E! a# z# I% `
  400.   def v_icon(*args,icon_id)
    ' {/ q$ l8 Q" [2 {. r9 F5 a
  401.     char_ids = [*args]
    ( C, `6 c( N% d/ T
  402.     if char_ids == [:all]! r. b5 Z; w& C% {: F0 M3 O) _
  403.       $game_map.vehicles.each { |v| v.icon = icon_id }
    1 P. Y8 Z. t+ @7 g
  404.     else
    + a7 M3 B/ J) Q) C8 s
  405.       char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }
    : `" n9 C1 N% P! T' S& f
  406.     end
    . q# B' g' A- N4 ]2 J$ b  w' z
  407.     SceneManager.scene.spriteset.refresh_effects
    ) Y4 c/ _; ^  M7 Y$ o( ~" h$ u5 _
  408.   end. F3 b5 [+ j2 B9 |
  409.   6 i& a/ i  h' }' s. O
  410. #-----------------------------------#
    ( @, p  H) @' o  n. m' I8 I
  411. #  GENERAL
    & _7 ?6 w( h% c& C
  412. #-----------------------------------#
    4 H3 ?+ B4 R+ f( A+ k, H" L
  413.   
    ) k4 x4 B* u; S; M! ^7 O
  414.   # Turn on/off effects
    1 L, E) O+ C4 g- p
  415.     # 0 = reflect, N. @" E0 J: G5 @* M
  416.     # 1 = shadow* R$ a% p5 i4 V, V
  417.     # 2 = mirror+ p: x% }* v. V8 Q  b1 Q: D
  418.     # 3 = icon( E9 N% A) _9 X0 v# z5 M1 \6 ]" T
  419.       
    ) a. h2 |( J! `9 |) z( @4 ~  Q4 [
  420.   def char_effects(*args,status)
    % D0 {* {# t. `7 V
  421.     [*args].each { |e| $game_map.char_effects[e] = status }
    : h) R- K( h$ B, g5 I# D
  422.     SceneManager.scene.spriteset.refresh_effects
    : Y  c2 ]& K5 M8 ]& h: B# b2 n# f
  423.   end
    " k& ~3 x+ J3 R  m7 w  u
  424.   
    0 L5 ^3 T) D% {
  425.     % i9 L: h1 G' ?& V9 N3 ]
  426. end # Game_Interpreter7 u' ?$ u- h& P4 Z: Q. S
  427.   6 \, n5 o# w$ m+ j; f/ X4 B
  428.   
    3 N+ L8 G6 S' c: _& ^: S: i* m
  429. #-------------------------------------------------------------------------------
    ! x, k, `' A# F
  430. #  Spriteset_Map2 p) w, x: Q. u1 i/ o. F- i
  431. #-------------------------------------------------------------------------------2 O& V6 m1 c5 A1 w% K/ P- X
  432.   . e6 Z1 I! g* e
  433. class Spriteset_Map
    - d) p+ k0 b: R, _9 R2 v
  434.   alias galv_reflect_sm_initialize initialize9 B; l4 s4 p) w9 ^5 j  |
  435.   def initialize
    # E4 }9 r! w  r6 V5 L
  436.     create_effects
    5 Q$ d* x5 C1 F
  437.     galv_reflect_sm_initialize
    ( y9 s, ?3 \6 U1 M2 A1 Y
  438.     refresh_characters
    : f! [: u, g7 ^( C% U
  439.   end
    7 D+ |/ z7 g2 B3 m7 v2 z
  440.    
    ! }. [; H! k* c, N1 e4 e& M
  441.   alias galv_reflect_sm_refresh_characters refresh_characters- o9 }7 u* a* l
  442.   def refresh_characters0 S2 ^& ?% }/ @/ K
  443.     galv_reflect_sm_refresh_characters
    . X. t; `: X' n3 Y7 r: A
  444.     create_effects0 x% n) l3 P! G& M: o
  445.   end
    / Z( @) X: h' O/ x
  446.    
    & {+ U& W* |6 l5 L! A
  447.   def refresh_effects
    5 X: |" G0 B% [) W* `" j
  448.     dispose_effects, m3 Q3 E" x  m$ `
  449.     create_effects' C9 X6 f' f' q* g: F) F
  450.   end
    6 n; K) q+ _# K4 v) N
  451.    
    9 M9 x7 K  T4 ~
  452.   def create_effects( {* s9 q" g! N; p9 Q+ r, w- w
  453.     @shadow_sprites = []- y6 I1 ]+ D3 h! f
  454.     @reflect_sprites = []# T& j! I0 ?' J) w1 |
  455.     @mirror_sprites = []
    0 M# R" P* q, |* j% k
  456.     @icon_sprites = []
    + A( E! ~' w. E9 W, Q! s% e
  457.       6 h/ f) ?2 w' O! \3 v) y" c/ K% p
  458.     # Do reflections
    : K  `, @" |% s4 y
  459.     if $game_map.char_effects[0]
    . ~9 ^. h: e$ }' V7 c0 f
  460.       $game_map.events.values.each { |e|
    8 r$ p0 {* s7 Q, o7 c
  461.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect
    ! V! O$ m- D' w/ ~3 @- i
  462.       }$ Y, g$ e: \3 ]. O
  463.       $game_player.followers.each { |f|
    0 J" o7 q6 [( G3 J. I
  464.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect
    ' H% ~3 Q" \) O. [: P9 |
  465.       }1 \. l( b9 f5 U2 r" D
  466.       if $game_player.reflect
    * O, Q2 d! p8 m4 z% n
  467.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))
    2 x3 q- D' s0 G* ^- ~0 g
  468.       end3 ^) I0 `! b5 q2 o( k$ C0 e; a$ t
  469.       $game_map.vehicles.each { |v|
    8 V5 v, x- T+ p  E. N0 b0 ^6 v
  470.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect& N5 |- }1 G7 H( q5 A- R( d
  471.       }1 ?1 }/ B# f2 ~: p' Z! t8 z2 o
  472.     end
    ! ]( r- M, n; _* e) f7 i+ Q
  473.       
    * L1 M0 j1 |0 J! M4 m/ L6 p* K" x
  474.     # Do mirrors
    ! C' h8 X9 K* v5 k* c
  475.     if $game_map.char_effects[2]. O2 o% G7 ?4 M/ Y; p9 D' \& P
  476.       $game_map.events.values.each { |e|
    # `% R! f2 n8 V. [
  477.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect) s, r' I, ?! T: |. M0 h+ L
  478.       }
    9 o* Z4 c+ M- w. ^5 p3 ]) z
  479.       $game_player.followers.each { |f|
    2 O1 O" r2 t& Z6 E9 v4 x
  480.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect
    0 X  P; N  D7 c  F. g
  481.       }
    ) B0 H  D4 ~  }
  482.       if $game_player.reflect
    2 y  \/ p8 t' z
  483.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player))& e) e4 K$ B( @. y% p
  484.       end% D# k5 C' R. w* U0 Q
  485.       $game_map.vehicles.each { |v|
    ( _& N6 F: L5 [% H, f$ G7 V8 G6 h
  486.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect
    6 w3 t$ g" R% E: D
  487.       }" q" w' @0 u7 }5 T
  488.     end4 z- H4 B. R  J6 U0 ^
  489.       
    ! ~4 E% w! z6 O* Q
  490.     # Do Shadows
    - u% `/ C8 c! `, l
  491.     if $game_map.char_effects[1]
    $ I& P3 H" F7 a0 ^' s) ]
  492.       return if $game_map.light_source.empty?
    ! _: v2 C) w3 z7 a1 G
  493.       $game_map.light_source.count.times { |s|- r* D9 h( ]3 P( [2 J& [! ^$ m
  494.         $game_map.events.values.each { |e|
    1 d) @8 K: j& ^) C
  495.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow5 W0 i: X: U* T9 f# ?6 {1 b8 S
  496.         }
    , L! N- q( V1 m0 e- }
  497.         $game_player.followers.each { |f|  ]# B% R' ]" g& L; B' M
  498.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow
    + d( ^" S2 f7 n" Z
  499.         }) `$ e8 O1 [7 s+ g3 @' ]5 g
  500.         if $game_player.shadow
    9 \  \( R5 x! x' a% Y' A
  501.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))- G# R+ O1 q% b! Z) i
  502.         end
    ; A* P7 [5 j1 i( G
  503.         $game_map.vehicles.each { |v|
    , l; e( @. i: O% G; H  R  U
  504.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow
    5 q1 _% r; `5 r1 e
  505.         }( ?; A$ B, n1 i  w' w- @0 W8 j+ x
  506.       }
      H' n: A' t* G& i4 W5 b# t
  507.     end
    * R/ U- R* v0 `( d
  508.       ! L8 S1 E) P8 }4 [! o1 _
  509.     # Do icons
    . c2 i) F1 C4 J- \. p2 L
  510.     if $game_map.char_effects[3]
    ; [1 C2 A; |- r) C5 ~# m1 m
  511.       $game_map.events.values.each { |e|
    $ T/ G7 z9 b( Y
  512.         @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon
    - y' {5 O5 E( u0 V/ c4 l
  513.       }
    & ?. @' A% t! C8 E$ W8 T& Q
  514.       $game_player.followers.each { |f|
    5 x& Y' T% K+ F; e
  515.         @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon
    / `# u4 K, j1 P, {( ]1 H
  516.       }; u- V4 G" D4 ^  u; I
  517.       if $game_player.icon5 g7 c( Y, ~5 g: S9 |8 L" O
  518.         @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))5 y1 B% o1 D' o  A) D3 l
  519.       end
    6 q5 h2 }# @/ d: @# l- w; P) G, [; d
  520.       $game_map.vehicles.each { |v|5 Q# b, S' `* d( T. X9 B
  521.         @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon
    ) U- u- J/ N% B6 w; v" o+ T6 w
  522.       }1 x0 R) E* d/ f
  523.     end
    - A# x+ `& p8 |5 k* K9 S
  524.   end4 _' `( O1 v* M$ k; K
  525.    
    / Y5 K% C9 W5 Y, j+ N" p3 Z1 H4 a
  526.   alias galv_reflect_sm_update update
    0 M8 |& y9 N1 K( x# T! ?
  527.   def update
    3 C' x6 L# K( n7 }; P* m
  528.     galv_reflect_sm_update
    8 j$ i' O4 G# j  j$ H0 K
  529.     @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]
    0 _6 ^# ^5 ]: N$ i! J! n( N
  530.     @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]: C# q$ I) ]6 x; v. V6 {$ k3 Z
  531.     @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]! R# D, o3 {8 a9 g
  532.     @icon_sprites.each {|s| s.update} if $game_map.char_effects[3], ~( @7 U0 V' b( w8 e0 ]
  533.   end2 x. b, C5 |3 _: V/ G: E. v; o
  534.   
    # G3 J0 W9 M- Q4 a. P! X3 R
  535.   alias galv_reflect_sm_dispose_characters dispose_characters4 K0 q0 L& ?3 Q/ B2 [
  536.   def dispose_characters
    8 N2 T6 c+ L1 }( M
  537.     galv_reflect_sm_dispose_characters
    3 D- `8 d2 o' q6 R5 M6 [
  538.     dispose_effects
    ' w/ L' @9 G! S1 s' ~. b
  539.   end
    ) g0 B$ [/ d% ^2 P# S
  540.    
    ' s, ]8 _) z. I
  541.   def dispose_effects7 d6 c4 o6 `: @5 G" Y
  542.     @reflect_sprites.each {|s| s.dispose}
    + J7 d- h+ I) w" y4 r2 ]( o
  543.     @shadow_sprites.each {|s| s.dispose}
    ! N/ J7 `0 w6 y/ ~7 `
  544.     @mirror_sprites.each {|s| s.dispose}! r9 S) Q2 J  F1 S+ x/ q* l
  545.     @icon_sprites.each {|s| s.dispose}
    . Z% @: h) S: B* Q& [8 Y
  546.   end
    7 Q0 ?3 W( _7 }; x* r
  547. end # Spriteset_Map; Z- S7 `; c. j$ ^% E6 V. y- w
  548.   + G' U  c0 g0 z* W* J1 |
  549.   4 D) Q6 {2 y2 W. h$ N# w4 R! p- f
  550. #-------------------------------------------------------------------------------7 }: b) P+ t4 N0 I
  551. #  Sprite_Reflect 5 \- r+ b$ U9 j( F# h  p
  552. #-------------------------------------------------------------------------------" }" U( d; G  {2 Y
  553.   3 @9 ]+ ^( u+ d# d% O' g
  554. class Sprite_Reflect < Sprite_Character
    + p: H8 M. V6 d% M
  555.   def initialize(viewport, character = nil)
    + D7 ]+ ^1 j# b7 A7 T, m
  556.     super(viewport, character)
    " M" {# p; T/ `" j
  557.   end
    / Z: W7 T1 X0 k5 |3 Y5 d  |
  558.   ) r2 @, `+ O4 }3 w( a
  559.   def update
    4 i+ R5 u: y% ]$ C" C. m& E: Q$ A
  560.     super
    ! A3 f% v9 h$ a2 [
  561.   end+ L4 f7 Z* g# g
  562.     3 k9 v8 Q% e7 x8 h/ m$ j- r
  563.   def update_balloon; end0 q- M9 `0 r- s6 K
  564.   def setup_new_effect; end
    - E4 U9 L& o- D  \
  565.     ! G! n5 Z4 ]- H- N! a
  566.   def set_character_bitmap- a5 M3 k: C( h; |% I) K4 Q
  567.     if @character.reflect_sprite
    5 }. x' l+ A3 [6 e" H/ L! H
  568.       self.bitmap = Cache.character(@character.reflect_sprite[0])
    8 `" }2 C4 o& s/ r
  569.     else* S' j/ r+ o( l  O) p- U. i9 L1 s0 f
  570.       self.bitmap = Cache.character(@character_name)
    6 z+ m5 a# ^; w# {) A- s3 z
  571.     end2 R8 e  n3 J8 E0 g4 g% f& r/ G
  572.     self.mirror = true
    ( {& @, [1 u  C% q
  573.     self.angle = 180
    . S' k; C% e4 ~# Z* ^5 W. d
  574.     self.opacity = 220! j4 F& R; X) {# X
  575.     self.z = Galv_CEffects::REFLECT_Z
    9 V* ^& w# g+ C$ s% ]) G  W" p
  576.     self.wave_amp = $game_map.reflect_options[0]" V& F8 t1 @1 E: t# I5 t
  577.       ; ~, z1 R: j+ j! v9 {& D
  578.     sign = @character_name[/^[\!\$]./]2 Q, T" @: v/ ?
  579.     if sign && sign.include?('). v0 Z+ y. x% {3 a( I! s% h# K
  580.       @cw = bitmap.width / 3
    # c6 s2 [9 u8 r$ t; q$ @% c6 V& |
  581.       @ch = bitmap.height / 4( L6 \2 o1 @! k8 `
  582.     else
    1 y( c: H' X. m$ {$ ~5 D. F$ h
  583.       @cw = bitmap.width / 12
    5 v; `6 ?+ F. W+ E+ u. i1 e
  584.       @ch = bitmap.height / 8$ d" c7 [- X4 m% p7 {8 S0 l5 ]
  585.     end
    ) X% B/ y1 j8 r8 n: t, F
  586.     self.ox = @cw / 2
    - B) b& N0 o- z0 L8 T' w0 ~* |- _, Y
  587.     self.oy = @ch
      _, l+ N. F: a" l! J
  588.   end- ?$ y9 \. C. S- }4 {  j
  589.   
    ' e8 I2 V2 W3 ~
  590.   def update_position  t; u, n6 s. _3 B3 l
  591.     self.x = @character.screen_x% z2 m% n( |+ i4 m/ B3 u( i
  592.     jump = @character.jumping? ? @character.jump_height * 2 : 0# g( ^8 s9 m0 x& ^
  593.     alt = @character.altitude ? @character.altitude * 2 : 03 G# W6 @. j9 X- g9 Q) ~4 ]& `1 c
  594.     self.y = @character.screen_y - 3 + jump + alt
    7 }3 K! [* Q! L9 m# G4 m% G
  595.   end( h: J4 e: m: P" k
  596.   ) b+ v; o6 d$ s9 g8 ~1 b; ]
  597.   def update_other
    2 H+ w' h4 _; `( G2 k
  598.     self.blend_type = @character.blend_type; O3 }7 ^8 S1 B8 C3 G8 z/ U
  599.     self.visible = [email protected]
    6 E; s9 q0 K  K/ q& t4 U
  600.   end
    , X* n8 ?! G6 _9 ~7 ]( d+ c* q7 t
  601.    
    6 k% A: t. x  N% ^5 q
  602.   def update_src_rect4 N& W) A0 c( L% D* L
  603.     if @character.reflect_sprite
    2 O; a. p/ Q) K9 `9 y$ d
  604.       index = @character.reflect_sprite[1]2 P3 Z6 w, m: o9 k; W2 n  F
  605.     else9 y1 ^- m: p0 @+ s
  606.       index = @character.character_index9 D% f: q7 x. T  z; n1 R7 ?$ {" B
  607.     end* ~: K, U8 G+ G8 t
  608.     pattern = @character.pattern < 3 ? @character.pattern : 1
    . b3 R$ Q, ^9 V* r" Y
  609.     sx = (index % 4 * 3 + pattern) * @cw
    " [! o" I4 _% o/ `" [, j2 Z
  610.     sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch* O1 o/ z* }  G
  611.     self.src_rect.set(sx, sy, @cw, @ch)
    5 T( s& k# o& k# g2 B+ a( N
  612.   end3 Z/ B# ^' T0 [) }4 s6 o
  613. end # Sprite_Reflect < Sprite_Character: H9 A  V4 y3 {
  614.   
    / U6 o7 D9 v5 ~. ~* P& f
  615.   # K5 [/ Y2 U, u. `5 U" [
  616. #-------------------------------------------------------------------------------* Q$ J- ]1 |/ N
  617. #  Sprite_Mirror/ b; \6 e9 D. A8 @/ P0 k* Z. Q& ~
  618. #-------------------------------------------------------------------------------. G- ?; k# T9 P/ x
  619.   3 B  d1 F$ A* S; J& Y
  620. class Sprite_Mirror < Sprite_Character/ m/ O1 u1 P4 q" d
  621.   def initialize(viewport, character = nil)
    # ^1 ^+ w8 l( X* O. E" G
  622.     @distance = 0( B% M2 v5 o& v" W  L
  623.     super(viewport, character)
    6 [/ f6 k6 H- u
  624.   end! o  W: G5 ^  O: n; y) N, @3 E
  625.     e5 X5 Y" S% ^9 K
  626.   def update! D, e! L, u7 d$ H! }
  627.     super) d8 k7 s, g+ M4 L+ ~! ]8 P: R
  628.   end
    : {( p  k* p/ O% C, L* y
  629.     ; [6 R5 r" F* I- p. c4 p$ O
  630.   def update_balloon; end3 C$ m2 Y) @5 y$ f! p+ B( H7 ~* F
  631.   def setup_new_effect; end" X% a) _) ]  A
  632.    
    , ^# V: Y/ w0 K+ l7 ]; L. N
  633.   def set_character_bitmap6 h' y2 L$ [5 e9 Y: j
  634.     if @character.reflect_sprite; z) |6 e* K5 y& q0 d
  635.       self.bitmap = Cache.character(@character.reflect_sprite[0])
    4 S8 A* u/ y  }# B, f
  636.     else
    : m* h' r9 y2 B  P
  637.       self.bitmap = Cache.character(@character_name)
    ; G7 F$ ]. Z5 b6 p( d
  638.     end
    * k$ P/ M, _/ x: O
  639.     self.mirror = true
    7 Z/ c  N- I9 ~' |' l
  640.     self.opacity = 255
    : x" e# B6 d' j0 }( Q! Y
  641.     self.z = Galv_CEffects::REFLECT_Z
    2 A2 w* p2 K; O, V" v  Z. S- a
  642.       6 v; _7 N  W# t2 t! ~
  643.     sign = @character_name[/^[\!\$]./]: }' G; V# c- Z& `" k; F$ V- R
  644.     if sign && sign.include?(')
    ! y+ O" ?/ y4 ]* ]1 S+ ~. x
  645.       @cw = bitmap.width / 3& I0 f7 i$ M! J- `: s3 s, p
  646.       @ch = bitmap.height / 4* ^" B$ N$ V1 O, N7 r6 Y, b
  647.     else
    # t* L5 \( F. f( F
  648.       @cw = bitmap.width / 12
    # j; A+ o8 H1 @- B
  649.       @ch = bitmap.height / 8
    0 Q  R  f9 Q: w! g  c+ T
  650.     end3 r+ r* h$ g+ A. @
  651.     self.ox = @cw / 2
    $ {, H1 o5 t4 t2 V$ u
  652.     self.oy = @ch
    " p7 E( ]5 [. `
  653.   end- j9 n( ^/ M" F7 O5 }0 T
  654.   
    ' e2 G/ b4 ~- D. {* Z
  655.   def update_src_rect
    1 O$ d2 p/ T# _+ ^
  656.     if @character.reflect_sprite* M, i% X( u& t0 p9 P6 k* P
  657.       index = @character.reflect_sprite[1]
    9 A% _4 r* b3 H; A
  658.     else
    7 \1 u, I  h, X! M
  659.       index = @character.character_index
    , W$ p0 d4 M/ s  h1 R. c
  660.     end/ g+ N# f1 d3 q+ K" ~" C  m) g
  661.     pattern = @character.pattern < 3 ? @character.pattern : 18 V. X- _- `# A" o# j5 C
  662.     sx = (index % 4 * 3 + pattern) * @cw
    1 h2 H) A9 ^, Y2 B# ~7 S
  663.     sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch/ B% q# O) o2 J0 W
  664.     self.src_rect.set(sx, sy, @cw, @ch)
    $ q" f2 S) W! `$ J, {6 D
  665.   end  z- |1 ^; H( R+ K- ]
  666.    
    1 `. P/ j1 S) O4 B
  667.   def get_mirror_y6 H) |" U4 ?% J$ v/ N$ I
  668.     20.times {|i|( s3 H" g( Z7 h, l8 a  ~
  669.       if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION
    1 _/ H' F! m6 P7 r! Z
  670.         @distance = (i - 1) * 0.05
    , g8 Y# ^: M& }) K) c1 i
  671.         [url=home.php?mod=space&uid=502659]@DISPLAY[/url] = @character.y - i - $game_map.display_y + $game_map.height
    ) F9 g" {/ o- H0 H  A
  672.         self.opacity = 255
    / d: D2 W- g+ K1 G. c6 f# u
  673.         return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 4
    " R" O8 ]0 P' ]- k
  674.       end
    ( q( R+ {: ]$ _5 X, `
  675.     }
    ' B5 X2 o& g9 M
  676.     self.opacity = 0( z( R" [% Q% e
  677.     return @ch
    % a: e$ X- {5 Z0 G1 K
  678.   end
    % Z) E5 l0 B) ~0 F1 U7 X
  679.    
    3 |% h  @1 N, [) w# Z) p2 C
  680.   def update_position* d0 B$ ?& h6 i5 N& s& e( G  Y
  681.     self.x = @character.screen_x
    ' G+ y0 M: D( e# A2 p
  682.     self.y = get_mirror_y - 6& o2 y% }# o3 M# j6 g! }
  683.     self.zoom_x = 1 - @distance! F# L9 a2 T/ ~5 s7 b& t+ g
  684.     self.zoom_y = 1 - @distance
    ! q6 }* R: E% C3 G
  685.   end8 d8 P4 h' Y6 m6 Q3 ?
  686.   
    % p  Z% \, S, q( s) C% H& W
  687.   def update_other
    $ N5 x7 r) n3 v0 J! c
  688.     self.blend_type = @character.blend_type
    1 r3 E" W; W/ o8 Y' c# o
  689.     self.visible = [email protected]9 j8 x' ?- [, L# J
  690.   end+ H" V3 H0 P& s" [7 e1 w% c
  691. end # Sprite_Mirror < Sprite_Character! {  q1 H, Q. C
  692.   
    1 ?9 i7 w- X" l  \/ S: e0 s
  693.   6 `( n! v$ r4 s4 x0 |  v: M; S
  694. #-------------------------------------------------------------------------------
    # R3 n* x  h: B7 t/ t* }' f2 U
  695. #  Sprite_Shadow
    : N: j$ H  q5 ^4 f
  696. #-------------------------------------------------------------------------------& f  h; q. @8 X5 y+ S+ D, \
  697.   
    9 T8 ?: k0 Z4 z
  698. class Sprite_Shadow < Sprite_Character/ J( x5 h5 F9 Z
  699.   def initialize(viewport, character = nil, source): J% i' M5 L8 [! U6 g; [7 J
  700.     [url=home.php?mod=space&uid=14094]@flicker[/url] = 0- h- c9 V' D% s) g# [; N7 M' a/ S
  701.     @famount = 0* W- [' @' x% M1 b
  702.     @aamount = 0
    ) @: A3 x) s* d- o
  703.     [url=home.php?mod=space&uid=171370]@source[/url] = source& g# `/ A2 i; h: v1 u/ O- i
  704.     super(viewport, character)8 Y  Z, o3 s: s* x* C
  705.   end
    1 f  r9 v( Y1 m  r0 }
  706.    7 @% a0 Q/ I! ^! d  w
  707.   def update_balloon; end$ Y/ X* w0 G8 o$ C5 V, x7 P
  708.   def setup_new_effect; end
    ) C* Z% k( }# I; n3 Z1 A3 R/ ~+ I
  709.   % P6 Y5 N, k% C3 T
  710.   def update9 t% V" h. M9 R+ j' @& j% c! ~# \
  711.     super- U4 d/ K% Y/ ]. \
  712.     update_bitmap
    + I( e) H" K% s, d! N
  713.     update_src_rect, h9 M8 q9 @' r' l1 B
  714.     update_position* _5 I( c- t: r' y* P* I! W
  715.     update_other$ K% p8 a* p2 q! k
  716.     update_facing
    . ^& W" \. ^7 `. L
  717.   end7 m4 J! ^; S/ U
  718.    ; q9 x; M1 }: f) \' q5 V+ K
  719.   def set_character_bitmap0 }1 B, |# x% z+ z. A# c
  720.     self.bitmap = Cache.character(@character_name)2 f+ E+ {: P" _' l
  721.      , C1 x, z5 n: ]
  722.     self.color = Color.new(0, 0, 0, 255)5 T& p" S3 Q- y, k
  723.     self.z = Galv_CEffects::SHADOW_Z1 n. ~; B5 d+ P# y) T
  724.     self.wave_amp = 1 if $game_map.shadow_options[2]' @- \% o/ I, u5 \/ Q" f8 I  N
  725.     self.wave_speed = 1000
    3 M. R) C) E7 K& [: s5 u
  726.       
    ' r, L6 C% ?+ Q* v2 _4 S% F7 i! _
  727.     sign = @character_name[/^[\!\$]./]* n, k$ I$ ^; A4 W7 e
  728.     if sign && sign.include?(')8 @1 g8 |- G* ]  s( h! b. ^
  729.       @cw = bitmap.width / 3
    ; L, }3 a3 s7 A8 U
  730.       @ch = bitmap.height / 4
    $ R3 D" r7 M! b3 A2 t
  731.     else: E& r% {0 M: M, S6 |; G
  732.       @cw = bitmap.width / 12; Z9 L5 O2 V$ A/ i5 K- L
  733.       @ch = bitmap.height / 8
    + z+ E6 Z  V; N& c* }' N
  734.     end
    1 p' q9 ~; t1 I1 e0 Q- `
  735.     self.ox = @cw / 2# @% x8 N" z' Q
  736.     self.oy = @ch
    . r1 M, Y5 J% z2 t
  737.   end% H( s- V$ l# O2 x: w* G- I8 c
  738.   
    $ w) m7 B3 V! U5 a& V- D
  739.   def update_position: i# r) L: m  K: s8 H* W
  740.     self.x = @character.screen_x7 j& `" h' u# k( W$ D
  741.     self.y = @character.screen_y - 10
    & u  c& B1 b, {' x& @
  742.     get_angle, X3 B2 S; Y- h" X' P( p/ H, s
  743.   end1 _! O7 L1 S4 V& Q" D* g  S% d) T
  744.    
      l4 h$ A* s5 V  Z6 O
  745.   def get_angle  i; _8 w: o4 x3 x" n
  746.     x = $game_map.light_source[@source][0] - @character.real_x
    0 b  S) m2 T! |
  747.     y = $game_map.light_source[@source][1] - @character.real_y
    + r5 o: X* W2 Q
  748.     self.opacity = $game_map.shadow_options[0] -
    1 V  y- K! X  u$ c7 J: c1 w
  749.       Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]7 r0 I. F# v4 H- R# O- J+ t9 f
  750.       0 ]; A' P  T' _, L4 W$ M
  751.     if x == 0 && y == 0 || self.opacity <= 0- _$ t" x. q' A% ?- l( M9 u9 u
  752.       self.opacity = 0
    4 Z' y- W6 K! a7 @
  753.     else
    1 o. L7 n* h+ h$ V$ n% W1 b
  754.       self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount/ R! V3 w1 m/ y' e4 m& a" R' G
  755.     end
    3 w3 }/ t* d& P( g  U9 I
  756.   end  n  s  m: K% z" R! ], @
  757.    
    ) |% F) O$ |1 R& c  V4 i1 D) Z2 _
  758.   def update_facing
    / a( H* o! Z& U+ ?6 J$ u0 b
  759.     if @character.y < $game_map.light_source[@source][1]
    : I. z  U- R% B
  760.       self.mirror = false  T$ I* }  f. O: q& k* h1 j
  761.     else- r3 b0 I( v" _, f( D7 e
  762.       self.mirror = true
    % e: w8 u) }  {
  763.     end
    + v0 Q# Y" m( z0 A" i$ P" J
  764.   end+ w: h+ V/ r/ ^' ]: V0 R8 t' H) D
  765.     ) S. L% H9 o, v5 W
  766.   def update_other$ b$ E0 h/ ]$ H
  767.     self.blend_type = @character.blend_type
    8 Q0 u  w) j6 W5 N% a1 H2 w
  768.     self.visible = [email protected]
    6 v7 M0 [' p# E
  769.   end2 o) d! b4 c  ]( P8 d  m- P2 V
  770. end # Sprite_Shadow < Sprite_Character+ E" J1 d# w1 Z+ K
  771.   
    % J- M/ W" N" d9 L( n- i1 O
  772.     `& {) X* F: H% p# |) o& m$ O2 ~% I
  773. #-------------------------------------------------------------------------------6 G# ]6 m; L5 w! H2 H4 i
  774. #  Sprite_Icon% q  ^0 H7 O+ q
  775. #-------------------------------------------------------------------------------
    . Y+ |. e( S3 L# Z, x/ C
  776.   7 V: X8 d* G& ^5 s
  777. class Sprite_Icon < Sprite_Character
    1 j$ X& w$ d) `/ Q# X
  778.   def initialize(viewport, character = nil)
    6 X' n, e2 F6 l9 X
  779.     @icon_sprite ||= Sprite.new5 Z: {7 ^5 ?( P! A& \1 b7 C2 c. L0 S
  780.     @icon_sprite.bitmap ||= Cache.system("Iconset")' Y" d6 |0 b) |5 p4 Y8 ?# c# K
  781.     @icon = nil  F% t; s  I, G& D. X" L
  782.     super(viewport, character)7 d0 e, o+ G2 Z* K9 [0 z0 s( j' e8 E
  783.   end
    0 T' U8 ~: V0 T" L: H
  784.   $ u0 b5 M2 [0 @1 b
  785.   def dispose
    8 w$ U7 \! o3 w9 E2 \
  786.     super' q3 v! r* ^3 B2 M0 p# p
  787.     if @icon_sprite2 Z, c% ^& O, r6 t( Y
  788.       @icon_sprite.dispose
    0 y: L( K* t6 a* N$ \
  789.       @icon_sprite = nil' j+ r, Y: d8 T8 a+ L# ?
  790.     end
    ( m  k0 L  A' E
  791.   end$ s$ s6 I) C4 d; D: N0 X
  792.     4 F% G6 e) {, F) s. G
  793.   def update9 e/ g* a/ l( [6 C
  794.     super: x, ^. G& S  Q6 B0 Q
  795.     update_icon6 h6 s9 s$ Y7 C; y, z  {
  796.   end
    1 [3 ]. F7 W: i: F
  797.     " z4 w5 Q$ Z: i% G3 i; O
  798.   def update_icon
    ; q7 G, r' f& _) n, n
  799.     return if [email protected]
    " @% Z% ^2 ]% g/ y, f
  800.     draw_icon(@character.icon). [6 c# D/ _5 U2 O; Y- H
  801.   end
    " ^/ }- F9 h. `6 M
  802.     & [& ^* @9 L4 n3 o) h
  803.   def draw_icon(icon_index)& E4 s) M  D2 h3 |
  804.     return if [email protected]?
    # U5 k  g# D) Q' ]5 |- l* i
  805.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)5 Z/ ^8 u# c" ~. ]+ E( B
  806.     @icon_sprite.src_rect  = rect
    - o5 i5 y# S: p/ u5 a" V- p
  807.     @icon = icon_index3 c% j6 T9 T9 \9 r8 ^
  808.   end1 _0 L" s) k7 p& q6 f4 n, w
  809.    
    6 g6 H, m- A/ y
  810.   def update_position8 s8 y- q/ ~5 C: V& Y
  811.     @icon_sprite.x = @character.screen_x - 12! F, `; b4 I& R1 v! d
  812.     @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET
    " ]: l; b' T: S- {0 M9 Y9 R8 g8 L8 D: E
  813.   end
    3 b9 U7 X* n/ P$ x
  814.   
    . c* j2 o( M7 r9 w6 Y, w
  815.   def update_other
    # s4 d) z( _8 O& O$ n7 C/ U( T0 W
  816.     self.blend_type = @character.blend_type
    2 x  u/ ]7 t, ?5 D0 y7 t) b5 G
  817.     @icon_sprite.visible = [email protected]9 P$ g( Q; l$ n0 m6 W2 L5 t- f
  818.   end) k9 d1 K" w  T" L7 G
  819. end # Sprite_Icon < Sprite_Character3 z' M# }- m2 @2 ^" I4 h, H" Z
  820.   
    4 b' k* n6 f* C2 T- l( t( t
  821.   - ~0 v; [, u7 x) N3 o
  822. #-------------------------------------------------------------------------------
    9 p* P1 @( D. d0 A: V2 S  }
  823. #  Other Stuff
    ' M' K) Q/ r& f4 d7 f3 ~
  824. #-------------------------------------------------------------------------------
    * a1 n0 S' ~2 J" K1 T: U* A
  825.   
    " Y5 x- `$ \2 W4 n
  826.   " U5 ?9 b$ B4 X; X9 i
  827. class Game_Character < Game_CharacterBase* J/ E3 Y' T7 ?( D* x. l
  828.   attr_reader    :altitude9 v" U# }* R8 c
  829.   attr_accessor  :reflect
    8 w, _9 {+ n8 J7 A' o3 v
  830.   attr_accessor  :reflect_sprite
      [0 l7 ~( s+ d' R; [8 ?* x
  831.   attr_accessor  :shadow
    & r$ k! j, X0 w2 J( e, k
  832.   attr_accessor  :icon/ P: k, f0 X3 N0 z: A1 D
  833.   attr_accessor  :icon_offset# a: U% [& Z) |, k7 e
  834. end" s# ?* s: x8 g' q9 _6 e6 r
  835.   1 `4 t9 X. Y% |: L2 |
  836.   - R3 E5 Y  o) w0 Y
  837. class Game_Event < Game_Character
    7 J0 t7 m) u/ ^) o- U! M9 n
  838.   alias galv_reflect_ge_initialize initialize
    8 L2 s1 O7 t) ]
  839.   def initialize(map_id, event): Y1 g" b! ?  M
  840.     @reflect = false+ N; V% h" h% i7 h
  841.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = false
    % n: f" H! G- x/ b5 f/ R7 [* }
  842.     @icon_offset = [0,0]1 s& m% m/ O- s, s- @
  843.     galv_reflect_ge_initialize(map_id, event)
    $ X: s8 g' H' z* _! D
  844.   end. ?$ U% G! S! x# A2 N
  845. end # Game_Event < Game_Character* U5 Z1 ^0 R- `2 b# R( T3 \: s
  846.   
    0 J. h8 w: N3 ~4 e, P# K& ?8 |
  847.   
    3 t3 l0 |0 F. P# m4 Q+ \' I7 r, g
  848. class Game_Vehicle < Game_Character) Y0 g3 Z6 |. _9 n3 }  [
  849.   attr_reader :map_id
    5 G! R5 t+ K' R! S! g; \
  850.     2 N( z" i5 ^6 Y; R( ?# Z
  851.   alias galv_reflect_gv_initialize initialize
    ! ^& n0 O7 W; {- x- ?
  852.   def initialize(type)
    - `) m; ~5 R/ t* x" a
  853.     @reflect = true& O$ t3 h5 B$ \% `
  854.     @shadow = true
    . s! R/ U" f4 I5 |/ x" ?# u" u
  855.     @icon_offset = [0,0]0 {, M3 \( `, K! G' l( o, A8 `4 l
  856.     galv_reflect_gv_initialize(type)
    ' ^1 N9 p3 M; P2 V2 i
  857.   end- ?5 t0 {$ S5 X! P) R* a  r! I9 E
  858. end # Game_Vehicle < Game_Character3 k/ k% N. ]* m- Z8 u
  859.   ! n0 R+ i( O( T+ _8 [
  860.   7 x- U9 u* S9 Z1 W8 h4 ]
  861. class Game_Follower < Game_Character1 @  _2 c% U9 X3 B' X- X: W
  862.   alias galv_reflect_gf_initialize initialize
    # [: ^/ c$ |% D
  863.   def initialize(member_index, preceding_character)4 x0 D: ]8 }" z. t0 K9 M0 s
  864.     galv_reflect_gf_initialize(member_index, preceding_character)4 `- V4 d% a/ T6 d8 Y- D
  865.     @reflect = true6 }5 i: @; H5 O; i
  866.     @shadow = true* E& n! v; b/ R+ {. F
  867.   end' b1 \$ m' d3 F6 q$ t
  868.     : W, }% w2 l  B5 @+ a- C. \
  869.   alias galv_reflect_gf_refresh refresh
    1 H. G6 m8 r9 c
  870.   def refresh, E: v: C2 h, r$ _! q
  871.     galv_reflect_gf_refresh. g1 {  ]0 j6 n! y( u1 w$ {2 \
  872.     return if actor.nil?
    $ S2 K+ ^" w( v1 O8 K' ?# g
  873.     @reflect = actor.reflect1 l- {5 d+ M7 _' W8 Q# u
  874.     @reflect_sprite = actor.reflect_sprite
    5 T8 D& A# N6 \! ]% E: M) \4 P/ Y+ ~' H
  875.     @icon = actor.icon, t. V0 r+ i8 z  a3 d& k
  876.     if SceneManager.scene_is?(Scene_Map)2 q) G( _7 I+ T1 v2 c
  877.       SceneManager.scene.spriteset.refresh_effects
    * Y' @9 n! P  `, y
  878.     end
    3 O) e% `7 {; n, u
  879.   end
    . @1 `# B, B8 J' m& G
  880. end # Game_Follower < Game_Character/ x6 z8 W' E5 x7 T& U" U7 }/ ^
  881.   
      {( C: k8 V" @, B( }; v& E6 C
  882.   6 h* H. h; a5 X+ q& F
  883. class Game_Player < Game_Character
    % l3 u+ e9 b3 p: k+ s1 ?
  884.   alias galv_reflect_gp_initialize initialize
    , O! `; _% `, u  h- J
  885.   def initialize
    1 S& m2 [; y  f' o+ s* Y8 i+ [' R
  886.     galv_reflect_gp_initialize& O8 q6 }( P% b# r2 s
  887.     @reflect = true/ T3 c: z2 b! j, g
  888.     @shadow = true
    8 s: l0 z1 N  a: L$ `8 i* E
  889.   end
    - v( P% t* _2 {/ f2 S) F
  890.     3 D4 K( u: |& s6 |: u! h1 z
  891.   alias galv_reflect_gp_refresh refresh
      D% x/ V  S4 o. p% W& B
  892.   def refresh
    8 B& x7 s/ a* _4 r; c% {
  893.     galv_reflect_gp_refresh3 n3 n6 u  L: Z1 G6 |4 F* ~' i
  894.     @reflect = actor.reflect5 Z' f, \" N  |7 }4 H7 e
  895.     @reflect_sprite = actor.reflect_sprite7 x6 ]8 C6 r) G9 R6 r
  896.     @icon = actor.icon
    , z5 L. i8 Q( Y
  897.     if SceneManager.scene_is?(Scene_Map)* C' [+ M9 H& C* Q5 M
  898.       SceneManager.scene.spriteset.refresh_effects
    6 }' k% t" L" w+ I; ?9 e0 \- S
  899.     end4 @8 z: v. A& N1 H- v) W; s; O" z& F  M
  900.   end
    0 L6 d! f* }/ L7 s, y- E
  901. end # Game_Player < Game_Character
    " j$ l  v# ~) Y; S8 g% x
  902.   
    ; O. Z  f# h2 A! _
  903.   
    ( U) P) r4 P' @  }: w( s" i2 s
  904. class Scene_Map < Scene_Base
    5 D; T3 N) _7 }9 Q
  905.   attr_accessor :spriteset( e( z0 E& t6 V" ~
  906. end # Scene_Map
    " U$ L/ w8 ?. {% N& u0 ]  j% k1 }
  907.   3 u0 F! c8 k7 E* }* \" m
  908.   ' E! F9 h1 @; q& H
  909. class Game_Map/ [- M5 ^3 x, y9 o( q& N
  910.   attr_accessor :char_effects' e2 q& m7 K" U8 A. j% D
  911.   attr_accessor :light_source
      V/ L# `/ t2 o, U: q
  912.   attr_accessor :shadow_options/ c5 D2 E5 y* z' o# @4 w7 Q& i
  913.   attr_accessor :reflect_options
    , E4 O( H) C) r; X0 e! {
  914.     ! f7 I3 U$ m" }+ y( e
  915.   alias galv_reflect_game_map_initialize initialize2 P# p6 ~% x# _# S+ S$ F
  916.   def initialize. A9 H. E  B9 T' m: U  H9 j2 a
  917.     @light_source = []' U, T6 {" A! j+ c- \/ D
  918.     @shadow_options = [80,10,false]
    ' x/ x# @1 I* v: T% E
  919.     @reflect_options = [0]
    * u- r/ a5 t2 I
  920.     @char_effects = [false,false,false,false]  \- r) W- k- j' z: I  \
  921.     #[reflect,shadow,mirror,icon]
      s* S' X& j: @9 U1 f) @
  922.     galv_reflect_game_map_initialize
      n' Q1 C0 y& v! M2 I/ h
  923.   end
    / }6 N3 {( W& z: Q# Q- ~. M; S
  924.    
    $ Q' s3 }# \0 |* u3 s
  925.    
    2 Q0 P1 L3 K4 |, u2 N  O) h
  926.   alias galv_reflect_game_map_setup setup0 v$ t  L) a! ~! x) v( _
  927.   def setup(map_id)8 Y. ^2 O* h7 F- o  }, e- X
  928.     galv_reflect_game_map_setup(map_id)
    $ M; M* ?( u  ^
  929.     reset_char_effects& _0 H  ^, p& V  \# o5 Y# B2 G
  930.     do_all_chareffects
    # h- V2 [% L5 [1 q2 U5 f* J
  931.     if SceneManager.scene_is?(Scene_Map)3 e2 y$ Z* A: i$ \) E) J
  932.       SceneManager.scene.spriteset.refresh_effects
    4 {0 ^2 d; T* D: s8 k( @! E2 J) N
  933.     end( p9 ^7 h+ W/ b# o" `
  934.   end
    - Q, Q5 T' r3 O; q+ a: ~
  935.    
    ) V" n$ j3 ~1 [# v( `# N# f
  936.   def reset_char_effects
    4 g$ {$ i6 A% I! @& N
  937.     @light_source = []. U  E  B" U. t6 F" Z4 A
  938.     @events.values.each { |e|% d; I* J. m; t( [0 y
  939.       e.reflect = false
    ; N* t8 i  G* O* b2 a
  940.       e.icon = nil }
    " ]8 P6 l+ L1 N
  941.   end
    3 l8 w' `: |% R% _& i, U
  942. end # Game_Map
    ! h- J. J7 v; i. |( Y" C; a' k- y
  943.   
    4 J' {: D$ p, k- g9 {1 c
  944.   
    $ P3 e( T% {( t% x* D
  945. class Game_Actor < Game_Battler
    , @* K  y; a* P; k3 \& w" V# H
  946.   attr_accessor :reflect
    ! u$ n0 y5 W( }% I, u3 v; \
  947.   attr_accessor :reflect_sprite
    " v0 l4 |/ Y' U+ G+ z9 s
  948.   attr_accessor :icon
    # R/ E) q* ^5 x
  949.    
    2 Q# ]' ?: n( v4 |( B
  950.   alias galv_reflect_game_actor_initialize initialize/ j1 _4 H; C. M0 ^( U
  951.   def initialize(actor_id)7 C- Y* ~  \: n! t8 u- a  _1 [
  952.     galv_reflect_game_actor_initialize(actor_id)
    7 `2 {$ [9 l/ v7 j6 _. I, {. Y6 ]0 a
  953.     @reflect = $data_actors[actor_id].reflect! }- l$ i$ V$ c
  954.     @reflect_sprite = $data_actors[actor_id].reflect_sprite* K5 o: H- V  ]+ x
  955.     @icon_offset = [0,0]9 `4 A- e5 N3 j" n4 p
  956.   end
    , Q+ E9 b0 r( a
  957. end # Game_Actor < Game_Battler
    ' _9 n" S( k% S% O) Q
  958.   
    8 ]: y+ y. O* x% i" G
  959.   
    3 X' ]2 G3 H0 f: h- `( s
  960. class RPG::Actor
    ! ^( `; t  o3 h3 P4 `% Q: Z
  961.   def reflect_sprite
    % H& }5 z1 F1 ]+ B$ Q9 B9 D4 P' L8 M
  962.     if @reflect_sprite.nil?
    ) H" ^6 B; Z4 o9 e! W, y5 ^, E6 C/ d+ A
  963.       if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
    ; \% c! Q7 o  e; Z  u
  964.         @reflect_sprite = [$1.to_s,$2.to_i]8 d1 O3 w, N+ W: x
  965.       else
    0 a; y0 h) p  A' j* V: p
  966.         @reflect_sprite = nil4 L) d7 m$ a& x
  967.       end
    ! r% H0 F- H- @- y4 r2 O! d
  968.     end* m( ~9 U" @% V5 o, c$ u, M: H
  969.     @reflect_sprite8 T- [! t1 Q$ o* q
  970.   end3 C+ G3 K: W( v6 ]
  971.   def reflect
    % C1 K1 q/ ]8 Q- z
  972.     if @reflect.nil?7 O3 a/ y- ~/ R% d: s  N
  973.       if @note =~ /<no_reflect>/i* f: p! {* P: ]
  974.         @reflect = false% q& _% D4 w, k9 w
  975.       else
    $ K% C- K7 m# d$ b8 Y" f$ A+ o: W
  976.         @reflect = true
    0 I  H) E/ W0 M9 R8 S
  977.       end" e. E- a  O: r# ~; i( Z2 h& t
  978.     end
    $ L- Z7 ^4 R  @, o/ F2 C# x. q" C
  979.     @reflect
    : G9 k5 v' k2 `4 P% \% X3 h# E3 U- i
  980.   end
    ) C+ [! O" U  k/ h4 H
  981. end # RPG::Actor
    ! Q8 p% w- h& ?
复制代码

作者: 禺谷皓月    时间: 2014-6-25 11:35
记得口袋妖怪的池塘是有倒影的




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1