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

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