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

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