$element_n=16 #кол-во эллементов
$element={ #элементы
1=>"Огонь",
2=>"Лёд",
3=>"Молния",
4=>"Вода",
5=>"Земля",
6=>"Воздух",
7=>"Свет",
8=>"Тьма",
9=>"Нежить",
10=>"Змея",
11=>"Водяной",
12=>"Зверь",
13=>"Гоблин",
14=>"Птица",
15=>"Демон ",
16=>"Ангел",
}
$element_rank={
1=>"200%",
2=>"150%",
3=>"100%",
4=>"50%",
5=>"0%",
6=>"-100%"
}
MONSTERS=32 #кол-во монстров(enemies)
XS=[0,120,240,360]
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
class Window_Monster < Window_Base
def initialize(monster)
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@monster = monster
refresh
end
def refresh
self.contents.clear
draw_monster_graphics(@monster) # Показывает battle графику
draw_text_3d(XS[0],-5,80, 32, i2s(@monster.id)+"/"+i2s(MONSTERS))
draw_text_3d(XS[0],10,200,32,"Имя: "+@monster.name)
draw_text_3d(XS[0],40,200,32,"Жизни "+i2s(@monster.maxhp),0,255,0) # Выводит хп монстра
draw_text_3d(XS[0],70,200,32,"Сп "+i2s(@monster.maxsp),0,0,255)
draw_text_3d(XS[0],100,200,32,$str_str+" "+i2s(@monster.str))
draw_text_3d(XS[0],130,200,32,$str_dex+" "+i2s(@monster.dex))
draw_text_3d(XS[0],160,200,32,$str_agi+" "+i2s(@monster.agi))
draw_text_3d(XS[0],190,200,32,$str_int+" "+i2s(@monster.int))
#-----------------------------------------------------------------------
draw_text_3d(XS[1],190,200,32,$str_atk+" "+i2s(@monster.atk))
draw_text_3d(XS[1],160,200,32,$str_eva+" "+i2s(@monster.eva))
draw_text_3d(XS[1],130,200,32,$str_pdf+" "+i2s(@monster.pdef))
draw_text_3d(XS[1],100,200,32,$str_mdf+" "+i2s(@monster.mdef))
#----------------------------------------------------------------------
draw_text_3d(XS[0],400,200,32,"Опыт"+" "+i2s(@monster.exp))
draw_text_3d(XS[1],400,200,32,"Деньги"+" "+i2s(@monster.gold))
# draw_text_3d(XS[2],400,200,32,"Видел?"+" "+b2s($monster_vision[@monster.id]))
#-----------------------------
#резисты
#-------------
draw_text_3d(XS[2],-5,200,32,"Эффективность",255,0,255)
monster_element_ranks(XS[2],10)
end
end
#--------------#
class Window_Base < Window
#--------------------------------------------------------------------------
# Выводит изображение
#--------------------------------------------------------------------------
def draw_monster_graphics(monster)
battler=RPG::Cache.battler(monster.battler_name, monster.battler_hue) # устонавливает каке изображение выводить
w = battler.width
h = battler.height
self.contents.blt(0, 0, battler, Rect.new(0, 0, w,h))
end
end
#------------------------------
#резисты
#------------------------------
def monster_element_ranks (x,y,n=$element_n)
if n<=12 then monster_element_ranks_1(x,y,n) end
if n>12 then
monster_element_ranks_1(x,y,12,0)
monster_element_ranks_1(x+150,y,n-12,12)
end
end
def monster_element_ranks_1(x,y,n,e)
for i in 1..n
draw_text_3d(x,y+i*28,200,32,$element[i+e])
# draw_text_3d(x,y+i*28,200,32,$data_elements[i+e].name)
draw_text_3d(x+80,y+i*28,200,32,$element_rank[@monster.element_ranks[i+e]])
end
end
#--------------------------------------------------------------------------
class Scene_Monster
def initialize(monster = 0, equip_index = 0)
@monster_id = monster
end
def main
@monster = $data_enemies[@monster_id]
@status_window = Window_Monster.new(@monster)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@status_window.dispose
end
#--------------------------------------------------------------------------
# Проверяет нажата ли клавиша; если "R" нажата то выводит следушего монстра
#--------------------------------------------------------------------------
def test(i=1,monster_id=@monster_id)
if $monster_vision[monster_id]=true
then return monster_id
else test(monster_id+i)
end
end
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(7)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
if @monster_id <MONSTERS then
@monster_id += 1
else @monster_id=1
end
$scene = Scene_Monster.new(@monster_id)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
if @monster_id >1 then
@monster_id+=- 1
else @monster_id=MONSTERS
end
$scene = Scene_Monster.new(@monster_id)
return
end
end
end
Социальные закладки