rpgmakervxace吧 关注:17,919贴子:51,410
  • 14回复贴,共1

萌新问一个技能的问题

只看楼主收藏回复

就是那种需要一回合蓄力然后学习另一个强力技能并自动释放,那怎么才能让这个强力技能在释放过后自动消失呢


IP属地:广东来自Android客户端1楼2022-05-18 20:42回复
    没看明白你的需求,凭猜测给你解答一下:
    在一技能上加公共事件,添加技能二,删除技能一,打开开关X。
    在二技能后面加公共事件,删除技能二,添加技能一,并关闭开关X。
    开关可能不是必须的。


    IP属地:浙江来自Android客户端3楼2022-05-19 06:45
    收起回复
      2025-12-26 14:43:45
      广告
      不感兴趣
      开通SVIP免广告
      #==============================================================================
      # F01 - 细节美化 - By芙蕾娅
      #------------------------------------------------------------------------------
      #  ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
      #==============================================================================
      module Freya
      # 值槽的种类
      # 0 = 默认
      # 1 = 描绘边框
      # 2 = 渐变
      # 3 = 描绘边框 + 渐变
      Gauge_Type = 3
      end
      #==============================================================================
      # ■ Window_Base
      #------------------------------------------------------------------------------
      #  游戏中所有窗口的父类
      #==============================================================================
      class Window_Base < Window
      #--------------------------------------------------------------------------
      # ☆ 放大字体尺寸
      # 放大字体尺寸从8更改为4
      #--------------------------------------------------------------------------
      def make_font_bigger
      contents.font.size += 4 if contents.font.size <= 64
      end
      #--------------------------------------------------------------------------
      # ☆ 缩小字体尺寸
      # 缩小字体尺寸从8更改为4
      #--------------------------------------------------------------------------
      def make_font_smaller
      contents.font.size -= 4 if contents.font.size >= 16
      end
      #--------------------------------------------------------------------------
      # ☆ 绘制值槽
      # rate : 比率(1.0 为满值)
      # color1 : 渐变色的左端
      # color2 : 渐变色的右端
      # 增加了绘制种类
      #--------------------------------------------------------------------------
      def draw_gauge(x, y, width, rate, color1, color2)
      if Freya::Gauge_Type == 0
      fill_w = (width * rate).to_i
      gauge_y = y + line_height - 8
      contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
      contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
      elsif Freya::Gauge_Type == 1
      fill_w = ((width - 2) * rate).to_i
      gauge_y = y + line_height - 8
      contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
      contents.gradient_fill_rect(x + 1, gauge_y + 1, fill_w, 4, color1, color2)
      elsif Freya::Gauge_Type == 2
      fill_w = ((width) * rate).to_i
      gauge_y = y + line_height - 8
      contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
      contents.gradient_fill_rect(x, gauge_y, fill_w / 2, 6, color1, color2)
      contents.gradient_fill_rect(x + fill_w / 2, gauge_y, fill_w / 2, 6, color2, color1)
      elsif Freya::Gauge_Type == 3
      fill_w = ((width - 2) * rate).to_i
      gauge_y = y + line_height - 8
      contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
      contents.gradient_fill_rect(x + 1, gauge_y + 1, fill_w / 2, 4, color1, color2)
      contents.gradient_fill_rect(x + 1 + fill_w / 2, gauge_y + 1, fill_w / 2, 4, color2, color1)
      end
      end
      #--------------------------------------------------------------------------
      # ☆ 以 当前值/最大值 这样的分数形式绘制当前值和最大值
      # current : 当前值
      # max : 最大值
      # color1 : 当前值的颜色
      # color2 : 最大值的颜色
      # 稍微缩小字体大小,移动一些坐标
      #--------------------------------------------------------------------------
      def draw_current_and_max_values(x, y, width, current, max, color1, color2)
      change_color(color1)
      xr = x + width
      contents.font.size = 15
      if width < 96
      draw_text(xr - 40, y, 42, line_height, current, 2)
      else
      draw_text(xr - 92, y, 42, line_height, current, 2)
      change_color(color2)
      draw_text(xr - 52, y, 12, line_height, "/", 2)
      draw_text(xr - 42, y, 42, line_height, max, 2)
      end
      contents.font.size = Font.default_size
      end
      end


      IP属地:浙江4楼2022-05-20 08:31
      回复
        #==============================================================================
        # F08 - 战斗敌人显示血条 - By芙蕾娅
        #------------------------------------------------------------------------------
        #  ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
        #==============================================================================
        module Freya
        # 隐藏HP的文本
        HideGaugeText = "Hide_Gauge"
        # 血条颜色
        EnemyHPGaugeColor1 = Color.new(64,128,96)
        EnemyHPGaugeColor2 = Color.new(96,192,160)
        end
        #==============================================================================
        # ■ Sprite_Battler_HP
        #------------------------------------------------------------------------------
        #  显示战斗者的生命在战斗者的精灵下面。
        #==============================================================================
        class Sprite_Battler_HP < Sprite
        #--------------------------------------------------------------------------
        # ● 初始化对象
        #--------------------------------------------------------------------------
        def initialize(viewport,battler)
        super(viewport)
        @battler = battler
        @last_hp = 0
        create_bitmap
        update
        end
        #--------------------------------------------------------------------------
        # ● 释放
        #--------------------------------------------------------------------------
        def dispose
        self.bitmap.dispose
        super
        end
        #--------------------------------------------------------------------------
        # ● 生成位图
        #--------------------------------------------------------------------------
        def create_bitmap
        @last_hp = @battler.hp
        bw = 96
        bh = 6
        self.bitmap = Bitmap.new(bw, bh)
        self.bitmap.fill_rect(0, 0, bw, bh, Color.new(32,32,64))
        if Freya::Gauge_Type.nil? or Freya::Gauge_Type == 0
        hp = ((bw) * @battler.hp_rate).to_i
        self.bitmap.gradient_fill_rect(0, 0, hp, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
        elsif Freya::Gauge_Type == 1
        hp = ((width - 2) * @battler.hp_rate).to_i
        self.bitmap.gradient_fill_rect(1, 1, hp, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
        elsif Freya::Gauge_Type == 2
        hp = ((width) * @battler.hp_rate).to_i
        self.bitmap.gradient_fill_rect(0, 0, hp / 2, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
        self.bitmap.gradient_fill_rect(hp / 2, 0, hp / 2, bh, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
        elsif Freya::Gauge_Type == 3
        hp = ((width - 2) * @battler.hp_rate).to_i
        self.bitmap.gradient_fill_rect(1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
        self.bitmap.gradient_fill_rect((hp / 2) + 1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
        end
        end
        #--------------------------------------------------------------------------
        # ● 更新画面
        #--------------------------------------------------------------------------
        def update
        super
        unless self.bitmap.nil?
        self.x = @battler.screen_x - self.width / 2
        self.y = @battler.screen_y
        create_bitmap if @last_hp != @battler.hp
        hide = $data_enemies[@battler.enemy_id].note.include?(Freya::HideGaugeText)
        if @battler.hp == 0 or hide
        self.opacity = 0
        elsif @battler.hp > 0 && !hide
        self.opacity = 255
        end
        end
        end
        end
        #==============================================================================
        # ■ Sprite_Battler
        #------------------------------------------------------------------------------
        #  显示战斗者的精灵。根据 Game_Battler 类的实例自动变化。
        #==============================================================================
        class Sprite_Battler < Sprite_Base
        #--------------------------------------------------------------------------
        # ☆ 初始化对象
        #--------------------------------------------------------------------------
        alias initialize_freya_enemy_hp initialize
        def initialize(viewport, battler = nil)
        initialize_freya_enemy_hp(viewport, battler)
        if @battler.is_a?(Game_Enemy)
        @hp_gauge = Sprite_Battler_HP.new(viewport, battler)
        end
        end
        #--------------------------------------------------------------------------
        # ☆ 释放
        #--------------------------------------------------------------------------
        alias dispose_freya_enemy_hp dispose
        def dispose
        dispose_freya_enemy_hp
        unless @hp_gauge.nil?
        @hp_gauge.dispose
        end
        end
        #--------------------------------------------------------------------------
        # ☆ 更新画面
        #--------------------------------------------------------------------------
        alias update_freya_enemy_hp update
        def update
        update_freya_enemy_hp
        @hp_gauge.update unless @hp_gauge.nil?
        end
        end


        IP属地:浙江5楼2022-05-20 08:32
        回复
          显示敌人血量,把上面两个脚本,添加到Main之上。
          另外,提问题请清晰明确的表达你的需求。


          IP属地:浙江6楼2022-05-20 08:34
          收起回复