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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
, z' H3 ?; r% v2 h, n6 y
这个代码怎么用啊,有大神知道吗。我从国外找的。  w, g3 T8 X# A2 b
http://galvs-scripts.com/2013/02/21/character-effects/
4 j3 N6 F% V( V* B. `2 B9 \是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    / x# ~9 [7 e- c0 O7 l) l3 v& z
  2. #  Galv's Character Effects, A9 n4 y% o7 c0 J! d: n8 p% _
  3. #------------------------------------------------------------------------------#' j6 y' W9 h; o4 M5 T; B
  4. #  For: RPGMAKER VX ACE  H% J! o6 z  g3 [; s. l- z
  5. #  Version 2.1# Y8 l! H( ~" h8 M- t# g6 [7 B
  6. #------------------------------------------------------------------------------#: M, l, H- l6 r0 B! t0 s1 E& J
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows! ?; @, R; _2 Q" I
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    % Q8 @+ F# w# F5 ~
  9. #                           - Fixed shadow facing bug
    2 ?8 u. C8 B5 w5 u% \
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    . J" k5 z! F9 F2 I  w; f( x$ p7 Q
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    - ~; z% h/ I7 E$ C7 M
  12. #  2013-02-22 - Version 1.7 - bug fixes, L# i# z3 g1 b  I% }: c: g# G
  13. #  2013-02-22 - Version 1.6 - added icon effect" r1 v% Q- y$ e& H7 z* F+ z: X8 e
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps  O4 l  U# {4 X8 L
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles& @, r# N( r0 g) T4 m/ j, S2 g+ T
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks4 W! \' W$ H0 ~
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)" f& Y& b1 l$ L' ^. y
  18. #  2013-02-21 - Version 1.1 - updated flicker effect" N" Y. P  C; \6 p2 v. ~
  19. #  2013-02-21 - Version 1.0 - release
    3 k! F% B! Z" H, L8 s% M; c0 j
  20. #------------------------------------------------------------------------------#
    * B4 G' k8 G7 f' M! c2 N. l
  21. #  This script was made to provide some additional effects for characters such; X( r+ l" _! a: V' U+ {
  22. #  as events, followers and the player on the map.) s' G2 r# v# Z7 Z9 @0 I, X4 ?
  23. #  Currently it includes:
    3 n/ t, P, r# M6 D  H. h" Z4 }0 m
  24. #
    # n  s7 b6 L' v- }& m) D
  25. #  Shadows
    + r% _2 x( W* F, {) F& o, [, n( r
  26. #  Shadows that appear under player and events in a directions depending on
    + t2 @" P9 }4 O) M
  27. #  a light source that you choose.
    3 T! N) x0 Q) |7 O6 H- U; D
  28. #$ ^* A9 O2 f) x3 o
  29. #  Parallax Reflect  f5 Q) F+ N/ O& P2 P$ T# v0 K
  30. #  Reflections that appear on the parallax layer for events and actors to be0 e6 {& u2 h$ m7 K( d0 b( S* g: L
  31. #  used for things like reflections in the water or glass floor etc. To get
    2 Y1 a2 y+ a- m$ ]1 q. J
  32. #  effects like the demo, you need to edit the charset graphic to make the water; R  d9 h9 B  @  u! c7 u
  33. #  partially transparent.8 ?! c/ J& `6 _" ~
  34. #
    % U- B( Z3 p8 y7 [0 c3 Z
  35. #  Parallax Mirrors" T, H& j0 k# |. Q) d  N
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    - M: G/ Z  t, t+ D6 a* Y! p
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    # x" H8 t, d0 e$ S: }
  38. #  changed so actors and events can use different charsets for their reflections' A% [8 m# F; g4 f# s8 f1 M' B
  39. #8 e' D2 P1 A- z. M1 C
  40. #------------------------------------------------------------------------------#
    $ P4 Z% k8 ?" j9 U0 S  C
  41.   
    1 B8 n- ~* p  w6 c$ q) V

  42. ; b3 _2 H% F1 D5 l% f/ b6 _
  43. #------------------------------------------------------------------------------#
    8 k. w- f5 v# Z$ |( Z) I; X
  44. #  NEW - First event command as a COMMENT, @& u2 x  e* f
  45. #------------------------------------------------------------------------------#
    : C) u! S- N5 ^' J4 g1 ~
  46. #  You can add a comment as the first event command on an event page to set if
    + X' s! L7 @, m2 r
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    * F+ I+ z- M9 X% j
  48. #  below, all must be on the same line in the comment.
    ( d& Z$ `6 s& j6 E0 l
  49. #
    + S' k: |8 w% I
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)+ u+ \; u. H- H7 J5 O$ u& v& l
  51. # <shadow>           # set the event to display a shadow
    ! D" Q3 f1 U+ p$ ^) ?! e1 V
  52. # <reflect>          # set the event to display reflections. X* M5 ?/ o7 t  k" F* v+ X; \0 m
  53. #
    7 L+ Z5 i3 J8 d7 N6 R7 y$ N7 R
  54. #------------------------------------------------------------------------------#
    3 h/ k1 c$ Z% @5 _  |$ \
  55. #  EXAMPLE:
      \9 _2 Y' n) M! ]/ Q6 d# u! g
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event# v+ v8 a0 Y3 ]0 J; A
  57. #------------------------------------------------------------------------------#1 d# l: Q: D4 X; F

  58. & j* _, a# L5 f0 I* Z. ~! o
  59. 8 q) G6 H* G$ ^5 }- b% [
  60. #------------------------------------------------------------------------------#
    3 u' z: g& z! M0 I* e
  61. #  SCRIPT CALLS:& ^1 l+ H: N7 c
  62. #------------------------------------------------------------------------------#1 g6 m5 ~$ Z, _8 E5 q& Q' L
  63. #
    ( _5 K- h* Z# R; H4 d. W) y
  64. #  char_effects(x,x,x,status)) g$ R# f1 n) m) n/ f- ^" `1 _
  65. #4 G7 j2 u9 ~2 S* a0 S  d) U
  66. #------------------------------------------------------------------------------#  }$ R- a& {6 F  i/ d: X' x
  67. #  # each effect can be true or false to enable/disable them during the game.
    ; |- ^+ o& Z. w* M5 }: ]; }3 N
  68. #  # you can change multiples of effects at once, x being the effect number* C/ M. g1 b. L- w' x0 S% W
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    1 D  ?4 q5 g) c4 r% C6 F; ~: A( I
  70. #------------------------------------------------------------------------------#
    9 H+ j- c% [9 c" j6 e4 M1 F! Z
  71. #  EXAMPLES:# d( U4 h9 `: Q+ z
  72. #  char_effects(0,true)              # turn reflections on
    6 |1 J( Y( L+ S# A  ~9 S9 w- y
  73. #  char_effects(0,2,true)            # turn reflections and mirror on2 c- }- V2 ]4 R. r1 {8 t; [* o
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    " n0 k/ B8 M! S) Q1 O
  75. #------------------------------------------------------------------------------#( z! H3 T3 D$ A
  76. #' Y% n- w# A# S; w
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset& f: B/ _( F) P" d% {
  78. #
    . I6 ?9 B2 p: n4 B% ~) z/ A1 p. E
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset2 m- Y6 d; c9 m1 l( U
  80. #
    ( j+ i+ B/ _: P. E+ F
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset3 Y. q, p1 X' K. H- n
  82. #
    - t; c6 z2 p0 N4 s) J/ w
  83. #------------------------------------------------------------------------------#
    ) f9 l' Q$ k. Q4 N+ Y; f
  84. #  EXAMPLES:
    + F4 x- r# x% w. t+ O/ M' [' h! A
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite0 D( K' f  @# `
  86. #                                    # in position 2 of "Actor2" charset.( U: a. R. T/ B% r7 C# b
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    1 A+ V; M3 D! a; X& z6 s) E
  88. #                                    # "Actor4" charset.
    ) o6 M% M  q8 K$ N/ a- O
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of$ P0 I' ~2 K' x; F5 p- ~# n# O2 k
  90. #                                    # "Vehicle" charset.
    1 h7 W0 k6 Q8 A: A$ D. a
  91. #------------------------------------------------------------------------------#0 J+ T& g. m, n" y: W6 L5 j
  92.   9 ]5 p3 M. L6 R; G( b
  93. #------------------------------------------------------------------------------#* f8 _7 i& B. l/ C8 E
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS1 ?1 l4 x6 L/ p3 b6 X
  95. #------------------------------------------------------------------------------#
    % ?; w1 ?6 Z! I9 ~  ~: r
  96. #
    * f9 s9 L6 q# v6 g
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    9 w2 n1 L5 Y& Y" Z
  98. #                          # use this to specify for mirror and reflect.  O5 k2 m. ]5 z
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    3 l: q' b* }& M! _2 j" h
  100. #                          # to change all events use :all9 y6 F8 B) Y; f% s2 S* ?
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    3 a: |3 {9 Z/ m8 W
  102. #                          # it 0 for no icon.; e# J$ g& `, j5 z( q! |7 h, |
  103. #
    * ?+ y" j2 x* F* `
  104. #------------------------------------------------------------------------------#
    . |! x0 z* Z/ z2 i9 c, p
  105. #  EXAMPLES:8 d$ T! o3 a6 D' j
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    # I! L  c( G6 g# H, O1 m& a' X3 K
  107. #  shadow(1,false)         # Turn event 1 shadow OFF3 i% I8 ~, ^) ^, {/ }
  108. #  reflect(:all,true)      # Turn all event reflections ON: F% `+ g' N( m: y2 s" {5 v' ]3 {1 ~
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear7 e5 @% V: a7 C: S: H1 ^
  110. #) ~: }4 S$ {; r% k4 r2 z! ]9 U
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering% b/ I8 T1 y' S% H' r
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    8 k: G7 b: J4 e; |7 R
  113. #        should use these effects sparingly and only activate them on events$ Z. Z8 I2 X8 M" b, |% u2 a) ^
  114. #        that require them.
    , a2 H* F" \+ _) {
  115. #------------------------------------------------------------------------------#3 S6 r9 d" B! U; I
  116.   
    4 U1 C; N% @0 Z
  117. #------------------------------------------------------------------------------#" G6 w% |7 g$ S9 T2 l
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES! c9 g. M1 u' X% y
  119. #------------------------------------------------------------------------------#" i; @- c1 z, S& O4 ^: o/ A' I/ A
  120. #
    7 A( X0 t' G0 J0 A/ l; l  K7 k; U
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default 2 O  L' C1 Y% x) D8 ?# W
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off " R2 b- Y4 T0 u. A' z0 N. P  ]
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.- Z+ r: b+ `0 O' V
  124. #
    & |( t: F2 c0 Y5 a+ o( @) N
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects! A4 i) ?/ m5 |- J2 O% d. k
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.+ H, }  [6 m* S
  127. #  v_icon(x,x,x,icon_id)
    / C; ~9 m/ w: g; x  C$ b8 M2 y
  128. #
    % H, ]0 K8 t6 A+ |8 g3 ?2 c
  129. #------------------------------------------------------------------------------#
    - t* [9 T8 I9 w
  130.   
    . {) Y+ V9 ^0 b7 [- }" k$ Z
  131. #------------------------------------------------------------------------------#0 p7 f2 x$ N0 K; f
  132. #  SCRIPT CALLS for shadow options
    0 S& o' ]8 Y( i6 g; ^8 w  P  N
  133. #------------------------------------------------------------------------------## c0 Q  Y% G+ L* ~& ]
  134. #
    , v2 P  f, `  m' J' d+ Z
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the # b0 w" m7 I' k
  136. #                              # light source number you wish to change (for
    7 E# z2 m7 `: H$ }$ S! T% h( @
  137. #                              # more than one). These are reset on map change.( y- ^( ?6 l0 L7 K: k  H3 k
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    6 ?, f. W: g/ W! g8 A5 ^* x
  139. #                              # This will need to be in parallel process if you1 N! w- R+ ^4 Q5 ]1 u
  140. #                              # want it to be a moving light.
    6 }. T3 b! A6 \& l1 a6 R) _
  141. #
    8 a, E( _" v$ M  t& e# {2 C
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below# k; l1 h% ]0 i
  143. #: J# ]. [  v/ G
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    $ x8 [. K+ ^& y5 V3 e2 S/ g" A2 \
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    ' j5 b- d! H, M- b; E
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    / ^: @2 Y* E0 W6 W
  147. #7 L( m- M6 b: [7 }
  148. #------------------------------------------------------------------------------#
    # ^$ H% T- C+ Q6 y4 f& j! q
  149. #  EXAMPLE:% t# X' ?4 J$ G' n
  150. #  shadow_options(80,10,false)    # This is the default setting.& I& k# i0 H( v
  151. #------------------------------------------------------------------------------#
    2 W5 X) v2 m+ j5 ~0 h  L: N
  152.   
    & c" N$ S% a1 `, V2 ^) e& G
  153. #------------------------------------------------------------------------------#
    ! S* ~7 r3 z. z6 q
  154. #  SCRIPT CALLS for reflect options
    ) U" h, c* V) d+ U8 P3 |
  155. #------------------------------------------------------------------------------#$ d2 T7 u  ?, P- m- y9 u5 w2 q! R8 s
  156. #9 ]3 i# S( b! S( N# A+ W$ s8 T
  157. #  reflect_options(wave_pwr) & I! d/ j3 S4 ^1 ?$ c" T- f& g
  158. #) g# a: ~% p8 ?- {+ ~' C9 d3 L
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    " [- e& d3 d# ]1 e- e3 v; x8 @6 p, \
  160. #
    # E2 w% V5 B0 [2 c  D" V  r
  161. #------------------------------------------------------------------------------#5 n2 U& F4 j3 N
  162. #  EXAMPLE:5 g  O- Z0 {* g  c1 x
  163. #  reflect_options(1) # Turn wave power to 1
    4 _+ k" D1 ~/ y+ H" \1 m
  164. #------------------------------------------------------------------------------#
    2 n0 X; P: A5 ]) J! O
  165.   
    / |! M+ ?2 r2 U( k) ~* U
  166.   
    & X' n0 ?3 A7 V5 z% C& `9 D, N
  167. #------------------------------------------------------------------------------#$ h! h# _- d: z0 p2 P, d; P: S
  168. #  NOTETAG for ACTORS
    % ?4 O8 c+ v8 T$ N
  169. #------------------------------------------------------------------------------#; W2 d8 a9 `# p" f* z' ?* R
  170. #9 j0 l8 e, r3 t/ B3 f1 V! j
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    # Y$ J' G! @* M
  172. #' q. z# [' C9 J4 ^) m8 ^
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections( h* V4 |5 U' ~. A
  174. #                                  # and use the character in position 'pos'3 N3 [' G( V- O. R) r6 x+ X! q; k
  175. #
    3 q$ z7 n( Y8 W$ _+ `$ o
  176. #------------------------------------------------------------------------------#9 r7 H' I; g6 n0 K0 X! Y
  177. #  EXAMPLES:% b- Y" K2 S: M5 l+ A
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    : r5 |4 l0 Z( f, y
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    & V6 x8 {* M, n: h. P
  180. #------------------------------------------------------------------------------#
    ' [4 K" N4 Q6 T7 B# S) i3 Y7 Y, l
  181.   $ H( N0 a5 B  P8 p6 j( P8 g
  182.   
    5 a2 n! g/ W1 d9 m) H* O  }1 _# N
  183. ($imported ||= {})["Galv_Character_Effects"] = true9 C# R) K, F) _+ S& g: p- K/ F- R
  184. module Galv_CEffects
    ! d2 V# M/ Q7 W' Z" K
  185.   7 \' z- R. x) T) R! K& ~% ^
  186. #------------------------------------------------------------------------------#  5 Y! j4 I1 T. K' ]! D
  187. #  SETUP OPTIONS
    ( Q4 P. O- F8 `( F/ a
  188. #------------------------------------------------------------------------------#9 K3 E' e; O+ }
  189.   / n: ~  Z+ j/ v
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    / k, b3 T+ y( W& |1 K. G; F( s
  191.                         # region on the wall you want to make reflective (and
    # A; F3 y0 K- i. z' C8 K# K8 B
  192.                         # then use tiles/mapping that make the parallax visible)
    * H7 ]1 X: S  R3 V) @/ [
  193.   ! L: r/ C* M" q* b; d; P
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    * C1 [' T! S9 u+ S0 e
  195.     & Q1 e, `9 _' Z, r3 F
  196.   REFLECT_Z = -10       # Z level of reflections4 t; _3 Y* e& c
  197.   SHADOW_Z = 0          # Z level of shadows
    / T4 j7 r# \; Y3 \4 X7 {0 i1 H) q
  198.   
    5 Z5 J& ]) U6 V1 ]" d3 r1 a
  199. #------------------------------------------------------------------------------#  ( U3 ?' G+ Y4 q) A' ^& v
  200. #  END SETUP OPTIONS4 w6 n) ]! l$ k9 A4 {' S
  201. #------------------------------------------------------------------------------#
    * \8 s7 Y& r" [+ K$ m- N& E
  202. end
    & U5 ~8 f7 j) J. Q% {1 C- c# f
  203.   # J( t  y+ g# w2 e- K; u
  204.   
    0 U( l4 t8 }+ v" g

  205. 5 v4 |; a& S- {- C- u

  206. 8 a  U8 j, |0 q# U* O8 ?' t8 K  u) z
  207. class Game_Map6 `3 \$ p5 t$ K9 g+ q# |
  208.   def do_icons(refresh = true)
    ! [% }  b0 H5 N1 `
  209.     @events.values.each { |e|
    7 O3 E; f: V+ h5 x2 j
  210.       next if !e.list
    " I5 }  r0 p4 t: L# J0 c
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    * L& D. h7 n' {8 O0 r
  212.         e.icon = $1.to_i/ Y: m/ j. o" J: ?0 |& a
  213.         e.icon_offset = [$2.to_i,$3.to_i]. ~* Z, j: I0 k, F2 h
  214.       else8 w% J; I3 ]% V$ f5 [' D2 `# O8 v
  215.         e.icon = 0
    ) w0 o* X) v# g
  216.         e.icon_offset = [0,0]
    ' p; J( n& K) m  y
  217.       end
    1 q5 }. c, N1 L# J( m, p/ d$ e) A
  218.     }
    8 R4 X' W0 Q9 U% ^
  219.     SceneManager.scene.spriteset.refresh_effects if refresh8 q4 D# U: U" g2 Q. i
  220.   end
    ! `) x; i% z7 G9 S( X3 \- S# X" b
  221.    1 @9 p& G- G! D" q' ]% l
  222.    
    * V! Q$ @% G, Y! f
  223.   def do_shadows(refresh = true)
    ' }2 G: D6 y. f9 B# L& M9 U
  224.     @events.values.each { |e|/ Z9 J) V. k' c+ Q% F
  225.       next if !e.list
    $ b) ~+ \. i; Y
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/% x( ^& h. F8 u, d4 Y
  227.         e.shadow = true
    ; i/ {9 Q* L6 \' a
  228.       else- Q! _6 b) K( R/ C9 T: G" N! i
  229.         e.shadow = false
    5 j* ^. e( T$ N# x$ {
  230.       end3 l9 I* c9 O! i- ^5 _6 M
  231.     }
    9 a+ |9 c0 }5 J5 k) I- w9 F5 ^
  232.     SceneManager.scene.spriteset.refresh_effects if refresh6 L6 V7 E) S! f" G  [) `) f
  233.   end; g" @: I$ @, m
  234.    . j; y9 V, {; X) d
  235.   def do_reflects(refresh = true)
    : q# \% M  ]5 p' ^- J% [
  236.     @events.values.each { |e|
    # C# Y+ b6 K! S
  237.       next if !e.list
    4 `* m- R' r! p. [) R; F
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    / U8 e% q* T  v# B/ ~
  239.         e.reflect = true
    * j+ s* Q+ D$ F1 x- z2 J$ D0 `
  240.       else
    # g4 j4 D' b; X
  241.         e.reflect = false" |; m2 ]0 K& k8 _( g
  242.       end  ]0 u) M  W2 v5 r" |1 e# ?
  243.     }1 T/ k: E- C, E  @
  244.     SceneManager.scene.spriteset.refresh_effects if refresh' u* W# s2 _; t  y& W! K8 v6 J8 f
  245.   end- F6 y$ j7 V+ o' {9 Z, l9 j& p
  246.    5 }; ^) b# n6 E8 U8 O9 h& }: n4 O
  247.   def do_all_chareffects4 }3 Q9 K8 ~" }  n' z3 s7 h& ^  E4 [# q
  248.     do_icons(false)
    ( D# K  E: O% G# V- X5 _
  249.     do_shadows(false)
    2 E. W% P3 G6 e& `) B# V( o% Y
  250.     do_reflects(false)
    + @! Z$ Q7 p+ \* t& [8 x8 A$ f6 J; O
  251.   end4 {6 s: q* o' g9 L
  252.    
      [* ]9 Z: b3 s2 C- a; A% H
  253. end # Game_Map
    2 ?4 m4 W# T5 X1 L( q. X# Z+ z
  254. ' N9 Y6 C7 w* F) _) m$ b# {$ P" K

  255.   ^4 x; S6 A% ]! Y3 v& F0 ~/ t" m

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-2-19 06:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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