赞 | 0 |
VIP | 5 |
好人卡 | 9 |
积分 | 1 |
经验 | 6154 |
最后登录 | 2017-7-15 |
在线时间 | 498 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 498 小时
- 注册时间
- 2011-5-23
- 帖子
- 73
|
lz是不是要这个- # 仴仯仴 No108. 僶僩儖僶僢僋丒Full-View亄壜摦僇儊儔 仴仯仴
- #
- # update 2006/ 4/16
- #
- #==============================================================================
- # 仩 僇僗僞儅僀僘億僀儞僩
- #==============================================================================
- module XRXS_BP8
- #
- # 僇儊儔堏摦懍搙
- # ( SPEED1 : 嫍棧暘妱悢丅彫偝偄傎偳憗偄
- # SPEED2 : 嵟掅堏摦懍搙[扨埵:px/F])
- #
- SPEED1 = 8
- SPEED2 = 15
- #
- # GA偺墶暆僒僀僘傪愝掕 ( 1024:XGA僒僀僘丄640:VGA僒僀僘)
- #
- GA_W = 680
- end
- #------------------------------------------------------------------------------
- # 仱 壜摦僇儊儔偺摦偒愝掕
- #------------------------------------------------------------------------------
- class Scene_Battle
- #--------------------------------------------------------------------------
- # 仠 僷乕僥傿僐儅儞僪僼僃乕僘奐巒
- #--------------------------------------------------------------------------
- alias xrxs_bp8_start_phase2 start_phase2
- def start_phase2
- # 僇儊儔丗僙儞僞儕儞僌
- $xcam.centering
- # 屇傃栠偡
- xrxs_bp8_start_phase2
- end
- #--------------------------------------------------------------------------
- # 仠 僼儗乕儉峏怴 (傾僋僞乕僐儅儞僪僼僃乕僘 : 僄僱儈乕慖戰)
- #--------------------------------------------------------------------------
- alias xrxs_bp8_update_phase3_enemy_select update_phase3_enemy_select
- def update_phase3_enemy_select
- # 尰嵼慖戰拞偺僄僱儈乕傪庢摼
- enemy = $game_troop.enemies[@enemy_arrow.index]
- # 僇儊儔丗拲栚
- if @last_enemy_arrow != enemy
- $xcam.watch(enemy)
- @last_enemy_arrow = enemy
- end
- # 栠偡
- xrxs_bp8_update_phase3_enemy_select
- end
- #--------------------------------------------------------------------------
- # 仠 僄僱儈乕慖戰廔椆
- #--------------------------------------------------------------------------
- alias xrxs_bp8_end_enemy_select end_enemy_select
- def end_enemy_select
- # 僇儊儔丗僙儞僞儕儞僌
- $xcam.centering
- @last_enemy_arrow = nil
- # 屇傃栠偡
- xrxs_bp8_end_enemy_select
- end
- #--------------------------------------------------------------------------
- # 仠 僼儗乕儉峏怴 (儊僀儞僼僃乕僘 僗僥僢僾 2 : 傾僋僔儑儞奐巒)
- #--------------------------------------------------------------------------
- alias xrxs_bp8_update_phase4_step2 update_phase4_step2
- def update_phase4_step2
- # 栠偡
- xrxs_bp8_update_phase4_step2
- # 僗僥僢僾 3 偵堏峴偡傞梊掕偺応崌
- if @phase4_step == 3
- # 傾僋僥傿僽側僶僩儔乕偑僶僩儖僼傿乕儖僪偵嫃傞応崌
- if @active_battler.in_battlefield?
- # 僇儊儔丗拲栚
- $xcam.watch(@active_battler)
- end
- end
- end
- #--------------------------------------------------------------------------
- # 仠 僼儗乕儉峏怴 (儊僀儞僼僃乕僘 僗僥僢僾 3 : 峴摦懁傾僯儊乕僔儑儞)
- #--------------------------------------------------------------------------
- alias xrxs_bp8_update_phase4_step3 update_phase4_step3
- def update_phase4_step3
- # 栠偡
- xrxs_bp8_update_phase4_step3
- # 僇儊儔僞乕僎僢僩偲側傝偆傞僞乕僎僢僩偺 X 暯嬒抣傪寁嶼
- x_average = 0
- number = 0
- cam_target = nil
- for target in @target_battlers
- if target.in_battlefield?
- x_average += target.x
- number += 1
- cam_target = target
- end
- end
- # 僇儊儔僞乕僎僢僩偑尒偮偐偭偨応崌
- if number > 0
- # 傕偟懳徾傾僯儊偑乽埵抲丗夋柺乿偺応崌
- animation = $data_animations[@animation2_id]
- if animation != nil and animation.position == 3
- # 僇儊儔丗僙儞僞儕儞僌
- $xcam.centering
- # 僇儊儔丗僘乕儉傾僂僩
- $xcam.zoomout
- elsif number == 1
- # 僇儊儔丗拲栚
- $xcam.watch(cam_target)
- else
- # 僇儊儔丗巜掕 X 埵抲傪拲栚
- $xcam.watch_at(x_average / number)
- end
- end
- end
- #--------------------------------------------------------------------------
- # 仠 傾僼僞乕僶僩儖僼僃乕僘奐巒
- #--------------------------------------------------------------------------
- alias xrxs_bp8_start_phase5 start_phase5
- def start_phase5
- # 僇儊儔丗僙儞僞儕儞僌
- $xcam.centering
- # 屇傃栠偡
- xrxs_bp8_start_phase5
- end
- end
- #------------------------------------------------------------------------------
- # 僇僗僞儅僀僘億僀儞僩偙偙傑偱
- #==============================================================================
- #------------------------------------------------------------------------------
- #
- # 仱 壜摦僇儊儔 僔僗僥儉 仱
- #
- #==============================================================================
- # 仩 XCam
- #------------------------------------------------------------------------------
- # 壜摦僇儊儔傪埖偆僋儔僗偱偡丅
- #==============================================================================
- class XCam
- #--------------------------------------------------------------------------
- # 仜 岞奐僀儞僗僞儞僗曄悢
- #--------------------------------------------------------------------------
- attr_reader :x
- attr_reader :y
- attr_reader :z
- attr_accessor :x_destination
- attr_accessor :y_destination
- attr_accessor :z_destination
- attr_accessor :watch_battler
- attr_accessor :freeze_count
- #--------------------------------------------------------------------------
- # 仜 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- def initialize
- # 僇儊儔弶婜埵抲寛掕
- @x = 320
- @y = 240
- @z = 296
- # 嵟戝斖埻偺寁嶼
- @x_max = 0
- @y_max = 0
- @z_max = XRXS_BP8::GA_W * 37 / 128
- # Z偺嵟戝惂尷
- @z = @z_max if @z > @z_max
- # 僇儊儔丗僙儞僞儕儞僌
- self.centering
- # 弶婜壔
- @freeze_count = 0
- end
- #--------------------------------------------------------------------------
- # 仜 僼儗乕儉峏怴
- #--------------------------------------------------------------------------
- def update
- @moved = false
- # 僇儊儔埵抲偺峏怴
- if @freeze_count > 0
- # 僼儕乕僘僇僂儞僩傪尭傜偡
- @freeze_count -= 1
- return
- end
- # 嵗昗庢摼
- z_dest = @z_destination
- x_dest = @watch_battler == nil ? @x_destination : @watch_battler.x
- y_dest = @watch_battler == nil ? @y_destination : 88 + @watch_battler.y/2
- # 僇儊儔: Z 嵗昗 (桪愭)
- if @z != z_dest
- @z = slide(@z, z_dest, @z_speed, 37, @z_max)
- @x_max = (@z_max - @z) * 64 / 37
- @y_max = (@z_max - @z) * 48 / 37
- @moved = true
- end
- # 僇儊儔: X 嵗昗
- if @x != x_dest or @moved
- @x = slide(@x, x_dest, @x_speed, 320 - @x_max, 320 + @x_max)
- @moved = true
- end
- # 僇儊儔: Y 嵗昗
- if @y != y_dest or @moved
- @y = slide(@y, y_dest, @y_speed, 240 - @y_max, 240 + @y_max)
- @moved = true
- end
- end
- #--------------------------------------------------------------------------
- # 仜 僗儔僀僪 (尰嵼抧丒栚揑抧偐傜峴偔傋偒尰嵼抧傪曉偡)
- #--------------------------------------------------------------------------
- def slide(from, to, move_speed, to_min, to_max)
- # 寢壥傪敾暿
- if (to - from).abs < move_speed
- result = to
- else
- sign = from > to ? -1 : 1
- result = from + sign * move_speed
- end
- # 斖埻偵傛偭偰曉媝
- return [[result, to_min].max, to_max].min
- end
- #--------------------------------------------------------------------------
- # 仜 摦偄偨偐偳偆偐丠
- #--------------------------------------------------------------------------
- def moved?
- return @moved
- end
- #--------------------------------------------------------------------------
- # 仜 僇儊儔懍搙愝掕
- #--------------------------------------------------------------------------
- def set_speed
- x_dest = @watch_battler == nil ? @x_destination : @watch_battler.x
- y_dest = @watch_battler == nil ? @y_destination : 88 + @watch_battler.y/2
- z_dest = @z_destination
- @x_speed = [[(x_dest - @x).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min
- @y_speed = [[(y_dest - @y).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min
- @z_speed = [[(z_dest - @z).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min
- end
- #--------------------------------------------------------------------------
- # 仜 僙儞僞儕儞僌
- #--------------------------------------------------------------------------
- def centering
- @watch_battler = nil
- @x_destination = 320
- @y_destination = 240
- @z_destination = 185
- set_speed
- end
- #--------------------------------------------------------------------------
- # 仜 僘乕儉傾僂僩
- #--------------------------------------------------------------------------
- def zoomout
- @z_destination = 222
- set_speed
- end
- #--------------------------------------------------------------------------
- # 仜 僶僩儔乕傪拲栚
- #--------------------------------------------------------------------------
- def watch(battler)
- @watch_battler = battler
- @z_destination = 180
- set_speed
- end
- #--------------------------------------------------------------------------
- # 仜 巜掕 X 埵抲傪拲栚
- #--------------------------------------------------------------------------
- def watch_at(x)
- @watch_battler = nil
- @x_destination = x
- @y_destination = 240
- @z_destination = 185
- set_speed
- end
- #--------------------------------------------------------------------------
- # 仜 僘乕儉攞棪偺庢摼
- #--------------------------------------------------------------------------
- def zoom
- return 185.00 / self.z
- end
- end
- #==============================================================================
- # 仭 Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # 仜 岞奐僀儞僗僞儞僗曄悢
- #--------------------------------------------------------------------------
- attr_reader :x # 僶僩儖僼傿乕儖僪丂墶丂埵抲(+偑塃丂)
- attr_reader :y # 僶僩儖僼傿乕儖僪 崅偝 埵抲(+偑壓丂)
- attr_reader :z # 僶僩儖僼傿乕儖僪墱峴偒埵抲(+偑庤慜)
- #--------------------------------------------------------------------------
- # 仜 僶僩儖僼傿乕儖僪忋偵嫃傞偐丠
- #--------------------------------------------------------------------------
- def in_battlefield?
- return false
- end
- end
- #==============================================================================
- # 仭 Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # 仜 僶僩儖僼傿乕儖僪忋偵嫃傞偐丠 [僆乕僶乕儔僀僪]
- #--------------------------------------------------------------------------
- def in_battlefield?
- return true
- end
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- alias xrxs_bp8_initialize initialize
- def initialize(troop_id, member_index)
- @z = 0
- xrxs_bp8_initialize(troop_id, member_index)
- end
- #--------------------------------------------------------------------------
- # 仠 僶僩儖夋柺 X 嵗昗偺庢摼
- #--------------------------------------------------------------------------
- alias x screen_x
- def screen_x
- return self.x if $xcam == nil
- return 320 + (self.x - $xcam.x) * 185 / $xcam.z
- end
- #--------------------------------------------------------------------------
- # 仠 僶僩儖夋柺 Y 嵗昗偺庢摼
- #--------------------------------------------------------------------------
- alias y screen_y
- def screen_y
- return self.y if $xcam == nil
- return 240 + (self.y - $xcam.y) * 185 / $xcam.z
- end
- end
- #==============================================================================
- # 仭 Spriteset_Battle
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # 仜 僼儗乕儉峏怴 (壜摦僇儊儔)
- #--------------------------------------------------------------------------
- def update_xcam
- # 僇儊儔埵抲偑摦偄偨応崌
- if $xcam.moved?
- # 僇儊儔埵抲偐傜僘乕儉棪傪寁嶼
- zoom = 185.00 / $xcam.z
- w = XRXS_BP8::GA_W / 2
- h = w * 3 / 4
- # 攚宨偺愝掕峏怴
- @battleback_sprite.zoom_x = zoom
- @battleback_sprite.zoom_y = zoom
- @battleback_sprite.x = (320 - $xcam.x) * zoom - w * (zoom - 1)
- @battleback_sprite.y = (240 - $xcam.y) * zoom - h * (zoom - 1)
- end
- end
- end
- #==============================================================================
- # --- 僶僩儔乕僗僾儔僀僩丒壜摦僇儊儔揔梡 ---
- #==============================================================================
- module XRXS_Cam_Deal
- def update
- # 屇傃栠偡
- super
- # 僶僩儔乕偑僶僩儖僼傿乕儖僪偵偄側偄応崌偼廔椆
- return if @battler == nil or not @battler.in_battlefield?
- # 僌儔僼傿僢僋偑枹愝掕側応崌偼廔椆
- return if self.bitmap == nil
- # 僘乕儉棪偺曄峏 ( 僗僾儔僀僩嵗昗偺嵞愝掕偼尦偺儊僜僢僪偵擟偣傞 )
- zoom = 1.00 * 185 / (185 - @battler.z)
- self.zoom_x = zoom * $xcam.zoom
- self.zoom_y = zoom * $xcam.zoom
- end
- end
- class Sprite_Battler < RPG::Sprite
- include XRXS_Cam_Deal
- end
- #==============================================================================
- # --- 僟儊乕僕僼僅儘乕 儌僕儏乕儖 ---
- #==============================================================================
- module XRXS_DamageFollow
- def update
- # 屇傃栠偡
- super
- # 僇儊儔偑懚嵼偟側偄応崌
- return if $xcam == nil
- # 僶僩儔乕偑 nil 傑偨偼僶僩儖僼傿乕儖僪偵偄側偄応崌
- return if @battler == nil or not @battler.in_battlefield?
- # 捈慜僇儊儔埵抲偐傜丄堏摦検傪嶼弌
- x_moved = @last_cam_x == nil ? 0 : $xcam.x - @last_cam_x
- y_moved = @last_cam_y == nil ? 0 : $xcam.y - @last_cam_y
- # 僟儊乕僕僗僾儔僀僩攝楍偺嶌惉
- damage_sprites = [@_damage_sprite]
- damage_sprites += @damage_sprites if @damage_sprites != nil
- # 僇儊儔傪僼僅儘乕
- for sprite in damage_sprites
- next if sprite == nil
- next if sprite.disposed?
- sprite.x -= x_moved
- sprite.y -= y_moved
- end
- # 捈慜僇儊儔埵抲偺曐帩
- @last_cam_x = $xcam.x
- @last_cam_y = $xcam.y
- end
- end
- class Sprite_Battler < RPG::Sprite
- include XRXS_DamageFollow
- end
- #==============================================================================
- # 仭 Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # 仠 儊僀儞張棟
- #--------------------------------------------------------------------------
- alias xrxs_bp8_main main
- def main
- # 壜摦僇儊儔偺惗惉
- $xcam = XCam.new
- # 栠偡
- xrxs_bp8_main
- # 壜摦僇儊儔偺夝曻
- $xcam = nil
- end
- #--------------------------------------------------------------------------
- # 仠 僼儗乕儉峏怴
- #--------------------------------------------------------------------------
- alias xrxs_bp8_update update
- def update
- # 壜摦僇儊儔偺僼儗乕儉峏怴
- $xcam.update
- # 屇傃栠偡
- xrxs_bp8_update
- end
- end
- #------------------------------------------------------------------------------
- #
- # 仱 Full-View 僔僗僥儉 仱
- #
- #==============================================================================
- # 仭 Spriteset_Battle
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # 仠 僆僽僕僃僋僩弶婜壔
- #--------------------------------------------------------------------------
- alias xrxs_bp8_initialize initialize
- def initialize
- # 屇傃栠偡
- xrxs_bp8_initialize
- # 僌儔僼傿僢僋僗傾儗僀傪庢摼
- # 價儏乕億乕僩 0 傪嶌惉
- w = XRXS_BP8::GA_W
- h = w * 3 / 4
- x = 320 - w / 2
- y = 240 - h / 2
- @viewport0 = Viewport.new(x, y, w, h)
- @viewport0.z = 0
- # 價儏乕億乕僩 1 偺愝掕傪曄峏
- @viewport1.z += 1
- @viewport1.rect.height = 480
- # 僶僩儖僶僢僋僗僾儔僀僩傪嵞嶌惉 (價儏乕億乕僩 0 傪巊梡)
- @battleback_sprite.dispose
- @battleback_sprite = Sprite.new(@viewport0)
- @battleback_name = ""
- # 僶僩儖僶僢僋偺僼儗乕儉峏怴
- update_battleback
- end
- #--------------------------------------------------------------------------
- # 仠 夝曻
- #--------------------------------------------------------------------------
- alias xrxs_bp8_dispose dispose
- def dispose
- # 屇傃栠偡
- xrxs_bp8_dispose
- # 價儏乕億乕僩傪夝曻
- @viewport0.dispose
- end
- #--------------------------------------------------------------------------
- # 仠 僼儗乕儉峏怴
- #--------------------------------------------------------------------------
- alias xrxs_bp8_update update
- def update
- # 僼儗乕儉峏怴 (僶僩儖僶僢僋)
- update_battleback
- # 僼儗乕儉峏怴 (壜摦僇儊儔)
- update_xcam if defined? update_xcam
- # 屇傃栠偡
- xrxs_bp8_update
- # 夋柺偺僔僃僀僋埵抲傪愝掕
- @viewport0.ox = $game_screen.shake if @viewport0 != nil
- end
- #--------------------------------------------------------------------------
- # 仜 僼儗乕儉峏怴 (僶僩儖僶僢僋)
- #--------------------------------------------------------------------------
- def update_battleback
- # 僶僩儖僶僢僋偺僼傽僀儖柤偑尰嵼偺傕偺偲堘偆応崌
- if @battleback_name != $game_temp.battleback_name
- @battleback_name = $game_temp.battleback_name
- if @battleback_sprite.bitmap != nil
- @battleback_sprite.bitmap.dispose
- end
- # 僌儔僼傿僢僋僗傾儗僀傪庢摼
- w = XRXS_BP8::GA_W
- h = w * 3 / 4
- # 僶僩儖僶僢僋偺庢摼偲奼戝
- bg = RPG::Cache.battleback(@battleback_name)
- xga = Bitmap.new(w, h)
- xga.stretch_blt(xga.rect, bg, bg.rect)
- # XGA傪僶僩儖僶僢僋偵愝掕
- @battleback_sprite.bitmap = xga
- end
- end
- end
- #==============================================================================
- # ---乽愴摤拞偺"夋柺"傾僯儊偺埵抲廋惓乿儌僕儏乕儖 ---
- #==============================================================================
- module XRXS_FullScreen_AnimationOffset
- def animation_set_sprites(sprites, cell_data, position)
- super
- for i in 0..15
- sprite = sprites[i]
- pattern = cell_data[i, 0]
- if sprite == nil or pattern == nil or pattern == -1
- next
- end
- if position == 3
- if self.viewport != nil
- sprite.y = 160 # 偙偺堦峴偩偗曄峏
- sprite.y += cell_data[i, 2]
- end
- end
- end
- end
- end
- class Sprite_Battler < RPG::Sprite
- include XRXS_FullScreen_AnimationOffset
- end
复制代码 |
|