04-12-2012, 05:09 PM
I was planning on going to bed after I dropped my son off for school, but got side-tracked by working on this some more! I'll put the old and new up side-by-side so you can get a feel for all the extra pixel scribbles I've done.
I'm sure most people have heard the old version of this cover track, but I've since kicked it into some next level shit. I've had this on bb.ohsk.net for awhile now so I'm sure I've shown some poor lonely soul in IRC, yet I don't think I've posted this version on the forum, so to show the rest of the world I don't fuck around, here is my rendition of Ozzy Osbourne's hit "Over the Mountain" so enjoy!
Over The Mountain (Cover)
Oh yeah, and I did some scripting earlier too! This one is for skills that require that you have certain items. Just as an example, your "Egress" skill that takes you to an inn might require a Warp Stone. Anyways, I'm adding more to this tomorrow so that, not only can skills require items but can, optionally, use items as well. By the way, if anybody has an Enemy Uses Items script, especially if the enemies have their own inventory, you can link me and I'll write a patch on request, otherwise I'll probably write my own.
I'm sure most people have heard the old version of this cover track, but I've since kicked it into some next level shit. I've had this on bb.ohsk.net for awhile now so I'm sure I've shown some poor lonely soul in IRC, yet I don't think I've posted this version on the forum, so to show the rest of the world I don't fuck around, here is my rendition of Ozzy Osbourne's hit "Over the Mountain" so enjoy!
Over The Mountain (Cover)
Oh yeah, and I did some scripting earlier too! This one is for skills that require that you have certain items. Just as an example, your "Egress" skill that takes you to an inn might require a Warp Stone. Anyways, I'm adding more to this tomorrow so that, not only can skills require items but can, optionally, use items as well. By the way, if anybody has an Enemy Uses Items script, especially if the enemies have their own inventory, you can link me and I'll write a patch on request, otherwise I'll probably write my own.
Code:
#===============================================================================
# ** Skills : Require Goods
#===============================================================================
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
if Object.const_defined?(:SDK)
SDK.log('Skills.RequireGoods', 'Kain Nobel ©', 4.0, '2012.04.12')
end
#===============================================================================
# ** RPG::Skill
#===============================================================================
class RPG::Skill
#=============================================================================
# ** RPG::Skill::Required
#=============================================================================
module Required
#---------------------------------------------------------------------------
# * Items
# {skill_id => item_id, ...}
# {skill_id => [item_id, ...], ...}
# {skill_id => {item_id => quantity, ...}, ...}
#---------------------------------------------------------------------------
Items = {
1 => 1, # Skill 1 needs a single Potion
2 => [2, 3], # Skill 2 needs a single of two seperate items
3 => {4 => 2, 5 => 2} # Skill 3 needs 2 of both these items
}
#---------------------------------------------------------------------------
# * Armors
# {skill_id => armor_id, ...}
# {skill_id => [armor_id, ...], ...}
# {skill_id => {armor_id => quantity, ...}, ...}
#---------------------------------------------------------------------------
Armors = {
}
#---------------------------------------------------------------------------
# * Weapons
# {skill_id => weapon_id, ...}
# {skill_id => [weapon_id, ...], ...}
# {skill_id => {weapon_id => quantity, ...}, ...}
#---------------------------------------------------------------------------
Weapons = {
}
#---------------------------------------------------------------------------
# * Defaults (*Don't touch*)
#---------------------------------------------------------------------------
Items.default, Armors.default, Weapons.default = [], [], []
end
#-----------------------------------------------------------------------------
# * Required Items
#-----------------------------------------------------------------------------
def required_items
@required_items ||= get_required_objects(Required::Items)
end
#-----------------------------------------------------------------------------
# * Required Armors
#-----------------------------------------------------------------------------
def required_armors
@required_armors ||= get_required_objects(Required::Armors)
end
#-----------------------------------------------------------------------------
# * Required Weapons
#-----------------------------------------------------------------------------
def required_weapons
@required_weapons ||= get_required_objects(Required::Weapons)
end
#-----------------------------------------------------------------------------
# * Get Required Objects
#-----------------------------------------------------------------------------
def get_required_objects(const)
data = Hash.new
case const[@id]
when Integer ; data[const[@id]] = 1
when Array ; const[@id].each {|val| data[val] = 1}
when Hash ; data = const[@id]
end
data
end
#-----------------------------------------------------------------------------
# * Required Items?
#-----------------------------------------------------------------------------
def required_items?
required_items.each do |id, quant|
return false unless $game_party.item_number(id) >= quant
end
required_armors.each do |id, quant|
return false unless $game_party.armor_number(id) >= quant
end
required_weapons.each do |id, quant|
return false unless $game_party.weapon_number(id) >= quant
end
return true
end
end
#===============================================================================
# ** Game_Battler
#===============================================================================
class Game_Battler
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :skillsconsitems_gmbattler_skilleffect, :skill_effect
#-----------------------------------------------------------------------------
# * Skill Effect
#-----------------------------------------------------------------------------
def skill_effect(*args)
result = skillsconsitems_gmbattler_skilleffect(*args)
user, skill = args[0], args[1]
if user.is_a?(Game_Actor)
skill.required_items.each {|a, b| $game_party.lose_item(a, b)}
skill.required_armors.each {|a, b| $game_party.lose_armor(a, b)}
skill.required_weapons.each {|a, b| $game_party.lose_weapon(a, b)}
end
result
end
end
#===============================================================================
# ** Game_Actor
#===============================================================================
class Game_Actor
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :skillsconsitems_gmactor_skillcanuse?, :skill_can_use?
#-----------------------------------------------------------------------------
# * Skill Can Use?
#-----------------------------------------------------------------------------
def skill_can_use?(skill_id)
return false unless $data_skills[skill_id].required_items?
skillsconsitems_gmactor_skillcanuse?(skill_id)
end
end