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