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

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