| 
 
| 赞 | 120 |  
| VIP | 13 |  
| 好人卡 | 16 |  
| 积分 | 194 |  
| 经验 | 38692 |  
| 最后登录 | 2025-10-17 |  
| 在线时间 | 3082 小时 |  
 Lv4.逐梦者 
	梦石0 星屑19416 在线时间3082 小时注册时间2013-1-11帖子1289 | 
| 本帖最后由 张咚咚 于 2017-7-16 14:53 编辑 
 复制代码#==================================
#    腳本名:持有特定武器時格檔敵人攻擊
#
#    作者:QQ蚊子湯
#  https://rpg.blue/home.php?mod=space&uid=2658226
#  請勿刪除作者訊息
#  不限遊戲類型
#  不需要報告
#  可以改造
#  改造並保留作者訊息可以二次發布
#===================================以下設定
$QQweaponss = [1,2]    #武器編號 (複數武器警加逗號, )
QQne = true           #是否在格檔時播放效果音 關:false 開:true
$QQSE = "Cat.ogg"         #格檔時的效果音檔名(請加副檔名)
$QQmesegiT = "拦截!"    #格檔時的文字提示(請使用雙引號 "像這樣") 
$QQanimation = 1 #显示动画ID
$QQrand = 100            #格檔機率 100=100%發動  20=20%發動
#======================================設定到此為止
$QQmesegi=0
class Game_Battler < Game_BattlerBase
alias QQ16_9_29_1 make_damage_value
def make_damage_value(user, item)
    value = item.damage.eval(user, self, $game_variables)
    if item.is_a?(RPG::Skill)
      if !user.is_a?(Game_Actor)
        for $QQweapons in $QQweaponss
      if self.weapons.include?($data_weapons[$QQweapons])&&rand(100) < $QQrand
        value = 0
        $QQmesegi=1
        end
    end
      end
end
    value *= item_element_rate(user, item)
    value *= pdr if item.physical?
    value *= mdr if item.magical?
    value *= rec if item.damage.recover?
    value = apply_critical(value) if @result.critical
    value = apply_variance(value, item.damage.variance)
    value = apply_guard(value)
    @result.make_damage(value.to_i, item)
  end
end
class Window_BattleLog < Window_Selectable
alias QQ16_9_29_2 display_hp_damage
     def display_hp_damage(target, item)
    return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
    if target.result.hp_damage > 0 && target.result.hp_drain == 0
      target.perform_damage_effect
    end
if $QQmesegi==1
    #add_text($QQmesegiT);
    $QQmesegi=0
    $动画.start_animation($data_animations[$QQanimation])
    if QQne ==true
      Audio.se_play("Audio/SE/" + $QQSE , 80, 100)
    end
      end
    Sound.play_recovery if target.result.hp_damage < 0
    add_text(target.result.hp_damage_text)
    wait
  end
end
class Sprite_Battler < Sprite_Base
  #初始化
  alias qqeat_initialize initialize
  def initialize(viewport, battler = nil)
    qqeat_initialize(viewport, battler)
    $动画 = Sprite_Base.new
    $动画.x = 60
    $动画.y = 60
  end
  #释放
  alias qqeat_dispose dispose
  def dispose
    qqeat_dispose
    $动画.dispose
  end
  #更新
  alias qqeat_update update
  def update
    qqeat_update 
    $动画.update if $动画 != nil
  end
end
 | 
 |