AccueilAccueil  PortailPortail  CalendrierCalendrier  TutorielsTutoriels  FAQFAQ  RechercherRechercher  S'enregistrerS'enregistrer  MembresMembres  GroupesGroupes  ConnexionConnexion  

Partagez | 
 

 Livre des objets obtenus depuis le début du jeu avec %

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Jordinateur
Blob
Blob
avatar

Nombre de messages : 260
Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^)
Humeur/Caractère : Aller a l'école T_T
Date d'inscription : 12/05/2006

MessageSujet: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 1:15

Cela vous permettra de créer un livre, qui vous dira quels objets vous avez possédé depuis le début, et combien de fois

Arrow Créez un script appellé "Scene_ItemBook" et collez ce code :
Code:
module Item_Book_Config
SHOW_COMPLETE_TYPE = 3

FIRST_EQUIP_ADD = true
end

class Data_ItemBook
attr_reader :item_kind_name
attr_reader :weapon_kind_name
attr_reader :armor_kind_name
attr_reader :kind_row
attr_reader :item_id_data
attr_reader :weapon_id_data
attr_reader :armor_id_data
attr_reader :item_kind_element_name
attr_reader :weapon_kind_element_name
attr_reader :armor_kind_element_name
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize

# ↓以下、設定用のいろいろ
@item_kind_name = ["objet"]
@weapon_kind_name = ["arme"]
@armor_kind_name = ["protection"]
@kind_row = ["objet",
"arme",
"protection"]
@item_kind_element_name = []
@weapon_kind_element_name = []
@armor_kind_element_name = []
# ↑ココまで

@item_id_data = item_book_id_set
@weapon_id_data = weapon_book_id_set
@armor_id_data = armor_book_id_set
end
#--------------------------------------------------------------------------
# ● 指定された種類表示名の情報を返す
#--------------------------------------------------------------------------
def kind_search(name)
if @item_kind_name.include?(name)
return [0, @item_kind_name.index(name)]
elsif @weapon_kind_name.include?(name)
return [1, @weapon_kind_name.index(name)]
elsif @armor_kind_name.include?(name)
return [2, @armor_kind_name.index(name)]
end
end
#--------------------------------------------------------------------------
# ● 図鑑用登録無視属性取得
#--------------------------------------------------------------------------
def no_add_element
no_add = 0
# 登録無視の属性IDを取得
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /図鑑登録無効/
no_add = i
break
end
end
return no_add
end

#--------------------------------------------------------------------------
# ● 指定された属性名のIDを返す
#--------------------------------------------------------------------------
def element_search(element_name)
return nil if element_name == nil
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /^#{element_name}/
return i
end
end
end

#--------------------------------------------------------------------------
# ● 図鑑用アイテムID設定
#--------------------------------------------------------------------------
def item_book_id_set
data = []
no_add = no_add_element
if @item_kind_element_name.size == 0
data[0] = [0]
for i in 1...$data_items.size
item = $data_items[i]
next if item.name == ""
next if item.element_set.include?(no_add)
data[0].push(item.id)
end
else
for i in 0...@item_kind_element_name.size
data[i] = [0]
element_id = element_search(@item_kind_element_name[i])
for j in 1...$data_items.size
item = $data_items[j]
next if item.name == ""
next if item.element_set.include?(no_add)
if item.element_set.include?(element_id)
data[i].push(item.id)
end
end
end
end
return data
end
#--------------------------------------------------------------------------
# ● 図鑑用武器ID設定
#--------------------------------------------------------------------------
def weapon_book_id_set
data = []
no_add = no_add_element
if @weapon_kind_element_name.size == 0
data[0] = [0]
for i in 1...$data_weapons.size
item = $data_weapons[i]
next if item.name == ""
next if item.element_set.include?(no_add)
data[0].push(item.id)
end
else
for i in 0...@weapon_kind_element_name.size
data[i] = [0]
element_id = element_search(@weapon_kind_element_name[i])
for j in 1...$data_weapons.size
item = $data_weapons[j]
next if item.name == ""
next if item.element_set.include?(no_add)
if item.element_set.include?(element_id)
data[i].push(item.id)
end
end
end
end
return data
end
#--------------------------------------------------------------------------
# ● 図鑑用防具ID設定
#--------------------------------------------------------------------------
def armor_book_id_set
data = []
no_add = no_add_element
if @armor_kind_element_name.size == 0
data[0] = [0]
for i in 1...$data_armors.size
item = $data_armors[i]
next if item.name == ""
next if item.guard_element_set.include?(no_add)
data[0].push(item.id)
end
else
for i in 0...@armor_kind_element_name.size
data[i] = [0]
element_id = element_search(@armor_kind_element_name[i])
for j in 1...$data_armors.size
item = $data_armors[j]
next if item.name == ""
next if item.guard_element_set.include?(no_add)
if item.guard_element_set.include?(element_id)
data[i].push(item.id)
end
end
end
end
return data
end
end

class Window_Base < Window
#--------------------------------------------------------------------------
# ● 基本属性表示
#--------------------------------------------------------------------------
def draw_attack_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("Feu") if elem == "Feu"
elem_temp.push("Glace") if elem == "Galce"
elem_temp.push("Eclair") if elem == "Eclair"
elem_temp.push("Eau") if elem == "Eau"
elem_temp.push("Terre") if elem == "Terre"
elem_temp.push("Vent") if elem == "Vent"
elem_temp.push("Lumière") if elem == "lumière"
elem_temp.push("Tenèbre") if elem == "Tenèbre"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "rien")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ● 武器属性表示
#--------------------------------------------------------------------------
def draw_attack_wp_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("斬") if elem == "斬"
elem_temp.push("打") if elem == "打"
elem_temp.push("突") if elem == "突"
elem_temp.push("射") if elem == "射"
elem_temp.push("魔") if elem == "魔"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "なし")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Jordinateur
Blob
Blob
avatar

Nombre de messages : 260
Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^)
Humeur/Caractère : Aller a l'école T_T
Date d'inscription : 12/05/2006

MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 1:16

Code:
# ● 特攻属性表示
#--------------------------------------------------------------------------
def draw_attack_weak_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("Undead") if elem == "Contre Undead"
elem_temp.push("Reptile") if elem == "Contre Reptile"
elem_temp.push("Aquatiq'") if elem == "Contre Aquatiq'"
elem_temp.push("Bête") if elem == "Contre Bête"
elem_temp.push("Ogre") if elem == "Contre Ogre"
elem_temp.push("Oiseau") if elem == "Contre Oiseau"
elem_temp.push("Démon") if elem == "Contre Démon"
elem_temp.push("Ange") if elem == "Contre Ange"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Rien")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ● ステート付与表示
#--------------------------------------------------------------------------
def draw_attack_add_state(x, y, plus_state_set)
state_temp = []
for i in plus_state_set
state = $data_states[i]
state_temp.push(state.name) if state.name != ""
end
if state_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Rien")
return
end
ox = 0
oy = 0
for name in state_temp
cx = self.contents.text_size(name).width
if ox + cx + 4 >= self.contents.width - 128
ox = 0
oy += 1
end
self.contents.draw_text(x+ox, y+oy*32, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ● 効果範囲を返す
#--------------------------------------------------------------------------
def draw_scope(scope)
case scope
when 0
return "Rien"
when 1
return "Un seul ennemi"
when 2
return "Tous les ennemis"
when 3
return "Un seul allié"
when 4
return "Tous les alliés"
when 5
return "Un seul allié"
when 6
return "Tous les alliés"
when 7
return "Employer"
end
end
end

class Game_Temp
attr_accessor :item_book_data
alias temp_item_book_data_initialize initialize
def initialize
temp_item_book_data_initialize
@item_book_data = Data_ItemBook.new
end
end

class Game_Actor < Game_Battler
alias item_book_game_actor_initialize initialize
def initialize(actor_id)
item_book_game_actor_initialize(actor_id)
if Item_Book_Config::FIRST_EQUIP_ADD
$game_party.add_weapon_count(@weapon_id, 0) if @weapon_id > 0
$game_party.add_armor_count(@armor1_id, 0) if @armor1_id > 0
$game_party.add_armor_count(@armor2_id, 0) if @armor2_id > 0
$game_party.add_armor_count(@armor3_id, 0) if @armor3_id > 0
$game_party.add_armor_count(@armor4_id, 0) if @armor4_id > 0
end
end
end

class Game_Party
attr_accessor :item_count # 入手アイテム情報(図鑑用)
attr_accessor :weapon_count # 入手武器情報(図鑑用)
attr_accessor :armor_count # 入手防具情報(図鑑用)
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias item_book_info_initialize initialize
def initialize
item_book_info_initialize
@item_count = {}
@weapon_count = {}
@armor_count = {}
end
alias item_book_gain_item gain_item
def gain_item(item_id, n)
add_item_count(item_id, 0) if n > 0
item_book_gain_item(item_id, n)
end
alias item_book_gain_weapon gain_weapon
def gain_weapon(item_id, n)
add_weapon_count(item_id, 0) if n > 0
item_book_gain_weapon(item_id, n)
end
alias item_book_gain_armor gain_armor
def gain_armor(item_id, n)
add_armor_count(item_id, 0) if n > 0
item_book_gain_armor(item_id, n)
end

#--------------------------------------------------------------------------
# ● アイテムの獲得情報の追加(図鑑用)
# 0:無獲得 1:獲得済
#--------------------------------------------------------------------------
def add_item_count(item_id, type = 0)
if type == -1
@item_count[item_id] = 0
else
@item_count[item_id] = 1
end
end
#--------------------------------------------------------------------------
# ● 武器の獲得情報の追加(図鑑用)
# 0:無獲得 1:獲得済
#--------------------------------------------------------------------------
def add_weapon_count(weapon_id, type = 0)
if type == -1
@weapon_count[weapon_id] = 0
else
@weapon_count[weapon_id] = 1
end
end
#--------------------------------------------------------------------------
# ● 防具の獲得情報の追加(図鑑用)
# 0:無獲得 1:獲得済
#--------------------------------------------------------------------------
def add_armor_count(armor_id, type = 0)
if type == -1
@armor_count[armor_id] = 0
else
@armor_count[armor_id] = 1
end
end
#--------------------------------------------------------------------------
# ● アイテム図鑑の最大登録数を取得
#--------------------------------------------------------------------------
def item_book_max
kind_data = []
kind_data[0] = $game_temp.item_book_data.item_kind_name
kind_data[1] = $game_temp.item_book_data.weapon_kind_name
kind_data[2] = $game_temp.item_book_data.armor_kind_name
size = 0
for i in 0..2
for kind in kind_data[i]
size += item_book_category_max(kind)
end
end
return size
end
#--------------------------------------------------------------------------
# ● アイテム図鑑の現在登録数を取得
#--------------------------------------------------------------------------
def item_book_now
kind_data = []
kind_data[0] = $game_temp.item_book_data.item_kind_name
kind_data[1] = $game_temp.item_book_data.weapon_kind_name
kind_data[2] = $game_temp.item_book_data.armor_kind_name
size = 0
for i in 0..2
for kind in kind_data[i]
size += item_book_category_now(kind)
end
end
return size
end
#--------------------------------------------------------------------------
# ● アイテム図鑑の完成率を取得
#--------------------------------------------------------------------------
def item_book_complete_percentage
i_max = item_book_max.to_f
i_now = item_book_now.to_f
comp = i_now / i_max * 100
return comp.truncate
end
#--------------------------------------------------------------------------
# ● アイテム図鑑のカテゴリー別最大登録数を取得
# category:カテゴリー名
#--------------------------------------------------------------------------
def item_book_category_max(category)
kind_data = $game_temp.item_book_data.kind_search(category)
case kind_data[0]
when 0
id_data = $game_temp.item_book_data.item_id_data.dup
when 1
id_data = $game_temp.item_book_data.weapon_id_data.dup
when 2
id_data = $game_temp.item_book_data.armor_id_data.dup
end
index = kind_data[1]
size = id_data[index].size - 1
return size
end
#--------------------------------------------------------------------------
# ● アイテム図鑑のカテゴリー別現在登録数を取得
# category:カテゴリー名
#--------------------------------------------------------------------------
def item_book_category_now(category)
kind_data = $game_temp.item_book_data.kind_search(category)
index = kind_data[1]
case kind_data[0]
when 0
now_item_info = @item_count.keys
elename = $game_temp.item_book_data.item_kind_element_name[index]
item_set = $data_items
when 1
now_item_info = @weapon_count.keys
elename = $game_temp.item_book_data.weapon_kind_element_name[index]
item_set = $data_weapons
when 2
now_item_info = @armor_count.keys
elename = $game_temp.item_book_data.armor_kind_element_name[index]
item_set = $data_armors
end
# 登録無視の属性IDを取得
no_add = $game_temp.item_book_data.no_add_element
element_id = $game_temp.item_book_data.element_search(elename)
new_item_info = []
for i in now_item_info
item = item_set[i]
next if item == nil
next if item.name == ""
case item
when RPG::Item
ele_set = item.element_set
when RPG::Weapon
ele_set = item.element_set
when RPG::Armor
ele_set = item.guard_element_set
end
next if ele_set.include?(no_add)
if element_id == nil or ele_set.include?(element_id)
new_item_info.push(item.id)
end
end
return new_item_info.size

end
#--------------------------------------------------------------------------
# ● アイテム図鑑のカテゴリー別完成率を取得
# category:カテゴリー名
#--------------------------------------------------------------------------
def item_book_category_complete_percentage(category)
i_max = item_book_category_max(category).to_f
i_now = item_book_category_now(category).to_f
comp = i_now / i_max * 100
return comp.truncate
end
end

class Interpreter
def item_book_max(category=nil)
if category == nil
return $game_party.item_book_max
else
return $game_party.item_book_category_max(category)
end
end
def item_book_now(category=nil)
if category == nil
return $game_party.item_book_now
else
return $game_party.item_book_category_now(category)
end
end
def item_book_comp(category=nil)
if category == nil
return $game_party.item_book_complete_percentage
else
return $game_party.item_book_category_complete_percentage(category)
end
end
end

class Window_ItemBook < Window_Selectable
attr_reader :data
attr_reader :item_kind
attr_reader :item_index
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(index=0)
super(0, 64, 640, 416)
@column_max = 2
@book_data = $game_temp.item_book_data
@data = data_set(index)
@data.shift
#@data.sort!
@item_max = @data.size
@item_kind = index
self.index = 0
#refresh
end
def new_data_set(index)
@data = data_set(index)
@data.shift
#@data.sort!
@item_max = @data.size
end
#--------------------------------------------------------------------------
# ● 入手データを取得
#--------------------------------------------------------------------------
def data_set(index)
kind_row_data = @book_data.kind_search(@book_data.kind_row[index])
@item_kind = kind_row_data[0]
@item_index = kind_row_data[1]
data = []
case @item_kind
when 0
data = @book_data.item_id_data[@item_index].dup
when 1
data = @book_data.weapon_id_data[@item_index].dup
when 2
data = @book_data.armor_id_data[@item_index].dup
end
return data
end
#--------------------------------------------------------------------------
# ● 表示許可取得
#--------------------------------------------------------------------------
def show?(kind, id)
case kind
when 0
if $game_party.item_count[id] == 0 or $game_party.item_count[id] == nil
return false
else
return true
end
when 1
if $game_party.weapon_count[id] == 0 or $game_party.weapon_count[id] == nil
return false
else
return true
end
when 2
if $game_party.armor_count[id] == 0 or $game_party.armor_count[id] == nil
return false
else
return true
end
end
end
#--------------------------------------------------------------------------
# ● アイテム取得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
#項目数が 0 でなければビットマップを作成し、全項目を描画
return if @item_max == 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_item(index)
case @item_kind
when 0
item = $data_items[@data[index]]
id = @book_data.item_id_data[@item_index].index(item.id)
when 1
item = $data_weapons[@data[index]]
id = @book_data.weapon_id_data[@item_index].index(item.id)
when 2
item = $data_armors[@data[index]]
id = @book_data.armor_id_data[@item_index].index(item.id)
end
return if item == nil
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 32, 32, id.to_s)
if show?(@item_kind, item.id)
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(x+48, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x+48 + 28, y, 212, 32, item.name, 0)
else
self.contents.draw_text(x+48 + 28, y, 212, 32,
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Jordinateur
Blob
Blob
avatar

Nombre de messages : 260
Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^)
Humeur/Caractère : Aller a l'école T_T
Date d'inscription : 12/05/2006

MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 1:17

Code:

"-----", 0)
return
end
end
end


class Window_ItemBook_Info < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0+64+64, 640, 480-64-64)
@book_data = $game_temp.item_book_data
self.contents = Bitmap.new(width - 32, height - 32)
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(item_id, item_kind, item_index)
self.contents.clear
self.contents.font.size = 22
case item_kind
when 0
draw_item_info(item_id, item_index)
when 1
draw_weapon_info(item_id, item_index)
when 2
draw_armor_info(item_id, item_index)
end
end
#--------------------------------------------------------------------------
# ● アイテム描画
#--------------------------------------------------------------------------
def draw_item_info(item_id, item_index)
item = $data_items[item_id]
rect = Rect.new(4, 0, 160, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = normal_color
id = @book_data.item_id_data[item_index].index(item.id)
self.contents.draw_text(4, 0, 32, 32, id.to_s)
self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
self.contents.font.color = normal_color
@help_window.set_text(item.description)
end
#--------------------------------------------------------------------------
# ● 武器描画
#--------------------------------------------------------------------------
def draw_weapon_info(item_id, item_index)
item = $data_weapons[item_id]
rect = Rect.new(4, 0, 160, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = normal_color
id = @book_data.weapon_id_data[item_index].index(item.id)
self.contents.draw_text(4, 0, 32, 32, id.to_s)
self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
self.contents.font.color = text_color(2)
self.contents.draw_text(4, 32, 48, 32, "ATK", 0)
self.contents.font.color = text_color(4)
self.contents.draw_text(4+128, 32, 48, 32, "DEF", 0)
self.contents.font.color = text_color(6)
self.contents.draw_text(4+256, 32, 48, 32, "MDF", 0)
self.contents.font.color = normal_color
self.contents.draw_text(4+48, 32, 48, 32, item.atk.to_s, 2)
self.contents.draw_text(4+48+128, 32, 48, 32, item.pdef.to_s, 2)
self.contents.draw_text(4+48+256, 32, 48, 32, item.mdef.to_s, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 64, 48, 32, "STR", 0)
self.contents.draw_text(4+128, 64, 48, 32, "DEX", 0)
self.contents.draw_text(4+256, 64, 48, 32, "SPD", 0)
self.contents.draw_text(4+384, 64, 48, 32, "MAT", 0)
self.contents.font.color = normal_color
self.contents.draw_text(4+48, 64, 48, 32, item.str_plus.to_s, 2)
self.contents.draw_text(4+48+128, 64, 48, 32, item.dex_plus.to_s, 2)
self.contents.draw_text(4+48+256, 64, 48, 32, item.agi_plus.to_s, 2)
self.contents.draw_text(4+48+384, 64, 48, 32, item.int_plus.to_s, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 96, 96, 32, "Attribut de base")
self.contents.draw_text(4, 128, 96, 32, "Attribut du Skill")
self.contents.draw_text(4, 160, 96, 32, "Attribut")
#self.contents.draw_text(4, 128, 96, 32, "武器属性")
self.contents.font.color = normal_color
draw_attack_element(4+96+16, 96, item.element_set)
draw_attack_weak_element(4+96+16, 128, item.element_set)
draw_attack_add_state(4+96+16, 160, item.plus_state_set)
#draw_attack_wp_element(4+96+16, 128, item.element_set)

@help_window.set_text(item.description)
end
#--------------------------------------------------------------------------
# ● 防具描画
#--------------------------------------------------------------------------
def draw_armor_info(item_id, item_index)
item = $data_armors[item_id]
rect = Rect.new(4, 0, 160, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = normal_color
id = @book_data.armor_id_data[item_index].index(item.id)
self.contents.draw_text(4, 0, 32, 32, id.to_s)
self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)
self.contents.draw_text(640-128-88-4, 0, 88, 32, item.price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(640-128, 0, 128, 32, $data_system.words.gold, 0)
self.contents.font.color = text_color(4)
self.contents.draw_text(4, 32, 48, 32, "DEF", 0)
self.contents.font.color = text_color(6)
self.contents.draw_text(4+128, 32, 48, 32, "MDF", 0)
self.contents.font.color = system_color
self.contents.draw_text(4+256, 32, 48, 32, "ESQ", 0)
self.contents.font.color = normal_color
self.contents.draw_text(4+48, 32, 48, 32, item.pdef.to_s, 2)
self.contents.draw_text(4+48+128, 32, 48, 32, item.mdef.to_s, 2)
self.contents.draw_text(4+48+256, 32, 48, 32, item.eva.to_s, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 64, 48, 32, "STR", 0)
self.contents.draw_text(4+128, 64, 48, 32, "DEX", 0)
self.contents.draw_text(4+256, 64, 48, 32, "SPD", 0)
self.contents.draw_text(4+384, 64, 48, 32, "MAT", 0)
self.contents.font.color = normal_color
self.contents.draw_text(4+48, 64, 48, 32, item.str_plus.to_s, 2)
self.contents.draw_text(4+48+128, 64, 48, 32, item.dex_plus.to_s, 2)
self.contents.draw_text(4+48+256, 64, 48, 32, item.agi_plus.to_s, 2)
self.contents.draw_text(4+48+384, 64, 48, 32, item.int_plus.to_s, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 96, 96, 32, "Attribut de base")
self.contents.draw_text(4, 128, 96, 32, "Attribut de l'attaque spéciale")
self.contents.draw_text(4, 160, 96, 32, "Stat DEF")
#self.contents.draw_text(4, 128, 96, 32, "武器耐性")
self.contents.font.color = normal_color
draw_attack_element(4+96+16, 96, item.guard_element_set)
draw_attack_weak_element(4+96+16, 128, item.guard_element_set)
draw_attack_add_state(4+96+16, 160, item.guard_state_set)
#draw_attack_wp_element(4+96+16, 128, item.guard_element_set)

@help_window.set_text(item.description)
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
#ダミー
end
end


class Scene_ItemBook
include Item_Book_Config
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main
# ウィンドウを作成
@title_window = Window_Base.new(0, 0, 640, 64)
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, "Bibliothèque des Objets", 0)
draw_comp
@main_window = Window_ItemBook.new
@main_window.active = false
@main_window.index = -1
@help_window = Window_Help.new
@help_window.z = 110
@help_window.y = 64
@help_window.visible = false
command = $game_temp.item_book_data.kind_row
@kind_window = Window_Command.new(160, command)
@kind_window.z = 110
@kind_window.x = 320 - @kind_window.width / 2
@kind_window.y = 240 - @kind_window.height / 2
@kind_window.active = true
# インフォウィンドウを作成 (不可視・非アクティブに設定)
@info_window = Window_ItemBook_Info.new
@info_window.z = 110
@info_window.visible = false
@info_window.active = false
# ヘルプウィンドウを関連付け
@info_window.help_window = @help_window
@visible_index = 0
@now_kind = nil
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if $scene != self
break
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Jordinateur
Blob
Blob
avatar

Nombre de messages : 260
Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^)
Humeur/Caractère : Aller a l'école T_T
Date d'inscription : 12/05/2006

MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 1:17

Code:

end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@title_window.dispose
@help_window.dispose
@main_window.dispose
@kind_window.dispose
@info_window.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
#@help_window.update
@main_window.update
@kind_window.update
@info_window.update
if @info_window.active
update_info
return
end
# メインウィンドウがアクティブの場合: update_target を呼ぶ
if @main_window.active
update_main
return
end
# 種類ウィンドウがアクティブの場合: update_kind を呼ぶ
if @kind_window.active
update_kind
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (種類ウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_kind
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
if @now_kind != @kind_window.index
@main_window.new_data_set(@kind_window.index)
@main_window.refresh
@now_kind = @kind_window.index
end
subtitle = $game_temp.item_book_data.kind_row[@kind_window.index]
title = "Bibliothèque des Objets:"+subtitle
@title_window.contents.clear
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, title, 0)
draw_comp(subtitle)
@kind_window.active = false
@kind_window.visible = false
@main_window.active = true
@main_window.index = 0
return
end
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_main
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
@main_window.active = false
@kind_window.active = true
@kind_window.visible = true
@main_window.index = -1
@title_window.contents.clear
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, "Bibliothèque des Objets", 0)
draw_comp
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
if @main_window.item == nil or
@main_window.show?(@main_window.item_kind, @main_window.item) == false
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
@main_window.active = false
@info_window.active = true
@info_window.visible = true
@visible_index = @main_window.index
@info_window.refresh(@main_window.item, @main_window.item_kind, @main_window.item_index)
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (インフォウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_info
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
@main_window.active = true
@info_window.active = false
@info_window.visible = false
@help_window.visible = false
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
return
end
if Input.trigger?(Input::L)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != 0
@visible_index -= 1
else
@visible_index = @main_window.data.size - 1
end
loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
return
end
if Input.trigger?(Input::R)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != @main_window.data.size - 1
@visible_index += 1
else
@visible_index = 0
end
loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
return
end
end
def draw_comp(category=nil)
if SHOW_COMPLETE_TYPE != 0
if category == nil
case SHOW_COMPLETE_TYPE
when 1
i_now = $game_party.item_book_now
i_max = $game_party.item_book_max
text = i_now.to_s + "/" + i_max.to_s
when 2
comp = $game_party.item_book_complete_percentage
text = comp.to_s + "%"
when 3
i_now = $game_party.item_book_now
i_max = $game_party.item_book_max
comp = $game_party.item_book_complete_percentage
text = i_now.to_s + "/" + i_max.to_s + " " + comp.to_s + "%"
end
else
case SHOW_COMPLETE_TYPE
when 1
i_now = $game_party.item_book_category_now(category)
i_max = $game_party.item_book_category_max(category)
text = i_now.to_s + "/" + i_max.to_s
when 2
comp = $game_party.item_book_category_complete_percentage(category)
text = comp.to_s + "%"
when 3
i_now = $game_party.item_book_category_now(category)
i_max = $game_party.item_book_category_max(category)
comp = $game_party.item_book_category_complete_percentage(category)
text = i_now.to_s + "/" + i_max.to_s + " " + comp.to_s + "%"
end
end
if text != nil
@title_window.contents.draw_text(320, 0, 288, 32, text, 2)
end
end
end
end



Arrow Ensuite, créez un objet (livre de préférence) ou un événement qui appelle ce script :
Code:
 $scene = Scene_ItemBook.new

Par contre je ne connais pas l'auteur, alors si l'auteur voit ce message, qu'il me le dise, pour que je marque son nom, merci...
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
GTK
Painteur GTK
Painteur GTK
avatar

Masculin
Nombre de messages : 3597
Age : 28
Humeur/Caractère : Fatigué
Date d'inscription : 29/04/2006

Statut
Expérience:
100/100  (100/100)
Pixel Point Pixel Point: ---

MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 21:23

Jordinateur a écrit:


Par contre je ne connais pas l'auteur, alors si l'auteur voit ce message, qu'il me le dise, pour que je marque son nom, merci...



Merci de cette dernière petite phrases, tu es un défendeur de la juste cause !

_________________
-- Peuple d'Ultima Graphisme, je m'adresse à vous --
-- Prenez les armes et assomez la racaille ! --
-- Vous aussi, devenez une Brute --

Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://ultimagraphisme.actifforum.com
Jordinateur
Blob
Blob
avatar

Nombre de messages : 260
Localisation : Devant mon ordinateur !(enfin sa dépend, peut-être avec ma copine aussi ^^)
Humeur/Caractère : Aller a l'école T_T
Date d'inscription : 12/05/2006

MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   Dim 21 Mai - 23:30

Si l'auteur ne voit pas son nom a côté duscript, ilpeut porter pleinte et te demander d'enlever le script, et je crois que quand on a fait quelque chose dont on est fier, on veut que tout le monde le sache, et c'est normal Exclamation
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Contenu sponsorisé




MessageSujet: Re: Livre des objets obtenus depuis le début du jeu avec %   

Revenir en haut Aller en bas
 
Livre des objets obtenus depuis le début du jeu avec %
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Exécuter un javascript avec un bouton submit
» Réception TV Mauvaise
» Mon ordinateur troune au ralenti....depuis plusieurs jours.
» Livre d'or
» Mise en place des objets

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Ultima Graphisme :: Aide, Tuto, Script & Recrutement :: Script-
Sauter vers: