-
Finntroll
-
-
Вне сайта
-
Мастер
-
- Сообщений: 167
- Спасибо получено: 8
-
-
|
Вот...
#******************************************************************************
# Display Background Based on Area *
# Версия 1.02. Автор Diakonos *
# Основано на Battle Backgrounds автора Synthesize *
#******************************************************************************
# Фон Битвы (Battle BG by Area)
# Что нового: Ver 1.02
# 1. Added display Background image based on Area name
# 2. Error checking - Displays default VX background if error
# 3. Cleaner code
#
# Ver 1.01
# 1. Ability to display default VX background added
#
# Ver 1.00
# Initial Release - Displays Background image based on Area_ID
#
class Game_Player < Game_Character
def which_area_in
for area in $data_areas.values
return area.id if in_area?(area)
end
return 1
end
def which_area_name
for area in $data_areas.values
return area.name if in_area?(area)
end
return "Woods"
# какой фон отображается, если Вы не в area
end
end
module SynBattleB
# положите фоны битв в папку 'Картинки' (Graphics/Pictures)
# Format = {area_id => "имя файла фона"}
# You only need to fill this in if
# добавляя фоны битвы, не забывайте ставить после них запятые
Battle_background =
{
1 => "Grassland", #если Use_VX_BG равно true, то это поле игнорируется
#и используется VX BG по умолчанию.
2 => "Grassland",
3 => "Grassland",
4 => "Woods",
5 => "Grassland",
6 => "Woods",
7 => "Woods",
8 => "Woods",
9 => "Woods",
10 => "Cave",
11 => "Woods",
12 => "Woods",
13 => "Woods",
14 => "Woods",
15 => "Pass",
16 => "Cave",
17 => "Cave",
18 => "Woods",
19 => "Woods",
20 => "Woods",
21 => "Woods",
22 => "Pass",
23 => "Desert",
24 => "Desert",
25 => "Desert",
26 => "Desert",
27 => "Desert",
28 => "FortOutside",
29 => "FortInside",
30 => "WaterCave",
31 => "FireCave",
32 => "PassRain",
33 => "Snowfield",
34 => "Snowfield",
35 => "IceCave",
36 => "Damus",
37 => "Dracus",
38 => "Dracus",
39 => "Dracus",
40 => "Dracus",
41 => "Darkus",
42 => "Litus",
43 => "Litus",
44 => "Cave",
45 => "WaterCave",
46 => "FortInside",
47 => "FireCave",
48 => "Dracus",
49 => "Darkus",
50 => "Litus"
}
#
#You only need to fill this area in if "Use_Area_Name=true" otherwise use above.
# Format = {area_name => "Background File Name"}
# Using area name is really the best, because background is not based on
# area_id but rather area_name.
# (i.e. multiple areas_ids can share the same background)
Battle_area_name_background =
{
"Grassland" => "Grassland",
"Forest" => "Forest",
"Desert" => "Desert",
"Swamp" => "Swamp",
"Tower" => "Tower02"
}
#If true, uses area name to set background instead of id#
#You can use either method, but using Area name is pretty cool.
Use_Area_Name = false
# Create the large shadow battlefloor?
Create_battlefloor = false
# If you want you can use the standard VX background as slot #1
Use_VX_BG = false
end
#
# НаборСпрайтов_Битва
#
class Spriteset_Battle
alias syn_create_battlefloor create_battlefloor
#
# Фон VX по умолчанию
#
def def_battle_back_diakonos
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(90, 12)
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
@battleback_sprite.wave_amp = 8
@battleback_sprite.wave_length = 240
@battleback_sprite.wave_speed = 120
end
#
# Battle Background based on either Area Name or Area ID
#
def area_battle_back_diakonos
if SynBattleB::Use_Area_Name == false then
# Error Check, if any error don't crash, but display VX default background
if SynBattleB::Battle_background[$game_player.which_area_in]==nil then
def_battle_back_diakonos
else
image = SynBattleB::Battle_background[$game_player.which_area_in]
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = Cache.picture(image)
end
else
# Error Check, if any error don't crash, but display VX default background
if SynBattleB::Battle_area_name_background[$game_player.which_area_name]==nil then
def_battle_back_diakonos
else
image = SynBattleB::Battle_area_name_background[$game_player.which_area_name]
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = Cache.picture(image)
end
end
end
#
# Create Battleback
#
def create_battleback
if SynBattleB::Use_VX_BG == true and $game_player.which_area_in==1 then
#Checks if Use_VX_BG is true and if you are in area #1, if so it will
#display the standard VX swirly background. If not, it uses a picture.
def_battle_back_diakonos
else
#Run Display Picture Subroutine
area_battle_back_diakonos
end
end
def create_battlefloor
@battlefloor_sprite = Sprite.new(@viewport1)
syn_create_battlefloor if SynBattleB::Create_battlefloor == true
end
end
#******************************************************************************
# Display Background Based on Area *
# Ver 1.02 by Diakonos *
# Based on Battle Backgrounds by Synthesize *
#******************************************************************************
Самый простой, на мой взгляд, скрипт задников... правда тут он уже настроен под какую-то игру, но разобраться - труда не составит...
|