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

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