设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1430|回复: 2
打印 上一主题 下一主题

水面动态倒影,求解

[复制链接]
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
跳转到指定楼层
1
发表于 2014-6-25 11:31:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
代码复制
  1.  

. j1 L; Z7 T* x; F$ T/ Y这个代码怎么用啊,有大神知道吗。我从国外找的。+ O+ O9 B/ o0 ]' U3 B, ]! P% ?
http://galvs-scripts.com/2013/02/21/character-effects/# o' q0 h- D7 E% f0 q
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#1 y% ~8 P8 P1 n2 B0 R6 [
  2. #  Galv's Character Effects
    ) ?: G$ a: f! \/ c4 \' M8 J$ |- U
  3. #------------------------------------------------------------------------------## f8 A+ c4 Q; T. ]4 ?. T& a0 O8 r
  4. #  For: RPGMAKER VX ACE
    ( B$ i5 J. w" N, @9 V
  5. #  Version 2.1
    % E- d7 a+ O+ a2 s
  6. #------------------------------------------------------------------------------#  K7 Z4 D. r8 y
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    / _" a7 e! h5 o* K, D+ I
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects9 H: N. n) |; m1 u
  9. #                           - Fixed shadow facing bug
    # n1 `$ P- L% s+ [6 p4 k
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    9 X1 ^  E! |3 d+ F% G" w! _1 \
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    7 k( F1 L( {; ~% n7 @
  12. #  2013-02-22 - Version 1.7 - bug fixes
    $ Y" R1 c) m7 C
  13. #  2013-02-22 - Version 1.6 - added icon effect
    2 n1 o2 _; v; m8 f7 u
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    7 U- ]# _2 p- r% A1 k
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    ' w7 Z, }+ q( x
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks* j4 W/ c6 P- A  D5 N5 G
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)7 z) P2 \1 J/ h" Q
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    6 Y$ R1 H6 T7 I# i8 C2 [6 }3 a  r7 ]
  19. #  2013-02-21 - Version 1.0 - release9 b2 X# N3 O! l, u7 O. u
  20. #------------------------------------------------------------------------------#* x5 {4 ?5 |+ A3 s9 B2 z0 l
  21. #  This script was made to provide some additional effects for characters such
    ) v1 L0 g1 Z7 G, E  N
  22. #  as events, followers and the player on the map.: }2 q+ j( q/ {% g
  23. #  Currently it includes:; B4 \( L) p0 N0 v) G
  24. #5 t4 ^( M& I8 l3 s5 H8 S3 r: _. M0 t
  25. #  Shadows
    9 O, u4 ~8 H; B$ E* u' C5 S
  26. #  Shadows that appear under player and events in a directions depending on
    ! A7 f4 D1 N+ m  q
  27. #  a light source that you choose.0 L5 ~+ r- N3 o! [
  28. #
    # p6 Q# C1 P+ L( W
  29. #  Parallax Reflect
    7 M: ^9 m: r1 E& H
  30. #  Reflections that appear on the parallax layer for events and actors to be  t2 e, \5 M3 w/ }) u- W
  31. #  used for things like reflections in the water or glass floor etc. To get
    * v# A# u+ m" I( L
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    ) M/ O# k* y4 U# Q+ p
  33. #  partially transparent.: r; O+ I0 L+ \8 E
  34. #
    ' \' Z0 J7 \2 u9 ?
  35. #  Parallax Mirrors
    ( j2 ?" X) B  Q4 m% Q
  36. #  Much like reflect but are instead actors and event are reflected in a mirror3 c; q6 U8 x. \
  37. #  on a wall designated by a region. Both mirror and reflect effects can be" Q' V/ I9 t* {0 c% ]8 X- m
  38. #  changed so actors and events can use different charsets for their reflections1 ^; w; S( E5 e
  39. #: ]; M8 g- L& W+ Y3 s
  40. #------------------------------------------------------------------------------#6 E7 F( {2 `& l3 t
  41.   : M& a  u, q( _$ w& x

  42. 7 w: p' ?$ ~% S
  43. #------------------------------------------------------------------------------#
    3 l, Y4 y! D5 L) F0 B% `. G
  44. #  NEW - First event command as a COMMENT
      `) h% x' D) _" R( L3 m1 \. C
  45. #------------------------------------------------------------------------------#7 R8 N# i. Q; G* W1 P5 y1 t# p. \
  46. #  You can add a comment as the first event command on an event page to set if$ L( A* h2 X" X# A& p, g( |
  47. #  that event has an icon, shadow or reflection active. The tags to use are  y/ E, G$ O" u5 v
  48. #  below, all must be on the same line in the comment.& O: k; `! _) o- d0 c
  49. #4 @1 {7 @- |: a  B/ y0 T
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)' o+ [4 X6 b; X, p6 U, z
  51. # <shadow>           # set the event to display a shadow
    2 V6 ~$ T3 ?. J0 g& _
  52. # <reflect>          # set the event to display reflections
    7 ~- b* t$ h; s6 R' y! D
  53. #" r3 q' X5 i8 ~+ N" A9 H
  54. #------------------------------------------------------------------------------#
    & N  c+ r" V  V0 h) x; _; T
  55. #  EXAMPLE:
    2 X' w4 F! }6 [$ Z3 _" r. C& O
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event' ~1 v$ H1 o+ H; }+ C3 x( _8 W
  57. #------------------------------------------------------------------------------#9 z% P: H; k8 y4 e

  58. & [) I& P" o" G' I. g5 I* b

  59. ( m0 a7 W8 E3 g
  60. #------------------------------------------------------------------------------#
    - b' j5 }) @5 X
  61. #  SCRIPT CALLS:
    , R3 @6 ?3 N8 v, i* D
  62. #------------------------------------------------------------------------------#
    5 U# R3 o+ A: h, Y! a
  63. #
    # j# D; K$ e+ l* x/ Y
  64. #  char_effects(x,x,x,status)& q" _1 c1 k& C8 [% r
  65. #
    + N$ @% ?# p, N' J/ N
  66. #------------------------------------------------------------------------------#
    8 Q5 ~* q& }! T& b  e0 I
  67. #  # each effect can be true or false to enable/disable them during the game.+ [! ~# d  D3 _
  68. #  # you can change multiples of effects at once, x being the effect number; a# b/ J! B* T/ g: x: q1 T- Y, _3 a0 ]
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons) ^2 k& V- p& A* m7 `8 i  {
  70. #------------------------------------------------------------------------------#& o6 g8 K! o* d$ A
  71. #  EXAMPLES:: B7 l* F7 y  V7 ?+ d/ K1 L
  72. #  char_effects(0,true)              # turn reflections on- C3 K5 a* K5 e4 P( B% q
  73. #  char_effects(0,2,true)            # turn reflections and mirror on& F. ]( b! w. |9 M. A
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    & e& r9 ?* o( P6 z. R
  75. #------------------------------------------------------------------------------#
    ' }, f% r% ?' }# ^! H; k
  76. #
      G, H7 v( @% T( o
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset- c  U* j* b% ?" j! n
  78. #. p2 K8 w" Q  {' O( \) N. x" e4 P+ R
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    ( X& O3 |2 d( v
  80. #! \/ \+ S- J/ p1 _- Q7 @
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    ( o9 h0 `* A, {( n* z+ P' l- c1 Q. B
  82. #
    2 a6 t0 [9 H5 J. ~
  83. #------------------------------------------------------------------------------#/ l+ x# V. P' _, u' f% Y. R
  84. #  EXAMPLES:8 r! W( C" a$ S. r4 [9 R
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite( R6 C  b0 i) T* E+ B- z) K
  86. #                                    # in position 2 of "Actor2" charset." k) k! Z( ^3 ^; D
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
      z3 _& F( {' K9 t3 f
  88. #                                    # "Actor4" charset.* G: @$ E% d+ G/ ?, _0 c: A0 p
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of* L& V" R" ~0 E' A9 n. E& e
  90. #                                    # "Vehicle" charset.
    ! G- V3 z, ~; b# {# h& j: B
  91. #------------------------------------------------------------------------------#3 X) p+ w- w7 S$ W) d: |. q% b
  92.   
    ( Y) ~9 O; E0 f! T' c
  93. #------------------------------------------------------------------------------#
    % B* z- x, `  c
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    7 W# {4 Y; d$ w
  95. #------------------------------------------------------------------------------#
    4 F) f' U' ^8 u+ T0 u1 f
  96. #1 K; U- D  ^4 @$ ?8 E
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off" j; m2 }' v8 v% h4 N7 u
  98. #                          # use this to specify for mirror and reflect.5 ?. K" T2 m) Y  K% S
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    ! g3 t8 y  I! b0 _. \( `$ F
  100. #                          # to change all events use :all
    2 D$ e0 W* o. h
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    . u' [- R3 e  R: U
  102. #                          # it 0 for no icon.
    0 Q8 n' J# ^: r/ B
  103. #5 P1 n' W2 T( O9 h
  104. #------------------------------------------------------------------------------#2 N& K! E. U3 Q( Q
  105. #  EXAMPLES:
    - r, e) f5 V* }# S
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    + H& J9 r' c) K" }- J/ N
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    7 f  Z: e, y6 O
  108. #  reflect(:all,true)      # Turn all event reflections ON- D! i& w) @& u+ e/ Z
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    , m5 s' T9 f" `. i1 ]7 J
  110. #. e% H7 k3 S5 h  Z4 o+ b  D4 Q- D
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    $ @8 g& n$ m: c: z
  112. #        a map. This is a design decision to try to keep lag to a minimum. You3 G  U0 r2 _% n* ~6 z/ e1 N
  113. #        should use these effects sparingly and only activate them on events
    . C4 c" R% y# i& k  u
  114. #        that require them.
    - O: X, t0 a' J4 @+ |4 e
  115. #------------------------------------------------------------------------------#- |& d- @1 ?3 z6 `7 w0 j' Y" b3 W
  116.   4 R) j  i* O1 q/ ]
  117. #------------------------------------------------------------------------------## L! B) H3 d) x* [4 `( }
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES- @0 T$ F( C( v7 D, s" U/ ~; p+ ]
  119. #------------------------------------------------------------------------------#/ ?  @+ K. [( }) `! K* h% i
  120. #+ A6 e( M3 J/ D: f+ C
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default ' j; A/ Y: |  p6 i" \/ j
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    + m( Z6 O2 `8 `% ?
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    + k7 V; I" a+ U; M
  124. #
    7 r, V8 ^9 D' Z2 I
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects$ D9 Z, D/ J6 [- p3 R
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.4 @7 |' Z* G" G
  127. #  v_icon(x,x,x,icon_id)5 O& Y5 V+ [8 |3 `' D
  128. ## O6 C  @* I# |% _  m( ]
  129. #------------------------------------------------------------------------------#, V$ C, T+ {- K8 k
  130.   
    . m/ k( |+ r2 m
  131. #------------------------------------------------------------------------------#
    $ ^4 K& O* q- i3 I1 C# g
  132. #  SCRIPT CALLS for shadow options
    3 C  P9 o* x  h
  133. #------------------------------------------------------------------------------#
    : t7 A* f9 }* T8 Q9 ?
  134. #
    ) |3 b1 x- W" C. z  X, D. g$ z$ _
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 3 [9 H% q9 V" B8 a: o
  136. #                              # light source number you wish to change (for
    5 f: f& S& p) j3 g& k
  137. #                              # more than one). These are reset on map change.0 x! s/ M+ V( c0 V* X
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.1 V! E' ]5 m% a' P
  139. #                              # This will need to be in parallel process if you
    7 [$ z" k1 b4 e
  140. #                              # want it to be a moving light." k  L  i$ p. b7 f) S' h
  141. #/ b2 I3 u6 K2 ?$ ]
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
      n/ U4 @+ k  j$ _* }) Z
  143. #
    1 h7 A2 r7 Z9 l
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    7 r5 @& E4 C) h' s6 V
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    7 j3 U0 R2 z. O+ H& i8 B4 j
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    ; R! K& n  Q1 B* a
  147. #) d! ^4 `: _8 E; U2 R
  148. #------------------------------------------------------------------------------#; _8 r; O* s1 r: z
  149. #  EXAMPLE:) k0 C, z* j; v' q3 r
  150. #  shadow_options(80,10,false)    # This is the default setting.+ G, w, s5 T% g  T. M$ [
  151. #------------------------------------------------------------------------------#" e. c9 y* g0 n# T4 F2 g6 n5 |5 k5 q
  152.   
    ! `$ Y% s) X, E% D9 Z
  153. #------------------------------------------------------------------------------#
    4 }6 A6 c8 b$ N2 X/ T  X
  154. #  SCRIPT CALLS for reflect options8 ^% y+ a: m) h* H' }4 @1 g8 o
  155. #------------------------------------------------------------------------------#7 h. A. j5 E5 X, H
  156. #! C+ E, _" B/ q) ~2 W
  157. #  reflect_options(wave_pwr) . ]" ?/ P+ Y/ J& ?# C3 k
  158. #
    - Z+ H  [- ~$ m* k
  159. #    # wave_pwr = how strong the wave movement is. 0 is off: o; b* V9 o2 o# q
  160. #. J$ T3 e+ `/ ?1 ^, A: a6 V
  161. #------------------------------------------------------------------------------#
    & `% s' m8 ^# G# a& T2 |. P: @" }! x5 e
  162. #  EXAMPLE:. l% q6 ~5 f! l* `( Z* h: p, @
  163. #  reflect_options(1) # Turn wave power to 1
    9 O6 D% E8 P6 J; c5 M4 P" a+ w% w6 e
  164. #------------------------------------------------------------------------------#* A* V- R6 |( W3 s+ ~4 s# \3 r
  165.   ; Z1 S9 F+ m8 o7 r
  166.   
    , P" w7 C% O, K+ C! I: K
  167. #------------------------------------------------------------------------------#( S* I' Q9 ^- d! P
  168. #  NOTETAG for ACTORS
    / o3 t  D/ o) E. k6 I
  169. #------------------------------------------------------------------------------#0 Q0 Z+ J* A9 _% A7 B1 D
  170. #0 N0 ^9 S6 @$ S& t* b+ r
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)4 f$ U* s" a4 A( a) E
  172. #
    9 ^( _/ P$ s! x7 {4 o- L0 D( X: W
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections; F. `4 B( E) ^
  174. #                                  # and use the character in position 'pos'
    4 y( ]) ?2 _9 D7 m' ~% \( i
  175. #
    7 m8 m3 S4 Y( Z, \: L. M
  176. #------------------------------------------------------------------------------#
    ! w9 Q6 G# d; N$ @
  177. #  EXAMPLES:. D2 K. J+ l5 m
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset7 s) q% a; W. E7 u& b: d2 b
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    4 |1 @6 y, N) w8 c) ^( X2 {
  180. #------------------------------------------------------------------------------#) c1 r# O# b: r$ H+ o% @
  181.   8 _7 I! O& k. X4 q4 o2 j
  182.     @! u! ?( a1 _: o. H, B9 N
  183. ($imported ||= {})["Galv_Character_Effects"] = true+ Z6 T; C: \+ ~' @
  184. module Galv_CEffects' v6 _0 p+ V6 e) w0 z; Q# b
  185.   
    4 s' h4 F. m3 t0 p' f7 @; o
  186. #------------------------------------------------------------------------------#  
    1 S, a" w% l* m. k7 G( s
  187. #  SETUP OPTIONS
    + ^/ D- `( O5 m6 z( P9 V) R3 Z
  188. #------------------------------------------------------------------------------#
    6 H3 \  f2 H5 I5 b" J
  189.   - ]$ |+ k. A7 Q& K& H
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the& Q! e8 [8 E; r# m3 e/ L# ]
  191.                         # region on the wall you want to make reflective (and
    / x# a7 f4 l- K+ y8 L# d
  192.                         # then use tiles/mapping that make the parallax visible)$ h, O3 ^* q1 _% ~0 k+ W! J
  193.   
    , C+ E" j& K; v  C8 j! l5 a
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    8 z0 F: d% h. y2 Q) g8 y
  195.     - w  N+ y/ F5 s: Z% {0 j' ]/ n
  196.   REFLECT_Z = -10       # Z level of reflections, s, x/ `! l$ w) `3 F# z. a* }
  197.   SHADOW_Z = 0          # Z level of shadows
    0 {1 K/ b' N2 O. }* V( @% |% v" a
  198.   $ N6 s% G) ]3 d
  199. #------------------------------------------------------------------------------#  + Y* v8 Y, N. x5 P
  200. #  END SETUP OPTIONS
    $ g; @  h; S# o/ q2 J8 Z
  201. #------------------------------------------------------------------------------#
    8 k& Z' X% I% x/ P: H2 r. i8 ?
  202. end
    " M9 E$ R# Z8 w4 g$ k
  203.   
    2 K7 G& G- N6 q, N$ r
  204.   
    . m0 _  f; c5 z" A6 R% @8 ?
  205.   z+ }- J) I: T
  206. 1 t2 u- Q. a; ~: _; v
  207. class Game_Map0 x* v8 N: b; z- y2 d. C8 J
  208.   def do_icons(refresh = true)
    : R3 x3 B: N+ ?
  209.     @events.values.each { |e|
    ; `7 F% o6 z4 s
  210.       next if !e.list
    , v) C/ @, L7 H# r* ~8 ^
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/" ?4 y, {5 K5 ]) v
  212.         e.icon = $1.to_i! Z' ^5 N: u- F' K% Z' K' S5 _& ?
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    ) x9 @& E  L* P5 D8 z2 h  P1 ]
  214.       else% |: V; Y0 t# F' z% p
  215.         e.icon = 0
    - a0 H& `$ S% p, T
  216.         e.icon_offset = [0,0]) P) ]3 C  X1 a. H3 ]! j
  217.       end
    0 O1 h, @: P5 r% ?: z3 F! g- Z
  218.     }
    ' J# d7 s% Q1 D) e1 q! u% T
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    3 s( S1 I8 G- L- |  h
  220.   end* ~7 V% K2 o, [: v+ p4 |
  221.    
    - Q! g$ w: V0 w% B5 D
  222.    
    2 h3 @- D. `, ^4 M# U  |- K
  223.   def do_shadows(refresh = true)
    $ U  x8 ]8 `% w0 c. j9 @! d/ v8 ~
  224.     @events.values.each { |e|
    ; s1 a- v, t& r' q: d  M' u  m
  225.       next if !e.list
    " l, w, |, l' R) b/ a
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/$ Z; Z  c7 Q/ B( u3 V7 z; M
  227.         e.shadow = true
    8 X2 L  y* j3 ?& Z. h
  228.       else
      z, ^# r) }9 ^* e. `
  229.         e.shadow = false) |0 m+ A- ~' R" c
  230.       end
    / G& W6 N4 \' T% [9 y( v: I
  231.     }7 z7 R7 O% p, ^2 T! d( W( j& C
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    6 b4 h! M2 A2 I9 z
  233.   end
    ; r1 n' q" w$ T3 ?* [
  234.    8 i# U, W- }& S7 G
  235.   def do_reflects(refresh = true), I: h. |5 g5 U/ u2 Y' t' c2 Q
  236.     @events.values.each { |e|' ]" x9 W  _4 o: N' n
  237.       next if !e.list
    ( U7 i' ?& U4 n. u9 c$ }
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    " o, y# u8 ]$ g( i
  239.         e.reflect = true
    ) {2 |$ K6 ?; {9 I" H5 L$ W% u
  240.       else% l5 z& E2 s7 h
  241.         e.reflect = false( `) _- f3 H& o, h5 O
  242.       end
      |( h: h) X$ ]) I, E
  243.     }. |; ~1 N/ m4 I6 Z" v
  244.     SceneManager.scene.spriteset.refresh_effects if refresh, P+ v) r) M/ O, y9 w. k
  245.   end9 \( Z$ I' U7 L0 [/ F* {/ o
  246.    
      n' p& ]" h' Q: |& q7 L( Z
  247.   def do_all_chareffects
    ( ~5 \% }$ N7 A& i# b- j
  248.     do_icons(false)
    5 y) {8 J* Z+ K3 E3 k
  249.     do_shadows(false): ~; b" A" \6 r+ m- F( W; I2 t# {# X
  250.     do_reflects(false)
    % K- p1 r3 x6 x0 F( _! z
  251.   end
    9 @1 U4 i: |; t, X0 `' |
  252.    " _% u! Z6 I. s/ w, [" x, r- N
  253. end # Game_Map
    * M) x0 a; z, c  I# j1 V: a! z5 Y
  254. 3 J: F4 a. L/ y! Y) N

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

使用道具 举报

梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
3
 楼主| 发表于 2014-6-25 11:35:49 | 只看该作者
记得口袋妖怪的池塘是有倒影的
回复 支持 反对

使用道具 举报

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-7-23 09:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表