Conectarse
Buscar
Últimos temas
Los posteadores más activos del mes
No hay usuarios |
Estadísticas
Tenemos 98 miembros registradosEl último usuario registrado es Lawdesifi
Nuestros miembros han publicado un total de 6208 mensajes en 777 argumentos.
KGC_BattleCamera
Drupogame :: RPG Maker :: RPG maker XP :: Scripts
Página 1 de 1.
KGC_BattleCamera
Este script lo que hace es dar efectos de movimiento de camara.
Solo compatible con batallas frontales.
Aqui el script:
Solo compatible con batallas frontales.
Aqui el script:
- Código:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ?????? - KGC_BattleCamera?
#_/----------------------------------------------------------------------------
#_/ ?????????????????
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ? ???????? - Customize ?
#==============================================================================
module KGC
# ???????????
BC_SPEED_INIT = 24
end
#### BC_SPEED_INIT
### Initial velocity of camera.
#???????????????????????????????????????
$imported = {} if $imported == nil
$imported["BattleCamera"] = true
#==============================================================================
# ¦ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :battle_camera_enabled # ???????
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_KGC_BattleCamera initialize
def initialize
initialize_KGC_BattleCamera
@battle_camera_enabled = true
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
attr_reader :origin_x, :origin_y
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_KGC_BattleCamera initialize
def initialize(troop_id, member_index)
# ???????
initialize_KGC_BattleCamera(troop_id, member_index)
@cmr_enabled = $game_temp.battle_camera_enabled
@origin_x = $data_troops[@troop_id].members[@member_index].x
@origin_y = $data_troops[@troop_id].members[@member_index].y
end
#--------------------------------------------------------------------------
# ? ????? X ?????
#--------------------------------------------------------------------------
def screen_x
return @cmr_enabled ? (@origin_x - $scene.camera.x * self.zoom) : @origin_x
end
#--------------------------------------------------------------------------
# ? ????? Y ?????
#--------------------------------------------------------------------------
def screen_y
return @cmr_enabled ? (@origin_y - $scene.camera.y * self.zoom) : @origin_y
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def zoom
n = @cmr_enabled ?
((1.0 + $scene.camera.z / 512.0) * ((@origin_y - 304) / 256.0 + 1)) : 1
return n
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias update_KGC_BattleCamera update
def update
# ???????
update_KGC_BattleCamera
return if !$game_temp.battle_camera_enabled || @battler == nil
if @battler.is_a?(Game_Enemy)
# ????
self.zoom_x = self.zoom_y = @battler.zoom
end
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
alias update_KGC_BattleCamera update
def update
# ???????
update_KGC_BattleCamera
=begin
if Input::trigger?(Input::Z)
c = $scene.camera
zoom = c.z / 512.0 + 1
p "#{c.x}, #{c.y}, #{c.z}"
p "#{@battleback_sprite.x + 320}, #{@battleback_sprite.y + 304}, #{zoom}"
end
=end
# ???????
if $game_temp.battle_camera_enabled
update_camera
end
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def update_camera
cx = $scene.camera.x
cy = $scene.camera.y
cz = $scene.camera.z
bx = @battleback_sprite.x + 320
by = @battleback_sprite.y + 304
if bx != cx || by != cy || @bz != cz
# ????
zoom = cz / 512.0 + 1
@battleback_sprite.zoom_x = zoom * 2
@battleback_sprite.zoom_y = zoom * 2
# ?????
if $imported["Base Reinforce"] && KGC::BR_BATTLEBACK_FULL
@battleback_sprite.ox = @battleback_sprite.bitmap.width >> 1
@battleback_sprite.oy = @battleback_sprite.bitmap.height >> 1
mag_x = 640.0 / @battleback_sprite.bitmap.width
mag_y = 480.0 / @battleback_sprite.bitmap.height
@battleback_sprite.zoom_x *= mag_x
@battleback_sprite.zoom_y *= mag_y
end
# ????
@battleback_sprite.x = -cx * zoom / 2 - 320 + @battleback_sprite.ox * 2
@battleback_sprite.y = -cy * zoom / 2 - 144 + @battleback_sprite.oy * 2
@bz = cz
end
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Camera
#------------------------------------------------------------------------------
# ????????????????
#==============================================================================
class Camera
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_reader :x, :y, :z
attr_accessor :move_speed
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
@x = @y = @z = 0
@move_x = @move_y = @move_z = 0
@move_speed = KGC::BC_SPEED_INIT
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def move(x, y, z)
@move_x = x - @x - 320
@move_y = y - @y - 160
@move_z = z - @z
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def move_target(target)
if !$game_temp.battle_camera_enabled || target == nil ||
!target.is_a?(Game_Enemy)
return
end
tx = target.origin_x
ty = target.origin_y - 144
tz = (304 - target.origin_y) * 4.5
move(tx, ty, tz)
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def centering
@move_x = -@x
@move_y = -@y
@move_z = -@z
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def update
return unless $game_temp.battle_camera_enabled
# X????
mv = [[@move_x.abs * @move_speed / 160, 1].max, @move_speed].min
if @move_x > 0
@x += mv
@move_x = [@move_x - mv, 0].max
elsif @move_x < 0
@x -= mv
@move_x = [@move_x + mv, 0].min
end
# Y????
mv = [[@move_y.abs * @move_speed / 160, 1].max, @move_speed].min
if @move_y > 0
@y += mv
@move_y = [@move_y - mv, 0].max
elsif @move_y < 0
@y -= mv
@move_y = [@move_y + mv, 0].min
end
# Z????
mv = [[@move_z.abs * @move_speed / 96, 1].max, @move_speed * 2].min
if @move_z > 0
@z += mv
@move_z = [@move_z - mv, 0].max
elsif @move_z < 0
@z -= mv
@move_z = [@move_z + mv, 0].min
end
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Scene_Battle (???? 1)
#==============================================================================
class Scene_Battle
attr_reader :camera
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
alias main_KGC_BattleCamera main
def main
# ?????
@camera = Camera.new
# ???????
main_KGC_BattleCamera
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias update_KGC_BattleCamera update
def update
# ?????/????
unless @_initialized_camera
troop = $data_troops[@troop_id]
$game_temp.battle_camera_enabled = !(troop.name =~ /\[CMR_D\]/i)
@_initialized_camera = true
end
@camera.update
# ???????
update_KGC_BattleCamera
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Scene_Battle (???? 3)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
alias update_phase3_enemy_select_KGC_BattleCamera update_phase3_enemy_select
def update_phase3_enemy_select
# ???????????
if $game_temp.battle_camera_enabled &&
(!$imported["ActiveCountBattle"] || @action_battler == nil)
@camera.move_target(@enemy_arrow.enemy)
end
# ???????
update_phase3_enemy_select_KGC_BattleCamera
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias end_enemy_select_KGC_BattleCamera end_enemy_select
def end_enemy_select
# ?????????
if $game_temp.battle_camera_enabled &&
(!$imported["ActiveCountBattle"] || @action_battler == nil)
@camera.move(320, 160, 0)
end
# ???????
end_enemy_select_KGC_BattleCamera
end
end
#???????????????????????????????????????
#==============================================================================
# ¦ Scene_Battle (???? 4)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? ?????? (??????? ???? 3 : ??????????)
#--------------------------------------------------------------------------
alias update_phase4_step3_KGC_BattleCamera update_phase4_step3
def update_phase4_step3
# ?????
if $game_temp.battle_camera_enabled
move_camera
end
# ???????
update_phase4_step3_KGC_BattleCamera
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def move_camera
if @active_battler.is_a?(Game_Actor) && @target_battlers != []
if @target_battlers.size > 1
@camera.move(320, 160, -96)
else
@camera.move_target(@target_battlers[0])
end
elsif @active_battler.is_a?(Game_Enemy)
@camera.move_target(@active_battler)
end
end
#--------------------------------------------------------------------------
# ? ?????? (??????? ???? 6 : ??????)
#--------------------------------------------------------------------------
alias update_phase4_step6_KGC_BattleCamera update_phase4_step6
def update_phase4_step6
# ???????????
@camera.centering if $game_temp.battle_camera_enabled
# ???????
update_phase4_step6_KGC_BattleCamera
end
end
The_King_Jaas- Co-Administrador
- Mensajes : 1737
Fecha de inscripción : 02/02/2011
Drupogame :: RPG Maker :: RPG maker XP :: Scripts
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.
Lun Ene 23, 2012 11:32 pm por edux
» edux returns
Lun Ene 23, 2012 11:30 pm por edux
» The Elder Scrolls IV: Oblivion
Vie Ene 20, 2012 11:28 pm por Aljevalsar
» Kojima promete que habrá un Metal Gear Solid de auténtico sigilo
Jue Dic 22, 2011 7:33 pm por Anime_Maker
» Este fin de semana habrá nuevos modos para Modern Warfare 3
Jue Dic 15, 2011 12:03 pm por Akeo
» Kojima quiso crear un Metal Gear Solid 5 ambientado en la Segunda Guerra Mundial
Jue Dic 15, 2011 11:01 am por Akeo
» Darksiders II se dejará ver en los Spike VGA
Miér Dic 14, 2011 11:50 am por Akeo
» El creador de Bayonetta desmiente estar implicado en el desarrollo de Metal Gear Rising
Miér Dic 14, 2011 1:54 am por Akeo
» Los creadores de Bayonetta se encargan del desarrollo de Metal Gear Rising
Miér Dic 14, 2011 1:52 am por Akeo
» En Construccion: Mundo Abismal
Lun Oct 24, 2011 4:03 am por SagahonArturo
» Visceral Games busca nuevo personal para la franquicia Dead Space
Mar Oct 11, 2011 3:22 am por The_King_Jaas
» buenas
Mar Oct 11, 2011 3:21 am por The_King_Jaas
» Batman: Arkham City llegará "sin ninguna limitación"
Sáb Oct 08, 2011 1:44 am por Akeo
» Los creadores de Bulletstorm admiten divertidos que el juego tenía demasiadas palabras malsonantes
Sáb Oct 08, 2011 1:41 am por Akeo
» PES 2012: El primer DLC estará disponible el 11 de octubre
Sáb Oct 08, 2011 1:39 am por Akeo