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

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