赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1673 |
最后登录 | 2016-3-27 |
在线时间 | 21 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 21 小时
- 注册时间
- 2014-6-25
- 帖子
- 7
|
2楼

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