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