Pokemon Menu - Chrono Cry - 04-20-2005
Pokemon Menu
Chrono Cry
April 20, 2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Hello all i know there is already a code like this but here is my version of it i give credit to Matte and Momomo for a certain part of this script .
Ok let me begin
Firstly replace Scene_Menu with this:
Code: #==============================================================================
# â–� Scene_Menu
#------------------------------------------------------------------------------
#==============================================================================
class Scene_Menu
#Pokémon Menu - Version 1
#Developed By Chrono Cry and Scaboon (Same person lol)
#Changes can easily be made to the scripts and i shall inform you step by step how to.
def initialize(menu_index = 0)
@menu_index = menu_index
end
#Here is the main line of command it basically makes everything happen
def main
# These are the chocies that appear on the menu
s1 = "Pokédex"
s2 = "Pokémon"
s3 = "Bag"
s4 = "Tora"
s5 = "Save"
s6 = "Exit"
@spriteset = Spriteset_Map.new
@command_window = Window_Command.new(140, [s1, s2, s3, s4, s5, s6]) # This arranges the order of the selection
@command_window.index = @menu_index
# -----------------------------------------
if $game_party.actors.size == 0
# ===========================
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# --------------------------------
if $game_system.save_disabled
# ----------------------------
@command_window.disable_item(4)
end
# プレイ時間ウィンドウを作æˆ
Graphics.transition
# メインループ
loop do
# ゲーãƒ� ç”»é¢ã‚’æ›´æ–°
Graphics.update
# å…¥å� ›æƒ…å� ±ã‚’æ›´æ–°
Input.update
# フレー� 更新
update
# ç”»é¢ãŒåˆ‡ã‚� 替ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@spriteset.dispose
@command_window.dispose
end
#--------------------------------------------------------------------------
# ◠フレー� 更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@spriteset.update
@command_window.update
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ� ィブã®å� ´åˆ: update_command を呼ã¶
if @command_window.active
update_command
return
end
# スãƒ� ータスウィンドウãŒã‚¢ã‚¯ãƒ� ィブã®å� ´åˆ: update_status を呼ã¶
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ◠フレーãƒ� æ›´æ–° (コマンドウィンドウãŒã‚¢ã‚¯ãƒ� ィブã®å� ´åˆ)
#--------------------------------------------------------------------------
def update_command
# B ボタンãŒæ� ¼ã•ã‚ŒãŸå� ´åˆ
if Input.trigger(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# マップ画é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Map.new
return
end
# C ボタンãŒæ� ¼ã•ã‚ŒãŸå� ´åˆ
if Input.trigger(Input::C)
# パーãƒ� ィ人数㌠0 人ã§ã€ã‚»ãƒ¼ãƒ–ã€ã‚²ãƒ¼ãƒ� 終äº� 以外ã®ã‚³ãƒžãƒ³ãƒ‰ã®å� ´åˆ
if $game_party.actors.size == 0 and @command_window.index < 4
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# コマンドウィンドウã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã§åˆ� å²
case @command_window.index
# The selection below is what happens when a selection is made
when 0 # Opens up pokedex scene you have to make this yourself i suggest the biestary script
# 決定 � SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイãƒ� ãƒ� ç”»é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_MonsterBook.new
when 1 # This opens up the pokemon scene you will need to make this yourself
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ゲーãƒ� 終äº� ç”»é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Pokemon.new
when 2 # This opens up the item screen
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# スãƒ� ータスウィンドウをアクムィブã«ã™ã‚‹
$scene = Scene_Item.new
when 3 # This opens up status screen i recommend you mess around with Window_Status to get what you want it to look like
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# スãƒ� ータスウィンドウをアクムィブã«ã™ã‚‹
$scene = Scene_Status.new
when 4 # This brings up save menu
# セーブç¦æ¢ã®å� ´åˆ
if $game_system.save_disabled
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# セーブ画é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Save.new
when 5 # This brings up exit choice
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ゲーãƒ� 終äº� ç”»é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# ◠フレーãƒ� æ›´æ–° (スãƒ� ータスウィンドウãŒã‚¢ã‚¯ãƒ� ィブã®å� ´åˆ)
#--------------------------------------------------------------------------
def update_status
# B ボタンãŒæ� ¼ã•ã‚ŒãŸå� ´åˆ
if Input.trigger(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクãƒ� ィブã«ã™ã‚‹
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ボタンãŒæ� ¼ã•ã‚ŒãŸå� ´åˆ
if Input.trigger(Input::C)
# コマンドウィンドウã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã§åˆ� å²
case @command_window.index
when 1 # スã‚ル
# ã“ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®è¡Œå‹•åˆ¶é™ãŒ 2 以ä¸� ã®å� ´åˆ
if $game_party.actors[@status_window.index].restriction >= 2
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# スã‚ル画é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装備
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# 装備画é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Equip.new(@status_window.index)
when 3 # ス� ータス
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# スãƒ� ータス画é¢ã«åˆ‡ã‚� 替ãˆ
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
Then replace Window_Command with this
Code: #==============================================================================
# â–� Window_Command edited by Chrono Cry
#------------------------------------------------------------------------------
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def initialize(width, commands)
# This defines the position of the command bar
super(500, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.index = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
nd now for the biggest feature to this
Make a new script above main called Pokedex and paste this into it
By the way this was developed by momomo and matte fixed it so i have no credit for this part
Code: # Originally released by: momomo?
# Removal of comments and fix: Matte
module Enemy_Book_Config
DROP_ITEM_NEED_ANALYZE = false
EVA_NAME = "Evasion"
SHOW_COMPLETE_TYPE = 3
end
class Game_Temp
attr_accessor :enemy_book_data
alias temp_enemy_book_data_initialize initialize
def initialize
temp_enemy_book_data_initialize
@enemy_book_data = Data_MonsterBook.new
end
end
class Game_Party
attr_accessor :enemy_info
#--------------------------------------------------------------------------
alias book_info_initialize initialize
def initialize
book_info_initialize
@enemy_info = {}
end
#--------------------------------------------------------------------------
def add_enemy_info(enemy_id, type = 0)
case type
when 0
if @enemy_info[enemy_id] == 2
return false
end
@enemy_info[enemy_id] = 1
when 1
@enemy_info[enemy_id] = 2
when -1
@enemy_info[enemy_id] = 0
end
end
#--------------------------------------------------------------------------
def enemy_book_max
return $game_temp.enemy_book_data.id_data.size - 1
end
#--------------------------------------------------------------------------
def enemy_book_now
now_enemy_info = @enemy_info.keys
no_add = $game_temp.enemy_book_data.no_add_element
new_enemy_info = []
for i in now_enemy_info
enemy = $data_enemies[i]
next if enemy.name == ""
if enemy.element_ranks[no_add] == 1
next
end
new_enemy_info.push(enemy.id)
end
return new_enemy_info.size
end
#--------------------------------------------------------------------------
def enemy_book_complete_percentage
e_max = enemy_book_max.to_f
e_now = enemy_book_now.to_f
comp = e_now / e_max * 100
return comp.truncate
end
end
class Interpreter
def enemy_book_max
return $game_party.enemy_book_max
end
def enemy_book_now
return $game_party.enemy_book_now
end
def enemy_book_comp
return $game_party.enemy_book_complete_percentage
end
end
class Scene_Battle
alias add_enemy_info_start_phase5 start_phase5
def start_phase5
for enemy in $game_troop.enemies
unless enemy.hidden
$game_party.add_enemy_info(enemy.id, 0)
end
end
add_enemy_info_start_phase5
end
end
class Window_Base < Window
def initialize(x, y, width, height)
super()
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
@windowskin_name = $game_system.windowskin_name
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
self.x = x
self.y = y
self.width = width
self.height = height
self.z = 100
end
#--------------------------------------------------------------------------
def draw_enemy_drop_item(enemy, x, y)
self.contents.font.color = normal_color
self.contents.font.name = $fontface
treasures = []
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
if treasures.size > 0
item = treasures[0]
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
name = treasures[0].name
else
self.contents.font.color = disabled_color
self.contents.font.name = $fontface
name = "No Item"
end
self.contents.draw_text(x+28, y, 212, 32, name)
end
#--------------------------------------------------------------------------
def draw_enemy_book_id(enemy, x, y)
self.contents.font.color = normal_color
self.contents.font.name = $fontface
id = $game_temp.enemy_book_data.id_data.index(enemy.id)
self.contents.draw_text(x, y, 32, 32, id.to_s)
end
#--------------------------------------------------------------------------
def draw_enemy_name(enemy, x, y)
self.contents.font.color = normal_color
self.contents.font.name = $fontface
self.contents.draw_text(x, y, 152, 32, enemy.name)
end
#--------------------------------------------------------------------------
def draw_enemy_graphic(enemy, x, y, opacity = 255)
bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
x = x + (cw / 2 - x) if cw / 2 > x
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
def draw_enemy_exp(enemy, x, y)
self.contents.font.color = system_color
self.contents.font.name = $fontface
self.contents.draw_text(x, y, 120, 32, "EXP")
self.contents.font.color = normal_color
self.contents.font.name = $fontface
self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
end
#--------------------------------------------------------------------------
def draw_enemy_gold(enemy, x, y)
self.contents.font.color = system_color
self.contents.font.name = $fontface
self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
self.contents.font.color = normal_color
self.contents.font.name = $fontface
self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
end
end
class Game_Enemy_Book < Game_Enemy
#--------------------------------------------------------------------------
def initialize(enemy_id)
super(2, 1)
@enemy_id = enemy_id
enemy = $data_enemies[@enemy_id]
@battler_name = enemy.battler_name
@battler_hue = enemy.battler_hue
@hp = maxhp
@sp = maxsp
end
end
class Data_MonsterBook
attr_reader :id_data
#--------------------------------------------------------------------------
def initialize
@id_data = enemy_book_id_set
end
#--------------------------------------------------------------------------
def no_add_element
no_add = 0
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /Monster Book/
no_add = i
break
end
end
return no_add
end
#--------------------------------------------------------------------------
def enemy_book_id_set
data = [0]
no_add = no_add_element
for i in 1...$data_enemies.size
enemy = $data_enemies[i]
next if enemy.name == ""
if enemy.element_ranks[no_add] == 1
next
end
data.push(enemy.id)
end
return data
end
end
class Window_MonsterBook < Window_Selectable
attr_reader :data
#--------------------------------------------------------------------------
def initialize(index=0)
super(0, 64, 640, 416)
@column_max = 2
@book_data = $game_temp.enemy_book_data
@data = @book_data.id_data.dup
@data.shift
@item_max = @data.size
self.index = 0
refresh if @item_max > 0
end
#--------------------------------------------------------------------------
def data_set
data = $game_party.enemy_info.keys
data.sort!
newdata = []
for i in data
next if $game_party.enemy_info[i] == 0
if book_id(i) != nil
newdata.push(i)
end
end
return newdata
end
#--------------------------------------------------------------------------
def show?(id)
� if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
� return false
� else
� return true
� end
end
#--------------------------------------------------------------------------
def book_id(id)
return @book_data.index(id)
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
self.contents = Bitmap.new(width - 32, row_max * 32)
if @item_max > 0
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
def draw_item(index)
enemy = $data_enemies[@data[index]]
return if enemy == 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.font.name = $fontface
draw_enemy_book_id(enemy, x, y)
if show?(enemy.id)
self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
else
self.contents.draw_text(x + 28+16, y, 212, 32, "ï¼?ï¼?ï¼?ï¼?ï¼?", 0)
return
end
if analyze?(@data[index])
self.contents.font.color = text_color(3)
self.contents.font.name = $fontface
self.contents.draw_text(x + 256, y, 24, 32, "Cancel", 2)
end
end
#--------------------------------------------------------------------------
def analyze?(enemy_id)
if $game_party.enemy_info[enemy_id] == 2
return true
else
return false
end
end
end
class Window_MonsterBook_Info < Window_Base
include Enemy_Book_Config
#--------------------------------------------------------------------------
def initialize
super(0, 0+64, 640, 480-64)
self.contents = Bitmap.new(width - 32, height - 32)
end
#--------------------------------------------------------------------------
def refresh(enemy_id)
self.contents.clear
self.contents.font.name = $fontface
self.contents.font.size = 22
enemy = Game_Enemy_Book.new(enemy_id)
draw_enemy_graphic(enemy, 96, 240+48+64, 200)
draw_enemy_book_id(enemy, 4, 0)
draw_enemy_name(enemy, 48, 0)
draw_actor_hp(enemy, 288, 0)
draw_actor_sp(enemy, 288+160, 0)
draw_actor_parameter(enemy, 288 � � , � 32, 0)
self.contents.font.color = system_color
self.contents.draw_text(288+160, 32, 120, 32, EVA_NAME)
self.contents.font.color = normal_color
self.contents.draw_text(288+160 + 120, 32, 36, 32, enemy.eva.to_s, 2)
draw_actor_parameter(enemy, 288 � � , � 64, 3)
draw_actor_parameter(enemy, 288+160, � 64, 4)
draw_actor_parameter(enemy, 288 � � , � 96, 5)
draw_actor_parameter(enemy, 288+160, � 96, 6)
draw_actor_parameter(enemy, 288 � � , 128, 1)
draw_actor_parameter(enemy, 288+160, 128, 2)
draw_enemy_exp(enemy, 288, 160)
draw_enemy_gold(enemy, 288+160, 160)
if analyze?(enemy.id) or !DROP_ITEM_NEED_ANALYZE
self.contents.draw_text(288, 192, 96, 32, "Drop Item")
draw_enemy_drop_item(enemy, 288+96+4, 192)
self.contents.font.color = normal_color
end
end
#--------------------------------------------------------------------------
def analyze?(enemy_id)
if $game_party.enemy_info[enemy_id] == 2
return true
else
return false
end
end
end
class Scene_MonsterBook
include Enemy_Book_Config
#--------------------------------------------------------------------------
def main
$game_temp.enemy_book_data = Data_MonsterBook.new
@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, "Monster Book", 0)
if SHOW_COMPLETE_TYPE != 0
case SHOW_COMPLETE_TYPE
when 1
e_now = $game_party.enemy_book_now
e_max = $game_party.enemy_book_max
text = e_now.to_s + "/" + e_max.to_s
when 2
comp = $game_party.enemy_book_complete_percentage
text = comp.to_s + "%"
when 3
e_now = $game_party.enemy_book_now
e_max = $game_party.enemy_book_max
comp = $game_party.enemy_book_complete_percentage
text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
end
if text != nil
@title_window.contents.draw_text(320, 0, 288, 32, � text, 2)
end
end
@main_window = Window_MonsterBook.new
@main_window.active = true
@info_window = Window_MonsterBook_Info.new
@info_window.z = 110
@info_window.visible = false
@info_window.active = false
@visible_index = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@main_window.dispose
@info_window.dispose
@title_window.dispose
end
#--------------------------------------------------------------------------
def update
@main_window.update
@info_window.update
if @info_window.active
update_info
return
end
if @main_window.active
update_main
return
� end
end
#--------------------------------------------------------------------------
def update_main
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @main_window.item == nil or @main_window.show?(@main_window.item) == false
$game_system.se_play($data_system.buzzer_se)
return
end
$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)
return
end
end
#--------------------------------------------------------------------------
def update_info
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@main_window.active = true
@info_window.active = false
@info_window.visible = false
return
end
if Input.trigger?(Input::C)
return
end
if Input.trigger?(Input::L)
$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.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id)
return
end
if Input.trigger?(Input::R)
$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.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id)
return
end
end
end
And that should do it
PS: I am currently working on some new projects that i would like to inform you on which are a fully working pokedex, a proper pokemon capture and use system and Fire Emblem battle system till i post next cya :D
|