Sign in to follow this  
Followers 0
Tsukihime

effect
Golden Touch

3 posts in this topic

Effect: Golden Touch

-Tsukihime

 

This effect allows you to convert items in your inventory into gold.

The amount of gold received is based on the price of the item times the multiplier of the effect.

 

Download

 

Script: Download here

Required: Effect Manager

 

Usage

 

Tag your item/skill with

 

<eff: golden_touch x>
Where `x` is the gold multiplier

 

Screenshots

 

Here is a simple sequence of events

 

1. Selecting my skill

 

eff_golden_touch1.jpg

 

2. Choosing my item. Note the (somewhat) helpful help message

 

eff_golden_touch2.jpg

 

3. Gold!

 

eff_golden_touch3.jpg

Edited by Tsukihime
dbchest2 likes this

Share this post


Link to post
Share on other sites

i made change to this script so it will not go to scene map/ battle and stay in the scene_golden touch for more touching :D.

for the gold display i change it to use yanfly gab window (since i'm too lazy to made my own window and i think yanfly's gab window is easy to use and compatible with almost everything)

 

i also change the enabled? function to disable item with 0 price. so if you have item that is not key item but don't want it converted to gold just set the price to 0. you could add your own condition as well in that function if you want.

 

here's the script if anyone interested

ps: require yanfly gab window script. just search it or open yanfly blog.

 

 


 

=begin

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

** Effect: Golden Touch

Author: Tsukihime

Date: Oct 30, 2012

edited by estriole

requirement : yanfly gab window script

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

** Change log

Nov 03, 2012

- modded by estriole

 

Oct 30, 2012

- initial release

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

** Terms of Use

* Free to use in commercial/non-commercial projects

* 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://xtsukihime.wordpress.com/2012/10/05/effects-manager)

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

** Description

 

This script adds a "golden touch" effect to your skill.

When this effect is activated, you can select an item from your inventory

and turn it into gold.

 

The amount of gold received is based on the price of the item times the

multiplier of the effect.

 

Tag your item/skills with

<eff: golden_touch x>

 

Where x is some float representing the gold multiplier

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

=end

module Effects

module Golden_Touch

Effect_Manager.register_effect(:golden_touch, 1.6)

end

end

 

class RPG::UsableItem

 

# Check whether the operator is valid

def add_effect_golden_touch(code, data_id, args)

args[0] = args[0] ? args[0].to_f : 1

add_effect(code, data_id, args)

end

end

 

class Game_Battler < Game_BattlerBase

 

def item_effect_golden_touch_global(effect)

SceneManager.call(Scene_GoldenTouch)

SceneManager.scene.set_effect_callback(:effect_golden_touch, effect)

end

end

 

# Just a custom window for my effect

class Window_ItemList_GoldenTouch < Window_ItemList

 

# everything should be available for almost everything

def enable?(item)

return false if item.is_a?(RPG::Item) && item.key_item?

return false if item.price == 0 #will not convert item with 0 price

return true

end

 

# Let's just show the price of the item

def update_help

return unless item

name = item.name

if item.price == 0 || item.key_item?

@help_window.set_text("<cannot changed>")

else

@help_window.set_text("%s\nValue: %d gold" %[name,item.price])

end

end

end

 

# A new scene for selecting an item for the effect

class Scene_GoldenTouch < Scene_Item

 

def create_item_window

wy = @category_window.y + @category_window.height

wh = Graphics.height - wy

@gab_window = Window_Gab.new

@gab_window.z = 200 #to put the order on top other window

@gab_window.y += 300 #move the gab window to bottom

@item_window = Window_ItemList_GoldenTouch.new(0, wy, Graphics.width, wh)

@item_window.viewport = @viewport

@item_window.help_window = @help_window

@item_window.set_handler(:ok, method(:on_item_ok))

@item_window.set_handler(:cancel, method(:on_item_cancel))

@category_window.item_window = @item_window

end

 

def on_item_ok

if @effect_callback

send(@effect_callback)

else

super

end

@item_window.refresh

@item_window.activate

#back to window after converting one item

end

 

def effect_golden_touch

return if item.nil? #escape code when you convert the last of the item and click again

gained = item.price * @effect.value1[0]

name = item.name

$game_party.gain_gold(gained.to_i)

$game_party.lose_item(item, 1)

text = sprintf("You touch %s and turn it to %d %s!",name,gained,Vocab.currency_unit)

@gab_window.clear

@gab_window.setup(text,nil,nil)

 

end

end

 

 

 

 

 

edit: made it work for 2.0 above update (but not work in 1.6 because the changes made)

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.