Bonjour, voilà, après un peu de taf et d'apprentissage en script, voici le fruit de mon travail: une grosse amélioration du script carte dresseur.
#==============================================================================
# ¦ Carte Dresseur
# Script Communauté PSP - Slash
# Ajout de rotation et animation du background par Zohran
# le 18/7/09
#-----------------------------------------------------------------------------
# Support de carte dresseur
#-----------------------------------------------------------------------------
# Pour changer l'image de vos badges, allez dans le dossier Icons de votre
# projet et remplacer les images BadgeX.png ou X est le numero du badge
#-----------------------------------------------------------------------------
# Interrupteurs occupés : 1001-1008 : Gestion des badge : activé ses
# intérupteurs lorsque vous recevez un badge
# ex : vous recevez le badge 1 alors activé l'intérupteur 1001
# 1002 pour le badge 2 etc ...
#-----------------------------------------------------------------------------
# Variables occupés : 1501-1504 : Gestion des Objectifs : Augmenter ou Diminuer
# ces Variables pour gerez vos objectifs
# La variable 1501 correspond a l'objectif 1
# La variable 1502 correspond a l'objectif 2 etc...
# Vous pouvez renomés les objectifs via le script ci dessous
#-----------------------------------------------------------------------------
module POKEMON_S_TCARD
# Nom des objectifs
OBJECTIF1 = "Premier Objectif"
OBJECTIF2 = "Deuxieme Objectif"
OBJECTIF3 = "Troisieme Objectif"
OBJECTIF4 = "Quatrieme Objectif"
end
class Scene_T_Card
def main
Graphics.freeze
@z_level = 10000
@fond=Viewport.new(0,0,640,480)
@fond.z = @z_level
@background = Plane.new(@fond)
@background.bitmap = Bitmap.new("Graphics/Pictures/T_Card_Back.PNG")
@background.z = @z_level
@carte = Sprite.new
@carte.bitmap = RPG::Cache.picture("T_Card.PNG")
@carte.x = 0
@carte.y = 0
@carte.z = @z_level
@perso = Sprite.new
if $game_variables[1000] == nil or $game_variables[1000] == 0
@perso.bitmap = RPG::Cache.picture("persogars.png")
end
if $game_variables[1000] == 1
@perso.bitmap = RPG::Cache.picture("persogars.png")
end
if $game_variables[1000] == 2
@perso.bitmap = RPG::Cache.picture("persofille.png")
end
@perso.x = 414
@perso.y = 162
@perso.z = @z_level + 2
@badge1 = Sprite.new
@badge2 = Sprite.new
@badge3 = Sprite.new
@badge4 = Sprite.new
@badge5 = Sprite.new
@badge6 = Sprite.new
@badge7 = Sprite.new
@badge8 = Sprite.new
@badge1.bitmap = RPG::Cache.icon("Badge1.png")
@badge2.bitmap = RPG::Cache.icon("Badge2.png")
@badge3.bitmap = RPG::Cache.icon("Badge3.png")
@badge4.bitmap = RPG::Cache.icon("Badge4.png")
@badge5.bitmap = RPG::Cache.icon("Badge5.png")
@badge6.bitmap = RPG::Cache.icon("Badge6.png")
@badge7.bitmap = RPG::Cache.icon("Badge7.png")
@badge8.bitmap = RPG::Cache.icon("Badge8.png")
@badge1.x = 146
@badge2.x = 194
@badge3.x = 242
@badge4.x = 290
@badge5.x = 338
@badge6.x = 386
@badge7.x = 434
@badge8.x = 482
@badge1.y = 336
@badge2.y = 336
@badge3.y = 336
@badge4.y = 336
@badge5.y = 336
@badge6.y = 336
@badge7.y = 336
@badge8.y = 336
@badge1.z = @z_level + 2
@badge2.z = @z_level + 2
@badge3.z = @z_level + 2
@badge4.z = @z_level + 2
@badge5.z = @z_level + 2
@badge6.z = @z_level + 2
@badge7.z = @z_level + 2
@badge8.z = @z_level + 2
if $game_switches[1001] == true
@badge1.opacity = 255
else
@badge1.opacity = 0
end
if $game_switches[1002] == true
@badge2.opacity = 255
else
@badge2.opacity = 0
end
if $game_switches[1003] == true
@badge3.opacity = 255
else
@badge3.opacity = 0
end
if $game_switches[1004] == true
@badge4.opacity = 255
else
@badge4.opacity = 0
end
if $game_switches[1005] == true
@badge5.opacity = 255
else
@badge5.opacity = 0
end
if $game_switches[1006] == true
@badge6.opacity = 255
else
@badge6.opacity = 0
end
if $game_switches[1007] == true
@badge7.opacity = 255
else
@badge7.opacity = 0
end
if $game_switches[1008] == true
@badge8.opacity = 255
else
@badge8.opacity = 0
end
@card = Window_T_Card.new
@card.x = 0
@card.y = 0
@card.z = @z_level + 2
@card.opacity = 0
@spriteset = Spriteset_Map.new
Graphics.transition
loop do
@background.ox += 1
@background.oy += 1
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
end
def update
@spriteset.update
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
@badge1.dispose
@badge2.dispose
@badge3.dispose
@badge4.dispose
@badge5.dispose
@badge6.dispose
@badge7.dispose
@badge8.dispose
@card.dispose
@spriteset.dispose
@carte.dispose
@perso.dispose
$scene = POKEMON_S::Pokemon_Menu.new
return
end
if Input.trigger?(Input::C)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
@badge1.dispose
@badge2.dispose
@badge3.dispose
@badge4.dispose
@badge5.dispose
@badge6.dispose
@badge7.dispose
@badge8.dispose
@card.dispose
@spriteset.dispose
for i in 0..47
@carte.zoom_x -=0.02
@carte.x += 7
@perso.zoom_x -=0.02
@perso.x -= 0.99
Graphics.update
end
@carte.dispose
@perso.dispose
$scene = Scene_T_Card_Verso.new
return
end
end
end
class Window_T_Card < Window_Base
include POKEMON_S
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.font.color = Color.new(255,255,255)
@captured = 0
for i in 1..$data_pokedex.length-1
if $data_pokedex[i][1]
@captured += 1
end
end
refresh
end
def refresh
self.contents.clear
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(82, 84, 120, 32,Player.name)
self.contents.draw_text(184, 84, 120, 32,"ID " + Player.id.to_s, 2)
self.contents.draw_text(365, 70, 120, 32, "Code Echange",2)
self.contents.draw_text(351, 98, 120, 32, Player.trainer_trade_code,2)
@order = [0,1,2,3,4,5]
if $pokemon_party.size > 0
for i in 0..($pokemon_party.size - 1)
@pokemon = $pokemon_party.actors[@order[i]]
id = @pokemon.id
idx = (id - 1 )% 15
idy = (id - 1 ) / 15
xrect = idx * 100
yrect = idy * 60
src_rect = Rect.new(xrect, yrect, 100, 60)
bitmap = RPG::Cache.picture("T_Card Pokémon.PNG")
if i < 3
if @pokemon.egg
bitmap = RPG::Cache.picture("T_Card_Eggs.PNG")
src_rect = Rect.new(0, 0, 100, 60)
self.contents.blt(70 + 104 * i, 156, bitmap, src_rect, 255)
else
self.contents.blt(70 + 104 * i, 156, bitmap, src_rect, 255)
draw_gender(154 +104 * i, 190, @pokemon.gender)
end
else
if @pokemon.egg
bitmap = RPG::Cache.picture("T_Card_Eggs.PNG")
src_rect = Rect.new(0, 0, 100, 60)
self.contents.blt(70 + 104 * (i-3), 220, bitmap, src_rect, 255)
else
self.contents.blt(70 + 104 * (i-3), 220, bitmap, src_rect, 255)
draw_gender(154 + 104 * (i-3), 254, @pokemon.gender)
end
end
end
return
end
end
def draw_gender(x, y, gender)
if gender == 1
rect = Rect.new(0, 0, 18, 33)
bitmap = RPG::Cache.picture("Maleb.png")
self.contents.blt(x, y, bitmap, rect, 255)
end
if gender == 2
rect = Rect.new(0, 0, 18, 33)
bitmap = RPG::Cache.picture("Femaleb.png")
self.contents.blt(x, y, bitmap, rect, 255)
end
end
end
class Scene_T_Card_Verso
def main
Graphics.freeze
@z_level = 10000
@fond=Viewport.new(0,0,640,480)
@fond.z = @z_level
@background = Plane.new(@fond)
@background.bitmap = Bitmap.new("Graphics/Pictures/T_Card_Back.PNG")
@background.z = @z_level
@carte = Sprite.new
@carte.bitmap = RPG::Cache.picture("T_Card_Verso.PNG")
@carte.x = 0
@carte.y = 0
@carte.z = @z_level
@Verso = Window_T_Card_Verso.new
@Verso.x = 0
@Verso.y = 0
@Verso.z = @z_level + 2
@Verso.opacity = 0
@spriteset = Spriteset_Map.new
Graphics.transition
loop do
@background.ox += 1
@background.oy += 1
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
@carte.dispose
end
def update
@spriteset.update
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
@Verso.dispose
@spriteset.dispose
$scene = POKEMON_S::Pokemon_Menu.new
return
end
if Input.trigger?(Input::C)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
@Verso.dispose
@spriteset.dispose
for i in 0..47
@carte.zoom_x -=0.02
@carte.x += 7
Graphics.update
end
$scene = Scene_T_Card.new
return
end
end
end
class Window_T_Card_Verso < Window_Base
include POKEMON_S
include POKEMON_S_TCARD
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.font.color = Color.new(255,255,255)
@captured = 0
@viewed = 0
for i in 1..$data_pokedex.length-1
if $data_pokedex[i][1]
@captured += 1
end
if $data_pokedex[i][0]
@viewed += 1
end
end
refresh
end
def refresh
self.contents.clear
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(82, 84, 120, 32,Player.name)
self.contents.draw_text(184, 84, 120, 32,"ID " + Player.id.to_s, 2)
self.contents.draw_text(365, 70, 120, 32, "Code Echange",2)
self.contents.draw_text(351, 98, 120, 32, Player.trainer_trade_code,2)
self.contents.draw_text(74, 300, 300, 32, "Argent : " + $pokemon_party.money.to_s + "$")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
temps = sprintf("%02d:%02d", hour, min)
self.contents.draw_text(336, 300, 300, 32, "Temps de jeu : " + temps)
self.contents.draw_text(74, 340, 500, 32, "Pokédex : " + @captured.to_s + " Capturés / " + @viewed.to_s + " Aperçus")
self.contents.font.color = Color.new(41,53,57)
self.contents.draw_text(74, 120, 380, 64, "■ " + OBJECTIF1)
self.contents.draw_text(74, 160, 380, 64, "■ " + OBJECTIF2)
self.contents.draw_text(74, 200, 380, 64, "■ " + OBJECTIF3)
self.contents.draw_text(74, 240, 380, 64, "■ " + OBJECTIF4)
self.contents.draw_text(156, 120, 380, 64, $game_variables[1501].to_s,2)
self.contents.draw_text(156, 160, 380, 64, $game_variables[1502].to_s,2)
self.contents.draw_text(156, 200, 380, 64, $game_variables[1503].to_s,2)
self.contents.draw_text(156, 240, 380, 64, $game_variables[1504].to_s,2)
return
end
end