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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  

/ }- d0 F2 S# M2 j1 m" _这个代码怎么用啊,有大神知道吗。我从国外找的。* w. {+ n% g' G4 r) Z( L# J- r  z
http://galvs-scripts.com/2013/02/21/character-effects/0 c9 f$ W* D5 x' X, ?( j% n
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    - K5 g5 }4 j5 m7 w& R  D6 H
  2. #  Galv's Character Effects
    : ~% ~) h& ]7 Q: n" ]7 z/ M
  3. #------------------------------------------------------------------------------#5 O% e" ~4 _3 L+ w  b7 `
  4. #  For: RPGMAKER VX ACE# U+ c) }7 Y# L  z. {
  5. #  Version 2.1) z* A# z- H6 H
  6. #------------------------------------------------------------------------------#1 {9 z- C% y' A9 v) J$ W
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows3 H+ k; V& Q0 z4 o" w
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects# \# ~4 @7 R$ x: @
  9. #                           - Fixed shadow facing bug
    / w: ]+ x& C( Z! }
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    8 T. H( I# p" ?/ g( o
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    $ J5 v6 }5 v  K9 b( L
  12. #  2013-02-22 - Version 1.7 - bug fixes
    2 U, r8 q% S$ j2 T5 s9 Q2 `
  13. #  2013-02-22 - Version 1.6 - added icon effect
    5 c, D% z8 M% {; R7 q
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps/ F: z! p. d! a$ ?; y
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    5 ]& @" f' D0 ]( e
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks% i' U' u  [9 R4 S
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)! i2 W0 r, q! M  i' q
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    4 ^7 X& {- q7 k; ^# n1 n; X
  19. #  2013-02-21 - Version 1.0 - release1 M9 j6 c4 H+ ]  s) ~5 w, t
  20. #------------------------------------------------------------------------------#% j, @3 j# w  E4 }3 w/ }  V
  21. #  This script was made to provide some additional effects for characters such
    1 |2 s5 k$ q; w0 t4 Z
  22. #  as events, followers and the player on the map.
    / a) g2 K' N( _, X, j
  23. #  Currently it includes:
    + y5 L$ J- D3 T
  24. #
    - V1 j1 w3 J: I
  25. #  Shadows
    ) a* f8 G% ^& Y4 a7 J
  26. #  Shadows that appear under player and events in a directions depending on% s3 x4 O! D7 k/ N; X' p  _1 u
  27. #  a light source that you choose.
    5 t7 Y7 x; y: M) x/ W
  28. #9 Y! }$ `& p" g4 y" ]& O
  29. #  Parallax Reflect9 J( W- f5 u9 V  X
  30. #  Reflections that appear on the parallax layer for events and actors to be
    ( v) ^/ p$ p( Y! O7 m. I( ]
  31. #  used for things like reflections in the water or glass floor etc. To get* y9 B' L, Q7 ]8 `3 }+ k
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    2 p; x" X4 M; \( g  K( B
  33. #  partially transparent.
    9 k* ?. M) u# L/ \
  34. #
    ( }  h. @8 o; I5 Q3 U
  35. #  Parallax Mirrors
    ' s& R& X$ S) W* x4 s
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    % s' R' U5 y, q
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    ; _& Y0 Z8 h* i) I5 H0 Q/ @) a
  38. #  changed so actors and events can use different charsets for their reflections- }( j9 `, j( {9 T
  39. #
    + W+ `) J& w: Z% p8 K7 R( Y1 u
  40. #------------------------------------------------------------------------------#& B1 ~# M7 k" |9 e! y6 Z3 L1 G# f
  41.   . W2 W2 A4 v& ]  Z: G! |7 S% y1 e

  42. " W5 M5 p8 `8 d: K& r) W5 q
  43. #------------------------------------------------------------------------------#
    4 X  P/ l' x3 \4 K1 q& j
  44. #  NEW - First event command as a COMMENT
    : G% H" d3 [. a0 S7 Y
  45. #------------------------------------------------------------------------------#
    ! T' |% q( Y# F1 p& A4 j
  46. #  You can add a comment as the first event command on an event page to set if5 E6 r) o3 u  _
  47. #  that event has an icon, shadow or reflection active. The tags to use are' ]' {) ~) ]( y# \4 j
  48. #  below, all must be on the same line in the comment.
    ! f. G3 Q5 {- r+ `% d7 @! W( e
  49. #
    * r6 H; x$ H/ B$ ]
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    7 w6 v* w: q7 G' c# T2 E
  51. # <shadow>           # set the event to display a shadow
    & p( a' w0 H: p
  52. # <reflect>          # set the event to display reflections
    " T1 B& E% M6 a3 F- i7 K
  53. #
    ; ^! ~9 v' `' [0 c; w' T7 }' X0 P
  54. #------------------------------------------------------------------------------#3 u" [! p: k$ W. r
  55. #  EXAMPLE:8 x4 A* o! `- K5 \
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    : X4 O* f  N) j! h
  57. #------------------------------------------------------------------------------#
    5 e* g5 ^  V" r- e
  58. # \# G, Y  m7 H3 o* X

  59. 6 i" S3 |1 J$ Q- |1 z
  60. #------------------------------------------------------------------------------#& l' k1 F6 u# J3 S
  61. #  SCRIPT CALLS:
    / I0 s7 A+ O9 P
  62. #------------------------------------------------------------------------------#+ j3 Z8 m8 A( O" M: y) Z; `
  63. #3 a- e% M; k' w& X" j; ]. X3 h- K
  64. #  char_effects(x,x,x,status)  _, d! Y8 K& F
  65. #
      A) \- ~  M* k& g: M; _1 V
  66. #------------------------------------------------------------------------------#
    4 }- C) ]( f& a: p
  67. #  # each effect can be true or false to enable/disable them during the game.
    - w; ?0 J$ O  j$ S5 b
  68. #  # you can change multiples of effects at once, x being the effect number, q( K; Q1 a6 Q
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons6 K4 v% |2 b5 ~% J1 C
  70. #------------------------------------------------------------------------------#) K: s0 {4 A( K8 f: S
  71. #  EXAMPLES:
      w0 J1 |9 D  P: X8 y
  72. #  char_effects(0,true)              # turn reflections on$ {7 |! C$ O; ~/ B: L
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    , N2 L. u* q) w. K& y" j
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    & L, m6 i1 V6 a( K
  75. #------------------------------------------------------------------------------#- o$ w3 m  @7 o
  76. #$ f5 G' Y. N- ~% k7 o0 g& M* F
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset* l0 L5 |3 a! a0 p7 G5 Q& S5 E
  78. #7 v" W4 Z- S8 v* D  M& g' |
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset; M% L& a: n* T$ ]" Y
  80. #
    # A+ ^0 H6 ~; Z
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset% k% F7 E7 z$ Z9 |$ K3 `
  82. #
    0 A1 m1 w0 A8 o1 s8 Q
  83. #------------------------------------------------------------------------------#3 l5 x! b, `5 i7 n
  84. #  EXAMPLES:) Z5 B9 S' H7 u9 f9 U
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    5 Z$ a$ H2 f) C$ ?
  86. #                                    # in position 2 of "Actor2" charset.+ @4 k5 J  a2 b  E+ ~- t
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    4 ]4 _* A$ a, S3 ]
  88. #                                    # "Actor4" charset.
    , P$ V" ]6 {# _9 q% o& k0 C
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of, u6 X( G' O1 b" e$ j
  90. #                                    # "Vehicle" charset.
    ) R; k1 y6 g- l) c" z5 b
  91. #------------------------------------------------------------------------------#
    . p5 M, D5 m5 ]5 R  ~" g
  92.   3 M9 F) h' l# r$ E: I- T
  93. #------------------------------------------------------------------------------#
    ; G$ C+ _7 g- S7 ^, a* |
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS0 x6 e. b& R+ |- a, S& N
  95. #------------------------------------------------------------------------------#6 ?8 v8 O7 ?* o' P' ~2 h8 e$ y
  96. #
    , d0 |& |) s" }" A8 W; M
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off5 d/ O9 p7 W5 w% F1 o9 o4 T' J
  98. #                          # use this to specify for mirror and reflect.
    5 h; {9 ]' \9 p1 W9 e, Y
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change( g' h3 L) v7 L6 X0 ^8 s5 V/ ~
  100. #                          # to change all events use :all; `' B% @4 m0 T
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    , m9 z. f1 z( A
  102. #                          # it 0 for no icon.2 B3 T0 F, l( P0 [: L, K
  103. #; A7 B1 k- X" m* z/ X4 K
  104. #------------------------------------------------------------------------------#
    * A! a+ U( X; f) p' i6 L' t. x; A
  105. #  EXAMPLES:0 k2 y! g: N8 Y8 @* ^3 A
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON: d$ L% y4 L: _# }
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    " }9 [, p& O8 H/ Y3 y
  108. #  reflect(:all,true)      # Turn all event reflections ON* t/ ?7 V- e  l% {  Y1 A
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    6 L' ?  @( f0 l8 ?/ ~7 d# _
  110. #0 Q" A& ~9 U: g; i2 z
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    # o  U  }2 \/ O- X  P# ]
  112. #        a map. This is a design decision to try to keep lag to a minimum. You6 m! M; W9 c# w0 |! U6 Z  J
  113. #        should use these effects sparingly and only activate them on events$ e' Z  j5 D9 _% J& M* v
  114. #        that require them.* [& P# S6 g) M- c& q  W
  115. #------------------------------------------------------------------------------#
    " ]2 G. r6 B/ Y, @# e3 n2 k- U
  116.   9 n% |2 U/ F; k3 e$ u
  117. #------------------------------------------------------------------------------#
    / s/ {+ @2 Q+ l. M1 B$ \9 e: D  }" E4 s$ z
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES# A4 D1 q0 t7 j. D7 H  M
  119. #------------------------------------------------------------------------------#2 F- N& E, k: v% Y$ ]
  120. #
    & E/ u6 x) ?9 m2 E# H) s
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    5 e2 z4 C" a- p' T; \# s
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 9 J* E* j! s; p. t( C6 w
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    - V/ e5 U1 y5 c
  124. #
    9 n8 i. f2 T) o8 h/ A4 y9 R
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects4 a' W: }# X" `: w8 p
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.8 F- @; ?8 n$ b! c
  127. #  v_icon(x,x,x,icon_id)
    3 ?: R( y, t) ^3 z4 z( C$ D: ^
  128. #: ?' _. u$ n) T$ {- ]
  129. #------------------------------------------------------------------------------#
    ) I/ l3 u/ ^# r& a# G
  130.   
    , ~7 _/ T- {& [! J& k$ ?
  131. #------------------------------------------------------------------------------#
    8 m4 {9 O: ]" e( z
  132. #  SCRIPT CALLS for shadow options
    ; z, T3 T( \; R' l) K4 f
  133. #------------------------------------------------------------------------------#: \5 y. x3 B5 K
  134. #
    ' U& a% E# Z3 n4 [# Q( B9 R
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    8 Q; V( G+ _; ^5 O  g% ^$ H$ X
  136. #                              # light source number you wish to change (for
    2 J* u/ c4 T* Z9 X0 A
  137. #                              # more than one). These are reset on map change.6 u2 I' \  b  M$ w( x
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    3 F2 t4 I8 _7 ]- |0 b8 {" b
  139. #                              # This will need to be in parallel process if you
    ( r+ R9 M3 }0 w0 j
  140. #                              # want it to be a moving light., q. o7 Q+ A* Y! `& ~
  141. #
      k0 G* Y# U! d* p
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    # k  [* {  c3 u6 P, _! ]
  143. #
    9 [$ R  V9 ?  W, h0 V! r' g) j
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    7 }1 d# [/ x, x% W
  145. #    # fade = amount shadow becomes more transparent the further away you are.7 Q6 w9 S, v. I: I# j* ?
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.7 v8 X) l+ l2 D5 U$ d" h. N
  147. #
    8 R3 O. Y6 W4 E3 n9 k5 M
  148. #------------------------------------------------------------------------------#
    - v. k, V: N4 b7 g; t' i' g
  149. #  EXAMPLE:
    9 n, M0 [( X1 w! D, T
  150. #  shadow_options(80,10,false)    # This is the default setting.
    8 g1 O( \# h$ V% W2 ^7 Z
  151. #------------------------------------------------------------------------------#  x, x/ E; i1 C: p) f% D
  152.   3 n5 q3 h5 T3 _4 q. T5 Y
  153. #------------------------------------------------------------------------------#
    7 T, e: Y# T6 C3 F. i
  154. #  SCRIPT CALLS for reflect options
    4 A" |) i1 S! V8 @; `  `( w
  155. #------------------------------------------------------------------------------#' ^' F! X0 l; s* I* ~
  156. #- a0 |' n! E$ x$ b( g# E/ E7 o
  157. #  reflect_options(wave_pwr) ( ~+ \8 P/ }2 b$ L' v* \
  158. #( G( h9 o9 {9 n7 y3 X; E& x
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    ) n3 c8 O2 S$ M4 B" c7 H4 ]* p
  160. #
    & Z/ w8 H- x9 s% N, F
  161. #------------------------------------------------------------------------------#
    " h% F& f9 E! V6 W- v! p, o
  162. #  EXAMPLE:
    + Y9 E; ^% ~: N8 X: _, q
  163. #  reflect_options(1) # Turn wave power to 1' h$ A) B' Z, X; z, k
  164. #------------------------------------------------------------------------------#
    0 ^! B* ]* K' n; g$ C
  165.   . o/ n6 a( K, N# b- ]
  166.   ( @! J% Y* @- v5 q& R
  167. #------------------------------------------------------------------------------#, ~0 n$ ~% ?# F, f% h
  168. #  NOTETAG for ACTORS
    ! k% B$ R: r) [- H2 a
  169. #------------------------------------------------------------------------------#
    # K8 a# g5 K; \% r4 l1 U+ a
  170. #
    * Q+ |! v: T7 _& P- c5 L
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!): p' k  C1 g$ z# m' O
  172. #
    ; ]- x$ j1 J" C& Z) [- h7 u; z! \
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections6 w- i9 ?3 ^* T0 P3 a9 m
  174. #                                  # and use the character in position 'pos'
    ) u5 g3 m( a# H; ^/ K% C  ~4 Y
  175. #
    * l  |5 \) i2 X  d
  176. #------------------------------------------------------------------------------#
    - o" m, j4 g3 \7 a* D
  177. #  EXAMPLES:8 b; g5 _# h1 h( m/ R$ f
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    ) z  w5 H( h& `$ Q+ `
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset1 ?5 w9 G4 o+ D4 _' c+ P1 W5 p
  180. #------------------------------------------------------------------------------#. J6 W; g3 |0 B; _8 _; r9 `
  181.   9 w  S2 q, G0 O( x
  182.   . U  R' o+ |: t+ d
  183. ($imported ||= {})["Galv_Character_Effects"] = true* @; d; d4 ^+ @$ R1 v& b; m
  184. module Galv_CEffects
    # \6 \- ~6 n; o- G
  185.   " O3 d8 ]0 c" j$ T
  186. #------------------------------------------------------------------------------#    k4 f! W6 |  D
  187. #  SETUP OPTIONS
      p: |6 f* N3 F* ]% \, w" }# I
  188. #------------------------------------------------------------------------------#
    1 A8 n! q( q  e
  189.   
    ! u1 q5 J+ v- V( T/ u0 D
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    % q! \2 l1 q# @
  191.                         # region on the wall you want to make reflective (and
    $ }% H' _# `6 y. L
  192.                         # then use tiles/mapping that make the parallax visible)
      ]2 V! D* z9 j5 k* T
  193.   
      b, g+ J% n6 r6 c& u( [5 _) {
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters. \+ h; }4 l9 T' d+ W
  195.     2 x7 t3 b1 X( v% U( U4 Z
  196.   REFLECT_Z = -10       # Z level of reflections) G1 I7 S: W" a6 S$ P3 H/ }8 T( |
  197.   SHADOW_Z = 0          # Z level of shadows( z  y2 V1 R" c& }$ K; |, Y# ]
  198.   5 Z  }$ h/ |+ x& G  W
  199. #------------------------------------------------------------------------------#  
    * n$ m  s9 ~6 K8 m) W
  200. #  END SETUP OPTIONS$ @. u6 d: m. x8 [' y1 |1 P
  201. #------------------------------------------------------------------------------#
    3 }  ?& p5 Z6 O8 o, T& e6 [8 k
  202. end" d* i( G" Q9 G3 f
  203.   5 D/ C; J9 {' O5 ~2 x
  204.   / p4 _8 n, r  ?0 H
  205. 7 D# B& j  J" g
  206.   \5 i( l9 w9 I8 ]/ c% e, N( U$ t
  207. class Game_Map
    9 ?+ S% {3 a5 V. H
  208.   def do_icons(refresh = true)
    * v/ m1 q7 v7 e& R+ w
  209.     @events.values.each { |e|" E. r9 j; |* }
  210.       next if !e.list/ {* G, m4 c5 ]! H9 ?9 U* J5 \" C
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/8 a; s4 y2 m7 k* K' ^, }
  212.         e.icon = $1.to_i5 [& t9 F" C8 ^  L+ R0 Q
  213.         e.icon_offset = [$2.to_i,$3.to_i]3 g4 {- I2 |9 r+ }
  214.       else9 t3 W; n0 z* z! `
  215.         e.icon = 0
    % e' ?9 Y/ V7 l+ H: i
  216.         e.icon_offset = [0,0]* B, A6 X3 c' G; c) A0 l5 R
  217.       end3 `. h- Z4 L& S% D: [; I
  218.     }7 G; w+ \' N& m: N
  219.     SceneManager.scene.spriteset.refresh_effects if refresh: q0 u% W# D- E
  220.   end
    ' O+ k1 }" g1 Q6 Z+ _
  221.    % x" U5 f/ X) n
  222.    , |: Z9 A  a* d$ \, c) ?' U
  223.   def do_shadows(refresh = true)" Q% H7 U* e& h2 }9 u" T
  224.     @events.values.each { |e|
    0 G1 A' T$ U3 P; b$ c6 E
  225.       next if !e.list( D  Y7 Q: F  _- f! _% R( y
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/7 @- w  ]# Z" s' q$ V
  227.         e.shadow = true
    , H: O# L" b$ ?6 k% p: @( h
  228.       else( T. o! ]; o/ U' T
  229.         e.shadow = false, ~6 w, x# E6 P$ K  s
  230.       end
    5 q, q- q, l5 G0 J
  231.     }
    1 t, K0 Q' j! q7 n, _
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    6 R4 V: R9 f9 G8 q0 K" ?- C
  233.   end
    ! N) _) g- x  x7 f4 a, ^
  234.    
    * e% k' F9 S5 N% W
  235.   def do_reflects(refresh = true)
    " M! b: j" p. i$ x
  236.     @events.values.each { |e|4 B3 S  v1 T. B/ O( m
  237.       next if !e.list2 c; |, A7 K" l+ Q: F2 t5 _) l+ l/ n( v
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    2 C5 c% h4 f8 P* b2 ?! l
  239.         e.reflect = true% N) n  `) V" J) R5 b% u
  240.       else! |% X$ ~% \2 ]5 u2 k! k
  241.         e.reflect = false
    + J/ E" J( d0 ^- V
  242.       end
    : m" v1 F/ g+ D( c! g$ H, ?$ O
  243.     }
    ) f: x6 `, E6 m! @
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    & }' i- S! j! E. o1 y! o
  245.   end
    % X- O: S5 X; |2 l* i% i# H$ F
  246.      J, d* H* ]1 B* H
  247.   def do_all_chareffects
    ! |% Z. \) s& T' m
  248.     do_icons(false)8 T( z: i) ~: s8 @& M. O
  249.     do_shadows(false)
    . ^" S7 p" A5 V  }
  250.     do_reflects(false)) g) W/ D' m/ Q/ u2 ]
  251.   end
    7 W6 x9 c8 ^7 ~) S
  252.    " \, N' P4 ^; O8 c
  253. end # Game_Map
    , d. _8 W0 u! ~: i3 _% u
  254. . f6 e' \/ |4 I- t
  255. 4 o8 \& S) G# B6 b6 \  A6 E
  256. % [+ q  k! ]# Z1 A7 T" m
  257.   6 s* J$ O; F; p7 T
  258. class Game_Interpreter# Y! i3 X0 |2 v9 o0 Z
  259.    
    $ x/ ]; r) F6 W
  260.   def remove_icon2 U$ e  c. Z; w
  261.     icon(@event_id,0)3 c4 ~/ o: q" o+ K" n8 D5 k
  262.   end/ w$ A8 p! N5 o0 h7 S
  263.   / H5 V* d! j. A8 Z1 F
  264. #-----------------------------------#
    ; o" d9 \1 p5 ~5 |( [0 Z$ U  f
  265. #  REFLECTIONS5 B2 E/ d6 K9 [
  266. #-----------------------------------#! K5 \2 t+ k) a8 r) Z) r8 P$ ~( M- v* {
  267.   ( |, F- i8 m. o
  268.   # Add/Remove Reflections from selected events) \' g' _' D/ X( ^4 ?
  269.   def reflect(*args,status)8 v% u8 O- b6 J4 ~- V. s) m
  270.     char_ids = [*args]
    ! d. x6 H6 E) e: j* t9 ?3 y
  271.     if char_ids == [:all]
    ) W1 r, i" p0 v! S" m7 E* p
  272.       $game_map.events.values.each { |e| e.reflect = status }
    7 ~( Q" A4 n) h+ m0 q
  273.     else
    8 n8 A7 C# T: e0 r5 V* O2 c! u4 T
  274.       char_ids.each {|c| $game_map.events[c].reflect = status }
    2 K8 I: p1 _( f  \) \
  275.     end
    2 E/ W- E) A' R) ?
  276.     SceneManager.scene.spriteset.refresh_effects
    5 u. r( n4 ^0 r  @$ V
  277.   end/ V) l; C: r7 k6 t
  278.     6 {: V! C$ e; d7 @+ t/ I( F6 ~6 Q% {
  279.   # Change forever actor's reflect status" X: G( s$ v# h, V) X8 i" n
  280.   def actor_reflect(actor_id,status)1 s2 U) A& W6 ?# b
  281.     $game_actors[actor_id].reflect = status
    # E: O$ d/ R! C  r. U0 C$ b
  282.     $game_player.refresh
    6 x, o+ h- k& G: I7 ~8 U
  283.   end6 L* j1 x+ }) v/ a8 m# a% c
  284.     7 S, l0 N: I% ?, {. A4 Y& N9 X) t
  285.   # Change forever vehicle's reflect status
    ( U4 ?/ C( g* T; p# r: S! N
  286.   def v_reflect(*args,status)
    1 L* N! D  D0 X$ P' _" e6 t
  287.     char_ids = [*args]# T0 d1 R3 E% Y7 i
  288.     if char_ids == [:all]: {1 T! a5 }- w6 i( U
  289.       $game_map.vehicles.each { |v| v.reflect = status }
    $ D8 R8 k- v* \) }: T7 W1 \4 P
  290.     else" U  M1 n; O1 S1 F5 t5 c9 X+ ]
  291.       char_ids.each { |v| $game_map.vehicles[v].reflect = status }. N, _; U* L, m) R0 M. [% D
  292.     end! a1 i' T* [* I$ U. }; e
  293.     SceneManager.scene.spriteset.refresh_effects9 l( {* N7 b/ [1 c
  294.   end* G& M: r1 e1 X( g+ _$ ^6 c$ d8 Q1 w
  295.   
    0 t, O8 z; a; h7 c
  296.   def reflect_options(*args)
    8 a( a" _+ |# X
  297.     $game_map.reflect_options = [*args]. }' G; U, [6 _3 U6 ^! N1 Z
  298.     SceneManager.scene.spriteset.refresh_effects. a5 s1 ^! k  k, m+ h! k# H
  299.   end2 B. t1 q1 i, Y$ G, @" |
  300.     3 @( u& M1 H8 h' F& W
  301.   # Actor reflect sprite change
    / `# p4 r$ B  f* E, ~0 B
  302.   def reflect_sprite(actor_id,filename,pos)
    / E9 h+ L9 T& D+ i# T' W/ R" x
  303.     $game_actors[actor_id].reflect_sprite = [filename,pos]: z( t# L# X+ K) G5 }
  304.     $game_player.refresh( O( k- M$ U3 }( P' {6 v1 K2 V
  305.   end
    7 [6 K3 C; }6 d2 v% [
  306.     - @5 }6 g6 {' @; O1 z
  307.   # Event reflect sprite change
    & q+ s- g9 r6 B! U0 S
  308.   def reflect_esprite(event_id,filename,pos)
    $ F* \* \, b4 E3 A
  309.     $game_map.events[event_id].reflect_sprite = [filename,pos]/ [" N7 ~7 W+ A5 K& V6 D
  310.     $game_map.events[event_id].reflect = true
    ' T2 i# C2 x. ^' S& _/ i
  311.     SceneManager.scene.spriteset.refresh_characters
    ) c; q' T9 Z3 D/ u) Z
  312.   end
    4 E. h4 U% y+ e# R* H& h1 k3 h) y
  313.    
    ( [$ b; q* ?  g  k" o# }
  314.   # Vehicle reflect sprite change
    * }9 c8 a* d6 e  E; D1 b4 c3 [
  315.   def reflect_vsprite(v_id,filename,pos)
    ! V1 N" d) T/ K. W* `2 B, d- I
  316.     $game_map.vehicles[v_id].reflect_sprite = [filename,pos]! y6 ?9 ], N! }8 {" y  b
  317.     SceneManager.scene.spriteset.refresh_characters& k2 Y* _4 e( x
  318.   end9 p% p# K$ X% r
  319.   7 _+ q; b. j9 t! G! K
  320. #-----------------------------------#
    $ R# i8 Y' @5 D0 U( f3 Z1 n% i
  321. #  SHADOWS
    , u& R, e  K5 T: Z2 i2 N8 n& {
  322. #-----------------------------------#
    : Y, v3 D0 z" k5 Y( C3 Q
  323.   / M& I8 @" [& o
  324.   # Add/Remove Shadows from selected characters9 e$ {) v" n7 g
  325.   def shadow(*args,status)
    $ ]! D; F0 p1 _' f3 u+ t( q
  326.     char_ids = [*args]) x9 o) O6 [' P7 E& [
  327.     if char_ids == [:all]- `5 i; q0 U2 L; k# S% d" a- s0 r
  328.       $game_map.events.values.each { |e| e.shadow = status }
    , c; G" Y4 i5 s
  329.     else7 e4 `1 \( T6 E8 G* S: X
  330.       char_ids.each {|c| $game_map.events[c].shadow = status }
    / s* }5 m- m1 X8 Z: r7 \
  331.     end5 k4 P% x' c4 i5 _5 o1 I+ R
  332.     SceneManager.scene.spriteset.refresh_effects5 O3 C8 H* t8 A7 ?  N
  333.   end' \8 r* b$ s  X' V& S+ A- U4 }' j( |
  334.    
    ) t% E' D7 g- M; q
  335.   # Change player and follower shadows& @: O" q2 S; V4 O. {  T
  336.   def actor_shadows(status)- }# j8 \3 K/ }6 m
  337.     $game_player.shadow = status: W' r  h5 h+ E+ n* t( I
  338.     $game_player.followers.each { |f| f.shadow = status }/ g4 _4 {3 O2 Z8 q1 b0 i% {
  339.     SceneManager.scene.spriteset.refresh_effects
    4 J  S; R) m5 Q  n
  340.   end
    % }$ W+ r3 a2 o6 W$ K
  341.     8 T4 x) h9 q2 [2 U( q
  342.   # Change vehicle's shadow status0 c- t8 C! z6 Z) I0 T6 }$ @
  343.   def v_shadow(*args,status)- @. m, O* v- ]" j  R
  344.     char_ids = [*args]6 m4 N1 z) x+ U8 p& e6 ~7 w
  345.     if char_ids == [:all]# r' E" ?$ n- J4 f8 v
  346.       $game_map.vehicles.each { |v| v.shadow = status }
    % D& z* V2 P. E
  347.     else
    ' w* J1 J2 X! J5 n# j% y
  348.       char_ids.each { |v| $game_map.vehicles[v].shadow = status }
    7 Y' T0 h/ z9 s
  349.     end$ [! w. u4 O, L/ W% w! r' z
  350.     SceneManager.scene.spriteset.refresh_effects
    ( Q7 [# x, {0 |! ~$ h& h6 d5 w
  351.   end$ b# T+ b" T0 ?) y
  352.     + p. s( r7 p0 q. S. M6 q% H  S$ R
  353.   def shadow_options(*args)
    7 H0 c$ w+ j$ ^* @+ F( ^; L
  354.     $game_map.shadow_options = [*args]
    - d7 R( M, i- {) V, n3 D2 A
  355.     SceneManager.scene.spriteset.refresh_effects
    - F  P2 x# {! r7 a  s3 d
  356.   end
    * z5 |  \* D& y' ]+ o3 f1 m
  357.   8 r# V# m% T7 i' ~' m( c
  358.   def shadow_source(*args,shad_id)" c, b) M6 z$ p) z
  359.     shadsource = [*args], ^+ f" K+ X# _) o/ A6 t
  360.   
    . u1 o' e: Y6 ~. V
  361.     if shadsource.count == 1
    4 ~& I# q4 q( L7 Q) ^& Y0 v. u
  362.       $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,( B- T6 c5 _* ^( N# u0 r; D7 K
  363.         $game_map.events[shadsource[0]].real_y]
    / Y; f$ S" ~7 D8 \( F
  364.     elsif shadsource.count > 1
    1 Y& h  Y% `- ?; C! }, H
  365.       $game_map.light_source[shad_id] = shadsource& u0 i: _9 w8 d, K
  366.     else" d; |: c5 q1 h0 c4 j) B0 @
  367.       $game_map.light_source = []0 M9 o) \. b( }; X" y
  368.     end
      Y; V0 u* ^5 r  D( X% C8 L$ c6 }2 w
  369.   end
    ' l0 p7 c9 p8 n6 }' m
  370.   
    $ t1 x+ i5 f* |; |$ E
  371.   0 l! [) V7 J. E9 ^
  372. #-----------------------------------#  j0 z" U! Z$ F- Z, ^- Z; i# B+ I
  373. #  ICONS0 h: b$ H9 u0 D! b3 R3 t: g
  374. #-----------------------------------#
    # ?; y0 G* K, S% X% ~$ J2 G) M
  375.     C3 T' i: i+ \+ H
  376.   # Add/Remove Icons from selected events7 g" q' T- Y0 a, u% {
  377.   def icon(*args,icon_id)# ]- W$ ?. ?+ a! }; G& S$ d
  378.     char_ids = [*args]( p$ S, ~: P7 u
  379.     if char_ids == [:all]
    + Q% y# S8 l: A. h! q
  380.       $game_map.events.values.each { |e|
    8 j% w! C. \- Q0 \; A' j$ _$ L2 l
  381.       if e.icon <= 0' P3 o* L3 I9 n6 N3 K
  382.         e.icon = nil* [! ~1 A" X) E( Q! g
  383.       else
    , E8 b# O5 s2 \, u, c6 U
  384.         e.icon = icon_id  [! i3 T. I- p! g
  385.       end/ n* t" y  G. r4 C
  386.     }
    8 J$ f( w' E7 t/ g6 p
  387.     else
    " ]6 v* o- A6 l, B
  388.       char_ids.each {|c| $game_map.events[c].icon = icon_id }" O  Y* m. ]3 |% |2 q- c% D
  389.     end9 C8 ?" I6 B' M( W' Z) A
  390.     SceneManager.scene.spriteset.refresh_effects
    6 D* s. l+ M0 [
  391.   end
    # ^) q" M, L! ?3 ~; u# S  n
  392.     0 ^3 I7 x/ V8 ~2 Q& c6 \
  393.   # Change forever actor's icon
    1 X1 d, ]3 Z0 R3 o3 P3 [
  394.   def actor_icon(actor_id,icon_id)3 V" l! l3 ]3 G3 V! O; l
  395.     $game_actors[actor_id].icon = icon_id
    1 S5 y' V1 P6 E: j- ?+ e
  396.     $game_player.refresh5 b/ y) K$ }) G! b  i; _
  397.   end
    % E3 d* q5 E2 U
  398.    
    1 K' M: c9 a+ ?- t+ \) ]3 c2 M  u
  399.   # Change forever vehicle's icon
      {0 |, v  n/ z) g3 @6 T3 F
  400.   def v_icon(*args,icon_id): Y3 ~& g# Q& U) Y$ @0 T
  401.     char_ids = [*args], D" y  i4 [& g( A3 x
  402.     if char_ids == [:all]
    * L8 g$ z$ P+ \3 W* ?) L
  403.       $game_map.vehicles.each { |v| v.icon = icon_id }
    4 }; R. e( h8 g0 {) d8 L
  404.     else/ ]7 F! W0 k; N$ o( |" {
  405.       char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }
    ! E# j9 t; Z7 f' p$ c
  406.     end
      n: `8 o- Z$ G4 V
  407.     SceneManager.scene.spriteset.refresh_effects
    ; O7 z- y' G7 d! S: u
  408.   end
    - y1 y( C5 `( J3 S( S! Z" j
  409.   
    ( l6 [; W! z3 k( i
  410. #-----------------------------------#
    8 ^7 k% N% L: k( B6 `. o
  411. #  GENERAL
    ! d9 Y9 Y9 @% G' {: j) @6 D+ @0 |
  412. #-----------------------------------#
    , B4 e: |8 g* b
  413.   
    * T9 T( F9 r" }
  414.   # Turn on/off effects$ x( t  q/ X4 f4 s  b6 |. R- B5 S
  415.     # 0 = reflect9 J, t% o) r; _. j1 _3 ?5 B8 r
  416.     # 1 = shadow. ^7 l4 \. Z" j" @# t% q
  417.     # 2 = mirror. y9 f) i1 T; U2 w7 n* x: r! i
  418.     # 3 = icon
    , K9 J* b8 l0 v; P
  419.       4 X- W# t* C4 U3 c- L# T
  420.   def char_effects(*args,status)
    5 ^# d2 `, i% f0 f
  421.     [*args].each { |e| $game_map.char_effects[e] = status }" g8 \& z6 |7 ~# \
  422.     SceneManager.scene.spriteset.refresh_effects& k8 D* R* j8 H
  423.   end9 g- }' a! \5 h" X3 ^) O: O
  424.   ; Q% _2 f+ ]( ?( V% C6 T0 g5 b
  425.    
    9 ], ]7 t3 |. B3 T; H4 l( O
  426. end # Game_Interpreter9 E) c$ Z+ @* T) P- @
  427.   
    ) ~" K( Z7 W; Y& b7 H% u5 [
  428.   
    8 Z, }- Y! K$ c" T- C2 K- Y
  429. #-------------------------------------------------------------------------------
    " u2 I1 m& U" y" ?$ A7 M7 p
  430. #  Spriteset_Map
    & s3 g- N0 ?  \, j8 q
  431. #-------------------------------------------------------------------------------% |0 i% D" w" C0 k8 f* e
  432.   
    : E  P, V" f: M
  433. class Spriteset_Map4 t& ?, f7 _; |# U+ M* o5 Q
  434.   alias galv_reflect_sm_initialize initialize* y1 @1 X* U3 D" u1 x
  435.   def initialize
    5 I3 ~- U5 v& }% T
  436.     create_effects
    - t0 b7 U" O6 O3 ?
  437.     galv_reflect_sm_initialize
      m) k0 v6 _2 Z' Z" e
  438.     refresh_characters
    ! L& U1 T) G  S" G
  439.   end
    5 \; O+ \9 }" S6 F: z
  440.     + v) R+ r: f: F5 N
  441.   alias galv_reflect_sm_refresh_characters refresh_characters
    ( i: v6 ^7 I1 q* ]7 d8 [1 y" |
  442.   def refresh_characters6 a/ K% D. ?8 F3 _
  443.     galv_reflect_sm_refresh_characters0 f' Z6 p8 G# R/ Z4 {% f
  444.     create_effects" _- A. ~) h$ e2 Z3 G5 x# e+ D
  445.   end) M# ^) P7 T  k, s# b6 o3 c1 ^
  446.     . O  D' a* z7 L8 g2 B4 e' p: D$ D
  447.   def refresh_effects# k# q" V$ [8 Y1 K8 ^, m
  448.     dispose_effects# z5 `4 u. i# ~1 ~" a' \
  449.     create_effects, `, _: s4 t4 N2 E" Z7 m, W/ j- n6 N
  450.   end6 a- }" D% @% l" Z+ |. h
  451.     6 y# B5 m" M1 B. D3 c
  452.   def create_effects
    2 ^3 }# G% Y& [3 s* R' t. e1 |
  453.     @shadow_sprites = []
    ) d* o5 E8 |+ D, z
  454.     @reflect_sprites = []0 i) j7 c$ T# e9 g, {
  455.     @mirror_sprites = []
    ) X4 H* M8 t) Y2 @+ [# u+ f
  456.     @icon_sprites = []* q" c+ v, J% \
  457.         W; v  J2 M* R9 e* A- ^% t! G
  458.     # Do reflections
    0 s; Z$ D5 F3 f$ _
  459.     if $game_map.char_effects[0]7 E- s! [( _+ y7 W
  460.       $game_map.events.values.each { |e|/ e, Y5 k1 z# p
  461.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect, o* z2 M* F/ A3 H1 f  e7 U- Z
  462.       }
    ' \# ^- v* E3 c& i! \5 W5 p5 }+ u% o
  463.       $game_player.followers.each { |f|7 @, k  i7 v9 T+ x: e4 v( [
  464.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect/ _4 `# D. R3 k1 K
  465.       }- M7 h/ J5 C) C, Z' t/ x
  466.       if $game_player.reflect
    1 l2 D# p' i+ ]' \( E8 q
  467.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))
    . e2 Q1 m% m9 @/ P% p' q
  468.       end9 |( e7 @7 t1 x" p4 R
  469.       $game_map.vehicles.each { |v|0 t4 v! z% a+ n, F; ]
  470.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect
    , g7 n/ ^: [. z  E* _8 B* x( a
  471.       }
      ]" M- v# A4 E# K) d
  472.     end
      g4 p4 T1 D/ |7 b2 d+ A+ e
  473.       
    + [2 `; J6 o" Z7 S  f: ~
  474.     # Do mirrors; l- t5 E4 s; A0 P5 d
  475.     if $game_map.char_effects[2]
    # l& B& c& V' H  f
  476.       $game_map.events.values.each { |e|$ n. [) o1 H2 v% t5 ^" S
  477.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect2 ?  f2 _, n! [
  478.       }
    # w6 D9 x5 z/ k! R- J* }
  479.       $game_player.followers.each { |f|) Q2 g6 D/ `# i; e; f
  480.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect, e" S2 G1 X! H' p
  481.       }
    # Y" C8 @" {4 S- A9 k
  482.       if $game_player.reflect
    + s- k8 O) o/ Z/ s
  483.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player))
    0 O. X$ i1 f# Z
  484.       end
    + q9 J2 v  S+ ]( B" M& j: a* [* ~9 K
  485.       $game_map.vehicles.each { |v|
      n2 f& p/ o0 ?# D  Q" Z
  486.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect
    8 A( t7 x. R8 c7 s1 y
  487.       }
    / f  S: h; e& y5 I/ w. k. K
  488.     end2 H  Q* d' k1 F" S% ^3 @8 \
  489.       / l$ B) p) ]9 G: W: e: e! w# J* i
  490.     # Do Shadows2 Z# r/ W6 {/ X. x) t) g
  491.     if $game_map.char_effects[1]
    " q  \( h2 ]1 X' w( x; B8 |: V
  492.       return if $game_map.light_source.empty?; ~- ^/ O/ O" z  i# o
  493.       $game_map.light_source.count.times { |s|$ L* f) W: ]3 x# k9 u, @, Y9 ]
  494.         $game_map.events.values.each { |e|
    9 @( ^; h9 {5 ^: Q+ T2 i
  495.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow. D4 e8 k) `4 ?8 o& T, v' a
  496.         }5 p+ f9 Q  k/ a2 N% v4 [4 u
  497.         $game_player.followers.each { |f|* j3 n* M7 A! U1 H
  498.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow( g% F3 j8 C' Z1 T- x. R
  499.         }! _% ~& L# a7 G
  500.         if $game_player.shadow
    # _/ n' R$ e/ E2 o9 V# m
  501.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))
    0 f( I7 l$ }( q$ `4 B
  502.         end
    4 m1 J% p0 H0 {+ M7 t
  503.         $game_map.vehicles.each { |v|' D& r$ l  z7 ^4 r) f7 f
  504.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow- \. T( [& T5 I7 H4 w. F9 s
  505.         }5 s2 S7 n" E2 d  s
  506.       }
    0 C( w; z  f& O; P9 E8 I" C7 p
  507.     end0 P, l) [' d. \
  508.       
    " l) O( a9 v! P3 c, l3 v& s
  509.     # Do icons
    % t& T0 d7 w$ N% P1 [5 d
  510.     if $game_map.char_effects[3]
    $ @) y7 Y. w5 o
  511.       $game_map.events.values.each { |e|5 Z; t# b: h2 \. C/ l# A
  512.         @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon. M4 G7 j( [3 t; I  N4 v: s7 Z
  513.       }
    9 o7 F7 r8 J! }6 X( m
  514.       $game_player.followers.each { |f|( ]' G" _8 }/ K. a3 G& D$ @
  515.         @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon
    $ `+ r6 c9 H0 V, e/ K) a6 I
  516.       }  \: h& [' V. }& Y9 n. K+ z% `5 x
  517.       if $game_player.icon
    $ }2 \' W, Q0 z8 [. n
  518.         @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))7 o1 s5 h3 V" R* i9 ]% G
  519.       end8 w3 j7 Z" V* W) G0 _- j' h
  520.       $game_map.vehicles.each { |v|
    : [: |7 y7 w( q- }# ~
  521.         @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon3 @5 Z; I9 `! t. U
  522.       }1 h' n1 o; B( h
  523.     end0 ]7 H' H. c# E( S7 I$ `2 s
  524.   end8 B4 ^$ I& _, K; y
  525.     - w. s, A4 m; P9 ^7 Z! F0 I; t
  526.   alias galv_reflect_sm_update update
    2 \5 {0 w: V/ Q. l
  527.   def update# o) _) I+ i/ A7 |1 j* L
  528.     galv_reflect_sm_update
    - v$ u1 h2 ]' t: \! W
  529.     @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]
    ) c  d- S! B/ I" Y0 _
  530.     @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]
    - F' l* P- T3 E! L& h$ f
  531.     @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]3 |( |3 r$ C5 V; T# a$ _+ Y
  532.     @icon_sprites.each {|s| s.update} if $game_map.char_effects[3]2 [2 X4 L/ ^1 g6 ?# |: A( [& R$ E
  533.   end
    % _0 S$ z+ Q# v# N$ H
  534.   8 t- |0 K: C  T0 b- Z4 ^) t
  535.   alias galv_reflect_sm_dispose_characters dispose_characters
    ! C2 h5 I9 h- A# g0 w
  536.   def dispose_characters
    ) ?" |, k$ n% _. W* }
  537.     galv_reflect_sm_dispose_characters
    6 B  Q8 D6 T' Z; `
  538.     dispose_effects- t, T( I* H! j/ h! D
  539.   end3 X, I$ D1 M' e& W* _
  540.    
    6 m. B$ o! M0 f" B; a% i7 L  \
  541.   def dispose_effects! m  N! u* H/ k2 m; y
  542.     @reflect_sprites.each {|s| s.dispose}% Y1 a: `1 l4 i* A1 S1 c
  543.     @shadow_sprites.each {|s| s.dispose}, ?% a& w$ L  l5 m$ _: M& R* L
  544.     @mirror_sprites.each {|s| s.dispose}
    $ ?7 l% i9 E5 r) G+ {+ J5 G+ n
  545.     @icon_sprites.each {|s| s.dispose}
    ! Z! B# g5 K! z  `% i( {7 y( z1 z
  546.   end
    " b  z, k8 ]5 p5 P, w% p
  547. end # Spriteset_Map
    ) b9 k, \# I' n+ d4 P+ Q' [
  548.   
    7 u/ w8 v$ m2 G5 V# q5 `
  549.   
    1 K2 {9 `" V2 ?  K; J% o. n0 @
  550. #-------------------------------------------------------------------------------
    ; s' [' D$ w  X6 ^% X1 C
  551. #  Sprite_Reflect
    4 m: b% q  p& r% @2 n
  552. #-------------------------------------------------------------------------------6 D0 Q( A5 A' `# w+ q* L
  553.   ) d( o# B2 `6 B/ x1 y+ M6 w
  554. class Sprite_Reflect < Sprite_Character( L+ g) `8 A) d5 Z7 g7 i
  555.   def initialize(viewport, character = nil)/ _. h& _7 H* K- J/ {5 y8 @" ^
  556.     super(viewport, character)
    - j$ _. u3 A; D& `! z4 v! \
  557.   end
    3 J; ]3 G/ m8 Y( h- G$ }; f4 D9 [% V
  558.   
    - ~# f7 w/ b8 t4 ]: g2 |, s1 S
  559.   def update
    + N" _3 K! J$ m/ J$ ]
  560.     super
    ( N2 `* K+ E( j" S
  561.   end, A! _4 g" q, r3 q
  562.     ; d% a( V4 U4 |% g& E: d5 {
  563.   def update_balloon; end
    9 o& I+ |0 b' V" Q: g
  564.   def setup_new_effect; end
    ; l0 J3 ^) P( C: v
  565.    
    0 I* P; Q7 \5 k6 w
  566.   def set_character_bitmap
    1 `$ z1 Y7 n% d, }. m) R
  567.     if @character.reflect_sprite4 Y7 W8 v2 h- y  a
  568.       self.bitmap = Cache.character(@character.reflect_sprite[0])
      Z0 d7 z. G/ I% X
  569.     else
    / @1 ~1 T! I2 \  D# i9 F$ Q$ q
  570.       self.bitmap = Cache.character(@character_name)
    $ p4 I; U9 a0 h5 a/ K3 G% x
  571.     end, [1 @' H$ e2 K, N
  572.     self.mirror = true
    . S, f! k# e3 u% B% }( e7 J
  573.     self.angle = 180
    $ |0 D6 C- T4 c$ Y2 Q) k! u$ I9 c
  574.     self.opacity = 220) t& z, U, s1 `( t) _& ]+ \
  575.     self.z = Galv_CEffects::REFLECT_Z
    1 t4 o5 n* T2 |/ s
  576.     self.wave_amp = $game_map.reflect_options[0]
    9 C- A4 k& t4 ]$ Z9 D! m
  577.       6 ], x5 e6 l& K) f) n, I0 s5 ?6 l9 L
  578.     sign = @character_name[/^[\!\$]./]  x6 f) m& s9 o! a$ j7 ], C/ Q+ N. A7 T
  579.     if sign && sign.include?(')4 g/ y- a# l1 m- ?1 w
  580.       @cw = bitmap.width / 31 h) ], C4 v+ t- L* k
  581.       @ch = bitmap.height / 49 n8 Q' z0 D# B: k
  582.     else
    * p" S( ~% K& h! @
  583.       @cw = bitmap.width / 12
      g8 Q( x# J1 R- R' p. w/ Z
  584.       @ch = bitmap.height / 8
    6 ]3 d: H( s- l% l4 z3 ^& i
  585.     end/ {& B. K: N9 x- \1 w
  586.     self.ox = @cw / 28 q8 Y) `  v6 U- o4 |* W' n( O
  587.     self.oy = @ch
      T% `# t- z& B! O
  588.   end
    , }6 Q( B! e* u  x- \
  589.   4 l1 _) n: ~' F; S1 ~  E
  590.   def update_position
    ! m' z% d3 V2 C; X" [9 O4 n
  591.     self.x = @character.screen_x
    # L# U$ Y; ~, C2 M" |0 D% Y
  592.     jump = @character.jumping? ? @character.jump_height * 2 : 0
    2 W# d+ F( }1 \0 ~- S( X1 M/ c3 O
  593.     alt = @character.altitude ? @character.altitude * 2 : 0. K+ t( V/ A6 U' s8 N4 k
  594.     self.y = @character.screen_y - 3 + jump + alt
    . Q9 v/ |: b) e) w! J. G: u
  595.   end
    9 n! e% D4 ^4 Y2 y9 Z
  596.   5 s* G6 W" `1 @+ Q
  597.   def update_other
    ' C0 L6 A  }; a3 M( N
  598.     self.blend_type = @character.blend_type. @' O) t  ?" I
  599.     self.visible = [email protected]
    * Q# l3 R, ?1 N1 [+ ]) g: Y1 s
  600.   end6 {) F6 n  B8 U. o, B
  601.     ) O7 \( k6 o$ N1 m# ~% @7 S; @
  602.   def update_src_rect
    8 z0 P. m$ [0 `/ ~
  603.     if @character.reflect_sprite% D* l' y5 {  B$ ?, o6 g, ^) o
  604.       index = @character.reflect_sprite[1]7 c! I( ^% K& B
  605.     else
    2 `: C  ~3 @2 P! B" x/ T1 U9 y
  606.       index = @character.character_index  E3 [2 n' E# `; c) I
  607.     end
    ' ]% K3 ^# N( b- R2 |) ?6 J
  608.     pattern = @character.pattern < 3 ? @character.pattern : 17 {: i9 U8 ], e. ?; ?' h% e
  609.     sx = (index % 4 * 3 + pattern) * @cw
    " V# P8 N' p7 a* C6 v
  610.     sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
    0 p1 l# N0 e# N% S" L
  611.     self.src_rect.set(sx, sy, @cw, @ch)
    ( U4 g5 \, R- l. _* r2 t/ N
  612.   end
    * H( F' K, l% E5 A
  613. end # Sprite_Reflect < Sprite_Character# x# ^# t! ?8 u0 c
  614.   $ Y1 G$ C+ I7 F) p0 N. i' R
  615.   " V1 r# p+ b6 l0 t- |! f
  616. #-------------------------------------------------------------------------------- i0 J* a( j: K' F& H
  617. #  Sprite_Mirror
    5 }3 ?8 |, A5 w$ r. o: X2 X
  618. #-------------------------------------------------------------------------------+ f: g4 }+ ~0 v. [
  619.   8 k; m# w  ^. k  n. j
  620. class Sprite_Mirror < Sprite_Character
    8 Q5 [9 D1 b% V) y
  621.   def initialize(viewport, character = nil)
    , u, O$ Z2 w& g$ C- D: u8 b
  622.     @distance = 0
    7 P  n; b& b: a4 _) v
  623.     super(viewport, character)
    - l3 z2 c8 v* K0 I( E8 n
  624.   end( G1 ?6 a. [+ ]7 z8 U# h: }, y
  625.   % {; B* s& ^' h3 r5 Z
  626.   def update
    4 ~* q8 h6 [6 Y& j) w
  627.     super% T2 e1 b( W5 c5 ~5 Z- I  p, k
  628.   end
    4 W! D, j" X0 V  ^% l, w
  629.    
    ; d5 T: `/ z, I( `) u# ]
  630.   def update_balloon; end
    ; p# x2 j# R! g  n( n' C: T
  631.   def setup_new_effect; end
    % z$ @  R1 W- T7 R8 |' G% K" d3 T! I
  632.    
    / n& L+ D4 f' L% I; C) c$ t1 c# W
  633.   def set_character_bitmap
    & H/ a% u4 P4 U( A' b! I0 Q
  634.     if @character.reflect_sprite+ J6 B% l2 H  t) a$ k
  635.       self.bitmap = Cache.character(@character.reflect_sprite[0])" f9 d2 }8 n' Q6 g
  636.     else4 ?1 S% `, R: x
  637.       self.bitmap = Cache.character(@character_name)/ e& N+ E- P& F1 d# h0 `8 r
  638.     end
    0 |+ U. h: E. D5 w9 L
  639.     self.mirror = true0 a9 H6 G1 Q( X, s
  640.     self.opacity = 2551 H  _& \/ W  H! d! L
  641.     self.z = Galv_CEffects::REFLECT_Z* p7 Q! u6 Z3 B; O' c4 b; B
  642.       
    ' _# i" |. n( a6 F5 _
  643.     sign = @character_name[/^[\!\$]./]( z3 k4 k* M2 p7 W* h
  644.     if sign && sign.include?(')
    9 H6 n; ]7 ?# n- {; v4 d5 ^
  645.       @cw = bitmap.width / 3$ B7 G" p3 J# m4 l- P' `2 \
  646.       @ch = bitmap.height / 4
    - @# k+ a4 @$ ]% n7 L5 S, L( W
  647.     else) m$ F8 V; A5 R. [
  648.       @cw = bitmap.width / 12$ G5 }( x4 u+ g- S
  649.       @ch = bitmap.height / 8
    / X- {6 A7 O: u8 V/ I; j9 ]4 V
  650.     end9 O- M, N* a/ o2 c2 Y- C9 _# f- j
  651.     self.ox = @cw / 2; h: q8 j: |0 l8 C6 V6 X7 Z
  652.     self.oy = @ch8 b2 @: w# R* H2 t) I5 K6 [
  653.   end* q- o" |/ Z; L; {2 l8 E9 S1 v
  654.   
    ! g7 q6 a6 p6 q6 o
  655.   def update_src_rect" t& e; f& q' V
  656.     if @character.reflect_sprite
    ( @: A7 G- j% ~% |) d* x4 J
  657.       index = @character.reflect_sprite[1]& e  v, [4 O+ h, J4 x( q' N
  658.     else
    , O+ a) l" z( _  E2 j2 X
  659.       index = @character.character_index9 y! {' I1 a' g& P$ I
  660.     end- `4 F% U/ C6 r2 S* d
  661.     pattern = @character.pattern < 3 ? @character.pattern : 1
    ( D3 v* {& W  R1 m+ f" v
  662.     sx = (index % 4 * 3 + pattern) * @cw
    8 e) B# X- r8 [8 ]
  663.     sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch  i1 k5 O' z% |* x/ v4 |6 n
  664.     self.src_rect.set(sx, sy, @cw, @ch)
    , G- M9 d+ S9 S$ K* H
  665.   end
    ; g* M8 i8 D8 Q& t* S
  666.     9 ]0 u4 f" |; I
  667.   def get_mirror_y
    : g# r; n6 k! x) U) n4 K0 }* U
  668.     20.times {|i|
    - y0 P$ R  G/ Y
  669.       if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION9 P8 F; V" j. A3 z( d% J
  670.         @distance = (i - 1) * 0.05, Q/ b7 f8 A  O. h( {
  671.         [url=home.php?mod=space&uid=502659]@DISPLAY[/url] = @character.y - i - $game_map.display_y + $game_map.height
    0 u, ^+ e) p/ ?5 |( Y
  672.         self.opacity = 255( i8 K( U( k, b2 q0 K* N
  673.         return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 42 n' n* i: Q2 W+ G  i# d$ u
  674.       end
      }1 F3 w, \4 r$ X: Q. f' R+ Y2 L
  675.     }: n1 q) d: l  _- F6 }( ^6 s2 ]: n
  676.     self.opacity = 0/ L9 M8 P- _' G
  677.     return @ch
    ! i6 @! f( O( |& [7 B4 z, x
  678.   end& J' p, d) p/ X! u* C0 e
  679.    
    / _5 V; U% w- e  q5 D
  680.   def update_position
    5 X5 k: o1 P) \, t" y. w
  681.     self.x = @character.screen_x9 R& T2 {$ g% Q5 S* R/ d3 ^' I9 a
  682.     self.y = get_mirror_y - 6
    5 d+ w. i  V4 o9 r
  683.     self.zoom_x = 1 - @distance( z3 @" a, t; E) h5 j
  684.     self.zoom_y = 1 - @distance( j2 Q% ?; k6 B% V, W1 T: E  [+ ?
  685.   end5 J3 T. ]: C$ p8 T. e* D7 ]# U* z
  686.   
    & _% }( g! z( l3 ^8 C
  687.   def update_other  U; \* N. G7 C6 H8 Q
  688.     self.blend_type = @character.blend_type
    & U0 G1 i+ }! f: m6 j7 L9 ]
  689.     self.visible = [email protected]. M' @" O/ _! n; D& w$ [
  690.   end
    : A1 C4 L+ e! p* v9 I, {" x
  691. end # Sprite_Mirror < Sprite_Character
    : s4 _6 F; s8 i! ^" A* z
  692.   
    : ^# Z6 i$ c% |
  693.   
    9 }+ ~! |* A. d9 k
  694. #-------------------------------------------------------------------------------
    3 V' C9 L( ?/ }" U& {
  695. #  Sprite_Shadow
    , B5 |1 p9 i% p1 K. H
  696. #-------------------------------------------------------------------------------
    1 W+ Q- F& @2 K" k" j9 ]$ K  R
  697.   
    8 w+ p  A6 S" m# v! h0 M
  698. class Sprite_Shadow < Sprite_Character* o( M5 K) X$ v6 F2 }
  699.   def initialize(viewport, character = nil, source)
    / w/ E3 K' G( X7 ~
  700.     [url=home.php?mod=space&uid=14094]@flicker[/url] = 0$ P* _1 v/ n% [7 Y7 H0 f
  701.     @famount = 0
    9 f" a6 W8 l4 T% S
  702.     @aamount = 0' p# w! E6 A" u" f
  703.     [url=home.php?mod=space&uid=171370]@source[/url] = source$ ]3 z; D7 m+ \6 m
  704.     super(viewport, character)
    : z3 u5 B2 _4 e; ~* @& g
  705.   end! l2 P( W8 _8 r- ]* s
  706.    7 ^0 b- U& B1 z% Y. z
  707.   def update_balloon; end5 p0 {+ `* @4 `" ?7 R4 [* Z
  708.   def setup_new_effect; end: p/ x/ p8 t( Y. [$ A$ T( z
  709.   / t6 m3 q4 ]- ^2 C
  710.   def update3 I+ U& Y2 k% P7 M0 D, g3 ?1 \
  711.     super: I- B7 h2 }/ r2 b, ]& G
  712.     update_bitmap
    " L) g, Y7 M6 p# [2 d& `0 D
  713.     update_src_rect
    % T. t/ H" N( n9 U. P  M6 W
  714.     update_position3 C& t9 U2 T! V; U
  715.     update_other
    + l! Y1 s0 S, f2 v
  716.     update_facing
    1 s0 x+ f& {; z! d* q+ B! w
  717.   end" [) f" M  X0 g" J3 T9 z
  718.    ' x, Y% a7 f& ^3 X- q
  719.   def set_character_bitmap
    1 p- l8 P7 e' X1 ?# |
  720.     self.bitmap = Cache.character(@character_name)1 i* X' Z0 |/ y/ E% o0 ]6 D2 h
  721.      
    / r, @6 }: I( }: [* B
  722.     self.color = Color.new(0, 0, 0, 255)1 O0 q; ?+ N: f& r: p/ v8 Y
  723.     self.z = Galv_CEffects::SHADOW_Z
    8 k) b0 M# d: M8 ]& `+ g1 n( @
  724.     self.wave_amp = 1 if $game_map.shadow_options[2]% V7 q8 \3 r1 p- D- N& s! ~
  725.     self.wave_speed = 1000
    0 \) `2 [3 z8 |
  726.       
      z# M9 e2 ~7 w5 Q1 U
  727.     sign = @character_name[/^[\!\$]./]6 f- c$ B8 Y4 m6 {! ]# w* N$ R
  728.     if sign && sign.include?(')( ^0 y4 b% r2 z  m/ ^$ F/ d
  729.       @cw = bitmap.width / 3! P; Q7 ?! g  ]5 q/ c+ i1 W6 P
  730.       @ch = bitmap.height / 4+ T0 R) l- f# t% g8 x
  731.     else
    , g6 R' {; j# K" v6 D# E& A
  732.       @cw = bitmap.width / 12" ?2 y1 Z' i: Z3 d5 e  H0 x
  733.       @ch = bitmap.height / 88 Q) X% S0 @$ ?0 v7 o% q
  734.     end  ]4 g3 N4 E5 n
  735.     self.ox = @cw / 2
    ! y3 g4 S- I7 r
  736.     self.oy = @ch" Q' ~4 U5 R/ C1 e
  737.   end
    9 c5 R' R7 y) D* {7 u  }
  738.   
    ! _. [7 f, W9 U1 o
  739.   def update_position
      ]8 E$ e% ]7 k  w8 w
  740.     self.x = @character.screen_x
    6 l  o* |4 l$ a+ f% X/ f, A
  741.     self.y = @character.screen_y - 10
    + _9 D) x+ ]2 q& I' H5 d
  742.     get_angle
    1 x/ z0 [3 \% l2 x
  743.   end
    / A4 s8 P2 ]' u* ~: f" L
  744.     5 Y- a* Z% M( g. W7 B% q, m$ s
  745.   def get_angle
    6 B% N2 E5 X3 S! o" t
  746.     x = $game_map.light_source[@source][0] - @character.real_x
    ) q0 W0 }$ j  j6 k3 K9 l
  747.     y = $game_map.light_source[@source][1] - @character.real_y0 |& [/ [/ j* W+ h4 z
  748.     self.opacity = $game_map.shadow_options[0] - % S1 j% o: _* ?4 ?# k: I+ t( G
  749.       Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]3 l; N# F+ o7 L
  750.       ; b: P0 |8 G. Q
  751.     if x == 0 && y == 0 || self.opacity <= 0
    8 j5 T& K1 j: z( D2 d0 Z
  752.       self.opacity = 0
    , X9 U& @- a! b! l! E5 J
  753.     else
    ! q& k8 L# u  J- a$ Z
  754.       self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount" w! c7 J1 Y9 y: c
  755.     end% ]& X0 t& h& X- M
  756.   end/ a( W& J) @. B+ c' k
  757.    
    * q# Q. b: S1 Y8 B
  758.   def update_facing
    : V. f+ h4 e' t/ Y2 D. V
  759.     if @character.y < $game_map.light_source[@source][1]
    4 H0 w. D- o: Y* [# m6 c
  760.       self.mirror = false- D0 d; [1 W2 e
  761.     else+ F/ P" D% x% G4 J. f& b$ M- Z& w
  762.       self.mirror = true/ @" K. R9 f8 I. B: S1 z  W
  763.     end
    ; ?1 t6 ]* C7 P1 q+ @- I3 G  t
  764.   end# T+ y9 G, L+ `0 z' j! A4 p
  765.    
    ) Q+ p+ ~2 y, O. O8 B& F
  766.   def update_other
    5 Q. L1 i8 E- j/ a# ~% N3 R
  767.     self.blend_type = @character.blend_type
    * _3 B0 b  L3 I) H
  768.     self.visible = [email protected]$ G6 ^2 w1 j) q. ?4 u
  769.   end. X) b+ N/ |" N) |6 T9 [8 [
  770. end # Sprite_Shadow < Sprite_Character
      ~, q/ f9 C' U
  771.   5 H1 @$ Z2 ]1 F: M/ C4 V7 O
  772.   
    5 ~5 R. q% E7 I* a" n
  773. #-------------------------------------------------------------------------------; R( J! K" a/ {% D
  774. #  Sprite_Icon
    8 F+ v: Z% N0 t
  775. #-------------------------------------------------------------------------------3 R% L) U# y( C3 t6 K! s8 G0 l- M
  776.   , j9 R' r5 j' F& b8 \4 G3 E" ]4 v, U
  777. class Sprite_Icon < Sprite_Character
    ( s& H" C& d# s8 Y/ n$ ~3 u) [% o
  778.   def initialize(viewport, character = nil)6 w: m* m& F* \* J* l/ w
  779.     @icon_sprite ||= Sprite.new
    9 R+ C0 F! j: R* ^- S
  780.     @icon_sprite.bitmap ||= Cache.system("Iconset")
    2 g1 d% C8 A( v3 N
  781.     @icon = nil
    " l: c+ I, ^- U6 d) O% ]
  782.     super(viewport, character)
    , k  E) W% D! a
  783.   end
    , w) ]+ x" S) c6 d
  784.   
    ; R0 V/ W, d, p7 Z3 R2 i8 y
  785.   def dispose9 T$ _+ U/ M5 B6 g8 {. T
  786.     super
    ' c* w8 p" ?2 C! C* J% f  a8 p8 A
  787.     if @icon_sprite
    - G1 @( U) h* A/ M- w
  788.       @icon_sprite.dispose; K* f4 j7 s7 T# Q$ n
  789.       @icon_sprite = nil0 e2 i3 E, \4 w3 C" Q
  790.     end- b5 }& [) R; A. A( X( J! c/ E0 u% @1 r
  791.   end4 Q: g+ e" y  X6 \& w; B
  792.     2 N: L9 O8 `8 W) M7 Z
  793.   def update0 L& N1 {4 Y5 z
  794.     super
    % U7 f9 J$ X6 ^9 d
  795.     update_icon& w( ~4 H7 n2 v8 h: N
  796.   end0 s8 z0 A8 B9 J5 G7 j' g9 J- r
  797.    
    . g. N0 i% L( W& T: x1 D5 o
  798.   def update_icon" v! b& h; e" `
  799.     return if [email protected]
    & [4 L# ?: M$ h$ \
  800.     draw_icon(@character.icon)
    ) z* ?5 ~/ B% ?, G8 X
  801.   end2 W6 Q/ \4 Y2 [: X% T
  802.     5 q+ k; R! I# G  C
  803.   def draw_icon(icon_index)
    + f6 h6 x( E8 E$ ]  y
  804.     return if [email protected]?" f5 F7 D( Y! c8 g
  805.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    & o. Q% z% x0 |9 P/ P; A
  806.     @icon_sprite.src_rect  = rect# F* y+ \: b# v1 w
  807.     @icon = icon_index- t( H6 u" O* p9 F- R5 `
  808.   end$ H! x: o) `  Z- v4 M
  809.    
    . B. t9 a* C) m- x5 `$ v
  810.   def update_position% {1 b5 e) l; L6 |  x! L$ P! d
  811.     @icon_sprite.x = @character.screen_x - 12; Q8 o9 J' j5 }$ k& G# F
  812.     @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET. i& W: |. k  k) p- A
  813.   end9 B/ F: P9 n& O& q2 f% c! r
  814.   
    1 y3 v9 M/ |* ]7 v
  815.   def update_other
    , l$ o* m  p/ F, L' b8 Y
  816.     self.blend_type = @character.blend_type
    * ^1 l$ w$ m" A3 v* }8 t
  817.     @icon_sprite.visible = [email protected]) i5 C* W+ O' N4 ^$ \* f' K
  818.   end
    $ E( u$ Z8 T9 y& `1 t' W& r
  819. end # Sprite_Icon < Sprite_Character0 H6 G! }- I8 _& n8 V2 {* e# ^
  820.   - H* v2 T. E& f* L1 ~
  821.   
    9 g5 N$ `' W4 F4 d) G
  822. #-------------------------------------------------------------------------------7 A$ u6 e5 _, H* c& h
  823. #  Other Stuff  _# y% N& [2 W
  824. #-------------------------------------------------------------------------------
    " T* B; S- v2 }9 y( s
  825.   ) c0 p" B5 {; D0 R* i5 L
  826.   4 \6 q0 N+ [! ]+ m6 P. j, [- s. n
  827. class Game_Character < Game_CharacterBase. B/ {9 h3 n! _4 Z& S
  828.   attr_reader    :altitude
    + U& \- x6 t$ ]
  829.   attr_accessor  :reflect
    : `3 T, ?+ f  x) W' h5 W
  830.   attr_accessor  :reflect_sprite
    8 [/ w: ^( V, i: `* r. Y4 o5 u
  831.   attr_accessor  :shadow
    5 N( N( w2 V9 q1 Y8 M" g
  832.   attr_accessor  :icon3 D; g& X9 E# P) d4 {
  833.   attr_accessor  :icon_offset
    6 c0 l$ U$ B  T
  834. end( S7 \0 K4 u' V, C- u8 P7 i% S
  835.   
    + V/ @4 f% Z+ J3 u# y
  836.   ' e* j# f- `1 t
  837. class Game_Event < Game_Character
    3 Q9 ]) u: ]! J9 k$ }
  838.   alias galv_reflect_ge_initialize initialize3 d$ w! f. ?1 ]% {+ i, m  ^$ D' _  b- a
  839.   def initialize(map_id, event)
    / y: v" [/ o0 C9 K6 H8 i
  840.     @reflect = false
    8 {) ~! S5 G$ P, |% `' h/ W  @
  841.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = false
    ' _5 f' u6 U4 ^% r3 Y5 ?  N; v
  842.     @icon_offset = [0,0]/ L1 d8 o# ~; \" d  d/ b6 g
  843.     galv_reflect_ge_initialize(map_id, event)
    3 A8 S% |" v+ u: d, c
  844.   end4 Y  S6 h3 n& X$ D& A. _7 {
  845. end # Game_Event < Game_Character
    1 j% X5 k6 Q; s3 c
  846.   % r8 W  y8 ]% \. w
  847.   # e9 u! X* f6 G; V! G
  848. class Game_Vehicle < Game_Character) m; W0 }. s) T+ n  X
  849.   attr_reader :map_id
    , P: V. x3 S/ e/ M* r" n5 f
  850.    
    7 b; M7 f. g4 @; R5 @% r- a) ^- M
  851.   alias galv_reflect_gv_initialize initialize; N  C+ }  G8 ~$ x
  852.   def initialize(type)
    8 R- p! \4 I1 Y7 r$ u# e
  853.     @reflect = true
    2 ^5 o  g3 Y4 @# p3 k/ p6 p6 g2 u
  854.     @shadow = true
    1 _* m$ }7 a) _8 f) \4 p6 O8 M
  855.     @icon_offset = [0,0]" i+ ]* O& M% e. v8 Y( f
  856.     galv_reflect_gv_initialize(type)  i0 J& z2 A7 O
  857.   end
    % r8 y( X* V$ r( U& t  |" V9 g
  858. end # Game_Vehicle < Game_Character
    " z$ J5 `2 t- j
  859.     @( A1 L. n  }
  860.   . g" \1 e1 U0 n1 E/ M) ]0 }/ b+ f
  861. class Game_Follower < Game_Character7 w: x! m, e& U: Z' l4 D
  862.   alias galv_reflect_gf_initialize initialize
    0 c/ v( z' N; u! y9 V6 Z
  863.   def initialize(member_index, preceding_character)9 ~( F  k$ P  ?; E7 @' E3 }
  864.     galv_reflect_gf_initialize(member_index, preceding_character)% Q+ W5 u7 f  `& L+ \+ r* O
  865.     @reflect = true8 s4 j8 E: u: D6 s/ c0 ]0 I
  866.     @shadow = true. P. U$ {9 R1 y2 }( _/ y' p: o
  867.   end- B! F% r' C9 Z4 a8 B' H
  868.    
    8 Q1 _, h/ {, [3 [
  869.   alias galv_reflect_gf_refresh refresh! l3 t$ q  q$ O9 y) `1 P1 z# v& j9 a" Y  Z
  870.   def refresh
    1 c: s0 j: g4 b. Q* ~+ Z. \
  871.     galv_reflect_gf_refresh
    & L9 D  w3 K/ G& N) q
  872.     return if actor.nil?
    - c9 E( D5 d! e$ Y6 o7 E" h: ?: H
  873.     @reflect = actor.reflect8 H: \- `. J! U- {- k
  874.     @reflect_sprite = actor.reflect_sprite
    ; z6 \: I4 o: ?0 ?9 B) D" U1 I
  875.     @icon = actor.icon; p, t, l: z1 W) x& H1 z
  876.     if SceneManager.scene_is?(Scene_Map)
    : W9 e: c: J- A) B' T
  877.       SceneManager.scene.spriteset.refresh_effects
    3 X6 i& Q: G1 G' q& s/ D
  878.     end% r0 V6 f, V- I+ g
  879.   end( k, j" l# w7 q# w5 B
  880. end # Game_Follower < Game_Character& P  ^% o9 U" Q' g$ n
  881.   + _' \7 c5 Q" }  x0 D
  882.   & Q  B7 n- k* ~( A8 L
  883. class Game_Player < Game_Character
    / J) D% u" ]7 Q+ `+ O1 G( ]$ ^
  884.   alias galv_reflect_gp_initialize initialize' R# w$ E' |' ~; b5 G
  885.   def initialize
    + P: ?: ]9 n2 x% z, R3 T+ p5 x
  886.     galv_reflect_gp_initialize. c8 [8 h8 l1 U  e" Y0 h8 s* D: [
  887.     @reflect = true
    & t& U& `- |# x- c
  888.     @shadow = true- y) }. O* A) B
  889.   end
    ; p, k1 T; p$ `5 [4 I& c" J; M
  890.    
      P2 `8 b1 o6 c! a. I( G6 B3 I# k
  891.   alias galv_reflect_gp_refresh refresh6 K+ u2 }  _- k4 \+ f
  892.   def refresh5 X! u2 l% h# c& u3 D
  893.     galv_reflect_gp_refresh9 b6 p  \7 M( a3 V
  894.     @reflect = actor.reflect
    3 D0 D& B( [% k2 t% Q
  895.     @reflect_sprite = actor.reflect_sprite
    ; f8 p" o3 Q- L& R1 U
  896.     @icon = actor.icon! L0 E% j2 D2 M1 L  a
  897.     if SceneManager.scene_is?(Scene_Map); u  P, N; l( e5 j" l: L" Y
  898.       SceneManager.scene.spriteset.refresh_effects
    6 G) F# M7 i. F! O# X* V: n
  899.     end
    5 H( l% l6 Q$ O& O; g
  900.   end5 ]/ ?4 E7 \' j  B! C% ]. q
  901. end # Game_Player < Game_Character
    0 {- A6 H! s. y2 W2 j( E, C
  902.   7 |5 Y1 \: S% o% _9 F% B9 t
  903.   
    ( l8 }! A( I: z7 k1 c
  904. class Scene_Map < Scene_Base
    - D* f1 y4 c" Z; `! Z6 ~8 Q
  905.   attr_accessor :spriteset
    ( }7 ?: g# F& Z. G, s+ _* M% T5 N
  906. end # Scene_Map
    ; f" U; z( T0 M7 r
  907.   6 c8 [9 b; t+ ?( F
  908.   - _3 _. c3 A, h$ J. Q7 A
  909. class Game_Map
    / T6 m, ^& E- y  z* a0 P' t! c5 i
  910.   attr_accessor :char_effects
    6 W) C2 E  u; h( ?$ p
  911.   attr_accessor :light_source' U2 g6 K1 J* _
  912.   attr_accessor :shadow_options
    2 B2 x0 S' I8 o2 K# X
  913.   attr_accessor :reflect_options
    4 m/ ]3 c" Q+ M
  914.     ; J% y) g- \, u8 H, B; J/ V* P
  915.   alias galv_reflect_game_map_initialize initialize" B* _! f8 P; G1 A0 v! C
  916.   def initialize/ t+ P; M- B) W
  917.     @light_source = []6 g: v, ]0 y" n5 w3 S
  918.     @shadow_options = [80,10,false]
    9 i1 E# v) P( T: ]" G1 m/ N4 W
  919.     @reflect_options = [0]2 h$ t* w1 `4 I) `& B+ t; ?
  920.     @char_effects = [false,false,false,false], w% A) u, b- C* h2 o' f# R0 L
  921.     #[reflect,shadow,mirror,icon]% W+ f+ v! a7 ?2 A3 l
  922.     galv_reflect_game_map_initialize$ s* _7 T0 p7 H0 Z
  923.   end9 J5 h! j6 E3 S( n
  924.    1 y1 P9 [. q3 {4 e; n2 J9 r& t9 S
  925.     3 v, A( g1 K8 _% o
  926.   alias galv_reflect_game_map_setup setup
    2 }% o# f  [" ^
  927.   def setup(map_id)2 k; N; g% ^0 T5 G* \' F3 V
  928.     galv_reflect_game_map_setup(map_id)
    * s) D& o2 r# {, o; q8 X' }
  929.     reset_char_effects
    3 d* I, M3 s8 c/ A- X
  930.     do_all_chareffects# W9 d" w3 s  l' ^. y
  931.     if SceneManager.scene_is?(Scene_Map)& Q+ D* x- J6 R) q8 x) c
  932.       SceneManager.scene.spriteset.refresh_effects
    / E8 y4 {3 j7 |$ T
  933.     end
    : u: c2 q3 F# z; \; A! H( d
  934.   end
    2 r% I1 P8 _6 N8 J  ~0 A" A
  935.     ) o* M8 n( l8 B
  936.   def reset_char_effects0 b9 [# ]2 e7 u7 Y" {5 C9 J+ i
  937.     @light_source = []7 g/ j% |; t  O: F  R* V# t
  938.     @events.values.each { |e|
    ; `. Y0 q5 B+ P# f: h0 O& Q
  939.       e.reflect = false
    4 {8 K! `: U" x: j  n
  940.       e.icon = nil }
    5 N7 Y! P  y. z1 E$ |# s/ \2 b
  941.   end
    1 z$ |3 X( l5 G1 k. o
  942. end # Game_Map
      {! T8 \: i9 v0 v: E% J
  943.   
    - H( v# ~0 R' A/ F$ W7 N  I( f: E
  944.   # U" M% J1 n. H' M& M& y
  945. class Game_Actor < Game_Battler
    9 I! \: u+ M) w! w
  946.   attr_accessor :reflect; Z0 w5 N3 a- Z  }( b3 q. ^
  947.   attr_accessor :reflect_sprite: k& A2 A" y* C6 P* \
  948.   attr_accessor :icon" q! [, o/ P1 o5 z# Q, R$ d
  949.    
    / o- \% Q) w% O) Z, |5 S9 L
  950.   alias galv_reflect_game_actor_initialize initialize# K( ?  t9 ~8 X, u" X. Y, G
  951.   def initialize(actor_id)
    + K- I( G7 U& m( z' C, W/ E
  952.     galv_reflect_game_actor_initialize(actor_id)$ P" N& o7 l- \- P1 S5 \7 V
  953.     @reflect = $data_actors[actor_id].reflect3 e, b( R" N# C' h/ z+ e
  954.     @reflect_sprite = $data_actors[actor_id].reflect_sprite" C# W9 a; m) s- ]
  955.     @icon_offset = [0,0]. a) M, Z9 ]! i7 b3 n/ H
  956.   end4 M2 _4 [. E. W0 b8 H4 g0 R, o  p5 c
  957. end # Game_Actor < Game_Battler
    * o. o/ V3 }) s3 U( g" f/ \
  958.   
    : y0 i* g) S: l& J; h8 R6 p
  959.   
    , @. r3 Q9 P* x) l+ Y  [/ b
  960. class RPG::Actor
    # q# d+ a( g/ H; X  L- b8 Q; A: W
  961.   def reflect_sprite1 S+ b4 }" Q$ _2 E7 @# t& _6 J- i8 R
  962.     if @reflect_sprite.nil?
    $ F7 T. j7 L% U$ z1 S& \
  963.       if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
    0 Z' t% }0 y! [$ ^
  964.         @reflect_sprite = [$1.to_s,$2.to_i]$ j3 T" ?/ j* b3 Y3 _9 i+ C% _2 Y3 R
  965.       else7 H& |5 q& H) v0 d" e4 L" U0 I8 W/ S
  966.         @reflect_sprite = nil& v! c4 {1 ~9 m# B4 b1 F' S7 k4 _  G
  967.       end2 C+ w( }' E: k) C" p
  968.     end
    2 T1 v: i$ _1 y! f* ?
  969.     @reflect_sprite: X" y4 ^3 w8 K) G' v" L
  970.   end
    6 t, M$ c8 L- I2 ?
  971.   def reflect* l8 w" h* t' t# ^: x* [
  972.     if @reflect.nil?( I$ K# Y. Y( B
  973.       if @note =~ /<no_reflect>/i: ]* n9 X7 g* O* {5 |5 _
  974.         @reflect = false
    7 Y/ o% T8 V" Y+ w
  975.       else
    . J! j" v4 o( h8 Q' |7 c7 z: r
  976.         @reflect = true
      D( r; P& z( [+ M2 F) W
  977.       end4 n0 H# J! O$ o7 Q* E- Q1 D
  978.     end# k; W% B! l+ ]0 L9 L# ], w" }
  979.     @reflect4 U" P0 a3 s1 K8 x
  980.   end
    5 M$ e; H2 t! v4 D" P& l
  981. end # RPG::Actor, J# Y1 d3 ?& s! a3 ?; R" D/ @9 O
复制代码
回复 支持 反对

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-4-12 10:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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