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