Tuesday, April 6, 2010

#============================================================================#
# ******************************* Esto es un Bestiario universal, que es #
# * ARPG Bestiario U. By Falcao * Compatible con todo tipo de sistemas de #
# * ------------------------- * batallas como, XAS HERO ABS, batallas #
# * Date 11/19/2009 * laterales, o las batallas frontales que #
# ******************************* vienen por defecto. #
# RMXP #
# makerpalace.onlinegoo.com V 2.0 #
#============================================================================#

#----------------------------------------------------------------------------
# * Instrucciones
# Solo copiar y pegar el script a sus proyectos, para llamarlo des de un
# un evento hacerlo asi: $scene = Scene_MonsterGuide.new
#
# Si quieres acceder al bestiario desde el Menu solo preciona Tecla Z
#
# Si quieres agregar enemigos manualmente hacerlo asi
#
# XAS.add_enemy(id) En vez de 'id' pon el ID de enemigo
# XAS.fill_bestiary Completa la lista de enemigos
#
# * Compatibilidad
#
# Compatible con batallas laterales, batalla por defecto entre otros
#
# Compatible con XAS HERO 1.0, 1.5, 2.0, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6
# comprobado!!
#----------------------------------------------------------------------------

module FalcaoVocab

# Descripcion para cada enemigo
# A = ID de enemigo
# B = descripcion
Description = {

1=> 'Habita cerca de los arrollos del bosque Falcar',
2=> 'Se mata facilmente con un ataque normal, es devil al elemento agua',
3=> 'Habita en el bosque shulton, devil al elemento fuego',
4=> 'Ponsoñosa araña que habita dentro de cuevas, si pica tomar antidoto',
5=> 'Rata escurridiza, suele dejar buena experiencia',
21=> 'Habita alrededor del castillo tridan, devil a luz',

}


#Texto si no hay datos
NoEnemys = "Sin Datos"

#Texto si no a sido derrotado
NoDefeat = "No derrotado"

#Texto si no dara Item o arma
NoItem = "Sin Item"

#Avtivar ventana emergente en el menu true/false
MenuWindow = true

#Texto de la ventana emergente
WindowHelpText = "Precione Z para el Bestiario"

end


module XAS
def self.add_enemy(id)
unless $game_system.enemy_defeated[id]
$game_system.enemy_defeated[id] = true
$game_system.enemy_encountered[id] = true
end
end
def self.fill_bestiary
for enemy in $data_enemies
next if enemy == nil
unless $game_system.enemy_defeated[id]
$game_system.enemy_defeated[enemy.id] = true
$game_system.enemy_encountered[enemy.id] = true
end
end
end
end

$xrxs = {} if $xrxs == nil

# Get Xas System acces
class Game_Event < Game_Character
if $xrxs["xas"] == true || $xrxs_xas == true
alias falcaoxas_Defeat enemy_defeat_process
def enemy_defeat_process(enemy)
falcaoxas_Defeat(enemy)
$game_system.enemy_defeated[enemy.id] = true
end
end
end

class Monster_info < Window_Base
include FalcaoVocab
def initialize
super(186, 0, 455, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@tiempo = 0
@scroll = 0
end
def refresh(enemy)
self.contents.clear
if $game_system.enemy_defeated[enemy.id]
draw_description(enemy)
else
#self.contents.draw_text(-130, -4, 600, 32 , FalVocab[0],1)
end
end

def draw_description(enemy)
if Description.has_key?(enemy.id)
Description.each do |id, value|
if id == enemy.id
cx = contents.text_size(value).width
scroll_text(value)
self.contents.draw_text(@scroll, -4, cx + 10, 32 , value)
end
end
else
text = "

Description no Available
Falcao Script Xas Hero Bestiary V 2"

scroll_text(text,false)
cx = contents.text_size(text).width
self.contents.draw_text(@scroll, -4, cx + 10, 32, text)
end
end

def scroll_text(texto, result_ok=true)
cx = contents.text_size(texto).width
if cx > self.width - 25
@tiempo += 1
if @tiempo > 60
@scroll -= 1 if @result == nil
if @scroll == -cx
@result = true
end
end
end
if @result
result_ok ? @scroll += 10 : @scroll = 0
if @scroll >= 0
@scroll = 0; @tiempo = 0
@result = nil
end
end
if Input.press?(Input::UP) or Input.press?(Input::DOWN)
@scroll = 0; @tiempo = 0; @result = nil
end
end
end

module Bestiary
$game_special_elements = {}
$imported = {}
$data_states = load_data("Data/States.rxdata")
$data_system = load_data("Data/System.rxdata")
MG_HIDE_ENEMIES = []
end

class Window_MonsterGuideRight < Window_Base
MG_ELEMENT_RANGE = 1..8
MG_WEEK_COLOR = Color.new(255, 128, 128)
MG_RESIST_COLOR = Color.new(128, 128, 255)
end

class Scene_MonsterGuide
MG_MOVE_REFRESH = true
end

class Scene_Battle
MG_ORIGINAL_DEFEAT = true
end
$imported["Lista de Monstros"] = true
class Object
include Bestiary
end

def call_monster_guide
$game_player.straighten
$scene = Scene_MonsterGuide.new
end

class Game_System
attr_accessor :enemy_encountered
attr_accessor :enemy_defeated
alias initialize_KGC_MonsterGuide initialize
def initialize
initialize_KGC_MonsterGuide
@enemy_encountered = []
@enemy_defeated = []
end

def enemy_exist?(enemy_id)
return $data_enemies[enemy_id] != nil && $data_enemies[enemy_id].name != ""
end
def all_enemies_count
n = 0
for i in 1...$data_enemies.size
next if !enemy_exist?(i) || MG_HIDE_ENEMIES.include?(i)
n += 1
end
return n
end

def defeated_enemies_count
n = 0
for i in 1...$data_enemies.size
next if !enemy_exist?(i) || !@enemy_encountered[i] ||
!@enemy_defeated[i] || MG_HIDE_ENEMIES.include?(i)
n += 1
end
return n
end
def monster_guide_completion
return defeated_enemies_count * 100 / all_enemies_count
end
end

class Game_Enemy < Game_Battler
attr_reader :original_id
alias initialize_KGC_MonsterGuide initialize
def initialize(troop_id, member_index)
initialize_KGC_MonsterGuide(troop_id, member_index)
@original_id = []
unless @hidden
$game_system.enemy_encountered[@enemy_id] = true
end
end

alias transform_KGC_MonsterGuide transform
def transform(enemy_id)
@original_id.push(@enemy_id)
transform_KGC_MonsterGuide(enemy_id)
$game_system.enemy_encountered[@enemy_id] = true
end

def hidden=(value)
@hidden = value
unless @hidden
$game_system.enemy_encountered[@enemy_id] = true
end
end
end

class Window_MonsterGuideTop < Window_Base
def initialize
super(0, 0, 186, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
text = "Total: #{$game_system.defeated_enemies_count}/#{$game_system.all_enemies_count}"
self.contents.draw_text(0, 0, width - 32, 32, text)
text = "Complete :#{$game_system.monster_guide_completion}%"
self.contents.draw_text(0, 32, width - 32, 32, text)
end
end

class Window_MonsterGuideLeft < Window_Selectable
def initialize
super(0, 96, 186, 384)
self.index = 0
refresh
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_enemies.size
next if !$game_system.enemy_exist?(i) || MG_HIDE_ENEMIES.include?(i)
@data.push($data_enemies[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end

def draw_item(index)
enemy = @data[index]
if $game_system.enemy_defeated[enemy.id]
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x, y = 4, index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if $game_system.enemy_encountered[enemy.id]
self.contents.draw_text(x, y, self.width, 32, enemy.name)
else
self.contents.draw_text(x, y, self.width, 32, "???????")
end
end
end

class Window_MonsterGuideRight < Window_Base
def initialize
super(186, 63, 455, 417)
self.contents = Bitmap.new(width - 32, height - 32)
end
def refresh(enemy, show_status = true)
self.contents.clear
self.contents.font.size = $fsize
unless $game_system.enemy_encountered[enemy.id]
self.contents.font.color = disabled_color
self.contents.draw_text(0, 208, 368, 32, FalcaoVocab::NoEnemys, 1)
return
end
bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
cw = bitmap.width; ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(184 - cw / 2, 0, bitmap, src_rect)
return unless show_status
if $game_system.enemy_defeated[enemy.id]
draw_grid(0,336)
draw_grid(222,336)
self.contents.font.color = system_color
self.contents.draw_text(0, 215, 75, 32, $data_system.words.hp)
self.contents.draw_text(150, 215, 75, 32, $data_system.words.sp)
self.contents.draw_text(300, 215, 75, 32, $data_system.words.str)
self.contents.draw_text(0, 242, 75, 32, $data_system.words.dex)
self.contents.draw_text(150, 242, 75, 32, $data_system.words.agi)
self.contents.draw_text(300, 242, 75, 32, $data_system.words.int)
self.contents.draw_text(0, 274, 75, 32, $data_system.words.atk)
self.contents.draw_text(150, 274, 75, 32, $data_system.words.pdef)
self.contents.draw_text(300, 274, 96, 32, "Exp")
self.contents.font.color = normal_color
hp = enemy.maxhp; sp = enemy.maxsp
str = enemy.str; dex = enemy.dex; agi = enemy.agi; int = enemy.int
atk = enemy.atk; pdef = enemy.pdef; mdef = enemy.mdef
exp = enemy.exp; gold = enemy.gold
if $imported["LimitBreak"]
hp *= $maxhp_correct
sp *= $maxsp_correct
end
if $imported["BattleDifficulty"]
hp *= get_difficulty[1]
sp *= get_difficulty[2]
correct = get_difficulty[3]
str *= correct; dex *= correct; agi *= correct; int *= correct
atk *= correct; pdef *= correct; mdef *= correct
exp *= get_difficulty[4]; gold *= get_difficulty[5]
end
self.contents.draw_text(48, 215, 64, 32, Integer(hp).to_s, 2)
self.contents.draw_text(198, 215, 64, 32, Integer(sp).to_s, 2)
self.contents.draw_text(348, 215, 64, 32, Integer(str).to_s, 2)
self.contents.draw_text(48, 242, 64, 32, Integer(dex).to_s, 2)
self.contents.draw_text(198, 242, 64, 32, Integer(agi).to_s, 2)
self.contents.draw_text(348, 242, 64, 32, Integer(int).to_s, 2)
self.contents.draw_text(48, 274, 64, 32, Integer(atk).to_s, 2)
self.contents.draw_text(198, 274, 64, 32, Integer(pdef).to_s, 2)
self.contents.draw_text(270, 274, 144, 32, Integer(exp).to_s, 2)
text = ""
#------------------------------------------
self.contents.font.color = MG_WEEK_COLOR.dup
self.contents.draw_text(104, 320, 264, 32, text)
text = ""
self.contents.font.color = MG_RESIST_COLOR.dup
self.contents.draw_text(104, 352, 264, 32, text)
self.contents.font.color = normal_color
# ??????
n = enemy.treasure_prob
n *= get_difficulty[6] if $imported["BattleDifficulty"]
prob = "#{Integer(n)}%"
if enemy.item_id > 0
icon = RPG::Cache.icon($data_items[enemy.item_id].icon_name)
text = $data_items[enemy.item_id].name
elsif enemy.weapon_id > 0
icon = RPG::Cache.icon($data_weapons[enemy.weapon_id].icon_name)
text = $data_weapons[enemy.weapon_id].name
elsif enemy.armor_id > 0
icon = RPG::Cache.icon($data_armors[enemy.armor_id].icon_name)
text = $data_armors[enemy.armor_id].name
else
icon = Bitmap.new(24, 24)
text = FalcaoVocab::NoItem
prob = ""
end
# Items
self.contents.font.size = 19
self.contents.blt(10, 345, icon, Rect.new(0, 0, 24, 24))
self.contents.draw_text(40, 345, 165, 32, "#{prob} #{text}")
# Gold
icon = RPG::Cache.icon("032-Item01") rescue nil
self.contents.blt(240, 348,icon,Rect.new(0, 0, 24, 24), 255) rescue nil
self.contents.draw_text(275, 335, 165, 50,
"#{Integer(gold).to_s} #{$data_system.words.gold}")
else
self.contents.font.size = $fsize
self.contents.font.color = disabled_color
self.contents.draw_text(0, 250, 368, 32, FalcaoVocab::NoDefeat, 1)
end
end

def draw_grid(x,y)
width = 200
color = system_color
self.contents.fill_rect(x+2, y-2, width-4, 1, color)
self.contents.fill_rect(x+1, y-1, width-2, 1, color)
self.contents.fill_rect(x, y, width, 1, color)
self.contents.fill_rect(x, y+1, 3, 45, color)
self.contents.fill_rect(x+ 197, y+1, 3, 45, color)
self.contents.fill_rect(x, y+45, width, 1, color)
self.contents.fill_rect(x+1, y+46, width-2, 1, color)
self.contents.fill_rect(x+2, y+47, width-4, 1, color)
end
end

class Scene_MonsterGuide
def main
@guide_top_window = Window_MonsterGuideTop.new
@guide_left_window = Window_MonsterGuideLeft.new
enemy = @guide_left_window.item
@guide_right_window = Window_MonsterGuideRight.new
@info_monter = Monster_info.new
@info_monter.refresh(enemy)
@show_status = true
@guide_right_window.refresh(enemy, @show_status)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@guide_top_window.dispose
@guide_left_window.dispose
@guide_right_window.dispose
@info_monter.dispose
end
def update
@guide_top_window.update
@guide_left_window.update
@guide_right_window.update
fenemy = @guide_left_window.item
@info_monter.refresh(fenemy)
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
$game_map.refresh
return
end
if Input.trigger?(Input::A)
$game_system.se_play($data_system.decision_se)
@show_status = !@show_status
enemy = @guide_left_window.item
@guide_right_window.refresh(enemy, @show_status)
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
enemy = @guide_left_window.item
@guide_right_window.refresh(enemy, @show_status)
return
end
if MG_MOVE_REFRESH
if @last_index != @guide_left_window.index
@last_index = @guide_left_window.index
enemy = @guide_left_window.item
@guide_right_window.refresh(enemy, @show_status)
return
end
end
end
end

class Scene_Battle
alias start_phase5_KGC_MonsterGuide start_phase5
def start_phase5
for enemy in $game_troop.enemies
next if enemy.hidden
$game_system.enemy_defeated[enemy.id] = true
if MG_ORIGINAL_DEFEAT
enemy.original_id.each do |id|
next if id == nil
$game_system.enemy_defeated[id] = true
end
end
end
start_phase5_KGC_MonsterGuide
end
end

class Scene_Menu
alias falcaoABSbestiario_update update
def update
falcaoABSbestiario_update
if Input.trigger?(Input::A)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_MonsterGuide.new
end
end
end

class BesInfo < Window_Base
def initialize
super(160, 430, 480, 50)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 500
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.font.size = 20
self.contents.draw_text(-70, -6, 600, 32, FalcaoVocab::WindowHelpText,1)
end
end

class Scene_Menu
alias falcaoPulsaZ_main main
def main
@besinfo = BesInfo.new
@besinfo.x = 160
@besinfo.y = 490
@counter = 0
falcaoPulsaZ_main
@besinfo.dispose
end
alias falcaoPulsaZ_update update
def update
falcaoPulsaZ_update
unless FalcaoVocab::MenuWindow == true
@besinfo.visible = false
end
@besinfo.y -= 3 if @besinfo.y > 430 and @counter != 80
if @counter == 80
@besinfo.y += 3
else
@counter += 1
end
end
end

class Font
alias falcaoBest_font2 initialize
def initialize
falcaoBest_font2
if $scene.is_a?(Scene_MonsterGuide)
self.name = "Georgia"
self.size = 20
$fsize = self.size
end
end
end

Thursday, November 26, 2009

First post

Wow, so I've finally succumbed to the urges to blog my progress on my game. this is just another procrastination tool, so i don't have to work on it. XD

Well
What Ive done today
Finished 1 Cutscene in Minardor (Mark, and Leanne join)
I also finished the mercenary acceptance scene.

Thats it!
As a note, this will get boring, VERY boring..... so, don't expect much for now.