SHOW:
|
|
- or go back to the newest paste.
| 1 | #============================================================================== | |
| 2 | # ** Window_Habilidades v 0.7 | |
| 3 | # Exibe uma janela que exibe as habilidades | |
| 4 | #------------------------------------------------------------------------------ | |
| 5 | # Autor: Pedro Matoso 19/01/2013 | |
| 6 | # Alterador: LeonMM 14/06/2013 | |
| 7 | #------------------------------------------------------------------------------ | |
| 8 | # Chame a Janela com: $hab.visible = true | |
| 9 | #------------------------------------------------------------------------------ | |
| 10 | # Instruçoes: Basta usar o código $hab.val_up(id, valor) | |
| 11 | # Sendo "id" o id da habilidade e "valor" o valor a ser adicionado a habilidade | |
| 12 | # ID das habilidades | |
| 13 | # Ataque:0 | |
| 14 | # Combate a distância:1 | |
| 15 | # Magia:2 | |
| 16 | # Força:3 | |
| 17 | # Defesa:4 | |
| 18 | # Restauração:5 | |
| 19 | # Corte a lenha:6 | |
| 20 | # Arte do Fogo:7 | |
| 21 | # Pontos vitais:8 | |
| 22 | # Pesca:9 | |
| 23 | # Culinaria:10 | |
| 24 | # Metalugia:11 | |
| 25 | # Mineração:12 | |
| 26 | #============================================================================== | |
| 27 | ||
| 28 | class Window_Habilidades < Window_Base | |
| 29 | ||
| 30 | def initialize(x=183, y=115, width=275, height=230, fonts=20) | |
| 31 | super(x, y, width, height) | |
| 32 | self.contents = Bitmap.new(width -32, height -32) | |
| 33 | self.windowskin = RPG::Cache.windowskin("B")
| |
| 34 | self.z = 9999999 | |
| 35 | self.back_opacity = 200 | |
| 36 | @actor = $game_party.actors[0] | |
| 37 | @dragable = true | |
| 38 | @closable = true | |
| 39 | check | |
| 40 | refresh | |
| 41 | end | |
| 42 | ||
| 43 | def val_up(id,valor) | |
| 44 | @actor.hab[id] += valor | |
| 45 | - | # ** Level ataque |
| 45 | + | if @actor.hab[id] >= @actor.habmax[id] and @actor.hablvl[id] <= 10 |
| 46 | @actor.hablvl[id] += 1 | |
| 47 | - | case $atqexp |
| 47 | + | @actor.habmax[id] = check_max(@actor.hablvl[id]) |
| 48 | - | when 0 .. 72 # Level 1 |
| 48 | + | end |
| 49 | - | $atqmexp = 72 |
| 49 | + | |
| 50 | - | $atqlvl = 1 |
| 50 | + | |
| 51 | - | when 73 .. 169 # Level 2 |
| 51 | + | def check_max(lvl) |
| 52 | - | $atqmexp = 169 |
| 52 | + | return 72 if lvl == 0 |
| 53 | - | $atqlvl = 2 |
| 53 | + | return 72*lvl if lvl >= 1 |
| 54 | - | when 170 .. 281 # Level 3 |
| 54 | + | |
| 55 | - | $atqmexp = 281 |
| 55 | + | |
| 56 | - | $atqlvl = 3 |
| 56 | + | |
| 57 | - | when 282 .. 412 # Level 4 |
| 57 | + | |
| 58 | - | $atqmexp = 412 |
| 58 | + | |
| 59 | - | $atqlvl = 4 |
| 59 | + | |
| 60 | - | when 413 .. 619 # Level 5 |
| 60 | + | |
| 61 | - | $atqmexp = 619 |
| 61 | + | |
| 62 | - | $atqlvl = 5 |
| 62 | + | |
| 63 | - | when 620 .. 947 # Level 6 |
| 63 | + | |
| 64 | - | $atqmexp = 947 |
| 64 | + | |
| 65 | - | $atqlvl = 6 |
| 65 | + | |
| 66 | - | when 948 .. 1368 # Level 7 |
| 66 | + | |
| 67 | - | $atqmexp = 1368 |
| 67 | + | |
| 68 | - | $atqlvl = 7 |
| 68 | + | |
| 69 | - | when 1369 .. 1994 # Level 8 |
| 69 | + | |
| 70 | - | $atqmexp = 1994 |
| 70 | + | |
| 71 | - | $atqlvl = 8 |
| 71 | + | |
| 72 | - | when 1995 .. 2888 # Level 9 |
| 72 | + | |
| 73 | - | $atqmexp = 2888 |
| 73 | + | |
| 74 | - | $atqlvl = 9 |
| 74 | + | |
| 75 | - | when 2889 .. 4052 # Level 10 |
| 75 | + | self.contents.draw_text(55, 2,800, 24, @actor.hablvl[0].to_s) |
| 76 | - | $atqmexp = 4052 |
| 76 | + | |
| 77 | - | $atqlvl = 10 |
| 77 | + | self.contents.draw_text(27, 19, 800, 24, @actor.hab[0].to_s + "/" + @actor.habmax[0].to_s) |
| 78 | #Combate a distância | |
| 79 | #comdiss = "ICO2" | |
| 80 | #comdis = RPG::Cache.icon("#{comdiss}")
| |
| 81 | #comdis_rect = Rect.new(0,0,349,68) | |
| 82 | #self.contents.blt(80,30,comdis,comdis_rect) | |
| 83 | self.contents.font.size = 12 | |
| 84 | self.contents.draw_text(135, 2,800, 24, @actor.hablvl[1].to_s) | |
| 85 | self.contents.font.size = 11 | |
| 86 | self.contents.draw_text(110, 19, 800, 24, @actor.hab[1].to_s + "/" + @actor.habmax[1].to_s) | |
| 87 | #Magia | |
| 88 | #magiaa = "ICO3" | |
| 89 | #magia = RPG::Cache.icon("#{magiaa}")
| |
| 90 | #magia_rect = Rect.new(0,0,349,68) | |
| 91 | #self.contents.blt(160,30,magia,magia_rect) | |
| 92 | self.contents.font.size = 12 | |
| 93 | self.contents.draw_text(215, 2,800, 24, @actor.hablvl[2].to_s) | |
| 94 | self.contents.font.size = 11 | |
| 95 | - | self.contents.draw_text(55, 2,800, 24, $atqlvl.to_s) |
| 95 | + | self.contents.draw_text(193, 19, 800, 24, @actor.hab[2].to_s + "/" + @actor.habmax[2].to_s) |
| 96 | #Pesca | |
| 97 | - | self.contents.draw_text(27, 19, 800, 24, $atqexp.to_s + "/" + $atqmexp.to_s) |
| 97 | + | |
| 98 | #pesca = RPG::Cache.icon("#{pescaa}")
| |
| 99 | #pesca_rect = Rect.new(0,0,349,68) | |
| 100 | #self.contents.blt(80,110,pesca,pesca_rect) | |
| 101 | self.contents.font.size = 12 | |
| 102 | self.contents.draw_text(135, 82,800, 24, @actor.hablvl[3].to_s) | |
| 103 | self.contents.font.size = 11 | |
| 104 | - | self.contents.draw_text(135, 2,800, 24, $cadlvl.to_s) |
| 104 | + | self.contents.draw_text(110, 99, 800, 24,@actor.hab[3].to_s + "/" + @actor.habmax[3].to_s) |
| 105 | #Pontos vitais | |
| 106 | - | self.contents.draw_text(110, 19, 800, 24, $cadexp.to_s + "/" + $cadmexp.to_s) |
| 106 | + | |
| 107 | #cf = RPG::Cache.icon("#{cff}")
| |
| 108 | #cf_rect = Rect.new(0,0,349,68) | |
| 109 | #self.contents.blt(80,70,cf,cf_rect) | |
| 110 | self.contents.font.size = 12 | |
| 111 | self.contents.draw_text(135, 42,800, 24, @actor.hablvl[4].to_s) | |
| 112 | self.contents.font.size = 11 | |
| 113 | - | self.contents.draw_text(215, 2,800, 24, $cadlvl.to_s) |
| 113 | + | self.contents.draw_text(110, 59, 800, 24, @actor.hab[4].to_s + "/" + @actor.habmax[4].to_s) |
| 114 | #Culinária | |
| 115 | - | self.contents.draw_text(193, 19, 800, 24, $magexp.to_s + "/" + $magmexp.to_s) |
| 115 | + | |
| 116 | #culi = RPG::Cache.icon("#{culii}")
| |
| 117 | #culi_rect = Rect.new(0,0,444349,68) | |
| 118 | #self.contents.blt(80,150,culi,culi_rect) | |
| 119 | self.contents.font.size = 12 | |
| 120 | self.contents.draw_text(135, 122,800, 24, @actor.hablvl[5].to_s) | |
| 121 | self.contents.font.size = 11 | |
| 122 | - | self.contents.draw_text(135, 82,800, 24, $peclvl.to_s) |
| 122 | + | self.contents.draw_text(110, 139, 800, 24, @actor.hab[5].to_s + "/" + @actor.habmax[5].to_s) |
| 123 | #Metalurgia | |
| 124 | - | self.contents.draw_text(110, 99, 800, 24,$pecexp.to_s + "/" + $pecmexp.to_s) |
| 124 | + | |
| 125 | #meta = RPG::Cache.icon("#{metaa}")
| |
| 126 | #meta_rect = Rect.new(0,0,349,68) | |
| 127 | #self.contents.blt(80,190,meta,meta_rect) | |
| 128 | self.contents.font.size = 12 | |
| 129 | self.contents.draw_text(135, 162,800, 24, @actor.hablvl[6].to_s) | |
| 130 | self.contents.font.size = 11 | |
| 131 | - | self.contents.draw_text(135, 42,800, 24, $pvvlvl.to_s) |
| 131 | + | self.contents.draw_text(110, 179, 800, 24, @actor.hab[6].to_s + "/" + @actor.habmax[6].to_s) |
| 132 | #Força | |
| 133 | - | self.contents.draw_text(110, 59, 800, 24, $pvvexp.to_s + "/" + $pvvmexp.to_s) |
| 133 | + | |
| 134 | #fforça = RPG::Cache.icon("#{fforçaa}")
| |
| 135 | #fforça_rect = Rect.new(0,0,249,68) | |
| 136 | #self.contents.blt(0,70,fforça,fforça_rect) | |
| 137 | self.contents.font.size = 12 | |
| 138 | self.contents.draw_text(55, 42,800, 24, @actor.hablvl[7].to_s) | |
| 139 | self.contents.font.size = 11 | |
| 140 | - | self.contents.draw_text(135, 122,800, 24, $cullvl.to_s) |
| 140 | + | self.contents.draw_text(28, 59, 800, 24, @actor.hab[7].to_s + "/" + @actor.habmax[7].to_s) |
| 141 | #Defesa | |
| 142 | - | self.contents.draw_text(110, 139, 800, 24, $culexp.to_s + "/" + $culmexp.to_s) |
| 142 | + | |
| 143 | #defesa = RPG::Cache.icon("#{defesaa}")
| |
| 144 | #defesa_rect = Rect.new(0,0,249,68) | |
| 145 | #self.contents.blt(0,110,defesa,defesa_rect) | |
| 146 | self.contents.font.size = 12 | |
| 147 | self.contents.draw_text(55, 82,800, 24, @actor.hablvl[8].to_s) | |
| 148 | self.contents.font.size = 11 | |
| 149 | - | self.contents.draw_text(135, 162,800, 24, $mtalvl.to_s) |
| 149 | + | self.contents.draw_text(28, 99, 800, 24, @actor.hab[8].to_s + "/" + @actor.habmax[8].to_s) |
| 150 | #Corte a Lenha | |
| 151 | - | self.contents.draw_text(110, 179, 800, 24, $mtaexp.to_s + "/" + $mtamexp.to_s) |
| 151 | + | |
| 152 | #corle = RPG::Cache.icon("#{corlee}")
| |
| 153 | #corle_rect = Rect.new(0,0,249,68) | |
| 154 | #self.contents.blt(0,150,corle,corle_rect) | |
| 155 | self.contents.font.size = 12 | |
| 156 | self.contents.draw_text(55, 122,800, 24, @actor.hablvl[9].to_s) | |
| 157 | self.contents.font.size = 11 | |
| 158 | - | self.contents.draw_text(55, 42,800, 24, $forlvl.to_s) |
| 158 | + | self.contents.draw_text(28, 139, 800, 24, @actor.hab[9].to_s + "/" + @actor.habmax[9].to_s) |
| 159 | #Arte do Fogo | |
| 160 | - | self.contents.draw_text(28, 59, 800, 24, $forexp.to_s + "/" + $formexp.to_s) |
| 160 | + | |
| 161 | #artfo = RPG::Cache.icon("#{artfoo}")
| |
| 162 | #artfo_rect = Rect.new(0,0,249,68) | |
| 163 | #self.contents.blt(0,190,artfo,artfo_rect) | |
| 164 | self.contents.font.size = 12 | |
| 165 | self.contents.draw_text(55, 162,800, 24, @actor.hablvl[10].to_s) | |
| 166 | self.contents.font.size = 11 | |
| 167 | - | self.contents.draw_text(55, 82,800, 24, $deflvl.to_s) |
| 167 | + | self.contents.draw_text(29, 179, 800, 24, @actor.hab[10].to_s + "/" + @actor.habmax[10].to_s) |
| 168 | #Mineração | |
| 169 | - | self.contents.draw_text(28, 99, 800, 24, $defexp.to_s + "/" + $defmexp.to_s) |
| 169 | + | |
| 170 | #mine = RPG::Cache.icon("#{minee}")
| |
| 171 | #mine_rect = Rect.new(0,0,349,68) | |
| 172 | #self.contents.blt(160,70,mine,mine_rect) | |
| 173 | self.contents.font.size = 12 | |
| 174 | self.contents.draw_text(215, 42, 800, 24, @actor.hablvl[11].to_s) | |
| 175 | self.contents.font.size = 11 | |
| 176 | - | self.contents.draw_text(55, 122,800, 24, $callvl.to_s) |
| 176 | + | self.contents.draw_text(193, 59, 800, 24, @actor.hab[11].to_s + "/" + @actor.habmax[11].to_s) |
| 177 | #Restauração | |
| 178 | - | self.contents.draw_text(28, 139, 800, 24, $calexp.to_s + "/" + $calmexp.to_s) |
| 178 | + | |
| 179 | #res = RPG::Cache.icon("#{ress}")
| |
| 180 | #res_rect = Rect.new(0,0,349,68) | |
| 181 | #self.contents.blt(160,110,res,res_rect) | |
| 182 | self.contents.font.size = 12 | |
| 183 | self.contents.draw_text(215, 82, 800, 24, @actor.hablvl[12].to_s) | |
| 184 | self.contents.font.size = 11 | |
| 185 | - | self.contents.draw_text(55, 162,800, 24, $adflvl.to_s) |
| 185 | + | self.contents.draw_text(193, 99, 800, 24, @actor.hab[12].to_s + "/" + @actor.habmax[12].to_s) |
| 186 | end | |
| 187 | - | self.contents.draw_text(29, 179, 800, 24, $adfexp.to_s + "/" + $adfmexp.to_s) |
| 187 | + | |
| 188 | def check | |
| 189 | for id in 0..12 | |
| 190 | if @actor.hablvl[id] == 0 | |
| 191 | @actor.hablvl[id] = 1 | |
| 192 | @actor.habmax[id] = 72 | |
| 193 | end | |
| 194 | - | self.contents.draw_text(215, 42, 800, 24, $minlvl.to_s) |
| 194 | + | end |
| 195 | end | |
| 196 | - | self.contents.draw_text(193, 59, 800, 24, $minexp.to_s + "/" + $minmexp.to_s) |
| 196 | + | |
| 197 | def on_close | |
| 198 | self.visible = false | |
| 199 | self.active = false | |
| 200 | $habi.visible = false | |
| 201 | $habi.active = false | |
| 202 | $fechando_ativar = true | |
| 203 | - | self.contents.draw_text(215, 82, 800, 24, $reslvl.to_s) |
| 203 | + | |
| 204 | end | |
| 205 | - | self.contents.draw_text(193, 99, 800, 24, $resexp.to_s + "/" + $resmexp.to_s) |
| 205 | + | |
| 206 | attr_reader :hab | |
| 207 | attr_reader :hablvl | |
| 208 | attr_reader :habmax | |
| 209 | alias set_leon setup(actor_id) | |
| 210 | def setup(actor_id) | |
| 211 | @hab = Array.new(13) | |
| 212 | @hablvl = Array.new(13) | |
| 213 | @habmax = Array.new(13) | |
| 214 | set_leon(actor_id) | |
| 215 | end | |
| 216 | end |