[XP] State Requirement Skills

Started by [Faint], November 17, 2009, 09:20:36 am

Previous topic - Next topic

[Faint]

November 17, 2009, 09:20:36 am Last Edit: November 17, 2009, 02:17:27 pm by [Faint]
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


  • Very Easy to set up.



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


  • Everyone here at chaos-project that has helped me out in understanding RGSS.



Author's Notes

Woot for first working script.
Scripts by me - State Requirement Skills
current project - Project: AURA

G_G

Very nice, I may use this in the future.
*databases*

Blizzard

November 17, 2009, 10:50:16 am #2 Last Edit: November 17, 2009, 10:53:48 am by Blizzard
Want me to add this to Tons? I could also add a few other of your scripts. :P
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

[Faint]

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.
Scripts by me - State Requirement Skills
current project - Project: AURA

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

[Faint]

Scripts by me - State Requirement Skills
current project - Project: AURA

ShadowPierce

->Pretty good script...
*levels up*



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

[Faint]

 :^_^': Thanks it's my first working script so naturally it's not very complex.
Scripts by me - State Requirement Skills
current project - Project: AURA

ShadowPierce

->Yeah, I remember when we were still asking so much questions...  :) Sadly, I still am...  :P



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

[Faint]

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. :^_^':
Scripts by me - State Requirement Skills
current project - Project: AURA

ShadowPierce

->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



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Hellfire Dragon

Nice little script, I'll probably be using it ;)

[Faint]

Thanks, nice to know some other people besides myself have use for this.
Scripts by me - State Requirement Skills
current project - Project: AURA