Sujet n°9153
Posté par Disccat le 8 Fév - 00:31 (2011)
Titre : [résolu] Tempête de sable
Une modeste demande de ma part pour les scripteurs. J'ai bidouillé un peu la nouvelle Capacité Spéciale (de mon projet), nommée "ALEA-CLIMAT", qui comme son nom l'indique à peu près, invoque une météo aléatoire. Ma demande est simple; Le Pokémon disposant de cette Capacité Spéciale ne doit pas être affecté par la tempête de sable, ni la grêle. Hors, mon bidouillage fonctionne avec la grêle, mais pas avec la tempête de sable. Je vous laisse observer la partie de script ci-dessous:


Script

      # Tempete de sable
      if $battle_var.sandstorm? and count != 0
        draw_text("La tempête de sable souffle.")
        animation = $data_animations[494]
        @actor_sprite.animation(animation, true)
        loop do
          @actor_sprite.update
          Graphics.update
          Input.update
          if not(@actor_sprite.effect?) #and Input.trigger?(Input::C)
            break
          end
        end
       
        # Dégats
        for array in list
          target = array[0]
          target_sprite = array[1]
          target_status = array[2]
          if target.type_ground? or target.type_rock? or target.type_steel?
              target.effect_list.include?(0x9B0) or target.effect_list.include?(0x9B3) or
              target.ability == 8  or target.ability == 125
            next
          end
          damage = target.max_hp / 16
          heal(target, target_sprite, target_status, -damage)
        end
      elsif $battle_var.sandstorm? and count == 0
        draw_text("La tempête de sable s'est arretée.")
        wait(40)
        $battle_var.reset_weather
      end
     
      # Grêle
      if $battle_var.hail? and count > 0
        draw_text("Il grêle...")
        animation = $data_animations[495]
        @actor_sprite.animation(animation, true)
        loop do
          @actor_sprite.update
          Graphics.update
          Input.update
          if not(@actor_sprite.effect?) #and Input.trigger?(Input::C)
            break
          end
        end
       
        # Dégâts
        for array in list
          target = array[0]
          target_sprite = array[1]
          target_status = array[2]
          if target.type_ice? or
              target.effect_list.include?(0x9B0) or target.effect_list.include?(0x9B3) or
              target.ability == 125
            next
          end
          damage = target.max_hp / 16
          heal(target, target_sprite, target_status, -damage)
        end
      elsif $battle_var.hail? and count == 0
        draw_text("La grêle s'est arrêtée.")
        wait(40)
        $battle_var.reset_weather
      end
     
    end


125 est l'ID de la Capacité Spéciale, et évidemment, je n'ai donné que la partie de script concernée par le problème.

Si vous manquez d'indications, dîtes-le moi, après tout, je suis encore loin de maîtriser les scripts.

Mémo perso: Ligne 1075 Pokemon_Battle_Core_1

ÉDIT: Effectivement, c'est ce "or" qui manquait, merci Sphinx! ^^ .

Posté par Sphinx le 10 Fév - 17:24 (2011)
Je ne pense pas dire de bêtises en affirmant qu'il doit te manquer un or à la fin de :
Code:
if target.type_ground? or target.type_rock? or target.type_steel? # <=== CETTE LIGNE
     target.effect_list.include?(0x9B0) or target.effect_list.include?(0x9B3) or
     target.ability == 8  or target.ability == 125


^o^ Ca rédoudra peut être ton pb, sinon n'hésite pas à repasser :p