| 赞 | 0 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 1 |
| 经验 | 1673 |
| 最后登录 | 2016-3-27 |
| 在线时间 | 21 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 21 小时
- 注册时间
- 2014-6-25
- 帖子
- 7
|
2楼

楼主 |
发表于 2014-6-25 11:32:43
|
只看该作者
- #------------------------------------------------------------------------------#
' a- n/ G" E! O/ M+ t1 g6 Q - # Galv's Character Effects+ F: @( w( G* [# C
- #------------------------------------------------------------------------------#: @0 n, D* {; L1 r9 w6 B
- # For: RPGMAKER VX ACE
/ {" O' V$ F2 \: u J - # Version 2.1$ d# F: q" W7 z/ b( P" Y1 C
- #------------------------------------------------------------------------------#
; F* S4 ]6 w |, V* d - # 2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows' }1 O# j8 k/ L" t
- # 2013-12-07 - Version 2.0 - Added comments to more easily add event effects' W; C ~7 r: } s' u2 J
- # - Fixed shadow facing bug
, Q3 a' C0 e, x - # 2013-02-24 - Version 1.9 - added z level option for reflection and shadows
: T3 `8 t. F7 E! l- Q8 C5 x# D7 L - # 2013-02-23 - Version 1.8 - added multiple light sources for shadows
* N# I6 q6 u& a7 I - # 2013-02-22 - Version 1.7 - bug fixes
5 ~% O1 w- |% H' N" U% \* \( ` - # 2013-02-22 - Version 1.6 - added icon effect
# O9 C. W9 \0 Z2 p' a6 ~ - # 2013-02-22 - Version 1.5 - fixed mirror bug on large maps7 ?& E" `& |$ F, b( W! d, @
- # 2013-02-22 - Version 1.4 - added effects to vehicles7 ~. k9 [* c6 j
- # 2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks2 u K9 ~- s, E l1 f, w% |
- # 2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
1 }% f7 w. N% y0 ? - # 2013-02-21 - Version 1.1 - updated flicker effect
4 p- D5 v9 Q0 x7 t N - # 2013-02-21 - Version 1.0 - release
; S. h \( u6 u+ M! n2 Q - #------------------------------------------------------------------------------#
: p7 ~# u" O" }" t/ `- _ - # This script was made to provide some additional effects for characters such. a1 o1 C; G2 h& W2 p( r: y* ^
- # as events, followers and the player on the map.& [, K r" x; i7 c
- # Currently it includes: X; n2 r. {" A( w7 z+ g9 l
- #6 u2 s- s' e! E9 m& O& U2 ?
- # Shadows
8 _+ a; m, i. K1 _ - # Shadows that appear under player and events in a directions depending on
' G! n4 }2 l, B q& ] - # a light source that you choose.
. L2 O. e" _8 J. N - #
8 K% a% }" p" A0 t' {$ ? - # Parallax Reflect, |8 z) b+ [$ M. j+ S8 `
- # Reflections that appear on the parallax layer for events and actors to be4 Z3 n; G6 ?% A+ ] g. u8 S
- # used for things like reflections in the water or glass floor etc. To get
# y# D) ^/ v" M) Z- L4 R$ q- E$ L - # effects like the demo, you need to edit the charset graphic to make the water
, p0 a! b* E5 m, }* [! L2 q - # partially transparent.
; F" O$ V- P; m3 M$ h o - #( x7 G9 L8 Z' W: G$ I8 y* ?) X6 B
- # Parallax Mirrors2 o, C& ~9 c! S J8 U
- # Much like reflect but are instead actors and event are reflected in a mirror, b& e4 r2 p5 V7 m7 ?9 v# ?. k/ \
- # on a wall designated by a region. Both mirror and reflect effects can be
/ n, N5 R' y2 ~% O: k: w2 o - # changed so actors and events can use different charsets for their reflections
1 `3 |4 ~& t2 Y- I j& n6 y- ` - #
( Y1 O& Y& k( i - #------------------------------------------------------------------------------## ?% p: x% x4 j2 U
-
0 X3 k' \1 z" \ @7 e; w/ f - ' z r* ?+ ?2 n( }' T+ i$ G
- #------------------------------------------------------------------------------#/ l) V+ @9 w6 t
- # NEW - First event command as a COMMENT1 G) g5 [6 w- r/ [' C
- #------------------------------------------------------------------------------#
3 @# I8 w4 h. b - # You can add a comment as the first event command on an event page to set if% j( T5 N8 a2 G
- # that event has an icon, shadow or reflection active. The tags to use are
/ {6 K) M0 B9 r" _" J/ i# ^ - # below, all must be on the same line in the comment.4 {. P2 `; z6 i+ B
- #! _( H J9 K; e/ a
- # <icon:id,x,y> # set the event to display an icon (x,y position offset)0 j. Q& I; [) X$ S! T' m1 N
- # <shadow> # set the event to display a shadow- B( ]2 Y! M* T! `! R9 P, r7 m
- # <reflect> # set the event to display reflections
8 ^; h1 ?" Z; G- V; w3 j3 | - #
) l0 D0 ?* {: Q/ o2 y# W5 Y - #------------------------------------------------------------------------------#: g# s- b0 ]2 D5 ]/ z! s* s$ _4 O: Y: L
- # EXAMPLE:, R1 j% J- i* Q$ c' d. ]& z: v
- # <icon:1,0,0><shadow><reflect> # to show reflect, shadow and icon 1 on event
' P- E/ x7 |8 ?* b9 K8 T7 ^ R - #------------------------------------------------------------------------------#' m) X5 U' | w1 A8 I
-
1 z+ d2 C' x. _ - & N4 P4 T8 ?9 e2 |/ D
- #------------------------------------------------------------------------------#
! I- {% U Y' _ - # SCRIPT CALLS:
1 l; g6 ~) M: w - #------------------------------------------------------------------------------#
7 F8 E" r1 L- b, V% } - #+ ^+ ]. ~7 ]! D B- {# n4 [) r
- # char_effects(x,x,x,status)
# Q% {5 \8 d6 z7 z k9 e% O$ H! e - #
4 h" ^ K5 u3 c4 C7 M& a& S; E - #------------------------------------------------------------------------------#3 ]" O0 r7 R5 H, p& A
- # # each effect can be true or false to enable/disable them during the game.1 v2 D9 F- P! C4 Z9 y0 Q
- # # you can change multiples of effects at once, x being the effect number/ P8 u% g3 P/ l) Q/ o. W
- # # 0 = reflect 1 = shadows 2 = mirror 3 = icons
1 @& A% Z1 Z* r. s - #------------------------------------------------------------------------------#0 {& Y& _" k }$ R! v1 @
- # EXAMPLES:
" o8 ?" g+ I" S0 A$ g - # char_effects(0,true) # turn reflections on4 l# Z. d$ N" H6 G$ p& B
- # char_effects(0,2,true) # turn reflections and mirror on
5 Y! P% F5 W F2 t6 y" [$ m - # char_effects(1,3,false) # turn shadows and icons off$ \( ^2 j" ]# ~; P$ Z% _3 l" x
- #------------------------------------------------------------------------------## V8 y9 N$ v: { [9 y* n
- #1 z9 X4 U: ]/ W
- # reflect_sprite(actor_id,filename,pos) # Change actor's reflect charset
( b; M' e* o$ d( { l9 o - #4 j2 E; k1 d6 ^# H
- # reflect_esprite(event_id,filename,pos) # Change event's reflect charset
9 Z0 S. \5 X0 E. ` - #* R. e$ ` I$ ]; f2 I1 m, S
- # reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
0 b. I- q* j4 V - # w7 k1 D: M, x4 H4 g' D
- #------------------------------------------------------------------------------#
$ l& ~: z+ f$ Q$ U! f - # EXAMPLES:( M/ Z3 q, T# P! B3 j
- # reflect_sprite(1,"Actor2",2) # change actor 1's charset to use sprite0 }! l9 F0 t7 X r' a# ` N/ k
- # # in position 2 of "Actor2" charset.& O, J. d9 H9 N( Q+ G
- # reflect_esprite(3,"Actor4",5) # event 3 will use sprite in position 5 of
3 a- V2 Y3 \& w% B - # # "Actor4" charset.9 J' G& g" S& h5 L. C9 p
- # reflect_vsprite(1,"Vehicle",5) # Ship will use sprite in position 5 of: T8 G1 ?; s& Z4 w# P& c* R: a
- # # "Vehicle" charset.
/ b/ }$ _* j8 U2 A - #------------------------------------------------------------------------------#- E* U6 t: S, m7 y0 w, n; G* L3 u
-
& R/ h/ D$ Z1 \3 R1 _ - #------------------------------------------------------------------------------#, X4 W5 J% K9 v6 p9 W' }7 G& p
- # SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS5 ?% d, Q q: d( }* T
- #------------------------------------------------------------------------------#
& F8 p" I* H9 E - #
( y/ K; b* E# S! Y4 r - # reflect(x,x,x,status) # status can be true or false to turn on or off
7 T) } p4 S2 l7 b3 ` - # # use this to specify for mirror and reflect.* p# D! `) r h1 V- y4 v1 n
- # shadow(x,x,x,status) # where x is the event ids you want to change* E# j. y9 F& ]
- # # to change all events use :all' s( L$ o: E- v4 U3 E4 S5 s( Q
- # icon(x,x,x,icon_id) # set which icon id to appear above character. Make; J. ^. N& s3 \$ \) B& j, Y, o
- # # it 0 for no icon./ F8 d1 B: A, u+ t$ F/ |6 n
- #
; j6 c' T% {; s5 |5 a! ~: k - #------------------------------------------------------------------------------#
5 W( N' Y: i7 J# V# X' Y1 j9 W - # EXAMPLES:
: A, g/ F2 D1 b5 U3 ~ - # reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON6 O0 o5 {( n/ \- h; m
- # shadow(1,false) # Turn event 1 shadow OFF1 Y( |' n% `" j3 k1 I
- # reflect(:all,true) # Turn all event reflections ON( G/ i; z ~! B7 x9 y3 g6 V# W5 w6 X
- # icon(1,2,3,4,38) # Events 1,2,3 and 4 will have icon 38 appear
- ?( ~1 c3 L6 i- p9 r H" s - #
% @( F0 U# s7 e9 I5 E: Y* p6 ^( D( X$ j - # NOTE: All events will default to NO shadows and NO reflections when entering; a- F1 O0 G( a8 s% G% H% z: L
- # a map. This is a design decision to try to keep lag to a minimum. You2 |3 c2 Y. ?! h- ^$ ~' n9 j
- # should use these effects sparingly and only activate them on events
6 ?7 ?# ^; E$ t8 ^, m - # that require them.7 }( E( J; a# [$ N
- #------------------------------------------------------------------------------#
6 M+ @ `9 b% Q$ x. o7 _ - 0 a! M* W$ _. K7 ^9 n4 [4 y9 s( Y
- #------------------------------------------------------------------------------#' t: V9 \6 b" [/ D+ I1 _+ U) W' i( `
- # SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES& N# s) O' _* G( @
- #------------------------------------------------------------------------------#
- M7 q# |' Y$ y1 n' ?, I. i - #
: q e4 m; F5 z) {9 j - # actor_reflect(actor_id,status) # reflections and shadows are ON by default
2 j9 g- }8 m8 G# q0 G9 Z - # actor_shadow(actor_id,status) # for actors and vehicles. Turning them off / p1 H9 t" y$ a( N* b1 z
- # actor_icon(actor_id,icon_id) # or on will permanently change them.
/ F Z& @( P. `( T - #
* K: D1 }( |5 f+ Z - # v_reflect(x,x,x,status) # use these v_ calls for changing vehicle effects
_9 S8 t5 N( W: j - # v_shadow(x,x,x,status) # on and off for vehicles.
r9 s/ O- m4 Z6 i. g - # v_icon(x,x,x,icon_id)
6 g/ [: W# M6 l$ k2 q2 Q - #' X6 Q& s. w; Y. k5 r) m
- #------------------------------------------------------------------------------#" Q9 h# f4 L# { |6 g
- ) _+ ^% u0 x) W0 g; [; I" N/ _
- #------------------------------------------------------------------------------#
, p7 l/ Y( i0 K: B" K# T/ q( E - # SCRIPT CALLS for shadow options
" Y# s& ?: B( \* [1 P: @ - #------------------------------------------------------------------------------#8 V" m0 t; R3 s H$ T% Q
- #$ f8 ]. S+ C0 U# I: b: Y" _
- # shadow_source(x,y,id) # set the x,y location for the light. id is the 9 q- f. | e$ U3 l3 x n" c6 H
- # # light source number you wish to change (for
* X' G7 H! V5 `0 }: b, S5 F - # # more than one). These are reset on map change.
! g9 ^* w) d! h* V" k; i' l7 z: T - # shadow_source(event_id,id) # use an event's x,y location for the light.
+ A7 [2 P2 W4 |7 J# y; ~ - # # This will need to be in parallel process if you
: s7 L: Q' s6 C6 h4 ^2 K2 V - # # want it to be a moving light.; x, l5 ?, }' g, W
- #5 C: \1 D( d5 p" i% d
- # shadow_options(intensity,fade,flicker) # descriptions below
# O1 t/ W+ z* ]& J8 e - #) }3 x& J# K/ i# o8 ~: h
- # # intensity = opacity when standing next to the light source (255 is black)3 P" h2 W) i* i
- # # fade = amount shadow becomes more transparent the further away you are.
' m$ y! M9 z# O - # # flicker = true or false. Shadows will flicker as if being cast by fire.
) p" [4 v4 H4 m' M% b - #) s* w: S, ?% i0 ^( A
- #------------------------------------------------------------------------------#0 {, x$ x( P* \0 j2 V, {# L5 I
- # EXAMPLE:
2 ~# C1 |5 T7 U - # shadow_options(80,10,false) # This is the default setting.' }: K) D( i+ n7 x9 w* r# B
- #------------------------------------------------------------------------------#
1 I# v) L: n- |. ~2 K9 l - / b1 D' {3 r2 v+ {7 M* r0 M
- #------------------------------------------------------------------------------#( ~5 {6 J5 o. m% N
- # SCRIPT CALLS for reflect options9 L# r4 u- i( Y
- #------------------------------------------------------------------------------#7 p3 ?8 x& V6 K2 x8 w3 D B6 ?
- #7 [5 x' L* `4 R6 y: Z
- # reflect_options(wave_pwr) \' U7 V- ?* a) ^
- #
2 z4 {* e5 I; `% ?1 U; { - # # wave_pwr = how strong the wave movement is. 0 is off7 ]' ?& ?& X2 n5 T% a! \
- #' f; W$ y3 }3 a# p2 P' G& _" |7 z( I. F
- #------------------------------------------------------------------------------#+ E9 L3 |$ ~; w0 ~: v; |# s7 G4 W0 @
- # EXAMPLE:
8 x$ y# \, I9 n# p - # reflect_options(1) # Turn wave power to 1
8 q% L. H0 ]$ l7 A; ?7 W% l - #------------------------------------------------------------------------------#0 r" C' O7 t+ p& B+ u8 K4 B. `
-
: P7 M' ~/ {7 T -
8 O" d) M1 p& b - #------------------------------------------------------------------------------#
- O$ p3 f/ @5 E - # NOTETAG for ACTORS
% K0 o& s' J8 I6 Z - #------------------------------------------------------------------------------#6 N# A: ?, x+ [, R9 V- m
- #6 Z% M" M; v0 e+ j/ J' Q8 {0 j" c' A
- # <no_reflect> # Actor will not have a reflection (for vampires of course!)) h# W. A1 n6 D% O, V
- #" x, h# A6 ^! e6 `7 q5 K: ]0 b
- # <reflect_sprite: FileName,pos> # Actor will use this charset for reflections
# J# o/ O' x" { - # # and use the character in position 'pos'4 W) ]" V6 ?/ S5 E% m
- #
- J: J d! \! g& B6 q - #------------------------------------------------------------------------------#4 T0 F5 m5 _7 X
- # EXAMPLES:- d- R( D" {' s5 X, c$ z7 \4 M8 y
- # <reflect_sprite: Actor2,0> # The first character from Actor2 charset2 y2 S' I# n4 h+ K' ?
- # <reflect_sprite: Actor3,7> # The last character from Actor2 charset6 L+ q; H: c( l) E# G8 x9 t
- #------------------------------------------------------------------------------#
G& H( w4 W) t* A - 2 g$ {, |, Y1 ?/ Q1 ?" x( P
-
: A/ ?0 a1 `2 z6 p& s& p5 U; F - ($imported ||= {})["Galv_Character_Effects"] = true+ O: c: }$ s7 V7 L0 }" B
- module Galv_CEffects
q/ Z9 ?2 H6 H( C' @* S -
- X* ^, h; q& w: ]( A3 h - #------------------------------------------------------------------------------#
# j4 R5 l7 z, w2 s/ i; { - # SETUP OPTIONS2 _/ S# A3 x5 S
- #------------------------------------------------------------------------------#
1 \& O; V7 [8 w+ q8 h - 3 N1 W/ n: x) S
- MIRROR_REGION = 1 # Region ID used to determine mirror walls. Paint the
% I% p, L$ B" y - # region on the wall you want to make reflective (and
4 v4 k9 R5 m" j+ ` - # then use tiles/mapping that make the parallax visible)3 E* [ ?% ^- V2 U, J: C
- 9 N+ O# O _; @2 }, }% t+ w' V
- ICON_OFFSET = -60 # Y offset for icons that are displayed above characters/ D% j: \; }% s; c
-
1 e, H# Y$ Z ~& Z - REFLECT_Z = -10 # Z level of reflections) [+ Z1 L y& @' Z- v% Z3 g* P
- SHADOW_Z = 0 # Z level of shadows
L3 P+ [) I. `) E -
+ ?% ^* o! K3 T8 H - #------------------------------------------------------------------------------# 3 l) ~0 A" K4 m( ? X3 k+ q; B% g$ _
- # END SETUP OPTIONS
2 M& e3 F6 H: N; I; Z - #------------------------------------------------------------------------------#
# f5 c0 j, B& r" `) J - end
+ r$ U9 o1 G6 z; K -
* N+ j% K w5 X4 O% ~& A$ h - $ a% T3 g& I5 W! M% B
-
6 l; j8 [0 u% L$ f/ T# o -
3 P) K( C @7 J. T& c4 u - class Game_Map9 G2 R/ h4 b. b( Z, a, P" k+ P
- def do_icons(refresh = true)3 v( }0 n6 K. E9 ?* C
- @events.values.each { |e|
+ }" ^' d4 |! T" e5 @( V, \8 r: ~ - next if !e.list( B& L; N! d. V' u4 ]& f
- if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/$ k5 I( V: r4 S: g, k7 ~ R2 P
- e.icon = $1.to_i% M' t8 }, J$ p1 t' ?
- e.icon_offset = [$2.to_i,$3.to_i]
8 e4 y( s/ J" g7 T' k - else3 R D. Z7 O1 d \8 V
- e.icon = 03 S( J0 P3 R$ F( m
- e.icon_offset = [0,0]1 ?) D$ p1 `0 X, ?
- end
( x3 ?# i$ ^( M% [ - }! y8 [; ?. Z3 k& |) @9 _
- SceneManager.scene.spriteset.refresh_effects if refresh; ~$ _* |; f* @. d# E" _
- end! Z9 L/ p! E- v
-
2 Y/ i' t1 Q+ H& a# p Z -
! J3 F: p' {9 R) D8 B$ H9 Z - def do_shadows(refresh = true)3 q+ O) L+ p- I2 T2 l# j
- @events.values.each { |e|! Y, B$ A4 P9 ]- s
- next if !e.list
2 b7 B7 E5 K9 v: k$ _8 P" e - if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/! J" o" N) [9 w. X% A" F
- e.shadow = true
4 c* t& b; g$ x- U! n: r" h - else0 g9 ]$ L( s( E5 p- F
- e.shadow = false% a: _/ `5 \( N6 k& j3 y
- end* A1 e2 k+ ^9 c6 g& }' `: R
- }
" ]5 _. k$ T8 J0 E - SceneManager.scene.spriteset.refresh_effects if refresh, w1 L5 }$ b9 q
- end
+ G+ f# S5 V% N -
" ^3 ?$ ~" Y1 z1 W! Y - def do_reflects(refresh = true). z; a" @6 q7 ^8 B" ]
- @events.values.each { |e|* o/ |* q% a! F8 }0 s, t; _$ m
- next if !e.list) {+ D. M0 [, R0 b K
- if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/9 v. d1 n% l2 d3 N" p1 N/ f
- e.reflect = true6 f. S$ W8 l- e" R. f
- else' r1 n5 u) ~$ l- d' C
- e.reflect = false
) T! A; Y" T- v, r$ A g3 I, h - end9 }$ x# X. V$ V- Q
- }
* w7 \' _- ^2 H/ B; Z6 W4 H - SceneManager.scene.spriteset.refresh_effects if refresh
0 j. b9 \* J* ?! s2 ]8 c1 H - end$ |% R+ D7 t9 U6 x6 k" ?, N. M
-
% o2 W* v3 t2 Q1 H - def do_all_chareffects
5 i8 l& n5 W6 C3 s4 L - do_icons(false)
% E$ W5 n0 w9 q+ y: Q7 a - do_shadows(false)0 s+ _, h- b% ~6 ?3 T# R9 k Z5 ~1 W, w
- do_reflects(false)
v7 z" L( [- e# r - end1 t# H3 N) K0 X6 e9 R. L
- + V) r/ p: J: u U0 U# b% J J: x
- end # Game_Map C0 g( i$ l6 D) t% a' f; ~
- ) @, d: q5 X/ A& B# T
-
% W* T& P$ x+ Z: \) L$ T% C - ) B6 L! W0 Z8 k2 ?0 x% e4 [
-
- O2 m, s5 R; w0 A1 Z - class Game_Interpreter, x. c5 k" O3 G
-
. S/ E! C' ]6 j0 B# R - def remove_icon
6 W" Z: k9 x8 q& M' ^7 V - icon(@event_id,0)* y8 s( F# J5 r/ L
- end
* H" O& i! x% q6 b - ; ?' w+ c2 {# _6 h' R6 l; D
- #-----------------------------------#+ T \+ O4 e4 E% ~: {
- # REFLECTIONS# h& q# D+ |! Q; X* @8 m
- #-----------------------------------#
2 X; |1 B' E; s! I8 [ -
+ C- ?" C5 v' N5 e8 R$ O - # Add/Remove Reflections from selected events
5 I0 [% N9 N, S* A - def reflect(*args,status)- y( R0 c6 L+ n+ H5 Z
- char_ids = [*args]
( D) t' h1 n' t, u- x) {% E5 T - if char_ids == [:all]8 D1 I$ g2 o, s( J8 }; p# l
- $game_map.events.values.each { |e| e.reflect = status }
5 n$ S; V% i: @* Y) O - else' F* u) d6 L' T
- char_ids.each {|c| $game_map.events[c].reflect = status }
( W) A( j O2 ^. F' p ?" } - end* L2 O* E% y& J+ R
- SceneManager.scene.spriteset.refresh_effects6 O! q. s# Y! J0 y' Q' ]( Q5 q
- end
S& r; E3 W+ r$ K0 M, c. i! d+ C - . H+ U+ [) n; v$ y& t+ }9 S. r
- # Change forever actor's reflect status; Z! _; ~9 n" j3 t$ Y7 j
- def actor_reflect(actor_id,status)3 ` u! E# W8 r/ ^+ t N l
- $game_actors[actor_id].reflect = status2 e! t& F' ]$ {
- $game_player.refresh
! u" ?9 u: X# s - end, O/ K! \8 C+ p0 y
-
/ @3 K: \5 a% W) Z - # Change forever vehicle's reflect status
- }8 U1 Z* B; w1 r4 i* t" t - def v_reflect(*args,status)
" |% s: t3 z2 z/ D1 A - char_ids = [*args]
+ F8 g; P7 \# |1 I2 _6 z, H* ` - if char_ids == [:all]8 u0 u! n. y; d$ s# N; u
- $game_map.vehicles.each { |v| v.reflect = status }$ Z3 X" e$ ~" B* m3 i6 [% m9 B! |
- else
- ?& U# E& D8 y0 q+ {9 S - char_ids.each { |v| $game_map.vehicles[v].reflect = status }
% ], C, u$ B+ m - end
, I9 f: A5 [9 S' r- {0 a - SceneManager.scene.spriteset.refresh_effects
9 c: J) a; L& W- U/ N - end8 o0 ~* H0 j1 u9 B' B+ G+ I
- ) d/ W- o/ A" Q4 D1 @: m& R
- def reflect_options(*args)
1 E/ H2 n; T( ?+ F) x, P. }/ H - $game_map.reflect_options = [*args]- f, n# I% v5 x6 @; c, F; E( _/ [
- SceneManager.scene.spriteset.refresh_effects
* B9 j( H& b w" f8 i - end7 h9 K; E+ s% w
-
! u# p9 `% b5 g! b; T7 A* v7 G& N - # Actor reflect sprite change
D1 v3 G% z/ x - def reflect_sprite(actor_id,filename,pos)
, @5 F% f, x! ?/ Y - $game_actors[actor_id].reflect_sprite = [filename,pos]9 I. k5 f' X$ b. `9 ?. \
- $game_player.refresh' f M& D) q9 I5 L; [0 ]( w
- end) P) E) M6 ~7 X& d1 F: ~0 u
- * \$ [( }; K0 u6 Z+ t9 k' N1 K$ ?
- # Event reflect sprite change
7 E" d" p7 ~6 E8 t% Z - def reflect_esprite(event_id,filename,pos). P) j2 d4 n3 R1 I; d% ^; k
- $game_map.events[event_id].reflect_sprite = [filename,pos]
: V" o( q& [2 G" i- B6 v& P' t - $game_map.events[event_id].reflect = true' s. @9 k* |/ e* l- \5 t8 u
- SceneManager.scene.spriteset.refresh_characters+ j9 A3 Y6 U) R. C
- end
, v1 n7 S/ |+ B o8 B - # s# f& V5 o4 K' @9 x( W8 [, W7 ?
- # Vehicle reflect sprite change+ y" x# H8 A, m4 R7 A
- def reflect_vsprite(v_id,filename,pos)
0 f- c5 N# L, r3 K/ _ - $game_map.vehicles[v_id].reflect_sprite = [filename,pos]" J2 |2 J7 w# S I- r& E# Z# r
- SceneManager.scene.spriteset.refresh_characters
* k0 d- E, n4 B - end. J' s# h$ W5 @7 W V5 A7 D
- ( R0 I N/ n" f# z+ m
- #-----------------------------------#
2 s# D5 V3 q) ^) A' Z' Z$ H - # SHADOWS; G$ f7 d1 ~% h4 Q
- #-----------------------------------#
8 A2 G0 r4 Y* a) i; E$ k' V - 6 s. w$ |: f- Z& Y
- # Add/Remove Shadows from selected characters4 j/ ^1 @2 @8 v6 c( t& U$ r9 j( j
- def shadow(*args,status)
# z5 c8 J5 Q6 A# K$ {; d+ a1 D - char_ids = [*args]% j! B. _0 u9 N) \! ^' x
- if char_ids == [:all]
- z5 B9 I( v' s6 C. h - $game_map.events.values.each { |e| e.shadow = status }
! d' F5 w5 h, I0 ]- z - else
9 C8 S; H- S5 a% r- ` - char_ids.each {|c| $game_map.events[c].shadow = status }
! [" x% T5 M/ l/ D; `, b: l/ y- t, ?9 { - end
$ F% {2 Q4 d: V! g1 w& R - SceneManager.scene.spriteset.refresh_effects7 D1 [% G! Y# A6 K0 d
- end
; R3 y0 x& N2 J" }% G% b -
' ]! I ?6 X$ z9 t" S+ R0 ]# K - # Change player and follower shadows# L4 G6 ^9 {7 H! `
- def actor_shadows(status)
$ I7 B4 l2 E8 e- G. t - $game_player.shadow = status4 Y% n1 ]0 B# [" \' I8 m' R
- $game_player.followers.each { |f| f.shadow = status }9 P3 K) I5 s' { b" ~. F
- SceneManager.scene.spriteset.refresh_effects& B3 q9 j4 V. a) ?. }
- end
" P' m$ v! B; R; M5 y, z+ u0 { -
( A. p% }6 m' L6 s9 x6 S: x - # Change vehicle's shadow status9 H+ u* E# K: {3 ~
- def v_shadow(*args,status)' V0 q& ?. I2 z" o: _5 r: P* P1 @5 r
- char_ids = [*args]
5 q# k u% x. P9 C5 p1 e - if char_ids == [:all]1 _# z9 z+ w8 d' u
- $game_map.vehicles.each { |v| v.shadow = status }
! z8 e7 o+ D1 [ - else3 t0 G c% z9 | U1 S
- char_ids.each { |v| $game_map.vehicles[v].shadow = status }
. E# g* F2 w, [4 x6 _ - end6 U* X4 E+ ~! P# T
- SceneManager.scene.spriteset.refresh_effects9 n2 i' R$ y& X5 {
- end
# a+ e8 c) j7 B! R -
! ]) l1 X. `" n \ - def shadow_options(*args)
3 E* P: W C N$ H% h. X% x5 h - $game_map.shadow_options = [*args]
+ B6 ?$ _% T5 p, b5 S! Y5 `+ n - SceneManager.scene.spriteset.refresh_effects* |0 R+ r$ v6 [+ a: t
- end
+ X; n8 }9 k, H+ E1 s6 F -
2 ~/ k$ p5 [- t! I2 y, e/ @% D - def shadow_source(*args,shad_id)0 m, M* s. Y; E6 Q$ ^
- shadsource = [*args]" L, x1 u9 c6 }" w; p% \
-
" t9 x; b4 l2 p. Z7 h Y - if shadsource.count == 1; k% ~. t& R6 T# U( ~
- $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,8 S6 p' v. o, x! e" F; p
- $game_map.events[shadsource[0]].real_y]
. a. d/ }# P: Q# o5 q5 u# ~ - elsif shadsource.count > 11 Q5 ?7 h0 M; L" K" H: y
- $game_map.light_source[shad_id] = shadsource( e4 L! |. h u
- else
, c3 p% @3 q) \3 C [9 J+ H% p - $game_map.light_source = []
1 T! b R: y3 z; J6 \- ?) \ - end
8 H* ?' D5 E, }0 c3 p' Y - end5 a$ l2 E- \' Q% y
-
3 m, k/ p ~7 F- ~+ V- p" c -
6 A8 c3 m7 h. X# \% r - #-----------------------------------#
! O4 o0 W! s: | a7 j1 \$ {/ S& E - # ICONS
# A) w# }" {' O+ [' p3 ~ - #-----------------------------------#
* X) ^/ `% Q) O5 y# ?7 K( _% L. l - " g, X0 U7 O0 V9 g c
- # Add/Remove Icons from selected events2 a1 L9 \; @* w$ L; m
- def icon(*args,icon_id)
& C2 ?" [8 r+ i0 R0 h3 d- {+ q - char_ids = [*args]
/ D( P$ T; ?7 P1 y, ]# O - if char_ids == [:all]
* E Q0 u9 Z j1 O% y' ` - $game_map.events.values.each { |e|; ~! U6 n; ]7 f! N8 T1 ?
- if e.icon <= 0
( R" W5 t% |! B# l' s - e.icon = nil
5 C" a' y7 ?( ]8 Q) N - else6 j) y: [3 G, Y2 o- ]
- e.icon = icon_id
* {* g0 @& ^& ?/ \( F9 Z& ^$ N - end+ E0 @: a0 u/ q! W
- }3 _, l! ]4 J& U8 {# M
- else5 p4 V- l8 k$ ?2 x2 O1 b) ]
- char_ids.each {|c| $game_map.events[c].icon = icon_id }
" B' ]8 _0 ~& F$ ` - end
& u) o, I. {- ?& S# Y4 }; q - SceneManager.scene.spriteset.refresh_effects* t3 ?9 q& P- g# N
- end
- O7 w# I p- u- o9 B: `! K6 J) s -
' s8 h* t9 C- `# O: a- b - # Change forever actor's icon
6 c# S: \4 h- w$ Z. [( ` @ - def actor_icon(actor_id,icon_id)7 o" H% R" q# K' Y- W8 w
- $game_actors[actor_id].icon = icon_id
* U4 w% R; X9 X6 ~) d2 j: ~' _ - $game_player.refresh5 C8 S3 V0 ^) ~8 D
- end
' T6 ^/ R; ?* ]9 N - * `: f# r; q+ w3 k$ j; P; V
- # Change forever vehicle's icon
C( m# ^7 L3 d1 F" S! L - def v_icon(*args,icon_id)
, t Q+ \* s" ]( d - char_ids = [*args]
& z/ R& _: l+ Z2 o* u9 h3 t - if char_ids == [:all]
6 O5 z; p6 \3 O+ O& O- O. ]. u$ V - $game_map.vehicles.each { |v| v.icon = icon_id }
0 h; r& Y7 K! q; p# d - else o: t( X) I; x5 |, g+ I
- char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }) {9 ]$ V3 @+ G6 ^ {+ N
- end/ t3 [: ~5 U( n) }2 K
- SceneManager.scene.spriteset.refresh_effects
- w' _* r9 W) {5 k, ^0 x/ y - end+ M+ z @/ V" f% \5 E3 t) l1 g1 c/ x
-
# Y. Y6 J5 ^; @& D0 _: m% W* |" q - #-----------------------------------# k. M" V9 D3 ^# v7 }% l
- # GENERAL/ G) e; r* n$ n5 }8 u2 ^) d
- #-----------------------------------#
! D: u" e! e) g - ) [. O3 t* a e/ _+ B1 ]
- # Turn on/off effects1 G3 S+ A' I3 l
- # 0 = reflect9 E) a2 {/ B5 d3 t5 o1 E- s
- # 1 = shadow
# M. F. d2 ^( H9 b3 z4 I, ~ - # 2 = mirror
$ h; s z0 k* i& U - # 3 = icon4 n9 S9 E5 N$ u$ Y1 d2 N
- . j/ A, [$ T! E" ^# X4 f# x9 {, Y
- def char_effects(*args,status)+ i$ o& G( j' U
- [*args].each { |e| $game_map.char_effects[e] = status } x0 g7 V$ Z9 N
- SceneManager.scene.spriteset.refresh_effects
& Z l J; i/ C - end6 H( a% q: r; _; p% I. a
- 7 b5 H7 L, b- k& z# z: M
-
9 f. h/ i) a d9 t. d2 @ - end # Game_Interpreter
. g, B# B7 k( F ]. K0 [$ z' g7 t+ { - ! g& E8 ~* C: K! w/ d# l7 @
- / d3 F. ]1 |9 N) j( h6 t6 t7 }9 ^7 M
- #-------------------------------------------------------------------------------2 _' S; u% O- {, ?* x8 W% Y) o( J
- # Spriteset_Map- g* r V: F) }+ B
- #-------------------------------------------------------------------------------$ S* g+ m( }4 C8 [# Y( D7 z
-
. w- \& J) \+ | E" r - class Spriteset_Map
; k0 [$ H$ Z& b& f/ S0 Q - alias galv_reflect_sm_initialize initialize
& n* a6 S' {( W0 F- m - def initialize
9 T, w' w5 ~" _3 T. o' q+ |( c6 a - create_effects
" ]/ [7 s _+ K3 `) J% H3 i - galv_reflect_sm_initialize: Y2 N8 e+ L4 _/ W/ _2 k' O; K
- refresh_characters: j' X2 S1 [& r7 R
- end
: m+ I# a! _5 F, l5 s5 K7 Q4 S0 i - : A1 R: L. G5 C. k, n( w8 P
- alias galv_reflect_sm_refresh_characters refresh_characters
: x* I; z8 }* b$ L. |7 \ - def refresh_characters0 Q3 T- U: A, ]: \4 ]% j7 B
- galv_reflect_sm_refresh_characters- A1 u# V+ H* q) c# v
- create_effects
3 o& a% u( a+ B& U3 f, z2 L8 D$ e - end
3 ]$ ~7 h8 W! m, y' }. M5 \ - 3 J. c2 ?1 v1 ~; M- N. r+ Z
- def refresh_effects5 L4 h. W8 t0 s! `8 |
- dispose_effects: t& d" G6 U$ P" J. a
- create_effects
& ^! ]' V2 X+ j; d: d% y - end! r) O8 Q( m3 p- ^; i' G0 |
- , ~/ n$ I- m$ K6 l+ U# t
- def create_effects9 O9 F2 m) ?( w* X5 w2 {7 z/ O
- @shadow_sprites = []
) r: S( T; |/ t( X' @( B7 M8 P( t - @reflect_sprites = []
: j% `* q7 ?2 B - @mirror_sprites = []
, \& V1 u5 y1 E! N% L! E - @icon_sprites = []
* ^ f Q( |9 P- t7 j% } -
5 {3 T4 d$ R7 I. v - # Do reflections
! r- e5 X5 } z- [- [. `8 c; o6 k+ h - if $game_map.char_effects[0]
( e/ b9 c: C7 g. ? - $game_map.events.values.each { |e|! v% [* y8 D3 m6 b% k5 _. {$ A" ~' U
- @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect
6 c- m7 r% q2 c C# H9 e - }
' P+ C4 k/ O8 { - $game_player.followers.each { |f|9 n/ m( d$ C. a$ x* X# [: {
- @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect4 `2 X9 G, Q7 \9 E
- }% ]3 I8 W. h9 m
- if $game_player.reflect- ?' f- K0 P! _: ?4 Q
- @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))
1 z/ _8 h; z7 z- G - end; H* Y, s7 f9 Y& d! f
- $game_map.vehicles.each { |v|
! X& `9 [" i' N3 n* t - @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect6 G/ u5 k# V" z/ Q" d2 B
- }
1 M$ O% ?1 B8 @, V5 R - end; d" w9 Y$ f, S- b2 }) |- N
- / m/ [- j- f2 s8 f, _
- # Do mirrors
! t5 P2 z, J/ T+ A' f* \ - if $game_map.char_effects[2]' f- F: m" r' M. n) b* l
- $game_map.events.values.each { |e|
. E/ n" A. J! S2 u - @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect
1 @+ M9 J, H$ _9 U; E$ D - }
) Y" l3 R7 P# l4 l9 i5 ^2 q3 F - $game_player.followers.each { |f|
. r( I* W: B9 Z; D' x4 c$ w" p - @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect% i, ^$ \8 D# n: W) I+ N
- }
, m$ {, U0 m/ Y. K - if $game_player.reflect j( \- }- E1 V* h4 j |
- @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player)); o# F2 w4 ?, p& m9 w2 \
- end4 a8 J5 U7 a1 q+ \
- $game_map.vehicles.each { |v|
& W7 e9 M6 z$ h! d/ G - @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect
) k3 @1 \8 V8 W \$ X) e - }+ O* p8 z& s8 K/ q4 e( d6 ^ n
- end
: E- k6 p; P; u \ -
+ K, h/ ]& `4 x - # Do Shadows
# q" x# P* r& i q5 X - if $game_map.char_effects[1]
1 d8 |9 T# Q( ?. S* n0 M$ E - return if $game_map.light_source.empty?( x$ ]. N6 v1 ?; D- c) [% ~6 }+ D
- $game_map.light_source.count.times { |s|8 K9 P' s7 U7 E5 H+ I
- $game_map.events.values.each { |e|- ~6 ^( A5 C# G$ G0 M
- @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow
) V* a; p9 j. L. ^' b; j - }
9 s/ V4 e, `2 y9 ] _* L - $game_player.followers.each { |f|
$ I8 |' Y/ |8 F; u; x - @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow6 r% h- y& r/ S- X' ^, t
- }
! `( q& f0 p: B. M& k. u - if $game_player.shadow
5 W! o2 C) g! E8 l - @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))0 R0 h) ^ i8 x7 s( G
- end: V$ J; J. c& b. u9 c* U
- $game_map.vehicles.each { |v|( @' D# \. d5 R9 z
- @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow
) t& i2 x3 C9 `2 m - }
# y D( D" K" u# N2 B( s- F - }
5 v* A/ v" d" `# u$ X - end3 P! T) c! v" ^' ~
- ) ~* {- X8 B& n9 o2 W+ W X u
- # Do icons
( B# K h0 r* l: p( ~) r* Y - if $game_map.char_effects[3]! L" r" M0 r! L2 E7 k& K( M! F
- $game_map.events.values.each { |e|2 [4 |8 B) u+ u8 r
- @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon6 Z* o" b% g; P2 t
- }
5 T, E& m( Z2 `: ]" E0 w* m - $game_player.followers.each { |f|
4 z1 Z( X$ V7 Y) [ - @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon+ v9 [8 V }. Q/ ^8 y4 E) N" g
- }
( o0 X& s6 v6 H1 l, J) U - if $game_player.icon% Y; u) P8 q* U
- @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))
; p- k- ], G% N! H/ J2 _2 v( G - end+ n; f$ y" J$ P8 F$ H
- $game_map.vehicles.each { |v|, X8 a* k3 b5 F3 X% ~
- @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon- g7 @8 C1 O0 V8 N8 @- \
- }
3 d4 ~- p( r' D i# ~2 H - end
; ^, F) W! V, h - end. y. ^2 t; {1 G) p6 q4 A' ?3 w* H1 O
-
2 R5 ^- E5 s' m3 N; \! p1 ]6 [ - alias galv_reflect_sm_update update
@4 j+ h& L5 p9 `0 `4 i - def update: T: {8 Z( Q- `- E# X5 `
- galv_reflect_sm_update
0 |; O5 [$ l* S/ E& [ - @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]
K3 D/ ^# |+ c' N( U! u - @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]7 x9 x% ?7 L! [+ r; C7 M* n- T
- @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]! X2 ?9 E3 J. U$ Q) K9 V
- @icon_sprites.each {|s| s.update} if $game_map.char_effects[3]
; D* _5 x4 w/ W; G) z) E+ f$ n4 T8 a/ M - end
) V& u. x8 u; K - / F/ D' s8 \( A# F! V1 M5 D8 e. ], S# d
- alias galv_reflect_sm_dispose_characters dispose_characters( m* f$ U5 r P; N: W
- def dispose_characters
, |! S. q( I% w8 C* J8 c! a - galv_reflect_sm_dispose_characters
! j$ [" @- Q0 I+ t( F T9 ~' V - dispose_effects8 E% @( x* Y0 @' r5 J D
- end6 G" e5 J( s5 l. I
- ' U! I. Q1 R2 m6 {) S
- def dispose_effects
* U: ~( g8 f, n) ~; l% m- x - @reflect_sprites.each {|s| s.dispose}
* t6 q5 t. Q0 |! ]. ^9 J6 ` - @shadow_sprites.each {|s| s.dispose}
7 w7 f% H; C4 e, E8 Z- [ - @mirror_sprites.each {|s| s.dispose}
, U! e$ S( a y Y - @icon_sprites.each {|s| s.dispose}( b2 [; H2 |' u0 E
- end) D3 W* I% u( t/ s; x
- end # Spriteset_Map# |' p+ M# a& ~' y+ }
- ( b, D; A+ B; e' o- N' }+ }
-
9 k5 B. W: ^ R% t# E - #------------------------------------------------------------------------------- M1 ~/ q+ q1 t8 @( |4 G2 Z1 [
- # Sprite_Reflect , w) ]- X: y _5 M# D2 j
- #-------------------------------------------------------------------------------
4 I1 n# m) I) i. @5 j2 k( d - " @. \1 ^: u# C2 J$ ~* u
- class Sprite_Reflect < Sprite_Character% ~/ b3 C) v& q5 y; m8 {6 H/ [, e
- def initialize(viewport, character = nil)
; h) k! F: V/ @' h' q, ?; X - super(viewport, character)- B* M) o# J$ t; s4 a5 f) F& w4 I
- end
: a# @1 v) ~9 a; q# h- O1 a5 F7 S0 ~ - 2 Q& `( b/ }/ ^6 a, Q! h
- def update
9 L7 }$ C! v2 p& M - super' I; q0 j* ]( g7 ~/ Q; b! s! {# Y- R
- end
9 F, [# x B# @1 p6 e# w - 2 K1 e9 v7 a. ^ u" K
- def update_balloon; end
% K1 B' ~6 _& L - def setup_new_effect; end! g2 s3 X4 `5 l* r" {1 ~5 n
- ; `$ e8 q5 B5 o" y8 {, T
- def set_character_bitmap
$ ?8 x" R- R8 z - if @character.reflect_sprite
# Q" `9 j& t1 L7 W0 E: p# A - self.bitmap = Cache.character(@character.reflect_sprite[0])
) [) N# ?7 I3 t4 \+ e8 D - else
8 T1 \& V+ G1 I+ N& S - self.bitmap = Cache.character(@character_name). i2 |. I0 Y3 p* D/ b& i
- end
( n6 m2 `- _, M7 d0 P# | - self.mirror = true
: g4 A7 V' [& j, r- D8 L% M8 H - self.angle = 180* N7 n1 T! X3 z$ u4 m
- self.opacity = 220( P. s" [ y0 H& x. n' w8 r
- self.z = Galv_CEffects::REFLECT_Z: X) @' m9 f# f& T- Y( K
- self.wave_amp = $game_map.reflect_options[0]
' @/ `1 x8 j! A, C& h( j& j - + {5 y0 v7 e6 y
- sign = @character_name[/^[\!\$]./], E$ }8 [1 ]2 m8 ?
- if sign && sign.include?(')9 o" j# }. E4 z8 B7 B" H3 c$ C( O
- @cw = bitmap.width / 3
& F8 E. X) P+ Z3 o7 @ - @ch = bitmap.height / 4
# R8 |! ]& m M6 |9 H - else5 s2 V, @* d" A4 x
- @cw = bitmap.width / 12, M5 Q8 r7 H3 c
- @ch = bitmap.height / 8
6 h: @7 b+ u/ j - end! Q1 o* Q! ] q
- self.ox = @cw / 2
( ^. Y4 [2 g/ X" A$ }! i - self.oy = @ch
) L4 O6 U1 c" v& D - end: d1 \. p$ P2 H5 k) W: [5 ~+ A& Z+ u4 x
- 7 p8 ]( U2 e3 j" a/ n3 F7 Z) H
- def update_position
1 P' N7 `& d. ?. T( e - self.x = @character.screen_x
9 ^, x( G) L& W - jump = @character.jumping? ? @character.jump_height * 2 : 0
" j; n; r4 D; }$ i N* y. {* n - alt = @character.altitude ? @character.altitude * 2 : 0
& i& ?+ i8 f w) L - self.y = @character.screen_y - 3 + jump + alt
- K4 G7 g$ Y- D2 ~- h' W - end* ~# G! X& A C1 e- _+ C
-
6 o, }. f3 [% Q% B$ c, D, b - def update_other, c6 H4 \4 v1 E j8 A- |
- self.blend_type = @character.blend_type
& r8 v6 V o q! {5 U - self.visible = [email protected]
$ p: X/ r4 }, d' U. ^# i- i1 N4 u; c$ ? - end
* b3 `; z: a( g - & C5 R* C# B5 M/ n3 \
- def update_src_rect
2 n e1 S- H5 Z* \, V - if @character.reflect_sprite, D1 `% a R) e. y9 t/ x
- index = @character.reflect_sprite[1]
, q; t D) g0 G# z { - else
% [5 P3 K5 V$ _ - index = @character.character_index
: k. r/ @8 V$ e) F1 A6 F. R: { - end
: _; d3 e+ v6 k/ F/ j. g2 R - pattern = @character.pattern < 3 ? @character.pattern : 12 F: \6 E9 I( D9 n( _; J
- sx = (index % 4 * 3 + pattern) * @cw
7 X: y# Z: [' P2 _ - sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch% [0 P4 p! ~7 B, r$ T o( B) Q
- self.src_rect.set(sx, sy, @cw, @ch)
1 P6 p- Y8 g0 K4 C3 @" T) { - end% f2 q" F1 q8 H/ k8 y5 Z
- end # Sprite_Reflect < Sprite_Character4 f' Y; _1 q; K( |% {+ L' |) }
- `) A1 o; c+ U5 T5 x1 X! L
- & N- m% h# H( o& c0 b# v
- #-------------------------------------------------------------------------------
/ B3 M4 p( j* F: Y9 [ D- s - # Sprite_Mirror
2 t7 m( O, U7 n - #-------------------------------------------------------------------------------" I( t7 t6 Z6 y* R
-
6 t; w. V, R! O0 _ - class Sprite_Mirror < Sprite_Character2 q/ q6 @& M2 c% w: e% T& E" B
- def initialize(viewport, character = nil)6 H) _5 N, T3 h5 n2 I+ Z
- @distance = 0
8 K" g- y+ n6 z, k7 l+ s# O - super(viewport, character)' G; s+ I$ ]* @+ [/ o
- end9 [1 H/ C0 b' B5 u- L/ R8 B- \
-
/ o2 L# k' R& P) P0 M) g3 q% Q - def update; g! i! {6 b: G
- super/ z! ^2 l; d+ |6 c$ w/ E0 ^
- end
# L; q1 O, x1 f" B6 H -
; h+ \8 }" D2 w* i( J' G - def update_balloon; end
# {5 v+ f1 ]' l' L - def setup_new_effect; end" z! q" U: u9 t3 ?; a( r
- - f: ~5 X$ k: u, X% x- ?! c
- def set_character_bitmap
. z4 Z* Q; X% ]9 ?3 E - if @character.reflect_sprite& ^9 D, B$ `/ ` X, s% e) W3 X# \
- self.bitmap = Cache.character(@character.reflect_sprite[0])! }0 I1 y; ]. Y; `2 n- N' n
- else% t+ {" u6 F- L+ B
- self.bitmap = Cache.character(@character_name)
. q9 g6 ~9 }# c+ A' k - end
: B, |8 v" U( _1 G - self.mirror = true6 `) n5 Z* u* P6 ^3 e# z( W3 f: w% c
- self.opacity = 255
$ e. a( M6 A/ n, }4 L8 B& [9 K/ a - self.z = Galv_CEffects::REFLECT_Z) h+ ~. L- G# M* n9 a
- ; S; B5 f% A5 w' E) I& J# H
- sign = @character_name[/^[\!\$]./]
' O$ @+ d! X, x! p - if sign && sign.include?(')
8 E. y% }' O& y0 w - @cw = bitmap.width / 3
/ n G) B" w" H& n! C( S& i+ w( ~ - @ch = bitmap.height / 4
9 s7 q9 P6 A2 E( t - else
& D' e4 R* |9 g7 X/ T - @cw = bitmap.width / 12& l* V5 n3 s" }6 |* z, b& ?
- @ch = bitmap.height / 8, j# `& T. `2 k$ p" h" r
- end
" I, [1 f4 D m. j5 n - self.ox = @cw / 2
) G% N7 L/ V2 s" G - self.oy = @ch( b# i* j1 D1 U7 j
- end
" H& o5 {9 f4 B! ]& d- t -
" o1 f& T" e+ V. A& E; W- s2 Y9 o0 t - def update_src_rect
! H* J1 n; |3 O7 @ - if @character.reflect_sprite4 x& }3 C7 L! F
- index = @character.reflect_sprite[1]
# ^: k5 C) }' ^( ]' O8 ] - else
' u. R! Q* B+ { - index = @character.character_index0 c+ s3 y4 ]3 k7 u3 @
- end
Z: u1 b! T6 B1 T3 w2 m - pattern = @character.pattern < 3 ? @character.pattern : 1
" N; l% q2 ~$ o" p4 ` - sx = (index % 4 * 3 + pattern) * @cw8 ]! P# M! r9 r7 H8 h8 K9 n: \
- sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch
" S( y% W. w/ B) [. G% c; ~; V - self.src_rect.set(sx, sy, @cw, @ch)
& s& U I% V) {7 w: B - end3 D$ `& `* B- K; b+ A+ w" r
- # g0 V# q5 S! g8 G7 d' z
- def get_mirror_y
9 f6 F' Y- v( m, ] - 20.times {|i|
+ u) }2 u$ U; F& a, t - if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION: w& w4 D# f5 c, Q9 ?8 W# ?: r
- @distance = (i - 1) * 0.05
) I9 t/ a2 J9 b. o$ |( ? n - [url=home.php?mod=space&uid=502659]@DISPLAY[/url] = @character.y - i - $game_map.display_y + $game_map.height7 F$ H, Z. G9 c' }
- self.opacity = 255
- T3 d0 V3 { u& N - return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 41 u, ^; `3 ? p; C: S7 T" w
- end
% U8 i2 {# j) I0 \' T8 T3 u - } ?3 X9 g0 s4 \. j
- self.opacity = 0
, O5 L; O4 |* x - return @ch1 q* k% o: A0 `+ q- @
- end6 ^* I" f( [/ T5 ^* O, F( i
-
, K% t E2 Q& R6 |9 J - def update_position* ^. m% D. o3 w" h
- self.x = @character.screen_x+ w4 @' c0 A( J1 k! ]
- self.y = get_mirror_y - 6
" l: ]1 ~1 X- g8 T- z - self.zoom_x = 1 - @distance- D: n6 i( r- @" I* s! a3 Y$ o$ F
- self.zoom_y = 1 - @distance
! c* F" v$ e4 s6 m - end
2 N1 w* l6 i! d& p - - s4 n+ ~8 e# a5 f& _
- def update_other* _' U0 C+ G8 X7 Q
- self.blend_type = @character.blend_type' k. N" V! D8 X% e
- self.visible = [email protected]
- L5 ?3 O$ M' z4 \! J2 j. |8 T - end
& ?* b1 {6 K: j2 t - end # Sprite_Mirror < Sprite_Character/ }2 z1 G$ k' ]+ J' Y ^- h6 R
- - n! p! [% T9 z! V
-
5 q5 {9 n4 n5 n- {/ Z& C - #-------------------------------------------------------------------------------' X* t3 ?4 i5 \0 C
- # Sprite_Shadow
% j" g6 e6 s- K [/ o - #-------------------------------------------------------------------------------
4 y' u3 A z* H0 c/ `! z- N# T; ] -
) z, W/ g) u' {8 Z1 B5 m0 a$ m$ T - class Sprite_Shadow < Sprite_Character: ?9 |8 K' x2 ?" `4 r
- def initialize(viewport, character = nil, source)
N: F' z$ b! P& { - [url=home.php?mod=space&uid=14094]@flicker[/url] = 0
8 y* ]* f/ M' f0 {) x9 h - @famount = 0& X, ~3 f# H9 _% r6 N0 v+ N
- @aamount = 0
1 v! X& F3 p! a+ L& }. G+ k/ z - [url=home.php?mod=space&uid=171370]@source[/url] = source
" D: n4 f. j$ Y- M2 @ - super(viewport, character)
, u" r# Z' [7 c7 z - end6 m H- j7 J4 R0 b9 l$ p2 u
-
" L H0 r6 v; N6 E - def update_balloon; end1 Y- C3 M1 h0 {% D
- def setup_new_effect; end* t/ Z T( U2 V7 G, p
- " ?- h( D$ s* l0 V( ^8 z! l- E
- def update
6 h9 @- D; w! p! i - super* F. e: A1 C$ W7 T% n$ I" ]1 i5 a
- update_bitmap
. W* x, n8 j+ {$ @* Y* Q - update_src_rect A: B: s: z. V" l9 m# a) x( V! R0 _
- update_position! h) }6 N1 T! G/ X4 i2 s* `( A# [
- update_other
8 i8 e7 V9 J, p1 ^; e/ S0 J - update_facing* }% a5 n* ^1 W& ^" ?/ c" \
- end4 Y7 `5 X2 V0 S e- K1 M' B! e' _
- % \+ I9 E: R3 T3 K8 N0 T! N
- def set_character_bitmap
4 U& K4 p8 w6 m1 {5 v) Z& l8 s - self.bitmap = Cache.character(@character_name)
" V/ |4 Y! ?0 @* _: t9 D6 k -
+ V+ W: F! {5 b( P( k( O" D( w - self.color = Color.new(0, 0, 0, 255)
3 G4 x! z$ W8 m6 i/ l2 o - self.z = Galv_CEffects::SHADOW_Z
1 ] R2 q) [" O/ `, K) _% v4 p - self.wave_amp = 1 if $game_map.shadow_options[2]2 U* n! B! y$ w3 {6 q& ^/ F
- self.wave_speed = 1000
7 l/ Q3 c6 l! P% h' i! p3 ~ - 4 j+ w) d! W) G
- sign = @character_name[/^[\!\$]./]
4 U8 _7 @2 N" F, V2 k - if sign && sign.include?(')/ D5 o2 z; q% m3 v! X5 i6 v% @) `' S3 ^
- @cw = bitmap.width / 36 a" p6 U; a+ H5 ?& y2 r
- @ch = bitmap.height / 4
+ ^6 H) N/ _! N5 W - else
5 W* G5 A/ B6 D' L9 ^1 ? - @cw = bitmap.width / 12
" [# ^: ^+ K6 x) U0 ` - @ch = bitmap.height / 8; E- H/ A# @3 S, {8 U- \6 C9 s
- end( A. Z9 g: w3 w+ n1 R2 x
- self.ox = @cw / 2+ R$ |& D, ?1 g# Z
- self.oy = @ch
+ g- I2 s- z' j" c" ~5 O - end( ^) ~/ x9 P: u6 g* X) l1 V7 t
-
% Q) O( e8 a* R( E' L( t) G - def update_position
3 Q& E( l8 h$ i, O. [, k - self.x = @character.screen_x
% I( ~1 {! \. E9 |+ i - self.y = @character.screen_y - 10
. u% K; E$ M5 l2 ]# F* H - get_angle
7 Q; k# T( \! O - end
) t" C3 V# Q* {( D5 G: x - * }' _) b) i" ~
- def get_angle
' I" A( ?! ^# Y5 U - x = $game_map.light_source[@source][0] - @character.real_x
; S$ v: U& _! |( p1 E - y = $game_map.light_source[@source][1] - @character.real_y+ W X9 S5 ?, w$ q' M
- self.opacity = $game_map.shadow_options[0] -
! o2 q6 J, X8 t8 t2 W% Q9 n% b - Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]5 M/ f$ P+ ^0 c! H
-
! y* u- p" t' f' u K0 F - if x == 0 && y == 0 || self.opacity <= 0
1 n9 k5 k. f+ n8 N9 T8 Z/ {% a - self.opacity = 06 O4 N4 y R$ b. q
- else
5 ]/ j; z( k5 z) y7 ~ - self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount
+ \ w0 ~& p) H, p$ m - end
9 A4 g0 K- J. y* |) ~7 u' q& B - end
. N' `! t2 J0 d - * \! g3 q- i! p) ?0 K9 X, C
- def update_facing
% H: O9 ^+ N" v, W4 ?3 Z - if @character.y < $game_map.light_source[@source][1]
3 ^! ]0 w" D( f5 o/ g - self.mirror = false) K% o% |$ }- }" a9 p6 h. w7 o! i
- else; w2 F/ y! U/ K
- self.mirror = true
# d3 N# ~! N& Y. ]; o- x - end% E% @8 S% a9 ]/ x
- end
# [' |; e I, z1 L7 R6 K) X( E! T -
3 R3 v, s3 n/ s4 z8 y) X - def update_other
' a6 Y+ L! U' o* _. t2 n - self.blend_type = @character.blend_type
0 A% P* {8 P$ [. P% K9 p - self.visible = [email protected]
; p% S9 ^0 z2 B* B - end
7 _/ G3 k M3 P+ l0 M/ F - end # Sprite_Shadow < Sprite_Character
. l7 j6 u# r5 b& V" { - 1 o5 M* N: t& I; o/ u! i* R
-
# i1 I% Z8 w5 T# \+ A1 D7 l - #-------------------------------------------------------------------------------
: d( n: I! o+ U% d - # Sprite_Icon/ J$ r% s% W/ B3 ~( q
- #-------------------------------------------------------------------------------
4 u* p) J0 r7 h7 M: k0 p -
$ P5 Y) d+ p8 z7 H3 x - class Sprite_Icon < Sprite_Character2 S) R; q. M1 Q; F- x5 L7 H* b4 K
- def initialize(viewport, character = nil)
9 E* D; D, C$ L2 H - @icon_sprite ||= Sprite.new4 {- b2 l# Y+ W" L d
- @icon_sprite.bitmap ||= Cache.system("Iconset"). A7 X6 q& o" E' `
- @icon = nil
0 Z( |8 K) W) P4 g" e6 w - super(viewport, character); D% I, ^3 i/ j: u+ S2 f5 [
- end
' o$ N" j1 \4 S9 p j w -
* V7 j4 Q# h# { - def dispose2 P) Z! R. s8 l
- super: q I! f7 o' R
- if @icon_sprite
9 V q( f$ h' Z$ E3 m - @icon_sprite.dispose
% D* U5 y1 m! I+ O - @icon_sprite = nil
; R2 l5 N2 I. h- q6 @4 H - end% E$ A& y L4 ]6 D2 c. H
- end
( y* X' Y) w( p b: l -
) D' {9 ^1 F* y% C* g+ D( Z - def update
+ V' w) [# L& ^+ T& p - super4 Z8 I1 b0 W; x
- update_icon
4 \2 {9 P2 d* b- w0 \5 ~ - end
# V; k1 B; f# V' \7 p; F/ u -
6 E; n% I' ~+ u; P9 @2 q - def update_icon
, g6 W- s% g5 H; D% g# i - return if [email protected]
+ J/ \" w* G; [" R - draw_icon(@character.icon)
- z+ G2 H4 _& ~# z# r9 F0 P5 } - end
+ K! X; f, M3 p; @0 i -
- ~! z4 z! r9 Q - def draw_icon(icon_index); `, d+ U( J) X- d
- return if [email protected]?
8 j$ h" ^6 g% `. I, X - rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)! j' G5 U8 y* \# D+ H6 g" ~
- @icon_sprite.src_rect = rect0 }& D7 w/ e0 X: K8 [
- @icon = icon_index T* w6 e% f- h, }5 T3 ^% S
- end4 s0 |4 a% f. U9 \% T' a# F4 ]
-
/ F) ~, l7 W! f0 h5 h9 L - def update_position8 o, C) Q( ~. N6 @
- @icon_sprite.x = @character.screen_x - 12
4 y" x5 r" ~; A+ ~ - @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET
8 x- E- G6 u" b: X) h* J7 c( @ - end, T; u1 }0 {1 G
-
l) s1 \* w) @8 ^; J7 r - def update_other5 H$ |2 b' {4 A* @
- self.blend_type = @character.blend_type
: F2 T+ j, X* Y, n# w - @icon_sprite.visible = [email protected]" z* K3 v1 [( I* @# U3 Y
- end
. Z, i% }: `3 j1 A - end # Sprite_Icon < Sprite_Character
' X. ^, @# i3 b' L -
! O# l3 q7 s/ X -
$ q, ^6 t$ T+ x6 Q. Y' x - #-------------------------------------------------------------------------------
8 O# W- e& s7 R; H9 }- h2 c - # Other Stuff
u; C* L( V2 T, u: A6 F0 h+ Q8 E - #-------------------------------------------------------------------------------
* K3 y% [) N7 o7 J$ u% M7 f -
+ l" B& U% A; [ -
4 X8 r' J1 m: y8 ]4 b, ^ - class Game_Character < Game_CharacterBase% X5 ^ G9 Z9 w1 x( P
- attr_reader :altitude& i8 N4 L! A( W5 i' o/ v2 Z
- attr_accessor :reflect- d$ D! P" I3 H
- attr_accessor :reflect_sprite
; D" K9 S" J7 U- j- R - attr_accessor :shadow4 j j: ?! \& _- h) F& l* K
- attr_accessor :icon
, @ J: H) {5 y' Z1 S' P+ Q! n. g* k7 j - attr_accessor :icon_offset
3 T5 \" v0 E& t& n/ K. j - end
/ K! {& U) W& {2 F8 ~ -
% E+ L8 W1 a1 `1 A; F0 U -
. \7 W. p& b5 f0 d+ j" y- Y, O - class Game_Event < Game_Character
, i! H' ?# W. u; q, r - alias galv_reflect_ge_initialize initialize% P7 T- l! | z6 _9 p' _3 k
- def initialize(map_id, event)/ _; H& g! K/ V# E0 U
- @reflect = false
p( P' Q# D9 R* ^ - [url=home.php?mod=space&uid=31758]@Shadow[/url] = false
* J: c5 N4 X' {# B - @icon_offset = [0,0]
+ v* a+ `2 l7 x4 b1 g5 B5 U( v) U - galv_reflect_ge_initialize(map_id, event)
2 B2 L2 l# d& P! K( d - end
2 J$ c- N2 J! r; m1 `3 w - end # Game_Event < Game_Character: M- k7 W7 g' h% \3 e) ?
-
4 m+ Z$ x' `! H& E - f& r6 _! y) t, g- |5 P) `
- class Game_Vehicle < Game_Character
6 O0 N0 C" u# X0 Z L" J' F3 H* T) V" t - attr_reader :map_id
3 {4 t, W0 d) G8 z& M4 e+ x -
4 N& z9 F) U5 f/ W7 r( ?# x. q3 g - alias galv_reflect_gv_initialize initialize
5 Y6 \$ k8 l4 T - def initialize(type)/ b4 L# S f! E
- @reflect = true/ T4 g( B7 [$ T6 l+ s1 _
- @shadow = true6 @+ K) f% c/ C* o& t- ~
- @icon_offset = [0,0]
2 D) E x* ]2 _! ? - galv_reflect_gv_initialize(type). M' U+ [: z5 `8 ]! K) x P4 N
- end
7 w7 W4 D7 A; J7 A$ T. C) j2 P - end # Game_Vehicle < Game_Character5 P# T0 n. ]' A/ {; y
-
, r/ [' U) ?: ]3 J9 T - % F% x1 B5 v7 U& t7 [2 r5 e
- class Game_Follower < Game_Character
F0 {% ^* ]/ H8 ]8 ]. R) S0 T2 ` - alias galv_reflect_gf_initialize initialize
7 ?2 }1 m3 ]1 b _& S9 h - def initialize(member_index, preceding_character)
s9 B( }5 C+ b5 i& Q3 ~! U - galv_reflect_gf_initialize(member_index, preceding_character); n. A8 J' L4 k0 f* M
- @reflect = true
# A7 g4 y; B3 j, u# B* ^2 }) g - @shadow = true
5 l+ j6 H2 _% ^, n - end
, _0 b3 S: |/ P1 ~# [ -
8 {; }1 H! [2 Q - alias galv_reflect_gf_refresh refresh
6 ^7 d* U- ?2 i5 h0 _3 M3 N - def refresh: G( G9 {" V" N3 d9 g) m1 u5 @
- galv_reflect_gf_refresh
+ R: z1 _9 X- A9 [7 a" O# x - return if actor.nil?
' U( v; c$ h( Q } - @reflect = actor.reflect
" M# ]' F3 @: g) ] - @reflect_sprite = actor.reflect_sprite
; W) c8 m- N) Z L" c, p; D - @icon = actor.icon( C$ a7 B3 k0 Z$ s
- if SceneManager.scene_is?(Scene_Map)" Q& u, \7 ?6 W& Y1 F
- SceneManager.scene.spriteset.refresh_effects
1 f9 o2 A- q) p! V. Y9 z5 Z9 C - end/ ?1 U- Q# F2 O# d0 [1 f4 \
- end
5 w' m+ F+ E* P4 y+ z' t/ @' \ - end # Game_Follower < Game_Character
' u. W4 K8 I. E: |1 G - ! P* M! v( a. s* y$ E
- 1 H5 h( Q) C, {* ~+ A1 K( t* `8 M5 W
- class Game_Player < Game_Character- w, A( B9 b/ v
- alias galv_reflect_gp_initialize initialize
( B. O* [. r! q$ k - def initialize
0 B( O2 J) y( u - galv_reflect_gp_initialize
2 N2 ]! \0 `. A) @' } - @reflect = true* Z$ m5 z4 D0 t$ M
- @shadow = true4 Y" D4 [. n& Q- |3 T( C
- end
. F# E( v; ~& e9 J- l5 D5 D - 2 `) [; Q! `4 N1 C$ E
- alias galv_reflect_gp_refresh refresh3 b" v4 @ _& [0 k# H
- def refresh
. f' \8 r/ Y! E( T+ K5 n6 c( t - galv_reflect_gp_refresh
6 z1 A0 [: V" |9 Y d3 | L - @reflect = actor.reflect3 g9 g4 V& K4 C2 }! E, _ e
- @reflect_sprite = actor.reflect_sprite
% x" \! A: W4 i! G4 P' D. e - @icon = actor.icon% r; x# t$ B) k$ K) ?$ K
- if SceneManager.scene_is?(Scene_Map)1 R& Y3 I, p/ R) i- R
- SceneManager.scene.spriteset.refresh_effects/ d6 L2 j& D) \6 U7 \! [, G
- end
3 S5 U- h8 \5 a4 u! G; m - end
* w }8 ^% q/ O- I# s+ g, J - end # Game_Player < Game_Character
5 m+ q3 t0 L( r: n3 Y5 O - & p% L- d; x8 O" F+ g# h1 s9 k
- 6 T: M# x, }+ i8 O) M
- class Scene_Map < Scene_Base. V- ^5 a# ?' q1 G5 [1 H& K) L9 R
- attr_accessor :spriteset. X2 J9 X% T# y: j" b0 l1 R# k
- end # Scene_Map
: Z4 K' p V* G -
: C L# w' Z1 x+ [ -
: Z' o, H* F4 r# @3 W - class Game_Map
8 k( N$ X# u% U# H' k - attr_accessor :char_effects
$ R0 Y$ |9 ^) n9 P1 w - attr_accessor :light_source
+ P0 v4 B4 ^( U$ r3 I) O - attr_accessor :shadow_options
9 Z( o2 `- X& |7 {/ B - attr_accessor :reflect_options' P, ^ k" w' G( D
-
* V n9 E) x8 R4 ?2 b - alias galv_reflect_game_map_initialize initialize
3 c% n/ c; Q) A9 x1 |2 ^1 t - def initialize
/ L! g0 u8 n4 ?0 d - @light_source = []$ a* J5 M0 c/ c E9 W; ~: ^5 P5 @, C: w
- @shadow_options = [80,10,false]
- [, O- r& T- G$ V2 l1 K - @reflect_options = [0]% }9 @# N c5 q, M& q
- @char_effects = [false,false,false,false]: h# M3 p0 Q/ u* {7 D$ H" L8 s
- #[reflect,shadow,mirror,icon]
% k7 A; V2 {& P - galv_reflect_game_map_initialize/ N( u% F) N) V* ]
- end) I% ^2 ~8 D b7 g( a. n1 W
-
) m( o ?/ l2 i. D" |) c -
# l% D' I' r8 l. v1 D2 G - alias galv_reflect_game_map_setup setup9 O# l; Z. o( f5 h2 z( P
- def setup(map_id)
* B1 Y2 }- \7 u, q5 B2 U( y - galv_reflect_game_map_setup(map_id)
8 k. Y L! R: | - reset_char_effects
* |% h0 x4 Z' }& ~+ R. o4 F+ L - do_all_chareffects
. a% J/ ^: `# s9 {) b2 {" v - if SceneManager.scene_is?(Scene_Map)% F: S/ s$ g" v u3 v! U5 q3 D$ R
- SceneManager.scene.spriteset.refresh_effects
+ Q' w- O' c5 ?" j0 S7 b - end/ w# O5 R$ Z6 B! |; F6 m( O
- end5 z+ z/ p1 H7 F$ S) ~
-
3 T" G6 A8 @9 K- d7 N5 M6 z+ ^0 q - def reset_char_effects1 e3 n0 i$ f* u+ O! [
- @light_source = []
+ P; v, l6 }0 L H - @events.values.each { |e|
4 A7 n* }) q1 b; M" g- V - e.reflect = false
6 B7 b& R6 ?# K3 F! _3 W: j7 {5 p) } - e.icon = nil }- e8 P1 ^6 E6 X4 ]) ?' ^9 |4 k
- end
4 \9 d" @, Z$ G, S2 ] - end # Game_Map) q2 \) a& _# h+ N1 T, b
-
4 F4 T) k, c# T2 @ -
2 i2 i' E) U" j, E L, w3 ]2 n4 n - class Game_Actor < Game_Battler
. H. D% O9 N& U! J2 i; U9 r - attr_accessor :reflect: a& C- U2 Q/ y% v% n# Y9 i/ _' Q( [
- attr_accessor :reflect_sprite9 M8 z" a5 g v' w; b
- attr_accessor :icon
: E' [5 z) u3 X0 S2 e. [9 \ - ) s0 s% f) a% Y# f8 a. @
- alias galv_reflect_game_actor_initialize initialize
4 @2 _& A4 C2 @8 v- b: Q' d% h - def initialize(actor_id)( i1 k& y8 I- E2 j4 C. X( b
- galv_reflect_game_actor_initialize(actor_id)
2 l# U8 E% _$ i6 K/ X2 N% o: ^ - @reflect = $data_actors[actor_id].reflect- U) T8 e# T; ], ? i( |' Z; k- j
- @reflect_sprite = $data_actors[actor_id].reflect_sprite
; p* {/ }# d# A7 Y, @: d - @icon_offset = [0,0]
9 o' K: D+ p- K8 U2 O - end! H) J/ c$ w9 d* l; k! i* d
- end # Game_Actor < Game_Battler7 G# U' e& X Z( j+ l
- ' q; R& R1 N. m- }
- & E$ G/ ], ~: }( c' q) D
- class RPG::Actor
& r0 ~5 a1 R' l/ |" c) B( A - def reflect_sprite
6 v4 k6 `& L7 s" J# J - if @reflect_sprite.nil?
8 m( U' c/ }& _- N# X8 U - if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
$ ?( X4 E- E% _3 W2 x! ?# y - @reflect_sprite = [$1.to_s,$2.to_i]
( |4 O6 A( e" V8 P+ g - else3 j9 w# N( [. M& _; m
- @reflect_sprite = nil f3 b/ I/ e2 |7 Y* [
- end
$ ?7 m- K: d- y% s% |. R! g- w; c - end
" w" E" E" I2 d' M6 Q6 ` - @reflect_sprite
1 |# v0 _% D; E" K. _' y( T - end
i/ V9 O6 T' s/ A/ }! @7 @0 u* [ - def reflect2 j# c- Q" L0 y$ v" a3 ~
- if @reflect.nil?( t7 V0 n, C, M. _' O7 i
- if @note =~ /<no_reflect>/i! o. c. J5 `5 N, ^9 U( @
- @reflect = false2 F4 u, O: b5 K; R& a( M( ]$ L
- else
' F/ L# `1 W! v/ F2 f - @reflect = true9 M8 c" [, C2 s3 W
- end
@. V" E) a( `4 q* x1 ]( J4 ? - end) ?7 i) L* y, i, s
- @reflect9 ?& ~# `( `1 D2 X; C* Q4 h
- end8 H, i) T a) @ [! P: Q5 {
- end # RPG::Actor
, k: @/ y. s! P1 v
复制代码 |
|