AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le deal à ne pas rater :
Xiaomi Mi Smart Camera 2K Standard Edition (design compact / support ...
11.39 €
Voir le deal

Partagez
 

 [VX] On-Screen Shop

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
OR-K
Prêtre Lv13
Prêtre Lv13
avatar


Masculin Age : 31
Inscrit le : 19/06/2008
Messages : 877

[VX] On-Screen Shop Empty
MessageSujet: [VX] On-Screen Shop   [VX] On-Screen Shop Icon_minitimeVen 11 Juil 2008 - 23:47

Un petit script qui permet d'améliorer les magasins (il montre combien vous avez d'objets "X", et combien l'équipement "Y" vous augmentera vos stats !)

Auteur :Woratana

Traducteur : Moi : OR-K

Screen :
Spoiler:

Le script :
Code:
#=======================================================================
# ● [VX] ◦ On-Screen Shop ◦ □
#-------------------------------------------------------------------
# ◦ Par Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 14/05/2008
# ◦ Version: 1.0
# Traduite par OR-K
#=======================================================================

class Scene_Shop < Scene_Base
 
  USE_SPRITESET = true
  # Voulez-vous utilisez une map réelle comme fond? (les tiles l'animeront ?)
 
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_str_oshop start
  def start
    wora_sceshop_str_oshop
    @spriteset = Spriteset_Map.new if USE_SPRITESET
    @gold_window.x = Graphics.width - @gold_window.width - 24
    @gold_window.y = Graphics.height - @gold_window.height - 24
    @buy_window.x = @sell_window.x = 0
    @number_window.x = 0
    @dummy_window.y = @help_window.height
    @buy_window.y = @sell_window.y = @help_window.height
    @number_window.y = @status_window.y = @help_window.height
    @buy_window.height = @sell_window.height = 200
    @number_window.height = @status_window.height = 200
    @dummy_window.y = Graphics.height
    @status_window.create_contents
    @help_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_ter_oshop terminate
  def terminate
    wora_sceshop_ter_oshop
    @spriteset.dispose if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias wora_sceshop_upd_oshop update
  def update
    wora_sceshop_upd_oshop
    if @command_window.active
      @help_window.visible = false
    elsif @buy_window.active
      @help_window.visible = @buy_window.visible
    elsif @sell_window.active
      @help_window.visible = @sell_window.visible
    end
    @spriteset.update if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::ShopBuy
    s2 = Vocab::ShopSell
    s3 = Vocab::ShopCancel
    @command_window = Window_Command.new(120, [s1, s2, s3])
    @command_window.y = Graphics.height - @command_window.height - 24
    @command_window.x = 24
    if $game_temp.shop_purchase_only
      @command_window.draw_item(1, false)
    end
  end
end

class Window_ShopNumber < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    y = 64
    self.contents.clear
    draw_item_name(@item, 0, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(212, y, 20, WLH, "×")
    self.contents.draw_text(248, y, 20, WLH, @number, 2)
    self.cursor_rect.set(244, y, 28, WLH)
    draw_currency_value(@price * @number, 4, y + WLH * 2, 264)
  end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      if change > 0 # Si cela augmente le statut
       
      elsif change < 0 # Si cela baisse le statut
        self.contents.font.color.alpha = 128
      else # Si cela ne change pas le statut
        self.contents.font.color.alpha = 128
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
  end
end

Utilisation : Ce script ne nécessite aucun réglage, intégrez-le au-dessus de Main, il agira seul sur les magasins. Razz

En espérant qu'il vous plaira !
Merci à Woratana pour ce script Wink
Revenir en haut Aller en bas
MirainoHikari
Ex-Admin-Script
Ex-Admin-Script
MirainoHikari


Masculin Age : 41
Inscrit le : 26/05/2008
Messages : 2360

[VX] On-Screen Shop Empty
MessageSujet: Re: [VX] On-Screen Shop   [VX] On-Screen Shop Icon_minitimeSam 12 Juil 2008 - 1:53

Merci du partage. Je te donne tes points.
Revenir en haut Aller en bas
http://mirainohikari.deviantart.com
OR-K
Prêtre Lv13
Prêtre Lv13
avatar


Masculin Age : 31
Inscrit le : 19/06/2008
Messages : 877

[VX] On-Screen Shop Empty
MessageSujet: Re: [VX] On-Screen Shop   [VX] On-Screen Shop Icon_minitimeSam 12 Juil 2008 - 10:51

De rien Wink
Et merci à toi pour les points Wink
Revenir en haut Aller en bas
Contenu sponsorisé




[VX] On-Screen Shop Empty
MessageSujet: Re: [VX] On-Screen Shop   [VX] On-Screen Shop Icon_minitime

Revenir en haut Aller en bas
 

[VX] On-Screen Shop

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» [Résolu] Comment faire afficher mon nouveau TileA4
» Screen
» [Brouillon] Screen IG
» Zouzaka Shop
» Splash screen

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Scripts VX - RGSS2 :: Objets et compétences-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit