01-29-2007, 01:00 PM
(This post was last modified: 06-13-2017, 04:15 AM by DerVVulfman.)
CSS (Custom Shop System) *Animated!*
By Samo, the thief
V 1.0
Jan 29 2007
It has some taxes, introductions and it looks very cool
CODE:
-----
here it is:
INSTRUCTIONS:
-------------
- Place this script above Main and delte the original Scene_Shop.
- Then put this in Scene_Title, under this and add the line in ADDED:
CREATING A SHOP:
-Call the shop in the normal form, but before calling, put this in a call
script:
Put as many of these commands you want, but have in mind they will be lines
EX:
Then Doing the new feauture. Put this in a new call script:
X is a number will be plus to all prices of the shop. If you don't want this,
just put it as 0. Put this two things in all shops you create.
FEATURES:
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Introduction in a shop.
- Animations of Windows added.
- Colors in some items
- Better Shop status
- Taxes in shops
- Now creating shops is really fun and customizable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Enjoy the script and give me the credit. Replies please! What do you think of this?
Samo, the thief.
By Samo, the thief
V 1.0
Jan 29 2007
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
It has some taxes, introductions and it looks very cool
CODE:
-----
here it is:
CODE
Code:
#============================================================================#
#============================================================================#
#============================================================================#
#
# CSS (Custom Shop System) V1.0
# by Samo, the thief
#
#
#
# INSTRUCTIONS:
#
# - Place this script above Main and delte the original Scene_Shop.
#
# - Then put this in Scene_Title, under this and add the line in #ADDED:
#
# $game_player = Game
# $game_player = Game_Player.new
# #---------ADDED-----------------------
# $shop_line = []
# #---------ADDED--------------------------------------------
#
#
#
#
# CREATING A SHOP:
#
# -Call the shop in the normal form, but before calling, put this in a call
# script:
#
#
# $shop_line.push(LINE)
#
# Put as many of these commands you want, but have in mind they will be lines
# EX:
#
#
#
# $shop_line.push("Welcome to Diggin's Shop. I have many strange")
# $shop_line.push("potions for you. My prices are the best in Lyna.")
# $shop_line.push("You may check them all you want. Take your time")
# $shop_line.push("and maybe you'll be interested in something.")
#
# Then Doing the new feauture. Put this in a new call script:
#
#
# $shop_tax = X
#
# X is a number will be plus to all prices of the shop. If you don't want this,
# just put it as 0. Put this two things in all shops you create.
#
#
#FEATURES:
#<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# - Introduction in a shop.
# - Animations of Windows added.
# - Colors in some items
# - Better Shop status
# - Taxes in shops
# - Now creating shops is really fun and customizable.
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
#
# Please, give me the credit if you use it. Enjoy it!
# Samo, the thief.
#
#
#============================================================================#
#============================================================================#
#============================================================================#
#==============================================================================
# ■ Scene_Shop
#------------------------------------------------------------------------------
class Scene_Shop
# ------------------------------------
def main
@spriteset = Spriteset_Map.new
@help_window = Window_Help.new
@help_window.x = -640
@help_window.y = 416
@help_window.z = 100
@help_window.opacity = 225
@command_window = Window_ShopCommand.new
@command_window.y = -64
@command_window.opacity = 235
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = -64
@gold_window.opacity = 235
@info_window = Window_Information.new
@info_window.x = -480
@info_window.active = false
@info_window.visible = false
@info_window.z = 200
@info_window.opacity = 215
@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
@buy_window.active = false
@buy_window.visible = false
@buy_window.x = -400
@buy_window.opacity = 215
@buy_window.help_window = @help_window
@sell_window = Window_ShopSell.new
@sell_window.active = false
@sell_window.visible = false
@sell_window.x = -400
@sell_window.opacity = 215
@sell_window.help_window = @help_window
@number_window = Window_ShopNumber.new
@number_window.active = false
@number_window.visible = false
@number_window.opacity = 215
@status_window = Window_ShopStatus.new
@status_window.visible = false
@status_window.x = 768
@status_window.opacity = 215
@command_window.active = false
@info_window.active = true
@info_window.visible = true
@info_window.x = -480
@i_a = true
@info_window.refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@help_window.dispose
@command_window.dispose
@gold_window.dispose
@buy_window.dispose
@sell_window.dispose
@number_window.dispose
@status_window.dispose
@info_window.dispose
$shop_line = []
end
# ------------------------------------
def update
if @help_window.x != 0
@help_window.x += 80
end
if @gold_window.y != 0
@gold_window.y += 4
end
if @command_window.y != 0
@command_window.y += 4
end
if @i_a and @info_window.x != 100
@info_window.x += 20
end
if @b_a and @buy_window.x != 0
@buy_window.x += 20
end
if @sl_a and @sell_window.x != 0
@sell_window.x += 20
end
if @st_a and @status_window.x != 368
@status_window.x -= 20
end
@command_window.update
@gold_window.update
@buy_window.update
@sell_window.update
@number_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @info_window.active
update_info
return
end
if @buy_window.active
update_buy
return
end
if @sell_window.active
update_sell
return
end
if @number_window.active
update_number
return
end
end
# ------------------------------------
def update_command
@status_window.visible = false
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@info_window.active = true
@info_window.visible = true
@info_window.x = -480
@i_a = true
@info_window.refresh
when 0
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@buy_window.active = true
@buy_window.visible = true
@buy_window.x = -400
@b_a = true
@buy_window.refresh
@status_window.visible = true
@status_window.x = 768
@st_a = true
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@sell_window.active = true
@sell_window.visible = true
@sell_window.x = -400
@sl_a = true
@sell_window.refresh
@status_window.visible = true
@status_window.x = 768
@st_a = true
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
end
end
return
end
end
# ------------------------------------
def update_info
@status_window.item = @buy_window.item
if Input.trigger?(Input::C)
@i_a = false
$game_system.se_play($data_system.decision_se)
@command_window.active = true
@info_window.active = false
@info_window.visible = false
@help_window.set_text("")
return
end
end
# ------------------------------------
# ------------------------------------
def update_buy
@status_window.item = @buy_window.item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.x = 768
@status_window.item = nil
@st_a = false
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @buy_window.item
if @item == nil or @item.price + $shop_tax > $game_party.gold
$game_system.se_play($data_system.buzzer_se)
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
if number == 99
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
max = @item.price == 0 ? 99 : $game_party.gold / @item.price
max = [max, 99 - number].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
# ------------------------------------
def update_sell
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@sell_window.active = false
@sell_window.visible = false
@status_window.visible = false
@status_window.x = 768
@st_a = false
@status_window.item = nil
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @sell_window.item
@status_window.item = @item
if @item == nil or @item.price == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
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
max = number
@sell_window.active = false
@sell_window.visible = false
@number_window.set(@item, max, (@item.price + $shop_tax) / 2)
@number_window.active = true
@number_window.visible = true
end
end
# ------------------------------------
def update_number
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@number_window.active = false
@number_window.visible = false
case @command_window.index
when 0
@buy_window.active = true
@buy_window.visible = true
when 1
@sell_window.active = true
@sell_window.visible = true
end
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.shop_se)
@number_window.active = false
@number_window.visible = false
case @command_window.index
when 0
value = (@item.price + $shop_tax) * @number_window.number
$game_party.lose_gold(value)
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
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
@buy_window.active = true
@buy_window.visible = true
when 1
value = ((@item.price + $shop_tax) * @number_window.number) / 2
$game_party.gain_gold(value)
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
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
@sell_window.active = true
@sell_window.visible = true
end
return
end
end
#==============================================================================
# Window_ShopCommand
#------------------------------------------------------------------------------
# Es la ventana que elige el negocio a realizar en una tienda
#==============================================================================
class Window_ShopCommand < Window_Selectable
#--------------------------------------------------------------------------
# - Inicializar Objeto
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
@item_max = 4
@column_max = 4
@commands = ["Buy", "Sell", "Info.", "Quit"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# - Refrescar
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# - Dibujado del objeto
# index : número del objeto
#--------------------------------------------------------------------------
def draw_item(index)
x = 4 + index * 125
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# Esta es la venta que muestra el dinero
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# - Inicio de Objetos...
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
refresh
end
#--------------------------------------------------------------------------
# - Actualizacion
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# Window_ShopBuy
#------------------------------------------------------------------------------
# Es la lista que muesta la lista de las mercancias que puede ser comprado en una tienda
#==============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# - Inicializar Objeto
# shop_goods : Mercancias
#--------------------------------------------------------------------------
def initialize(shop_goods)
super(0, 64, 368, 290)
@shop_goods = shop_goods
refresh
self.index = 0
end
#--------------------------------------------------------------------------
#- Adquisiciún del Objeto
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# - Refrescar
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
@data.push($data_items[goods_item[1]])
when 1
@data.push($data_weapons[goods_item[1]])
when 2
@data.push($data_armors[goods_item[1]])
end
end
# Número de Objetos. Si no es cero se creara un mapa de bits y se dibujaran los objetos.
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# - Dibujado de un Objeto
# index : Número del Objeto
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
# La cantidad de objetos adquiridos poseidos
case item
when RPG::Item
number = $game_party.item_number(item.id)
color = Color.new(60,175,0,255)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
color = Color.new(0,175,255,255)
when RPG::Armor
number =$game_party.armor_number(item.id)
color = Color.new(175,155,115,255)
end
# El número de objetos poseidos debajo del dinero en mano.Si no tienes 99 aparecera en color normal (el precio)
# En otro caso, se pondra un color de caracter inv?lido
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.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)
if item.price <= $game_party.gold and number < 99
self.contents.font.color = color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
value = item.price + $shop_tax
self.contents.draw_text(x + 200, y, 88, 32, value.to_s, 2)
end
#--------------------------------------------------------------------------
# - Renovar Texto de ayuda
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# Window_ShopSell
#------------------------------------------------------------------------------
# Es la ventana que muestra el núero de objetos que posee una tienda para comprar.
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# - Inicializar Objeto
#--------------------------------------------------------------------------
def initialize
super(0, 64, 368, 290)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# - Adquisición del Objeto
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
#- Refrescar
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
# El número de objetos. Si no es cero, se dibujara un mapa de bits y se dibujaran los objetos.
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# - Dibujado del Objeto
# index : Número de Objeto
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
color = Color.new(60,175,0,255)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
color = Color.new(0,175,255,255)
when RPG::Armor
number =$game_party.armor_number(item.id)
color = Color.new(175,155,115,255)
end
# Si la compra es posible, el color de caracteres no cambia, si no es posible, se fijara un color para indicarlo.
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.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)
if item.price > 0
self.contents.font.color = color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# - Renovación del texto de ayuda
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# Window_ShopNumber
#------------------------------------------------------------------------------
# Es la ventana donde se elige el número de objetos a comprar o a vender en una tienda.
#==============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# - Inicializar Objeto
#--------------------------------------------------------------------------
def initialize
super(0, 64, 368, 290)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
@item = nil
@max = 1
@price = 0
@number = 1
end
#--------------------------------------------------------------------------
# - Elección de objeto, número máximo y precio
#--------------------------------------------------------------------------
def set(item, max, price)
@item = item
@max = max
@price = price
@number = 1
refresh
end
#--------------------------------------------------------------------------
# - Elegir número de entrada
#--------------------------------------------------------------------------
def number
return @number
end
#--------------------------------------------------------------------------
#- Refrescar
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_item_name(@item, 4, 96)
self.contents.font.color = normal_color
self.contents.draw_text(272, 96, 32, 32, "~")
self.contents.font.color = text_color(4)
self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2)
self.contents.font.color = text_color(0)
self.cursor_rect.set(304, 96, 32, 32)
# Dibujar el precio total y las unidades actuales
domination = $data_system.words.gold
cx = contents.text_size(domination).width
total_price = (@price + $shop_tax) * @number
self.contents.font.color = normal_color
self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(332-cx, 160, cx, 32, domination, 2)
end
#--------------------------------------------------------------------------
# - Renovar Frame
#--------------------------------------------------------------------------
def update
super
if self.active
# Cursor Derecha (+1)
if Input.repeat?(Input::RIGHT) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number += 1
refresh
end
# Cursor Izquierda (-1)
if Input.repeat?(Input::LEFT) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number -= 1
refresh
end
# En cursor (+10)
if Input.repeat?(Input::UP) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number = [@number + 10, @max].min
refresh
end
# Bajo Cursor (-10)
if Input.repeat?(Input::DOWN) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number = [@number - 10, 1].max
refresh
end
end
end
end
#==============================================================================
# ¡ Window_ShopStatus
#------------------------------------------------------------------------------
# @Es la ventana que muestra el equipamiento o el número de objetos en posesión, o el objetivo, en una tienda.
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
#- Inicializar Objeto
#--------------------------------------------------------------------------
def initialize
super(368, 64, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
@item = nil
refresh
end
#--------------------------------------------------------------------------
# - Refrescar
#--------------------------------------------------------------------------
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, "The number you have")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
return
end
# Información adicional del articulo de equipo
for i in 0...$game_party.actors.size
# Objetivo es Adquirido
actor = $game_party.actors[i]
# Si el equipamiento es posible, o es imposible, se mostrara un color de personaje para el posible y otro para el no posible
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# Dibujar nombre del objetivo
self.contents.draw_text(36, 64 + 64 * i, 120, 32, actor.name)
draw_actor_graphic (actor, 12, 96 + 64 * i)
# El articulo de equipo presente es adquirido
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]
else
item1 = $data_armors[actor.armor3_id]
end
# Cuando se puede equipar
if actor.equippable?(@item)
# En el caso de armas
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# En el caso de protectores
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
# Dibujado del cambio de un parametro
self.contents.font.size = 16
if change != 0
self.contents.draw_text(124, 64 + 64 * i, 112, 32,sprintf("Change: %+d", change), 2)
else
self.contents.draw_text(124, 64 + 64 * i, 112, 32,"No change", 2)
end
end
# El Objeto es dibujado
self.contents.font.size = 26
if item1 != nil
x = 24
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 + 24, y, 212, 32, item1.name)
end
end
end
#--------------------------------------------------------------------------
# - Elegir Objeto
# item : Un Nuevo Objeto
#--------------------------------------------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
end
#==============================================================================
# ¡ Window_Information
#------------------------------------------------------------------------------
#==============================================================================
class Window_Information < Window_Base
#--------------------------------------------------------------------------
#- Inicializar Objeto
#--------------------------------------------------------------------------
def initialize
super(100, 64, 480, 360)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 26
refresh
end
#--------------------------------------------------------------------------
# - Refrescar
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "Information:")
self.contents.font.color = normal_color
for i in 0..$shop_line.size - 1
self.contents.draw_text(12, 32 * (i +1), 460, 32, $shop_line[i])
end
self.contents.font.color = system_color
self.contents.font.size = 23
self.contents.draw_text(0, 300, 460, 32, "Press 'ACCEPT' to continue... ")
end
end
INSTRUCTIONS:
-------------
- Place this script above Main and delte the original Scene_Shop.
- Then put this in Scene_Title, under this and add the line in ADDED:
Code:
$game_player = Game_Player.new
#---------ADDED-----------------------
$shop_line = []
#---------ADDED--------------------------------------------
CREATING A SHOP:
-Call the shop in the normal form, but before calling, put this in a call
script:
Code:
$shop_line.push(LINE)
Put as many of these commands you want, but have in mind they will be lines
EX:
Code:
$shop_line.push("Welcome to Diggin's Shop. I have many strange")
$shop_line.push("potions for you. My prices are the best in Lyna.")
$shop_line.push("You may check them all you want. Take your time")
$shop_line.push("and maybe you'll be interested in something.")
Then Doing the new feauture. Put this in a new call script:
Code:
$shop_tax = X
X is a number will be plus to all prices of the shop. If you don't want this,
just put it as 0. Put this two things in all shops you create.
FEATURES:
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Introduction in a shop.
- Animations of Windows added.
- Colors in some items
- Better Shop status
- Taxes in shops
- Now creating shops is really fun and customizable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Enjoy the script and give me the credit. Replies please! What do you think of this?
Samo, the thief.