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

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