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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
" n% E4 x; I) @9 B. s- u
这个代码怎么用啊,有大神知道吗。我从国外找的。
3 v# z0 _- W: E: i9 z9 v1 C# ]5 Ehttp://galvs-scripts.com/2013/02/21/character-effects/# o" T% M1 ?+ x1 ^0 j; @
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    8 G( i6 H' l" P3 C/ b# n3 j
  2. #  Galv's Character Effects  L: u; A5 \+ i; C4 w5 c
  3. #------------------------------------------------------------------------------#$ S& U/ h1 g& y
  4. #  For: RPGMAKER VX ACE+ j2 H, G- C6 c3 ~, @
  5. #  Version 2.1
    % S* L, c9 [: @2 w. b& M
  6. #------------------------------------------------------------------------------#" z7 X2 _! p! F7 F
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows' ~7 b1 w" l+ Z. W
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects& ]( J9 v% Q) d* e% W+ V
  9. #                           - Fixed shadow facing bug! _2 B$ l4 i7 }5 @( P; v
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows- _- r" ^" B, W3 p0 ?
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    - J+ U9 h9 l& @8 I
  12. #  2013-02-22 - Version 1.7 - bug fixes8 k) \& J# d" F5 ?% P
  13. #  2013-02-22 - Version 1.6 - added icon effect
    , n  g! N% `7 V4 p; y
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps" a+ u0 j- `8 h: D- ~; Q) J2 M
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles% G  B0 c, I3 A( P4 U
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    9 X1 V, v! |) ~# l" M
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    ; C' N6 I( {1 `9 F
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    + U' w" s; N* E' h: k$ t+ \1 u
  19. #  2013-02-21 - Version 1.0 - release
    ; H' E  {2 K( j7 `+ Q7 T/ d8 }/ m
  20. #------------------------------------------------------------------------------#
    1 V# C7 ?& d4 ^& I/ p1 c* P
  21. #  This script was made to provide some additional effects for characters such
    1 J( b1 k" b6 s3 T: S9 V3 O1 I
  22. #  as events, followers and the player on the map.) N( l* Z, Z# V* t/ r
  23. #  Currently it includes:/ s2 Z- e' r$ k. S, I
  24. #
    7 j% y$ a3 K) a- ]; q# f) d( b
  25. #  Shadows
    3 t$ r: }3 @: ?* |, O  y* o
  26. #  Shadows that appear under player and events in a directions depending on; R# f% B1 `0 n! }* ?
  27. #  a light source that you choose.
    , ~) {; Q( G5 |% P
  28. #
    3 s, {: I  ?! ?1 T9 o
  29. #  Parallax Reflect
    # n* V+ B" {) P
  30. #  Reflections that appear on the parallax layer for events and actors to be
    / D- @) c% J1 d- x8 Q" m# c
  31. #  used for things like reflections in the water or glass floor etc. To get
    * A3 x" I9 U+ Y3 D/ {
  32. #  effects like the demo, you need to edit the charset graphic to make the water; W$ k8 L! L8 m# @2 c
  33. #  partially transparent.
    , o; o! @$ t+ x5 K6 U1 B4 [
  34. #4 F2 P0 x" H! q* q, C, G
  35. #  Parallax Mirrors8 P, O" L0 P# M" \
  36. #  Much like reflect but are instead actors and event are reflected in a mirror7 h! ~# b+ t5 R! A
  37. #  on a wall designated by a region. Both mirror and reflect effects can be! g1 L+ V( t4 n* Y
  38. #  changed so actors and events can use different charsets for their reflections
    ' R4 }- ~' ^3 T7 {. R2 W  U! k  g
  39. #; D4 R! Q7 m8 ~- @# n
  40. #------------------------------------------------------------------------------#8 Y6 @4 ^5 o$ q& X: ?, a2 X
  41.   2 o0 F& i/ H, j# C( Y
  42. - P3 t3 M  M! @- T
  43. #------------------------------------------------------------------------------#
    & q, _  z# x/ V1 B; s3 m
  44. #  NEW - First event command as a COMMENT# [5 J/ Y& p8 E* Z7 T. G* r3 f
  45. #------------------------------------------------------------------------------#
    & D2 b% ^% ~3 J2 U
  46. #  You can add a comment as the first event command on an event page to set if
    0 o1 u, v% S& r0 P
  47. #  that event has an icon, shadow or reflection active. The tags to use are- V* H4 L+ {5 D2 ^) o, O
  48. #  below, all must be on the same line in the comment.
    6 X$ L$ s  Z7 l  [# L/ k
  49. #& N0 l2 j6 P7 m0 |, v- T) a1 Y" d
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    9 S- }+ C; i) E/ k' h
  51. # <shadow>           # set the event to display a shadow
    & h- }. D* t3 e& N
  52. # <reflect>          # set the event to display reflections
    % u# X& O2 @, `4 c3 ~7 `
  53. #
    ' r! U: P8 v6 z* f4 i/ \
  54. #------------------------------------------------------------------------------#, a, `5 C+ Y- |5 n( z: G
  55. #  EXAMPLE:/ ?7 ]: O8 ~. r  z6 e7 @
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    2 A7 c7 `' x8 ?
  57. #------------------------------------------------------------------------------#$ Y/ o$ ^) f( l5 g- {; i- Z  u

  58. 3 S# }/ m0 x' X( |

  59. 1 H9 x. O! u( b# @9 p) N0 u
  60. #------------------------------------------------------------------------------#
    * W7 w. s% r4 s. y8 n4 Q$ H1 J4 O3 t
  61. #  SCRIPT CALLS:) [4 s9 {6 t  W$ e  M: i0 q8 m# g
  62. #------------------------------------------------------------------------------#& d1 n) n! I5 n5 o6 t1 |
  63. #
    + p$ B6 U; g2 ?, E5 J& @/ g
  64. #  char_effects(x,x,x,status)  T% A6 A, u6 e$ L& ?1 L# i
  65. #
    ! w5 Q. G4 ~; k3 Y9 U6 J1 w
  66. #------------------------------------------------------------------------------#
    9 {  D6 a! r) z. U
  67. #  # each effect can be true or false to enable/disable them during the game.% f7 _9 S. k7 n$ q3 W
  68. #  # you can change multiples of effects at once, x being the effect number+ W( O: J! Z6 ^- F# m8 n
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    - q! e: d  e  X$ d  e7 Q# h4 T- b
  70. #------------------------------------------------------------------------------#3 Z1 W. Z# ^* s6 S2 ]  t/ e
  71. #  EXAMPLES:
    / P* Y0 z# z" T# E: `% B9 Y8 i
  72. #  char_effects(0,true)              # turn reflections on
    $ ?! X' M8 P6 ~5 p# K8 E+ C
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    - ?5 }3 t* H) `# f6 P
  74. #  char_effects(1,3,false)           # turn shadows and icons off5 s+ {6 Q7 b( O# [4 L2 c0 A
  75. #------------------------------------------------------------------------------#
    / _- D( z' A7 S8 ?2 w* _
  76. #- F- S& G! X0 n4 X) h4 z
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset' \" h# [% G, C& H! K; M! L
  78. #
      F+ g( p, [9 @, ?; S& N2 {0 i0 G
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset, Q7 {4 N8 [' M" y! d
  80. #9 E* b; c  E, G0 u2 t! b/ P+ i
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset# `2 z% ^3 T2 _, f+ G
  82. ## D! z1 t& F# e$ b/ Z" Q: o
  83. #------------------------------------------------------------------------------#2 e) Q% y2 D1 n; _
  84. #  EXAMPLES:. e* ^" h8 e9 j: `. n8 J3 N
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    . N; [# G' H* a: z
  86. #                                    # in position 2 of "Actor2" charset.
    - }% Q$ h6 w* P  a' L2 g; d8 I
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    ; K" w/ }0 [' P5 F
  88. #                                    # "Actor4" charset.) L- b5 ~! X' @
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of2 U* [- G0 E: \2 b: ^+ T0 j* B
  90. #                                    # "Vehicle" charset.$ O7 R) N; @! K! \( d
  91. #------------------------------------------------------------------------------#
    ; o+ x, W0 a) E5 V$ x
  92.   " \' G% @3 {# e( k, v
  93. #------------------------------------------------------------------------------#. R' V9 B8 T3 k8 K, ~, b$ _# d4 ?: ^+ g" ~
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS4 l# a& ]/ b" n8 r- N- @: \4 M5 d
  95. #------------------------------------------------------------------------------#. T" E: Z4 z5 v) R" A8 Q7 \
  96. #
    ) D2 E8 X  j9 M1 Q! t  p
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    ! l, V$ Z) J$ Q3 D! d( |
  98. #                          # use this to specify for mirror and reflect.4 |5 ?  l* j; |  X% t8 X
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change* z) c5 N2 V; u9 V$ H8 l
  100. #                          # to change all events use :all: [' P$ O' m9 ?0 ^% Z: m' j
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    . v$ a' R5 Q8 b( H# V
  102. #                          # it 0 for no icon.
    ! ]' e$ U, c0 ]7 P6 h1 Y
  103. #% ~2 J. {5 ?4 d' X! V: C  I* }$ g
  104. #------------------------------------------------------------------------------#
    + x6 Q7 f" }. T( x( ]
  105. #  EXAMPLES:
    $ G8 V' t" k$ S+ }! o; M5 J
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON* e, ?+ @$ r( g# Y2 H. ^1 Y
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    ) I; u( `5 @0 I, E. y" N* G/ Q* ^4 A
  108. #  reflect(:all,true)      # Turn all event reflections ON  @' [4 k) ^. l, P/ O' R( |$ G7 n  g
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    7 v, z) c9 W7 X; R) P# A1 Q
  110. #& v9 G; c3 {0 K- ]4 q
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering  W  g+ m8 q  \
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    : ^3 D+ M. Z/ C' H3 N8 z& Z
  113. #        should use these effects sparingly and only activate them on events
    + ?, X& ?, q# [. c8 ], ^( q
  114. #        that require them.- K2 V, {( F* X* m, b/ H3 J
  115. #------------------------------------------------------------------------------#
    0 v7 S9 E( Z- x8 ]7 p/ L/ R' _4 F( I
  116.   
    , f5 R/ F3 y; m
  117. #------------------------------------------------------------------------------#
    - a' I: U4 {' y! F7 M( }/ C
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES% A/ |5 g5 z0 P' W& |% h
  119. #------------------------------------------------------------------------------#" E" h) _) y, p3 l
  120. #% G8 T- E/ W) J, p
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default $ K9 V! L+ u9 a) P5 j3 J
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off " s+ u8 n% Q! h' ]
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    3 B0 K5 M; X& F" y3 n+ x) S
  124. #$ X; K* W- z* d
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    & I9 `, l$ c% q# o. g
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.3 b7 v( g/ `( r) s% r
  127. #  v_icon(x,x,x,icon_id)
    ) r, A9 t- u; E; w
  128. #
    - |/ [! N0 ?) @
  129. #------------------------------------------------------------------------------#2 z5 y4 ~8 [+ Y2 n- h0 \
  130.   
    4 V6 ?1 ]  g! h$ H" s' ~
  131. #------------------------------------------------------------------------------#2 \* m  B. P$ S* _; w
  132. #  SCRIPT CALLS for shadow options
    # S- M  f/ M0 g8 K9 t
  133. #------------------------------------------------------------------------------#
    7 J! C( G, X( G! j7 K
  134. #" z+ A# X6 k- _4 D6 H' P( o
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 0 K0 S8 H8 ]! {- j, j
  136. #                              # light source number you wish to change (for
    + E5 ~5 [% w9 E0 c* b# l
  137. #                              # more than one). These are reset on map change.; U; J) N9 O  W
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    * Y7 X, R- N: z' x6 [1 [  _
  139. #                              # This will need to be in parallel process if you
    9 t8 A' M6 c/ b/ L
  140. #                              # want it to be a moving light.
    8 }/ Z& ?  L/ Y; [2 a1 I6 \9 H9 H
  141. #
    9 X/ I( k( I* O" v% M
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    $ K1 n# T* }: E1 B5 K4 t
  143. #0 n# w3 W$ g3 B2 m+ t) ?
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    9 }' ?+ ~4 l! \! |9 f1 [/ T2 b
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    9 v. P: \& H# Z3 Z/ s
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    2 I* k1 o0 I; Z/ l% O
  147. #
    - R" h8 H) v" q. n( \5 J, `2 d
  148. #------------------------------------------------------------------------------#/ _# {; z+ C4 w7 V! Y# L* N+ y" w) P4 M
  149. #  EXAMPLE:, m4 ?! f' i; w
  150. #  shadow_options(80,10,false)    # This is the default setting.
    * s" j% v; k% A% M2 }4 ~: x
  151. #------------------------------------------------------------------------------#
    ( j+ ^: Y! M) p) i9 |
  152.   
    * ]% F7 `- K/ J
  153. #------------------------------------------------------------------------------#. \( l& q4 a9 Y+ Q( E4 K$ G+ _
  154. #  SCRIPT CALLS for reflect options
    7 E4 b0 ~) B; f( a- w; I
  155. #------------------------------------------------------------------------------#; l; Q' c- `2 h# f2 M' k2 D
  156. #
    ' K( l. l  h7 C5 W
  157. #  reflect_options(wave_pwr)
    - h* L* I& M' ]. d& [$ b0 T+ l
  158. #
    2 j* G5 H/ p/ f$ w% n+ a/ |
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    $ Y4 W2 {4 b3 ~, ?8 K# e+ s$ [, x
  160. #) B( S! }3 c0 b2 k
  161. #------------------------------------------------------------------------------#! g; z: \' r$ J
  162. #  EXAMPLE:- d* b: X( R, ?$ s7 ^
  163. #  reflect_options(1) # Turn wave power to 1
    : T4 \  O6 Y. D( }0 D( _' x% v2 [0 ~, Q
  164. #------------------------------------------------------------------------------#8 s6 o. f6 l' K( q! Y) {& C
  165.   
    + e0 b0 ^+ ]8 a' K) }
  166.   
    & w, D8 Y, n% c, q" n
  167. #------------------------------------------------------------------------------#8 k* U9 Q3 _' |, F& R
  168. #  NOTETAG for ACTORS( \6 {/ l4 U' U! S  I# P% k5 \
  169. #------------------------------------------------------------------------------#
    6 l# m3 D' ]  _0 k, ?) C% v, {
  170. #: `# p0 Y* s# Y1 s
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    ! o' p! l) U" {' B/ f, ?; i
  172. #) n' Y+ r( ?& _' k9 z- [! l$ C
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections& [/ ^" Z, }: h% c7 \+ ~5 w
  174. #                                  # and use the character in position 'pos'$ }- s: V. g9 S& C/ s
  175. #
    7 w: D9 f9 i' t4 Q  A
  176. #------------------------------------------------------------------------------#
    8 O( |3 f' @$ h7 v2 L7 e
  177. #  EXAMPLES:
    " b1 K  L' B( q6 Y
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    % u3 ?1 F8 \( g$ x* {
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    4 i5 V5 U- S/ f$ u! K" @
  180. #------------------------------------------------------------------------------#4 U! s& B! q. z5 {5 R
  181.   
    9 w/ }7 x+ @6 w% l6 }$ B; V
  182.   
    , O) v8 d# [8 Q( T
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    " ?2 [5 \: w# E$ m
  184. module Galv_CEffects5 R* Q' h" a, r, v( B/ o, _
  185.   ! f! K% q4 s( F- a4 O
  186. #------------------------------------------------------------------------------#    n) `' X# `9 \
  187. #  SETUP OPTIONS
    7 L5 o! m* S& p& a, U
  188. #------------------------------------------------------------------------------#0 }( w& y; B9 k
  189.   
      t1 q. ?" w; E% F& X* Y
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    + ]1 @# `# l- `6 x8 W
  191.                         # region on the wall you want to make reflective (and
    / w% b* u& O9 G  u
  192.                         # then use tiles/mapping that make the parallax visible)
    # l" `2 C- l3 H) {4 M& |
  193.   8 J3 u6 f" T) F; ]. P2 L) u3 E
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters1 g6 D7 m1 {7 _0 z) K5 e9 V
  195.     6 G/ y5 _+ m4 T+ }* X8 a  f% p2 u
  196.   REFLECT_Z = -10       # Z level of reflections
    % _' }" u: d+ J
  197.   SHADOW_Z = 0          # Z level of shadows
    - b' q/ P  q# M% u) n
  198.   
    8 d$ R" J4 {' e& G( v  {
  199. #------------------------------------------------------------------------------#  
    ; q. p# @& T$ A3 S: @1 X  W
  200. #  END SETUP OPTIONS! I% N# e/ ^( }0 b6 _
  201. #------------------------------------------------------------------------------#
    ; `. ]/ f& R, B/ C! v
  202. end
    4 Q6 u" \# c# X2 c" d0 o8 a& _; Q5 ~
  203.   7 h5 Y! g: n' s2 a
  204.   
    # j1 V5 b4 i% _" }) k

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-8-24 12:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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