[XP] Ryex's Weapons Unleash Skills

Started by Ryex, May 11, 2009, 12:08:10 am

Previous topic - Next topic

Jackolas

love the script... it should be a must have in RMXP itself :P

Ryex

ok i'm looking at Blizz ABS thinking about creating a BABS version of this script

correct me if I'm wrong but all i need to do is


class Map_Actor < Map_Battler

  def use_attack
      unless $data_weapons[@battler.weapon_id].unleash_chance(@battler.weapon_id) == false
        if rand(100) <= ($data_weapons[@battler.weapon_id].unleash_chance(@battler.weapon_id))
            use_skill($data_skills[$data_weapons[@battler.weapon_id].unleash_id(@battler.weapon_id])
        end
      end
    super
  end

end       

and then a slight mod of use skill to remove sp cost and other things if it is an unleash. am I correct?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Yes. But you additionally need to return the result from the superclass method and you might want to skip executing the attack at all. It's up to you, though.
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.

Ryex

BABS Script Version: ShowHide


#=============================================================================
#
# ** Ryex's Weapons Unleash Skills BABS version
#
#-----------------------------------------------------------------------------
#
# By Ryex
# V 1.00
#
#-----------------------------------------------------------------------------
#
# Features
#
#  * Allows Weapons to have a chance to "Unleash" skills from the database
#  * Customizable unleash rates / chance to unleash for every weapon
#
#  
#
#-----------------------------------------------------------------------------
#
# Instructions
#
# Place in a new script above main then fill out the Configuration.
#
#==============================================================================
module RPG
 class Weapon
   def unleash_id(id)
     case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration for the skills weapons unleash
# Use when <WeaponID> then return <ID of Unleash skill>
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return 7
when 5 then return 10
when 25 then return 19
when 29 then return 22
#add new lines here
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     end
     return 0
   end
 
   def unleash_chance(id)
     case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration for unleash chance.
# this must be filled out other wise weapons will NEVER unleash
# Use when <WeaponID> then return <% chance of unleash (a # 0 - 100)>
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return 100
when 5 then return 50
when 25 then return 25
when 29 then return 75
#add new lines here
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     end
     return false
   end
 end
end
 
class class Game_Actor < Game_Battler
 
 attr_accessor :unleash
 
 alias ryex_WUS_GActor_init_later initialize
 def initialize(actor_id)
   @unleash = false
   ryex_WUS_GActor_init_later(actor_id)
 end
 
 
end

class Map_Actor < Map_Battler

 def use_attack
   unless $data_weapons[@battler.weapon_id].unleash_chance(@battler.weapon_id) == false
     if rand(100) <= ($data_weapons[@battler.weapon_id].unleash_chance(@battler.weapon_id))
       use_skill($data_skills[$data_weapons[@battler.weapon_id].unleash_id(@battler.weapon_id])
       @battler.unleash = ture
     end
   end
   return super
 end
 
 alias ryex_WUS_Map_Actor_use_skill_latter use_skill
 def use_skill(skill)
   #if this skill in a waepon unleash
   if @battler.unleash
     @battler.hpdamage = @battler.spdamage = 0
     # call common event
     common_event_call(skill)
     # set usage animation
     set_usage_animation(skill)
     # set up user damage display if necessary
     user_damage_display
     # reset action
     self.reset_action
     # if using skill sprites for this type of battler
     if BlizzABS::Config::A_SKILL_SPRITES
       # setup sprite extension with ID
       setup_sprites("_skl#{skill.id}")
     else
       # setup sprite extension
       setup_sprites('_skl')
     end
     @battler.unleash = false
     return true
   else
     ryex_WUS_Map_Actor_use_skill_latter(skill)
   end
 end

end



I'm not quite sure if this works as I haven't tested it. dose it look right to you Blizz? 
if some one can verify that it works i'll add it to the main post.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Looks alright to me on first sight. You should just add a return before "ryex_WUS_Map_Actor_use_skill_latter(skill)".
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.

Ryex

there is a return it's at the bottom of the if @battles.unleash statment right before the else
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Yes, but you need to return the original result as well in case the skill doesn't work.
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.

Ryex

June 19, 2009, 08:59:09 pm #27 Last Edit: June 19, 2009, 09:02:27 pm by Ryexander
what original result? the why i set it up it will return true if it @battler.unleash it true otherwise it will run like normal and there is no other result to return because ryex_WUS_Map_Actor_use_skill_latter(skill) will return the result of a normal skill use.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Yeah, right, you might not want that. Well, basically what I am saying is that you should return the result of the original method. But as you said, you probably don't need it in this case.
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.

Sally

how awesome would it be if there was a whole golden sun script set?

Ryex

Quote from: Sally on June 20, 2009, 01:45:39 am
how awesome would it be if there was a whole golden sun script set?

Very

So any one tried the Blizz ABS version yet? like Aqua? I'm fairly sure that Aqua said s/he would use it if there was a Blizz ABS version.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Aqua

Girl! XD

And um... I'm focusing on the Boss Battle Competition, and that can't use an ABS...
I'll try the Blizz-ABS version when I go back to another of my projects XD

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Shining Riku

Hey Ryexander! I'm gonna use this script too. It's awesome.  :D
Keep up the good work ok?  ;)

Power up!

This Side Backwards

Really useful script that I'm hoping to use, unfortunately, the Blizz ABS version isn't working... There are a few syntax errors and a little typo, (ture instead of true).

Great idea with the script though, hope it can be fixed! Oh one more thing, does the script bypass the attack? (When you unleash the skill, do you still swing/shoot you weapon?)

Ryex

truth be told I never got a chance to test the system with babs, could you upload a demo with the problems so I can test it and get rid of bugs for you?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

This Side Backwards

Sent you the demo via PM. Thanks again for the help!

Ryex

I knew I couldn't be something big. fixed version posted.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

This Side Backwards

Still a bit buggy, I sent another PM with the details and a demo.

Ryex

ok I've got it fully working now thanks for trying it out and not going away when it didn't work.  :P
check first post
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />