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