Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: fugibo on March 08, 2008, 09:56:19 am

Title: [XP] Blood Mage 1.80
Post by: fugibo on March 08, 2008, 09:56:19 am
Blood Mage Script
Authors: LongFellow
Version: 1.80
Type: Special Skill Effect
Key Term: Battle Add-on



Introduction

This script allows you to have spells consume HP instead of MP. It comes in very useful for making strategic characters :P


Features




Screenshots

n/a for this sort of script



Script
Post this above Blizzard's scripts and below the defaults:

The Script: ShowHide
Code: Blood Mage v 1.80

=begin
 "Blood Mage" Script for RMXP, v 1.80
 by WcW

 Introduction:
   This script was made by request for Akkein (aka Akkrin) at
   http://forum.chaos-project.com/. Make sure to credit him and
   all others listed in the "Credits/Thanks" section below if you
   use this script. For detailed instructions on how to use this script,
   please see the section "Directions" below. For small mods that can
   be done, see the "Tips/Modifying this Script" section below.

 Features:
 *   Allows for the consumption of HP rather than SP for skills
 *   Can be configured to set "Blood Mage" state based on class,
     actor, state, or by default on some skills
 *   Can set behavior for when an actor has too little HP for a
     skill, and can set a minimum percentage of HP an actor must
     have to use skills
 *   As of 1.8, no bug-free (hopefully! ;))
 *   Compatible with SP-cost add-ons and RTAB
 *   Small code; less than 100 lines if you cut out all commeting
     and white space
     
 Version History:
 1.0: Release
   1.02: Undocumented bug fixes
 1.12: Bug fix (checked for SP in addition to HP)
 1.22: "Bloodkill" added, allowing for you to disable "suicide" moves
 1.32: Blizzard gave me some optimized code
   1.33: Undocumented bug fix
 1.43: Modified some code, added new features
   1.44: Fixed status window refresh
   1.45: Fixed bug where Blood Skills were unaffected by SP cost modifications
   1.46: Fixed bug where no HP was consumed if the actor had 0 SP
 1.56: Added the option to disable bloodmage for some skills
   1.57: More RTAB compatibility (a la Blizzard)
   1.58: Fixed bugs (once again, a la Blizzard)
   1.59: Fixed $game_system.bloodmage_not error
 1.70: New testing version; direct predecessor and base of 1.8x series;
       better coding, new options, improved compatibility
   1.71: Undocumented bug fix
   1.72: Fixed RTAB error
   1.73: Improved comments, optimized skill_can_use?(id), added overcharging
         option, fixed an as-yet undiscovered bug (actors with too little HP
         could use a blood skill anyway)
   1.73b: Fixed a careless mistake
 1.80: All bugs fixed, bloodstates added, all commenting redone, flagged
       as stable, $WCW_BLOOD_MAGE added ;)
       
 Roadmap:
 1.85: BlizzABS compatibility, enemies as blood mages, and "dryusers" (users
       who will never use blood skills)
 
 Directions:
   You should place this script below all of the default RMXP scripts (these
   should end in Scene_Debug) and above any of Blizzard's scripts.
   
   All of the instructions below are either referring to the code directly
   after this comment-block, or the code inside Game_System within this script.
   
   - If you want to use RTAB with this script, change
     "WCW_BLOODMAGE_RTAB = false" to "WCW_BLOODMAGE_RTAB = true". This enables
     a small workaround for a quirk in RTAB (make_skill_action_result takes
     an argument, whereas it does not in the DBS)
   - To set an actor to be a bloodmage by default, add his ID between the
     brackets next to "@wcw_bloodusers =" below, and separate all IDs with
     commas. To remove a user from the group, simply delete their ID. To add
     a Blood-User in-game, use a Call Script event command with the code
     "$game_system.wcw_bloodusers.push <id>", replacing <id> with the
     actor's ID. To remove them, use "$game_system.wcw_bloodusers.delete <id>",
     likewise replacing <id> with the actor's ID.
   - To set a class to Blood Mage, add the ID between the brackets beside
     "@wcw_bloodmages =" below, once again separating them with commas.
     To remove a class, simply remove the ID. To add in-game, use Call Script
     with "$game_system.wcw_bloodmages.push <id>", replacing <id> with the ID.
     To remove a class, use "$game_system.wcw_bloodmages.delete <id>".
   - To add a Blood State, add the ID of the state between the brackets next
     to "@wcw_bloodstates =" below, separating each ID with a comma. To
     remove a state, simply remove the ID. To do the same in-game, use
     "$game_system.wcw_bloodstates.push <id>" and
     "$game_system.wcw_bloodstates.delete <id>".
   - To add a skill which always consumes HP rather than MP, add its ID
     between the brackets next to "@wcw_bloodskills = " below, separating
     each ID with commas. To remove the skill, remove the ID. To do the
     same in-game, use "$game_system.wcw_bloodskills.push <id>" and
     "$game_system.wcw_bloodskills.delete <id>".
   - To add a skill that will consume SP even when used by a Bloodmage,
     add its ID between the brackets next to "@wcw_dryskills =" below,
     separating each with a comma. To remove the skill, remove the ID.
     To do the same in-game, use "$game_system.wcw_dryskills.push <id>" and
     "$game_system.wcw_dryskills.delete <id>".
   - To allow a Blood Mage to die when they use a skill the require more
     HP than they have, replace "false" with "true" next to "@wcw_blood_die = "
     below. To reverse this, replace "true" with "false". TO do the same
     in-game, use "$game_system.wcw_blood_die = true" and
     "$game_system.wcw_blood_die = false".
   - To have a Bloodmage be left with 1 HP after they overcharge, replace
     "false" with "true" on the line with "@wcw_blood_overcharge". To do the
     same in-game, use "$game_system.wcw_blood_overcharge = true" or
     "$game_system.wcw_blood_overcharge = false". For this to work, the
     option above must be set to "false".
   - To set the minimum % HP a Blood Mage must have to use a Blood Skill,
     set the number between 0 and 1 next to "@wcw_blood_limit = " below. To do
     the same in-game, use "$game_system.wcw_blood_limit = <% in decimal>".

 Tips/Modifying this Script:
   * To change how much a Blood Mage is left with after overcharging,
     replace the "battler.hp = 1" in make_skill_action_effect in Scene_Battle
     with "battler.hp = <expression>", and the "return @hp > 1" in
     skil_can_use? in Game_Battler with "return @hp > <expression>".
   * To make $game_system.wcw_blood_limit be a static amount rather than
     percentage, replace "(self.hp * $game_system.wcw_blood_limit).to_i"
     in skill_can_use? in Game_battler with "$game_system.wcw_blood_limit".
   * To check for Blood Mage, use "if $WCW_BLOOD_MAGE". To check the version,
     use "if $WCW_BLOOD_MAGE > <your_version>".
     
 Compatibility:
   Tested with SP Cost Mod from Blizzard's Tons of Add-Ons and the
   Default Battle System. If you find any issues, please report them
   at http://forum.chaos-project.com/, in the Blood Mage thread, which
   will most likely be in the "RMXP Script Database" forum.
   
 Credits:
   Blizzard, for helping me learn to script, pointing out a bug, and
     optimizing code
   Fantasist, for getting me to come back to RMXP
   Akkrin, for giving me the Blood Mage idea
   Myself, for scripting it
   Cid, for reporting two errors ;)
   omegapirate2000, for confirming Cid's error (more the merrier :P)
   game_guy, for giving me an idea (overcharging)

 Enjoy |:]
=end

$WCW_BLOOD_MAGE = 1.8

#----------------------------------------------------------------------------
# * CONFIG (redefinition of Game_System class)
#     Configuration section :)
#----------------------------------------------------------------------------
# To use with RTAB, change false in the line below to true.
WCW_BLOODMAGE_RTAB = false

class Game_System

 # Defines getter's and setter's for configuration variables
attr_accessor :wcw_bloodusers, :wcw_bloodmages, :wcw_bloodstates,
               :wcw_bloodskills, :wcw_dryskills, :wcw_blood_die,
               :wcw_blood_overcharge, :wcw_blood_limit
               
# Backs up the old initialize method
alias init_wcw_bloodmage_later initialize

#------------------------------------------------------------------------
# - initialize
# First method called :P
#------------------------------------------------------------------------
def initialize

# This variable stores the ID's of all classes which should consume
# HP over MP.
@wcw_bloodusers = [1]
# This variable stores the ID's of all actors that act as
# bloodmages, even though their class is not a bloodmage.
@wcw_bloodmages = []
   # This variable stores the IDs of all states which cause an actor to
   # consumer HP rather than MP.
   @wcw_bloodstates = []

# This variable stores the ID's of all skills which will act as
# bloodmage skills, even if the actor using it isn't a bloodmage
@wcw_bloodskills = []
# This variable stores the ID's of all skills which will not cause
# a bloodmage to lose HP if they use them.
@wcw_dryskills = [57]

# If this variable is set to "true," bloodmages will be able to kill
# themselves if they use to much HP (it will use more HP than the
# actor has, even if it is not enough for the skill.) If it is
# set to false, they will only be able to use the skills until it
# would put them below $game_system.wcw_blood_limit.
@wcw_blood_die = false
# If this variable is set to "true," (and the one above is false),
# then when an actor uses a blood skill that costs more HP than he
# currently has, it will simply reduce his HP to one. (STILL IN
# TESTING).
@wcw_blood_overcharge = false
# This number must be set from 0 to 1. It signifies the minimum
# percent of HP an actor must have to use a skill if
# $game_system.wcw_blood_die is set to "false. 0 is default,
# and means the actor can use skills until his HP is 1.
@wcw_blood_limit = 0

   # Do everything else that is normally done :P
   return init_wcw_bloodmage_later

 end

end

#----------------------------------------------------------------------------
# * Bulk of the code (redefinition of some Game_Battler code)
#----------------------------------------------------------------------------
class Game_Battler

# Backs up skill_can_use?(skill_id)
alias skill_can_use_wcw_bloodmage_later skill_can_use? #lol, long name :P
 
 #------------------------------------------------------------------------
# - wcw_is_bloodmage?()
# Checks to see if actor is a bloodmage.
#------------------------------------------------------------------------
def wcw_is_bloodmage?
return self.is_a?(Game_Actor) && (
$game_system.wcw_bloodusers.include?(self.class_id) ||
$game_system.wcw_bloodmages.include?(self.id) ||
     @states.any? {|s| $game_system.wcw_bloodstates.include?(s)})
end

#------------------------------------------------------------------------
# - wcw_bloodmages_applies?(skill_id)
# Checks to see whether a given skill is a bloodskill when used by
# the actor.
#------------------------------------------------------------------------
def wcw_bloodmage_applies?(skill_id)
   return (wcw_is_bloodmage? && (!
$game_system.wcw_dryskills.include?(skill_id))) ||
$game_system.wcw_bloodskills.include?(skill_id)
end

#------------------------------------------------------------------------
# - skill_can_use?(skill_id)
# Checks to see if a skill can be used
#------------------------------------------------------------------------
def skill_can_use?(skill_id)

# Go ahead and pass it on if the actor isn't a bloodmage or the
# skill isn't a bloodskill
unless wcw_bloodmage_applies?(skill_id)
return skill_can_use_wcw_bloodmage_later(skill_id)
end

   # Get HP Cost, check other factors
   mysp = @sp
   @sp = $data_skills[skill_id].sp_cost
   return false unless skill_can_use_wcw_bloodmage_later(skill_id)
   @sp = mysp

   # Check HP
   if $game_system.wcw_blood_die
     return true
   elsif $game_system.wcw_blood_overcharge
     return @hp > 1
   else
     cost = (($tons_version >= 6.54) && $game_system.SP_COST_MOD) ?
         BlizzCFG.get_cost_mod(@states, $data_skills[skill_id].sp_cost) :
         $data_skills[skill_id].sp_cost
     print cost
     return (self.hp - cost) >((self.maxhp*$game_system.wcw_blood_limit).to_i)
   end

 end
end

#----------------------------------------------------------------------------
# * Code to make sure bloodmages consume HP instead of MP
#----------------------------------------------------------------------------
class Scene_Battle

# Backs up make_skill_action_result
alias make_skl_act_res_wcw_bldmg_later make_skill_action_result

#----------------------------------------------------------------------------
# - make_skill_action_result(battler=nil)
# Execute skill
#----------------------------------------------------------------------------
def make_skill_action_result(battler = @active_battler)
   mysp = battler.sp
   
# RTAB Compatibility Workaround
if WCW_BLOODMAGE_RTAB
make_skl_act_res_wcw_bldmg_later battler
else
make_skl_act_res_wcw_bldmg_later
end

# Reduce HP, and put the SP back where it should be :P
if battler.wcw_bloodmage_applies?(@skill.id)
     cost = ($tons_version && $game_system.SP_COST_MOD) ?
       BlizzCFG.get_cost_mod(battler.states, $data_skills[@skill.id].sp_cost) :
       $data_skill[@skill.id].sp_cost
# Set HP to 1 if overcharging; else, subtract cost
if (battler.hp < cost) && $game_system.wcw_blood_overcharge
battler.hp = 1
else
battler.hp -= cost
end
battler.sp = mysp
end
# Refresh Status Window
@status_window.refresh
end

end



Instructions
Inside the script.


Compatibility
None found yet. However, it most likely will have compatibility issues with most CBSes.


Credits and Thanks




Author's Notes

Enjoy! Also, report all errors and compatibility issues in THIS THREAD, not in a new topic. And please do report them ;)
Title: Re: Blood Mage v 1.02
Post by: Blizzard on March 08, 2008, 10:05:28 am
I remember debugging and optimizing v1.0 for Tons, but I never came to add it. xD How about applying the right form (http://forum.chaos-project.com/index.php?topic=17.0)?

EDIT:
#==============================================================================
# Blood Mage Magic Script v 1.0.0
# by WcW & Akkrin
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# - code reviewed, optimized, integrated into Tons of Add-ons, freed from
#   potential bugs and beta tested by Blizzard
# - compatible with RTAB and skill cost modifying scripts (by Blizzard)
# - this add-on is part of Tons of Add-ons with full permission of the original
#   author(s)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Introduction:
#
# I made this script for Akkein(Akkrin) at http://forum.chaos-project.com at
# his request. If he has allowed you to use this, enjoy. If he has not, ask
# him.
#
# Features:
#
# - Allows for certain classes to use up their HP instead of MP when using
#   spells.
# - Lightweight.
#
# Instructions:
#
# Add the IDs of all your "Blood Mage" classes to the [] thingy in the
# CONFIG section.
#
# Compatibility:
#
# This has no known compatibility issues. Might not be compatible with CBS-es.
# If you find any problems, please post them at http://forum.chaos-project.com
#
# WcW, Signing Off
#==============================================================================

#------------------------------------------------------------------------------
# * CONFIG
#     Configuration section
#------------------------------------------------------------------------------

BLOODMAGES = [] # Between the "[" and "]", add the ID of each class the you
                # want to be a blood mage and seperate each with a comma.

# Below lies the code

#------------------------------------------------------------------------------
# * Battle Scene
#------------------------------------------------------------------------------

class Scene_Battle
 
  #----------------------------------------------------------------------------
  # * Make Skill Action Result
  #----------------------------------------------------------------------------
  alias make_skill_action_result make_skill_action_result_bloodmage_later
  def make_skill_action_result(battler = nil)
    if battler == nil
      battler, sp = @active_battler, @active_battler.sp
      make_skill_action_result_bloodmage_later
    else
      sp = battler.hp
      make_skill_action_result_bloodmage_later(battler)
    end
    if (battler.current_action.forcing || battler.skill_can_use?(@skill.id)) &&
        battler.is_a?(Game_Actor) && BLOODMAGES.include?(battler.class_id)
      battler.hp -= sp - battler.sp
      battler.sp = sp
      @status_window.refresh
    end
  end
 
end


Worx with RTAB. :3

EDIT: I suggest aliasing skill_can_use? for convenience so the player can use the skill even though he has not enough SP. *makes a note*
Title: Re: [XP] Blood Mage v 1.02
Post by: fugibo on March 08, 2008, 10:13:06 am
That better?

And I'll look into that, thanks, Blizz. BTW, why did you change your name?

EDIT:

Wait.. I'm confused... In my test bed for this script, skill_can_use? check to see if the skill is learned, I think that the Scene_Battle method I aliased checks the SP.
Title: Re: [XP] Blood Mage v 1.02
Post by: Blizzard on March 08, 2008, 10:19:30 am
Nice. :) *powers up*

I changed it just for fun. I'll change it back later.
Title: Re: [XP] Blood Mage v 1.02
Post by: fugibo on March 08, 2008, 10:20:43 am
Wait... where DOES it check to see if you have enough SP...?
Title: Re: [XP] Blood Mage v 1.02
Post by: Blizzard on March 08, 2008, 10:26:52 am
skill_can_use? in Game_Battler. Just alias it.
Title: Re: [XP] Blood Mage v 1.02
Post by: fugibo on March 08, 2008, 10:29:25 am
IM AND IDIOT, I WAS LOOKING IN GAME_ACTOR, SAW IT JUST SEEING IF IT WAS LEARNT AND THEN LOOKED AT THE MAKE_SKILL_RESULT, I EVEN SAW THE EFFING SUPER IN THE GAME_ACTOR'S METHOD, IM SUCH AN EFFING IDIOT

ill go fix that , that must be the other bug I found that I couldn't remember :P

EDIT:

Fix'd.
Title: Re: [XP] Blood Mage v 1.22
Post by: Nortos on March 08, 2008, 07:40:10 pm
gj on this script  I can't be bothered looking through it so can you tell me if compatible with blizz ABS :P
Title: Re: [XP] Blood Mage v 1.22
Post by: fugibo on March 08, 2008, 08:09:34 pm
Probably not, sorry. Maybe I could make a mod for BlizzABS, though.
Title: Re: [XP] Blood Mage v 1.22
Post by: Vell on March 08, 2008, 09:08:58 pm
interestin.. skills that use HP instead of MP... maybe I'll use this for Tenia Mala... another game/novel/possible anime/possible manga I'm DEFINITELY going to do in the future, (the game version atleast) will definitely need HP usin skills, I may use this one.

I find it funny that while I was viewing this the ad had a picture of a Blood Elf from WoW...
Title: Re: [XP] Blood Mage v 1.22
Post by: fugibo on March 08, 2008, 10:00:33 pm
0_o

Also, for the next update, I plan to add a slight aesthetical fix that makes it so that if a Blood Mage has 0 SP, it will show it as the regular color instead of red, an option that can make Blood Mages just display n/a for their SP during battle, and a a new option that lets you turn of HP consumption for certain skills.
Title: Re: [XP] Blood Mage v 1.22
Post by: Nortos on March 09, 2008, 02:24:26 am
anyway I already planning on using this in my game maybe and have the only support char use her heatlh to use skills :P
Title: Re: [XP] Blood Mage v 1.22
Post by: Vell on March 09, 2008, 07:29:43 am
yeah itll be cool if not ALL spells had to be HP consuming.

this time its a draenei...
Title: Re: [XP] Blood Mage v 1.22
Post by: Blizzard on March 09, 2008, 11:34:30 am
No, it's not compatible with Blizz-ABS.

@WcW: Why don't you take my optimized version of your script that's also compatible with RTAB?
Title: Re: [XP] Blood Mage v 1.22
Post by: fugibo on March 09, 2008, 07:18:46 pm
Oh, sorry, I'll fix that =)

EDIT:

Blizz, the only problem I can spot in your scripting awesomeness is the fact that you NEVER debug your code before hand.

EDIT:

Thanks alot, Blizz, now I'm gonna have to redo your code for the new features.  >:(

It's okay, though

EDIT:

Fix'd. Could someone please check to make sure that it is compatible with RTAB, though?

EDIT:

Major upgrade, lol

EDIT:

And now I know for certain that it is compatible with the latest version of RTAB that I got straight from the Cogwheel website.
Title: Re: [XP] Blood Mage v 1.57
Post by: Nortos on March 10, 2008, 01:53:48 am
heh you updated it like 5 times today right?
Title: Re: [XP] Blood Mage v 1.57
Post by: Blizzard on March 10, 2008, 06:33:37 am
Now, that's what I call fast development. O_o
Title: Re: [XP] Blood Mage v 1.57
Post by: fugibo on March 10, 2008, 08:23:07 am
In the last 3 or 4 days, actually about.... 12 version updates, so....
Title: Re: [XP] Blood Mage v 1.57
Post by: Blizzard on March 10, 2008, 11:28:08 am
I wish I Blizz-ABS would go that fast or at least my own game.
Title: Re: [XP] Blood Mage v 1.57
Post by: fugibo on March 10, 2008, 02:21:13 pm
This is a real simple script, it should go pretty fast - and it only is because of how many bugs I found.

EDIT:

And there, yet another one fix'd

EDIT:

Two more fix'd
Title: Re: [XP] Blood Mage v 1.59
Post by: Nortos on March 13, 2008, 04:41:59 pm
good job on the fixes what was wrong? Or improved coding?
Title: Re: [XP] Blood Mage v 1.59
Post by: fugibo on March 13, 2008, 04:45:03 pm
Let's see... I believe 1.58 was just some random bug that was pretty bad, and the last one was me accidentally leavingout "not"'s that checked the config, but now it's fixed. I need to figure out how to optimize the skill_can_use method even more.
Title: Re: [XP] Blood Mage v 1.59
Post by: Nortos on March 13, 2008, 05:00:03 pm
yeah, when I get time I was gonna look more into this as I wnted to learn about skills in scripting cos have a plan for a short abs with lots of indvidual skills and multiple classes and pathways
Title: Re: [XP] Blood Mage v 1.59
Post by: fugibo on March 13, 2008, 05:05:42 pm
Good luck, the default Scene_Battle is scripted pretty dang crappy. It takes forever to figure out, I would just looking at Tons of Add-On's first because of the variance in effects to see how everything works.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.0 Testing)
Post by: fugibo on March 20, 2009, 02:14:53 pm
*bump*

Released a new testing version, 1.7.

This likely won't work, especially not with RTAB. However, it has several new features and cleaner code, so please check it out :)
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.0 Testing)
Post by: Blizzard on March 20, 2009, 02:42:54 pm
I'll make it work with RTAB and Blizz-ABS for Tons, don't worry.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.0 Testing)
Post by: Cid on April 06, 2009, 09:05:12 am
I get a syntax error on line 242 with the new script.

Have you considered adding an option to have blood skills take away a percentage of the user's max HP, instead of a whole number? The SMT series does this with all physical attacks and I think it works rather well.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.0 Testing)
Post by: ShadowBlaze on April 06, 2009, 04:22:12 pm
Lol, can't you just use common events? Like if you use a skill call a common event and then make the event minus HP? And of course that works with blizz - abs too. Nonetheless this is a useful script, maybe adding the effect of comsuming % HP like Cid said would make this script even more useful.  ;)
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: fugibo on April 06, 2009, 06:35:08 pm
*fixed*

I'll implement that sometime this week, mebe. Thanks for the idea & error :)
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: Cid on April 07, 2009, 03:49:59 am
Syntax error on line 243 now. :^_^':
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: fugibo on April 07, 2009, 05:00:06 pm
Now try it :P
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: Cid on April 08, 2009, 03:48:11 am
Hmm, now it won't let me use blood mage skills (they're faded out in the battle menu), and if I try to use a non-BM skill I get this error:

QuoteScript 'Blood Mage' line 263: ArgumentError occured.

wrong number of arguments(1 for 0)


Just so you know, the only section I'm configuring is "@wcw_bloodskills" (haven't touched anything else), and I'm testing it in a blank project with only the default scripts.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: fugibo on April 08, 2009, 08:18:57 am
I'm sorry, but I'll have to test this later. I don't have time right now to fix this -- so far I've been making this without running it, but it looks like I'm actually gonna hafta test it. Sorry :(
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: Cid on April 08, 2009, 01:34:25 pm
No problem. It's your script, so you can work on it whenever you like. :haha:
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: omegapirate2000 on May 19, 2009, 08:48:32 pm
Yep I get the same error as cid with the 1.7.1 version.

The stable version I was using has all of a sudden started freaking out whenever an enemy uses skills. 133: NoMethodError Undefined Method 'sp_cost' for nil:NilClass

This is the line: "sp = battler.sp < @skill.sp_cost ? @skill.sp_cost : battler.sp"


It kinda popped up at random  :^_^':
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.1 Testing)
Post by: fugibo on May 19, 2009, 09:08:46 pm
@stable: What other scripts are you using, and did you try removing the script and then re-adding it?

*BUMP*

Updated to 1.7.2. Thanks to Cid and Omegapirate2000 for testing ;)

Please, continue to get the testing version ready guys. I need your helps!
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.2 Testing)
Post by: G_G on May 19, 2009, 09:33:24 pm
Ok say you dont have enough HP could you make it subtract the needed amount of SP that's needed for the skill. Example:


Fire Ball Used: Requires 130 HP
HP: 122/744
SP: 200/200

Then is takes away 9 so theres at least 1 hp left in the user.

Just a suggestion and if you dont do it could you help me at least mod it?
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.2 Testing)
Post by: fugibo on May 19, 2009, 09:34:32 pm
I think I might already have that.

But that's besides the point; for now, does the script work properly?
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.2 Testing)
Post by: G_G on May 19, 2009, 09:36:29 pm
So far it does for me I always did like this script and I enjoy everytime it updates.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.2 Testing)
Post by: fugibo on May 19, 2009, 09:39:28 pm
The 1.7 series is a ton better than 1.5. It's just generally cleaner and more useful. You can also use Game_Battler.bloodmage_applies?, I believe, to check to see if Bloodmage can be used in the current situation -- I should probably get that to work with out-of-battle spells, if it doesn't already. 7_7

Anyway, what you're suggesting should be simple. You'd just have to mod bloodmage_applies and the skill effect method. I'll see what I can do in a sec.

EDIT:
Working on 1.7.3 currently; and lol, it's a year since I released 1.5.9! Wow, I'm sooooo lazy :P

*BUMP*

Alrighty, new version released. It's a bugfix release and a feature release, so please, check it out.

G_G, this should provide what you want, so try it out soon ;)

Also, WOW at this script. It has pretty significant power in nothing but 65 lines if you remove all of the comments and blank lines 0_0
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3 Testing)
Post by: omegapirate2000 on May 19, 2009, 11:09:08 pm
Jesus W, that didn't take long at all!


However, now I have an error that will happen anytime ANYONE uses ANY skill.
(http://i8.photobucket.com/albums/a3/omegapirate2000/ProblemActorSkill.png)

Heres the line in question: "if battler.wcw_bloodmage_applies?"

Syntax error?
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: fugibo on May 19, 2009, 11:14:44 pm
Fix'd, 1.7.3b posted

I forgot to pass @skill.id as an argument to battler.wcw_bloodmage_applies?, giving that error (which means that you passed one too few arguments).
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: omegapirate2000 on May 19, 2009, 11:21:08 pm
Quote from: WcW on May 19, 2009, 11:14:44 pm
Fix'd, 1.7.3b posted

I forgot to pass @skill.id as an argument to battler.wcw_bloodmage_applies?, giving that error (which means that you passed one too few arguments).

Thanks, I'll let you know if it works.


EDIT: Works perfectly, thanks a ton!
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: King Munkey on May 20, 2009, 12:46:09 am
I love this script. I haven't tested the newest version yet when I was using it before I got an error although I cannot remember what it was exactly.But I am being really lazy at the moment and I may try it out tomorow.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: fugibo on May 20, 2009, 12:21:33 pm
I'm going to release v 1.8 of this soon. It's got some serious upgrades :P
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: omegapirate2000 on May 20, 2009, 06:50:14 pm
Quote from: WcW on May 20, 2009, 12:21:33 pm
I'm going to release v 1.8 of this soon. It's got some serious upgrades :P

How much more can this script even be upgraded?
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: Blizzard on May 20, 2009, 06:51:18 pm
I wondered about that question myself the other day.
Title: Re: [XP] Blood Mage (v 1.5.9 Stable / v 1.7.3b Testing)
Post by: Ryex on May 20, 2009, 07:53:26 pm
Quote from: Blizzard on May 20, 2009, 06:51:18 pm
I wondered about that question myself the other day.

Dito^^ what kind of upgrades?
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on May 21, 2009, 12:37:33 am
A lot of bug-fixes and features. A LOT.

*BUMP*
Released. Enjoy! This version is heavily tested, and will almost definitely work as expected.
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on May 21, 2009, 12:25:45 pm
Moar errors!

The first is that my blood mage character doesn't consume HP for his spells, just SP.

And when he DOES use one of his skills I get this error:

(http://i8.photobucket.com/albums/a3/omegapirate2000/AnotherError.png)


Any ideas?
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on May 21, 2009, 03:16:42 pm
What? I SWEAR I tested this thing like crap and got no errors. But I'll check it out for you anyways.

EDIT:
Argh! I left out an "s" in $data_skills. Just change that on line 293. I'll look into the other error promptly.
Also, would your character happen to be using skill #57? Try #58 if he is.
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on May 23, 2009, 03:13:28 pm
Yeah, it works now, AND it consumes HP rather than SP, but it still isn't usable unless I have 5 SP (the cost of the skill).
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on May 23, 2009, 04:24:20 pm
>_< I'll fix that
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on May 23, 2009, 09:27:41 pm
Thanks man.
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on May 26, 2009, 08:21:25 pm
In the meanwhile, I don't suppose you have the last version of this script, do you? It worked perfectly for me.
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on May 27, 2009, 04:49:49 pm
I should, somewhere. But I've got to go to "Explorer Session" and listen to "Ryan Upshaw" talk right now, so yeah... I'll try to get that to you after I do my Alg. and Western Civ.

Yes, I'm trying to make the point that you shouldn't expect updates on this until after June. Sorry, I just don't have time.
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on May 27, 2009, 07:45:22 pm
Quote from: WcW on May 27, 2009, 04:49:49 pm
I should, somewhere. But I've got to go to "Explorer Session" and listen to "Ryan Upshaw" talk right now, so yeah... I'll try to get that to you after I do my Alg. and Western Civ.

Yes, I'm trying to make the point that you shouldn't expect updates on this until after June. Sorry, I just don't have time.

Thats fine, as long as I can get the previous version somewhere that should be all I'll ever actually need out of this script, unless the newer version is incredibly efficient :p
Title: Re: [XP] Blood Mage 1.80
Post by: Yin on May 28, 2009, 07:18:20 pm
When I use this, I take damage before the skill is even casted (with every skill). If an enemy does a skill to me, I take the damage before the skill even starts. How do I fix this? I'm using Charlie Lee's FFX Battle System.
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on May 28, 2009, 08:14:08 pm
What do you mean? Isn't that how it's supposed to work for BloodMage skills? As for the enemy part, that probably is a bug, but you're supposed to use up HP before the animation plays IIRC.
Title: Re: [XP] Blood Mage 1.80
Post by: Yin on May 28, 2009, 11:04:54 pm
Yeah, I know that's what the script is supposed to do, but what I mean is that even when it's not a bloodmage skill, the enemy/actor receives the damage before the animation even appears. It's as if it's going in the wrong order. The script works fine, it's just that little issue. It's like I see that I'm dead even before I see the damage pop up.
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on June 26, 2009, 09:53:10 am
Not to sound like a giant prick, but has WcW finished his stuff yet? I either need the previous version of this script (if anyone has it), a newer version that works for me, or a way of modifying it so that it works correctly for me.
Title: Re: [XP] Blood Mage 1.80
Post by: FenrisHalo on June 26, 2009, 10:17:21 am
*Ahem*It's a month since some1 last posted something... But anyway, I got version 1.7.1 right here:
I'm not putting it in a spoiler, it minimizes the box :P
=begin
Bloodmage Script v 1.7.1
by WcW

Introduction:
I made this script for Akkein (a.k.a. Akkrin) at
http://forum.chaos-project.com/ at his request. If you use
this script in your game, please make sure that you give him,
as well as myself, credits. For instructions on how to use this
script, refer to the "Instructiions" section further below.

Features:
- Allows for some actors/spells to consume HP rather than SP
- Can set bloodmages either by selecting specific actors
or by declaring "Bloodmage" classes
- Can define some spells to be used as blood spells regardless
of class/actor, and set others to be used as regular spells,
even by Bloodmages
- Can optionally set a minimum percent of HP an actor must
have left to use a Blood spell
- Small, light code with high chance of compatibility with
most scripts that are compatibility with the default
battle system, and _possibly_ BlizzABS

Version History:
1.0.0: Initial release; supported only basic HP consumption
1.0.2: Small Bug Fixes
1.1.2: Removed bug where skill checked for SP as well as HP
1.2.2: Add option for whether or not actors should be able
to kill themselves with Blood spells
1.3.2: Added Blizzard's optimized code.
1.3.3: Fixed a small bug left by Blizzard (:P)
1.4.3: Rewrote some of Blizzard's code for more Blood Mage
goodness :)
1.4.4: Fixed status window bug (wouldn't refresh)
1.4.5: Fixed bug where Blood Mages were unaffected
by things such as Half SP Cost.
1.4.6: Fixed another bug where it didn't consume
any HP at all if the blood mage had 0 SP
thanks to the last two bug fixes.
1.5.6: Added a new function that allows you to disable
the bloodmage effect for certain skills, and optimized
the code some more.
1.5.7: Fixed errors wtih RTAB
1.5.8: Fixed bugs
1.5.9: Fixed error with $game_system.bloodmage_not
1.7.0: Cleaned up code tremendously, added several new options,
improved compatibility, changed configuration. Testing
version; may not work. Please report all errors at
http://forum.chaos-project.com/.
1.7.1: Fixed error

Instructions:
This script should ideally be placed below all default RMXP
scripts and above all of Blizzard's scripts, as well as RMXP's
"Main" script.

To set up the default configuration:
---
To add actors that will be Bloodmages regardless of class:
- Add the actors ID between the brackets on line 153,
separating all ID's with commas.
---
To add classes that will be Bloodmages, regardless of actor:
- Add the class ID between the brackets on line 156,
similarly to setting up actors.
---
To add skills that will consume HP regardless of actor/class:
- Add the ID between the brackets on line 160,
same as the last two configuration options.
---
To add skills that will never sonsume HP:
- Add the ID between the brackets on line 163, same as
the last three.
---
To set actors to die/not die when they use too much HP:
- Replace 'false/true' with 'true/false' on line 170
to invert the current setting.
---
To set the minimum percent of HP a Bloodmage must have
to use a skill while the last option is set to 'false':
- Simply change the number on line 175
---

To edit configuration in an event/script:
( note: in each of these, <v> will represent the ID
  of the actor, class, or skill being spoken of, or
  value for the config option being spoken of )
  ---
To add an actor to the Bloodmages list:
- $game_system.wcw_bloodusers.push <v>
To remove an actor from the Bloodmages list:
- $game_system.wcw_bloodusers.delete <v>
---
To add a class to the Bloodmages list:
- $game_system.wcw_bloodmages.push <v>
To remove a class from the Bloodmages list:
- $game_system.wcw_bloodusers.delete <v>
---
To add an HP-consuming skill to the Bloodmages list:
- $game_system.wcw_bloodskills.push <v>
To remove an HP-consuming skill from the Bloodmages list:
- $game_system.wcw_bloodskills.delete <v>
---
To add a non-HP-consuming skill to the Bloodmages list:
- $game_system.wcw_dryskills.push <v>
To remove a non-HP-consuming skill from the Bloodmages list:
- $game_system.wcw_dryskills.delete <v>
---
To set Bloodmages to die when they use too much HP:
- $game_system.wcw_blood_die = true
To set Bloodmages to live when they use too much HP:
- $game_system.wcw_blood_die = false
---
To set the minimum percent of health a bloodmage must
have to use a skill when the last setting is 'false':
- $game_system.wcw_blood_limit = <v>
---

Compatibility:
If you find any issues, post them at http://forum.chaos-project.com/.

Credits:
Blizzard, for helping me learn to script, pointing out a bug, and optimizing
code
Fantasist, for getting me to come back to RMXP
Akkrin, for giving me the Blood Mage idea
Myself, for scripting it
Cid, for reporting an error ;)

Enjoy |:]
=end

#----------------------------------------------------------------------------
# * CONFIG (redefinition of Game_System class)
#     Configuration section :)
#----------------------------------------------------------------------------
class Game_System

# Defines getter's and setter's for configuration variables
attr_accessor :wcw_bloodusers, :wcw_bloodmages
attr_accessor :wcw_bloodskills, :wcw_dryskills
attr_accessor :wcw_blood_die, :wcw_blood_limit
# Backs up the old initialize method
alias init_wcw_bloodmage_later initialize

#------------------------------------------------------------------------
# - initialize
# First method called :P
#------------------------------------------------------------------------
def initialize

# This variable stores the ID's of all classes which should consume
# HP over MP.
@wcw_bloodusers = []
# This variable stores the ID's of all actors that act as
# bloodmages, even though their class is not a bloodmage.
@wcw_bloodmages = []

# This variable stores the ID's of all skills which will act as
# bloodmage skills, even if the actor using it isn't a bloodmage
@wcw_bloodskills = []
# This variable stores the ID's of all skills which will not cause
# a bloodmage to lose HP if they use them.
@wcw_dryskills = []

# If this variable is set to "true," bloodmages will be able to kill
# themselves if they use to much HP (it will use more HP than the
# actor has, even if it is not enough for the skill.) If it is
# set to false, they will only be able to use the skills until it
# would put them below $game_system.wcw_blood_limit.
@wcw_blood_die = false
# This number must be set from 1 to 100. It signifies the minimum
# percent of HP an actor must have to use a skill if
# $game_system.wcw_blood_die is set to "false. 0 is default,
# and means the actor can use skills until his HP is 1.
@wcw_blood_limit = 0

    return init_wcw_bloodmage_later

  end

end

#----------------------------------------------------------------------------
# * Bulk of the code (redefinition of some Game_Battler code)
#----------------------------------------------------------------------------
class Game_Battler

# Backs up skill_can_use?(skill_id)
alias skill_can_use_wcw_bloodmage_later skill_can_use? #lol, long name :P

#------------------------------------------------------------------------
# - wcw_is_bloodmage?()
# Checks to see if actor is a bloodmage.
#------------------------------------------------------------------------
def wcw_is_bloodmage?

return self.is_a?(Game_Actor) && (
$game_system.wcw_bloodusers.include?(self.class_id) ||
$game_system.wcw_bloodmages.include?(self.id) )

end

def wcw_bloodmage_applies?(skill_id)
return (wcw_is_bloodmage? && !
$game_system.wcw_dryskills.include?(skill_id)) ||
$game_system.wcw_bloodskills.include?(skill_id)
end

#------------------------------------------------------------------------
# - skill_can_use?(skill_id)
# Checks to see if a skill can be used
#------------------------------------------------------------------------
def skill_can_use?(skill_id)

# Go ahead and pass it on if the actor isn't a bloodmage or the
# skill isn't a bloodskill
unless wcw_bloodmage_applies? skill_id
return skill_can_use_wcw_bloodmage_later(skill_id)
end

# If the actor can die, let them;
if $game_system.wcw_blood_die
return skill_can_use_wcw_bloodmage_later skill_id
# Otherise, ensure that they have enough HP:
else
# Make sure that SP does not affect calculations;
# simplest way to do this an maintain compatibility
old_sp = self.sp
if self.sp < $data_skills[skill_id].sp_cost
self.sp = $data_skills[skill_id].sp_cost
end

# Test for skill the old way, always having enough SP
test = skill_can_use_wcw_bloodmage_later skill_id

# Restore SP
self.sp = old_sp

# Return the answer
return ((self.hp - $data_skills[skill_id].sp_cost) < (self.hp *
($game_system.wcw_blood_limit / 100)) && test)

end

  end
end

#----------------------------------------------------------------------------
# * Code to make sure bloodmages consume HP instead of MP
#----------------------------------------------------------------------------
class Scene_Battle

# Backs up make_skill_action_result
alias make_skill_action_result_wcw_bloodmage_later make_skill_action_result

#----------------------------------------------------------------------------
# - make_skill_action_result(battler=nil)
# Execute skill
#----------------------------------------------------------------------------
def make_skill_action_result(battler = @active_battler)
make_skill_action_result_wcw_bloodmage_later battler
# Reduce HP, and put the SP back where it should be :P
if battler.wcw_bloodmage_applies?
battler.hp -= @skill.sp_cost
battler.sp += @skill.sp_cost
end
@status_window.refresh
end

end
Title: Re: [XP] Blood Mage 1.80
Post by: Blizzard on June 26, 2009, 12:09:44 pm
Alternatively you can use G_G's HP Consuming Skill in Tons of Add-ons.
Title: Re: [XP] Blood Mage 1.80
Post by: FenrisHalo on June 26, 2009, 01:11:22 pm
sounds a bit like you're advertising for tons, but I guess you're right
Title: Re: [XP] Blood Mage 1.80
Post by: Blizzard on June 26, 2009, 01:25:24 pm
I'm just saying that because WcW made so many (buggy) versions of this that I kind of lost interest in adding the script to Tons. Instead I told G_G to make another script which I just revised and optimized then.
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on June 26, 2009, 01:27:51 pm
Meh. Half of them were made without any testing and this version is just crap. >_<

I'm also far too lazy to fix this. I might get around to that whenever I download the Windows 7 RC. X[
Title: Re: [XP] Blood Mage 1.80
Post by: Blizzard on June 26, 2009, 01:28:57 pm
I know. >.<
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on June 26, 2009, 01:39:19 pm
Quote from: FenrisHalo on June 26, 2009, 10:17:21 am
*Ahem*It's a month since some1 last posted something... But anyway, I got version 1.7.1 right here:
I'm not putting it in a spoiler, it minimizes the box :P
=begin
Bloodmage Script v 1.7.1
by WcW

Introduction:
I made this script for Akkein (a.k.a. Akkrin) at
http://forum.chaos-project.com/ at his request. If you use
this script in your game, please make sure that you give him,
as well as myself, credits. For instructions on how to use this
script, refer to the "Instructiions" section further below.

Features:
- Allows for some actors/spells to consume HP rather than SP
- Can set bloodmages either by selecting specific actors
or by declaring "Bloodmage" classes
- Can define some spells to be used as blood spells regardless
of class/actor, and set others to be used as regular spells,
even by Bloodmages
- Can optionally set a minimum percent of HP an actor must
have left to use a Blood spell
- Small, light code with high chance of compatibility with
most scripts that are compatibility with the default
battle system, and _possibly_ BlizzABS

Version History:
1.0.0: Initial release; supported only basic HP consumption
1.0.2: Small Bug Fixes
1.1.2: Removed bug where skill checked for SP as well as HP
1.2.2: Add option for whether or not actors should be able
to kill themselves with Blood spells
1.3.2: Added Blizzard's optimized code.
1.3.3: Fixed a small bug left by Blizzard (:P)
1.4.3: Rewrote some of Blizzard's code for more Blood Mage
goodness :)
1.4.4: Fixed status window bug (wouldn't refresh)
1.4.5: Fixed bug where Blood Mages were unaffected
by things such as Half SP Cost.
1.4.6: Fixed another bug where it didn't consume
any HP at all if the blood mage had 0 SP
thanks to the last two bug fixes.
1.5.6: Added a new function that allows you to disable
the bloodmage effect for certain skills, and optimized
the code some more.
1.5.7: Fixed errors wtih RTAB
1.5.8: Fixed bugs
1.5.9: Fixed error with $game_system.bloodmage_not
1.7.0: Cleaned up code tremendously, added several new options,
improved compatibility, changed configuration. Testing
version; may not work. Please report all errors at
http://forum.chaos-project.com/.
1.7.1: Fixed error

Instructions:
This script should ideally be placed below all default RMXP
scripts and above all of Blizzard's scripts, as well as RMXP's
"Main" script.

To set up the default configuration:
---
To add actors that will be Bloodmages regardless of class:
- Add the actors ID between the brackets on line 153,
separating all ID's with commas.
---
To add classes that will be Bloodmages, regardless of actor:
- Add the class ID between the brackets on line 156,
similarly to setting up actors.
---
To add skills that will consume HP regardless of actor/class:
- Add the ID between the brackets on line 160,
same as the last two configuration options.
---
To add skills that will never sonsume HP:
- Add the ID between the brackets on line 163, same as
the last three.
---
To set actors to die/not die when they use too much HP:
- Replace 'false/true' with 'true/false' on line 170
to invert the current setting.
---
To set the minimum percent of HP a Bloodmage must have
to use a skill while the last option is set to 'false':
- Simply change the number on line 175
---

To edit configuration in an event/script:
( note: in each of these, <v> will represent the ID
  of the actor, class, or skill being spoken of, or
  value for the config option being spoken of )
  ---
To add an actor to the Bloodmages list:
- $game_system.wcw_bloodusers.push <v>
To remove an actor from the Bloodmages list:
- $game_system.wcw_bloodusers.delete <v>
---
To add a class to the Bloodmages list:
- $game_system.wcw_bloodmages.push <v>
To remove a class from the Bloodmages list:
- $game_system.wcw_bloodusers.delete <v>
---
To add an HP-consuming skill to the Bloodmages list:
- $game_system.wcw_bloodskills.push <v>
To remove an HP-consuming skill from the Bloodmages list:
- $game_system.wcw_bloodskills.delete <v>
---
To add a non-HP-consuming skill to the Bloodmages list:
- $game_system.wcw_dryskills.push <v>
To remove a non-HP-consuming skill from the Bloodmages list:
- $game_system.wcw_dryskills.delete <v>
---
To set Bloodmages to die when they use too much HP:
- $game_system.wcw_blood_die = true
To set Bloodmages to live when they use too much HP:
- $game_system.wcw_blood_die = false
---
To set the minimum percent of health a bloodmage must
have to use a skill when the last setting is 'false':
- $game_system.wcw_blood_limit = <v>
---

Compatibility:
If you find any issues, post them at http://forum.chaos-project.com/.

Credits:
Blizzard, for helping me learn to script, pointing out a bug, and optimizing
code
Fantasist, for getting me to come back to RMXP
Akkrin, for giving me the Blood Mage idea
Myself, for scripting it
Cid, for reporting an error ;)

Enjoy |:]
=end

#----------------------------------------------------------------------------
# * CONFIG (redefinition of Game_System class)
#     Configuration section :)
#----------------------------------------------------------------------------
class Game_System

# Defines getter's and setter's for configuration variables
attr_accessor :wcw_bloodusers, :wcw_bloodmages
attr_accessor :wcw_bloodskills, :wcw_dryskills
attr_accessor :wcw_blood_die, :wcw_blood_limit
# Backs up the old initialize method
alias init_wcw_bloodmage_later initialize

#------------------------------------------------------------------------
# - initialize
# First method called :P
#------------------------------------------------------------------------
def initialize

# This variable stores the ID's of all classes which should consume
# HP over MP.
@wcw_bloodusers = []
# This variable stores the ID's of all actors that act as
# bloodmages, even though their class is not a bloodmage.
@wcw_bloodmages = []

# This variable stores the ID's of all skills which will act as
# bloodmage skills, even if the actor using it isn't a bloodmage
@wcw_bloodskills = []
# This variable stores the ID's of all skills which will not cause
# a bloodmage to lose HP if they use them.
@wcw_dryskills = []

# If this variable is set to "true," bloodmages will be able to kill
# themselves if they use to much HP (it will use more HP than the
# actor has, even if it is not enough for the skill.) If it is
# set to false, they will only be able to use the skills until it
# would put them below $game_system.wcw_blood_limit.
@wcw_blood_die = false
# This number must be set from 1 to 100. It signifies the minimum
# percent of HP an actor must have to use a skill if
# $game_system.wcw_blood_die is set to "false. 0 is default,
# and means the actor can use skills until his HP is 1.
@wcw_blood_limit = 0

    return init_wcw_bloodmage_later

  end

end

#----------------------------------------------------------------------------
# * Bulk of the code (redefinition of some Game_Battler code)
#----------------------------------------------------------------------------
class Game_Battler

# Backs up skill_can_use?(skill_id)
alias skill_can_use_wcw_bloodmage_later skill_can_use? #lol, long name :P

#------------------------------------------------------------------------
# - wcw_is_bloodmage?()
# Checks to see if actor is a bloodmage.
#------------------------------------------------------------------------
def wcw_is_bloodmage?

return self.is_a?(Game_Actor) && (
$game_system.wcw_bloodusers.include?(self.class_id) ||
$game_system.wcw_bloodmages.include?(self.id) )

end

def wcw_bloodmage_applies?(skill_id)
return (wcw_is_bloodmage? && !
$game_system.wcw_dryskills.include?(skill_id)) ||
$game_system.wcw_bloodskills.include?(skill_id)
end

#------------------------------------------------------------------------
# - skill_can_use?(skill_id)
# Checks to see if a skill can be used
#------------------------------------------------------------------------
def skill_can_use?(skill_id)

# Go ahead and pass it on if the actor isn't a bloodmage or the
# skill isn't a bloodskill
unless wcw_bloodmage_applies? skill_id
return skill_can_use_wcw_bloodmage_later(skill_id)
end

# If the actor can die, let them;
if $game_system.wcw_blood_die
return skill_can_use_wcw_bloodmage_later skill_id
# Otherise, ensure that they have enough HP:
else
# Make sure that SP does not affect calculations;
# simplest way to do this an maintain compatibility
old_sp = self.sp
if self.sp < $data_skills[skill_id].sp_cost
self.sp = $data_skills[skill_id].sp_cost
end

# Test for skill the old way, always having enough SP
test = skill_can_use_wcw_bloodmage_later skill_id

# Restore SP
self.sp = old_sp

# Return the answer
return ((self.hp - $data_skills[skill_id].sp_cost) < (self.hp *
($game_system.wcw_blood_limit / 100)) && test)

end

  end
end

#----------------------------------------------------------------------------
# * Code to make sure bloodmages consume HP instead of MP
#----------------------------------------------------------------------------
class Scene_Battle

# Backs up make_skill_action_result
alias make_skill_action_result_wcw_bloodmage_later make_skill_action_result

#----------------------------------------------------------------------------
# - make_skill_action_result(battler=nil)
# Execute skill
#----------------------------------------------------------------------------
def make_skill_action_result(battler = @active_battler)
make_skill_action_result_wcw_bloodmage_later battler
# Reduce HP, and put the SP back where it should be :P
if battler.wcw_bloodmage_applies?
battler.hp -= @skill.sp_cost
battler.sp += @skill.sp_cost
end
@status_window.refresh
end

end


I was looking for 1.73b personally, it's the only release that's worked perfectly for me :(
Title: Re: [XP] Blood Mage 1.80
Post by: FenrisHalo on June 26, 2009, 01:48:29 pm
I'm heartbroken  :<_<:

Seriously though, I don't think I have it :(

And Imma getting the whole 7 for free, cuz thats what u GET with a new laptop!
Or will it be free anyway?
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on June 26, 2009, 01:50:28 pm
Quote from: FenrisHalo on June 26, 2009, 01:48:29 pm
I'm heartbroken  :<_<:

Seriously though, I don't think I have it :(

And Imma getting the whole 7 for free, cuz thats what u GET with a new laptop!
Or will it be free anyway?


I got a new laptop half a year ago, so I'm fine for now :P

*looks up the cost* Apparently, no, it's still exorbitantly high. (http://arstechnica.com/microsoft/news/2009/06/windows-7-pricing-announced-cheaper-than-vista.ars)
Title: Re: [XP] Blood Mage 1.80
Post by: FenrisHalo on June 26, 2009, 01:53:38 pm
"cheaper than vista"? Who the h*ll ever liked Vista? Anyone mind if I call them stoopid? Well, from today onwards, Zepto's offering a free Windows 7 update, so I'll be the last to be :negative:.

I'm off to have no life now, cya ;)
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on June 26, 2009, 01:53:47 pm
Quote from: FenrisHalo on June 26, 2009, 01:48:29 pm
I'm heartbroken  :<_<:

Seriously though, I don't think I have it :(

It's fine, thanks for trying though.
Title: Re: [XP] Blood Mage 1.80
Post by: fugibo on June 26, 2009, 01:56:41 pm
*checks* No, I don't have that one. I think I only have 1.80 and 1.6x. :(
Title: Re: [XP] Blood Mage 1.80
Post by: omegapirate2000 on June 28, 2009, 12:50:33 pm
Can you try posting 1.6x?

Sorry, this is like, the only thing stopping me from releasing the second chapter of my game :P
Title: Re: [XP] Blood Mage 1.80
Post by: Keyren on April 12, 2012, 01:06:37 pm
hello I have just recorded ^ ^ I have a problem with this script, I set to ID for skill, characters, etc., but when I go to use the skill gives me error on the line 293 type 'NoMethodError' undefined method [] for nil:NilClass. Maybe it's an incompatibility problem? Using the Battle System standard, the Tons of Add-ons, the Advanced Weather, the Climate and Time Complete System, the Zer0_CMS and Full View+Xcam(I'm not sure that the name is because this script is Chinese, in effect, creates a sort of dynamic framing during the battle) I thought that was the cause, but also eliminates changes nothing>__<. Thanks in advance, I hope it's understandable I'm Italian and in some parts I used a translatorxD
Title: Re: [XP] Blood Mage 1.80
Post by: Blizzard on April 17, 2012, 10:16:02 am
I thought I integrated this script into Tons of Add-ons. If yes, you should use Tons of Add-ons instead.

EDIT:

Quote from: Blizzard on June 26, 2009, 12:09:44 pm
Alternatively you can use G_G's HP Consuming Skill in Tons of Add-ons.