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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
3 E  G$ f1 W6 g& J& {. O& f
这个代码怎么用啊,有大神知道吗。我从国外找的。0 z9 ~% t% G" B! m8 g( B
http://galvs-scripts.com/2013/02/21/character-effects/( U9 ^- ]; x" q' a
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    % Z7 T  Z* b: V- Y% {; q! D
  2. #  Galv's Character Effects
    ! F& ^  v3 `4 @7 h
  3. #------------------------------------------------------------------------------#
    ) c0 \7 X# U% b
  4. #  For: RPGMAKER VX ACE: {1 x% I. R6 G
  5. #  Version 2.1( z5 U. k, _  D. d6 ~# C
  6. #------------------------------------------------------------------------------#! {4 ?2 S7 k# D, T/ W% }4 a
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows! N3 O1 H  S' c8 F
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects" }" w: s: s0 z& l' A
  9. #                           - Fixed shadow facing bug
    2 `- c8 A  W2 V/ W" E# @4 p' E4 b1 w
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows/ q4 \7 V8 |6 J0 G& o. w
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    ! J$ j& r) S; c6 O* @4 ^
  12. #  2013-02-22 - Version 1.7 - bug fixes
    , G/ l4 b3 V" I  x* T9 g' S, j
  13. #  2013-02-22 - Version 1.6 - added icon effect8 n4 ?" U8 T2 f& Q2 a
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps5 C7 J! [% O: `
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    + r  E) B5 E# n, S; k
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    - ?1 M% z+ B- X0 Z% u4 S* U  Q
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    + P2 E+ X2 M: e% E* }# A$ ]+ D+ N1 \
  18. #  2013-02-21 - Version 1.1 - updated flicker effect3 A9 G3 O5 B+ V' {7 B3 @7 R, i
  19. #  2013-02-21 - Version 1.0 - release
    5 |, P6 N' A+ E6 m
  20. #------------------------------------------------------------------------------#
    2 k4 b$ j8 r, W: `0 ^
  21. #  This script was made to provide some additional effects for characters such7 W5 F2 w7 i) t+ z# V0 b
  22. #  as events, followers and the player on the map.3 [2 }' n5 C4 n: z2 z4 P
  23. #  Currently it includes:9 c  U$ {* c4 G
  24. #; R  s( p. V( S) ]  X: V+ x
  25. #  Shadows
    8 @" I& V  V* W( z. E5 |6 A, q
  26. #  Shadows that appear under player and events in a directions depending on* }. e5 b" o. |2 J
  27. #  a light source that you choose.. G+ r3 S2 n/ U3 t/ T$ O8 m
  28. ## I) l' \3 r0 m9 ?! X
  29. #  Parallax Reflect4 k9 R* q3 u8 D3 Z& {% D$ c
  30. #  Reflections that appear on the parallax layer for events and actors to be
      y; ?& D1 i* b0 U
  31. #  used for things like reflections in the water or glass floor etc. To get  ^4 @! N9 q: g# Q) s5 W
  32. #  effects like the demo, you need to edit the charset graphic to make the water- ?: f/ z+ T/ h$ i
  33. #  partially transparent.# H7 Q, ^" p" P2 s
  34. #6 x1 e& X. e8 \! E. n) _  m
  35. #  Parallax Mirrors
    # d, t( O" o; P
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    ; x& f! a1 I2 v* A$ H9 O
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    6 C4 w  @+ P, c5 J8 e. S
  38. #  changed so actors and events can use different charsets for their reflections
    ' e4 f2 P' ^: b0 H. ~/ m9 q
  39. #; Y  p% g1 Z& \6 S1 x" J  j
  40. #------------------------------------------------------------------------------#
    ) h  H- n+ t# [2 ?" N
  41.   2 ^: Y/ ]( \# l7 y. q8 L8 A

  42. 2 Z) c4 y& ], n7 N/ ]
  43. #------------------------------------------------------------------------------## T+ I, [, o9 F; Y  G" m
  44. #  NEW - First event command as a COMMENT. D7 R5 m& {: Q) A2 u$ W
  45. #------------------------------------------------------------------------------#2 L: a  g( S6 t0 I. J) b# g/ i
  46. #  You can add a comment as the first event command on an event page to set if
    4 n- ^* T: ?, k! @* V
  47. #  that event has an icon, shadow or reflection active. The tags to use are6 s, N0 @2 ~# M3 P8 a" u& W
  48. #  below, all must be on the same line in the comment.
    " F, m: o/ @, q: H8 }# n" P3 E
  49. #
    9 C9 s* Z% l4 Z
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)1 S( }% u: H' T& a4 L4 G' s$ }
  51. # <shadow>           # set the event to display a shadow
    $ t( k: }0 e7 q8 W  Z7 P% V. u8 H$ t- T
  52. # <reflect>          # set the event to display reflections+ Q4 Z5 V* o, k
  53. #; z3 _3 x0 _! V' Z$ v
  54. #------------------------------------------------------------------------------#
    : A& u& B) @" ^& E% y3 f% f$ v
  55. #  EXAMPLE:( S+ B, g/ _6 p; T+ v5 V' a
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    7 t2 i, T/ r% ^2 {  P' `8 L
  57. #------------------------------------------------------------------------------#5 c0 @  [1 S2 \; b" F6 S
  58. / P2 v/ o" ]7 Q( Z

  59. 7 M' U! |  B/ e/ x1 K2 \, K9 k
  60. #------------------------------------------------------------------------------#) e7 c4 o$ M9 ~) p+ ~
  61. #  SCRIPT CALLS:
    ) j4 E( l" p- ?% _& g  P/ o/ A+ r7 U
  62. #------------------------------------------------------------------------------#; q$ }7 f/ `% W9 v
  63. #9 c7 B- B+ I5 D% I
  64. #  char_effects(x,x,x,status)5 _' J/ m/ K+ _7 G, c
  65. #
    5 a$ }( p) O7 ^3 |2 W
  66. #------------------------------------------------------------------------------#7 G  K# U+ V% ~( q0 x) ]- n
  67. #  # each effect can be true or false to enable/disable them during the game., L1 o: V: F0 k' c
  68. #  # you can change multiples of effects at once, x being the effect number
    6 Y) B/ ~  {/ s, [. L# s+ w
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    # d# F; r! _5 `3 R, I& B
  70. #------------------------------------------------------------------------------#
    ; Q9 u' ^: \  V7 ^, R8 H! f7 U3 l$ a
  71. #  EXAMPLES:  h2 ^$ b, X. C
  72. #  char_effects(0,true)              # turn reflections on0 K+ h& j* h8 K7 S( Q
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
      O! N0 u; ]9 ^/ F2 L. c
  74. #  char_effects(1,3,false)           # turn shadows and icons off$ m8 n. R5 z! C! N# S
  75. #------------------------------------------------------------------------------#
    : i+ N6 }8 R7 y2 q$ M( y' z, w
  76. #& J% N7 H9 I, I
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset+ f/ l- g! F9 h
  78. #7 f# G3 Q6 x3 ^; W
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset1 l- O7 s( [% i1 ~* X) F
  80. #* }1 P$ ~; f" ^) Q' t4 w" X
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    # K" D! ~7 M1 r% o
  82. #
    / G3 l* d" r% U
  83. #------------------------------------------------------------------------------#
    ) j: A- h; f4 W, {4 c0 ?
  84. #  EXAMPLES:5 A) y/ u1 U5 p
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite8 U' g1 o5 h6 H- f+ `4 _+ a" r
  86. #                                    # in position 2 of "Actor2" charset.9 N2 ^6 P& z/ @8 z$ ?
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of# o* k1 q! z1 }# A# e- @! c: |1 V
  88. #                                    # "Actor4" charset.* N6 j, |) I; L" Y* {- y1 l: V
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of- ?& l# I; u9 v! p6 @
  90. #                                    # "Vehicle" charset.
    2 a( C" {- @! J, J* V" i
  91. #------------------------------------------------------------------------------#) Y  C" h9 Q$ j! N1 a
  92.   
    7 S3 M. N  a8 J4 y
  93. #------------------------------------------------------------------------------#2 _, ]0 G/ n; Y+ }: S. U4 j2 P
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS9 ~# {( ~7 ?4 N) I
  95. #------------------------------------------------------------------------------#0 |) Q. {2 t6 ?1 e. _+ f- r1 ?
  96. #
    5 Z3 I8 x4 N- L( T
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off" Q: q. B3 h1 v$ I7 l; Q
  98. #                          # use this to specify for mirror and reflect.& \, H+ _/ c# ?
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change5 L1 I6 ?* I: |
  100. #                          # to change all events use :all' T4 k7 q7 U' }9 w- ^0 j8 H
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make: X5 b- i# v, J5 o1 \- |: w
  102. #                          # it 0 for no icon.7 M9 k$ l4 K+ X
  103. #
    9 b3 l% d& D7 E
  104. #------------------------------------------------------------------------------#$ \. i4 L$ _4 Q% c* I, Z
  105. #  EXAMPLES:8 J1 t5 u8 n% {- a
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON: I1 r0 I# ^3 a' E( b5 _
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    " d1 u, m0 Z* B) q8 B
  108. #  reflect(:all,true)      # Turn all event reflections ON9 c4 X( z1 X" n) @0 o: e
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear9 h4 ~  p/ r6 u$ d1 S7 W1 u1 p; M; ~
  110. #( r$ y* C& O4 B
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering0 v7 {! Q1 F1 t5 `! r* m  A
  112. #        a map. This is a design decision to try to keep lag to a minimum. You' P2 r  I& s+ V5 r% y* ?
  113. #        should use these effects sparingly and only activate them on events
    5 B# N# z7 l, b) c* d
  114. #        that require them.  f$ }0 g4 T7 w3 c
  115. #------------------------------------------------------------------------------#
    4 l  g. q3 r- R/ o2 y9 r% O6 R' ^
  116.   
    ' \( R. S) b1 F1 n( a, j
  117. #------------------------------------------------------------------------------#  k+ O: _; _, z- e, V& Z
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES8 o6 r* P$ U4 P) O) [( P( e
  119. #------------------------------------------------------------------------------#
    + u# N0 ]7 o9 Q8 `
  120. #  h6 E' }% F/ Z& y- g
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    , T+ D- U( a7 ?  k
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off   R0 r0 D$ W- R  H, l# C
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.7 X" j/ ^0 u. v4 `3 e' e- x
  124. #
    / H* [* o; [6 C8 |) v4 {' F
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    - Y! V$ p1 c3 U* r% c$ f- o( B) i
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
      i1 i" b+ i0 T$ f  {2 w  Y. O
  127. #  v_icon(x,x,x,icon_id)
    9 B/ `3 d- g- X2 ^1 v0 r+ r0 k8 |! q2 w( j
  128. #
    8 }) `+ o4 v) e
  129. #------------------------------------------------------------------------------#+ ]; }& y" |) L4 T0 B
  130.   
    ; t' V; _' r( l  K) @3 F$ P, ~
  131. #------------------------------------------------------------------------------#1 _; A. v8 o% H" a
  132. #  SCRIPT CALLS for shadow options
    0 z6 X% h3 i8 s3 G' e
  133. #------------------------------------------------------------------------------#
    3 J$ Y" P' T$ I- h
  134. #, x1 D% O1 ^2 ~& z
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 2 S! q: N9 \4 F( U  O- p
  136. #                              # light source number you wish to change (for
      |+ ~/ _1 E. B' t7 z: _
  137. #                              # more than one). These are reset on map change.
    * S* W/ d5 D0 S
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.7 Z, r' B( @  o5 R' J
  139. #                              # This will need to be in parallel process if you5 N1 h, Q# Y7 k4 o* d
  140. #                              # want it to be a moving light./ Q5 x; [) R# C1 C
  141. #
    ' N! o  D! ?% `4 b" ^# \  d
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    8 k! W0 y' z8 Y
  143. #
    " ~6 W1 B& {2 c8 p! H6 ~6 r+ {
  144. #    # intensity = opacity when standing next to the light source (255 is black)) p4 i! ]2 J$ {! C4 C
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    6 Z$ T! A2 N$ i* w0 ~4 g8 x+ h" g
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.% p( w  j/ r8 E  I  X
  147. #0 o; W# u* {# C9 M
  148. #------------------------------------------------------------------------------## l  ?+ k# I% R4 F$ ?5 I. L: S
  149. #  EXAMPLE:
    * A1 p1 S" P) d1 A  d
  150. #  shadow_options(80,10,false)    # This is the default setting.
      R  e0 @( K0 b/ h8 U( R# t* x
  151. #------------------------------------------------------------------------------#" T& J4 J% ]2 F2 E' P" ]* W5 y
  152.   
    / k5 Q, A, d, t( J$ S" n; q- @' X
  153. #------------------------------------------------------------------------------#
    5 S( q  `) j5 |4 v. B+ a5 Q8 p
  154. #  SCRIPT CALLS for reflect options& H' `- a+ q: g0 i# G% N1 H
  155. #------------------------------------------------------------------------------#- f. a$ p& K$ H, |4 u! K/ N# r
  156. #* h8 e( ]/ ^/ a! B9 _0 G8 ~# Y$ n
  157. #  reflect_options(wave_pwr)
    ( i; t) A) s' i0 T
  158. ## k! X3 l7 h  r5 B  H) _
  159. #    # wave_pwr = how strong the wave movement is. 0 is off/ T2 }* l% B0 T! W+ d* H) `- H
  160. #" H( l* q0 m: h6 B9 _, e
  161. #------------------------------------------------------------------------------#
    7 u* o3 e  a5 @0 X
  162. #  EXAMPLE:! d; Q# t& P7 y
  163. #  reflect_options(1) # Turn wave power to 1
    0 A5 J% c) N7 i. r6 D
  164. #------------------------------------------------------------------------------#7 ?& L: U9 R! t
  165.     K- _% x$ ]/ U, O
  166.     s/ D& z9 ?4 p6 I8 f+ t
  167. #------------------------------------------------------------------------------#
    6 G. I4 J5 C$ Q- _% h/ F+ K
  168. #  NOTETAG for ACTORS
    ( o# Q4 I: T& c7 B0 [; c7 A. v
  169. #------------------------------------------------------------------------------#* h. N% ]) h7 `! q4 }6 L- s8 b
  170. #& I. C/ x8 J- B2 o+ b# }
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    8 |$ n; G/ ?& G9 Q# F
  172. #2 i8 j$ W1 M0 m0 Q4 m6 W) F
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections; S6 P& X( T( s6 m
  174. #                                  # and use the character in position 'pos'
      z4 a1 Q1 E) {5 o3 X) T( x7 J
  175. #
    " H3 `! y8 a; x4 C6 s
  176. #------------------------------------------------------------------------------#
    " L# O0 ?9 g2 C4 G- P
  177. #  EXAMPLES:
    ) X$ p) e# [4 n4 h
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    8 l+ W- O1 Q8 ]6 J% x+ n6 y& j
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    0 O+ n- Z9 D! {
  180. #------------------------------------------------------------------------------#
    / F8 b% C7 q! {6 E
  181.   
    , F1 m# }  ~/ P2 j2 v7 P9 I
  182.   
    ! H' n, T2 B3 G7 l- y( e
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    - ]$ O- c0 }: G
  184. module Galv_CEffects* V) f5 {3 D) A) K" W2 z
  185.   
    $ ~' x& o& D( y; j
  186. #------------------------------------------------------------------------------#  
    & G% t9 x. @- [& y0 Z) r
  187. #  SETUP OPTIONS! q# V2 X; F! I  l4 M8 [
  188. #------------------------------------------------------------------------------#
    8 Q. N) L+ f: ^5 F
  189.   
    * B1 i2 q' D) Q  A0 i, k$ D
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    ' W2 g6 _$ v7 v/ o9 q9 ^# X
  191.                         # region on the wall you want to make reflective (and
    % B8 {. {" l' q4 C: T/ O& S6 A
  192.                         # then use tiles/mapping that make the parallax visible)* \& h) m1 z0 @% e2 Z
  193.   1 S+ b+ w  k/ `5 u7 j
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    & d7 H/ k0 r- p
  195.    
    " Z6 q* V- a. @& l
  196.   REFLECT_Z = -10       # Z level of reflections% y0 l. l; Q+ I, K$ s2 J; Y
  197.   SHADOW_Z = 0          # Z level of shadows% ^* y% l, a- E
  198.   ! F) }. m) m3 a3 L8 K2 M
  199. #------------------------------------------------------------------------------#  ; J  z9 X: M! c# C8 N
  200. #  END SETUP OPTIONS- x3 F+ p0 `  L& c
  201. #------------------------------------------------------------------------------#0 _3 B+ U% F9 w- d% m# p+ ^6 `/ M
  202. end
    - d! m* Q& Q: E5 D; r* C
  203.   
    * r% L, k7 J6 h5 X
  204.   
    : K* r  a6 g4 G/ Q# q+ j! E. o2 {
  205. 1 z! ]; ?! V6 A& f6 p

  206. 9 ]* N4 Y* V) |
  207. class Game_Map
    . s4 c. ^+ Z# O* p3 q/ E, W/ y
  208.   def do_icons(refresh = true)
    , A) L9 n' M9 a! J" h- [
  209.     @events.values.each { |e|
    - Q: G5 t& t+ R" \
  210.       next if !e.list
    ) h; }* m! t: b
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    / A' z" T1 I6 e. m
  212.         e.icon = $1.to_i- @! R* h9 f2 G1 A) \
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    , ]. L& u6 d2 q+ m
  214.       else
    " U3 _( b' S# |1 d" a- D6 `1 k
  215.         e.icon = 0/ @+ z) T' d4 |  p9 x
  216.         e.icon_offset = [0,0]' i0 L" R$ K1 G( K6 R6 H! B3 U! [) O! u
  217.       end
    , S6 q4 n& b1 ~! }( d
  218.     }* @! m+ q# ^8 m' t/ K
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    ) l6 Q8 [& ^( b
  220.   end) h7 w/ _% X& Z/ K" \
  221.    
    : }; L' }0 u- J. |. j) K
  222.    
    " @7 j& K8 t1 ^" a" V
  223.   def do_shadows(refresh = true)
    ) U" k/ U4 f6 `7 ^) V1 N
  224.     @events.values.each { |e|
    : j! `+ v. w% Q& f% I8 p
  225.       next if !e.list
    + }( k, X' h! K, k8 H
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/, W2 E+ {, q  f4 b7 R
  227.         e.shadow = true/ \3 p$ K8 ]: Z
  228.       else
    : h6 D, K% C, C( h; v' A
  229.         e.shadow = false: W- X8 \- \1 v- y3 g) F
  230.       end, W; d' G; O) W3 N
  231.     }
    , M, Z7 L% k+ ~) T7 r
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    , c& V5 d+ R  a' i3 F4 n" E
  233.   end
    * T* f- f3 B7 k7 i; |4 c
  234.    , }; E! c6 v  @( r9 D! H
  235.   def do_reflects(refresh = true); d6 _: a9 e" |" j. Y5 y) a
  236.     @events.values.each { |e|
    $ L6 r2 ]: R) g/ K/ m! H
  237.       next if !e.list  V( c4 I  ^8 l1 K6 i  s! A
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    0 O- q, x- ]; z& ~9 y
  239.         e.reflect = true; G5 ?' j- I3 e7 B: {! H
  240.       else
    ( I+ y5 n% t2 a" u: J! |5 ]
  241.         e.reflect = false  ?) H* Q& w/ G( a0 f3 N
  242.       end
    $ Q; P& k' i& g  P, l. [/ Q) Z- I* R6 u/ l
  243.     }
    8 k: u2 l' ]) v( p) m
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    6 Q( @" r* U  r# T: V
  245.   end
    & h; s( D5 u& n3 J2 ?5 r
  246.    ; A/ P9 c: e1 i6 i1 T6 u
  247.   def do_all_chareffects4 ]9 i/ e, ^4 L2 h! Z3 T
  248.     do_icons(false)2 Z4 t7 k- p2 Y+ u/ v
  249.     do_shadows(false)
    , g* u+ y) M5 Y: _
  250.     do_reflects(false)
    . t# L! l% H) a) I3 O2 K
  251.   end
    ( k( p7 Q) D" N' W3 l7 z
  252.    9 o3 n8 k( N" o& ~* z# u5 a1 h
  253. end # Game_Map
    7 F4 G& [! s. I. J
  254. 5 [, ]5 H4 T4 f. a# ?$ [- M

  255. / O5 A! E. Y7 J, ~

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2026-7-26 12:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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