Se paciente que es larga
#================================================================== # GMUS Guedez Mouse Use System # Version: 1.0 # Released: 26/5/2006 Last Update: 1/6/2006 # Thx to: Cadafalso, Near Fantastica, and some guys from asylum! #================================================================== class Mouse_PositionCheck def initialize end def main get_pos end def get_window_index(window) window.get_rect_positions return -1 if window.index == -1 return -2 if window.index == -2 for i in 0...window.get_rect.size if window.get_rect[i][0] < $bg.x and window.get_rect[i][1] < $bg.y and window.get_rect[i][2] > $bg.x and window.get_rect[i][3] > $bg.y return i end end return -999999 end def set_pos(x,y) $setCursorPos.Call(x,y) end #==============================Thx to: Cadafalso=================== def get_pos lpPoint = " " * 8 # store two LONGs $getCursorPos.Call(lpPoint) $bg.x, $bg.y = lpPoint.unpack("LL") # get the actual values end #================================================================== end class Window_Selectable < Window_Base def get_rect_positions index = self.index @rect_position = [] if @rect_position == nil if @rect_position == [] for i in 0...(self.row_max * @column_max) self.index = i update_cursor_rect p = self.cursor_rect.to_s p.gsub!("($1,$2,$3,$4):rect","");p.gsub!("(", ""); p.gsub!(")", "") p = p.split(/,\s*/) @rect_position[i] = [p[0].to_i + self.x + 16, p[1].to_i - self.oy + self.y + 16, p[0].to_i + p[2].to_i + self.x + 16, p[1].to_i + p[3].to_i - self.oy + self.y + 16] end self.index = index end end def refresh_rect_positions @rect_position = [] get_rect_positions end def get_rect return @rect_position end alias guedez_update update def update get_rect_positions if self.active == true old_index = self.index new_index = $mouse.get_window_index(self) $game_system.se_play($data_system.cursor_se) if old_index != new_index and not new_index == -999999 @index = new_index if old_index != -1 self.cursor_rect.empty if new_index == -999999 self.index = new_index end guedez_update end end # Actualy my script only need the mouse stuff, but i dont think # the rest will bring any trouble :D, so i let the full script #============================================================================== # ** Keyboard Input Module #============================================================================== # Near Fantastica # Version 5 # 29.11.05 #============================================================================== # The Keyboard Input Module is designed to function as the default Input module # dose. It is better then other methods keyboard input because as a key is # tested it is not removed form the list. so you can test the same key multiple # times the same loop. #============================================================================== #------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ #SDK.log("Keyboard Input", "Near Fantastica", 5, "29.11.05") #------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ #if SDK.state("Keyboard Input") == true module Keyboard #-------------------------------------------------------------------------- @keys = [] @pressed = [] Mouse_Left = 1 Mouse_Right = 2 Back= 8 Tab = 9 Enter = 13 Shift = 16 Ctrl = 17 Alt = 18 Esc = 27 Space = 32 Numberkeys = {} Numberkeys[0] = 48 Numberkeys[1] = 49 Numberkeys[2] = 50 Numberkeys[3] = 51 Numberkeys[4] = 52 Numberkeys[5] = 53 Numberkeys[6] = 54 Numberkeys[7] = 55 Numberkeys[8] = 56 Numberkeys[9] = 57 Numberpad = {} Numberpad[0] = 45 Numberpad[1] = 35 Numberpad[2] = 40 Numberpad[3] = 34 Numberpad[4] = 37 Numberpad[5] = 12 Numberpad[6] = 39 Numberpad[7] = 36 Numberpad[8] = 38 Numberpad[9] = 33 Letters = {} Letters["A"] = 65 Letters["B"] = 66 Letters["C"] = 67 Letters["D"] = 68 Letters["E"] = 69 Letters["F"] = 70 Letters["G"] = 71 Letters["H"] = 72 Letters["I"] = 73 Letters["J"] = 74 Letters["K"] = 75 Letters["L"] = 76 Letters["M"] = 77 Letters["N"] = 78 Letters["O"] = 79 Letters["P"] = 80 Letters["Q"] = 81 Letters["R"] = 82 Letters["S"] = 83 Letters["T"] = 84 Letters["U"] = 85 Letters["V"] = 86 Letters["W"] = 87 Letters["X"] = 88 Letters["Y"] = 89 Letters["Z"] = 90 Fkeys = {} Fkeys[1] = 112 Fkeys[2] = 113 Fkeys[3] = 114 Fkeys[4] = 115 Fkeys[5] = 116 Fkeys[6] = 117 Fkeys[7] = 118 Fkeys[8] = 119 Fkeys[9] = 120 Fkeys[10] = 121 Fkeys[11] = 122 Fkeys[12] = 123 Collon = 186 Equal = 187 Comma = 188 Underscore = 189 Dot = 190 Backslash = 191 Lb = 219 Rb = 221 Quote = 222 State = Win32API.new("user32","GetKeyState",['i'],'i') Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i') #-------------------------------------------------------------------------- def Keyboard.getstate(key) return true unless State.call(key).between?(0, 1) return false end #-------------------------------------------------------------------------- def Keyboard.testkey(key) Key.call(key) & 0x01 == 1 end #-------------------------------------------------------------------------- def Keyboard.update @keys = [] @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left) @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right) @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back) @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab) @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter) @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift) @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl) @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt) @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc) @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space) for key in Keyboard::Numberkeys.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Numberpad.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Letters.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Fkeys.values @keys.push(key) if Keyboard.testkey(key) end @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon) @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal) @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma) @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore) @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot) @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash) @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb) @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb) @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote) @pressed = [] @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left) @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right) @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back) @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab) @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter) @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift) @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl) @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt) @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc) @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space) for key in Keyboard::Numberkeys.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Numberpad.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Letters.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Fkeys.values @pressed.push(key) if Keyboard.getstate(key) end @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon) @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal) @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma) @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore) @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot) @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash) @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb) @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb) @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote) end #-------------------------------------------------------------------------- def Keyboard.trigger?(key) return true if @keys.include?(key) return false end #-------------------------------------------------------------------------- def Keyboard.pressed?(key) return true if @pressed.include?(key) return false end #end #------------------------------------------------------------------------------ # * End SDK Enable Test #------------------------------------------------------------------------------ end #=========================Game_Fixes============================= $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), '' $showm.call(18,0,0,0) $showm.call(13,0,0,0) $showm.call(13,0,2,0) $showm.call(18,0,2,0) $mouse = Mouse_PositionCheck.new $getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V') $setCursorPos = Win32API.new("user32", "SetCursorPos", ['I','I'], 'V') $bg = Sprite.new $bg.bitmap = RPG::Cache.icon('001-Weapon01') $bg.z = 999999 $bg.y = 0 $bg.x = 0 module Input if @self_update == nil @self_update = method('update') @self_press = method('press?') @self_rep = method('repeat?') end def self.update @self_update.call $mouse.main Keyboard.update end def self.trigger?(key_code) if @self_press.call(key_code) return true end if key_code == C return Keyboard.trigger?(Keyboard::Mouse_Left) elsif key_code == B return Keyboard.trigger?(Keyboard::Mouse_Right) else return @self_press.call(key_code) end end def self.repeat?(key_code) if @self_rep.call(key_code) return true end if key_code == C return Keyboard.pressed?(Keyboard::Mouse_Left) elsif key_code == B return Keyboard.pressed?(Keyboard::Mouse_Right) else return @self_rep.call(key_code) end end end class Arrow_Enemy < Arrow_Base def update super $game_troop.enemies.size.times do break if self.enemy.exist? @index += 1 @index %= $game_troop.enemies.size end #size = 0 #for i in 0...$game_troop.enemies.size # size += 1 if $game_troop.enemies[i].hp > 0 #end size = $game_troop.enemies.size if size == nil @index = ((size / 640.0) * $bg.x.to_f).to_i if self.enemy != nil self.x = self.enemy.screen_x self.y = self.enemy.screen_y end end end class Arrow_Actor < Arrow_Base def update super @index = 0 if $bg.x > 0 and $bg.x <= 160 and 0 <= ($game_party.actors.size - 1) @index = 1 if $bg.x > 160 and $bg.x <= 320 and 1 <= ($game_party.actors.size - 1) @index = 2 if $bg.x > 320 and $bg.x <= 480 and 2 <= ($game_party.actors.size - 1) @index = 3 if $bg.x > 480 and $bg.x <= 640 and 3 <= ($game_party.actors.size - 1) if self.actor != nil self.x = self.actor.screen_x self.y = self.actor.screen_y end end end class Window_Target < Window_Selectable alias gupdate update def update @defaultx = 0 if @defaultx == nil if @defaultx != self.x @defaultx = self.x self.refresh_rect_positions return else gupdate end end def update_cursor_rect if @index == -1 self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20) else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end class Scene_Battle def phase3_setup_command_window @party_command_window.active = false @party_command_window.visible = false @actor_command_window.active = true @actor_command_window.visible = true @actor_command_window.x = @actor_index * 160 @actor_command_window.refresh_rect_positions @actor_command_window.index = 0 end end class Scene_Equip def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index @equip_index = equip_index @actor = $game_party.actors[@actor_index] end alias gmain main def main @dummy = Window_EquipItem.new(@actor, 99) gmain @dummy.dispose end alias gupdate_right update_right def update_right if @right_window.index == -999999 if Input.trigger?(Input::C) $game_system.se_play($data_system.buzzer_se) end else gupdate_right end end def refresh @item_window1.visible = (@right_window.index == 0) @item_window2.visible = (@right_window.index == 1) @item_window3.visible = (@right_window.index == 2) @item_window4.visible = (@right_window.index == 3) @item_window5.visible = (@right_window.index == 4) @dummy.visible = (@right_window.index == -999999) item1 = @right_window.item case @right_window.index when 0 @item_window = @item_window1 when 1 @item_window = @item_window2 when 2 @item_window = @item_window3 when 3 @item_window = @item_window4 when 4 @item_window = @item_window5 when -999999 return end if @right_window.active @left_window.set_new_parameters(nil, nil, nil) end if @item_window.active item2 = @item_window.item last_hp = @actor.hp last_sp = @actor.sp @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) new_atk = @actor.atk new_pdef = @actor.pdef new_mdef = @actor.mdef @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) @actor.hp = last_hp @actor.sp = last_sp @left_window.set_new_parameters(new_atk, new_pdef, new_mdef) end end end class Scene_Skill def update_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_window.active = true @target_window.visible = false @target_window.active = false return end if Input.trigger?(Input::C) unless @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.skill_effect(@actor, @skill) end end if @target_window.index == -2 target = $game_party.actors[@target_window.index + 10] used = target.skill_effect(@actor, @skill) end if @target_window.index <= -3 $game_system.se_play($data_system.buzzer_se) return end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.skill_effect(@actor, @skill) end if used $game_system.se_play(@skill.menu_se) @actor.sp -= @skill.sp_cost @status_window.refresh @skill_window.refresh @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $scene = Scene_Map.new return end end unless used $game_system.se_play($data_system.buzzer_se) end return end end end class Scene_File def update @help_window.update for i in @savefile_windows i.update end if Input.trigger?(Input::C) if @file_index == -1 $game_system.se_play($data_system.buzzer_se) else on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end end if Input.trigger?(Input::B) on_cancel return end if $bg.y > 64 and $bg.y < 168 if @savefile_windows[0].selected == false $game_system.se_play($data_system.cursor_se) end @savefile_windows[0].selected = true @savefile_windows[1].selected = false @savefile_windows[2].selected = false @savefile_windows[3].selected = false @file_index = 0 elsif $bg.y > 168 and $bg.y < 272 if @savefile_windows[1].selected == false $game_system.se_play($data_system.cursor_se) end @savefile_windows[0].selected = false @savefile_windows[1].selected = true @savefile_windows[2].selected = false @savefile_windows[3].selected = false @file_index = 1 elsif $bg.y > 272 and $bg.y < 376 if @savefile_windows[2].selected == false $game_system.se_play($data_system.cursor_se) end @savefile_windows[0].selected = false @savefile_windows[1].selected = false @savefile_windows[2].selected = true @savefile_windows[3].selected = false @file_index = 2 elsif $bg.y > 376 and $bg.y < 480 if @savefile_windows[3].selected == false $game_system.se_play($data_system.cursor_se) end @savefile_windows[0].selected = false @savefile_windows[1].selected = false @savefile_windows[2].selected = false @savefile_windows[3].selected = true @file_index = 3 else @file_index = -1 @savefile_windows[0].selected = false @savefile_windows[1].selected = false @savefile_windows[2].selected = false @savefile_windows[3].selected = false end end end class Scene_Menu def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) unless @status_window.index < 0 case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end end end end class Game_Player def update last_moving = moving? unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing or @cant_move case Input.dir4 when 2 move_down when 4 move_left when 6 move_right when 8 move_up end end last_real_x = @real_x last_real_y = @real_y super if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y $game_map.scroll_down(@real_y - last_real_y) end if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X $game_map.scroll_left(last_real_x - @real_x) end if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X $game_map.scroll_right(@real_x - last_real_x) end if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y $game_map.scroll_up(last_real_y - @real_y) end unless moving? if last_moving result = check_event_trigger_here([1,2]) if result == false unless $DEBUG and Input.press?(Input::CTRL) if @encounter_count > 0 @encounter_count -= 1 end end end end if Input.trigger?(Input::C) check_curor_field if (@field_x == self.x + 1 and @field_y == self.y and self.direction == 6) or (@field_x == self.x - 1 and @field_y == self.y and self.direction == 4) or (@field_x == self.x and @field_y == self.y + 1 and self.direction == 2) or (@field_x == self.x and @field_y == self.y - 1 and self.direction == 8) check_event_trigger_there([0,1,2]) end end if Input.repeat?(Input::C) check_curor_field unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing or @cant_move and not (@field_x == self.x and @field_y == self.y) move_by_mouse end check_event_trigger_here([0]) end end end def check_curor_field dummyx = $game_map.display_x > 0 ? $bg.x + 16 : $bg.x @field_x = dummyx / 32 + $game_map.display_x / 128 @field_y = $bg.y / 32 + $game_map.display_y / 128 end def move_by_mouse dy = @field_x - self.x dx = self.y - @field_y if dx > 0 and dy > 0 #quarter 1 if dx > dy if passable?(self.x, self.y, 8) move_up else move_right end return elsif dx < dy if passable?(self.x, self.y, 6) move_right else move_up end return elsif dx == dy if passable?(self.x, self.y, 8) move_up else move_right end return end elsif dx > 0 and dy < 0 #quarter 2 if dx > -dy if passable?(self.x, self.y, 8) move_up else move_left end return elsif dx < -dy if passable?(self.x, self.y, 4) move_left else move_up end return elsif dx == -dy if passable?(self.x, self.y, 8) move_up else move_left end return end elsif dx < 0 and dy < 0 #quarter 2 if -dx > -dy if passable?(self.x, self.y, 2) move_down else move_left end return elsif -dx < -dy if passable?(self.x, self.y, 4) move_left else move_down end return elsif -dx == -dy if passable?(self.x, self.y, 2) move_down else move_left end return end elsif dx < 0 and dy > 0 #quarter 4 if -dx > dy if passable?(self.x, self.y, 2) move_down else move_right end return elsif -dx < dy if passable?(self.x, self.y, 6) move_right else move_down end return elsif -dx == dy if passable?(self.x, self.y, 2) move_down else move_right end return end elsif dx == 0 and dy < 0 move_left elsif dx == 0 and dy > 0 move_right elsif dx < 0 and dy == 0 move_down elsif dx > 0 and dy == 0 move_up end end end
################################################################################ ##### GUARDAR/CARGAR PARTIDAS EN EL MAPA ##### ###### CREADO POR HOUND, IDEA DE DIEGUIN451 #=============================================================================== # Este sencillo miniscript sirve para cargar y guardar partidas fcilmente # en el mapa, desde la constante $game_system. Esto puede parecer intil, pero # es especialmente til para mens o pantallas de ttulo por engines # Lo cree especialmente para Dieguin451, y sus grandes engines, pero puedes # utilizarlo libremente y sin necesidad de acreditarme, ya que esto lo hice # en pocos minutos y result satisfactorio. #=============================================================================== # Como Funciona? # Usa los mtodos que aqu estn aadidos desde la variable global $game_system. # Debers escribir lo siguiente en el comando "llamar script": # Para Guardar: $game_system.guardar(numero) # Para Cargar: $game_system.cargar(numero) # el num que hay dentro del parntesis es el nmero de la partida. # Por ejemplo, si pones $game_system.guardar(1) guardar la partida # en el archivo Save1.rxdata # El mximo de archivos disponibles es ilimitado. # Tambin recuerda en tu engine, al cargar una partida, poner la condicin de si # existe un archivo guardado en ese bloque, ya que de lo contrario dar error # al cargar dicha partida si no existe. # Para ello debers poner en Condiciones y Efectos o Conditional Branch, # en la opcin "script" lo siguiente # $game_system.existe?(num) #=============================================================================== # Esto es todo por ahora. Espero que te sirva de utilidad ;-) # Para cualquier comentario, duda o sugerencia, envalo por email a: # houndninja@gmail.com #=============================================================================== class Game_System def guardar(num) archivo = "Save#{num}.rxdata" file = File.open(archivo, "wb") characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) $game_system.save_count += 1 $game_system.magic_number = $data_system.magic_number Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) file.close end def cargar(num) archivo = "Save#{num}.rxdata" file = File.open(archivo, "rb") characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh file.close end def existe?(num) if FileTest.exist?("Save#{num}.rxdata") return true else return false end end end
#---------------------------------------------------------- # Level Up Point Spend System # by Stefo # LV up Point spend system # If you like this thing and want to use it in your RPG then # put me in your credits #---------------------------------------------------------- #Current Spend per level when you start game $SPLCH1 = 0 $SPLCH2 = 0 $SPLCH3 = 0 $SPLCH4 = 0 $SPLADD = 4 #This is how much you add points to abilities of selected hero $STRBY = 1 $AGIBY = 1 $DEXBY = 1 $INTBY = 1 $HPBY = 10 $SPBY = 10 #DO NOT CHANGE LINES BELOW! $Stradd = 1 $agiadd = 1 $dexadd = 1 $intadd = 1 $hpadd = 1 $spadd = 1 $getokay = 0 $stStrR = 1 $stAgiR = 1 $stDexR = 1 $stIntR = 1 $sthpR = 1 $stspR = 1 $actor1gotlv = 0 $actor2gotlv = 0 $actor3gotlv = 0 $actor4gotlv = 0 #------------------------------------------------------------------------------------------ # Scene_Battle # This is put here to make that you don't have to press 'C' button. #------------------------------------------------------------------------------------------- class Scene_Battle def update_phase5 if @phase5_wait_count > 0 @phase5_wait_count -= 1 if @phase5_wait_count == 0 @result_window.visible = true $game_temp.battle_main_phase = false @status_window.refresh end return end sleep(3) battle_end(0) end end class Act_Get_Spp def initialize(dtd) if !$BTEST actor = $game_actors[dtd] if dtd != 0 GET_IT(dtd) end end end def GET_IT(actids) actor = $game_actors[actids] $stStrR = actor.str.to_i $stIntR = actor.int.to_i $stDexR = actor.dex.to_i $stAgiR = actor.agi.to_i $sthpR = actor.maxhp.to_i $stspR = actor.maxsp.to_i end end class Act_Set_Spp def initialize(cactnum) if !$BTEST actor = $game_actors[cactnum] if cactnum != 0 SET_IT(cactnum) end end end def SET_IT(actids) actor = $game_actors[actids] actor.str = $stStrR actor.int = $stIntR actor.dex = $stDexR actor.agi = $stAgiR actor.maxhp = $sthpR actor.maxsp = $stspR actor.recover_all end end class Acts_Set_Spp_Added def initialize(currentActornum) if !$BTEST actor = $game_actors[currentActornum] if currentActornum != 0 SET_IT(actor) end end end def ADD_IT $ACTORD.str = $Stradd $ACTORD.int = $intadd $ACTORD.dex = $dexadd $ACTORD.agi = $agiadd $ACTORD.maxhp = $hpadd $ACTORD.maxsp = $spadd $ACTORD.recover_all end end class Scene_Title def command_new_game # Play decision sound effect $game_system.se_play($data_system.decision_se) # Stop Title BGM Audio.bgm_stop # Initialize new game Graphics.frame_count = 0 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $acst = Act_Set_Spp.new(0) $acgt = Act_Get_Spp.new(0) $acstadd = Acts_Set_Spp_Added.new(0) # Set up hero party $game_party.setup_starting_members # Set up opening map $game_map.setup($data_system.start_map_id) # Set up hero party's beginning location $game_player.moveto($data_system.start_x, $data_system.start_y) # Set up lead character's map sprite graphic $game_player.refresh # Refresh the map $game_map.autoplay $game_map.update $scene = Scene_Map.new end def battle_test # Load information from database into memory $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") $acst = Act_Set_Spp.new(0) $acgt = Act_Get_Spp.new(0) $acstadd = Acts_Set_Spp_Added.new(0) Graphics.frame_count = 0 # Initialize global classes $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # Set up battle $game_party.setup_battle_test_members $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # Set up music and sound $game_system.se_play($data_system.battle_start_se) $game_system.bgm_play($game_system.battle_bgm) $scene = Scene_Battle.new end end #-------------------------------------------------------------------------------------------- # This is edited because when you go to new level # you automatically gain hp,sp,agility etc. # so it's set that you don't get automatically that attributes #-------------------------------------------------------------------------------------------- class Game_Actor def exp=(exp) @exp = [[exp, 9999999].min, 0].max while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 $acgt.GET_IT(@actor_id) @level += 1 $acst.SET_IT(@actor_id) case @actor_id when 1 $actor1gotlv = 1 @ADSP = $SPLCH1.to_i @ADSP += $SPLADD.to_i $SPLCH1 = @ADSP.to_i when 2 $actor2gotlv = 1 @ADSP = $SPLCH2.to_i @ADSP += $SPLADD.to_i $SPLCH2 = @ADSP.to_i when 3 $actor3gotlv = 1 @ADSP = $SPLCH3.to_i @ADSP += $SPLADD.to_i $SPLCH3 = @ADSP.to_i when 4 $actor4gotlv = 1 @ADSP = $SPLCH4.to_i @ADSP += $SPLADD.to_i $SPLCH4 = @ADSP.to_i end for j in $data_classes[@class_id].learnings if j.level == @level learn_skill(j.skill_id) end end end while @exp < @exp_list[@level] @level -= 1 end @hp = [@hp, self.maxhp].min @sp = [@sp, self.maxsp].min end #------------------------------------------------------------------------------- def level=(level) $acgt.GET_IT(@actor_id) level = [[level, $data_actors[@actor_id].final_level].min, 1].max $acst.SET_IT(@actor_id) $acst.SET_IT(@actor_id) self.exp = @exp_list[level] $acst.SET_IT(@actor_id) case @actor_id when 1 $actor1gotlv = 1 $SPLCH1 += ([[level, $data_actors[@actor_id].final_level].min, 1].max - [[level, $data_actors[@actor_id].final_level].min, 1].max) + $SPLADD.to_i when 2 $actor2gotlv = 1 $SPLCH2 += ([[level, $data_actors[@actor_id].final_level].min, 1].max - [[level, $data_actors[@actor_id].final_level].min, 1].max) + $SPLADD.to_i when 3 $actor3gotlv = 1 $SPLCH3 += ([[level, $data_actors[@actor_id].final_level].min, 1].max - [[level, $data_actors[@actor_id].final_level].min, 1].max) + $SPLADD.to_i when 4 $actor4gotlv = 1 $SPLCH4 += ([[level, $data_actors[@actor_id].final_level].min, 1].max - [[level, $data_actors[@actor_id].final_level].min, 1].max) + $SPLADD.to_i end end end #----------------------------------------------------------------------------------------- # This is edited because you need extra things to save # in this script #------------------------------------------------------------------------------------------ class Scene_Save def write_save_data(file) characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) $game_system.save_count += 1 $game_system.magic_number = $data_system.magic_number Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) Marshal.dump ($SPLCH1,file) Marshal.dump ($SPLCH2,file) Marshal.dump ($SPLCH3,file) Marshal.dump ($SPLCH4,file) Marshal.dump ($actor1gotlv ,file) Marshal.dump ($actor2gotlv ,file) Marshal.dump ($actor3gotlv ,file) Marshal.dump ($actor4gotlv ,file) Marshal.dump($acst,file) Marshal.dump($acgt,file) end end #------------------------------------------------------------------------------------------- # This is edited because you need extra things to load # in this script #------------------------------------------------------------------------------------------- class Scene_Load def read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) $SPLCH1 = Marshal.load (file) $SPLCH2 = Marshal.load (file) $SPLCH3 = Marshal.load (file) $SPLCH4 = Marshal.load (file) $actor1gotlv = Marshal.load (file) $actor2gotlv = Marshal.load (file) $actor3gotlv = Marshal.load (file) $actor4gotlv = Marshal.load (file) $acst = Marshal.load(file) $acgt = Marshal.load(file) $acstadd = Marshal.load(file) if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh end end #--------------------------------------------------------------------- # A location shower ( without background window) # You can show it by calling a script in event # If you don't know how to do it then check mine! #--------------------------------------------------------------------- class Window_LocationShow < Window_Base def initialize super(600, -10, 640, 64) $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys if key = $game_map.map_id @mapnm = $map_infos[key].name end end self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 30 self.x = x - contents.text_size(@mapnm).width self.width = width - contents.text_size(@mapnm).width / 2 self.opacity = 0 refresh end def refresh self.contents.clear self.contents.font.color = Color.new(0,0,0) kl = contents.text_size(@mapnm).width self.contents.draw_text(2, 2, kl, 32,@mapnm , 2) self.contents.font.color = normal_color kl = contents.text_size(@mapnm).width self.contents.draw_text(0, 0, kl, 32,@mapnm , 2) end end class Window_Base < Window def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name,actor.battler_hue) cw =bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw,ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end def drawSPaddparam(actor, x, y, type,get) if $getokay != 0 $Stradd = $ACTORD.str.to_i $agiadd = $ACTORD.agi.to_i $dexadd = $ACTORD.dex.to_i $intadd = $ACTORD.int.to_i $hpadd = $ACTORD.maxhp.to_i $spadd = $ACTORD.maxsp.to_i $getokay = 0 return end @typ = type case @typ when 0 param_name = "Max. " + $data_system.words.hp param_value = $hpadd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color cx = contents.text_size(param_value.to_s).width self.contents.draw_text((x + cx) + 50, y, 70, 32, param_value.to_s, 2) when 1 param_name = "Max. " + $data_system.words.sp param_value = $spadd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color cx = contents.text_size(param_value.to_s).width self.contents.draw_text((x + cx) + 50, y, 70, 32, param_value.to_s, 2) when 2 param_name = $data_system.words.str param_value = $Stradd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, param_value.to_s, 2) when 3 param_name = $data_system.words.dex param_value = $dexadd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, param_value.to_s, 2) when 4 param_name = $data_system.words.agi param_value = $agiadd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, param_value.to_s, 2) when 5 param_name = $data_system.words.int param_value = $intadd.to_i self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, param_value.to_s, 2) end end def drawSPADD(x,y) actors = $ACTORIND case actors when 0 param_name = "Spend Points" self.contents.draw_text(x + 120, y, 36, 32, $SPLCH1.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") when 1 param_name = "Spend Points" self.contents.draw_text(x + 120, y, 36, 32, $SPLCH2.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") when 2 param_name = "Spend Points" self.contents.draw_text(x + 120, y, 36, 32, $SPLCH3.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") when 3 param_name = "Spend Points" self.contents.draw_text(x + 120, y, 36, 32, $SPLCH4.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, param_name + ":") end end def retclear if $getokay != 0 $Stradd = $ACTORD.str.to_i $agiadd = $ACTORD.agi.to_i $dexadd = $ACTORD.dex.to_i $intadd = $ACTORD.int.to_i $hpadd = $ACTORD.maxhp.to_i $spadd = $ACTORD.maxsp.to_i $getokay = 0 end end end #-------------------------------------------------------------------------------------------- # The edited show actor status window #-------------------------------------------------------------------------------------------- class Window_Status < Window_Base def refresh self.contents.clear draw_actor_battler(@actor,55, 250) draw_actor_name(@actor, 4, 0) self.contents.draw_text(154,-10,50,50,"Class:") draw_actor_class(@actor, 4 + 204, 0) draw_actor_level(@actor, 116, 32) draw_actor_state(@actor,116, 64) draw_actor_hp(@actor, 116, 112, 172) draw_actor_sp(@actor, 116, 144, 172) draw_actor_parameter(@actor, 116, 192, 0) draw_actor_parameter(@actor, 116, 224, 1) draw_actor_parameter(@actor, 116, 256, 2) draw_actor_parameter(@actor, 116, 304, 3) draw_actor_parameter(@actor, 116, 336, 4) draw_actor_parameter(@actor, 116, 368, 5) draw_actor_parameter(@actor, 116, 400, 6) self.contents.font.color = system_color self.contents.draw_text(320, 48, 80, 32, "EXP:") self.contents.draw_text(320, 80, 80, 32, "NEXT:") self.contents.font.color = normal_color self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2) self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2) self.contents.font.color = system_color self.contents.draw_text(320, 160, 96, 32, "Equipment") self.contents.draw_text(320, 208, 96, 32,$data_system.words.weapon + ":") self.contents.draw_text(320, 256, 96, 32, $data_system.words.armor1 + ":") self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor2 + ":") self.contents.draw_text(320, 352, 96, 32, $data_system.words.armor3 + ":") self.contents.draw_text(320, 400, 96, 32, $data_system.words.armor4 + ":") draw_item_name($data_weapons[@actor.weapon_id], 400 + 16, 208) draw_item_name($data_armors[@actor.armor1_id], 400 + 16, 256) draw_item_name($data_armors[@actor.armor2_id], 400 + 16, 304) draw_item_name($data_armors[@actor.armor3_id], 400 + 16, 352) draw_item_name($data_armors[@actor.armor4_id], 400 + 16, 400) end def dummy self.contents.font.color = system_color self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon) self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1) self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2) self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3) self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4) draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144) draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208) draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272) draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336) draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400) end end class Scene_Status def checkfora(actorindex) case actorindex when 0 if $actor1gotlv != 0 showlvupwin(actorindex) end when 1 if $actor2gotlv != 0 showlvupwin(actorindex) end when 2 if $actor3gotlv != 0 showlvupwin(actorindex) end when 3 if $actor4gotlv != 0 showlvupwin(actorindex) end end end def showlvupwin(acts) @brek = 0 sleep(0.1) Graphics.freeze Graphics.transition(40) sleep(0.1) Graphics.update sleep(0.1) @title = Window_Help.new @title.set_text("Has obtenido nivel! Quieres subir de nivel?", 0) @title.y = 100 @title.z = 99998 s1 = "Subir nivel!" s2 = "Cancelar" @lvupwin = Window_Command.new(192, [s1, s2]) @lvupwin.x = 220 @lvupwin.y = 200 @lvupwin.z = 99998 @lvupwin.back_opacity = 255 loop do Graphics.update Input.update updat(acts) if @brek != 0 break end end @lvupwin.dispose @title.dispose end def updat(act) @lvupwin.update if Input.trigger?(Input::C) case @lvupwin.index when 0 @brek = 1 $scene = Scene_Spend.new Graphics.transition when 1 @brek = 1 end end end def main @actor = $game_party.actors[@actor_index] @status_window = Window_Status.new(@actor) Graphics.transition $ACTORD = @actor $ACTORIND = @actor_index checkfora(@actor_index) loop do $ACTORD = @actor Graphics.update Input.update update if $scene != self break end end Graphics.freeze @status_window.dispose end end class Window_NewHelp < Window_Base def initialize(text,x,y) super(0, 0, 200, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh(text) end def refresh(text) self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, 32, text) end end #----------------------------------------------------------------------------------------- # Finally the main thing! #----------------------------------------------------------------------------------------- class Window_ActorSpp < Window_Base def initialize(actor,x,y,width,height) super(x, y, width, height) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize @actor = $ACTORD refresh end def refresh self.contents.clear draw_actor_battler($ACTORD, 220, 200) draw_actor_name($ACTORD, 150, 210) draw_actor_level($ACTORD, 150, 230) drawSPaddparam($ACTORD,150,250,0,0) drawSPaddparam($ACTORD,150,270,1,0) drawSPaddparam($ACTORD,150,290,2,0) drawSPaddparam($ACTORD,150,310,3,0) drawSPaddparam($ACTORD,150,330,4,0) drawSPaddparam($ACTORD,150,350,5,0) drawSPADD(150,400) end end class Scene_Spend def main @sprite = Spriteset_Map.new actsr = $ACTORD @kill_it = 0 @clerSP = 1 @help_text = Window_NewHelp.new("Choose attribute:",0,0) @help_text.x = 0 @help_text.y = 0 @help_text.width = 200 @help_text.z = 99999999 @help_text.height = 64 @help_text.opacity = 160 @acSpend = Window_ActorSpp.new(actsr,200,0,440,480) @acSpend.opacity = 160 @acSpend.z = 999999 $getokay = 1 @acSpend.refresh s1 = $data_system.words.hp s2 = $data_system.words.sp s3 = $data_system.words.str s4 = $data_system.words.dex s5 = $data_system.words.agi s6 = $data_system.words.int s7 = "OK" s8 = "Borrar Todo" @AttrSel = Window_Command.new(200, [s1, s2,s3,s4,s5,s6,s7,s8]) @AttrSel.y = 64 @AttrSel.height = 416 @AttrSel.z = 999999 @AttrSel.opacity = 160 Graphics.transition @clerSP = 1 loop do Graphics.update Input.update @acSpend.refresh updateATTRSEL if @kill_it != 0 break end end Graphics.freeze @AttrSel.dispose @acSpend.dispose @help_text.dispose @sprite.dispose Graphics.transition $acstadd.ADD_IT $scene = Scene_Map.new actsr = $ACTORIND case actsr when 0 if $actor1gotlv != 0 $actor1gotlv = 0 end when 1 if $actor2gotlv != 0 $actor2gotlv = 0 end when 2 if $actor3gotlv != 0 $actor3gotlv = 0 end when 3 if $actor4gotlv != 0 $actor4gotlv = 0 end end end def updateATTRSEL @AttrSel.update csa = $ACTORIND if @clerSP != 0 @clerSP = 0 case csa when 0 $SPLRET = $SPLCH1.to_i when 1 $SPLRET = $SPLCH2.to_i when 2 $SPLRET = $SPLCH3.to_i when 3 $SPLRET = $SPLCH4.to_i end end if Input.repeat?(Input::C) case @AttrSel.index when 0 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $hpadd = $hpadd + $HPBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $hpadd = $hpadd + $HPBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $hpadd = $hpadd + $HPBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $hpadd = $hpadd + $HPBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 1 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $spadd = $spadd + $SPBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $spadd = $spadd + $SPBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $spadd = $spadd + $SPBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $spadd = $spadd + $SPBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 2 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $Stradd = $Stradd + $STRBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $Stradd = $Stradd + $STRBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $Stradd = $Stradd + $STRBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $Stradd = $Stradd + $STRBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 3 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $dexadd = $dexadd + $DEXBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $dexadd = $dexadd + $DEXBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $dexadd = $dexadd + $DEXBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $dexadd = $dexadd + $DEXBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 4 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $agiadd = $agiadd + $AGIBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $agiadd = $agiadd + $AGIBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $agiadd = $agiadd + $AGIBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $agiadd = $agiadd + $AGIBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 5 acselt = $ACTORIND case acselt when 0 unless $SPLCH1 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $intadd = $intadd + $INTBY @acSpend.refresh @ackill = $SPLCH1 @ackill -= 1 $SPLCH1 = @ackill unless $SPLCH1 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 1 unless $SPLCH2 > 0 $game_system.se_play($data_system.buzzer_se) return end $intadd = $intadd + $INTBY @acSpend.refresh @ackill = $SPLCH2 @ackill -= 1 $SPLCH2 = @ackill unless $SPLCH2 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 2 unless $SPLCH3 > 0 $game_system.se_play($data_system.buzzer_se) @AttrSel.disable_item(0) return end $intadd = $intadd + $INTBY @acSpend.refresh @ackill = $SPLCH3 @ackill -= 1 $SPLCH3 = @ackill unless $SPLCH3 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end when 3 unless $SPLCH4 > 0 $game_system.se_play($data_system.buzzer_se) return end $intadd = $intadd + $INTBY @acSpend.refresh @ackill = $SPLCH4 @ackill -= 1 $SPLCH4 = @ackill unless $SPLCH4 > 0 @AttrSel.disable_item(0) @AttrSel.disable_item(1) @AttrSel.disable_item(2) @AttrSel.disable_item(3) @AttrSel.disable_item(4) @AttrSel.disable_item(5) return end end when 6 @kill_it = 1 when 7 clear end end end end def clear $getokay = 1 @acSpend.refresh @AttrSel.enable_item(0) @AttrSel.enable_item(1) @AttrSel.enable_item(2) @AttrSel.enable_item(3) @AttrSel.enable_item(4) @AttrSel.enable_item(5) amp = $ACTORIND case amp when 0 $SPLCH1 = $SPLRET when 1 $SPLCH2 = $SPLRET when 2 $SPLCH3 = $SPLRET when 3 $SPLCH4 = $SPLRET return end end class Window_Command < Window_Selectable def enable_item(index) draw_item(index, normal_color) end end #THIS IS ALL!! #-------------------------------------------------------------------------------------------- # End of the Script! # made by Drago del Fato! # Last two words : SCREW FLANDERS! #--------------------------------------------------------------------------------------------
# Anti Event Lag Script #====================================== # By: Near Fantastica # Date: 12.06.05 # Version: 3 #====================================== #====================================== # Game_Map #====================================== class Game_Map #-------------------------------------------------------------------------- def in_range?(object) screne_x = $game_map.display_x screne_x -= 256 screne_y = $game_map.display_y screne_y -= 256 screne_width = $game_map.display_x screne_width += 2816 screne_height = $game_map.display_y screne_height += 2176 return false if object.real_x <= screne_x return false if object.real_x >= screne_width return false if object.real_y <= screne_y return false if object.real_y >= screne_height return true end #-------------------------------------------------------------------------- def update if $game_map.need_refresh refresh end if @scroll_rest > 0 distance = 2 ** @scroll_speed case @scroll_direction when 2 scroll_down(distance) when 4 scroll_left(distance) when 6 scroll_right(distance) when 8 scroll_up(distance) end @scroll_rest -= distance end for event in @events.values if in_range?(event) or event.trigger == 3 or event.trigger == 4 event.update end end for common_event in @common_events.values common_event.update end @fog_ox -= @fog_sx / 8.0 @fog_oy -= @fog_sy / 8.0 if @fog_tone_duration >= 1 d = @fog_tone_duration target = @fog_tone_target @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d @fog_tone_duration -= 1 end if @fog_opacity_duration >= 1 d = @fog_opacity_duration @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d @fog_opacity_duration -= 1 end end end #====================================== # Spriteset_Map #====================================== class Spriteset_Map #-------------------------------------------------------------------------- def in_range?(object) screne_x = $game_map.display_x screne_x -= 256 screne_y = $game_map.display_y screne_y -= 256 screne_width = $game_map.display_x screne_width += 2816 screne_height = $game_map.display_y screne_height += 2176 return false if object.real_x <= screne_x return false if object.real_x >= screne_width return false if object.real_y <= screne_y return false if object.real_y >= screne_height return true end #-------------------------------------------------------------------------- def update if @panorama_name != $game_map.panorama_name or @panorama_hue != $game_map.panorama_hue @panorama_name = $game_map.panorama_name @panorama_hue = $game_map.panorama_hue if @panorama.bitmap != nil @panorama.bitmap.dispose @panorama.bitmap = nil end if @panorama_name != "" @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue) end Graphics.frame_reset end if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue @fog_name = $game_map.fog_name @fog_hue = $game_map.fog_hue if @fog.bitmap != nil @fog.bitmap.dispose @fog.bitmap = nil end if @fog_name != "" @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue) end Graphics.frame_reset end @tilemap.ox = $game_map.display_x / 4 @tilemap.oy = $game_map.display_y / 4 @tilemap.update @panorama.ox = $game_map.display_x / 8 @panorama.oy = $game_map.display_y / 8 @fog.zoom_x = $game_map.fog_zoom / 100.0 @fog.zoom_y = $game_map.fog_zoom / 100.0 @fog.opacity = $game_map.fog_opacity @fog.blend_type = $game_map.fog_blend_type @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy @fog.tone = $game_map.fog_tone i=0 for sprite in @character_sprites if sprite.character.is_a?(Game_Event) if in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4 sprite.update i+=1 end else sprite.update i+=1 end end #p i @weather.type = $game_screen.weather_type @weather.max = $game_screen.weather_max @weather.ox = $game_map.display_x / 4 @weather.oy = $game_map.display_y / 4 @weather.update for sprite in @picture_sprites sprite.update end @timer_sprite.update @viewport1.tone = $game_screen.tone @viewport1.ox = $game_screen.shake @viewport3.color = $game_screen.flash_color @viewport1.update @viewport3.update end end
class Window_Message < Window_Selectable # ------------------------------------ def initialize super(80, 304, 480, 160) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false self.z = 9998 @update_text = true @fade_in = false @fade_out = false @contents_showing = false @cursor_width = 0 self.active = false self.index = -1 end # ------------------------------------ def dispose terminate_message $game_temp.message_window_showing = false if @input_number_window != nil @input_number_window.dispose end super end # ------------------------------------ def terminate_message self.active = false self.pause = false self.index = -1 self.contents.clear @update_text = true @contents_showing = false if $game_temp.message_proc != nil $game_temp.message_proc.call end $game_temp.message_text = nil $game_temp.message_proc = nil $game_temp.choice_start = 99 $game_temp.choice_max = 0 $game_temp.choice_cancel_type = 0 $game_temp.choice_proc = nil $game_temp.num_input_start = 99 $game_temp.num_input_variable_id = 0 $game_temp.num_input_digits_max = 0 if @gold_window != nil @gold_window.dispose @gold_window = nil end end # ------------------------------------ def refresh self.contents.clear self.contents.font.color = normal_color @x = @y = 0 @cursor_width = 0 if $game_temp.choice_start == 0 @x = 8 end if $game_temp.message_text != nil @text = $game_temp.message_text begin last_text = @text.clone @text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until @text == last_text @text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end @text.gsub!(/\\\\/) { "\000" } @text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } @text.gsub!(/\\[Gg]/) { "\002" } end end # ------------------------------------ def reset_window if $game_temp.in_battle self.y = 16 else case $game_system.message_position when 0 self.y = 16 when 1 self.y = 160 when 2 self.y = 304 end end if $game_system.message_frame == 0 self.opacity = 255 else self.opacity = 0 end self.back_opacity = 160 end # ------------------------------------ def update_text if @text != nil while ((c = @text.slice!(/./m)) != nil) if c == "\000" c = "\\" end if c == "\001" @text.sub!(/\[([0-9]+)\]/, "") color = $1.to_i if color >= 0 and color <= 7 self.contents.font.color = text_color(color) end end if c == "\002" if @gold_window == nil @gold_window = Window_Gold.new @gold_window.x = 560 - @gold_window.width if $game_temp.in_battle @gold_window.y = 192 else @gold_window.y = self.y >= 128 ? 32 : 384 end @gold_window.opacity = self.opacity @gold_window.back_opacity = self.back_opacity end next end if c == "\n" if @y >= $game_temp.choice_start @cursor_width = [@cursor_width, @x].max end @y += 1 @x = 0 if @y >= $game_temp.choice_start @x = 8 end next end self.contents.draw_text(4 + @x, 32 * @y, 40, 32, c) @x += self.contents.text_size(c).width $game_system.se_play($data_system.decision_se) return end end if $game_temp.choice_max > 0 @item_max = $game_temp.choice_max self.active = true self.index = 0 end if $game_temp.num_input_variable_id > 0 digits_max = $game_temp.num_input_digits_max number = $game_variables[$game_temp.num_input_variable_id] @input_number_window = Window_InputNumber.new(digits_max) @input_number_window.number = number @input_number_window.x = self.x + 8 @input_number_window.y = self.y + $game_temp.num_input_start * 32 end @update_text = false #š end # ------------------------------------ def update super if @fade_in self.contents_opacity = 255 if @input_number_window != nil @input_number_window.contents_opacity = 255 end if self.contents_opacity == 255 @fade_in = false end end if @input_number_window != nil @input_number_window.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number $game_map.need_refresh = true @input_number_window.dispose @input_number_window = nil terminate_message end return end if @contents_showing if @update_text update_text return end if $game_temp.choice_max == 0 self.pause = true end if self.pause == true && Input.dir4 != 0 terminate_message end if Input.trigger?(Input::B) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1) terminate_message end terminate_message if self.pause == true end # Œˆ’ if Input.trigger?(Input::C) if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end terminate_message end return end if @fade_out == false and $game_temp.message_text != nil @contents_showing = true $game_temp.message_window_showing = true reset_window refresh Graphics.frame_reset self.visible = true self.contents_opacity = 0 if @input_number_window != nil @input_number_window.contents_opacity = 0 end @fade_in = true return end if self.visible @fade_out = true self.opacity = 0 if self.opacity == 0 self.visible = false @fade_out = false $game_temp.message_window_showing = false end return end end # ------------------------------------ def update_cursor_rect if @index >= 0 n = $game_temp.choice_start + @index self.cursor_rect.set(8, n * 32, @cursor_width, 32) else self.cursor_rect.empty end end end
#=================================================== # AMS - Advanced Message Script - R4 [Update #2] #=================================================== # For more infos and update, visit: # www.dubealex.com (Creation Asylum) # # Edited, Fixed and Enhanced by: Dubealex # Original Script Core by: XRXS Scripter (Jap Dudes) # HTML Hexadecimal color feature from: Phylomorphis # # Special Thanks: # Rabu: For enabling the Show Face feature in an encrypted project # # To found all my new features, search the following: #NEW # To configure the button to skip the dialog, search: #SKIP_TEXT_CODE # # May 18, 2005 #=================================================== LETTER_BY_LETTER_MODE = true #Set the letter by letter mode ON/OFF #=================================================== # ? CLASS AMS Begins #=================================================== class AMS attr_accessor :name_box_x_offset attr_accessor :name_box_y_offset attr_accessor :font_type attr_accessor :name_font_type attr_accessor :font_size attr_accessor :name_font_size attr_accessor :message_box_opacity attr_accessor :name_box_skin attr_accessor :name_box_text_color attr_accessor :message_box_text_color attr_accessor :message_box_skin attr_accessor :name_box_width attr_accessor :name_box_height attr_accessor :message_width attr_accessor :message_height attr_accessor :message_x attr_accessor :message_y_bottom attr_accessor :message_y_middle attr_accessor :message_y_top attr_accessor :event_message_x_ofset attr_accessor :event_message_y_ofset def initialize @name_box_x_offset = 0 #Choose the X axis offset of the name bos. default= 0 @name_box_y_offset = -10 #Choose the Y axis offset of the name bos. default= -10 @name_box_width = 8 #Choose the width of the Name Box. default= 8 @name_box_height = 26 #Choose the height of the Name Box. default= 26 @font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for message box @name_font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for Name Box @font_size = 22 #Choose the default Font Size for message box text @name_font_size = 22 #Choose the deafault Font Size for Name Box text @name_box_text_color=0 #Choose the Text Color of the Name Box @message_box_text_color=0 #Choose the Text Color of the Message Box @message_box_opacity = 160 #Choose the opacity of the message window. Default=160 @message_box_skin = "001-Blue01" #Choose the WindowSkin for the Message Box @name_box_skin = "001-Blue01" #Choose the WindowSkin for the Name Box @message_width = 480 #Choose the width size of the message box. Default=480 @message_height = 160 #Choose the height size of the message box. Default=160 @message_x = 80 #Choose the X position of the message box. Default=80 @message_y_bottom = 304 #Choose the Y bottom position of the message box. Default=304 @message_y_middle = 160 #Choose the Y middle position of the message box. Default=160 @message_y_top = 16 #Choose the Y top position of the message box. Default=16 @event_message_x_ofset = 0 #Choose the X position offset of the event message. Default=0 @event_message_y_ofset = 48 #Choose the Y position offset of the event message. Default=48 end end #=================================================== # ? CLASS AMS Ends #=================================================== #=================================================== # ? Class Window_Message Begins #=================================================== class Window_Message < Window_Selectable alias xrxs9_initialize initialize def initialize @alex_skip = false xrxs9_initialize if $soundname_on_speak == nil then $soundname_on_speak = "" end $gaiji_file = "./Graphics/Gaiji/sample.png" if FileTest.exist?($gaiji_file) @gaiji_cache = Bitmap.new($gaiji_file) else @gaigi_cache = nil end @opacity_text_buf = Bitmap.new(32, 32) end #-------------------------------------------------------------------------- alias xrxs9_terminate_message terminate_message def terminate_message if @name_window_frame != nil @name_window_frame.dispose @name_window_frame = nil end if @name_window_text != nil @name_window_text.dispose @name_window_text = nil end xrxs9_terminate_message end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = text_color($ams.message_box_text_color) self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size self.windowskin = RPG::Cache.windowskin($ams.message_box_skin) @x = @y = @max_x = @max_y = @indent = @lines = 0 @face_indent = 0 @opacity = 255 @cursor_width = 0 @write_speed = 0 @write_wait = 0 @mid_stop = false @face_file = nil @popchar = -2 if $game_temp.choice_start == 0 @x = 8 end if $game_temp.message_text != nil @now_text = $game_temp.message_text if (/\A\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then @face_file = $1 + ".png" @x = @face_indent = 128 if FileTest.exist?("Graphics/Pictures/" + $1 + ".png") self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96)) end @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" } end begin last_text = @now_text.clone @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) } end until @now_text == last_text @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end #NEW #Dubealex's Stop Skip Text ON-OFF @now_text.gsub!(/\\[%]/) { "\100" } #End new command #NEW #Dubealex's Show Monster Name Feature @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) do $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : "" end #End new command #NEW #Dubealex's Show Item Price Feature @now_text.gsub!(/\\[Pp]rice\[([0-9]+)\]/) do $data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : "" end #End new command #NEW #Dubealex's Show Hero Class Name Feature @now_text.gsub!(/\\[Cc]lass\[([0-9]+)\]/) do $data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : "" end #End new command #NEW #Dubealex's Show Current Map Name Feature @now_text.gsub!(/\\[Mm]ap/) do $game_map.name != nil ? $game_map.name : "" end #End new command #NEW #Dubealex's Choose Name Box Text Color @now_text.gsub!(/\\[Zz]\[([0-9]+)\]/) do $ams.name_box_text_color=$1.to_i @now_text.sub!(/\\[Zz]\[([0-9]+)\]/) { "" } end #End new command name_window_set = false if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil name_window_set = true name_text = $1 @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" } end if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then @popchar = $1.to_i if @popchar == -1 @x = @indent = 48 @y = 4 end @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" } end @max_choice_x = 0 if @popchar >= 0 @text_save = @now_text.clone @max_x = 0 @max_y = 4 for i in 0..3 line = @now_text.split(/\n/)[3-i] @max_y -= 1 if line == nil and @max_y <= 4-i next if line == nil line.gsub!(/\\\w\[(\w+)\]/) { "" } cx = contents.text_size(line).width @max_x = cx if cx > @max_x if i >= $game_temp.choice_start @max_choice_x = cx if cx > @max_choice_x end end self.width = @max_x + 32 + @face_indent self.height = (@max_y - 1) * 32 + 64 @max_choice_x -= 68 @max_choice_x -= @face_indent*216/128 else @max_x = self.width - 32 - @face_indent for i in 0..3 line = @now_text.split(/\n/)[i] next if line == nil line.gsub!(/\\\w\[(\w+)\]/) { "" } cx = contents.text_size(line).width if i >= $game_temp.choice_start @max_choice_x = cx if cx > @max_choice_x end end @max_choice_x += 8 end @cursor_width = 0 @now_text.gsub!(/\\\\/) { "\000" } @now_text.gsub!(/\\[Cc]\[([0123456789ABCDEF#]+)\]/) { "\001[#{$1}]" } @now_text.gsub!(/\\[Gg]/) { "\002" } @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" } @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" } #NEW #Dubealex's Permanent Color Change @now_text.gsub!(/\\[Cc]olor\[([0-9]+)\]/) do $ams.message_box_text_color= $1.to_i @now_text.sub!(/\\[Cc]\[([0-9]+)\]/) { "" } end #End of new command #NEW #Dubealex's Font Change Feature @now_text.gsub(/\\[Tt]\[(.*?)\]/) do buftxt = $1.to_s $ams.font_type = buftxt @now_text.sub!(/\\[Tt]\[(.*?)\]/) { "" } end #End of new command @now_text.gsub!(/\\[.]/) { "\005" } @now_text.gsub!(/\\[|]/) { "\006" } @now_text.gsub!(/\\[>]/) { "\016" } @now_text.gsub!(/\\[<]/) { "\017" } @now_text.gsub!(/\\[!]/) { "\020" } @now_text.gsub!(/\\[~]/) { "\021" } @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" } @now_text.gsub!(/\\[Ii]/) { "\023" } @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" } @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" } @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" } @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" } reset_window if name_window_set color=$ams.name_box_text_color off_x = $ams.name_box_x_offset off_y = $ams.name_box_y_offset space = 2 x = self.x + off_x - space / 2 y = self.y + off_y - space / 2 w = self.contents.text_size(name_text).width + $ams.name_box_width + space h = $ams.name_box_height + space @name_window_frame = Window_Frame.new(x, y, w, h) @name_window_frame.z = self.z + 1 x = self.x + off_x + 4 y = self.y + off_y @name_window_text = Air_Text.new(x, y, name_text, color) @name_window_text.z = self.z + 2 end end reset_window if $game_temp.choice_max > 0 @item_max = $game_temp.choice_max self.active = true self.index = 0 end if $game_temp.num_input_variable_id > 0 digits_max = $game_temp.num_input_digits_max number = $game_variables[$game_temp.num_input_variable_id] @input_number_window = Window_InputNumber.new(digits_max) @input_number_window.number = number @input_number_window.x = self.x + 8 @input_number_window.y = self.y + $game_temp.num_input_start * 32 end end #-------------------------------------------------------------------------- def update super if @fade_in self.contents_opacity += 24 if @input_number_window != nil @input_number_window.contents_opacity += 24 end if self.contents_opacity == 255 @fade_in = false end return end @now_text = nil if @now_text == "" if @now_text != nil and @mid_stop == false if @write_wait > 0 @write_wait -= 1 return end text_not_skip = LETTER_BY_LETTER_MODE while true @max_x = @x if @max_x < @x @max_y = @y if @max_y < @y if (c = @now_text.slice!(/./m)) != nil if c == "\000" c = "\\" end if c == "\001" @now_text.sub!(/\[([0123456789ABCDEF#]+)\]/, "") temp_color = $1 color = temp_color.to_i leading_x = temp_color.to_s.slice!(/./m) if leading_x == "#" self.contents.font.color = hex_color(temp_color) next end if color >= 0 and color <= 7 self.contents.font.color = text_color(color) end next end if c == "\002" if @gold_window == nil and @popchar <= 0 @gold_window = Window_Gold.new @gold_window.x = 560 - @gold_window.width if $game_temp.in_battle @gold_window.y = 192 else @gold_window.y = self.y >= 128 ? 32 : 384 end @gold_window.opacity = self.opacity @gold_window.back_opacity = self.back_opacity end c = "" end if c == "\003" @now_text.sub!(/\[([0-9]+)\]/, "") speed = $1.to_i if speed >= 0 and speed <= 19 @write_speed = speed end c = "" end if c == "\004" @now_text.sub!(/\[(.*?)\]/, "") buftxt = $1.dup.to_s if buftxt.match(/\//) == nil and buftxt != "" then $soundname_on_speak = "Audio/SE/" + buftxt else $soundname_on_speak = buftxt.dup end c = "" elsif c == "\004" c = "" end if c == "\005" @write_wait += 5 c = "" end if c == "\006" @write_wait += 20 c = "" end if c == "\016" text_not_skip = false c = "" end if c == "\017" text_not_skip = true c = "" end if c == "\020" @mid_stop = true c = "" end if c == "\021" terminate_message return end if c == "\023" @indent = @x c = "" end if c == "\024" @now_text.sub!(/\[([0-9]+)\]/, "") @opacity = $1.to_i color = self.contents.font.color self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255) c = "" end if c == "\025" @now_text.sub!(/\[([0-9]+)\]/, "") self.contents.font.size = [[$1.to_i, 6].max, 32].min c = "" end if c == "\026" @now_text.sub!(/\[([0-9]+)\]/, "") @x += $1.to_i c = "" end if c == "\027" @now_text.sub!(/\[(.*?)\]/, "") @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity) if $soundname_on_speak != "" Audio.se_play($soundname_on_speak) end c = "" end if c == "\030" @now_text.sub!(/\[(.*?)\]/, "") self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24)) if $soundname_on_speak != "" Audio.se_play($soundname_on_speak) end @x += 24 c = "" end if c == "\n" @lines += 1 @y += 1 @x = 0 + @indent + @face_indent if @lines >= $game_temp.choice_start @x = 8 + @indent + @face_indent @cursor_width = @max_choice_x end c = "" end if c == "\022" @now_text.sub!(/\[([0-9]+)\]/, "") @x += gaiji_draw(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i) c = "" end #NEW #Dubealex's Text Skip On/OFF Command if c == "\100" if @alex_skip==false @alex_skip=true else @alex_skip=false end c = "" end #end of new command if c != "" self.contents.draw_text(0+@x, 32 * @y, 40, 32, c) @x += self.contents.text_size(c).width if $soundname_on_speak != "" then Audio.se_play($soundname_on_speak) end end #SKIP_TEXT_CODE # B = Escape, 0 (On The NumPad), X # C = Enter, Space Bar and C # A = Shift, Z if Input.press?(Input::C) # <-- Change the value on that line if @alex_skip==false text_not_skip = false end end else text_not_skip = true break end if text_not_skip break end end @write_wait += @write_speed return end if @input_number_window != nil @input_number_window.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number $game_map.need_refresh = true @input_number_window.dispose @input_number_window = nil terminate_message end return end if @contents_showing if $game_temp.choice_max == 0 self.pause = true end if Input.trigger?(Input::B) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1) terminate_message end end if Input.trigger?(Input::C) if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end if @mid_stop @mid_stop = false return else terminate_message end end return end if @fade_out == false and $game_temp.message_text != nil @contents_showing = true $game_temp.message_window_showing = true refresh Graphics.frame_reset self.visible = true self.contents_opacity = 0 if @input_number_window != nil @input_number_window.contents_opacity = 0 end @fade_in = true return end if self.visible @fade_out = true self.opacity -= 48 if self.opacity == 0 self.visible = false @fade_out = false $game_temp.message_window_showing = false end return end end #-------------------------------------------------------------------------- def get_character(parameter) case parameter when 0 return $game_player else events = $game_map.events return events == nil ? nil : events[parameter] end end #-------------------------------------------------------------------------- def reset_window #MESSAGE_SIZE #MESSAGE_POSITION if @popchar >= 0 events = $game_map.events if events != nil character = get_character(@popchar) x = [[character.screen_x - $ams.event_message_x_ofset - self.width / 2, 4].max, 636 - self.width].min y = [[character.screen_y - $ams.event_message_y_ofset - self.height, 4].max, 476 - self.height].min self.x = x self.y = y end elsif @popchar == -1 self.x = -4 self.y = -4 self.width = 648 self.height = 488 else if $game_temp.in_battle self.y = 16 else case $game_system.message_position when 0 self.y = $ams.message_y_top when 1 self.y = $ams.message_y_middle when 2 self.y = $ams.message_y_bottom end self.x = $ams.message_x if @face_file == nil self.width = $ams.message_width self.x = $ams.message_x else if self.width <= 600 self.width = 600 self.x -=60 end end self.height = $ams.message_height end end self.contents = Bitmap.new(self.width - 32, self.height - 32) self.contents.font.color = text_color($ams.message_box_text_color) self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size if @face_file != nil self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96)) end if @popchar == -1 self.opacity = 255 self.back_opacity = 0 elsif $game_system.message_frame == 0 self.opacity = 255 self.back_opacity = $ams.message_box_opacity else self.opacity = 0 self.back_opacity = $ams.message_box_opacity end end #-------------------------------------------------------------------------- def gaiji_draw(x, y, num) if @gaiji_cache == nil return 0 else if @gaiji_cache.width < num * 24 return 0 end if self.contents.font.size >= 20 and self.contents.font.size <= 24 size = 24 else size = self.contents.font.size * 100 * 24 / 2200 end self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * 24, 0, 24, 24)) if $soundname_on_speak != "" then Audio.se_play($soundname_on_speak) end return size end end #-------------------------------------------------------------------------- def line_height return 32 if self.contents.font.size >= 20 and self.contents.font.size <= 24 return 32 else return self.contents.font.size * 15 / 10 end end #-------------------------------------------------------------------------- def ruby_draw_text(target, x, y, str,opacity) sizeback = target.font.size target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2 rubysize = [rubysize, 6].max opacity = [[opacity, 0].max, 255].min split_s = str.split(/,/) split_s[0] == nil ? split_s[0] = "" : nil split_s[1] == nil ? split_s[1] = "" : nil height = sizeback + rubysize width = target.text_size(split_s[0]).width target.font.size = rubysize ruby_width = target.text_size(split_s[1]).width target.font.size = sizeback buf_width = [target.text_size(split_s[0]).width, ruby_width].max width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0 if opacity == 255 target.font.size = rubysize target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1]) target.font.size = sizeback target.draw_text(x, y, width, target.font.size, split_s[0]) return width else if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height @opacity_text_buf.dispose @opacity_text_buf = Bitmap.new(buf_width, height) else @opacity_text_buf.clear end @opacity_text_buf.font.size = rubysize @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1) @opacity_text_buf.font.size = sizeback @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1) if sub_x >= 0 target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity) else target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity) end return width end end #-------------------------------------------------------------------------- def convart_value(option, index) option == nil ? option = "" : nil option.downcase! case option when "i" unless $data_items[index].name == nil r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name) end when "w" unless $data_weapons[index].name == nil r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name) end when "a" unless $data_armors[index].name == nil r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name) end when "s" unless $data_skills[index].name == nil r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name) end else r = $game_variables[index] end r == nil ? r = "" : nil return r end #-------------------------------------------------------------------------- def dispose terminate_message if @gaiji_cache != nil unless @gaiji_cache.disposed? @gaiji_cache.dispose end end unless @opacity_text_buf.disposed? @opacity_text_buf.dispose end $game_temp.message_window_showing = false if @input_number_window != nil @input_number_window.dispose end super end #-------------------------------------------------------------------------- def update_cursor_rect if @index >= 0 n = $game_temp.choice_start + @index self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32) else self.cursor_rect.empty end end end #========================================= # ? CLASS Window_Message Ends #========================================= #========================================= # ? Class Window_Frame Begins #========================================= class Window_Frame < Window_Base def initialize(x, y, width, height) super(x, y, width, height) self.windowskin = RPG::Cache.windowskin($ams.name_box_skin) self.contents = nil end #-------------------------------------------------------------------------- def dispose super end end #========================================= # ? CLASS Window_Frame Ends #========================================= #========================================= # ? CLASS Game_Map Additional Code Begins #========================================= class Game_Map #Dubealex's Addition (from XRXS) to show Map Name on screen def name $map_infos[@map_id] end end #========================================= # ? CLASS Game_Map Additional Code Ends #========================================= #========================================= # ? CLASS Scene_Title Additional Code Begins #========================================= class Scene_Title #Dubealex's Addition (from XRXS) to show Map Name on screen $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end #Dubealex's addition to save data from the AMS in the save files $ams = AMS.new end #========================================= # ? CLASS Scene_Title Additional Code Ends #========================================= #========================================= # ? CLASS Window_Base Additional Code Begins #========================================= class Window_Base < Window #Dubealex Addition (from Phylomorphis) to use HTML Hex Code Colors def hex_color(string) red = 0 green = 0 blue = 0 if string.size != 6 print("Hex strings must be six characters long.") print("White text will be used.") return Color.new(255, 255, 255, 255) end for i in 1..6 s = string.slice!(/./m) if s == "#" print("Hex color string may not contain the \"#\" character.") print("White text will be used.") return Color.new(255, 255, 255, 255) end value = hex_convert(s) if value == -1 print("Error converting hex value.") print("White text will be used.") return Color.new(255, 255, 255, 255) end case i when 1 red += value * 16 when 2 red += value when 3 green += value * 16 when 4 green += value when 5 blue += value * 16 when 6 blue += value end end return Color.new(red, green, blue, 255) end #-------------------------------------------------------------------------- def hex_convert(character) case character when "0" return 0 when "1" return 1 when "2" return 2 when "3" return 3 when "4" return 4 when "5" return 5 when "6" return 6 when "7" return 7 when "8" return 8 when "9" return 9 when "A" return 10 when "B" return 11 when "C" return 12 when "D" return 13 when "E" return 14 when "F" return 15 end return -1 end end #========================================= # ? CLASS Window_Base Additional Code Ends #========================================= #========================================= # ? Class Air_Text Begins #========================================= class Air_Text < Window_Base def initialize(x, y, designate_text, color=0) super(x-16, y-16, 32 + designate_text.size * 12, 56) self.opacity = 0 self.back_opacity = 0 self.contents = Bitmap.new(self.width - 32, self.height - 32) w = self.contents.width h = self.contents.height self.contents.font.name = $ams.name_font_type self.contents.font.size = $ams.name_font_size self.contents.font.color = text_color(color) self.contents.draw_text(0, 0, w, h, designate_text) end #-------------------------------------------------------------------------- def dispose self.contents.clear super end end #========================================== # ? CLASS Air_Text Ends #========================================== #=================================================== # ? CLASS Scene_Save Additional Code Begins #=================================================== class Scene_Save < Scene_File alias ams_original_write_save_data write_save_data def write_save_data(file) ams_original_write_save_data(file) Marshal.dump($ams, file) end end #=================================================== # ? CLASS Scene_Save Additional Code Ends #=================================================== #=================================================== # ? CLASS Scene_Load Additional Code Begins #=================================================== class Scene_Load < Scene_File alias ams_original_read_save_data read_save_data def read_save_data(file) ams_original_read_save_data(file) $ams = Marshal.load(file) end end #=================================================== # ? CLASS Scene_Load Additional Code Ends #===================================================
Con este script podrs: - Modificar el tamao y la posicin de la ventana de texto. - Permitir o bloquear saltar el texto. - Cerrar un dilogo automticamente. - Reproducir sonidos en los dilogos, cambiar la opacidad de los textos, su color (en hexadecimal), su tamao y la fuente utilizada. - Mostrar el nombre de un personaje (o de cualquier otra cosa) en un cuadradito sobre el cuadro de dilogo. - Mostrar el nombre del mapa, la cantidad de dinero que posees, la clase de un personaje, el precio de un objeto, etc. - Modificar la velocidad con la que aparece el texto. INSTRUCCIONES: Cada uno de los comandos que aparecen a continuacin, se debern colocar en la misma ventana del dilogo en el que quieres que surtan efecto. - Cambiar el color del texto: \c[ID del color] \c[#XXXXXX] (donde X es un valor comprendido con nmeros entre 0 y 9 y letras entre A y F) - Mostrar el dinero que tienes: \G - Mostrar el nombre del hroe: \n[ID del hroe] - Mostrar el nombre de un monstruo: \m[ID del monstruo] - Mostrar el precio de un objeto: \price[ID del objeto] - Mostrar el nombre del mapa en el que te encuentras: \Map - Mostrar un grfico de cara en el cuadro de dilogo: \f[nombre de la imagen] (Para que este funcione, debes colocar una imagen en formato png de tamao 96x96, con el nombre que desees, ya que este nombre ser el que uses en el cdigo, sin el png. Ej.: \f[alexis]) - Mostrar la clase a la que pertenece un personaje: \Class[ID del hroe] - Mostrar variables, objetos, armas, armaduras y habilidades: \v[xID] (x debe ser sustituido por una letra segn lo que quieras mostrar, siendo i para objetos, a para armaduras, w para armas, s para habilidades y en blanco si simplemente deseas mostrar una variable. Luego debes poner el ID de la variable que deseas mostrar) - Mostrar un nombre en un cuadradito sobre el cuadro de dilogo: \name[x] (Siendo x lo que desees escribir. Si lo que quieres es ver el nombre del 5 hroe, deberas escribir: \name[\n[5]] o \name[Pedro]) - Cambiar la opacidad del texto: \o[nmero entre el 0 y el 255] (Siendo 0 totalmente transparente y 255 totalmente visible) - Cambiar la velocidad del texto: \s[nmero entre el 1 y el 19] (Siendo el 1 el ms rpido y el 19 el ms lento) - Cambiar el tamao del texto: \h[nmero entre el 6 y el 32] (Siendo el 6 el tamao ms pequeo y el 32 el ms grande) - Mostrar el cuadro de dilogo sobre el hroe o un evento: \p[opcin elegida] (Donde pone opcin elegida, debers poner el ID del evento, un 0 si quieres que aparezca sobre el hroe o un -1 si quieres que aparezcan sin los bordes) - Cambiar la fuente de un cuadro de dilogo: \t[nombre de la fuente] (La fuente debe ser un archivo .TTF colocado en la carpeta Windows\Fonts. Este comando se har permanente hasta que se cambie el tipo de fuente) - Reproducir un efecto sonoro durante el mensaje: \a[nombre del archivo] (El archivo deseado debe estar en el directorio Audio\SE. Recuerda desactivar el sonido escribiendo \a[], ya que si no, el sonido sonara una y otra vez) - Permitir o bloquear saltar el texto: \% (si bloqueas el que un texto pueda ser leido rpidamente, el cambio ser permanente, con lo que debers desactivarlo cuando quieras que se pueda leer el texto rpidamente) - Cambiar el color del cuadradito de dilogo sobre el cuadro de dilogo principal (cambio permanente): \z[ID del color] (Se puede cambiar de nuevo el color escribiendo este cdigo de nuevo y poniendo el color que quieres que sea el nuevo permanente) - Cambiar el color del cuadro de dilogo: \Color[ID del color] (Se puede cambiar de nuevo el color escribiendo este cdigo de nuevo y poniendo el color que quieres que sea el nuevo permanente) - Otros comandos: \| -> Espera por 1 segundo \. -> Espera por 0,25 segundos \~ -> Cierra el cuadro de dilogo automticamente al escribirse la ltima letra \! -> Espera a que el jugador presione una tecla \\ -> Mostrar el caracter \ en un dilogo \< -> Activa el mostrar el dilogo letra a letra \> -> Desactiva el mostrar el dilogo letra a letra
class Scene_Menu # -------------------------------- def initialize(menu_index = 0) @menu_index = menu_index @changer = 0 @where = 0 @checker = 0 end # -------------------------------- def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Estado" s5 = "Guardar" s6 = "Salir" s7 = "Cambiar" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) @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 if $game_party.actors.size == 1 @command_window.disable_item(6) end @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 256 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @gold_window.dispose @status_window.dispose end # -------------------------------- def update @command_window.update @playtime_window.update @gold_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end # -------------------------------- def update_command 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 $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end if $game_party.actors.size == 1 and @command_window.index ==6 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 5 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new when 6 $game_system.se_play($data_system.decision_se) @checker = 0 @command_window.active = false @status_window.active = true @status_window.index = 0 end return end end # -------------------------------- def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) when 6 $game_system.se_play($data_system.decision_se) if @checker == 0 @changer = $game_party.actors[@status_window.index] @where = @status_window.index @checker = 1 else $game_party.actors[@where] = $game_party.actors[@status_window.index] $game_party.actors[@status_window.index] = @changer @checker = 0 @status_window.refresh end end return end end end
begin keybd = Win32API.new 'user32.dll','keybd_event',['i', 'i', 'l', 'l'], 'v' keybd.call 0xA4, 0, 0, 0 keybd.call 13, 0, 0, 0 keybd.call 13, 0, 2, 0 keybd.call 0xA4, 0, 2, 0 $fontface = "Lucida Console" $fontsize = 25 Graphics.freeze $scene = Scene_Title.new while $scene != nil $scene.main end Graphics.transition(20) rescue Errno::ENOENT filename = $!.message.sub("No se encont el archivo o directorio - ", "") print("Error RGSS: #{filename}") end
#============================================================================== # Window_SaveFile #------------------------------------------------------------------------------ class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- attr_reader :filename attr_reader :selected #-------------------------------------------------------------------------- def initialize(file_index, filename) super(0, 64 + file_index % 4 * 104, 640, 104) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize @file_index = file_index @filename = "Save#{@file_index + 1}.rxdata" @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = falseend #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color name = "Archivo #{@file_index + 1}" self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width if @file_exist hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 8, 600, 32, time_string, 2) self.contents.font.color = normal_color time_string = @time_stamp.strftime("%Y/%m/%d %H:%M") self.contents.draw_text(4, 40, 600, 32, time_string, 2) end end #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor_rectend #-------------------------------------------------------------------------- def update_cursor_rect if @selected self.cursor_rect.set(0, 0, @name_width + 8, 32) else self.cursor_rect.empty end end end
#============================================================================== # ■ Action Battle System #------------------------------------------------------------------------------ # Por: Near Fantastica # Traducido por: Sandor # http://www.rpgsystem.net # Fecha: 07/2/05 # Version 2 # # A tecla – X entrada – Tecla de habilidad instantnea 1 # S tecla – Y entrada – Tecla de habilidad instantnea 2 # D tecla – Z entrada – Tecla de habilidad instantnea 3 # Q tecla – L entrada – Atacar # W tecla –R entrada – Defender # # Las teclas de habilidades instantneas se pueden modificar entrando en el # men, luego vas a el men de habilidades y te situas encima de la habilidad # que quieres tener en instantneo, simplemente una vez encima de la habilidad # presionas la tecla que quieres que se le asigne, las teclas instantneas sn: # A, S, D # # Grcias a Harosata, Akura, Hazarim, Deke, Arcaine and #============================================================================== class Action_Battle_System #-------------------------------------------------------------------------- # ● Open instance variable #-------------------------------------------------------------------------- attr_accessor :active_actor attr_accessor :display attr_accessor :player_defending attr_accessor :skill_hot_key attr_accessor :dash_level #-------------------------------------------------------------------------- # ● Initialization #-------------------------------------------------------------------------- def initialize @event_counter = 0 @display = Sprite.new @display.bitmap = Bitmap.new(88, 48) @clear_counter = 0 @active_actor = 0 @player_defending = false @restore = false @reduce= false @timer = 0 @dash_level = 5 @sec = 0 @skill_hot_key = {} @skill_hot_key[1] = 0 @skill_hot_key[2] = 0 @skill_hot_key[3] = 0 @enemy_id = {} @enemy_name = {} @enemy_hp = {} @enemy_sp = {} @enemy_str = {} @enemy_dex = {} @enemy_agi = {} @enemy_int = {} @enemy_atk = {} @enemy_pdef = {} @enemy_mdef = {} @enemy_eva = {} @enemy_animation1_id = {} @enemy_animation2_id = {} @enemy_exp = {} @enemy_gold = {} @enemy_item_id = {} @enemy_weapon_id = {} @enemy_armor_id = {} @enemy_treasure_prob = {} @enemy_engagement = {} @enemy_movment = {} @enemy_frequency = {} @enemy_speed = {} @enemy_defending = {} @enemy_dex_loop = {} end #-------------------------------------------------------------------------- # ● Enemy Setup #-------------------------------------------------------------------------- def enemy_setup # Setup Event Max @event_counter = 0 for i in 1..999 if $game_map.map.events[i].id > @event_counter @event_counter = $game_map.map.events[i].id end end # Setup Event for i in 1..@event_counter #$game_map.map.events.size # Set the event to nill setting @enemy_id[i] = 0 for x in 1..$data_enemies.size - 1 if $game_map.map.events[i] == nil next i end if $game_map.map.events[i].name == $data_enemies[x].name # Event is an Enemy Setup Emeny @enemy_id[i] = $data_enemies[x].id @enemy_name[i] = $data_enemies[x].name @enemy_hp[i] = $data_enemies[x].maxhp @enemy_sp[i] = $data_enemies[x].maxsp @enemy_str[i] = $data_enemies[x].str @enemy_dex[i] = $data_enemies[x].dex @enemy_agi [i] = $data_enemies[x].agi @enemy_int[i] = $data_enemies[x].int @enemy_atk[i] = $data_enemies[x].atk @enemy_pdef[i] = $data_enemies[x].pdef @enemy_mdef[i] = $data_enemies[x].mdef @enemy_eva[i] = $data_enemies[x].eva @enemy_animation1_id[i] = $data_enemies[x].animation1_id @enemy_animation2_id[i] = $data_enemies[x].animation2_id @enemy_exp[i] = $data_enemies[x].exp @enemy_gold[i] = $data_enemies[x].gold @enemy_item_id[i] = $data_enemies[x].item_id @enemy_weapon_id[i] = $data_enemies[x].weapon_id @enemy_armor_id[i] = $data_enemies[x].armor_id @enemy_treasure_prob[i] = $data_enemies[x].treasure_prob @enemy_states = [] @enemy_engagement[i] = false @enemy_movment[i] = 0 @enemy_frequency[i] = 0 @enemy_speed[i] = 0 @enemy_defending[i] = false @enemy_dex_loop[i] = 0 end end end end #-------------------------------------------------------------------------- # ● Update Dash #-------------------------------------------------------------------------- def update_dash # check if sheild is active if @player_defending == true $game_player.move_speed = 3 return end # check is Dash Mode Active if Input.press?(Input::A) if $game_player.moving? # If A Key press enter dash mode # reduce dash level $game_player.move_speed=5 @restore = false if @reduce == false @timer = 50 # Initial time off set @reduce = true else @timer-= 1 end @sec = (@timer / Graphics.frame_rate)%60 if @sec == 0 if @dash_level != 0 @dash_level -= 1 @timer = 50 # Timer Count end end if @dash_level == 0 $game_player.move_speed=4 end end else # restore dash level $game_player.move_speed=4 @reduce = false if @restore == false @timer = 80 # Initial time off set @restore = true else @timer-= 1 end @sec = (@timer / Graphics.frame_rate)%60 if @sec == 0 if @dash_level != 5 @dash_level+= 1 @timer = 60 # Timer Count end end end end #-------------------------------------------------------------------------- # ● Clear Display #-------------------------------------------------------------------------- def clear_display @clear_counter += 1 if @clear_counter == 50 @clear_counter = 0 @display.bitmap.clear end end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update update_dash clear_display for i in 1..@event_counter # Check if Event is an Enemy if @enemy_id[i] == 0 next else # Enemy Engaged if @enemy_engagement[i] == true # Check Range if in_range?(i,5) # Update Battle if in_range?(i,1) event_melee_attack(i) else event_skill_attack(i) end next else @enemy_engagement[i] = false # Change Movement $game_map.events[i].move_type = @enemy_movment[i] $game_map.events[i].move_frequency = @enemy_frequency[i] $game_map.events[i].move_speed = @enemy_speed[i] next end end # Check Range if in_range?(i,5) # Check Event Direction if facing_player?(i) # Set Enemy Engaged @enemy_engagement[i] = true # Change Movement @enemy_movment[i] = $game_map.events[i].move_type $game_map.events[i].move_type = 2 @enemy_frequency[i] = $game_map.events[i].move_frequency $game_map.events[i].move_frequency = 5 @enemy_speed[i] = $game_map.events[i].move_speed $game_map.events[i].move_speed = 4 # Update Battle if in_range?(i,1) event_melee_attack(i) else event_skill_attack(i) end end end end end end #-------------------------------------------------------------------------- # ● Check If Event Is In Range #-------------------------------------------------------------------------- def in_range?(event_index, range) playerx = $game_player.x playery = $game_player.y eventx = $game_map.events[event_index].x eventy = $game_map.events[event_index].y # Determine x and y of circle x = (playerx - eventx) * (playerx - eventx) y = (playery - eventy) * (playery - eventy) # Determine raduis r = x +y if r <= (range * range) return true else return false end end #-------------------------------------------------------------------------- # ● Check If Event Is Facing Player #-------------------------------------------------------------------------- def facing_player?(event_index) playerx = $game_player.x playery = $game_player.y eventx = $game_map.events[event_index].x eventy = $game_map.events[event_index].y event_direction = $game_map.events[event_index].direction # Check down if event_direction == 2 if playery >= eventy return true end end # Check Left if event_direction == 4 if playerx <= eventx return true end end # Check Right if event_direction == 6 if playerx >= eventx return true end end # Check Up if event_direction == 8 if playery <= eventy return true end end return false end #-------------------------------------------------------------------------- # ● Check Event Attack Condisions # NOTE : there is no turns in the ABS therfore there is no turn percondition #-------------------------------------------------------------------------- def event_melee_preconditions(event_index) if @enemy_dex_loop[event_index] >= @enemy_dex[event_index] * 20 @enemy_dex_loop[event_index] = 0 for i in 0..$data_enemies[@enemy_id[event_index]].actions.size - 1 if $data_enemies[@enemy_id[event_index]].actions[i].kind == 0 actions = $data_enemies[@enemy_id[event_index]].actions[i] # Check Hp Level condition if @enemy_hp[event_index] * 100.0 / $data_enemies[@enemy_id[event_index]].maxhp > actions.condition_hp next end # Check Max Level condition if $game_party.max_level < actions.condition_level next end # Check switch condition switch_id = actions.condition_switch_id if actions.condition_switch_id > 0 and $game_switches[switch_id] == false next end # Check Rank to see if it is larger then the dice roll n = rand(10) if actions.rating < n next end # Return Action case actions.basic when 0 return 0 when 1 return 1 when 2 return 2 when 3 return 3 end end end # No action taken return 3 else # add to the dex loop @enemy_dex_loop[event_index] += @enemy_dex[event_index] return 3 end end #-------------------------------------------------------------------------- # ● Check Event Attack Condisions # NOTE : there is no turns in the ABS therfore there is no turn percondition #-------------------------------------------------------------------------- def event_skill_preconditions(event_index) if @enemy_dex_loop[event_index] >= @enemy_dex[event_index] * 100 @enemy_dex_loop[event_index] = 0 for i in 0..$data_enemies[@enemy_id[event_index]].actions.size - 1 if $data_enemies[@enemy_id[event_index]].actions[i].kind == 1 actions = $data_enemies[@enemy_id[event_index]].actions[i] # Check Hp Level condition if @enemy_hp[event_index] * 100.0 / $data_enemies[@enemy_id[event_index]].maxhp > actions.condition_hp return 0 end # Check Max Level condition if $game_party.max_level < actions.condition_level return 0 end # Check switch condition switch_id = action.condition_switch_id if actions.condition_switch_id > 0 and $game_switches[switch_id] == false return 0 end return actions.skill_id end end return 0 else # add to the dex loop @enemy_dex_loop[event_index] += @enemy_dex[event_index] return 0 end end #-------------------------------------------------------------------------- # ● Calculation of attribute correction # element_set : Attribute #-------------------------------------------------------------------------- def player_elements_correct(element_set) # In case of non attribute if element_set == [] # return 100 return 100 end # The weakest one is returned in the attribute which is given * method element_rate # is defined in Game_Actor and the Game_Enemy class which are succeeded from this class weakest = -100 for i in element_set weakest = [weakest, $game_party.actors[@active_actor].element_rate(i)].max end return weakest end #-------------------------------------------------------------------------- # ● Event Melee Attack #-------------------------------------------------------------------------- def event_melee_attack(event_index) kind = event_melee_preconditions(event_index) case kind when 0 # Enemy Attacking @enemy_defending[event_index] = false # First on-target hit decision hit_rate = 100 for i in @enemy_states hit_rate *= $data_states[i].hit_rate / 100.0 end hit_result = (rand(100) < hit_rate) # In case of on-target hit if hit_result == true # Calculating the basic damage atk = [@enemy_atk[event_index] - $game_party.actors[@active_actor].pdef / 2, 0].max damage = atk * (20 + @enemy_str[event_index] ) / 20 # Attribute correction damage *= player_elements_correct([]) damage /= 100 # When the mark of the damage is correct if damage > 0 # Critical correction if rand(100) < 4 * @enemy_dex[event_index] / $game_party.actors[@active_actor].agi damage *= 2 end # Defense correction if @player_defending == true damage /= 2 end end # Dispersion if damage.abs > 0 amp = [damage.abs * 15 / 100, 1].max damage += rand(amp+1) + rand(amp+1) - amp end # Second on-target hit decision eva = 8 * $game_party.actors[@active_actor].agi / @enemy_dex[event_index] + $game_party.actors[@active_actor].eva hit = damage < 0 ? 100 : 100 - eva # Check evade cant_evade = false for i in $game_party.actors[@active_actor].states if $data_states[i].cant_evade cant_evade = true end end hit = cant_evade ? 100 : hit hit_result = (rand(100) < hit) end # In case of on-target hit if hit_result == true # State shocking cancellation # Note : I still can not get the states effects to work correctly # remove_states_shock # From HP damage subtraction damage = damage.abs $game_party.actors[@active_actor].hp -= damage hit_player(damage, @enemy_animation2_id[event_index]) if $game_party.actors[@active_actor].hp <= 0 player_dead end # State change # Note : I still can not get the states effects to work correctly # states_plus(@enemy_states) # states_minus(@enemy_states) end when 1 # Enemy Defening if @enemy_defending[event_index] != true @enemy_defending[event_index] = true $game_map.events[event_index].move_speed = $game_map.events[event_index].move_speed - 1 end when 2 # Enemy Escaping # Note : Could Add a Teleport Event to make the Event jump far away from player when 3 # No Action Taken end end #-------------------------------------------------------------------------- # ● Event Skill Attack #-------------------------------------------------------------------------- def event_skill_attack(event_index) # Check Percondisions of the Enemy skill_id = event_skill_preconditions(event_index) # If Condisions not meet if skill_id == 0 return end skill = $data_skills[skill_id] # Check Sp Cost if skill.sp_cost > @enemy_sp[event_index] return end @enemy_sp[event_index] -= skill.sp_cost # When the effective range of skill with friend of HP 1 or more, your own HP 0, # or the effective range of skill with the friend of HP 0, your own HP are 1 or more, if ((skill.scope == 3 or skill.scope == 4) and @enemy_hp == 0) or ((skill.scope == 5 or skill.scope == 6) and @enemy_hp >= 1) # メソッド終了 return end # Clearing the effective flag effective = false # When common event ID is effective, setting the effective flag effective |= skill.common_event_id > 0 # First on-target hit decision skill_hit = 100 for i in @enemy_states skill_hit *= $data_states[i].hit_rate / 100.0 end user_hit = 100 for i in @enemy_states user_hit *= $data_states[i].hit_rate / 100.0 end hit = skill_hit if skill.atk_f > 0 hit *= user_hit / 100 end hit_result = (rand(100) < hit) # In case of uncertain skill setting the effective flag effective |= hit < 100 # In case of on-target hit if hit_result == true # Calculating power power = skill.power + @enemy_atk[event_index] * skill.atk_f / 100 if power > 0 power -= $game_party.actors[@active_actor].pdef * skill.pdef_f / 200 power -= $game_party.actors[@active_actor].mdef * skill.mdef_f / 200 power = [power, 0].max end # Calculating magnification ratio rate = 20 rate += (@enemy_str[event_index] * skill.str_f / 100) rate += (@enemy_dex[event_index] * skill.dex_f / 100) rate += (@enemy_agi[event_index] * skill.agi_f / 100) rate += (@enemy_int[event_index] * skill.int_f / 100) # Calculating the basic damage damage = power * rate / 20 # Attribute correction damage *= player_elements_correct(skill.element_set) damage /= 100 # When the mark of the damage is correct, if damage > 0 # Defense correction if @player_defending == true damage /= 2 end end # Dispersion if skill.variance > 0 and damage.abs > 0 amp = [damage.abs * skill.variance / 100, 1].max damage += rand(amp+1) + rand(amp+1) - amp end # Second on-target hit decision eva = 8 * $game_party.actors[@active_actor].agi / @enemy_dex[event_index] + $game_party.actors[@active_actor].eva hit = damage < 0 ? 100 : 100 - eva * skill.eva_f / 100 cant_evade = false for i in $game_party.actors[@active_actor].states if $data_states[i].cant_evade cant_evade = true end end hit = cant_evade ? 100 : hit hit_result = (rand(100) < hit) # In case of uncertain skill setting the effective flag effective |= hit < 100 end # In case of on-target hit if hit_result == true # In case of physical attack other than power 0 if skill.power != 0 and skill.atk_f > 0 # State shocking cancellation # Note : I still can not get the states effects to work correctly # remove_states_shock # Setting the effective flag effective = true end # From HP damage subtraction last_hp = $game_party.actors[@active_actor].hp $game_party.actors[@active_actor].hp -= damage effective |= $game_party.actors[@active_actor].hp != last_hp # State change # Note : I still can not get the states effects to work correctly # effective |= states_plus(skill.plus_state_set) # effective |= states_minus(skill.minus_state_set) if skill.power == 0 # When power is 0 # Set Damage to Zero damage = 0 end hit_player(damage, skill.animation2_id) if $game_party.actors[@active_actor].hp <= 0 player_dead end end end #-------------------------------------------------------------------------- # ● Display Hit Animation #-------------------------------------------------------------------------- def player_dead if $game_party.all_dead? $game_temp.gameover = true end $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # ● Display Hit Animation #-------------------------------------------------------------------------- def hit_player(damage, animation_id) if damage != 0 $game_player.jump(0, 0) $game_player.animation_id = animation_id @display.bitmap.clear @clear_counter = 0 @display.bitmap.font.name = $defaultfonttype # Unknown At This Time @display.bitmap.font.size = 32 @display.x = ($game_player.real_x - $game_map.display_x) / 4 @display.y = ($game_player.real_y - $game_map.display_y) / 4 @display.z = 500 @display.bitmap.font.color.set(255, 0, 0) @display.bitmap.draw_text(@display.bitmap.rect, damage.to_s, 1) end end #-------------------------------------------------------------------------- # ● Calculation of attribute correction # element_set : Attribute #-------------------------------------------------------------------------- def event_elements_correct(element_set, event_index) # In case of non attribute if element_set == [] # return 100 return 100 end # The weakest one is returned in the attribute which is given * method element_rate # is defined in Game_Actor and the Game_Enemy class which are succeeded from this class weakest = -100 for i in element_set # Note: I still can not get the states effects to work correctly weakest = [weakest, $data_enemies[@enemy_id[event_index]].element_rate(i)].max end return weakest end #-------------------------------------------------------------------------- # ● Player Melee Attack Preconditions #-------------------------------------------------------------------------- def player_melee_preconditions for i in 1..@event_counter # Check if Event is an Enemy if @enemy_id[i] == 0 next end if in_range?(i,1) player_melee_attack(i) next end end end #-------------------------------------------------------------------------- # ● Event Melee Attack #-------------------------------------------------------------------------- def player_melee_attack(event_index) # First on-target hit decision hit_rate = 100 for i in $game_party.actors[@active_actor].states hit_rate *= $data_states[i].hit_rate / 100.0 end hit_result = (rand(100) < hit_rate) # In case of on-target hit if hit_result == true # Calculating the basic damage atk = [$game_party.actors[@active_actor].atk - @enemy_pdef[event_index] / 2, 0].max damage = atk * (20 + $game_party.actors[@active_actor].str) / 20 # Attribute correction damage *= 100 #event_elements_correct($game_party.actors[@active_actor].element_set, event_index) damage /= 100 # When the mark of the damage is correct if damage > 0 # Critical correction if rand(100) < 4 * $game_party.actors[@active_actor].dex / @enemy_agi[event_index] damage *= 2 end # Defense correction if @enemy_defending== true damage /= 2 end end # Dispersion if damage.abs > 0 amp = [damage.abs * 15 / 100, 1].max damage += rand(amp+1) + rand(amp+1) - amp end # Second on-target hit decision eva = 8 * @enemy_agi[event_index] / $game_party.actors[@active_actor].dex + @enemy_eva[event_index] hit = damage < 0 ? 100 : 100 - eva # Check evade cant_evade = false for i in @enemy_states if $data_states[i].cant_evade cant_evade = true end end hit = cant_evade ? 100 : hit hit_result = (rand(100) < hit) end # In case of on-target hit if hit_result == true # State shocking cancellation # Note : I still can not get the states effects to work correctly # remove_states_shock # From HP damage subtraction damage = damage.abs @enemy_hp[event_index] -= damage # State change # Note : I still can not get the states effects to work correctly # states_plus($game_party.actors[@active_actor].states) # states_minus($game_party.actors[@active_actor].states) hit_event(event_index,damage, $game_party.actors[@active_actor].animation2_id) if @enemy_hp[event_index] <= 0 battle_spoils(event_index) end end end #-------------------------------------------------------------------------- # ● Player Skill Attack Preconditions #-------------------------------------------------------------------------- def player_skill_preconditions(index) if$game_party.actors[@active_actor].skill_learn?(@skill_hot_key[index]) # Set Skill skill = $data_skills[@skill_hot_key[index]] # Check Sp Cost if skill.sp_cost > $game_party.actors[@active_actor].sp return end # Set Sp $game_party.actors[@active_actor].sp -= skill.sp_cost # Check Skills Scope case skill.scope when 1 # One Enemy for i in 1..@event_counter # Check if Event is an Enemy if @enemy_id[i] == 0 next else case $data_classes[$game_party.actors[@active_actor].class_id].position when 0 if in_range?(i,1) player_skill_attack(skill, i) return end when 1 if in_range?(i,2) player_skill_attack(skill, i) return end when 2 if in_range?(i,5) player_skill_attack(skill, i) return end end end end when 2 # All Emenies for i in 1..@event_counter # Check if Event is an Enemy if @enemy_id[i] == 0 next else case $data_classes[$game_party.actors[@active_actor].class_id].position when 0 if in_range?(i,1) player_skill_attack(skill, i) return end when 1 if in_range?(i,2) player_skill_attack(skill, i) return end when 2 if in_range?(i,5) player_skill_attack(skill, i) return end end end end when 3 # One Ally # Note : I still can not get the states effects to work correctly and therefore # can not script this but these skill can skill be actived from the Main Menu when 4 # All Allies # Note : I still can not get the states effects to work correctly and therefore # can not script this but these skill can skill be actived from the Main Menu end else return end end #-------------------------------------------------------------------------- # ● Player Skill Attack #-------------------------------------------------------------------------- def player_skill_attack(skill, event_index) # When the effective range of skill with friend of HP 1 or more, your own HP 0, # or the effective range of skill with the friend of HP 0, your own HP are 1 or more, if ((skill.scope == 3 or skill.scope == 4) and @enemy_hp == 0) or ((skill.scope == 5 or skill.scope == 6) and @enemy_hp >= 1) return end # Clearing the effective flag effective = false # When common event ID is effective, setting the effective flag effective |= skill.common_event_id > 0 # First on-target hit decision skill_hit = 100 for i in $game_party.actors[@active_actor].states skill_hit *= $data_states[i].hit_rate / 100.0 end user_hit = 100 for i in $game_party.actors[@active_actor].states user_hit *= $data_states[i].hit_rate / 100.0 end hit = skill_hit if skill.atk_f > 0 hit *= user_hit / 100 end hit_result = (rand(100) < hit) # In case of uncertain skill setting the effective flag effective |= hit < 100 # In case of on-target hit if hit_result == true # Calculating power power = skill.power + $game_party.actors[@active_actor].atk * skill.atk_f / 100 if power > 0 power -= @enemy_pdef[event_index] * skill.pdef_f / 200 power -= @enemy_mdef[event_index] * skill.mdef_f / 200 power = [power, 0].max end # Calculating magnification ratio rate = 20 rate += ($game_party.actors[@active_actor].str * skill.str_f / 100) rate += ($game_party.actors[@active_actor].dex * skill.dex_f / 100) rate += ($game_party.actors[@active_actor].agi * skill.agi_f / 100) rate += ($game_party.actors[@active_actor].int * skill.int_f / 100) # Calculating the basic damage damage = power * rate / 20 # Attribute correction damage *= 100 #event_elements_correct(skill.element_set, event_index) damage /= 100 # When the mark of the damage is correct, if damage > 0 # Defense correction if @enemy_defending == true damage /= 2 end end # Dispersion if skill.variance > 0 and damage.abs > 0 amp = [damage.abs * skill.variance / 100, 1].max damage += rand(amp+1) + rand(amp+1) - amp end # Second on-target hit decision eva = 8 * @enemy_agi[event_index] / $game_party.actors[@active_actor].dex + @enemy_eva[event_index] hit = damage < 0 ? 100 : 100 - eva * skill.eva_f / 100 cant_evade = false for i in @enemy_states if $data_states[i].cant_evade cant_evade = true end end hit = cant_evade ? 100 : hit hit_result = (rand(100) < hit) # In case of uncertain skill setting the effective flag effective |= hit < 100 end # In case of on-target hit if hit_result == true # In case of physical attack other than power 0 if skill.power != 0 and skill.atk_f > 0 # State shocking cancellation # Note : I still can not get the states effects to work correctly # remove_states_shock # Setting the effective flag effective = true end # From HP damage subtraction last_hp = @enemy_hp[event_index] @enemy_hp[event_index] -= damage effective |= @enemy_hp[event_index] != last_hp # State change # Note : I still can not get the states effects to work correctly # effective |= states_plus(skill.plus_state_set) # effective |= states_minus(skill.minus_state_set) if skill.power == 0 # When power is 0 # Set Damage to Zero damage = 0 end hit_event(event_index, damage, skill.animation2_id) if @enemy_hp[event_index] <= 0 battle_spoils(event_index) end return end end #-------------------------------------------------------------------------- # ● Display Hit Animation #-------------------------------------------------------------------------- def hit_event(event_index, damage, animation_id) if damage != 0 $game_map.events[event_index].jump(0, 0) $game_map.events[event_index].animation_id = animation_id @display.bitmap.clear @clear_counter = 0 @display.bitmap.font.name = $defaultfonttype # Unknown At This Time @display.bitmap.font.size = 32 @display.x = ($game_map.events[event_index].real_x - $game_map.display_x) / 4 @display.y = ($game_map.events[event_index].real_y - $game_map.display_y) / 4 @display.z = 500 @display.bitmap.font.color.set(255, 0, 0) @display.bitmap.draw_text(@display.bitmap.rect, damage.to_s, 1) end end #-------------------------------------------------------------------------- # ● Spoils of Battle #-------------------------------------------------------------------------- def battle_spoils(event_index) $game_map.map.events[event_index].name = "Dead" @enemy_id[event_index] = 0 $game_map.events[event_index].erase treasures = [] if rand(100) < @enemy_treasure_prob[event_index] if @enemy_item_id[event_index] > 0 treasures.push($data_items[@enemy_item_id[event_index]]) end if @enemy_weapon_id[event_index]> 0 treasures.push($data_weapons[@enemy_weapon_id[event_index]]) end if @enemy_armor_id[event_index] > 0 treasures.push($data_armors[@enemy_armor_id[event_index]]) end end # トレジャーの数を 6 個までに限定 treasures = treasures[0..5] # EXP 獲得 for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false last_level = actor.level actor.exp += @enemy_exp[event_index] end end # ゴールド獲得 $game_party.gain_gold(@enemy_gold[event_index] ) # トレジャー獲得 for item in treasures case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end end end
#============================================================================== # ■ Scene_Map #------------------------------------------------------------------------------ # It is the class which processes the title picture #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ● Refer setup to Scene Map #-------------------------------------------------------------------------- alias scene_map_main main alias scene_map_update update #-------------------------------------------------------------------------- # ● Refers to Main #-------------------------------------------------------------------------- def main @on_map_diplay = Window_Mapstats.new $ABS.display = Sprite.new $ABS.display.bitmap = Bitmap.new(88, 48) scene_map_main $ABS.display.dispose @on_map_diplay.dispose end #-------------------------------------------------------------------------- # ● Refers to Update #-------------------------------------------------------------------------- def update @on_map_diplay.update $ABS.update if Input.trigger?(Input::L) # Player Attack if $ABS.player_defending == false $ABS.player_melee_preconditions end end if Input.press?(Input::R) # Player Shield Active $ABS.player_defending= true else # Player Sheild Disactive $ABS.player_defending = false end if Input.trigger?(Input::X) # Player Skill Hot Key 1 $ABS.player_skill_preconditions(1) end if Input.trigger?(Input::Y) # Player Skill Hot Key 2 $ABS.player_skill_preconditions(2) end if Input.trigger?(Input::Z) # Player Skill Hot Key 3 $ABS.player_skill_preconditions(3) end scene_map_update end end #============================================================================== # Window_Base #------------------------------------------------------------------------------ # Adds Draw line function, Draw Hp, Draw Sp, Draw Exp, # Adds Draw Actors Battler, Refines Draw Text Actors Level #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ● The drawing of HP # actor : actor # x : Ahead drawing X coordinate # y : Ahead drawing Y-coordinate # width : Width ahead drawing #-------------------------------------------------------------------------- def draw_actor_hp_text(actor, x, y, width = 144) # Character string "HP" It draws self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) # Calculates is a space which draws MaxHP if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end # Drawing HP self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(hp_x, y, 40, 32, actor.hp.to_s, 2) # Drawing MaxHP if flag self.contents.font.color = normal_color self.contents.draw_text(hp_x + 40, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + 52, y, 48, 32, actor.maxhp.to_s) end end #-------------------------------------------------------------------------- # ● The drawing of SP # actor : actor # x : Ahead drawing X coordinate # y : Ahead drawing Y-coordinate # width : Width ahead drawing #-------------------------------------------------------------------------- def draw_actor_sp_text(actor, x, y, width = 144) # Character string "sP" It draws self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.sp) # Calculates is a space which draws MaxSP if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end # Drawing HP self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(sp_x, y, 40, 32, actor.sp.to_s, 2) # Drawing MaxHP if flag self.contents.font.color = normal_color self.contents.draw_text(sp_x + 40, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + 52, y, 48, 32, actor.maxsp.to_s) end end #-------------------------------------------------------------------------- # ● Draws Actors Hp meter #-------------------------------------------------------------------------- def draw_actor_hp_bar(actor, x, y, width = 100, height = 10, bar_color = Color.new(255, 0, 0, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.hp / actor.maxhp for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Sp meter #-------------------------------------------------------------------------- def draw_actor_sp_bar(actor, x, y, width = 100, height = 10, bar_color = Color.new(0, 0, 255, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.sp / actor.maxsp for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Exp meter #-------------------------------------------------------------------------- def draw_actor_exp_bar(actor, x, y, width = 100, height = 10, bar_color = Color.new(255, 255, 0, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) if actor.level == 99 w = 0 else w = width * actor.exp / actor.next_exp_s.to_f end for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Str meter #-------------------------------------------------------------------------- def draw_actor_str_bar(actor, i, x, y, width = 100, height = 10, bar_color = Color.new(255, 0, 0, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.str / 999 for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Dex meter #-------------------------------------------------------------------------- def draw_actor_dex_bar(actor, i, x, y, width = 100, height = 10, bar_color = Color.new(0, 255, 0, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.dex / 999 for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Agi meter #-------------------------------------------------------------------------- def draw_actor_agi_bar(actor, i, x, y, width = 100, height = 10, bar_color = Color.new(0, 0, 255, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.agi / 999 for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Int meter #-------------------------------------------------------------------------- def draw_actor_int_bar(actor, i, x, y, width = 100, height = 10, bar_color = Color.new(180, 100, 200, 255)) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) w = width * actor.int / 999 for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Dash Power bar #-------------------------------------------------------------------------- def draw_dash_bar(x, y, width = 50, height = 10) self.contents.fill_rect(x, y, width, height, Color.new(255, 255, 255, 100)) case $ABS.dash_level when 0 .. 1 bar_color = Color.new(255, 0, 0, 255) when 2 .. 3 bar_color = Color.new(255, 255, 0, 255) else bar_color = Color.new(0, 255, 0, 255) end w = width * $ABS.dash_level / 5 for i in 0..height r = bar_color.red * (height -i)/height + 0 * i/height g = bar_color.green * (height -i)/height + 0 * i/height b = bar_color.blue * (height -i)/height + 0 * i/height a = bar_color.alpha * (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w , 1, Color.new(r, g, b, a)) end end #-------------------------------------------------------------------------- # ● Draws Actors Battler #-------------------------------------------------------------------------- def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.character_name, actor.character_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end end #============================================================================== # ■ On Map Display #------------------------------------------------------------------------------ # Displayes curent player stats to the window #============================================================================= class Window_Mapstats < Window_Base #-------------------------------------------------------------------------- # ● Initialization #-------------------------------------------------------------------------- def initialize super(0, 400, 640, 80) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.back_opacity = 125 # self.opacity = 0 update end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def refresh self.contents.clear actor = $game_party.actors[$ABS.active_actor] draw_actor_graphic(actor, 10, 45) # draws the actor graphic draw_actor_name(actor, 30, -5) #draws the actors name draw_actor_level(actor, 30, 15) #draws the actor level draw_actor_hp_text(actor, 110, -5) #draws the actors hp draw_actor_hp_bar(actor, 260, 5) #draws the actors hp bar draw_actor_sp_text(actor,110, 15) #draws the actors sp draw_actor_sp_bar(actor, 260, 27) #draws the actors sp bar draw_dash_bar(375, 27) #draws the dash level bar self.contents.draw_text(377, -5, 120, 32, "Cansancio") end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end #============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # It is the class which processes the title picture #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ● Refer setup to Scene Title #-------------------------------------------------------------------------- alias scene_title_update update #-------------------------------------------------------------------------- # ● Loads Event names #-------------------------------------------------------------------------- def update $ABS = Action_Battle_System.new scene_title_update end end #============================================================================== # ■ Game_Map #------------------------------------------------------------------------------ # Add defenision of the names to Game Map Class #============================================================================== class Game_Map #-------------------------------------------------------------------------- # ● Refer setup to Game Map #-------------------------------------------------------------------------- attr_accessor :map alias game_map_setup setup #-------------------------------------------------------------------------- # ● Refers the Map Setup #-------------------------------------------------------------------------- def setup(map_id) game_map_setup(map_id) $ABS.enemy_setup end end #============================================================================== # ■ Game_Character #------------------------------------------------------------------------------ # Add move_type to the accessor adderse #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● Open instance variable #-------------------------------------------------------------------------- attr_accessor :move_type attr_accessor :move_speed attr_accessor :move_frequency attr_accessor :character_name end #============================================================================== # ■ Scene_Skill #------------------------------------------------------------------------------ # It is the class which processes the skill picture. #============================================================================== class Scene_Skill #-------------------------------------------------------------------------- # ● Object initialization # actor_index : Actor index #-------------------------------------------------------------------------- def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index end #-------------------------------------------------------------------------- # ● Main processing #-------------------------------------------------------------------------- def main # Acquiring the actor @actor = $game_party.actors[@actor_index] # Drawing up the help window, the status window and the skill window @help_window = Window_Help.new @status_window = Window_SkillStatus.new(@actor) @skill_window = Window_Skill.new(@actor) # Help window association @skill_window.help_window = @help_window # Target window compilation (invisibility non actively setting) @target_window = Window_Target.new @target_window.visible = false @target_window.active = false # Skill Hot Key Window @shk_window = Window_Command.new(250, ["Habilidad asignada a la tecla de acceso rpido"]) @shk_window.visible = false @shk_window.active = false @shk_window.x = 200 @shk_window.y = 250 @shk_window.z = 1500 # Transition execution Graphics.transition # Main loop loop do # Renewing the game picture Graphics.update # Updating the information of input Input.update # Frame renewal update # When the picture changes, discontinuing the loop if $scene != self break end end # Transition preparation Graphics.freeze # Releasing the window @help_window.dispose @status_window.dispose @skill_window.dispose @target_window.dispose @shk_window.dispose end #-------------------------------------------------------------------------- # ● Frame renewal #-------------------------------------------------------------------------- def update # Renewing the windows @help_window.update @status_window.update @skill_window.update @target_window.update @shk_window.update # When the skill window is active: Update_skill is called if @skill_window.active update_skill return end # When the target window is active: Update_target is called if @target_window.active update_target return end # When the skill_hot_key window is active: Update_shk is called if @shk_window.active update_shk return end end #-------------------------------------------------------------------------- # ● When frame renewal (the skill window is active) #-------------------------------------------------------------------------- def update_skill # The B when button is pushed, if Input.trigger?(Input::B) # Performing cancellation SE $game_system.se_play($data_system.cancel_se) # Change to menu screen $scene = Scene_Menu.new(1) return end # When C button is pushed, if Input.trigger?(Input::C) # Acquiring the data which presently is selected in the skill window @skill = @skill_window.skill # When you cannot use, if @skill == nil or not @actor.skill_can_use?(@skill.id) # Performing buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Performing decision SE $game_system.se_play($data_system.decision_se) # When the effective range takes part, if @skill.scope >= 3 # Active conversion target window @skill_window.active = false @target_window.x = (@skill_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true # Setting cursor position the effective range (the single unit/the whole) according to if @skill.scope == 4 || @skill.scope == 6 @target_window.index = -1 elsif @skill.scope == 7 @target_window.index = @actor_index - 10 else @target_window.index = 0 end # When the effective range is other than taking part, else # When common event ID is effective, if @skill.common_event_id > 0 # Common event call reservation $game_temp.common_event_id = @skill.common_event_id # When using the skill performing SE $game_system.se_play(@skill.menu_se) #SP consumption @actor.sp -= @skill.sp_cost # Rewriting the contents of each window @status_window.refresh @skill_window.refresh @target_window.refresh # Change to map picture $scene = Scene_Map.new return end end return end # When X button is pushed, if Input.trigger?(Input::X) # Performing decision SE $game_system.se_play($data_system.decision_se) @skill_window.active = false @shk_window.active = true @shk_window.visible = true $ABS.skill_hot_key[1] = @skill_window.skill.id end #The Y when button is pushed, if Input.trigger?(Input::Y) # Performing decision SE $game_system.se_play($data_system.decision_se) @skill_window.active = false @shk_window.active = true @shk_window.visible = true $ABS.skill_hot_key[2] = @skill_window.skill.id end # The Z when button is pushed, if Input.trigger?(Input::Z) # Performing decision SE $game_system.se_play($data_system.decision_se) @skill_window.active = false @shk_window.active = true @shk_window.visible = true $ABS.skill_hot_key[3] = @skill_window.skill.id end # The R when button is pushed, if Input.trigger?(Input::R) # Performing cursor SE $game_system.se_play($data_system.cursor_se) # To the following actor @actor_index += 1 @actor_index %= $game_party.actors.size # Change to another skill picture $scene = Scene_Skill.new(@actor_index) return end #The L when button is pushed, if Input.trigger?(Input::L) # Performing cursor SE $game_system.se_play($data_system.cursor_se) # To actor before @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size # Change to another skill picture $scene = Scene_Skill.new(@actor_index) return end end #-------------------------------------------------------------------------- # ● When frame renewal (the shk window is active) #-------------------------------------------------------------------------- def update_shk # The C when button is pushed, if Input.trigger?(Input::C) # Performing decision SE $game_system.se_play($data_system.decision_se) # Reset Skill hot key window @shk_window.active = false @shk_window.visible = false @skill_window.active = true #Change to menu screen $scene = Scene_Skill.new(@actor_index) return end end end
Teclas de utilizacin: A tecla – Tecla de habilidad instantnea 1 S tecla – Tecla de habilidad instantnea 2 D tecla – Tecla de habilidad instantnea 3 Q tecla – Atacar W tecla – Defender SHIFT - Correr -Las teclas de habilidades instantneas se pueden modificar entrando en el men, luego vas a el men de habilidades y te situas encima de la habilidad que quieres tener en instantneo, simplemente una vez encima de la habilidad presionas la tecla que quieres que se le asigne, las teclas instantneas sn: A, S, D Poner enemigos en el mapa: 1. Ves a tu mapa. 2. Crea un evento en el mapa. 3. Escoje en el evento el chara que quieres para tu enemigo. 4. Al evento le das el nombre del enemigo al que quieres qu interprete. 5. Ves a la Base de Datos del juego, NO la del script, ahora el script no lo tocars ms. 6. Ves a la seccin de ENEMIGOS de la base de datos, asegurate que hay el enemigo que quieres. El enemigo que quieres que aparezca debe tener el mismo nombre que el evento anteriormente creado. 7. Ya est!todo lo dems se hace automtico...
Primero ir a Scene_Battle 1 y aadir debajo de s4 = $data_system.words.item CODE s5 = "Invocar" y substituir CODE @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4]) @actor_command_window.y = 160 por CODE @actor_command_window = Window_Command.new(200, [s1, s2, s5, s3, s4]) @actor_command_window.y = 120 Ahora ir a Scene_Battle 3 y substituir: CODE when 0 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 start_enemy_select when 1 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 1 start_skill_select when 2 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 1 phase3_next_actor when 3 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 2 start_item_select end por CODEwhen 0 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 start_enemy_select when 1 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 1 start_skill_select when 2 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 1 start_invoc_select when 3 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 1 phase3_next_actor when 4 $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 2 start_item_select end y ms abajo donde veais CODE def start_skill_select @skill_window = Window_Skill.new(@active_battler) @skill_window.help_window = @help_window @actor_command_window.active = false @actor_command_window.visible = false end #-------------------------------------------------------------------------- substituirlo por CODE def start_skill_select @skill_window = Window_Skill3.new(@active_battler) @skill_window.help_window = @help_window @actor_command_window.active = false @actor_command_window.visible = false end #-------------------------------------------------------------------------- def start_invoc_select @skill_window = Window_Skill2.new(@active_battler) @skill_window.help_window = @help_window @actor_command_window.active = false @actor_command_window.visible = false end #-------------------------------------------------------------------------- ahora Cread justo debajo de Window_Skill copiais Window_Skill dos nuevos: A uno le poneis Window_Skill2: Subsituir donde pone Class Window_Skill por Class Window_Skill2 y substituir CODE for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil @data.push(skill) end end por CODE for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill.name.include?(")") skill.name.delete!(")") if skill != nil @data.push(skill) end end end y donde pone CODE self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) substituir por CODE self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) @skill2 = skill.name skill.name = (@skill2 + ")") Ahora ir la otra copia y le poneis de nombre Window_Skill 3 y haceis lo mismo con el class de antes solo que ahora ponedle un 3 pegado al Skill en vez de un 2. Substituis CODE for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil @data.push(skill) end end por CODE for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill.name.include?(")") else if skill != nil @data.push(skill) end end end y CODEself.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) por CODEif skill.name.include?(")") nombre = skill.name.delete!(")") self.contents.draw_text(x + 28, y, 204, 32, nombre, 0) else self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) end Para que la mgia no aparezca con este smbolo ")" (Sin las comillas) de Window_Skill original hay que substituir donde pone CODE 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)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) end substituir por CODE if skill.name.include?(")") skill.name.delete!(")") 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)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) @skill2 = skill.name skill.name = (@skill2 + ")") self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) else 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)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) end end Y ya est, para dudas y errores decidlo. Nota: Las magias que aparezcan en invocaciones deben llevar al final del nombre ")" sin las comillas, por eso la ltima modificacin apra que no aparezca. Nota 2: Al final deben quedaros 3 Window_Skill el original mnimamente modificado y los dos nuevos copiados y modificados.
Audio.bgm_play("Video/nombre del video.mpg") Audio.me_play("Video/nombre del video.mpg")