Jump to content
estriole

Auto Skill Core

Recommended Posts

Effect: Auto Skill Core

- Author : Estriole

free to use in any project.

 

History

v1.1 - realize that tsukihime already update his/her script to include skill as effect object. so i add some lines to remove that skill before adding auto skill (to avoid double

effect)

i made this script initially when his/her manager still in 2.1 version and haven't use skill as effect object. i pm him/her about my implementation to use skill. but he/she didn't respond to is so i thought he/she didn't update his manager to use that. and in his 2.4 version change log doesn't mention that changes too :D/>.

 

v1.0 - initial release

 

This is add on for Tsukihime Effect Manager

http://www.rpgmakervxace.net/topic/7395-effect-manager/

put this script below that script.

 

What this add-on do?

if you want to have a skills that when learned could execute effects at battle start, battle end, turn start, turn end, crit attack, crit guard. basicly every trigger available in tsukihime Effect Manager.

and this effect execute just by having the skills in the skill pool. no need to execute it.

 

you just tag that skills with

<auto_skill>

then just script the effect and then tag the effect notetags.

you could also change the notetags in module ESTRIOLE if you have

that notetags already with other script.

 

example in tsukihime effect win recovery script:

 

 

def item_effect_win_recover_battle_end(obj, effect)

#this because in 2.4 version skill use item_effect instead of skill_effect

 

tag the auto skills with

<eff: win_recover hp percent> or <eff: win_recover mp percent>

then tag it with

<auto_skill>

 

so if any actor learn that skills. it will recover hp/mp at battle end

note: this is for actor only! enemy don't have that skills.

 

 

another usage is like this... example if we create

 

 

def item_effect_deal_phantom_poison_attack(obj,effect)

 

which when learn that skill will make the target poisoned every time we attack

either using attack command, using skill, or item.(we could add more condition

ex: only attack/only skill/anything you want)

 

(this just example so don't blame me it achieveable with add state in skill.

just imagine if you want complex effect)

 

 

 

sooo... what so different than tagging the effect in actor/class/state

 

actor = cannot be changed in game

class = can be changed in game but parameter / skill might change. cannot be shared with actor with different

class

state = removed upon death if not using script to make it permanent. cannot be seen what the state do without

seeing it in action.

auto_skill = -can be added/ removed in game by event command learn and forget skill

(flexible)

-still exist even the actor dies. (maybe want to make auto skills

that active if the user dies?. if actor dies... damage 1000 hp at turn

start... nice?)

- can write in skill description to give information to the player what this skill do.

 

made using Effect manager 2.4 (if Tsukihime update the manager and change

the code drasticly this script might not work)

 

 

Script:

v 1.0

 

 

 


 

=begin

#==============================================================================

** Effect: Auto Skill Core

Version: 1.0

Author: Estriole

Date: 25 Nov 2012

 

This is add on for Tsukihime Effect Manager

put this script below that script.

 

What this add-on do?

if you want to have a skills that when learned could execute effects at battle

start, battle end, turn start, turn end, crit attack, crit guard. basicly every

trigger in tsukihime Effect Manager.

 

you just tag that skills with

<auto_skill>

then just script the effect and then tag the effect notetags.

you could also change the notetags in module ESTRIOLE if you have

that notetags already with other script.

 

example in tsukihime effect win recovery:

 

def item_effect_win_recover_battle_end(obj, effect)

#this because in 2.4 version skill use item_effect instead of skill_effect

 

tag the auto skills with

<eff: win_recover hp percent> or <eff: win_recover mp percent>

 

so if any actor learn that skills. it will recover hp/mp at battle end

note: this is for actor only! enemy don't have that skills.

 

another usage is like this... example if we create

 

def item_effect_deal_phantom_poison_attack(obj,effect)

 

which when learn that skill will make the target poisoned every time we attack

either using attack command, using skill, or item.(we could add more condition

ex: only attack/only skill/anything you want)

 

(this just example so don't blame me it achieveable with add state in skill.

just imagine if you want complex effect)

 

sooo... what so different than tagging the effect in actor/class/state

actor = cannot be changed in game

class = can be changed in game but parameter / skill might change

state = removed upon death if not using script to make it permanent

auto_skill = -can be added/ removed in game by event command learn and forget skill

(flexible)

-still exist even the actor dies. (maybe want to make auto skills

that active if the user dies?. if actor dies... damage 1000 hp at turn

start... nice?)

 

made using Effect manager 2.4 (if Tsukihime update the manager and change

the code drasticly this script might not work)

 

note:

at first i use every skill for effect checking. but i realize that if a character

have lots of active skill. the checking might lower the speed a little. so i

decide to use only skills marked with auto_skill as effect checking objects

 

------------------------------------------------------------------------------

=end

 

module ESTRIOLE

AUTO_SKILLS_NOTETAGS = /<auto_skill>/i

end

 

class Game_Actor < Game_Battler

 

alias est_effect_auto_skills_core_effect_objects effect_objects

def effect_objects

est_effect_auto_skills_core_effect_objects - skills + auto_skills

end

 

def auto_skills

skills.select {|skill| auto_skill?(skill) }

end

 

def auto_skill?(skill)

if skill.auto_skill

return skill.auto_skill

else

return false

end

end

 

 

end

 

 

class RPG::Skill < RPG::UsableItem

attr_reader :auto_skill ## Gets a list of passive states to apply.

 

def create_auto_skills

return if @auto_skill

self.note.split(/[\r\n]+/).each do |line|

case line

when /<auto_skill>/i

@auto_skill = true

end

end

end

 

end

 

module DataManager

class << self ## Modify skills in the database.

alias est_auto_skill_database load_database unless $@

end

 

def self.load_database

est_auto_skill_database

create_auto_skills

end

 

def self.create_auto_skills

groups = [$data_skills]

for group in groups

for obj in group

next if obj == nil

obj.create_auto_skills if obj.is_a?(RPG::Skill)

end

end

end

end

 

 

 

 

 

 

Note:

at first i use every skill for effect checking. but i realize that if a character

have lots of active skill. the checking might lower the speed a little. so i

decide to use only skills marked with auto_skill as effect checking objects.

Edited by estriole

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×