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