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