RPG Fusion
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
Le Deal du moment : -40%
Tefal Ingenio Emotion – Batterie de cuisine 10 ...
Voir le deal
59.99 €

 

 Réputation

Aller en bas 
AuteurMessage
néos
Jongleur Itinérant
Jongleur Itinérant
néos


Masculin
Nombre de messages : 69
Age : 29
Projet(s) en cours : Héliote
Niveau Rpg Maker : Bof
Jeux Préférés : le pouvoir des esprit
Date d'inscription : 24/01/2008

Réputation Empty
MessageSujet: Réputation   Réputation EmptyMar 20 Mai 2008, 08:01

Auteur : Kyo
Trouvé sur : RXMP.org


Voici un petit script très sympa... Il permet de donner un système de réputation au héros et de faire des groupes, par exemple la famille royale, l'Ordre Blanc, etc.

1°/ Le script:
À mettre au-dessus de Main avec n'importe quel nom...:

Code:
#==============================================================
#  Kio's Reputation System v1.2
#==============================================================

class Game_System
    attr_accessor :fac_rep
    attr_accessor :fac_active
 
  alias rep_initialize initialize
  def initialize
    rep_initialize
    @fac_rep=[]
    @fac_active=[]
  end
end

class Scene_Title
 alias cng command_new_game
 def command_new_game
  cng
  #Determine the initial settings for the faction's reputations here
  $game_system.fac_rep = [50, 44, 75, 24, 9, 56, 100]
  #Determine the inital factions you can see here.
  $game_system.fac_active = ["active", "active", "active", "active", "active", nil, nil]
 end
end

class Scene_Reputation
  def main
    @status_window = Window_Reputation.new
    @sprite = Spriteset_Map.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @status_window.dispose
    @sprite.dispose
  end

  def update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(5)
      return
    end
  end
end

class Window_Reputation < Window_Base
    attr_accessor :factions
    attr_accessor :fac_rep
    attr_accessor :reptypes
    attr_accessor :fac_active

  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    self.contents.font.color = text_color(0)
    self.back_opacity = 120
    @factions = ["Famille Royale", "Église d' Avelius", "Nobles", "Paysans", "Étrangers", "Ordre Blanc", "Crestguarde"]
    @rep = ["Heroique", "Honoré", "Amical", "Neutre", "Froid", "Détesté", "Horripilé"]
    refresh
  end
 
  def draw_repbar(x, y, width, height, current, max)
    x -= 10
    for i in 0..(height+2)
      self.contents.fill_rect(x-3+i, y - 1 + i, width+5, 1, Color.new(255, 255, 255, 255))
    end
    for i in 0..height
      self.contents.fill_rect(x+i, y+i, width+1, 1, Color.new(0, 0, 0, 255))
    end
    for i in 0..height
      for j in 0..current
        self.contents.fill_rect(x+j+i, y+i, 1, 1, Color.new(0, 0 + (1.25*j), 255 - (1.25*j), 255 - (5*i)))
      end
    end
  end

  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 32
    self.contents.draw_text(20, 40, 184, 32, "Réputation", 2)
    self.contents.font.size = $fontsize
    for i in 0...@factions.size
      y = 80 + (i * 70)
      x = -30
      if i > 4
        x = 280
        y = 80 + ((i - 5) * 70)
      end
      if $game_system.fac_rep[i] > 100
        $game_system.fac_rep[i] = 100
      end
      if $game_system.fac_rep[i] < 0
        $game_system.fac_rep[i] = 0
      end
      if $game_system.fac_active[i] == "active"
        draw_fac(x, y, i)
      end
      self.contents.font.color = normal_color
    end
  end
 
  def draw_fac(x, y, i)
    self.contents.draw_text(x+40, y, 160, 32, @factions[i], 0)
    draw_repbar(x+90, y+32,  200, 14, 2 * $game_system.fac_rep[i], 100)
    self.contents.font.color = system_color
    if $game_system.fac_rep[i] >= 90
      self.contents.draw_text(x+210, y, 96, 32, @rep[0], 2)
    elsif $game_system.fac_rep[i] >= 75
      self.contents.draw_text(x+210, y, 96, 32, @rep[1], 2)
    elsif $game_system.fac_rep[i] >= 55
      self.contents.draw_text(x+210, y, 96, 32, @rep[2], 2)
    elsif $game_system.fac_rep[i] >= 45
      self.contents.draw_text(x+210, y, 96, 32, @rep[3], 2)
    elsif $game_system.fac_rep[i] >= 25
      self.contents.draw_text(x+210, y, 96, 32, @rep[4], 2)
    elsif $game_system.fac_rep[i] >= 10
      self.contents.draw_text(x+210, y, 96, 32, @rep[5], 2)
    else
      self.contents.draw_text(x+210, y, 96, 32, @rep[6], 2)
    end
  end
end 


2°/ Instructions:
Vers la ligne 22, vous pouvez changer la réaction de base des groupes et s'ils vous connaissent.
Vers la ligne 68, vous pouvez donner un nom aux groupes et aux stades : Amical, Héroique, Détesté...
Vers la ligne 118, vous pouvez définir la valeur qu'il faut pour avoir chaque stade.
Pour ajuster la réputation:
Code:
$game_system.fac_rep[i] += n


En changeant i par l'ID du groupe, + (pas "+=" ! Seulement le "+") par un moins ou un plus selon la situation, et n par le chiffre lui-même.

3°/ Un screen:
Réputation Repis7mj7
Revenir en haut Aller en bas
http://patchworkrmxp.canalblog.com/
 
Réputation
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Fusion :: BANQUE DU CODE :: Antre des Scripts :: Divers-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser