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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
2 B) R& |# |( P  m5 v  A
这个代码怎么用啊,有大神知道吗。我从国外找的。" w( V! k8 p0 T
http://galvs-scripts.com/2013/02/21/character-effects/
/ b# k. `8 T0 p) D0 K- S2 I; Z是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    6 J! r5 Q0 m+ V7 B, M8 @- C: i
  2. #  Galv's Character Effects
      A( F; m5 b7 V% T
  3. #------------------------------------------------------------------------------#
    , r3 q1 x! W; ^- n* f( r# ?, ^
  4. #  For: RPGMAKER VX ACE/ ~! z; ?/ ?' Z: O1 D
  5. #  Version 2.1
    5 |9 b& {$ [! w8 c& G
  6. #------------------------------------------------------------------------------#
    - B( S2 M2 ?8 q% A
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows- b8 z  ]0 A- m. e4 h  p/ x
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects8 v* T5 q; Y4 C+ c
  9. #                           - Fixed shadow facing bug
    % }/ I0 x- z% E
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows: V8 [  V; F( W  J" c: q
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows  x  s" i/ `- M+ s* t
  12. #  2013-02-22 - Version 1.7 - bug fixes, ?0 y' s* i) V3 W
  13. #  2013-02-22 - Version 1.6 - added icon effect/ Z' ?, N0 {+ G: N; W
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps; ^6 W5 f$ o* Q( `( l/ N( S# }2 X3 P/ w
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    $ q! v/ U: }# ^; G& m' f
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks8 n( ]6 E2 a4 T& w4 i
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops). u& M, @% d$ B- m3 r" o
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    4 t, L  t* K2 |4 o: P# c; {: K3 h( x
  19. #  2013-02-21 - Version 1.0 - release
    ; e+ ]: E  F2 |4 D: w
  20. #------------------------------------------------------------------------------#6 A( R( v6 f2 ?$ j
  21. #  This script was made to provide some additional effects for characters such  \6 r2 X+ m  w" t1 J- y
  22. #  as events, followers and the player on the map.# i" M( \9 R) x' K2 h/ `! r' @* \
  23. #  Currently it includes:
    : p) }! N/ S7 u+ o. [# f2 T  J
  24. #
    ( [! X1 y/ h5 z- p) i
  25. #  Shadows9 d8 ?  F+ n2 ~4 F$ e
  26. #  Shadows that appear under player and events in a directions depending on
    ( z0 u: g9 E9 z& J/ R  O. p& s" }
  27. #  a light source that you choose.3 M- Y, i# P4 ?. k( w
  28. #1 _, W  E8 |% N( u- ?) E" ~  N( ?5 E
  29. #  Parallax Reflect
    ( p- l6 H$ H1 a0 b
  30. #  Reflections that appear on the parallax layer for events and actors to be4 G' g& w: y. Q9 w1 v9 t
  31. #  used for things like reflections in the water or glass floor etc. To get
    9 s+ \: a+ w# z2 G9 m2 w- v
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    9 J! x! L# l8 x
  33. #  partially transparent.* \* \9 }- J' W0 v% h( Q
  34. #: w6 H$ u4 g" R  a9 J; k/ Q
  35. #  Parallax Mirrors: R: y+ [/ y6 ~& m
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    # Q0 Y& ]- C, x5 W# _3 }, }
  37. #  on a wall designated by a region. Both mirror and reflect effects can be( e' N: z* v' X9 ^6 o
  38. #  changed so actors and events can use different charsets for their reflections: w& Y+ N, @1 K+ f
  39. #$ Q) [1 @2 E& Y% z8 N; s
  40. #------------------------------------------------------------------------------#
    # P% I- [6 K9 L' r
  41.   
    ' X$ \; L& p& A' A  L; k2 s
  42. + B! `# G" v2 g3 H) P* B
  43. #------------------------------------------------------------------------------#
    & }& A9 a6 O/ D: u
  44. #  NEW - First event command as a COMMENT
    ; ]4 Z! h5 j/ K% j- f( V0 T5 [* E% L
  45. #------------------------------------------------------------------------------#2 `7 h9 l% F! N' _, b" h
  46. #  You can add a comment as the first event command on an event page to set if
    + H1 ], V& Q" ]( j" O
  47. #  that event has an icon, shadow or reflection active. The tags to use are+ b  P+ d1 I# X: D$ c
  48. #  below, all must be on the same line in the comment.
    + g; b/ }2 ]9 u3 L" C
  49. #
    4 b) ]& `) q& y8 H5 S
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)+ B& ?+ B% r  _+ H4 A
  51. # <shadow>           # set the event to display a shadow
    , o( @- L: ?: Q
  52. # <reflect>          # set the event to display reflections3 m7 F1 b0 V8 ]( U# x
  53. #  G: F" J$ Z0 y
  54. #------------------------------------------------------------------------------#& N$ v/ q: i/ Q  X- E, ^, r
  55. #  EXAMPLE:& x5 u& S* p4 ], L
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    ! R; ?7 C. T7 B
  57. #------------------------------------------------------------------------------#
    , i' }* [8 j/ V1 d. ]# ]! j

  58. $ r% N* e2 i+ ?" |
  59. / i" N; Y/ I4 \& j  t* T, H
  60. #------------------------------------------------------------------------------#; N4 f, z' {3 R  R7 q! A/ Q8 ]3 {
  61. #  SCRIPT CALLS:
    * F1 h: d  h2 s
  62. #------------------------------------------------------------------------------#+ _- I7 I0 K  G+ v) b& _( n
  63. #* _5 q/ A+ G) q0 p4 }8 e' V
  64. #  char_effects(x,x,x,status)3 B4 {8 Q1 \) R7 a0 A+ ^1 X
  65. #
    ' O9 r. k; Y  q" N
  66. #------------------------------------------------------------------------------#
    + v. c4 E6 F6 \
  67. #  # each effect can be true or false to enable/disable them during the game.
    * t2 M5 _) v1 _, \9 ~
  68. #  # you can change multiples of effects at once, x being the effect number" k! |' m$ i  f9 \; D# \" y6 Q+ e
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons- n. i2 g; g: O0 P
  70. #------------------------------------------------------------------------------#
    * d2 H: o/ t. W" y; F
  71. #  EXAMPLES:0 W, o  L7 F! J" [: R
  72. #  char_effects(0,true)              # turn reflections on7 t6 U* Y2 h! X2 Y
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    ! j2 B! V: E  i4 a. G
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    6 G" B; x1 I7 s" Y+ H% ?
  75. #------------------------------------------------------------------------------#+ {$ c" g1 l2 K
  76. #: G2 k. D0 ^0 e7 C% k. e' w
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset& U1 g# G1 X$ h" f3 C
  78. ## k3 g7 {+ w, c, H6 N
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    9 N; _2 s' f% v# W
  80. #
    " M8 @7 M" e0 N  t/ D) v, X! \
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset+ M7 W1 z0 U8 J% K8 T. p- k
  82. #9 ?$ X* F* ^9 u8 Q; M. k
  83. #------------------------------------------------------------------------------#; C# z& ^$ m1 @; N3 o
  84. #  EXAMPLES:
    : u2 R! @. K( |3 B# s
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite3 Q# T; A0 a, B
  86. #                                    # in position 2 of "Actor2" charset.
    $ {, b% v/ h; ^/ j! \
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    6 _1 C' L2 f2 d6 _. |) \3 O
  88. #                                    # "Actor4" charset.
    + M; ?/ [( {5 W+ `4 Z: Q/ B
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of- V. u7 c. {0 G. k  |3 p
  90. #                                    # "Vehicle" charset.  H1 ?* f6 u+ J: h
  91. #------------------------------------------------------------------------------#
    0 R5 l5 S, m1 \* M
  92.   
    6 S- l* a7 r  ~) V6 s$ O9 m
  93. #------------------------------------------------------------------------------#3 ]8 C9 T# c5 ]) E4 V
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS# c+ d$ W+ P$ S+ \+ ?( C) g# e# A
  95. #------------------------------------------------------------------------------#) t# Y& L. B$ }/ C% w
  96. #
    ! d; ~, V/ L$ |5 N
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    & T* Z: ~# k3 [
  98. #                          # use this to specify for mirror and reflect.% f7 d/ {3 H) l+ }2 U3 N
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    / t3 t( m; g3 \0 G
  100. #                          # to change all events use :all5 v- ~) o7 a! b- f
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    - ?, J0 n( z' T$ T% R; Q
  102. #                          # it 0 for no icon.* V/ I. y* {3 ?3 u
  103. #
    ; N- ~0 h6 a+ _9 v, ^% @" a# x
  104. #------------------------------------------------------------------------------#2 v8 o& {( _) w4 r& v7 t$ c7 a
  105. #  EXAMPLES:/ J2 w% A4 G, P$ q+ N
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    & i+ u2 Z9 M6 O
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    ' E% N5 [# V. ?: ^/ M; r% L
  108. #  reflect(:all,true)      # Turn all event reflections ON
    7 q# `& @6 J! ^
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    ) G7 F6 ~4 |! Z' n1 f5 @" v: h" F! i( F: \
  110. #
    8 u+ _+ F7 M0 \- n" w( ~! p+ `
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    # p5 L. _3 }$ w, p
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    7 e( ]) j& |) K, p
  113. #        should use these effects sparingly and only activate them on events: M' G3 F' i1 m! N) F9 E3 H( z% C
  114. #        that require them.. @7 D& I( f* `6 n" T: W/ w
  115. #------------------------------------------------------------------------------#
    + R7 \. F( {6 j
  116.   % |7 q* B" e; r  r4 ?; k: E
  117. #------------------------------------------------------------------------------#+ M  \: R' D$ T
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES' \( q2 R8 ]9 h& b
  119. #------------------------------------------------------------------------------#4 k" `4 T# G$ Z% s+ q, h7 ]$ ?
  120. #
      Z; {' {. X/ q
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    9 w/ f  t& j; T: V
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    8 H* N# j+ s7 y( B8 I! {. O5 q
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.* o* B: ~  r; F, m) H
  124. #- p8 F. h, `9 `6 {  }8 H  e0 l- q) G
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects# r/ n; y( A+ S8 t' U6 _% b& T
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    ' }, h, P! S" Z: p& r" P# `  G
  127. #  v_icon(x,x,x,icon_id)6 @, O9 i; e  K- r
  128. #
    , j/ b5 h! D& L- _2 T1 @. t& t
  129. #------------------------------------------------------------------------------#
    " u: J/ x: K# J  Z
  130.   % }% C5 I) e6 z) u
  131. #------------------------------------------------------------------------------#, I2 T% Y  @; C0 _7 K% b
  132. #  SCRIPT CALLS for shadow options
    , N  J1 V2 Q1 P* ]- f
  133. #------------------------------------------------------------------------------## k- n8 D; u, w% L# r- C/ C, w
  134. #; {- P" V  B1 N8 e5 Q$ C
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    6 ]' K6 Q7 i% ]# I  l$ ?
  136. #                              # light source number you wish to change (for+ Y  k0 z, O, r" x$ f! D
  137. #                              # more than one). These are reset on map change.7 }  A& E- Z) `0 z
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.& }& D2 _6 X+ k/ p% s
  139. #                              # This will need to be in parallel process if you, P' r" D# e+ `  q
  140. #                              # want it to be a moving light.8 r1 i, T# f! r: y" N
  141. #
    2 ?& T! o  ~0 `: u9 S
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below9 |& p' B# Y9 p0 T5 Y
  143. #5 j3 k1 j0 m6 D9 i( @) }( h$ Y
  144. #    # intensity = opacity when standing next to the light source (255 is black)+ E0 I3 w+ |& q
  145. #    # fade = amount shadow becomes more transparent the further away you are.% K$ B% }9 i4 r8 f5 K$ T) ?9 z
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.3 w) U# R7 c' b- F  s0 y
  147. #) b6 ~, e9 R) q# _2 u9 r
  148. #------------------------------------------------------------------------------#) i) _4 G+ A( P" K2 F# F
  149. #  EXAMPLE:
    4 b; a( r/ h4 ]% B
  150. #  shadow_options(80,10,false)    # This is the default setting.& z/ \+ L; h7 L6 b
  151. #------------------------------------------------------------------------------#
    * O8 E" f; z. @. h) b& B/ o
  152.   $ N8 N( {" C. y
  153. #------------------------------------------------------------------------------#7 \1 O: |' o) `7 Z
  154. #  SCRIPT CALLS for reflect options
    % w: S$ V1 |  r1 j  H% a, B# }: W
  155. #------------------------------------------------------------------------------#
    6 S  a% u: D7 ^$ a, l/ d& x
  156. #
    ! M/ i5 I) S& g, g+ Z
  157. #  reflect_options(wave_pwr) 9 \# [. C; l0 z4 ^& A
  158. #0 ^6 l; |+ e' Q/ ^/ |- f- M
  159. #    # wave_pwr = how strong the wave movement is. 0 is off0 F7 d8 |* [* B6 X7 n
  160. #1 S8 H- N7 D- n+ A. `4 W2 @
  161. #------------------------------------------------------------------------------#: `' w$ U' y& F
  162. #  EXAMPLE:
    4 u* y& j3 l8 G
  163. #  reflect_options(1) # Turn wave power to 1
    " D' z3 s3 ~1 |& j" V( B4 u9 K
  164. #------------------------------------------------------------------------------#. R+ `. V: o$ o4 X  V9 i
  165.   
    / o2 V- z3 v6 k# n9 B/ K8 p
  166.   
    : T3 s. z1 p. O, ^% ^, k
  167. #------------------------------------------------------------------------------#
    1 T: c9 x7 F" Q- [6 o; L6 {
  168. #  NOTETAG for ACTORS, ^" b: O, K. }: _6 J* q6 e
  169. #------------------------------------------------------------------------------#: \. c. d1 w  ^3 j
  170. #
    " _  X9 @5 _9 C- y" f) B& H* c
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    : e. L4 E: E# `; u) ?
  172. #
    / H( o- J  b2 S5 ^- N8 @: D- h0 H
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections9 B/ v8 W' d5 S" a8 g- y8 D
  174. #                                  # and use the character in position 'pos'# ?6 q$ }1 t0 q
  175. #
    1 _3 P' k3 Q5 J
  176. #------------------------------------------------------------------------------#4 g7 g/ Y  k7 n% q4 R2 J1 U! u
  177. #  EXAMPLES:
    # S! q# n- o# P
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset1 R$ t+ `2 x3 U9 \7 B5 ~
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    3 ?/ y! I: m* Q
  180. #------------------------------------------------------------------------------#
    ) ?1 z( W1 H# C4 \; H
  181.   
    ) B! @; k; L5 a* g
  182.   " ?+ M/ Z1 H0 i; S* Q
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    ; y/ [5 ~; z+ _; k5 l
  184. module Galv_CEffects: ^1 _7 [" c4 @( |% l$ ?
  185.   2 w, a+ @: x2 v9 D6 r5 X4 L! ]
  186. #------------------------------------------------------------------------------#  
    ! V8 |6 o+ Y0 t7 w2 n. i" g% ]
  187. #  SETUP OPTIONS$ q' o, M2 W8 i4 c( ~
  188. #------------------------------------------------------------------------------#
    6 T, T, E: _8 D1 v- l3 x" D
  189.   
    , ~1 l! u; j! V0 I
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the; p$ y- k! p- b2 \2 C2 K
  191.                         # region on the wall you want to make reflective (and9 n4 S6 k1 w8 {4 d6 N) f. j
  192.                         # then use tiles/mapping that make the parallax visible)
    9 g/ V7 e* j& e& u, ?6 K
  193.   
    / Q$ b0 J- i' R- f. ^" T
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    ; ?, {% ]6 g3 T5 L( z
  195.    
    & ]& D1 M( M2 Q8 Z9 D: L8 Z6 O
  196.   REFLECT_Z = -10       # Z level of reflections
    " J, R3 E3 `/ f" Q+ g( l+ i
  197.   SHADOW_Z = 0          # Z level of shadows
    ' |5 k+ ?( o; I; N
  198.   % r- ^8 R, E# q3 Q
  199. #------------------------------------------------------------------------------#  
    % [: ^* _- X- s9 D/ n3 i5 W
  200. #  END SETUP OPTIONS1 C" X. {% p+ X6 N' ~
  201. #------------------------------------------------------------------------------#
    4 Q( E) Q# J8 E2 J  ?
  202. end
    3 k$ W, P3 q5 i
  203.   
    , j' }: H3 X) O8 N2 j( A
  204.   1 g2 W+ k4 s" Z! D3 O9 r

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-5-9 04:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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