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

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