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