Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: [Faint] on November 17, 2009, 09:20:36 am

Title: [XP] State Requirement Skills
Post by: [Faint] on November 17, 2009, 09:20:36 am
State Requirement Skills
Authors: [Faint]
Version: 1.0
Type: Skill Add-On
Key Term: Custom Skill System



Introduction

Simple script that allows you to set state requirements for skills.


Features




Screenshots

N/A


Demo

N/A


Script


Spoiler: ShowHide

#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
# State Requirement Skills                                                     #
# Author: [Faint]                                                              #
# Version: 1.0                                                                 #
# Date: 11/10/2009                                                             #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
#                                                                              #
#   This Add-on allows you to make skills require a specified state to be      #
#   inflicted upon the actor before they can use said skill.                   #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
module SRConfigs
 
 def self.req_state(id)
   case id
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
# Configs                                                                      #
#                                                                              #
#   when SKILL_ID then return REQUIRED_STATE_ID                                #
#   SKILL_ID            - ID of the Skill.                                     #
#   REQUIRED_STATE_ID   - ID of the State required to use the Skill.           #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
     when 1 then return 17
   end
   return
 end

end

#==============================================================================#
# Game_Battler                                                                 #
#==============================================================================#

class Game_Battler
 
 alias state_met? skill_can_use?
 def skill_can_use?(skill_id)
   data = SRConfigs.req_state(skill_id)
   return data != nil && !self.state?(data) ? false : state_met?(skill_id)
 end
 
end




Instructions

Place above Main.


Compatibility

No none compatibility issues.


Credits and Thanks




Author's Notes

Woot for first working script.
Title: Re: [XP] State Requirement Skills
Post by: G_G on November 17, 2009, 09:25:14 am
Very nice, I may use this in the future.
*databases*
Title: Re: [XP] State Requirement Skills
Post by: Blizzard on November 17, 2009, 10:50:16 am
Want me to add this to Tons? I could also add a few other of your scripts. :P
Title: Re: [XP] State Requirement Skills
Post by: [Faint] on November 17, 2009, 01:53:20 pm
sure :D I didnt think this would be worth to add to tons but if you want to add it then by all means feel free to.
Title: Re: [XP] State Requirement Skills
Post by: Blizzard on November 17, 2009, 03:08:20 pm
I'll get to it as soon as I can.
Title: Re: [XP] State Requirement Skills
Post by: [Faint] on November 17, 2009, 03:42:03 pm
ok cool  ;)
Title: Re: [XP] State Requirement Skills
Post by: ShadowPierce on November 18, 2009, 08:49:05 am
->Pretty good script...
*levels up*


Title: Re: [XP] State Requirement Skills
Post by: [Faint] on November 18, 2009, 09:22:57 am
 :^_^': Thanks it's my first working script so naturally it's not very complex.
Title: Re: [XP] State Requirement Skills
Post by: ShadowPierce on November 19, 2009, 02:20:51 am
->Yeah, I remember when we were still asking so much questions...  :) Sadly, I still am...  :P


Title: Re: [XP] State Requirement Skills
Post by: [Faint] on November 19, 2009, 09:14:16 am
I just read lots of guides and such. Then I decided to make a new Project folder and just mess around and find what stuff did while referencing how to guides and syntax guides. :^_^':
Title: Re: [XP] State Requirement Skills
Post by: ShadowPierce on November 21, 2009, 01:12:13 am
->Yeah, I guess I'm just unlucky... The semester just started so I'll probably be slowing down on my project, and a girl just rejected me so I'm feeling reaaaaaaaaalllly bad right now...  :^_^': Anyway, good luck on your project!  :D


Title: Re: [XP] State Requirement Skills
Post by: Hellfire Dragon on November 21, 2009, 09:40:11 am
Nice little script, I'll probably be using it ;)
Title: Re: [XP] State Requirement Skills
Post by: [Faint] on November 21, 2009, 04:02:53 pm
Thanks, nice to know some other people besides myself have use for this.