Drupogame
Impuestos en las tiendas Imagen12

Si quieres formar parte del staff tienes que enviar un MP al administrador o al Co-Administrador

Unirse al foro, es rápido y fácil

Drupogame
Impuestos en las tiendas Imagen12

Si quieres formar parte del staff tienes que enviar un MP al administrador o al Co-Administrador
Drupogame
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Conectarse

Recuperar mi contraseña

Buscar
 
 

Resultados por:
 


Rechercher Búsqueda avanzada

Últimos temas
» Reglas del foro
Impuestos en las tiendas EmptyLun Ene 23, 2012 11:32 pm por edux

» edux returns
Impuestos en las tiendas EmptyLun Ene 23, 2012 11:30 pm por edux

» The Elder Scrolls IV: Oblivion
Impuestos en las tiendas EmptyVie Ene 20, 2012 11:28 pm por Aljevalsar

» Kojima promete que habrá un Metal Gear Solid de auténtico sigilo
Impuestos en las tiendas EmptyJue Dic 22, 2011 7:33 pm por Anime_Maker

» Este fin de semana habrá nuevos modos para Modern Warfare 3
Impuestos en las tiendas EmptyJue Dic 15, 2011 12:03 pm por Akeo

» Kojima quiso crear un Metal Gear Solid 5 ambientado en la Segunda Guerra Mundial
Impuestos en las tiendas EmptyJue Dic 15, 2011 11:01 am por Akeo

» Darksiders II se dejará ver en los Spike VGA
Impuestos en las tiendas EmptyMiér Dic 14, 2011 11:50 am por Akeo

» El creador de Bayonetta desmiente estar implicado en el desarrollo de Metal Gear Rising
Impuestos en las tiendas EmptyMiér Dic 14, 2011 1:54 am por Akeo

» Los creadores de Bayonetta se encargan del desarrollo de Metal Gear Rising
Impuestos en las tiendas EmptyMiér Dic 14, 2011 1:52 am por Akeo

» En Construccion: Mundo Abismal
Impuestos en las tiendas EmptyLun Oct 24, 2011 4:03 am por SagahonArturo

» Visceral Games busca nuevo personal para la franquicia Dead Space
Impuestos en las tiendas EmptyMar Oct 11, 2011 3:22 am por The_King_Jaas

» buenas
Impuestos en las tiendas EmptyMar Oct 11, 2011 3:21 am por The_King_Jaas

» Batman: Arkham City llegará "sin ninguna limitación"
Impuestos en las tiendas EmptySáb Oct 08, 2011 1:44 am por Akeo

» Los creadores de Bulletstorm admiten divertidos que el juego tenía demasiadas palabras malsonantes
Impuestos en las tiendas EmptySáb Oct 08, 2011 1:41 am por Akeo

» PES 2012: El primer DLC estará disponible el 11 de octubre
Impuestos en las tiendas EmptySáb Oct 08, 2011 1:39 am por Akeo

Los posteadores más activos del mes
No hay usuarios

Estadísticas
Tenemos 98 miembros registrados
El último usuario registrado es Lawdesifi

Nuestros miembros han publicado un total de 6208 mensajes en 777 argumentos.
Compañeros
Crear foro
Crear foro
Crear foro
Crear foro
PFC
Crear foro
Crear foro
Otakus Activos
Diviértete acá
Crear foro
Foro de anime y RM2k3/XP/VX
contador.
contador de visitas
Mayo 2024
LunMarMiérJueVieSábDom
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendario Calendario


Impuestos en las tiendas

Ir abajo

Impuestos en las tiendas Empty Impuestos en las tiendas

Mensaje por Akeo Vie Abr 22, 2011 12:09 am



Descripción:
Este script permite que en las tiendas, aparte del precio normal, se cobre un impuesto extra que se puede modificar en cualquier momento. Será a algo así como el I.V.A.

Screens:
Impuestos en las tiendas Taxezmo2

Scripts:
Código:
#============================================================================
# Tax Script 1.2
#----------------------------------------------------------------------------
# By The_Darklord
# Thanks to SephirothSpawn for help
#----------------------------------------------------------------------------
# The following methods are rewritten:
# Window_ShopBuy(draw_iten(index), Scene_Shop(update_buy, update_number)
# Window_ShopStatus(refresh)
#============================================================================

class Game_System
attr_accessor :tax
alias declaration initialize
def initialize
declaration
@tax = 0
end
end

class Window_ShopBuy < Window_Selectable
alias make_item draw_item
#--------------------------------------------------------------------------
# * Draw Item
#    index : item number
#--------------------------------------------------------------------------
def draw_item(index)
  item = @data[index]
  a = item.price
  item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
  make_item(index)
  item.price = a
end
end

#------------------------------------------------------------------------------

class Scene_Shop
#--------------------------------------------------------------------------
# * Frame Update (when buy window is active)
#--------------------------------------------------------------------------
def update_buy
  # Set status window item
  @status_window.item = @buy_window.item
  # If B button was pressed
  if Input.trigger?(Input::B)
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Change windows to initial mode
    @command_window.active = true
    @dummy_window.visible = true
    @buy_window.active = false
    @buy_window.visible = false
    @status_window.visible = false
    @status_window.item = nil
    # Erase help text
    @help_window.set_text("")
    return
  end
  # If C button was pressed
  if Input.trigger?(Input::C)
    # Get item
    @item = @buy_window.item
    a = @item.price
    @item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
    # If item is invalid, or price is higher than money possessed
    if @item == nil or @item.price > $game_party.gold
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Get items in possession count
    case @item
    when RPG::Item
      number = $game_party.item_number(@item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(@item.id)
    when RPG::Armor
      number = $game_party.armor_number(@item.id)
    end
    # If 99 items are already in possession
    if number == 99
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Calculate maximum amount possible to buy
    max = @item.price == 0 ? 99 : $game_party.gold / @item.price
    max = [max, 99 - number].min
    # Change windows to quantity input mode
    @buy_window.active = false
    @buy_window.visible = false
    @number_window.set(@item, max, @item.price)
    @number_window.active = true
    @number_window.visible = true
    @item.price = a
  end
end
#--------------------------------------------------------------------------
# * Frame Update (when quantity input window is active)
#--------------------------------------------------------------------------
def update_number
  # If B button was pressed
  if Input.trigger?(Input::B)
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Set quantity input window to inactive / invisible
    @number_window.active = false
    @number_window.visible = false
    # Branch by command window cursor position
    case @command_window.index
    when 0  # buy
      # Change windows to buy mode
      @buy_window.active = true
      @buy_window.visible = true
    when 1  # sell
      # Change windows to sell mode
      @sell_window.active = true
      @sell_window.visible = true
      @status_window.visible = false
    end
    return
  end
  # If C button was pressed
  if Input.trigger?(Input::C)
    # Play shop SE
    $game_system.se_play($data_system.shop_se)
    # Set quantity input window to inactive / invisible
    @number_window.active = false
    @number_window.visible = false
    # Branch by command window cursor position
    case @command_window.index
    when 0  # buy
      # Buy process
      a = @item.price
      @item.price = Integer(a * ( (100 + $game_system.tax) / 100.0))
      $game_party.lose_gold(@number_window.number * @item.price)
      case @item
      when RPG::Item
        $game_party.gain_item(@item.id, @number_window.number)
      when RPG::Weapon
        $game_party.gain_weapon(@item.id, @number_window.number)
      when RPG::Armor
        $game_party.gain_armor(@item.id, @number_window.number)
      end
      @item.price = a
      # Refresh each window
      @gold_window.refresh
      @buy_window.refresh
      @status_window.refresh
      # Change windows to buy mode
      @buy_window.active = true
      @buy_window.visible = true
    when 1  # sell
      # Sell process
      $game_party.gain_gold(@number_window.number * (@item.price / 2))
      case @item
      when RPG::Item
        $game_party.lose_item(@item.id, @number_window.number)
      when RPG::Weapon
        $game_party.lose_weapon(@item.id, @number_window.number)
      when RPG::Armor
        $game_party.lose_armor(@item.id, @number_window.number)
      end
      # Refresh each window
      @gold_window.refresh
      @sell_window.refresh
      @status_window.refresh
      # Change windows to sell mode
      @sell_window.active = true
      @sell_window.visible = true
      @status_window.visible = false
    end
    return
  end
end
end

#------------------------------------------------------------------------------

class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
  self.contents.clear
  if @item == nil
    return
  end
  case @item
  when RPG::Item
    number = $game_party.item_number(@item.id)
  when RPG::Weapon
    number = $game_party.weapon_number(@item.id)
  when RPG::Armor
    number = $game_party.armor_number(@item.id)
  end
  self.contents.font.color = system_color
  self.contents.draw_text(4, 0, 200, 32, "Tienes")
  self.contents.font.color = normal_color
  self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  self.contents.font.color = system_color
  if $game_system.tax > 0
    self.contents.draw_text(4, 0, 200, 86, "Impuesto actual")
    self.contents.font.color = normal_color
    self.contents.draw_text(172, 0, 64, 86, $game_system.tax.to_s + "%", 2)
  end
  if 0 > $game_system.tax
    self.contents.draw_text(4, 0, 200, 86, "Descuento")
    self.contents.font.color = normal_color
    self.contents.draw_text(172, 0, 64, 86, $game_system.tax.to_s + "%", 2)
  end
  if @item.is_a?(RPG::Item)
    return
  end
  # Equipment adding information
  for i in 0...$game_party.actors.size
    # Get actor
    actor = $game_party.actors[i]
    # If equippable, then set to normal text color. If not, set to
    # invalid text color.
    if actor.equippable?(@item)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    # Draw actor's name
    self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
    # Get current equipment
    if @item.is_a?(RPG::Weapon)
      item1 = $data_weapons[actor.weapon_id]
    elsif @item.kind == 0
      item1 = $data_armors[actor.armor1_id]
    elsif @item.kind == 1
      item1 = $data_armors[actor.armor2_id]
    elsif @item.kind == 2
      item1 = $data_armors[actor.armor3_id]
    else
      item1 = $data_armors[actor.armor4_id]
    end
    # If equippable
    if actor.equippable?(@item)
      # If weapon
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 != nil ? item1.atk : 0
        atk2 = @item != nil ? @item.atk : 0
        change = atk2 - atk1
      end
      # If armor
      if @item.is_a?(RPG::Armor)
        pdef1 = item1 != nil ? item1.pdef : 0
        mdef1 = item1 != nil ? item1.mdef : 0
        pdef2 = @item != nil ? @item.pdef : 0
        mdef2 = @item != nil ? @item.mdef : 0
        change = pdef2 - pdef1 + mdef2 - mdef1
      end
      # Draw parameter change values
      self.contents.draw_text(124, 64 + 64 * i, 112, 32,
        sprintf("%+d", change), 2)
    end
    # Draw item
    if item1 != nil
      x = 4
      y = 64 + 64 * i + 32
      bitmap = RPG::Cache.icon(item1.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, 212, 32, item1.name)
    end
  end
end
end

Instrucciones:
# Coloca el script sobre Main.

# Siempre que quieras cambiar el impuesto usa llamar script:
Código:
$game_system.tax = *IMPUESTO*

Cambia *Impuesto* por el porcentaje de impuesto que quieres en las tiendas.

# También puedes poner impuestos negativos (vamos, rebajas). En la screen podeis ver que el impuesto era del 4% (En el script ya está¡ traducido), pero si el impuesto es negativo, en vez de poner Impuesto pondrá Descuento.

Créditos:
Script creado por: Darklord
Corrección de un error por: SephirothSpaw
Akeo
Akeo
Administrador
Administrador

Mensajes : 1876
Fecha de inscripción : 02/01/2011
Edad : 29

https://drupogame.superforo.net

Volver arriba Ir abajo

Volver arriba


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