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

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