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