Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Shop Taxes VX, They are everywhere now...
Delyemerald2
post Feb 14 2010, 12:27 PM
Post #1


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Script Info
With this script you can add taxes to shops, or even add discounts. Depending on the item's price, you can make taxes or discounts everywhere. You can even create shops which will give you money when you buy an item if you overdo the discounts.

Features
Taxes (in percentage)
Discounts (in percentage)
Taxes (in amounts)
Discounts (in amounts)
Free items
Free items with money
Items (that are free normally) with a price

Screens
[Show/Hide] Normally

[Show/Hide] With Tax

[Show/Hide] With Discount

[Show/Hide] Overdid it a little =P


Script
[Show/Hide] Beta 2.5
CODE
#============================================================================
# Tax Script 2.5 (BETA)(VX)
#----------------------------------------------------------------------------
# Originally made by Falcon for RMXP (see further info at bottom of this part)
# Edited by Delyemerald2 to fit the RMVX
#----------------------------------------------------------------------------
# This system adds something to shop status, but in the same process, copies
# Everything normally there.
# With this script, you can add taxes or discounts.
# In order to do so, use the command Script in an event and enter this:
# (For Taxes)
# $game_system.tax.percent = x
# Where x is a value above 0 (will be counted in percentages)
# $game_system.tax.direct = y
# Where y is a value above 0 (this will be added to the base prices)
# (For Discounts)
# $game_system.tax.percent = x
# Where x is a value below 0 (will be counted in percentages)
# $game_system.tax.direct = y
# Where y is a value below 0 (this will be added to the base prices)
#----------------------------------------------------------------------------
# Credits to:
# Falcon for the original script
# Blizard for the idea that triggered version 2.0 (Falcon's Credits)
# You, becuase you eat a cookie in your life =D
#----------------------------------------------------------------------------
# ORIGINAL INFO (RMXP Version)
#----------------------------------------------------------------------------
# By Falcon
# Thanks to Blizzard for the idea that triggered version 2.0
#----------------------------------------------------------------------------
# This system should be compatible with all shop systems, but the
# Shop Status window will only show the tax/discount rate for the default
#============================================================================

# setup the variable that will hold the tax rate
class Game_System::Tax
   Direct_First = true
   attr_accessor :percent
   attr_accessor :direct
   def initialize
     @percent = 0
     @direct = 0
   end
end

  
class Game_System
   attr_reader :tax
   alias_method :delyemerald2_tax_init, :initialize
   def initialize
     delyemerald2_tax_init
     @tax = Tax.new
   end
end
  
# increase the price of the following items by the tax rate
class RPG::Item
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class RPG::Weapon
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class RPG::Armor
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 240, 304)
    @item = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
# Here you can customize what there will stand when there's a tax. You can also
# edit the heights of the words and numbers. One warning: Don't make it to long
# or it will overlap the percentages.
      if $game_system.tax.percent > 0 # If there is tax
       self.contents.draw_text(4, 16, 200, WLH, "Current Tax")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.tax.percent.to_s + "%", 2)
     elsif 0 > $game_system.tax.percent # If there is a discount rate
       self.contents.draw_text(4, 16, 200, WLH, "Discount")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.tax.percent.to_s + "%", 2)
     end
      if $game_system.tax.direct > 0 # If there is tax
       self.contents.draw_text(4, 32, 200, WLH, "Tax (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.tax.direct.to_s , 2)
     elsif 0 > $game_system.tax.direct # If there is a discount rate
       self.contents.draw_text(4, 32, 200, WLH, "Discount (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.tax.direct.to_s , 2)
     end
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index * 2)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
    draw_item_name(item1, x, y + WLH, enabled)
  end
  #--------------------------------------------------------------------------
  # * Get Weaker Weapon Equipped by the Actor (for dual wielding)
  #     actor : actor
  #--------------------------------------------------------------------------
  def weaker_weapon(actor)
    if actor.two_swords_style
      weapon1 = actor.weapons[0]
      weapon2 = actor.weapons[1]
      if weapon1 == nil or weapon2 == nil
        return nil
      elsif weapon1.atk < weapon2.atk
        return weapon1
      else
        return weapon2
      end
    else
      return actor.weapons[0]
    end
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : new item
  #--------------------------------------------------------------------------
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
end

CODE
#============================================================================
# Tax Script 2.0 (VX)
#----------------------------------------------------------------------------
# Originally made by Falcon for RMXP (see further info at bottom of this part)
# Edited by Delyemerald2 to fit the RMVX
#----------------------------------------------------------------------------
# This system adds something to shop status, but in the same process, copies
# Everything normally there.
# With this script, you can add taxes or discounts.
# In order to do so, use the command Script in an event and enter this:
# (For Taxes)
# $game_system.taxrate = x
# Where x is a value above 0 (will be counted in percentages)
# $game_system.taxamount = y
# Where y is a value above 0 (this will be added to the base prices)
# (For Discounts)
# $game_system.taxrate = x
# Where x is a value below 0 (will be counted in percentages)
# $game_system.taxamount = y
# Where y is a value below 0 (this will be added to the base prices)
#----------------------------------------------------------------------------
# Credits to:
# Falcon for the original script
# Blizard for the idea that triggered version 2.0 (Falcon's Credits)
# You, becuase you eat a cookie in your life =D
#----------------------------------------------------------------------------
# ORIGINAL INFO (RMXP Version)
#----------------------------------------------------------------------------
# By Falcon
# Thanks to Blizzard for the idea that triggered version 2.0
#----------------------------------------------------------------------------
# This system should be compatible with all shop systems, but the
# Shop Status window will only show the tax/discount rate for the default
#============================================================================

# setup the variable that will hold the tax rate
class Game_System
  attr_accessor :taxrate
  attr_accessor :taxamount
  alias declaration initialize
  def initialize
    declaration
    @taxrate = 0
    @taxammount = 0
  end
end

# increase the price of the following items by the tax rate
class RPG::Item
  def price
    return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
  end
end

class RPG::Weapon
  def price
    return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
  end
end

class RPG::Armor
  def price
    return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
  end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 240, 304)
    @item = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
# Here you can customize what there will stand when there's a tax. You can also
# edit the heights of the words and numbers. One warning: Don't make it to long
# or it will overlap the percentages.
      if $game_system.taxrate > 0 # If there is tax
       self.contents.draw_text(4, 16, 200, WLH, "Current Tax")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.taxrate.to_s + "%", 2)
     elsif 0 > $game_system.taxrate # If there is a discount rate
       self.contents.draw_text(4, 16, 200, WLH, "Discount")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.taxrate.to_s + "%", 2)
     end
      if $game_system.taxamount > 0 # If there is tax
       self.contents.draw_text(4, 32, 200, WLH, "Tax (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.taxamount.to_s , 2)
     elsif 0 > $game_system.taxamount # If there is a discount rate
       self.contents.draw_text(4, 32, 200, WLH, "Discount (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.taxamount.to_s , 2)
     end
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index * 2)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
    draw_item_name(item1, x, y + WLH, enabled)
  end
  #--------------------------------------------------------------------------
  # * Get Weaker Weapon Equipped by the Actor (for dual wielding)
  #     actor : actor
  #--------------------------------------------------------------------------
  def weaker_weapon(actor)
    if actor.two_swords_style
      weapon1 = actor.weapons[0]
      weapon2 = actor.weapons[1]
      if weapon1 == nil or weapon2 == nil
        return nil
      elsif weapon1.atk < weapon2.atk
        return weapon1
      else
        return weapon2
      end
    else
      return actor.weapons[0]
    end
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : new item
  #--------------------------------------------------------------------------
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
end


Instructions
Paste above main, underneath ALL standard shop scripts.
Depending on the version you use:
(v2.0)Use the command Script in an event and enter this:
(For Taxes)
$game_system.taxrate = x
Where x is a value above 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value above 0 (this will be added to the base prices)
(For Discounts)
$game_system.taxrate = x
Where x is a value below 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value below 0 (this will be added to the base prices)
(v2.5)Use the command Script in an event and enter this:
(For Taxes)
$game_system.tax.percent = x
Where x is a value above 0 (will be counted in percentages)
$game_system.tax.direct = y
Where y is a value above 0 (this will be added to the base prices)
(For Discounts)
$game_system.tax.percent = x
Where x is a value below 0 (will be counted in percentages)
$game_system.tax.direct= y
Where y is a value below 0 (this will be added to the base prices)

Coming
Nothing coming yet.

Credits
Falcon for the original RMXP version
Sephirothspawn for giving me a small modified part of the script as start of v2.5

This post has been edited by Delyemerald2: Feb 17 2010, 11:35 PM


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
Frousteleous
post Feb 14 2010, 02:18 PM
Post #2


Level 2
Group Icon

Group: Member
Posts: 16
Type: Mapper
RM Skill: Advanced




This is really ingenious. I've always hated that item prices couldnt vary from shop to shop, but this script allows you to do just that.

I havnt tried it out yet, but i definitely will later.

If I have any problems, ill let you know, though there shouldnt be any, seeing as this is a very foreward script.
Go to the top of the page
 
+Quote Post
   
benbarrett
post Feb 15 2010, 12:38 PM
Post #3


Level 3
Group Icon

Group: Member
Posts: 30
Type: Writer
RM Skill: Advanced




Hey, this works great. Thanks for posting. This will definitely add a bit more realism to games, especially if tax rates fluctuate as time goes by or differ from area to area.

Great job! smile.gif

-Ben


__________________________

"Ask for some palm trees, or tales from the South Seas, and I just might turn your head." -Twelve Volt Man, Jimmy Buffett
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 15 2010, 09:51 PM
Post #4


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Thanks for both your comments. I also I think I'll get this script finished today.


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 16 2010, 09:31 AM
Post #5


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




UPDATE
I've added version 2.0
This version adds:
Taxes based on amounts.
Discounts based on amounts.
The possibility to give a price to items which are normally free.

Also, please review the instructions. I made some mistakes in the older version.
Last, I will accept some request to update this script with the requested functions (not to hard please, just a beginner =P).


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
pultilian
post Feb 16 2010, 10:32 AM
Post #6


Level 1
Group Icon

Group: Member
Posts: 5
Type: Event Designer
RM Skill: Skilled




I ran into this error

Script ‘Taxes’ line 51: TypeError occurred
Nil can’t be coerced into fixnum.
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 16 2010, 10:37 AM
Post #7


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




My bad.
I misspelled amount everytime, and thought I had fixed that. But I forgot one. Go back to the script, and at line 44, remove a M from the "@taxammount = 0"


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
pultilian
post Feb 16 2010, 10:44 AM
Post #8


Level 1
Group Icon

Group: Member
Posts: 5
Type: Event Designer
RM Skill: Skilled




QUOTE (Delyemerald2 @ Feb 16 2010, 10:37 AM) *
My bad.
I misspelled amount everytime, and thought I had fixed that. But I forgot one. Go back to the script, and at line 44, remove a M from the "@taxammount = 0"


Sorry, but it is still not working.

This post has been edited by pultilian: Feb 16 2010, 10:44 AM
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 16 2010, 10:56 AM
Post #9


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Oke, then tell me these things:

Did it happened while starting up the game?
If yes, where did you paste the script exactly and do you have any other custom shop scripts (or add-ons, it can be a compatibility issue)?

If no, please give me the event where the error occured in. (what you typed)


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
pultilian
post Feb 16 2010, 11:43 AM
Post #10


Level 1
Group Icon

Group: Member
Posts: 5
Type: Event Designer
RM Skill: Skilled




QUOTE (Delyemerald2 @ Feb 16 2010, 10:56 AM) *
Oke, then tell me these things:

Did it happened while starting up the game?
If yes, where did you paste the script exactly and do you have any other custom shop scripts (or add-ons, it can be a compatibility issue)?

If no, please give me the event where the error occured in. (what you typed)

It happened while talking (using action key) to an event with shop processing and the script command $game_system.taxamount = 10

This post has been edited by pultilian: Feb 16 2010, 12:13 PM
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 16 2010, 12:12 PM
Post #11


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Did you use those []'s in the script also? They don't belong there.
Else, first try replacing that script at top of the materials, or right beneath the Window_ShopStatus script.
If that doesn't work, tell me what scripts you use that are related with the shopsystem.


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
pultilian
post Feb 16 2010, 12:18 PM
Post #12


Level 1
Group Icon

Group: Member
Posts: 5
Type: Event Designer
RM Skill: Skilled




I did not use the [ ] and I have no other scripts that have any thing to do with it except [mabye] Enix_FFGlass Window v1.0 by Speed@.
It sometimes works if you put a tax and discount in the same event.
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 16 2010, 11:04 PM
Post #13


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Weird, that shouldn't happen...
I will try to make an other version of the script. Try that one. If it doesn't work, then I think it's because this script is not compatible with that menu script. And if that is the case, I'll try to make it compatible.

EDIT
Try this:

CODE
#============================================================================
# Tax Script 2.5 (BETA)(VX)
#----------------------------------------------------------------------------
# Originally made by Falcon for RMXP (see further info at bottom of this part)
# Edited by Delyemerald2 to fit the RMVX
#----------------------------------------------------------------------------
# This system adds something to shop status, but in the same process, copies
# Everything normally there.
# With this script, you can add taxes or discounts.
# In order to do so, use the command Script in an event and enter this:
# (For Taxes)
# $game_system.tax.percent = x
# Where x is a value above 0 (will be counted in percentages)
# $game_system.tax.direct = y
# Where y is a value above 0 (this will be added to the base prices)
# (For Discounts)
# $game_system.tax.percent = x
# Where x is a value below 0 (will be counted in percentages)
# $game_system.tax.direct = y
# Where y is a value below 0 (this will be added to the base prices)
#----------------------------------------------------------------------------
# Credits to:
# Falcon for the original script
# Blizard for the idea that triggered version 2.0 (Falcon's Credits)
# You, becuase you eat a cookie in your life =D
#----------------------------------------------------------------------------
# ORIGINAL INFO (RMXP Version)
#----------------------------------------------------------------------------
# By Falcon
# Thanks to Blizzard for the idea that triggered version 2.0
#----------------------------------------------------------------------------
# This system should be compatible with all shop systems, but the
# Shop Status window will only show the tax/discount rate for the default
#============================================================================

# setup the variable that will hold the tax rate
class Game_System::Tax
   Direct_First = true
   attr_accessor :percent
   attr_accessor :direct
   def initialize
     @percent = 0
     @direct = 0
   end
end

  
class Game_System
   attr_reader :tax
   alias_method :delyemerald2_tax_init, :initialize
   def initialize
     delyemerald2_tax_init
     @tax = Tax.new
   end
end
  
# increase the price of the following items by the tax rate
class RPG::Item
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class RPG::Weapon
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class RPG::Armor
   def price
     return Integer(@price + $game_system.tax.direct + @price * $game_system.tax.percent / 100)
   end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 240, 304)
    @item = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
# Here you can customize what there will stand when there's a tax. You can also
# edit the heights of the words and numbers. One warning: Don't make it to long
# or it will overlap the percentages.
      if $game_system.tax.percent > 0 # If there is tax
       self.contents.draw_text(4, 16, 200, WLH, "Current Tax")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.tax.percent.to_s + "%", 2)
     elsif 0 > $game_system.tax.percent # If there is a discount rate
       self.contents.draw_text(4, 16, 200, WLH, "Discount")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 16, 104, WLH, $game_system.tax.percent.to_s + "%", 2)
     end
      if $game_system.tax.direct > 0 # If there is tax
       self.contents.draw_text(4, 32, 200, WLH, "Tax (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.tax.direct.to_s , 2)
     elsif 0 > $game_system.tax.direct # If there is a discount rate
       self.contents.draw_text(4, 32, 200, WLH, "Discount (A)")
       self.contents.font.color = normal_color
       self.contents.draw_text(100, 32, 104, WLH, $game_system.tax.direct.to_s , 2)
     end
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index * 2)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
    draw_item_name(item1, x, y + WLH, enabled)
  end
  #--------------------------------------------------------------------------
  # * Get Weaker Weapon Equipped by the Actor (for dual wielding)
  #     actor : actor
  #--------------------------------------------------------------------------
  def weaker_weapon(actor)
    if actor.two_swords_style
      weapon1 = actor.weapons[0]
      weapon2 = actor.weapons[1]
      if weapon1 == nil or weapon2 == nil
        return nil
      elsif weapon1.atk < weapon2.atk
        return weapon1
      else
        return weapon2
      end
    else
      return actor.weapons[0]
    end
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : new item
  #--------------------------------------------------------------------------
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
end


Follow the new instructions, new commands are used.

This post has been edited by Delyemerald2: Feb 16 2010, 11:17 PM


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
pultilian
post Feb 17 2010, 02:23 PM
Post #14


Level 1
Group Icon

Group: Member
Posts: 5
Type: Event Designer
RM Skill: Skilled




Thanks, works great now. By the way great script.
Go to the top of the page
 
+Quote Post
   
Delyemerald2
post Feb 17 2010, 11:32 PM
Post #15


Level 2
Group Icon

Group: Member
Posts: 18
Type: Mapper
RM Skill: Skilled




Thanks, and congratz wink.gif


__________________________
~Auras, Crystal Miracles~
Go to the top of the page
 
+Quote Post
   
Unclellama
post Mar 1 2010, 05:08 AM
Post #16



Group Icon

Group: Member
Posts: 3
Type: Writer
RM Skill: Beginner




Thanks for this, it's just what I needed and works perfectly for me! I am using it as a 'negotiation' skill, where leveling the skill up decreases the tax in 5% increments - just in case anybody wanted a bit of inspiration.
Go to the top of the page
 
+Quote Post
   
PlainWalker
post Jun 30 2010, 09:36 PM
Post #17



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Beginner




I just used this script an I overall enjoy using it thanks for making it laugh.gif


__________________________
Go to the top of the page
 
+Quote Post
   
DementedCashew
post Jul 1 2010, 10:25 AM
Post #18


Big Sister
Group Icon

Group: Revolutionary
Posts: 242
Type: Developer
RM Skill: Skilled




I feel like licking the script... oh this is going to be so good iluvff.gif


__________________________


------------------------------------------------------------------------------------------
My Stuff



Go to the top of the page
 
+Quote Post
   
Mitsarugi
post Aug 22 2011, 02:24 AM
Post #19


Level 2
Group Icon

Group: Member
Posts: 23
Type: Developer
RM Skill: Intermediate




why the hell when i click on the "With Taxes" spoiler i see a photo of you and your Girlfriend?????
Go to the top of the page
 
+Quote Post
   
Supershadowmarti...
post Aug 29 2011, 04:51 AM
Post #20


Level 1
Group Icon

Group: Member
Posts: 12
Type: Developer
RM Skill: Intermediate




QUOTE (Mitsarugi @ Aug 22 2011, 02:24 AM) *
why the hell when i click on the "With Taxes" spoiler i see a photo of you and your Girlfriend?????


I was thinking that too.


__________________________
[/font][size="7"][/size] Who decied that Light i s good? And Darkness is Evil?




Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 07:46 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker