Adding state to the damage owner?

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
Hi guys,

I want to make a skill like this:

- This skill applies a state called "Corrosive Skin" (for example) to an allied unit.

- When the unit having the state "Corrosive Skin" is taking damage from an enemy, there is a chance (15% for example) that another state will be applied to the damage dealer like "Poisoned" (for example).

That's all i want to do, but i haven't found a script to do that so i hope you can help me about this. Thank you :D
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
In the damage formula:

Code:
b.add_state(3) if b.state?(2); damage
where 3 is the 'corrosive skin' state (the one you want them to already have), 2 is the 'poisoned' state (the new one you want to add), and 'damage' is the actual damage formula to calculate how much damage will be applied whether they have the state or not.
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
Thank you for your answer but it is not what i mean. Because i can't change all the damage formulas of all my skills or if i had many states that do the same way, the damage formulas would be really long and confusing.

So i think if there is a script for this should be useful. I have found a script of Victor but instead of adding state to the damage dealer, it adds state to the damage taken unit so sadly it does not match my requirement.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


You will need to specify how many of these options you want to have, and if they will always behave in the same way. Do you JUST want it to look for one particular state, and if the target has that state, add one other particular state? Or do you want multiples of these combinations? Do you always want it to ADD the second state if the first one already exists, or do you want the ability to change that sometimes (like maybe remove a state if it exists)?


If you want a script written, you need to be VERY specific about how it needs to work.
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
I will pay more attention when posting new thread next time.

It will be nice if the script can work like the "Action States" script from Victor Sant below: 

#==============================================================================# ** Victor Engine - Action States#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2012.07.16 > First release# v 1.01 - 2012.07.30 > Fixed issue that made the game crash when attacking# v 1.02 - 2012.08.03 > Fixed issue with skill and item type changes#------------------------------------------------------------------------------# This script allows to setup a trait that allows to change the battlers# states when hit with a specific action.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.19 or higher## * Alias methods# class Game_Battler < Game_BattlerBase# def make_damage_value(user, item)##------------------------------------------------------------------------------# Instructions:# To instal the script, open you script editor and paste this script on# a new section bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Actors, Classes, Enemies, Weapons, Armors and States note tags:# Tags to be used on Actors, Classes, Enemies, Weapons, Armors and States# note boxes.# # <skill state add x: y> <item state add x: y># <skill state add x: y, z%> <item state add x: y, z%># Setup the skill or item and the state added when hit by the action# x : ID of the action# y : state ID# z : chance of happening (100% if not set)## <skill state remove x: y> <item state remove x: y># <skill state remove x: y, z%> <item state remove x: y, z%># Setup the skill or item and the state removed when hit by the action# x : ID of the action# y : state ID# z : chance of happening (100% if not set)## <skill type state add x: y> <item type state add x: y># <skill type state add x: y, z%> <item type state add x: y, z%># Setup the skill or item and the state added when hit by the action# x : ID of the action# y : state ID# z : chance of happening (100% if not set)## <skill type state remove x: y> <item type state remove x: y># <skill type state remove x: y, z%> <item type state remove x: y, z%># Setup the skill or item and the state removed when hit by the action# x : ID of the action# y : state ID# z : chance of happening (100% if not set)##------------------------------------------------------------------------------# Additional instructions:## States resistances are still valid, so even an 100% rate will not ensure# that the state is applied if the target is resistant to that state.#==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_action_states] = 1.02Victor_Engine.required:)ve_action_states, :ve_basic_module, 1.19, :above)#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# This class deals with battlers. It's used as a superclass of the Game_Actor# and Game_Enemy classes.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Alias method: make_damage_value #-------------------------------------------------------------------------- alias :make_damage_value_ve_action_states :make_damage_value def make_damage_value(user, item) make_damage_value_ve_action_states(user, item) action_states(item) end #-------------------------------------------------------------------------- # * New method: action_states #-------------------------------------------------------------------------- def action_states(item) item_state_change(item) item_type_state_change(item) end #-------------------------------------------------------------------------- # * New method: item_state_change #-------------------------------------------------------------------------- def item_state_change(item) action_state_change(item.skill? ? "SKILL" : "ITEM", item.id) end #-------------------------------------------------------------------------- # * New method: item_type_state_change #-------------------------------------------------------------------------- def item_type_state_change(item) type = item.skill? ? "SKILL TYPE" : "ITEM TYPE" item.type_set.each {|i| action_state_change(type, i) } end #-------------------------------------------------------------------------- # * New method: action_state_change #-------------------------------------------------------------------------- def action_state_change(type, id) regexp = /<#{type} STATE (ADD|REMOVE) #{id}: (\d+)(?:, *(\d+)%)?>/i get_all_notes.scan(regexp) do type = $1.downcase id = $2.to_i rate = $3 ? $3.to_i / 100.0 : 1 type == "add" ? add_state_normal(id) : remove_state(id) if rand < rate end endend
But like i said, instead of adding state to the damage taken unit, the damage dealer will be.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top