じ☆ve冰风 发表于 2026-8-2 10:35:31

Infective States

Made for a request here.

This script allows the "infection" of states.

Actor/Enemy will spread the infection to one of their party member at each turn's end.

Features:

Infective States

Re-infective (renewing state timer)

Able to set chance of infection for each turn's end

How to Use:

Paste the script below Material and above Main

Set up the infective state ids in the script's setting area

Compatibility:

This script uses alias method, it's unlikely to conflict with other scripts.

If you find it not working, simply put it below other custom scripts.

Terms of Use:

Free for both commercial and non-commercial

Script:

Spoiler                Code:       
#==============================================================================# ■ Meow Face Infective States#------------------------------------------------------------------------------# Randomly infect another character at each turn's end#==============================================================================module SICKMEOW #DO NOT REMOVE!#==============================================================================# Settings Area#==============================================================================  STATES = #State IDs that are infective  CHANCE = 2 # 1/X rate of infect chance (eg, 1/2 = 50%)#==============================================================================# End of Settings Area# Edit anything past this line at your own risk!#==============================================================================endclass Game_Battler < Game_BattlerBase  alias on_meow_end on_turn_end  def on_turn_end    on_meow_end    sick = SICKMEOW::STATES    target = rand($game_party.battle_members.size)    etarget = rand($game_troop.members.size)    states.each do |state|      if sick.include?(state.id) && rand(SICKMEOW::CHANCE) == 0        if actor?          $game_party.battle_members.add_state(state.id)        elsif enemy?          $game_troop.members.add_state(state.id)        end      end    end  endend








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