Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [RGSS] TSE-RemoveOnActions, Enable you to remove states after executes an action
privateWright
post Apr 16 2013, 05:07 AM
Post #1



Group Icon

Group: Member
Posts: 4
Type: Scripter
RM Skill: Skilled




Script Name : TSE-RemoveOnActions
Version : 1.0
Author : privateWright, privateer, or private (Either of them is fine...)

Introductions :
Hello, everyone at RRR! wink.gif Consider this as my registration gift.
This script will enable you to create states that will be removed once the bearer takes an action, whether it’s an attack, a skill, or an item. So, for example, if you are inflicted with a state, let's call it "Focus", that will enchance the bearer's next attack, it will be removed once the bearer attacks or use any actions.

Screenshots :
None needed.

Demo :
None needed.

Script :
CODE
#==============================================================================
# Theta Scripting Engine - Remove On Actions by privateer
#==============================================================================
# ► Version  : 1.0
#==============================================================================
# ► Introduction
# This script will enable you to create states that will be removed when the
# bearer takes an action, whether it's an attack, skill, or item.
#==============================================================================
# ► Instruction
# Just put this script anywhere below Scene_Debug but above Main.
#==============================================================================
# ► Compatibility
# Designed and tested for DBS. May or not work with exotic CBS.
#==============================================================================

module TSE
  module RemoveOnActions
    # Just put any state id(s) that you want in the array.
    # Don't forget to use comma for multiple entries!
    ROA_STATES = [13, 17]
  end
end

#==============================================================================
# DON'T EDIT ANY FURTHER UNLESS YOU KNOW WHAT YOU'RE DOING!
#==============================================================================

$imported = {} if $imported.nil?
$imported["TSE-RemoveOnActions"] = true

class RPG::State
  include TSE
  include RemoveOnActions
  def remove_on_actions?
    return ROA_STATES.include?(id)
  end
end

class Game_Battler
  alias tse_remove_on_actions_attack_effect attack_effect
  def attack_effect(attacker)
    for state in attacker.states
      attacker.remove_state(state) if $data_states[state].remove_on_actions?
    end
    tse_remove_on_actions_attack_effect(attacker)
  end
  
  alias tse_remove_on_actions_skill_effect skill_effect
  def skill_effect(user, skill)
    for state in user.states
      user.remove_state(state) if $data_states[state].remove_on_actions?
    end
    tse_remove_on_actions_skill_effect(user, skill)
  end  
  
  alias tse_remove_on_actions_item_effect item_effect
  def item_effect(user, item)
    for state in user.states
      user.remove_state(state) if $data_states[state].remove_on_actions?
    end
    tse_remove_on_actions_item_effect(user, item)
  end  
end

Or, for those who rather download it : Here!

Compatibility : Designed and tested for DBS. May or not work with exotic CBS.

Author Noted : I hope I will be welcomed at this forum. So, enjoy it, everyone!

-privateWright
Go to the top of the page
 
+Quote Post
   
yamina-chan
post Apr 18 2013, 01:29 AM
Post #2


Level 8
Group Icon

Group: Revolutionary
Posts: 128
Type: None
RM Skill: Skilled




Fairly sure it has been done before, but it works, that's the main concern ^^
I've been testing it for a bit and I could not see any flaws, so...well done =D


__________________________
There is a game out there for everyone. All you have to do is to find it.
Go to the top of the page
 
+Quote Post
   
privateWright
post Apr 19 2013, 05:19 AM
Post #3



Group Icon

Group: Member
Posts: 4
Type: Scripter
RM Skill: Skilled




QUOTE (yamina-chan @ Apr 18 2013, 04:29 PM) *
Fairly sure it has been done before, but it works, that's the main concern ^^
I've been testing it for a bit and I could not see any flaws, so...well done =D

Yeah... I guess so. Thanks, anyway. wink.gif I haven't done any deep searches, but I'm happy it does its works quite nicely. Oh, and be free to test it with other scripts. I want to know if it's compatible with other scripts or not.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 10:40 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker