[VX] Chodzenie - Wersja do druku
Ultima Forum
[VX] Chodzenie - Wersja do druku

+- Ultima Forum (https://forum.ultimateam.pl)
+-- Dział: RPG Maker (/Forum-RPG-Maker)
+--- Dział: Wsparcie (/Forum-Wsparcie)
+--- Wątek: [VX] Chodzenie (/Thread-VX-Chodzenie)



Chodzenie - Diablo - 04-04-15 15:52

To pytanie zapewne znów do Ayene xD Otóż korzystam z ABSa i jest skrypt o takiej treści:

Kod:
# State Patch by IceDragon
class Game_Character
  
  #--------------------------------------------------------------------------#
  # * New Method - Can Move?
  #--------------------------------------------------------------------------#
  # By Default this was true
  #--------------------------------------------------------------------------#
  def iex_ygg_can_move?
    return true if iex_ygg_attacker == nil
    return false unless iex_ygg_attacker.movable?
    return true
  end
  
  #--------------------------------------------------------------------------#
  # * New Method - Can Attack?
  #--------------------------------------------------------------------------#
  # By Default this was true
  #--------------------------------------------------------------------------#
  def iex_ygg_can_attack?
    return true if iex_ygg_attacker == nil
    return false unless iex_ygg_attacker.movable?
    return true
  end  
  
  alias iex_ygg_states_update update unless $@
  def update
    if $game_system.iex_yggdrasil_on?
      if iex_ygg_attacker != nil
        @confusion_time_out = 0 if @confusion_time_out == nil
        @confusion_time_out -= 1 unless @confusion_time_out == 0
        if iex_ygg_attacker.confusion?
          if @confusion_move_route == nil
            @confusion_move_route = RPG::MoveRoute.new
            (4).times do
              @confusion_move_route.list << RPG::MoveCommand.new(9)
            end
            @confusion_move_route.list << RPG::MoveCommand.new(0)
          end  
          if @confusion_time_out <= 0
            @confusion_move_route.repeat = false
            #@confusion_move_route.skippable = true
            force_move_route(@confusion_move_route)
            @confusion_time_out = 120
          end  
        end  
      end  
    end  
    iex_ygg_states_update
  end
  
end  

#~ unless $imported["BattleEngineMelody"]
#~   class RPG::State
#~    
#~     def iex_ygg_st_cache
#~       @state_ani = 0
#~       self.note.split(/[\r\n]+/).each { |line|
#~       case line
#~       when /<(?:STATE_ANIMATION|state animation|state ani):[ ]*(\d+)>/i
#~         @state_ani = $1.to_i
#~       end  
#~       }
#~     end
#~  
#~     def state_ani
#~       iex_ygg_st_cache if @state_ani == nil
#~       return @state_ani
#~     end
#~    
#~   end
#~ end  

#~ class Game_Battler
#~  
#~   def getStateAnim
#~     for state in states
#~       next unless state.state_ani > 0
#~       return state.state_ani
#~       break
#~     end
#~     return 0
#~   end
#~  
#~ end
#~ class Sprite_Character < Sprite_Base
#~  
#~   alias iex_ygg_states_spc_initialize initialize unless $@
#~   def initialize(*args)
#~     iex_ygg_states_spc_initialize(*args)
#~     @ygg_state_anim = IEX_Ygg_Anim.new(0, self.viewport)
#~     @ygg_state_anim.iex_ygg_setup_anim(@character.x, @character.y, true)
#~     @last_state_anim = 0
#~   end
#~  
#~   alias iex_ygg_states_spc_dispose dispose unless $@
#~   def dispose(*args)
#~     iex_ygg_states_spc_dispose(*args)
#~     if @ygg_state_anim != nil
#~       @ygg_state_anim.dispose
#~     end  
#~   end
#~  
#~   alias iex_ygg_states_spc_update update unless $@
#~   def update
#~     ygg_updateStateAnim
#~     iex_ygg_states_spc_update
#~   end
#~  
#~   def ygg_updateStateAnim
#~     if @ygg_state_anim != nil
#~       return if @ygg_state_anim.disposed?
#~       anim_id = 0
#~       if @character.iex_ygg_attacker != nil
#~         anim_id = @character.iex_ygg_attacker.getStateAnim
#~       end  
#~       if @last_state_anim != anim_id
#~         @ygg_state_anim.looped_anim = false
#~         @ygg_state_anim.iex_play_anim(anim_id)  
#~         if anim_id > 0
#~           @ygg_state_anim.looped_anim = true
#~         end  
#~         @last_state_anim = anim_id
#~       end  
#~       @ygg_state_anim.synchWithCharacter(@character)
#~     end  
#~   end
#~  
#~ end

Wnioskuje, że to w nim ustalono, że jeśli status nie pozwala na ruch, to nie można też atakować. Jesli to wykonalne, proszę o zmianę, aby można było atakować, ale nie można się ruszać kiedy stan (np. paraliż) tego zabrania.

Z góry dziękuję ;)


RE: Chodzenie - Ayene - 04-04-15 16:29

Spróbuj w fragmencie:
Kod:
def iex_ygg_can_attack?
    return true if iex_ygg_attacker == nil
    return false unless iex_ygg_attacker.movable?
    return true
  end
usunąć linijkę:
Kod:
return false unless iex_ygg_attacker.movable?



RE: Chodzenie - Diablo - 04-04-15 17:08

Dziękuję Ayene ;) Jesteś wielka ;)