=begin #============================================================================== ** Effect: Coin Toss Author: Hime Date: Oct 4, 2012 ------------------------------------------------------------------------------ ** Change log Oct 4, 2012 - initial release ------------------------------------------------------------------------------ ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header ------------------------------------------------------------------------------ ** Required -Effect Manager (http://www.rpgmakervxace.net/topic/7395-effect-manager/) ------------------------------------------------------------------------------ This script adds 'Coin Toss' effect to your item/skill. It allows you to damage using money. Just tag your item/skill with #============================================================================== =end $imported = {} if $imported.nil? $imported["Effect_CoinToss"] = true #============================================================================== # ** Configuration #============================================================================== module Effect module Coin_Toss Effect_Manager.register_effect(:coin_toss) end end #============================================================================== # ** Rest of the script #============================================================================== class Game_Battler < Game_BattlerBase def item_effect_coin_toss(user, item, effect) #stub end end class Game_Enemy < Game_Battler # you should customize it to suit your needs this is just an example def item_effect_coin_toss(user, item, effect) # just hardcoded amount = 5000 # adjust for max/min amount = [[$game_party.gold - amount, 0].max, amount].min $game_party.lose_gold(amount) self.hp = [self.hp - amount, 0].max @result.effect_results.push("%s tossed %d coins at %s" %[user.name, amount, self.name]) @result.success = true end end