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