✓ ESS20-21 如何添加旋转瓷砖脚本?

kshufo168

精英训练家
2023/04/15
6
0
535
36
我在eeveeexpo只找到17.2的插件不知道在21.1里起不起作用。求解
 

komeiji514

馆主
2022/09/01
107
1
14
775
20
放个port在这。
Ruby:
module GameData
  class TerrainTag
    attr_reader :spin_tile

    alias spin_initialize initialize
    def initialize(hash)
      spin_initialize(hash)
      @spin_tile = hash[:spin_tile]  || false
    end
  end
end

# 可根据自身需求重新编辑地形标签的ID。
GameData::TerrainTag.register({
  :id                     => :SpinTileUp,
  :id_number              => 41,
  :spin_tile              => true
})

GameData::TerrainTag.register({
  :id                     => :SpinTileDown,
  :id_number              => 42,
  :spin_tile              => true
})

GameData::TerrainTag.register({
  :id                     => :SpinTileLeft,
  :id_number              => 43,
  :spin_tile              => true
})

GameData::TerrainTag.register({
  :id                     => :SpinTileRight,
  :id_number              => 44,
  :spin_tile              => true
})

GameData::TerrainTag.register({
  :id                     => :SpinTileStop,
  :id_number              => 45
})

class PokemonGlobalMetadata
  attr_accessor :spinning
  alias spin_initialize initialize
  def initialize
    spin_initialize
    @spinning = false
  end
end

EventHandlers.add(:on_step_taken, :spin_tile,
  proc { |event|
    next if !$scene.is_a?(Scene_Map)
    next if event != $game_player
    currentTag = $game_player.pbTerrainTag
    if currentTag.spin_tile
      pbSpinTile
    end
  }
)

def pbSpinTile 
  tag = $game_player.pbTerrainTag
  return if !tag.spin_tile
  oldwalkanime = $game_player.walk_anime
  $game_player.move_speed == 1
  if !$PokemonGlobal.spinning
    $game_player.straighten
  end
  $game_player.walk_anime = false
    case tag.id
    when :SpinTileUp
      $game_player.turn_up     
      $game_player.pattern = 2 if !$PokemonGlobal.spinning
    when :SpinTileDown
      $game_player.turn_down
      $game_player.pattern = 0 if !$PokemonGlobal.spinning
    when :SpinTileRight
      $game_player.turn_right
      $game_player.pattern = 1 if !$PokemonGlobal.spinning
    when :SpinTileLeft
      $game_player.turn_left
      $game_player.pattern = 3 if !$PokemonGlobal.spinning
    end
  $game_player.walk_anime = true
  $PokemonGlobal.spinning = true
  loop do
    break if !$game_player.passable?($game_player.x, $game_player.y, $game_player.direction)
    break if tag.id == :SpinTileStop
    case tag.id
    when :SpinTileUp
      $game_player.turn_up
    when :SpinTileDown
      $game_player.turn_down
    when :SpinTileRight
      $game_player.turn_right
    when :SpinTileLeft
      $game_player.turn_left
    end
    $game_player.move_forward
    while $game_player.moving?
      Graphics.update
      Input.update
      pbUpdateSceneMap
    end
  end 
  $game_player.center($game_player.x, $game_player.y)
  $game_player.walk_anime = oldwalkanime 
  $PokemonGlobal.spinning = false
end
 

在线成员

现在没有成员在线。

最新帖子

论坛统计

主题
517
消息
2,352
成员
3,007
最新成员
ZQLdw