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