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

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