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

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