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