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