Project1

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

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

; y/ z/ T# [# m* {! @1 d这个代码怎么用啊,有大神知道吗。我从国外找的。' G7 p. Q. t" Y3 Y
http://galvs-scripts.com/2013/02/21/character-effects/8 |$ z1 b! m( J6 z& K( @
是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#& Z/ X# x0 s& t! k
  2. #  Galv's Character Effects1 C- ~2 G! j2 {0 M4 @* f
  3. #------------------------------------------------------------------------------#
    $ m$ M1 ^$ |' b8 r4 [
  4. #  For: RPGMAKER VX ACE
    * _* [! ?! R% D1 b
  5. #  Version 2.1! F7 h3 o1 V- x, c
  6. #------------------------------------------------------------------------------#* ]5 ]' Z; d' h: o  }9 X
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    3 C( s# `- q; i" @; ~' K
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    , C. _( r7 q, y& `
  9. #                           - Fixed shadow facing bug
    * B/ e: t+ Z+ m# L. l3 T; h
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    " ]& e6 ~0 F6 E& ?  c5 y
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows9 e$ ]" a+ q0 V/ V6 Z) e
  12. #  2013-02-22 - Version 1.7 - bug fixes
    8 F# ~, n+ J6 d  }9 X
  13. #  2013-02-22 - Version 1.6 - added icon effect  ~+ _/ T7 Z- K8 F. i5 I/ V; N6 a( w
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    ) g; U5 R1 m& Z: a+ l$ I
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles2 l# Y; C  x1 r# J
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks  O: B' K3 Q+ M
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)/ U4 p' t1 _/ r* M- r
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    ; Y9 r- g: U, c/ \2 d
  19. #  2013-02-21 - Version 1.0 - release
    5 Q0 P" M! D& v
  20. #------------------------------------------------------------------------------#
    5 S3 N* G2 ^: E. @* `; E
  21. #  This script was made to provide some additional effects for characters such
    3 X2 M9 m6 u3 L8 `  k- D1 z
  22. #  as events, followers and the player on the map.4 U  x% u, Q; T% U, z* @
  23. #  Currently it includes:
    - y( ^; z- n7 ?3 y2 r: r6 _, }: a! t+ V
  24. #
    $ Z3 J; P% \+ G8 A6 H9 n: ?( l
  25. #  Shadows3 ^' b* X2 v! p) R7 J6 I6 L7 x5 F
  26. #  Shadows that appear under player and events in a directions depending on
    " w6 p& ^- r. s9 B- r
  27. #  a light source that you choose.4 K, ?2 X1 l# L: b, b9 s4 N
  28. #& {5 I/ x- c# ]; a
  29. #  Parallax Reflect
    , t" v/ c" i# q8 ~  E9 n: X
  30. #  Reflections that appear on the parallax layer for events and actors to be7 w6 y( f, F2 a* K9 Z
  31. #  used for things like reflections in the water or glass floor etc. To get( E4 W$ `* V9 e" K2 U
  32. #  effects like the demo, you need to edit the charset graphic to make the water1 n$ e: }- Y( j
  33. #  partially transparent.7 o+ G; E1 M9 U% V5 A( i3 r; V4 h
  34. #. }# `1 m3 ^) J' r8 y
  35. #  Parallax Mirrors
    % Q! w6 K) o: P& n6 T
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    # V! F* i  {3 S# X" a) ]8 U6 `
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    2 n4 `5 Z. X. u) \. y0 A
  38. #  changed so actors and events can use different charsets for their reflections  l# m7 e8 J5 z. b+ H
  39. #) U4 a% e+ S$ c6 G+ z3 I
  40. #------------------------------------------------------------------------------#( L% U" ?; s7 M! }- v
  41.   
    + U# B9 I. {3 [; l

  42. ' h( Q! A9 t+ A3 g  S# Z
  43. #------------------------------------------------------------------------------#
    - f* m( g8 ~3 r( _" J0 y
  44. #  NEW - First event command as a COMMENT& \- y7 K) u5 z% t' p9 {
  45. #------------------------------------------------------------------------------#7 t) m5 _# F6 s( f
  46. #  You can add a comment as the first event command on an event page to set if
    4 E+ y/ d, E& M; _7 [; B
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    + y+ R& C% o1 z/ B0 e7 @& ?/ a
  48. #  below, all must be on the same line in the comment.
    # h2 \$ E2 }; M+ s
  49. #
    ! s) D5 u: T" x: U: Y8 O, L7 j" }
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    , s$ t4 T% o( e! I1 d: a! z
  51. # <shadow>           # set the event to display a shadow
    2 X7 G( a' M4 o" n; ]
  52. # <reflect>          # set the event to display reflections' c: ]0 |! ?- j4 m3 r: U
  53. #/ M& j* [# x# q$ m, o9 Y! y# w
  54. #------------------------------------------------------------------------------#: A" `9 L4 z9 j$ u2 V
  55. #  EXAMPLE:  c5 `7 L  N3 Q8 }+ x
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event6 U' m1 }. W/ z: l; t# J
  57. #------------------------------------------------------------------------------#
    / j) i8 ]/ l1 I# h
  58. 2 v  e) y, y0 \5 l) O/ [6 Y

  59. 7 u0 M/ ~! s4 X! }* V
  60. #------------------------------------------------------------------------------#4 }5 o' z  v7 {4 V; e1 q
  61. #  SCRIPT CALLS:+ p) ]( ~  [' o5 f, x2 U
  62. #------------------------------------------------------------------------------#
    ; R; D6 D" O- U9 B0 X& D
  63. #
    % p& F  {: ~5 y  }3 `1 i# W
  64. #  char_effects(x,x,x,status)
    1 }: u* N0 y7 i, V; r/ A
  65. #
    " P" G* W% F, k- R
  66. #------------------------------------------------------------------------------#
    , \/ |# E3 R9 X& k
  67. #  # each effect can be true or false to enable/disable them during the game.8 p* n# r* t/ g: T/ f: c$ b
  68. #  # you can change multiples of effects at once, x being the effect number
      ^4 R, a2 j$ A- N( ~9 h0 B8 Z
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons- c! v* i) F+ t/ _6 F# a$ d
  70. #------------------------------------------------------------------------------#) M* \7 V! J- F; {6 E. X$ C+ D
  71. #  EXAMPLES:
    - W  Y( V/ i4 Z. ]8 A
  72. #  char_effects(0,true)              # turn reflections on
    % m' l# z3 k8 `; P" a7 y
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    3 O2 E3 l0 X, r3 J% a. B* U7 `
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    + C; ^, p* W1 N* C3 D( o/ K
  75. #------------------------------------------------------------------------------#% q1 \+ y% P/ {$ p+ F% U  B0 V$ p
  76. #+ r0 _, I/ U6 w  h$ \, c( ?
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    9 p8 }4 `, \3 H7 M6 S* M$ O
  78. #- H4 _2 X6 V9 Q7 a6 X5 b0 T* p
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    2 R) Q1 ^; p1 R6 y
  80. #
    ( N4 W. z0 Q8 S" Z- R( d
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset6 m4 o# t3 |( W1 o. s0 \
  82. #; Y. B6 s2 K) H9 {8 U; j2 @7 a
  83. #------------------------------------------------------------------------------#
    / S/ Q* T, u2 L6 y6 s: V, @' ?( a
  84. #  EXAMPLES:: c! d4 \# c# t1 q
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite. ]* i' `* L$ k/ t& @  j
  86. #                                    # in position 2 of "Actor2" charset.
    * P" u( d& G$ E% E- h
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    6 l% A( y7 \5 F6 w! l% c
  88. #                                    # "Actor4" charset./ _! N3 ~' z: }' J
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    % v4 X: Q8 O( t
  90. #                                    # "Vehicle" charset.
    $ y) T, Z: B4 }, f
  91. #------------------------------------------------------------------------------#* V- `6 l- Y0 e7 k% e
  92.   
    7 K5 _7 L( ~$ Z
  93. #------------------------------------------------------------------------------#
    * E3 {4 o) R+ P9 S" o+ {# E6 T7 S
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    : L9 J, _3 N; G# @6 ]$ `
  95. #------------------------------------------------------------------------------#
    ' n1 r! Z: ?' N" Z) @) V  L
  96. #
    $ [4 c0 @8 s  ^( \: h
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off9 \& N! j( T7 e
  98. #                          # use this to specify for mirror and reflect.
    & c) f/ F+ e0 p" t
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change" X/ F4 V2 O) ?. a! x
  100. #                          # to change all events use :all+ U% R! k1 q" H  Y2 |: _: @# X% x2 ~
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make; J' {- C8 m9 D# o! ]* S" U
  102. #                          # it 0 for no icon.
    / d/ e8 A, U* o2 d, P
  103. #1 p. \' [6 f, o. g6 Q5 D2 {
  104. #------------------------------------------------------------------------------#
    . m  b* |. P& e' S
  105. #  EXAMPLES:! E8 v. W0 t8 W5 r% M/ J
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    3 O5 `* e% W' R& \
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    ( X# F2 A6 j- t
  108. #  reflect(:all,true)      # Turn all event reflections ON; N' e4 {- C3 @! }* F
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear5 {, I8 t2 O; c* @
  110. #. d+ p" {2 q8 k4 `5 `  J6 q( l
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    2 H: _1 Z/ L: k& u7 A1 o8 B$ Z9 z
  112. #        a map. This is a design decision to try to keep lag to a minimum. You' }: u$ w1 l) @  J2 X, d) i
  113. #        should use these effects sparingly and only activate them on events
    $ V4 V- ?. Y* z% E# j3 q- @* ]& J
  114. #        that require them.
    + v" |. }/ h4 ^- }  z7 @
  115. #------------------------------------------------------------------------------#
    % O/ v3 n) L% t7 o
  116.   / ]2 {& I0 c/ I. e' e7 V, W: {" W
  117. #------------------------------------------------------------------------------#1 U' k, ~. t6 e
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES9 N7 x/ _6 H" v) A! Z/ k1 a& o
  119. #------------------------------------------------------------------------------#
    & G# ^7 F3 a# L8 x, ^- U
  120. #
    ( O( |8 ~* A; }  e
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    , T+ s3 U% h4 F0 v9 J
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    " Y4 v4 ^6 Y# q1 I+ c! T
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them." G1 P2 F1 m+ i9 D9 X& Z5 a+ P9 o
  124. #) f& D2 @! |, G- O
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects& Q' O: B- U. m# y/ @/ w
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.* }1 X* S/ ^- L8 h
  127. #  v_icon(x,x,x,icon_id)
    * W' R8 W4 Q* s
  128. #0 O. _( P* J! |
  129. #------------------------------------------------------------------------------#! P' Y% `2 n) i8 i
  130.   8 |  t+ }% w: _! n
  131. #------------------------------------------------------------------------------#( _9 G' [) G5 ~+ [; C
  132. #  SCRIPT CALLS for shadow options! l9 ^0 R( z* v  b/ g
  133. #------------------------------------------------------------------------------#" L% C' r- P2 R' ]
  134. #
    1 ~$ L* S0 w' ~7 V/ P( }! e
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the : J5 X" @7 f2 G2 t' X
  136. #                              # light source number you wish to change (for
    9 Q( q  R3 Z) A" c- @
  137. #                              # more than one). These are reset on map change.
    $ ]! w- @& @& ^: I7 U+ m
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    : b% k, n' ~! f$ V
  139. #                              # This will need to be in parallel process if you
    9 l' Q  ]' O. C! T6 K2 m
  140. #                              # want it to be a moving light.% e5 F/ t) n& e1 l7 M# V# Z. e
  141. #9 F+ M& ?2 I0 t4 K* S% B
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    - q# o* h& k+ H, m# ^9 k
  143. #
    ; g; C/ E* j, T4 _$ H
  144. #    # intensity = opacity when standing next to the light source (255 is black)
      k% P- o; h# x% p8 l
  145. #    # fade = amount shadow becomes more transparent the further away you are.1 ^; r0 X+ p9 t/ c
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.7 K. i3 S8 z7 H
  147. #
    9 t  l! m# \$ \  S* N; x
  148. #------------------------------------------------------------------------------#( X0 Z; J# _% d. E
  149. #  EXAMPLE:
    " }! ~  X& e) E" X8 q
  150. #  shadow_options(80,10,false)    # This is the default setting." M  I) r4 e$ T5 o
  151. #------------------------------------------------------------------------------#3 ?, h' L# P8 G+ {) q9 H8 O
  152.   
    ; ^" t) M& o3 C0 I
  153. #------------------------------------------------------------------------------#  |% Q# z) D. b% p8 M
  154. #  SCRIPT CALLS for reflect options
      r' g$ \% Y/ f& j% `4 m
  155. #------------------------------------------------------------------------------#2 [% _* z3 }- [9 R* D% h% m
  156. #1 v9 B& P+ A( M$ |3 P, j
  157. #  reflect_options(wave_pwr)
    * F" h( g8 t% s9 J' T& e3 Z/ @
  158. #
    4 e- i  l1 Q" U2 r! {  I* O! I9 {( W
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    / w) V8 B% Y: h, _! a  J# r+ X
  160. #$ }7 r8 H  q+ E+ @
  161. #------------------------------------------------------------------------------#, p" x% {( _- B4 s* ~4 L" T
  162. #  EXAMPLE:8 Q8 T$ h4 y# u
  163. #  reflect_options(1) # Turn wave power to 1
    ( `1 S1 K& z% ^+ g
  164. #------------------------------------------------------------------------------#
    / r: x. t' v' |) X9 L9 R
  165.   # G: [6 l( S3 m8 j. m
  166.   / _2 V: d; Z2 h( m) Q: Y" ]
  167. #------------------------------------------------------------------------------#" |7 \3 f7 J* R- R% y" f' _
  168. #  NOTETAG for ACTORS
    * t( \' C6 o$ a. q  I% M
  169. #------------------------------------------------------------------------------#
    9 A  W" ?, p0 J: r- `" _' m8 v5 f5 K
  170. #
    9 w) o2 r5 N0 F( k* n8 ~& t  X
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    ) e% l1 `% z# o
  172. #0 g1 s+ w+ H4 G# E$ P8 J7 s
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections3 h- U! I( |. `9 k0 J
  174. #                                  # and use the character in position 'pos'( S1 k/ P% T" m! E. A
  175. #
    & a( ?% O& {. w( b% U
  176. #------------------------------------------------------------------------------#
    4 n9 K5 }& ?# t1 F/ z5 }+ Z
  177. #  EXAMPLES:
    * Z. a, t& N! ~) |9 L" n! T; C+ J( g
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset9 [' z( h! R( m8 \! _5 j6 k: n
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    0 {3 H+ m2 u  n8 n$ |' M
  180. #------------------------------------------------------------------------------#
    1 F1 c* w8 b. f9 I0 b
  181.   
    8 ~  |( H# K+ w( \0 k) t; G: \
  182.   8 n% q' o0 M: J- y5 T4 k; f
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    ! k$ n# \0 b: k, k3 W
  184. module Galv_CEffects/ w* `2 l( `: a
  185.   1 v# t4 ]. w( W! G9 q) m) b  Z
  186. #------------------------------------------------------------------------------#  8 d& C8 S- E" G
  187. #  SETUP OPTIONS" k0 M9 b$ v) g& }8 h8 ^
  188. #------------------------------------------------------------------------------#1 b6 q% |3 y$ i4 ]- g* Y
  189.   
    $ D# S1 q! K) Q" y4 U$ N
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    & {0 k. X6 ?9 w1 o# _3 c
  191.                         # region on the wall you want to make reflective (and4 b8 U* z7 V  H1 F9 B2 {
  192.                         # then use tiles/mapping that make the parallax visible); K, x) S, F% x. {1 {5 q' I9 ^, S
  193.   4 U( Z8 V$ w# g' o: o
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    / m4 v4 f6 `& {( q% b3 y
  195.     : w* z. B) f/ w- x
  196.   REFLECT_Z = -10       # Z level of reflections
    " ]( B' \% |. ?
  197.   SHADOW_Z = 0          # Z level of shadows
    9 Q7 L+ I& q3 I+ v7 j
  198.   8 Z, k7 Q7 Z' n
  199. #------------------------------------------------------------------------------#  
    ' a, v+ [8 E  h' W$ o1 F
  200. #  END SETUP OPTIONS
    ) j+ T0 f3 |; l. a- g  A' O
  201. #------------------------------------------------------------------------------#* u+ L0 U9 s* E: A& r2 S2 ~
  202. end
    + P* |8 A- t0 v, @4 h: [" P
  203.   / d3 Q" f) A2 b+ G" w2 t# q
  204.   
    ) p. M5 s0 t: r. k$ R8 D

  205. 1 l: u: G! O7 k9 e9 D

  206. ! }: ]7 L+ ~7 P2 _! m& _
  207. class Game_Map; a1 P4 B- l5 a: b
  208.   def do_icons(refresh = true)2 c( u6 b; [8 }4 z7 F" T
  209.     @events.values.each { |e|- U( M5 J- R7 C- g$ e1 P
  210.       next if !e.list
    ) t  \' H2 m. h2 M9 w2 ?0 j+ M
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/) B: G* I7 `; {9 O' a5 Q( |! d
  212.         e.icon = $1.to_i& p6 u7 X/ w! R
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    $ |6 y" G! |4 H' d
  214.       else. Q( w/ I) j' G9 ]8 b7 `
  215.         e.icon = 0
    ' [. v9 O8 Y" x$ k( Q
  216.         e.icon_offset = [0,0]
    - t1 l# O5 c% @. m( B; k% C
  217.       end3 \4 ]6 s- {1 x9 H
  218.     }
    4 P' W, ^+ w2 U3 j" J
  219.     SceneManager.scene.spriteset.refresh_effects if refresh, z- n3 j: D7 i5 T4 S. i' Y
  220.   end
    ; ?  V) P- k3 [6 O+ a! F
  221.    3 y' L& K& K1 u2 e/ {
  222.    
    - u7 _, v) w: w5 z1 i  B" p
  223.   def do_shadows(refresh = true)5 j# K" S  P# y7 J' W; J2 N/ w( T: |0 q
  224.     @events.values.each { |e|- A' n1 H, d, [9 P/ h% v
  225.       next if !e.list
    % B7 e- Q8 n; X& u0 F- ^
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/# {$ t$ r* T# Q9 u; ]" L4 Y9 i# l* R
  227.         e.shadow = true( L8 w  I: y  H+ P7 n( F
  228.       else
    1 e* H! s; ?& D; N( G/ T
  229.         e.shadow = false: ]! X/ c; i1 D7 s$ ~- k
  230.       end8 a" |4 Y0 G. `" w& M5 ~
  231.     }
    . K) f2 n) B5 Y, h# g
  232.     SceneManager.scene.spriteset.refresh_effects if refresh8 O; Z0 B; T+ D0 z% ?
  233.   end
    ; t# S, C. b6 r% v+ t( m# m
  234.    
    8 i6 m% E' B0 b6 Q+ n0 R2 K% u
  235.   def do_reflects(refresh = true)
    * g1 @+ a. {% _/ F! _; d6 @9 c2 a
  236.     @events.values.each { |e|& B9 b; L- F' l  ^: B
  237.       next if !e.list
    6 c) J+ L# W2 k
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    ; b: r5 M* X- m
  239.         e.reflect = true
    0 x! p/ r5 p% R; [7 f
  240.       else
    " W& o. J+ c; c
  241.         e.reflect = false
    9 I. T; @: o( M* b# k5 b
  242.       end, h! v' [# R' ?* Q: N4 [3 E
  243.     }
    / T. R6 y( j4 a- `, A
  244.     SceneManager.scene.spriteset.refresh_effects if refresh, r& X- g6 H; u
  245.   end
    & R* v* B2 R/ M" `1 E! k4 {) J' \7 c  T
  246.    
    5 Q2 ?; P" o- L6 Z4 X  C! d
  247.   def do_all_chareffects
    7 {3 Q6 o1 E6 ~3 n& x
  248.     do_icons(false)0 z+ B* o, b, h3 ?1 u8 I
  249.     do_shadows(false)
    7 o7 d8 K# u5 P$ g: r/ M
  250.     do_reflects(false)
    / y3 _' M; u" k/ Q) h
  251.   end
    * r+ A# ]% c$ j0 a
  252.    / Y. ^6 t) Z3 K2 X8 ?
  253. end # Game_Map) y3 u; F/ U0 w# ?( N; j, e

  254. 3 G5 P% O- c9 k% g6 V8 K: e

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

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




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