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