RPG maker VX
Últimos temas
» Script de menu
por maxi Jue 04 Dic 2014, 1:44 pm

» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm

» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am

» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am

» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm

» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm

» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am

» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am

» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am

» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am

» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am

» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm

» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am

» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am

» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm

¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado

Ninguno

[ Ver toda la lista ]


La mayor cantidad de usuarios en línea fue 117 el Mar 09 Ago 2011, 3:39 pm.

SCRIPT PARA TENER VIDAS EXTRAS

Ver el tema anterior Ver el tema siguiente Ir abajo

RPG Maker Vx SCRIPT PARA TENER VIDAS EXTRAS

Mensaje por prodijames el Sáb 20 Abr 2013, 12:50 pm

ola a todos os traigo este script que me encontre que sirve para tener vidas extras en tus personajes y crear como unos ``hospitales´´. (lo siento lo he intentado poner en code pero no lo e conseguido necesito ayuda para eso) aki el script :

Código:

#==============================================================================
#
# Yanfly 6 - Hospital Prizes
# --- Last Date Updated: 2011.09.26
# --- Level: Normal
# Requires: Y6 Hospital
#
#==============================================================================

$imported = {} if $imported == nil
$imported["Y6-HospitalPrizes"] = true

#==============================================================================
# Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# o 2011.09.26 - Updated window positions.
# o 2011.09.18 - Started Script and Finished.
#
#==============================================================================
# Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Inspired by Disgaea, this script adds on a small extension to the Hospital
# system. Depending on how often players make use of the Hospital's services,
# the player will earn prizes. For instance, after healing 1,000 HP, the player
# will gain a Life UP booster. What makes this script slightly different from
# what Disgaea does is that there can be multiple claims of prizes. The Life UP
# booster can be gained every 1,000 HP healed, up to a certain cap, which you
# may set. This provides incentive for players to use the hospital to heal up
# their wounds and rewards them for getting beat up~
#
#==============================================================================
# Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Item and Equipment Tags - Insert the following tags into their noteboxes.
# -----------------------------------------------------------------------------
# <prize max: x>
# This adjusts the maximum amount of times the player can claim this prize.
#
# <prize HP healed: x>
# This prize will be enabled for every multiple of x healed for HP up to the
# prize max cap.
#
# <prize MP healed: x>
# This prize will be enabled for every multiple of x healed for MP up to the
# prize max cap.
#
# <prize ailments: x>
# This prize will be enabled for every multiple of x healed for ailments up to
# the prize max cap.
#
# <prize deaths: x>
# This prize will be enabled for every multiple of x revived for deaths up to
# the prize max cap.
#
#==============================================================================
# Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Note: This script may not work with former Yanfly Engine scripts.
#      Use Yanfly Engine 6 scripts to work with this if available.
#==============================================================================

module Y6
  module HOSPITAL
   
    #--------------------------------------------------------------------------
    # - Vocab Settings -
    #--------------------------------------------------------------------------
    # These settings are used to alter the vocabulary used in the prize
    # windows within the hospital.
    #--------------------------------------------------------------------------
    PRIZE_VOCAB ={
    # :item          => String
      :prize_name    => "Prize",  # This is the claim prize command.
      :prize_amount  => "Amount", # How much of the prize is held.
    } # Do not remove this.
   
  end # HOSPITAL
end # Y6

#==============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis
# so edit at your own risk.
#==============================================================================

module Y6
  module REGEXP
  module BASEITEM
   
    PRIZE_MAX = /<(?:PRIZE_MAX|prize max):[ ]*(\d+)>/i
    PRIZE_HP  = /<(?:PRIZE_HP_HEALED|prize hp healed|prize hp):[ ]*(\d+)>/i
    PRIZE_MP  = /<(?:PRIZE_MP_HEALED|prize mp healed|prize mp):[ ]*(\d+)>/i
    PRIZE_AIL = /<(?:PRIZE_AILMENTS|prize ailment|prize ail):[ ]*(\d+)>/i
    PRIZE_DTH = /<(?:PRIZE_DEATHS|prize deaths|prize death):[ ]*(\d+)>/i
   
  end # BASEITEM
  end # REGEXP
end # Y6

#==============================================================================
# ** RPG::BaseItem
#==============================================================================

class RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :prize_max
  attr_accessor :prize_hp_healed
  attr_accessor :prize_mp_healed
  attr_accessor :prize_ailments
  attr_accessor :prize_deaths
 
  #--------------------------------------------------------------------------
  # common cache: y6_cache_baseitem_hosp
  #--------------------------------------------------------------------------
  def y6_cache_baseitem_hosp
    return if @cached_baseitem_hosp
    $hospital_prizes = [] if $hospital_prizes.nil?
    @cached_baseitem_hosp = true
    #---
    @prize_max = 0
    @prize_hp_healed = 0
    @prize_mp_healed = 0
    @prize_ailments = 0
    @prize_deaths = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when Y6::REGEXP::BASEITEM::PRIZE_MAX
        @prize_max = [$1.to_i, 1].max
      when Y6::REGEXP::BASEITEM::PRIZE_HP
        $hospital_prizes.push(self)
        @prize_max = [@prize_max, 1].max
        @prize_hp_healed = [$1.to_i, 1].max
      when Y6::REGEXP::BASEITEM::PRIZE_MP
        $hospital_prizes.push(self)
        @prize_max = [@prize_max, 1].max
        @prize_mp_healed = [$1.to_i, 1].max
      when Y6::REGEXP::BASEITEM::PRIZE_AIL
        $hospital_prizes.push(self)
        @prize_max = [@prize_max, 1].max
        @prize_ailments = [$1.to_i, 1].max
      when Y6::REGEXP::BASEITEM::PRIZE_DTH
        $hospital_prizes.push(self)
        @prize_max = [@prize_max, 1].max
        @prize_deaths = [$1.to_i, 1].max
      #---
      end
    } # self.note.split
  end # y6_cache_baseitem_hosp
 
  #--------------------------------------------------------------------------
  # new cache: prize_total
  #--------------------------------------------------------------------------
  def prize_total
    return 0 if $game_party.nil?
    n = nil
    if @prize_hp_healed > 0
      m = $game_party.hospital_hp_healed / @prize_hp_healed
      n = n.nil? ? m : [n, m].min
    end
    if @prize_mp_healed > 0
      m = $game_party.hospital_mp_healed / @prize_mp_healed
      n = n.nil? ? m : [n, m].min
    end
    if @prize_ailments > 0
      m = $game_party.hospital_states_healed / @prize_ailments
      n = n.nil? ? m : [n, m].min
    end
    if @prize_deaths > 0
      m = $game_party.hospital_deaths_healed / @prize_deaths
      n = n.nil? ? m : [n, m].min
    end
    n = n.nil? ? 0 : [n, @prize_max].min
    return n
  end
 
  #--------------------------------------------------------------------------
  # new cache: obtained_prize_times
  #--------------------------------------------------------------------------
  def obtained_prize_times
    return 0 if $game_party.nil?
    return $game_party.hospital_items_received(self)
  end
 
  #--------------------------------------------------------------------------
  # new cache: prize_times_can_obtain
  #--------------------------------------------------------------------------
  def prize_times_can_obtain
    return 0 if $game_party.nil?
    return [prize_total - obtained_prize_times, @prize_max].min
  end
 
  #--------------------------------------------------------------------------
  # anti-crash method: number_limit
  #--------------------------------------------------------------------------
  unless method_defined?(:number_limit)
  def number_limit; return 99; end
  end # method_defined?(:number_limit)
 
end # RPG::BaseItem

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias method: load_bt_database
  #--------------------------------------------------------------------------
  alias load_bt_database_hosp load_bt_database unless $@
  def load_bt_database
    load_bt_database_hosp
    load_hosp_cache
  end
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  alias load_database_hosp load_database unless $@
  def load_database
    load_database_hosp
    load_hosp_cache
  end
 
  #--------------------------------------------------------------------------
  # new method: load_hosp_cache
  #--------------------------------------------------------------------------
  def load_hosp_cache
    $hospital_prizes = []
    groups = [$data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj == nil
        obj.y6_cache_baseitem_hosp if obj.is_a?(RPG::BaseItem)
      end
    end
  end
 
end # Scene_Title

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
 
  #--------------------------------------------------------------------------
  # new method: hospital_items_received
  #--------------------------------------------------------------------------
  def hospital_items_received(item)
    @hospital_prize_items = {} if @hospital_prize_items.nil?
    @hospital_prize_weapons = {} if @hospital_prize_weapons.nil?
    @hospital_prize_armours = {} if @hospital_prize_armours.nil?
    n = 0
    if item.is_a?(RPG::Item)
      n = @hospital_prize_items[item.id]
      n = 0 if @hospital_prize_items[item.id].nil?
    elsif item.is_a?(RPG::Weapon)
      n = @hospital_prize_weapons[item.id]
      n = 0 if @hospital_prize_weapons[item.id].nil?
    elsif item.is_a?(RPG::Armor)
      n = @hospital_prize_armours[item.id]
      n = 0 if @hospital_prize_armours[item.id].nil?
    end
    return n
  end
 
  #--------------------------------------------------------------------------
  # new method: update_hospital_items_received
  #--------------------------------------------------------------------------
  def update_hospital_items_received(item, amount)
    @hospital_prize_items = {} if @hospital_prize_items.nil?
    @hospital_prize_weapons = {} if @hospital_prize_weapons.nil?
    @hospital_prize_armours = {} if @hospital_prize_armours.nil?
    if item.is_a?(RPG::Item)
      n = @hospital_prize_items[item.id]
      @hospital_prize_items[item.id] = 0 if n.nil?
      @hospital_prize_items[item.id] += amount
    elsif item.is_a?(RPG::Weapon)
      n = @hospital_prize_weapons[item.id]
      @hospital_prize_weapons[item.id] = 0 if n.nil?
      @hospital_prize_weapons[item.id] += amount
    elsif item.is_a?(RPG::Armor)
      n = @hospital_prize_armours[item.id]
      @hospital_prize_armours[item.id] = 0 if n.nil?
      @hospital_prize_armours[item.id] += amount
    end
  end
 
end # Game_Party

#==============================================================================
# ** Window_Hospital_Prize_Back
#==============================================================================

class Window_Hospital_Prize_Back < Window_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(hw)
    super(0, hw.y+hw.height, Graphics.width, Graphics.height-128-hw.height)
    refresh
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    text = Y6::HOSPITAL::PRIZE_VOCAB[:prize_name]
    contents.draw_text(24, 0, contents.width-24, WLH, text, 0)
    text = Y6::HOSPITAL::PRIZE_VOCAB[:prize_amount]
    contents.draw_text(0, 0, contents.width-24, WLH, text, 2)
  end
 
end # Window_Hospital_Prize_Back

#==============================================================================
# ** Window_Hospital_Prize_Give
#==============================================================================

class Window_Hospital_Prize_Give < Window_Selectable
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(bw)
    super(0, bw.y+WLH, Graphics.width, bw.height-WLH)
    self.active = false
    self.opacity = 0
    refresh
  end
 
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item; return @data[self.index]; end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    self.index = 0
    @data = []
    for item in $hospital_prizes
      next if item.nil?
      next if item.prize_times_can_obtain <= 0
      @data.push(item)
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max; draw_item(i); end
  end
 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    contents.clear_rect(rect)
    item = @data[index]
    return if item.nil?
    enabled = item.prize_times_can_obtain > 0
    draw_icon(item.icon_index, 0, rect.y, enabled)
    contents.font.color = normal_color
    contents.font.color.alpha = enabled ? 255 : 128
    text = item.name
    contents.draw_text(24, rect.y, rect.width/2-24, WLH, text, 0)
    text = sprintf("~%s", item.prize_times_can_obtain.group)
    contents.draw_text(rect.width/2, rect.y, rect.width/2-24, WLH, text, 2)
  end
 
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(item == nil ? "" : item.description)
  end
 
end # Window_Hospital_Prize_Give

#==============================================================================
# ** Window_Hospital_Prize_History
#==============================================================================

class Window_Hospital_Prize_History < Window_Selectable
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(bw)
    super(0, bw.y+WLH, Graphics.width, bw.height-WLH)
    self.active = false
    self.opacity = 0
    refresh
  end
 
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item; return @data[self.index]; end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    self.index = 0
    @data = []
    for item in $hospital_prizes
      next if item.nil?
      next unless item.obtained_prize_times > 0
      @data.push(item)
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max; draw_item(i); end
  end
 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    contents.clear_rect(rect)
    item = @data[index]
    return if item.nil?
    draw_icon(item.icon_index, 0, rect.y)
    text = item.name
    contents.draw_text(24, rect.y, rect.width/2-24, WLH, text, 0)
    text = sprintf("~%s", item.obtained_prize_times.group)
    contents.draw_text(rect.width/2, rect.y, rect.width/2-24, WLH, text, 2)
  end
 
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(item == nil ? "" : item.description)
  end
 
end # Window_Hospital_Prize_History

#==============================================================================
# ** Scene_Hospital
#==============================================================================

class Scene_Hospital < Scene_Base
 
  #--------------------------------------------------------------------------
  # enable_prize?
  #--------------------------------------------------------------------------
  def enable_prize?
    for item in $hospital_prizes
      next if item.nil?
      return true if item.prize_times_can_obtain > 0
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # enable_history?
  #--------------------------------------------------------------------------
  def enable_history?
    for item in $hospital_prizes
      next if item.nil?
      return true if item.obtained_prize_times > 0
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # redraw_command_window_prize
  #--------------------------------------------------------------------------
  def redraw_command_window_prize
    if Y6::HOSPITAL::COMMANDS.include?(:prize)
      @command_window.draw_item(@data.index(:prize), enable_prize?)
    end
    if Y6::HOSPITAL::COMMANDS.include?(:history)
      @command_window.draw_item(@data.index(:history), enable_history?)
    end
  end
 
  #--------------------------------------------------------------------------
  # open_prize_give_window
  #--------------------------------------------------------------------------
  def open_prize_give_window
    unless enable_prize?
      Sound.play_buzzer
      return
    end
    @help_window.width = Graphics.width
    @help_window.create_contents
    @gold_window.y = Graphics.height * 8
    @prize_back_window.y = @attendant_window.height
    @prize_give_window.y = @prize_back_window.y + 24
    @prize_give_window.active = true
    @prize_give_window.refresh
    hide_statistics_window
  end
 
  #--------------------------------------------------------------------------
  # update_prize_give_window
  #--------------------------------------------------------------------------
  def update_prize_give_window
    @prize_give_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @prize_give_window.active = false
      @command_window.active = true
      @statistics_window.refresh
      @help_window.width = Graphics.width - @gold_window.width
      @help_window.create_contents
      update_visible_windows
    elsif Input.trigger?(Input::C)
      item = @prize_give_window.item
      if item.nil?
        return
      elsif $game_party.item_number(item) >= item.number_limit
        Sound.play_buzzer
        return
      elsif item.prize_times_can_obtain <= 0
        Sound.play_buzzer
        return
      end
      Sound.play_use_item
      t = item.prize_times_can_obtain
      n = [t, item.number_limit - t].min
      $game_party.gain_item(item, n)
      $game_party.update_hospital_items_received(item, n)
      @prize_give_window.draw_item(@prize_give_window.index)
      redraw_command_window_prize
    end
  end
 
  #--------------------------------------------------------------------------
  # open_prize_history_window
  #--------------------------------------------------------------------------
  def open_prize_history_window
    unless enable_history?
      Sound.play_buzzer
      return
    end
    @help_window.width = Graphics.width
    @help_window.create_contents
    @gold_window.y = Graphics.height * 8
    @prize_back_window.y = @attendant_window.height
    @prize_history_window.y = @prize_back_window.y + 24
    @prize_history_window.active = true
    @prize_history_window.refresh
    hide_statistics_window
  end
 
  #--------------------------------------------------------------------------
  # update_prize_history_window
  #--------------------------------------------------------------------------
  def update_prize_history_window
    @prize_history_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @prize_give_window.active = false
      @command_window.active = true
      @statistics_window.refresh
      @help_window.width = Graphics.width - @gold_window.width
      @help_window.create_contents
      update_visible_windows
    end
  end
 
end # Scene_Hospital

#===============================================================================
#
# END OF FILE
#
#===============================================================================


Última edición por prodijames el Sáb 20 Abr 2013, 1:10 pm, editado 2 veces (Razón : puse code para que resulte facil)
avatar
prodijames
0
0

Masculino

Edad 27

Cantidad de envíos 7

Maker Cash 10

Reputación 0


Volver arriba Ir abajo

RPG Maker Vx Re: SCRIPT PARA TENER VIDAS EXTRAS

Mensaje por franciscojapones el Sáb 20 Abr 2013, 12:59 pm

Se ve muy bueno, creo que lo usare en algun proyecto.
Salu2

PD: el code funciona de la siguiente manera:;

Código:
 [code] pones el script aquí [/code]
Asi te aparecera como lo acabo de poner.

Salu2
avatar
franciscojapones
500
500

Masculino

Edad 17

Cantidad de envíos 1255

Maker Cash 1981

Reputación 151


Extras
Sobre mí:: Adicto a Vocaloid, usuario del chat grande del foro (Hipstah), adoro ridiculizar a turbia con su PCII y hacer el ridículo. Juego juegos y como comida. Odio mapear montañas (y todo) y tengo juegos raros y semi-decentes. ¡Jueguen Ladr y HDN D:

Volver arriba Ir abajo

RPG Maker Vx Re: SCRIPT PARA TENER VIDAS EXTRAS

Mensaje por marobes el Dom 21 Abr 2013, 10:39 am

perdona la ignorancia pero que es exactamente lo que hace el script,al menos
deberias poner imagenes o decir como funciona, por que me interesa saber
y creo que a muchos tambien.
avatar
marobes
50
50

Masculino

Edad 27

Cantidad de envíos 113

Maker Cash 167

Reputación 4


Extras
Sobre mí:: me encanta el dibujo,el manga

Volver arriba Ir abajo

RPG Maker Vx re: leelo

Mensaje por prodijames el Mar 23 Abr 2013, 8:35 am

perdona. soy nuevo aki i no puedo subir imagenes asta 7 dias. an pasado 4 asike en 3 dias pondre imagenes en todo
avatar
prodijames
0
0

Masculino

Edad 27

Cantidad de envíos 7

Maker Cash 10

Reputación 0


Volver arriba Ir abajo

RPG Maker Vx Re: SCRIPT PARA TENER VIDAS EXTRAS

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.