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