じ☆ve冰风 发表于 前天 15:19

CriticalAlert VX

CriticalAlert VX

by Kyonides​

Introduction

This scriptlet allows you to let the game call a preset common event whenever an actor or an enemy strikes the foe with a critical hit. The only thing you have to do is setting the appropriate common event ID's and that's it, guys!


The Script
                Ruby:        
# * CriticalAlert VX * #
#   Scripter : Kyonides Arkanthes
#   2023-06-06

# This scriptlet focuses on the attacker aka spellcaster.

module CriticalAlert
ACTOR_COMMON_EVENT_ID = 1
ENEMY_COMMON_EVENT_ID = 2
end

class Game_Battler
alias :kyon_critical_alert_gm_bltr_exec_dmg :execute_damage
def execute_damage(user)
    kyon_critical_alert_gm_bltr_exec_dmg(user)
    critical_hit_reserve_common_event(user)
end

def critical_hit_reserve_common_event(user)
    return unless @critical
    if user.is_a?(Game_Actor)
      event_id = CriticalAlert::ACTOR_COMMON_EVENT_ID
    else
      event_id = CriticalAlert::ENEMY_COMMON_EVENT_ID
    end
    $game_temp.common_event_id = event_id
end
end


Terms & Conditions

Free for use in any game.
Don't buy cat treats for a week!

That's it!


本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/criticalalert-vx.158112/
页: [1]
查看完整版本: CriticalAlert VX