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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  
7 Y( H, Q- s" G/ N* [, x
这个代码怎么用啊,有大神知道吗。我从国外找的。* ~& K  \- ^4 y; ^  L) k9 Z7 Z' u
http://galvs-scripts.com/2013/02/21/character-effects/
8 U0 c7 }* |& |0 h' O8 j9 G9 o4 A9 Z是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
3
 楼主| 发表于 2014-6-25 11:35:49 | 只看该作者
记得口袋妖怪的池塘是有倒影的
回复 支持 反对

使用道具 举报

梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#3 H4 U- ^3 t7 M- {" {6 k$ t
  2. #  Galv's Character Effects
    4 d- K5 H- B7 Y/ `4 X& H$ W, K: w
  3. #------------------------------------------------------------------------------#
    ; _, O* `/ I1 S, f! s  F
  4. #  For: RPGMAKER VX ACE
    ; I. }) c/ x6 o7 @
  5. #  Version 2.1
    ( C$ c% ]! |% Q  a- E) @2 c
  6. #------------------------------------------------------------------------------#8 ~* T6 a" P8 [" D9 P/ |3 v
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    * D. ]6 W! o/ h% M9 S0 R4 ]8 q
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    6 ~8 [' _. ?8 @' Q. j
  9. #                           - Fixed shadow facing bug: X- }1 e) I, _) L' y$ c! ?9 Y
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows# a4 q+ R4 Z4 v" y( z
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    ) t* b: h; [" m! l1 n# y
  12. #  2013-02-22 - Version 1.7 - bug fixes7 D% x+ \; J: W
  13. #  2013-02-22 - Version 1.6 - added icon effect# D/ W: R9 L7 ^. w
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    8 u$ _! U( P5 v4 x. K
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles4 n; K( I0 j' u6 X
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    3 f& K% h4 K% N; \, H3 a* ^6 W
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)3 f" J$ F1 E* W, }7 o& y4 l
  18. #  2013-02-21 - Version 1.1 - updated flicker effect; a+ U% l2 {0 ~. n5 `
  19. #  2013-02-21 - Version 1.0 - release
    & F8 y5 ]: V0 D/ a9 ?3 a  \) u) o! E
  20. #------------------------------------------------------------------------------#
    $ {1 P0 q' d% W( w- r, P
  21. #  This script was made to provide some additional effects for characters such) C& A0 @" |4 K
  22. #  as events, followers and the player on the map.9 |( p# k" z3 Q, S
  23. #  Currently it includes:
    % B; L, U  L& ~' g
  24. #
      q/ i* W3 ]8 ^! A/ J2 t1 r* X7 w
  25. #  Shadows
    + b  o, k  h% K+ d' I
  26. #  Shadows that appear under player and events in a directions depending on# W* c* s4 t  }2 J  F/ R  A- N
  27. #  a light source that you choose.
    + M$ [; q% K- \& W( p
  28. #% h: \9 O/ I# \& ]7 H6 v6 Z: m$ b
  29. #  Parallax Reflect
    ) L* q. R! F' C/ ~* u) v
  30. #  Reflections that appear on the parallax layer for events and actors to be' \( j) `/ l& E# K& g3 t6 r; K
  31. #  used for things like reflections in the water or glass floor etc. To get
    2 v$ U; p  J) T9 s9 X* f
  32. #  effects like the demo, you need to edit the charset graphic to make the water+ R6 `' n  F& Y" O0 l' I
  33. #  partially transparent.! m; D+ A3 `0 i) W7 l& }  }. A  V
  34. #
    , A0 L8 S; l0 V
  35. #  Parallax Mirrors0 D. w; Z; u$ w! g( M
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    3 J5 O' n+ Z) q& f  g! q
  37. #  on a wall designated by a region. Both mirror and reflect effects can be7 A8 Z7 i2 v8 f: @% ~
  38. #  changed so actors and events can use different charsets for their reflections
    ) G3 O6 t$ L4 l4 Q
  39. #
    $ f  e3 g7 O% u/ p+ m4 O3 G" w, R
  40. #------------------------------------------------------------------------------#/ P5 s# @  r: g# j- q5 q  _: M. u
  41.   
    9 `% |$ J: K' {9 w' a
  42. 0 w1 d; S# ]3 v9 `# d
  43. #------------------------------------------------------------------------------#
    ' L; v8 q6 l/ @7 }) |/ @
  44. #  NEW - First event command as a COMMENT
    9 @3 _2 [. r' z5 q( r
  45. #------------------------------------------------------------------------------#! H. c7 w+ ?7 ?. N
  46. #  You can add a comment as the first event command on an event page to set if/ J. j4 i) Y# ~- i
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    5 q! [9 C! `; G. R6 C
  48. #  below, all must be on the same line in the comment.: W0 d8 m, K) ^! `
  49. #
    3 J) G8 J' X( V0 ~& u+ n" z
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    / i0 \2 N2 b' j1 I4 U2 T) b2 M
  51. # <shadow>           # set the event to display a shadow
    , N0 b  r5 D2 f# N! T
  52. # <reflect>          # set the event to display reflections8 z& }2 @* Q+ W- w
  53. #
    1 e! I" i+ A& U% t
  54. #------------------------------------------------------------------------------#
    1 y( {/ T( p9 c0 z& X, M% Y2 P
  55. #  EXAMPLE:
    + \& _9 f0 \% V3 w( H0 t2 c
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    1 ^/ T. K5 q# @7 w- `9 d
  57. #------------------------------------------------------------------------------#: R" G/ ^+ \) o4 ], w2 Y. a0 ~" i
  58. : s+ ]( @! p! _
  59. ' Z' V" ^- a: H* V) M* {
  60. #------------------------------------------------------------------------------#
    3 a, x1 X2 y2 ^4 _9 X
  61. #  SCRIPT CALLS:
    4 k/ R  B# C! J* O8 k' k
  62. #------------------------------------------------------------------------------#
    5 @- H5 a1 S% K- U
  63. #3 n1 A# D, V1 v& _( D7 R$ j# u
  64. #  char_effects(x,x,x,status)
    5 @! T; M6 X/ \$ L
  65. #
    2 v' R& q, c0 }
  66. #------------------------------------------------------------------------------#
    0 D$ K3 j. D1 W" h5 o. e! n
  67. #  # each effect can be true or false to enable/disable them during the game.8 F1 m% d) x& v: |: v" i8 t
  68. #  # you can change multiples of effects at once, x being the effect number4 F  c3 G2 u0 V- J, ^7 A
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons/ y8 D2 ~% y% g- O( S/ X
  70. #------------------------------------------------------------------------------#
    " W% r4 g4 l6 f( O' \
  71. #  EXAMPLES:
    ' L; Y. T" _' b% y' l  ?
  72. #  char_effects(0,true)              # turn reflections on' p3 Z( l6 ^- c- ^1 h% c' n' ^5 w
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    ( }' V. p" ~. T( X# \, c! v
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    + N3 S$ C( v6 E* n3 V0 O2 @
  75. #------------------------------------------------------------------------------#
    1 c. y8 [. {0 G& R/ Y4 P  |
  76. #
    * [3 }; p$ u8 t7 a/ x) R
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset- A% f" d" V  k1 x0 W0 p
  78. #! v- X/ i5 {4 b8 I
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset+ O' B% |& e) X$ g, H, E8 D# h2 o
  80. #
    # U! W$ G4 ?) X0 s1 H
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset6 {& n( _' L: T
  82. #
    ) p4 Q, ~1 D& f+ `
  83. #------------------------------------------------------------------------------#
    : {- \4 W. \. S3 G  W6 V* \4 j2 f
  84. #  EXAMPLES:
    : m* j, V# v! {" _% I. {
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite( q1 _0 A0 X1 k7 J3 w
  86. #                                    # in position 2 of "Actor2" charset.! b! F9 q7 D0 q4 S6 U# [2 ?0 g
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    6 P" W$ w6 Z) \0 N* C; r: S
  88. #                                    # "Actor4" charset.
    ( l/ g$ u7 R, ^/ k! t: E0 \
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of6 O4 ~2 t: D" {+ ~
  90. #                                    # "Vehicle" charset.
    7 D# Y; F$ _* D, ]0 z! B
  91. #------------------------------------------------------------------------------#, r# m* R6 o5 F! K+ E. P
  92.   ! W% Z- A2 t1 x8 u
  93. #------------------------------------------------------------------------------#, @& S+ Q0 {" N
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    9 z2 p7 W+ d) i3 @; f# S7 j; x
  95. #------------------------------------------------------------------------------#
    ! o% ~. q1 j+ B# o* u
  96. #
    + q! l7 }* v* ~8 I7 R
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    * Y/ E" [: |9 _9 g! m! r
  98. #                          # use this to specify for mirror and reflect.
    ! L6 u1 t/ y3 S4 j+ j: e2 S
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change& \+ g1 Z6 f" G! P, L2 H! d; R1 X; b
  100. #                          # to change all events use :all7 G0 W5 ]- c* {( o! c+ E0 K" T, G
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    9 t! g. B$ A4 j2 Q
  102. #                          # it 0 for no icon.
    ) z$ z" O, p- `$ D* H! j( t
  103. #  i5 N, I, i+ c% G
  104. #------------------------------------------------------------------------------#$ e- _7 i" \1 i1 [
  105. #  EXAMPLES:- w* Q( |0 c( K' n% G2 ?$ v& C3 L
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    * l4 K) M" X6 e! S% \
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    ' b; @6 L: u2 L' _0 z, f
  108. #  reflect(:all,true)      # Turn all event reflections ON
    # i4 g2 _+ \$ u' p/ K9 A
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear$ ~1 q- @% V8 n( d7 M
  110. #) v, E4 o' O( O# A$ q
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering/ g! A6 V8 l2 ^. p
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    ' K; s  E3 E; S( v7 w1 G
  113. #        should use these effects sparingly and only activate them on events
    ( `& h2 z* f" H3 @! i. P
  114. #        that require them.
    2 g' Z4 Q9 x# [+ L* G
  115. #------------------------------------------------------------------------------#
    6 W  @% N4 r0 ?/ c" s
  116.   
    7 b4 ]1 `% {9 v% y) I7 y  h
  117. #------------------------------------------------------------------------------#5 X! g+ @5 @" d
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    ' e4 j( X" V: I: W" }( T
  119. #------------------------------------------------------------------------------#
    4 r3 O# J; l- h( [* r
  120. #
    3 b/ Y: a" `3 b0 F! K
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default ' W6 @: J4 v# i$ g7 [
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 9 w: P5 j  B: x9 B
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    1 g  H* P+ I8 Q
  124. #0 w9 o5 q) n% V4 ]
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
      V3 c/ x& _& ?) U/ Z$ ~
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    ( y5 j- E7 q. o1 V/ C0 W4 N& {* ?( n
  127. #  v_icon(x,x,x,icon_id); E1 Y) T3 e' S) S
  128. #
    0 ^7 h+ w& y! x* M; Z5 l9 G! m
  129. #------------------------------------------------------------------------------#
    / q8 j1 F" f: j  d0 d
  130.   0 |( z/ V% _8 h
  131. #------------------------------------------------------------------------------#
    9 b$ F  P* q9 \0 k+ w; j6 E
  132. #  SCRIPT CALLS for shadow options% f! n% L# t! x! o: A  T% [% u$ G
  133. #------------------------------------------------------------------------------#1 n, i# q2 y& l9 w8 n% c- t
  134. #
      D0 N" y$ q$ B2 b0 W" f
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 8 n! u4 k( c' V: M1 i
  136. #                              # light source number you wish to change (for) k4 I( h$ T: m) N% e" h
  137. #                              # more than one). These are reset on map change.3 Y6 S8 e$ q( O& S2 [
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    6 _8 c0 o2 l2 \& L. k# L2 }
  139. #                              # This will need to be in parallel process if you
    $ v% v, v! c- O: `, F
  140. #                              # want it to be a moving light.5 E% {: T. S. t# Y, _; `3 K
  141. #3 v8 l, C1 @" d- D9 I! g3 `0 p  ?2 a
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below$ _# @3 v9 e! t/ _' x1 S
  143. #, l) y7 u5 u% P+ W  r
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    4 j/ O' D2 y4 K5 [7 ?1 s
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    0 K: u4 e' A* O; W, u
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    4 r. R- S2 U. S
  147. #! R$ x& w4 ?( F8 w+ w7 P, g# j. D
  148. #------------------------------------------------------------------------------#
    - i' K' d! b& n
  149. #  EXAMPLE:0 v* [: ]1 ~: e" o! `) N  ~# e/ V" _
  150. #  shadow_options(80,10,false)    # This is the default setting.5 W3 I/ _1 Z# z. _' n* s
  151. #------------------------------------------------------------------------------#
    # `, x# h+ s' d, A8 k
  152.   8 C' P" W3 B" [
  153. #------------------------------------------------------------------------------#0 F) D" ?6 x" o9 [6 a" o$ h$ T
  154. #  SCRIPT CALLS for reflect options
    0 q  t6 x# \3 i1 c
  155. #------------------------------------------------------------------------------#3 y8 e! m) {0 B; t
  156. #
    , P0 S8 W+ a- d: R% x
  157. #  reflect_options(wave_pwr)
    5 Z! E' _1 ^  Y* g+ l& f
  158. #
    ' g. T# A# j* `: _
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    3 g/ @/ |/ w# d* G% k+ E1 S
  160. #+ q8 T# ^7 e2 [5 y( W* ]$ D/ ^
  161. #------------------------------------------------------------------------------#
    5 @2 z/ N3 H: \" N* r
  162. #  EXAMPLE:! `4 w' A4 C- R" W$ x  Y7 K/ M, h4 L
  163. #  reflect_options(1) # Turn wave power to 1
    / w& Y6 x; v0 p! E
  164. #------------------------------------------------------------------------------#0 T1 d! \, A* u/ u. L3 n+ }
  165.   - q- {9 D! K, G& |, H
  166.   
    - B( j% B6 l" [& L& k" Q; Z/ q/ b
  167. #------------------------------------------------------------------------------#( ^7 p+ i& F8 V3 c
  168. #  NOTETAG for ACTORS  S4 U# a1 }. Q
  169. #------------------------------------------------------------------------------#
    1 c7 X" X0 }/ l4 l2 j! i
  170. #
    5 ?" I# y) }  Q
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)" J4 b: G4 }- u
  172. #  c, V$ T6 v$ J. C
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections9 P- j/ Y% d) h( D, X
  174. #                                  # and use the character in position 'pos'
    7 C! _1 ~/ s, `0 I
  175. #
    8 b; y6 r$ @5 h2 a8 {
  176. #------------------------------------------------------------------------------#
    6 b% S$ {9 o' y
  177. #  EXAMPLES:9 p4 B' L& M" p) ]# g& V: D9 a1 e
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    2 e) G' e& Z/ |4 \, C/ ?2 a+ L+ n
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset" I4 o$ O+ q* D1 F
  180. #------------------------------------------------------------------------------#
    1 p4 C% H- Y3 p+ G
  181.   ( O1 b4 v  @8 Y/ P) e
  182.   
    : \) i* d. R' ^. C% r
  183. ($imported ||= {})["Galv_Character_Effects"] = true3 {& h2 o- T: z, ]! r
  184. module Galv_CEffects) c% s/ W( c. I1 P8 U
  185.   
    - C- H) U9 J1 w) d. X5 p' m
  186. #------------------------------------------------------------------------------#  
    ( I# z+ u, \- O. V% G+ y
  187. #  SETUP OPTIONS( e$ o, i7 G: ]: S5 ^: v1 L/ Z
  188. #------------------------------------------------------------------------------#' W7 q) W- X( h0 A3 G& C7 f& e
  189.   
    9 d$ z' b, h7 u8 d4 ~
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the' V# k% O9 f' w
  191.                         # region on the wall you want to make reflective (and
    : e$ |- i- a3 d$ j: o9 z
  192.                         # then use tiles/mapping that make the parallax visible)
    , t# y. U8 ~8 h8 J: W& E/ n
  193.   1 _9 c9 J" \5 x0 ~- A$ l# d; H
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters& x" w$ ^3 J/ R  K. v' z/ P
  195.     ! p: A3 `5 ~2 P7 |
  196.   REFLECT_Z = -10       # Z level of reflections
    2 U: d, p8 Z: Z: U  e
  197.   SHADOW_Z = 0          # Z level of shadows# |+ t0 O2 |0 t1 s+ e6 o1 N: W2 Z
  198.   
    8 Z$ z2 s% ]7 ?3 X% f
  199. #------------------------------------------------------------------------------#  
    7 z1 i9 ?: P& Q! n# O4 @$ I1 {
  200. #  END SETUP OPTIONS, d9 |. M, u" c# r. D9 I
  201. #------------------------------------------------------------------------------#
    0 Q) E; c% d# D' n* J
  202. end
    , X2 k) D" N# O0 K
  203.   8 o9 J/ w% z, I
  204.   0 X9 n/ F! Y1 e: \
  205. 8 o* p- o& {% Q. L

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

使用道具 举报

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

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

GMT+8, 2024-11-23 00:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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