Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 3 messages ] 
Auteur Message
 Sujet du message: [RMXP] Description des skills
MessagePublié: 23 Jan 2008, 01:57 
Villageois (Nv 2)

Inscrit le: 02 Nov 2007, 01:00
Messages: 24
Points d'aide: 0/60

Créations :

Voir ses créations

Description des skills :


Auteur : Loup Malade

Description :
Ce script offre un menu decrivant les particularités de chaque skill (Dégats, Attributs, etc ... )

Screenshot :
Image

Ressources :
http://www.megaupload.com/?d=7MSEH63V

Démo :
Démo v2 : http://www.mediafire.com/?cidoci1xxz9

Explications :
Ajouter les scripts ci-dessous au dessus de main puis placer le contenu du dossier Icons des ressources dans le dossier Icons de votre projet.

V2 -> Les Attribut magiques sont pas placer dans le sous menu, il sont juste en dessous des magies

Script :

PS : Pas obliger de mettre des crédits pour ce p'tit truc !


Haut
 Profil  
 
 Sujet du message: Re: [RMXP] Description des skills
MessagePublié: 27 Mai 2009, 20:37 
Villageois (Nv 2)

Inscrit le: 02 Nov 2007, 01:00
Messages: 24
Points d'aide: 0/60

Créations :

Voir ses créations

Script - Partie 1 :
Code: Tout sélectionner
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Window_Base
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Window_Base
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_element_icon(actor, x, y, skill_id, element_id)
      if($data_skills[skill_id].element_set.to_s != "")
         @element_id = $data_skills[skill_id].element_set[element_id]
         @elt_icon = RPG::Cache.icon("Elements/"+@element_id.to_s)
         self.contents.blt(x, y,  @elt_icon, Rect.new(0, 0, 24, 24))
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_skill_plus_status_icon( x, y, skill_id, status_id)
      @status_name = $data_skills[skill_id].plus_state_set[status_id]
      @status_name = $data_states[@status_name].name
      if(@status_name != "")   
         @status_icon = RPG::Cache.icon("Statuts/"+@status_name)
         self.contents.blt(x, y,  @status_icon, Rect.new(0, 0, 24, 24))
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_skill_minus_status_icon( x, y, skill_id, status_id)
      @status_name = $data_skills[skill_id].minus_state_set[status_id]
      @status_name = $data_states[@status_name].name
      if(@status_name != "")   
         @status_icon = RPG::Cache.icon("Statuts/"+@status_name)
         self.contents.blt(x, y,  @status_icon, Rect.new(0, 0, 24, 24))
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_occasion(nombre)
      @occasion = ["toujours","en combat","depuis le menu","jamais"]
      for i in 0...@occasion.size
         if(nombre==i)
            return @occasion[i]
         end
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_scope(nombre)
      @portee = ["Aucun","Un ennemi","Tous les ennemis",
      "Un allié", "Tous les alliés", "Un allié KO","Tous les alliés KO",
      "Utilisateur"]
      for i in 0...@portee.size
         if(nombre==i)
            return @portee[i]
         end
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Window_Skill_List
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Window_Skill_List < Window_Selectable
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def initialize(actor)
      super(0, 128, 640, 352)
      @actor = actor
      @column_max = 2
      refresh
      self.index = 0
      if $game_temp.in_battle
         self.y = 64
         self.height = 256
         self.back_opacity = 160
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def skill
      return @data[self.index]
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def refresh
      if self.contents != nil
         self.contents.dispose
         self.contents = nil
      end
      @data = []
      for i in 0...@actor.skills.size
         skill = $data_skills[@actor.skills[i]]
         if skill != nil
            @data.push(skill)
         end
      end
      @item_max = @data.size
      if @item_max > 0
         self.contents = Bitmap.new(width - 32, row_max * 32)
         self.contents.font.name = $fontface
         self.contents.font.size = $fontsize
         for i in 0...@item_max
            draw_item(i)
         end
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def draw_item(index)
      skill = @data[index] 
      x = 4 + index % 2 * (288 + 32)
      y = index / 2 * 32
      rect = Rect.new(x, y, self.width / @column_max - 32, 32)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      bitmap = RPG::Cache.icon(skill.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, 204, 32, skill.name, 0)
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_help
      @help_window.set_text(self.skill == nil ? "" : self.skill.description)
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Window_Help
#  Modifier par Loup Malade
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Window_Skill_Description < Window_Base
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   attr_accessor :skill
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def initialize(actor)
      super(0, 0, 640, 480)
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      @skill = nil
      @actor = actor
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def refresh
      self.contents.clear
      skill_id = @skill.id
      if @actor.skills.size > 0
         bitmap = RPG::Cache.icon(skill.icon_name)
         opacity = self.contents.font.color == normal_color ? 255 : 128
         self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24), opacity)
         self.contents.font.color = system_color
         self.contents.draw_text(36, 0, self.width - 40, 32, "-Nom") 
         self.contents.font.color = normal_color
         text= @skill.name
         self.contents.draw_text(36, 32, self.width - 40, 32, text)  
         self.contents.font.color = system_color
         self.contents.draw_text(256, 0, self.width - 40, 32,  "-MP")
         self.contents.font.color = normal_color
         text= @skill.sp_cost.to_s
         self.contents.draw_text(256, 32, self.width - 40, 32, text) 
         self.contents.font.color = system_color
         self.contents.draw_text(36, 64, self.width - 40, 32, "-Description : ")
         self.contents.font.color = normal_color
         text= @skill.description
         self.contents.draw_text(36, 96, self.width - 40, 32, text) 
         self.contents.font.color = system_color
         self.contents.draw_text(36, 128, self.width - 40, 32, "-Portée de l'action : ")
         self.contents.font.color = normal_color
         text= draw_scope(@skill.scope)
         self.contents.draw_text(228, 128, self.width - 40, 32, text)
         self.contents.font.color = system_color
         self.contents.draw_text(36, 160, self.width - 40, 32, "-Utilisation : ")
         self.contents.font.color = normal_color
         text= draw_occasion(@skill.occasion)
         self.contents.draw_text(164, 160, self.width - 40, 32, text)
         self.contents.font.color = system_color
         self.contents.draw_text(36, 192, self.width - 40, 32, "-Puissance de l'attaque : ")
         self.contents.font.color = normal_color
         text= @skill.power.to_s
         self.contents.draw_text(296, 192, self.width - 40, 32, text)      
         self.contents.font.color = system_color    
         self.contents.draw_text(36, 228, self.width - 40, 32, "-Eléments : " )  
         self.contents.font.color = normal_color
         for i in 0...skill.element_set.size        
            draw_element_icon(@actor, 152+i*32, 228, skill_id, i)
         end 
         self.contents.font.color = system_color
         self.contents.draw_text(36, 260, self.width - 40, 32, "-Status infligés : ") 
         self.contents.font.color = normal_color     
         for i in 0...skill.plus_state_set .size
            draw_skill_plus_status_icon( 208+i*32, 260 , skill_id, i)         
         end       
         self.contents.font.color = system_color
         self.contents.draw_text(36, 292, self.width - 40, 32, "-Status soignés : ") 
         self.contents.font.color = normal_color     
         for i in 0...skill.minus_state_set .size
            draw_skill_minus_status_icon( 206+i*32, 292 , skill_id, i)         
         end        
      end    
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end


Haut
 Profil  
 
 Sujet du message: Re: [RMXP] Description des skills
MessagePublié: 27 Mai 2009, 20:38 
Villageois (Nv 2)

Inscrit le: 02 Nov 2007, 01:00
Messages: 24
Points d'aide: 0/60

Créations :

Voir ses créations

Script - Partie 2 :

Code: Tout sélectionner
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ? Scene_Skill
#  Modifier par Loup Malade
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class Scene_Skill
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def initialize(actor_index = 0, equip_index = 0)
      @actor_index = actor_index
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def main
      @actor = $game_party.actors[@actor_index]
      @help_window = Window_Help.new
      @status_window = Window_SkillStatus.new(@actor)
      @skill_window = Window_Skill.new(@actor)
      @skill_window.active = false
      @skill_window.help_window = @help_window   
      @target_window = Window_Target.new
      @target_window.visible = false
      @target_window.active = false     
      @skill_window2 = Window_Skill_List.new(@actor)
      @skill_window2.active = false
      @skill_window2.height = 352
      @skill_window2.y = 128  
      @skill_description_window = Window_Skill_Description.new(@actor)
      @skill_description_window.visible = false
      @command = ["Utiliser","Description"]   
      @command_window = Window_Command.new(160, @command)
      @command_window.height = 96
      @command_window.x = 240
      @command_window.y = 160
      @command_window.z = 600
      @command_window.active = true
      @command_window.visible = true
      # ?????????
      Graphics.transition
      # ??????
      loop do
         # ????????
         Graphics.update
         # ???????
         Input.update
         # ??????
         update
         # ????????????????
         if $scene != self
            break
         end
      end
      # ?????????
      Graphics.freeze
      # ????????
      @help_window.dispose
      @status_window.dispose
      @skill_window.dispose
      @target_window.dispose
      @command_window.dispose
      @skill_description_window.dispose
      @skill_window2.dispose
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update
      # ????????
      @help_window.update
      @status_window.update
      @skill_window.update
      @target_window.update
      @command_window.update
      @skill_description_window.update
      @skill_window2.update
      if @skill_window.active
         update_skill
         return
      end 
      if @target_window.active
         update_target
         return
      end
      if @command_window.active
         update_command
         return
      end
      if @skill_window2.active 
         update_skill2
         return   
      end
      if @skill_description_window.visible
         update_description
         return   
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_command 
      if(@command_window.index == 0 )
         @skill_window.visible = true
         @skill_window2.visible = false     
      else
         @skill_window.visible = false
         @skill_window2.visible = true
      end   
      if Input.trigger?(Input::B)
         $game_system.se_play($data_system.cancel_se)
         $scene = Scene_Menu.new(1)
         return
      end
      if Input.trigger?(Input::C)
         case @command_window.index   
            when 0      
               @command_window.active = false   
               @command_window.visible = false
               @skill_window.active = true       
               @status_window.refresh
               $game_system.se_play($data_system.decision_se)
            when 1
               @command_window.active = false
               @command_window.visible = false
               @skill_window2.active = true
               @status_window.refresh
               $game_system.se_play($data_system.decision_se)       
         end
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_skill
      # B ??????????
      if Input.trigger?(Input::B)
         # ????? SE ???     
         $game_system.se_play($data_system.cancel_se)
         # ???????????
         @command_window.active = true
         @command_window.visible = true
         @skill_window.active = false
         return
      end
      # C ??????????
      if Input.trigger?(Input::C)
         # ????????????????????????
         @skill = @skill_window.skill
         # ????????
         if @skill == nil or not @actor.skill_can_use?(@skill.id)
            # ??? SE ???
            $game_system.se_play($data_system.buzzer_se)
            return
         end
         # ?? SE ???
         $game_system.se_play($data_system.decision_se)
         # ??????????
         if @skill.scope >= 3
            # ?????????????????
            @skill_window.active = false
            @target_window.x = (@skill_window.index + 1) % 2 * 304
            @target_window.visible = true
            @target_window.active = true
            # ???? (??/??) ?????????????
            if @skill.scope == 4 || @skill.scope == 6
               @target_window.index = -1
            elsif @skill.scope == 7
               @target_window.index = @actor_index - 10
            else
               @target_window.index = 0
            end
            # ????????????
         else
            # ??????? ID ??????
            if @skill.common_event_id > 0
               # ?????????????
               $game_temp.common_event_id = @skill.common_event_id
               # ??????? SE ???
               $game_system.se_play(@skill.menu_se)
               # SP ??
               @actor.sp -= @skill.sp_cost
               # ?????????????
               @status_window.refresh
               @skill_window.refresh
               @target_window.refresh
               # ??????????
               $scene = Scene_Map.new
               return
            end
         end
         return
      end
      # R ??????????
      if Input.trigger?(Input::R)
         # ???? SE ???
         $game_system.se_play($data_system.cursor_se)
         # ???????
         @actor_index += 1
         @actor_index %= $game_party.actors.size
         # ????????????
         $scene = Scene_Skill.new(@actor_index)
         return
      end
      # L ??????????
      if Input.trigger?(Input::L)
         # ???? SE ???
         $game_system.se_play($data_system.cursor_se)
         # ???????
         @actor_index += $game_party.actors.size - 1
         @actor_index %= $game_party.actors.size
         # ????????????
         $scene = Scene_Skill.new(@actor_index)
         return
      end
   end 
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_skill2
      # B ??????????
      if Input.trigger?(Input::B)
         # ????? SE ???     
         $game_system.se_play($data_system.cancel_se)
         # ???????????
         @command_window.active = true
         @command_window.visible = true
         @skill_window2.active = false      
         return
      end
      # C ??????????
      if Input.trigger?(Input::C)
         # ????????????????????????
         @skill = @skill_window2.skill
         # ????????
         # ?? SE ???
         $game_system.se_play($data_system.decision_se)
         # ??????????
         # ?????????????????
         @skill_window2.active = false
         @skill_description_window.skill = @skill
         @skill_description_window.visible = true
         @skill_description_window.z = 1000
         @skill_description_window.refresh
         # ???? (??/??) ?????????????
         return
      end
      # R ??????????
      if Input.trigger?(Input::R)
         # ???? SE ???
         $game_system.se_play($data_system.cursor_se)
         # ???????
         @actor_index += 1
         @actor_index %= $game_party.actors.size
         # ????????????
         $scene = Scene_Skill.new(@actor_index)
         return
      end   
      # L ??????????
      if Input.trigger?(Input::L)
         # ???? SE ???
         $game_system.se_play($data_system.cursor_se)
         # ???????
         @actor_index += $game_party.actors.size - 1
         @actor_index %= $game_party.actors.size
         # ????????????
         $scene = Scene_Skill.new(@actor_index)
         return
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_description
      if Input.trigger?(Input::B)
         $game_system.se_play($data_system.cancel_se)
         @skill_window2.active = true
         @skill_description_window.visible = false
         @skill_description_window.z = 0
         @status_window.z = 500
      end   
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   def update_target
      # B ??????????
      if Input.trigger?(Input::B)
         # ????? SE ???
         $game_system.se_play($data_system.cancel_se)
         # ?????????????
         @skill_window.active = true
         @target_window.visible = false
         @target_window.active = false
         return
      end
      # C ??????????
      if Input.trigger?(Input::C)
         # SP ????????????????
         unless @actor.skill_can_use?(@skill.id)
            # ??? SE ???
            $game_system.se_play($data_system.buzzer_se)
            return
         end
         # ???????????
         if @target_window.index == -1
            # ??????????????????
            used = false
            for i in $game_party.actors
               used |= i.skill_effect(@actor, @skill)
            end
         end
         # ????????????
         if @target_window.index <= -2
            # ??????????????????????
            target = $game_party.actors[@target_window.index + 10]
            used = target.skill_effect(@actor, @skill)
         end
         # ???????????
         if @target_window.index >= 0
            # ??????????????????????
            target = $game_party.actors[@target_window.index]
            used = target.skill_effect(@actor, @skill)
         end
         # ?????????
         if used
            # ??????? SE ???
            $game_system.se_play(@skill.menu_se)
            # SP ??
            @actor.sp -= @skill.sp_cost
            # ?????????????
            @status_window.refresh
            @skill_window.refresh
            @target_window.refresh
            # ?????
            if $game_party.all_dead?
               # ??????????????
               $scene = Scene_Gameover.new
               return
            end
            # ??????? ID ??????
            if @skill.common_event_id > 0
               # ?????????????
               $game_temp.common_event_id = @skill.common_event_id
               # ??????????
               $scene = Scene_Map.new
               return
            end
         end
         # ????????????
         unless used
            # ??? SE ???
            $game_system.se_play($data_system.buzzer_se)
         end
         return
      end
   end
   # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 3 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728