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

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