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