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

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