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

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