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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
& M8 j% m5 N; `6 u9 N: `  `
这个代码怎么用啊,有大神知道吗。我从国外找的。
! u; z- G; {" f" v. V; A/ ghttp://galvs-scripts.com/2013/02/21/character-effects/) X: W& f* n, j( Z
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#, j+ g) `1 L3 Z* Y1 G
  2. #  Galv's Character Effects
    : |* E0 U. k6 z  v" v; b
  3. #------------------------------------------------------------------------------#
    2 t6 s4 A& d& E: J( D7 n0 {! q
  4. #  For: RPGMAKER VX ACE& M' O1 B2 k% y
  5. #  Version 2.1
    # I$ h! `; A* n
  6. #------------------------------------------------------------------------------#
    1 J$ R4 F0 V7 ]' F; n; Q
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows, S  s2 T- t& T' ^7 z* Q
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects4 b$ ~4 d" C, V4 V: w8 T8 H5 f6 Q
  9. #                           - Fixed shadow facing bug
    2 K3 d3 d7 v  s& l  [( [0 v/ b& H: i
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows$ ~/ h" N% f3 E- l# o* z1 y! |& |! [
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows. t: F( g1 g3 E8 U7 w0 B
  12. #  2013-02-22 - Version 1.7 - bug fixes
    + f% k: P0 j# ^" K; V. A$ c
  13. #  2013-02-22 - Version 1.6 - added icon effect. {. d. ^! [3 D* Q
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    7 J& _+ R' o  y6 P! d
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    $ Y+ w7 n  `+ `& @
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
      Y3 Y: P# ^) V' p3 Z" |$ I
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)  z' `' }: a, L% t( E
  18. #  2013-02-21 - Version 1.1 - updated flicker effect. J5 ?; y# w' H/ x$ V! ~
  19. #  2013-02-21 - Version 1.0 - release2 q) f* j& J: c. y1 U1 f1 b
  20. #------------------------------------------------------------------------------#
    + Z" o% J+ I! |% d% F! y: N
  21. #  This script was made to provide some additional effects for characters such
    " a6 G& O/ K: s, `9 I
  22. #  as events, followers and the player on the map.9 r( Y' X6 N! x& F& M. t
  23. #  Currently it includes:
    . T/ M8 s7 j5 p
  24. #. X2 h' q7 M3 I1 T6 }" U
  25. #  Shadows
    1 x9 E/ V  V& l" o5 O8 L- d: u
  26. #  Shadows that appear under player and events in a directions depending on
    0 q: r! m0 u# u4 [) w/ x, O9 ?& u& M
  27. #  a light source that you choose., M) L; I- @. ?" H
  28. #
    : |- a) ?+ h2 W
  29. #  Parallax Reflect! z' s/ ~8 Z! w6 n/ a" C! b
  30. #  Reflections that appear on the parallax layer for events and actors to be
    , w& u+ @6 Y. A+ z6 v
  31. #  used for things like reflections in the water or glass floor etc. To get
    8 c6 q& I" o* E2 |9 R% u
  32. #  effects like the demo, you need to edit the charset graphic to make the water; @" ^- u  Z8 {6 W4 k
  33. #  partially transparent.
    7 |' g7 `& @2 |1 F3 u$ q" ?/ f# S" i
  34. #
    * s2 F3 `$ i, j7 d0 }
  35. #  Parallax Mirrors
    " I) {( W4 W9 u8 @+ [2 c9 ]$ y
  36. #  Much like reflect but are instead actors and event are reflected in a mirror$ y! f1 k. {& P9 o" @
  37. #  on a wall designated by a region. Both mirror and reflect effects can be  |' d4 y4 |6 u2 `
  38. #  changed so actors and events can use different charsets for their reflections
    7 f0 N: u" ]* x' R$ I
  39. #6 E8 Y$ W  O) q! r6 e
  40. #------------------------------------------------------------------------------#. L6 e2 z, U0 s' W7 B: K' u
  41.   1 o; m2 O% c1 l' K  y
  42. ; |+ f. j+ {% `( R& W' \
  43. #------------------------------------------------------------------------------#& v; h: e& y" A9 R2 P# Q
  44. #  NEW - First event command as a COMMENT8 C. q, Z" w4 p$ Z2 h# L
  45. #------------------------------------------------------------------------------#
    . ^. N$ M, K# E5 y
  46. #  You can add a comment as the first event command on an event page to set if6 n: G  [7 Y3 |6 j5 u
  47. #  that event has an icon, shadow or reflection active. The tags to use are1 D4 G! D5 N4 |. Z. u
  48. #  below, all must be on the same line in the comment.4 r/ y3 q% S, d  i) g
  49. #
    5 A3 @' |4 G1 p+ d+ u1 g, T
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)% V+ ~6 X0 ^: C
  51. # <shadow>           # set the event to display a shadow
    : I3 {& J# e9 u, U4 q2 o0 `
  52. # <reflect>          # set the event to display reflections
    " P  l6 J; ^! q% h7 F
  53. #
    # y/ f8 a- I1 G/ v- @" D
  54. #------------------------------------------------------------------------------#. P1 l0 ^/ i' Z
  55. #  EXAMPLE:
    6 C/ C# [. p9 Y; d# U
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    ! B1 g/ N5 l6 S4 g6 J6 X; W3 v7 t
  57. #------------------------------------------------------------------------------#8 N! C" ~- O  l) Z( C* c

  58. * Y- T+ m( k+ f( i+ S

  59. 8 g/ }. c8 k: ?5 k+ Q: [
  60. #------------------------------------------------------------------------------#2 |0 }" N9 @. w9 ^+ {% [9 {
  61. #  SCRIPT CALLS:
    ' t4 d7 L* g7 [# P2 c
  62. #------------------------------------------------------------------------------#' c# E$ K7 U4 O1 J, s: E
  63. #" ~" b8 T8 q" f' A( o+ y! b+ m- W  O
  64. #  char_effects(x,x,x,status)/ n5 \2 o7 g5 v4 ~9 R( d
  65. #
    $ s# ]9 P) O" M; H% m1 p: \
  66. #------------------------------------------------------------------------------#
    % [4 `- \- a4 C
  67. #  # each effect can be true or false to enable/disable them during the game.
    : q- _( @& k4 Q: j0 c6 w3 G1 B; u
  68. #  # you can change multiples of effects at once, x being the effect number
    - A8 g3 O& c) v; H, @
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons& t* o) d: Y; z: h% G
  70. #------------------------------------------------------------------------------#
    9 H* Z  Q5 ^' h+ r+ a( }
  71. #  EXAMPLES:+ f8 T- m' W7 K) P. {& L7 v
  72. #  char_effects(0,true)              # turn reflections on
    : R7 A9 c* M$ P/ K4 u
  73. #  char_effects(0,2,true)            # turn reflections and mirror on4 v) v8 C* A( }$ L
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    # D2 b& z0 ~: Z$ T1 t7 |* H$ V5 w, e
  75. #------------------------------------------------------------------------------#9 z. L! w# H; C" f2 |
  76. #
    6 M7 T  C5 ?! |% `
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    - K! t, k3 v, k% p2 @( b/ O/ c
  78. #6 @7 c( C& ]/ k9 G7 }
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    - `* O  q, O% P% o: ]
  80. #7 U4 w1 [2 c9 W9 R8 G8 ]
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    4 [8 _  z4 q, U3 @
  82. #, L& V7 h* r* v) |2 H
  83. #------------------------------------------------------------------------------#
    ! ?; z) i7 `/ S3 P' _' w( S
  84. #  EXAMPLES:
    7 C" K5 ~9 \' ?) \5 _
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    4 m0 ?# r# a: z5 y& O/ a( w/ ^8 f
  86. #                                    # in position 2 of "Actor2" charset.
    3 y. B; T: ]. a% I
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    7 l  S8 m; ^8 L5 _5 z5 o- _
  88. #                                    # "Actor4" charset.
    4 G' B' I  s. }& `
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    6 `' _. F  ]# @: f3 `$ p- y
  90. #                                    # "Vehicle" charset.( L( Y+ Q7 N; {0 i! C! E
  91. #------------------------------------------------------------------------------#
    & M# j+ w: g+ W, g. X: O, b4 @# [
  92.   & N: P+ Y/ a' Q$ _1 s! l" K4 s
  93. #------------------------------------------------------------------------------#* w7 C# n+ ~+ k3 `% u; k
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    , b& e4 d7 s  {
  95. #------------------------------------------------------------------------------#
    . s/ s# t" ~& s% _9 E4 A
  96. #3 {, x/ ^- e- Y3 z
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    ; E  ~$ R; ^9 W0 [
  98. #                          # use this to specify for mirror and reflect.
    ( f; V: V" q9 h: s
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change$ I( K- p) v# v5 M! Q
  100. #                          # to change all events use :all
    8 g! i' W3 Q8 z$ B2 a
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    $ o1 ?: ], Q" j8 W$ W5 G- J. j
  102. #                          # it 0 for no icon.
    $ P, J: r/ v0 c' l3 n) F% a
  103. #
    / Q  H/ ~) R# h! y
  104. #------------------------------------------------------------------------------#
    9 g' S4 J2 \/ Z" a: t3 s
  105. #  EXAMPLES:
    * ~) D9 z$ x( R! u9 O7 z. i& `
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    ) J/ H& ]! g3 V, v8 b& U" j
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    " y: T+ b+ h5 l) {5 U% K8 P& H
  108. #  reflect(:all,true)      # Turn all event reflections ON7 v3 u) B" q2 I5 s2 Z! x- y
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    ' b4 |7 v! N: a! \
  110. #
    5 K( y0 ~' q" K- P, Q
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering$ m( a4 B" R; N8 z+ J
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    4 k' h: W. x3 q8 \# ^5 |
  113. #        should use these effects sparingly and only activate them on events; b. a, V- I! J9 A
  114. #        that require them.3 i: q4 `, ]. e% f$ U
  115. #------------------------------------------------------------------------------#
    9 p1 p3 D/ E$ }7 v5 e
  116.   
    # j# V, A1 D- @% K/ O( X
  117. #------------------------------------------------------------------------------#3 P9 C* m( z5 p
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    7 u, n- e* s4 q$ a
  119. #------------------------------------------------------------------------------#' i! }+ |' }. v/ W
  120. #- O: A3 W6 Y. o5 p5 C4 g, u
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default / |5 Y0 J: G& W1 ?: P- [
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off ! p  P% o- k1 a: ]2 _; B
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.5 i% Z1 H' ?- n$ u
  124. #( Y7 d9 _0 x0 Q. q( C  e
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects! {$ W% S6 v8 b
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    3 j7 @' r5 r$ [/ E
  127. #  v_icon(x,x,x,icon_id)
    & \' W7 l+ o, r$ O9 W1 H% _
  128. #2 a3 T, m! h- g
  129. #------------------------------------------------------------------------------#0 \3 [) N3 ~1 P3 f6 E! C
  130.     C$ Q% j" D1 q8 `
  131. #------------------------------------------------------------------------------#. M7 k9 q$ S3 X/ v  l& X! @$ r
  132. #  SCRIPT CALLS for shadow options
    : `$ D, u/ P( {2 T* ^, A2 h
  133. #------------------------------------------------------------------------------#2 n+ i0 k8 N& M: U: P
  134. #' _1 a. N  F# Z# k5 M8 v
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    & d2 ^2 p& d! U0 _/ m
  136. #                              # light source number you wish to change (for7 x- S( m; y. [, f  Y5 E: B5 ~
  137. #                              # more than one). These are reset on map change.
    ; b3 L' e6 l* p% m% U
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    $ I; m3 j. w: {
  139. #                              # This will need to be in parallel process if you, p5 M" e( i. g% q7 w
  140. #                              # want it to be a moving light.$ @) T2 r: `. e5 u
  141. #
    + ]3 Z* c6 ~! O$ l
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below! O2 d* i/ }) Q. X0 g) k; F2 \' j
  143. #
    6 g) P( c, o7 F* q6 g% Q; Z/ ?
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    9 g+ V3 H$ y( h( W
  145. #    # fade = amount shadow becomes more transparent the further away you are., C* o8 o3 V7 s' q
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    2 O3 H  ]/ _' `% |/ l  @) L
  147. #
    ( w2 r1 h7 r* d+ J$ L# {  m( k3 E* j
  148. #------------------------------------------------------------------------------#
    ; p, [5 C# C0 R! e' N  V
  149. #  EXAMPLE:
    " U+ C1 X8 K3 i0 P$ @
  150. #  shadow_options(80,10,false)    # This is the default setting.
    3 y7 O3 Y# }% H6 O0 ]: `* {, ]+ _
  151. #------------------------------------------------------------------------------#
    " |- s, O; z6 ]# ^) m- Y1 c
  152.   
    + J2 u6 j2 r' }
  153. #------------------------------------------------------------------------------#
    # h0 U8 [, c- U: H8 T4 j/ h/ E
  154. #  SCRIPT CALLS for reflect options
    : U$ C* U5 T* E  K4 a. S
  155. #------------------------------------------------------------------------------#
    ) G4 i- q; J9 K2 a- |/ m& r
  156. #1 B4 V0 e: h% Q% I5 o/ G
  157. #  reflect_options(wave_pwr)
    $ ^7 _- a2 e+ d" W
  158. #9 C4 T& n+ W& o2 ^
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    ! D- F) z% e6 k$ l$ G
  160. #
    8 B0 j7 L! K0 u0 A. D
  161. #------------------------------------------------------------------------------#( n2 L# V# P$ c7 x
  162. #  EXAMPLE:
    7 O# o; l2 H9 j7 m
  163. #  reflect_options(1) # Turn wave power to 1
    % [7 d2 p$ i5 a
  164. #------------------------------------------------------------------------------#5 P* k  T; x; Q9 z  v/ H7 p
  165.   / l& ~& ~* |( a
  166.   5 @: ^- p" l" N
  167. #------------------------------------------------------------------------------#0 A" d- M# |3 q1 K) t
  168. #  NOTETAG for ACTORS3 v' z4 y) d) _1 e; Q* c
  169. #------------------------------------------------------------------------------#
    % V; X# c0 M  o# ?$ e
  170. #
    8 l7 S% X, J# A) u) Q/ B4 l
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
      a8 G! \2 r5 J1 @+ u* J) v/ \
  172. #1 h, I2 t5 Q% _6 ^( J& Y$ Z
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections6 D) s3 D2 C" D8 r# K) f* B
  174. #                                  # and use the character in position 'pos'
    % h2 h; [. P0 n' T0 B
  175. #- a: C; k  i1 w5 N3 P; N
  176. #------------------------------------------------------------------------------#; M  M& Q5 t' f  A
  177. #  EXAMPLES:0 c- j$ i# H! t$ s) W
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset; t4 L: D5 @9 {2 d8 d$ N: a% q
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
      l5 h' r5 Y& Z) a$ I2 J8 s/ c- `
  180. #------------------------------------------------------------------------------#
    ; @; |" ^' v# N/ z& Y' T
  181.   4 T. H" v# j( |) u6 z
  182.   
    ; K% u" }; p1 q4 E; O  I
  183. ($imported ||= {})["Galv_Character_Effects"] = true/ Q- U! a% L7 j4 ^( t7 z
  184. module Galv_CEffects4 W$ S3 O7 ?9 l+ Z
  185.   1 Z# v$ {" n. o: x3 f
  186. #------------------------------------------------------------------------------#  & Z+ ?5 }' }7 u( F+ @  N
  187. #  SETUP OPTIONS
    . o+ q( g  s, E: ~
  188. #------------------------------------------------------------------------------#
    9 \/ _9 C/ {5 s4 t! a
  189.   
    5 F7 |# n5 a. l- R0 n0 I
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    / V( ^% P0 U$ r5 }
  191.                         # region on the wall you want to make reflective (and) M9 [, |: f+ T" E. E' Q
  192.                         # then use tiles/mapping that make the parallax visible)
    ! Y* C  `0 R+ E" a; f2 z- H
  193.   
    4 c8 R7 N/ Z+ P$ ~0 w3 e
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    ( o9 }* d7 u/ `; ^
  195.     " G; v9 e0 `$ V$ ^
  196.   REFLECT_Z = -10       # Z level of reflections6 Y( |: i" s! g, i
  197.   SHADOW_Z = 0          # Z level of shadows
    " |5 l, h- T4 I
  198.   1 u- c* Q5 F  j
  199. #------------------------------------------------------------------------------#  
    & B! k: C  N5 X+ u0 ?+ h
  200. #  END SETUP OPTIONS
    1 H2 g' [! Y7 {- l8 P9 G
  201. #------------------------------------------------------------------------------#% l3 l& H& _4 t% K4 I0 q* W) x2 C$ m. \
  202. end
    & v) ^$ O3 B/ x  ~
  203.   
    3 L! L* ?( T0 R8 l
  204.   * x9 @# h4 @6 H* l

  205. ; r) w: a; {  j7 i' a$ D
  206. & E& w5 }4 I; O4 J
  207. class Game_Map
    ! Q5 c, P$ I2 @0 d/ s
  208.   def do_icons(refresh = true), C3 I! H4 y/ ^
  209.     @events.values.each { |e|
    4 y4 B4 O6 k% Y8 u
  210.       next if !e.list1 y( x: X$ O2 q7 a6 B8 _2 P* X. h
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/% J& z# h9 l" |8 e% x
  212.         e.icon = $1.to_i: z# T2 H4 o: s2 K: `& F6 D6 m
  213.         e.icon_offset = [$2.to_i,$3.to_i]% Z/ ?3 S+ \# Y# k1 v
  214.       else
    ! `) j( g# r& l% J6 B. Y
  215.         e.icon = 0
    ; {* X/ T- d8 @% D
  216.         e.icon_offset = [0,0]
    2 k2 Y- }7 P! y6 W. o" c3 W
  217.       end
    5 T- F! m9 B3 r6 o
  218.     }! |0 }; ]5 @9 @. p  {  E
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    ( A* ^" i2 j0 O: z& s5 b9 P
  220.   end: p1 X3 M7 T* N& u- w  V  ]
  221.    5 P4 }# T8 ~6 k; B$ V" n8 v; B4 R
  222.    
    5 F  k$ C7 F1 D% h$ l2 k; j. q
  223.   def do_shadows(refresh = true); m* \4 l$ B6 t* j
  224.     @events.values.each { |e|" q( n% r$ ~5 l0 q  T8 n3 l
  225.       next if !e.list1 P5 g  e9 Z, f+ _3 X# Z! B
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/3 q) n6 ^" \7 f' G! ]
  227.         e.shadow = true
    8 G: l/ q; g" }, Y+ D$ m
  228.       else# t' Y2 O+ y% h! W4 k, O
  229.         e.shadow = false! g2 v' |! a& d
  230.       end8 Q1 `0 w( X# b/ ^) L  k6 p" R
  231.     }
    % c' z/ k. V2 u# F6 J7 L
  232.     SceneManager.scene.spriteset.refresh_effects if refresh- M' p% |$ _* [) c% s5 Y) y+ a: ~- S
  233.   end
    % J1 h9 R1 g" y% P& r) @
  234.    
    ' l' v" p. ^! y. S) U
  235.   def do_reflects(refresh = true)& h' h: N" @$ I: E
  236.     @events.values.each { |e|
    8 ?% _: A) }. a  L5 y! Z( p
  237.       next if !e.list
    / L/ T3 x+ \. q; @5 Z' a
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>// a, P; b7 O8 c3 P
  239.         e.reflect = true5 c- w. z' _- j7 b+ j% x
  240.       else
    4 u9 v; V2 p4 U: O# H0 E% _# `! f
  241.         e.reflect = false
    % O, }! Q* c3 h* G' c/ u( D: n* n- H
  242.       end
    ! ]+ I7 V2 W4 C0 x0 ^. ~$ }
  243.     }' v  i. E; O, O) k
  244.     SceneManager.scene.spriteset.refresh_effects if refresh$ d0 e" i* ]6 i( Z& A* M
  245.   end( L9 z" I2 x" d! P$ N4 u
  246.    
    4 S+ }2 E( e, R+ g8 E8 d* V
  247.   def do_all_chareffects( L! ~% G. G6 m0 A
  248.     do_icons(false)
    # [: U4 [0 U* m' g% M( g
  249.     do_shadows(false)& m' ?% [- T. u+ K3 g$ u8 W4 h
  250.     do_reflects(false)7 Y  A$ k3 S8 g2 E# R9 j( `- ]
  251.   end
    5 P5 g) U( P  K" q  |: E, ^- U
  252.    ) @% b) T; B& @& E$ ^* I* b- C5 M& Z
  253. end # Game_Map
    ) D0 F: ?2 `/ b1 ]" c" M  q, Q* b3 X

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-4-5 01:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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