MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
188
First Language
Meowish
Primarily Uses
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:

[1] Infective States

[2] Re-infective (renewing state timer)

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

How to Use:

[1] Paste the script below Material and above Main

[2] 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:

Code:
#==============================================================================# ■ Meow Face Infective States#------------------------------------------------------------------------------# Randomly infect another character at each turn's end#==============================================================================module SICKMEOW #DO NOT REMOVE!#==============================================================================# Settings Area#==============================================================================  STATES = [28,3,5,6] #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[target].add_state(state.id)        elsif enemy?          $game_troop.members[etarget].add_state(state.id)        end      end    end  endend
 
Last edited by a moderator:

ovate

tale
Veteran
Joined
Dec 16, 2016
Messages
1,046
Reaction score
1,694
First Language
English
Primarily Uses
N/A
Fixed script format, credit Meow Face.
Code:
#==============================================================================
# ■ Meow Face Infective States
#------------------------------------------------------------------------------
# Randomly infect another character at each turn's end
#==============================================================================
module SICKMEOW
#DO NOT REMOVE!
#==============================================================================
# Settings Area
#============================================================================== 
STATES = [28,3,5,6] #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!
#==============================================================================
end
class 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[target].add_state(state.id)       
        elsif enemy?         
          $game_troop.members[etarget].add_state(state.id)       
        end
      end   
    end 
  end
 end
 

Latest Threads

Latest Posts

Latest Profile Posts

Messed up the chains... :kaoback:
Sw7U8dA.jpg

Character: Jeanne D'Arc from Fate/Apocrypha.
Neptrone wrote on Andar's profile.
Hello Andar, i just saw you created a lot of helpful thread in the past regarding RPG, genre, game design, etc, etc.

Do you have full collection or list about every useful thread that you made in the past ? I think it would be very useful for me.


Thanks :)
I-G-M-C, I-G-M-C!
To be honest, I had no idea what this was until now haha. But it looks fun, so my main game is on hold for a month while I participate! :yhappy:
Going live for tonight's Rise of the Third Power! Twitch

Forum statistics

Threads
123,246
Messages
1,155,206
Members
161,631
Latest member
OscarNuWar
Top