Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Dark Souls System
- # Version: 1.8
- # Author: GGSlayer
- # Credit: Tsukihime
- # Required: Tsukihime's Item Instance
- # Date: 14th Nov, 2014
- #--------------------------------------------------------------------------------
- # ** Terms of Use
- #
- # * Free to use in non-commercial projects
- # * Contact me for commercial use
- # * Credits to GGSlayer and Tsukihime in your project
- #-------------------------------------------------------------------------------
- # Description:
- #
- # This Script allow you to Have one or More of dark souls game features
- #
- #-------------------------------------------------------------------------------
- # Instruction:
- #
- # - Just Copy And Paste Under Materials and Above Main Process
- #
- # - Everything Is Put As defult But You Can Chagne It In Editable Region
- #
- # - In Editablel Region do the following:
- #
- # - Exp_Unit: Unit Shown For Exp Ex.(Gold Unit is G)
- #
- # - Command_Name: Command Shown In Menu
- #
- # - Start_Class_Stat: Each Class Is Strong at something so you modify
- # stat at start of the game for each class (There Is Two Example
- # of how modify class stat)
- #
- # - Parameter_Increase_Per_Stat: How Much parameter Increase At level Up
- #
- # - In skill Note tag wright the following:
- # <(name of stat with small letter)(:)(space)(number that needed to learn skill)>
- # add (,) if you need multiple stat to learn skill, you have until 4 stats needed
- # ex:
- # <str: 5>
- # <str: 5, dex: 3>
- # <str: 5, dex: 3, int: 3>
- # <str: 5, dex: 3, int: 3, luk: 3>
- #
- # - In Weapon, Armor note tag wright The same note as skill note tag
- #
- # - When Equip Weapon or Armor you will see two stat color:
- # Red: If actor stat less than needed stat to equip weapon or armor
- # Green: If actor stat equal or more than needed
- # stat to equip weapon or armor
- #
- # - you can not use physical and magical skills if you not have the
- # right weapon
- #
- # - To specify attribute of weapon and skill write in note tag:
- # - Physical: to do physical skill
- # - Magical: to do magical skill
- # - Faith: to do faith skill
- #
- # - To add durability for weapon and armor write in note tag:
- # - <Durability Number>
- # - Number: Equipment Durability
- #
- # - Durability consume for skills that learned from weapon or armor write
- # In skill note tag:
- # - <w_id consume> For weapon
- # - <a_id consume> For armor
- # - id: Weapon or armor id that skill learned from
- # - consume: Durability consume from use that skill
- #
- # - For skills that effect durability write in skill note tag:
- # - <Effect amount>
- # - amount: amount of durability decrease from this skill
- #
- # - For make skills or items that recover equipment durability like
- # Repair powder write in skill or item note tag:
- # - <Repair percentage>
- # - percentage: percentage of eguipment durability that will return
- #
- # - you can return original stat by add this command in the event script:
- # - name = Name
- # $game_party.members.each do |actor|
- # if actor.name == name
- # actor.return_original_stat
- # end
- # end
- # - name: is character name
- #
- # - To level up from specific places by write this command in
- # event script:
- # - $actor_name = Name
- # SceneManager.call(Scene_Status_Point)
- # - Name: is character name
- #
- # - Blacksmith scene write this command in event script:
- # - SceneManager.call(Scene_repair)
- #
- # - To Activate Durability Damage Floor Select Region ID and write it in:
- # Durability_Effect_Region_ID
- #
- # - To Determine the amount decrease of durability when step on
- # the effected region by write the amount in:
- # Durability_Decrease_from_Field
- #
- # - To Infuse weapon and shield:
- # - INFUSE_COST: Cost of Infuse Weapon and Shield
- # - ELEMENT_RESISTANCE_PERCENTAGE: Percentage of element resistance(For Shield)
- #
- # - To Learn Skill You need Actor Memory Slot and Stats to be
- # equal or more than Skill Required Memory Slot and Stats
- #
- # - Actor Memory Slot Increase by 1 for each number divisible by 5
- #
- # - To Add Required Memory Slot for Skill from Skill note tag Write:
- # - <MS: (Needed Memory Slot)>
- #
- # - To link Item To Skill You need To do the following:
- # - The Item Type Should be: Key Item
- # - Consume Should be: No
- # - In the note Tag: <Skill (Skill_Id)>
- #
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Note:
- # Make Character can use everything:
- # All weapons, All armors, dual Wielding, Special Skills, Magic Skills
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- module GGSlayer
- module Dark_Souls_System
- #---------------------------------------------------------------------
- # #
- # Start of EDITABLE REGION #
- # #
- #--------------------------------------------------------------------
- Exp_Unit = "Exp" # Unit Shown For Exp Ex.(Gold Unit is G)
- Command_Name = "Exp Stat" # Command Shown In Menu
- Durability_Effect_Region_ID = 1 # Map Region ID that effect durability
- Durability_Decrease_from_Field = 1 # Amount Decrease of Durability when step on the effected region
- INFUSE_COST = 0 # Cost of Infuse Weapon and Shield
- ELEMENT_RESISTANCE_PERCENTAGE = 0.5 # Percentage of element resistance(For Shield)
- INCREASE_PERCENTAGE = 0.1 # Percentage of parameter increase per level
- DS_ICONS = "IconSet" # Name Icons Set File
- #---------------------------------------------------------------
- # Actor Stats Icons
- #---------------------------------------------------------------
- EXP_ICON = 321 # Experience Icon
- VIT_ICON = 122 # Vitality Icon
- INT_ICON = 117 # Intelligent Icon
- FTH_ICON = 143 # Faith Icon
- STR_ICON = 116 # Strength Icon
- DEX_ICON = 12 # Dexterity Icon
- LUK_ICON = 259 # Luck Icon
- ATN_ICON = 230 # Attunement Icon
- DURABILITY_ICON = 115 # Durability Icon
- MS_ICON = 228 # Memory Slot Icon
- #---------------------------------------------------------------
- # Equipment Elements Icons
- #---------------------------------------------------------------
- NO_ELEMENT_ICON = 116
- FIRE_ELEMENT_ICON = 96
- ICE_ELEMENT_ICON = 97
- THUNDER_ELEMENT_ICON = 98
- WATER_ELEMENT_ICON = 99
- EARTH_ELEMENT_ICON = 100
- WIND_ELEMENT_ICON = 101
- HOLY_ELEMNT_ICON = 102
- DARK_ELEMENT_ICON = 103
- Start_Class_Stat =
- {
- # "Write Class Name Start With Capital Letter
- "Soldier" =>
- {
- # Start Level Charcter
- :start_level => 1,
- # Start Charcter Exp
- :start_exp => 0,
- # Start Character Vitality
- :start_vit => 1,
- # Start Character Intelligent
- :start_int => 1,
- # Start Character Faith
- :start_fth => 3,
- # Start Character Strength
- :start_str => 1,
- # Start Charcter Dexterity
- :start_dex => 1,
- # Start Character Luck
- :start_luck => 1,
- # Start Character Attunement
- :start_atn => 6,
- # Start Character physical Attribute
- :physical_att => false,
- # Start Character magical Attribute
- :magical_att => false,
- # Start Character faith Attribute
- :faith_att => false,
- },
- "Monk" =>
- {
- :start_level => 5,
- :start_exp => 0,
- :start_vit => 1,
- :start_int => 1,
- :start_fth => 1,
- :start_str => 5,
- :start_dex => 1,
- :start_luck => 1,
- :start_atn => 1,
- :physical_att => false,
- :magical_att => false,
- :faith_att => false,
- }
- }
- Parameter_Increase_Per_Stat =
- {
- :mhp => 50, # Default Increase Value For Hp
- :mmp => 20, # Default Increase Value For Mp
- :att => 2, # Default Increase Value For Att
- :def => 2, # Default Increase Value For Def
- :mat => 2, # Default Increase Value For MAT
- :mdf => 2, # Default Increase Value For MDF
- :agi => 2, # Default Increase Value For Agi
- :luk => 2, # Defaulr Increase Value For Luck
- }
- #---------------------------------------------------------------------
- # #
- # End Of EDITABLE REGION #
- # #
- #--------------------------------------------------------------------
- end
- end
- #==============================================================================
- # ** BattleManager
- #------------------------------------------------------------------------------
- # This module manages battle progress.
- #==============================================================================
- module BattleManager
- #--------------------------------------------------------------------------
- # * EXP Acquisition and Level Up Display
- #--------------------------------------------------------------------------
- def self.gain_exp
- $game_party.gain_exp($game_troop.exp_total)
- wait_for_message
- end
- end
- #============================================================================
- # ** RPG::EquipItem
- #============================================================================
- class RPG::EquipItem < RPG::BaseItem
- include GGSlayer::Dark_Souls_System
- attr_accessor :durability # Equipment Durability
- attr_accessor :equip_lv
- attr_accessor :original_params
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_system_equipitem_initialize initialize
- def initialize
- ggslayer_dark_souls_system_equipitem_initialize()
- @durability = 0
- @equip_lv = 0
- @original_params = []
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Equipment Level
- #--------------------------------------------------------------------------
- def get_equip_lv
- @equip_lv = 0 if @equip_lv == nil
- return @equip_lv
- end
- #--------------------------------------------------------------------------
- # * New Method: Write Equipment Level In the Name
- #--------------------------------------------------------------------------
- def write_equip_level_to_name
- return "" if @equip_lv == nil || @equip_lv == 0
- return @equip_lv.to_s + "+ " if @equip_lv > 0
- end
- #--------------------------------------------------------------------------
- # * New Method: Upgrade Equip
- #--------------------------------------------------------------------------
- def upgrade_equip
- @equip_lv = 0 if @equip_lv == nil
- @equip_lv += 1
- 6.times{|i| @params[i + 2] = @original_params[i + 2] + (@equip_lv * INCREASE_PERCENTAGE * @original_params[i + 2]).ceil}
- change_equipment_name
- end
- #--------------------------------------------------------------------------
- # * New Method: Fake Upgrade Equip
- #--------------------------------------------------------------------------
- def fake_upgrade(param_id)
- @original_params = [] if !@original_params.kind_of?(Array)
- if @original_params.empty?
- @params.each do |param|
- @original_params.push(param)
- end
- end
- return @original_params[param_id] + ((@equip_lv + 1) * INCREASE_PERCENTAGE * @original_params[param_id]).ceil
- end
- #--------------------------------------------------------------------------
- # * New Method: Change Weapon Attack Element
- #--------------------------------------------------------------------------
- def change_atk_element(element_number)
- @equip_element = element_number
- @features.each do |feature|
- @features.delete(feature) if feature.added
- end
- @features.push(RPG::BaseItem::Feature.new(31, element_number, 0, true))
- change_equipment_name(element_number)
- end
- #--------------------------------------------------------------------------
- # * New Method: Change Weapon Name
- #--------------------------------------------------------------------------
- def change_equipment_name(element_number = 0)
- @original_name = self.name if @original_name == nil
- self.name = write_equip_level_to_name + @original_name if @equip_element == nil || @equip_element <= 1
- self.name = write_equip_level_to_name + "Fire " + @original_name if @equip_element == 3
- self.name = write_equip_level_to_name + "Ice " + @original_name if @equip_element == 4
- self.name = write_equip_level_to_name + "Thunder " + @original_name if @equip_element == 5
- self.name = write_equip_level_to_name + "Water " + @original_name if @equip_element == 6
- self.name = write_equip_level_to_name + "Earth " + @original_name if @equip_element == 7
- self.name = write_equip_level_to_name + "Wind " + @original_name if @equip_element == 8
- self.name = write_equip_level_to_name + "Holy " + @original_name if @equip_element == 9
- self.name = write_equip_level_to_name + "Dark " + @original_name if @equip_element == 10
- end
- #--------------------------------------------------------------------------
- # * New Method: Change Weapon Attack Element
- #--------------------------------------------------------------------------
- def change_def_element(element_number)
- @equip_element = element_number
- @features.each do |feature|
- @features.delete(feature) if feature.added
- end
- @features.push(RPG::BaseItem::Feature.new(11, element_number, ELEMENT_RESISTANCE_PERCENTAGE, true)) if element_number != 1
- change_equipment_name(element_number)
- end
- #--------------------------------------------------------------------------
- # * new Method: Set Weapon Durability
- #--------------------------------------------------------------------------
- def set_durability
- if @durability == nil && self.note =~ /<Durability (\d+)>/
- @durability = $1.to_i
- elsif @durability == nil
- @durability = 0
- end
- end
- def get_features
- return @features if @features != nil
- end
- #--------------------------------------------------------------------------
- # * new Method: Get Weapon Original Durability
- #--------------------------------------------------------------------------
- def get_original_durability
- if self.note =~ /<Durability (\d+)>/
- return $1.to_i
- else
- set_durability
- return @durability
- end
- end
- #--------------------------------------------------------------------------
- # * new Method: Get Weapon Durability
- #--------------------------------------------------------------------------
- def get_durability
- set_durability if @durability == nil
- return @durability
- end
- #--------------------------------------------------------------------------
- # * new Method: Return Weapon Durability
- #--------------------------------------------------------------------------
- def repair(amount)
- set_durability if @durability == nil
- @durability += amount
- @durability = self.get_original_durability if @durability > self.get_original_durability
- end
- #--------------------------------------------------------------------------
- # * new Method: Decrease Weapon Durability
- #--------------------------------------------------------------------------
- def decrease_durability(amount)
- @durability = $1.to_i if @durability == nil && self.note =~ /<Durability (\d+)>/
- @durability -= amount if @durability != nil
- @durability = 0 if @durability != nil && @durability < 0
- end
- end
- #============================================================================
- # ** RPG::Skill
- #============================================================================
- class RPG::Skill < RPG::UsableItem
- #--------------------------------------------------------------------------
- # * Set Memory Slot Required to be Learned
- #--------------------------------------------------------------------------
- def set_memory_slot_required
- self.note =~ /<MS: (\d+)>/
- @memory_slot_required = $1.to_i if @memory_slot_required == nil
- end
- #--------------------------------------------------------------------------
- # * Get Memory Slot Required to be Learned
- #--------------------------------------------------------------------------
- def get_memory_slot_required
- set_memory_slot_required if @memory_slot_required == nil
- return @memory_slot_required
- end
- attr_accessor :memory_slot_required
- end
- #============================================================================
- # ** RPG::Item
- #============================================================================
- class RPG::Item < RPG::UsableItem
- attr_accessor :skill_id
- #--------------------------------------------------------------------------
- # * Check if Item Linked To Skill
- #--------------------------------------------------------------------------
- def is_skill?
- return true if get_skill_id
- return false
- end
- #--------------------------------------------------------------------------
- # * Get Skill ID Linked To This Item
- #--------------------------------------------------------------------------
- def get_skill_id
- set_skill_id if @skill_id == nil
- return @skill_id
- end
- #--------------------------------------------------------------------------
- # * Set Skill ID Linked To This Item
- #--------------------------------------------------------------------------
- def set_skill_id
- if self.note =~ /<Skill (\d+)>/
- @skill_id = $1.to_i
- else
- @skill_id = 0
- end
- end
- end
- #============================================================================
- # ** RPG::BaseItem::Feature
- #============================================================================
- class RPG::BaseItem::Feature
- alias ggslayer_dark_souls_system_rpg_baseitem_feature_initialize initialize
- def initialize(code = 0, data_id = 0, value = 0, added = false)
- ggslayer_dark_souls_system_rpg_baseitem_feature_initialize(code, data_id, value)
- @added = added
- end
- attr_accessor :added
- end
- #==============================================================================
- # ** Game_BaseItem
- #------------------------------------------------------------------------------
- # This class uniformly handles skills, items, weapons, and armor. References
- # to the database object itself are not retained to enable inclusion in save
- # data.
- #==============================================================================
- class Game_BaseItem
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_system_Game_BaseItem_initialize initialize
- def initialize
- ggslayer_dark_souls_system_Game_BaseItem_initialize()
- @durability = 0
- end
- #--------------------------------------------------------------------------
- # * Set Item Object
- #--------------------------------------------------------------------------
- def object=(item)
- @class = item ? item.class : nil
- @item_id = item ? item.id : 0
- item.set_durability if item != nil && item.class.superclass == RPG::EquipItem
- end
- end
- #==============================================================================
- # ** Game_Battler
- #------------------------------------------------------------------------------
- # A battler class with methods for sprites and actions added. This class
- # is used as a super class of the Game_Actor class and Game_Enemy class.
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- #--------------------------------------------------------------------------
- # * Test Skill/Item Application
- # Used to determine, for example, if a character is already fully healed
- # and so cannot recover anymore.
- #--------------------------------------------------------------------------
- def item_test(user, item)
- return false if item.for_dead_friend? != dead?
- return true if $game_party.in_battle
- return true if item.for_opponent?
- return true if item.damage.recover? && item.damage.to_hp? && hp < mhp
- return true if item.damage.recover? && item.damage.to_mp? && mp < mmp
- return true if item_has_any_valid_effects?(user, item)
- return true if item.note =~ /<Repair (\d+)>/
- return false
- end
- #--------------------------------------------------------------------------
- # * Apply Effect of Skill/Item
- #--------------------------------------------------------------------------
- def item_apply(user, item)
- @result.clear
- @result.used = item_test(user, item)
- @result.missed = (@result.used && rand >= item_hit(user, item))
- @result.evaded = (!@result.missed && rand < item_eva(user, item))
- if @result.hit?
- unless item.damage.none?
- @result.critical = (rand < item_cri(user, item))
- make_damage_value(user, item)
- execute_damage(user)
- effect_item_on_armor(user, self, item) if ($game_party.members).include? self
- effect_item_on_armor(user, user, item) if ($game_party.members).include? user
- decrease_weapon_durability(user, item) if ($game_party.members).include? user
- check_weapon_armor_condition(user) if ($game_party.members).include? user
- check_weapon_armor_condition(self) if ($game_party.members).include? self
- else
- decrease_weapon_durability(user, item) if ($game_party.members).include? user
- effect_item_on_armor(user, self, item) if ($game_party.members).include? self
- effect_item_on_armor(user, user, item) if ($game_party.members).include? user
- check_weapon_armor_condition(self) if ($game_party.members).include? self
- end
- item.effects.each {|effect| item_effect_apply(user, item, effect) }
- item_user_effect(user, item)
- end
- end
- #--------------------------------------------------------------------------
- # * new Method: Check Weapon Armor Condition
- #--------------------------------------------------------------------------
- def check_weapon_armor_condition(actor)
- actor.change_destroyed_equip(0, nil) if (actor.equips[0]) != nil && (actor.equips[0]).get_durability == 0
- actor.change_destroyed_equip(1, nil) if (actor.equips[1]) != nil && (actor.equips[1]).get_durability == 0
- actor.change_destroyed_equip(2, nil) if (actor.equips[2]) != nil && (actor.equips[2]).get_durability == 0
- actor.change_destroyed_equip(3, nil) if (actor.equips[3]) != nil && (actor.equips[3]).get_durability == 0
- actor.change_destroyed_equip(4, nil) if (actor.equips[4]) != nil && (actor.equips[4]).get_durability == 0
- actor.change_destroyed_equip(5, nil) if (actor.equips[5]) != nil && (actor.equips[5]).get_durability == 0
- actor.change_destroyed_equip(6, nil) if (actor.equips[6]) != nil && (actor.equips[6]).get_durability == 0
- end
- #--------------------------------------------------------------------------
- # * new Method: Decrease Weapon Durability
- #--------------------------------------------------------------------------
- def decrease_weapon_durability(user, item)
- if item.note =~ /<(\w)_(\d+) (\d+)>/
- if $1.to_s == "w"
- (user.equips[0]).decrease_durability($3.to_i) if (user.equips[0]) != nil && (user.equips[0].template_id) == $2.to_i
- (user.equips[1]).decrease_durability($3.to_i) if (user.equips[1]) != nil && (user.equips[1].template_id) == $2.to_i
- elsif $1.to_s == "a"
- (user.equips[2]).decrease_durability($3.to_i) if (user.equips[2]) != nil && (user.equips[2].template_id) == $2.to_i
- (user.equips[3]).decrease_durability($3.to_i) if (user.equips[3]) != nil && (user.equips[3].template_id) == $2.to_i
- (user.equips[4]).decrease_durability($3.to_i) if (user.equips[4]) != nil && (user.equips[4].template_id) == $2.to_i
- (user.equips[5]).decrease_durability($3.to_i) if (user.equips[5]) != nil && (user.equips[5].template_id) == $2.to_i
- (user.equips[6]).decrease_durability($3.to_i) if (user.equips[6]) != nil && (user.equips[6].template_id) == $2.to_i
- end
- else
- (user.equips[0]).decrease_durability(1) if (($game_party.members).include? user) && (user.equips[0]) != nil
- (user.equips[1]).decrease_durability(1) if (($game_party.members).include? user) && (user.equips[1]) != nil
- end
- end
- #--------------------------------------------------------------------------
- # * new Method: Increase Equipment Durability
- #--------------------------------------------------------------------------
- def increase_equipment_durability(actor, amount)
- (actor.equips[0]).repair((actor.equips[0].get_original_durability * amount).to_i) if (actor.equips[0]) != nil
- (actor.equips[1]).repair((actor.equips[1].get_original_durability * amount).to_i) if (actor.equips[1]) != nil
- (actor.equips[2]).repair((actor.equips[2].get_original_durability * amount).to_i) if (actor.equips[2]) != nil
- (actor.equips[3]).repair((actor.equips[3].get_original_durability * amount).to_i) if (actor.equips[3]) != nil
- (actor.equips[4]).repair((actor.equips[4].get_original_durability * amount).to_i) if (actor.equips[4]) != nil
- (actor.equips[5]).repair((actor.equips[5].get_original_durability * amount).to_i) if (actor.equips[5]) != nil
- (actor.equips[6]).repair((actor.equips[6].get_original_durability * amount).to_i) if (actor.equips[6]) != nil
- end
- #--------------------------------------------------------------------------
- # * new Method: Decrease Armor Durability
- #--------------------------------------------------------------------------
- def effect_item_on_armor(user, actor, item)
- if item.note =~ /<Effect (\d+)>/
- decrease_armor_durability(actor, $1.to_i)
- elsif item.note =~ /<Repair (\d+)>/
- increase_equipment_durability(actor, $1.to_f/100.0)
- elsif !(item.is_a?(RPG::Item)) && !(($game_party.members).include? user)
- decrease_armor_durability(actor, 1)
- end
- end
- #--------------------------------------------------------------------------
- # * new Method: Decrease Armor Durability
- #--------------------------------------------------------------------------
- def decrease_armor_durability(actor, amount)
- (actor.equips[0]).decrease_durability(amount) if (actor.equips[0]) != nil && (actor.equips[1]) == nil && (actor.equips[2]) == nil && actor.guard?
- (actor.equips[1]).decrease_durability(amount) if (actor.equips[1]) != nil && actor.guard?
- (actor.equips[2]).decrease_durability(amount) if (actor.equips[2]) != nil && actor.guard?
- (actor.equips[3]).decrease_durability(amount) if (actor.equips[3]) != nil
- (actor.equips[4]).decrease_durability(amount) if (actor.equips[4]) != nil
- (actor.equips[5]).decrease_durability(amount) if (actor.equips[5]) != nil
- (actor.equips[6]).decrease_durability(amount) if (actor.equips[6]) != nil
- end
- end
- #==============================================================================
- # ** Game_Actor
- #------------------------------------------------------------------------------
- # This class handles actors. It is used within the Game_Actors class
- # ($game_actors) and is also referenced from the Game_Party class ($game_party).
- #==============================================================================
- class Game_Actor < Game_Battler
- include GGSlayer::Dark_Souls_System
- attr_accessor :dk_actor_stat
- attr_reader :physical_attribute # Make Actor do Physical Attack
- attr_reader :magical_attribute # Make Actor do Magical Attack
- attr_reader :faith_attribute # Make Actor do Faith Attack
- attr_accessor :memory_slot # number Of Memory Slot that actor have
- attr_accessor :used_memory_slot # number Of Memory Slot that actor used
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_stat_point_game_actor_initialize initialize
- def initialize(actor_id)
- ggslayer_dark_souls_stat_point_game_actor_initialize(actor_id)
- @dk_actor_stat =
- {
- :level => Start_Class_Stat[self.class.name][:start_level], # Level
- :exp => Start_Class_Stat[self.class.name][:start_exp], # Exp
- :vit => Start_Class_Stat[self.class.name][:start_vit], # Vit
- :int => Start_Class_Stat[self.class.name][:start_int], # Int
- :fth => Start_Class_Stat[self.class.name][:start_fth], # Fth
- :str => Start_Class_Stat[self.class.name][:start_str], # Str
- :dex => Start_Class_Stat[self.class.name][:start_dex], # Dex
- :luk => Start_Class_Stat[self.class.name][:start_luck], # Luck
- :atn => Start_Class_Stat[self.class.name][:start_atn] # Attunement
- }
- @physical_attribute = Start_Class_Stat[self.class.name][:physical_att]
- @magical_attribute = Start_Class_Stat[self.class.name][:magical_att]
- @faith_attribute = Start_Class_Stat[self.class.name][:faith_att]
- @memory_slot = @dk_actor_stat[:atn] % 5 == 0 || @dk_actor_stat[:atn] % 5 >= 1 ? (@dk_actor_stat[:atn] / 5).floor : 0
- end
- #--------------------------------------------------------------------------
- # * New Method: Return Original Character Stat
- #--------------------------------------------------------------------------
- def return_original_stat
- $game_party.gain_exp(dk_actor_stat[:exp])
- self.clear_param_plus
- forget_all_skill
- clear_equipments
- deactivate_physical_attribute
- deactivate_magical_attribute
- deactivate_faith_attribute
- @dk_actor_stat =
- {
- :level => Start_Class_Stat[self.class.name][:start_level], # Level
- :exp => Start_Class_Stat[self.class.name][:start_exp], # Exp
- :vit => Start_Class_Stat[self.class.name][:start_vit], # Vit
- :int => Start_Class_Stat[self.class.name][:start_int], # Int
- :fth => Start_Class_Stat[self.class.name][:start_fth], # Fth
- :str => Start_Class_Stat[self.class.name][:start_str], # Str
- :dex => Start_Class_Stat[self.class.name][:start_dex], # Dex
- :luk => Start_Class_Stat[self.class.name][:start_luck], # Luck
- :atn => Start_Class_Stat[self.class.name][:start_atn] # Attunement
- }
- end
- #--------------------------------------------------------------------------
- # * New Method: Forget All Skill
- #--------------------------------------------------------------------------
- def forget_all_skill
- if @skills != nil
- @skills.each do |skill_id|
- @skills.delete(skill_id)
- end
- end
- @used_memory_slot = 0
- end
- #--------------------------------------------------------------------------
- # * Determine Maximum Level
- #--------------------------------------------------------------------------
- def max_level?
- @dk_actor_stat[:level] >= max_level
- end
- #--------------------------------------------------------------------------
- # * New Method: Determine Maximum Level When Level Up
- #--------------------------------------------------------------------------
- def max_level_at_level_up?(current_lv)
- current_lv >= max_level
- end
- #--------------------------------------------------------------------------
- # * Maximum Level
- #--------------------------------------------------------------------------
- def max_level
- return 687
- end
- #--------------------------------------------------------------------------
- # * Get EXP for Next Level
- #--------------------------------------------------------------------------
- def next_level_exp
- exp_for_level(@dk_actor_stat[:level] + 1)
- end
- #--------------------------------------------------------------------------
- # * Get Total EXP Required for Rising to Specified Level
- #--------------------------------------------------------------------------
- def exp_for_level(level)
- if level > 599
- lv_increased_above_600 = level - 599
- return (self.class.exp_for_level(lv_increased_above_600) + 2547133 + ((50744 + 250) * lv_increased_above_600 * 6))
- elsif level > 499
- lv_increased_above_500 = level - 499
- return (self.class.exp_for_level(lv_increased_above_500) + 2547133 + ((50744 + 250) * lv_increased_above_500 * 5))
- elsif level > 399
- lv_increased_above_400 = level - 399
- return (self.class.exp_for_level(lv_increased_above_400) + 2547133 + ((50744 + 250) * lv_increased_above_400 * 4))
- elsif level > 299
- lv_increased_above_300 = level - 299
- return (self.class.exp_for_level(lv_increased_above_300) + 2547133 + ((50744 + 250) * lv_increased_above_300 * 3))
- elsif level > 199
- lv_increased_above_200 = level - 199
- return (self.class.exp_for_level(lv_increased_above_200) + 2547133 + ((50744 + 250) * lv_increased_above_200 * 2))
- elsif level > 99
- lv_increased_above_100 = level - 99
- return (self.class.exp_for_level(lv_increased_above_100) + 2547133 + ((50744 + 250) * lv_increased_above_100))
- else
- self.class.exp_for_level(level)
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Level
- #--------------------------------------------------------------------------
- def get_dk_actor_level
- return @dk_actor_stat[:level]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor EXP
- #--------------------------------------------------------------------------
- def get_dk_actor_exp
- return @dk_actor_stat[:exp]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Vitality Point
- #--------------------------------------------------------------------------
- def get_dk_actor_vit
- return @dk_actor_stat[:vit]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Intelligent Point
- #--------------------------------------------------------------------------
- def get_dk_actor_int
- return @dk_actor_stat[:int]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Faith Point
- #--------------------------------------------------------------------------
- def get_dk_actor_fth
- return @dk_actor_stat[:fth]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Strength
- #--------------------------------------------------------------------------
- def get_dk_actor_str
- return @dk_actor_stat[:str]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Dexterity
- #--------------------------------------------------------------------------
- def get_dk_actor_dex
- return @dk_actor_stat[:dex]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Luck
- #--------------------------------------------------------------------------
- def get_dk_actor_luck
- return @dk_actor_stat[:luk]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor Attunement
- #--------------------------------------------------------------------------
- def get_dk_actor_atn
- return @dk_actor_stat[:atn]
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Number of Memory Slot
- #--------------------------------------------------------------------------
- def get_number_of_slot
- @memory_slot = update_number_of_slot if @memory_slot == nil
- return @memory_slot
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Number of Used Memory Slot
- #--------------------------------------------------------------------------
- def get_used_memory_slot
- @used_memory_slot = 0 if @used_memory_slot == nil
- return @used_memory_slot
- end
- #--------------------------------------------------------------------------
- # * New Method: Update Number of Memory Slot
- #--------------------------------------------------------------------------
- def update_number_of_slot
- @memory_slot = (@dk_actor_stat[:atn] / 5).floor if @dk_actor_stat[:atn] % 5 == 0 || @dk_actor_stat[:atn] % 5 >= 1
- @memory_slot = 0 if @memory_slot == nil
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Level
- #--------------------------------------------------------------------------
- def dk_level_up(increase)
- @dk_actor_stat[:level] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Total Exp
- #--------------------------------------------------------------------------
- def increase_dk_actor_exp(increase)
- @dk_actor_stat[:exp] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Vitality
- #--------------------------------------------------------------------------
- def increase_dk_actor_vit(increase)
- @dk_actor_stat[:vit] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Intelligent
- #--------------------------------------------------------------------------
- def increase_dk_actor_int(increase)
- @dk_actor_stat[:int] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Faith
- #--------------------------------------------------------------------------
- def increase_dk_actor_fth(increase)
- @dk_actor_stat[:fth] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Strength
- #--------------------------------------------------------------------------
- def increase_dk_actor_str(increase)
- @dk_actor_stat[:str] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Dexterity
- #--------------------------------------------------------------------------
- def increase_dk_actor_dex(increase)
- @dk_actor_stat[:dex] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Luck
- #--------------------------------------------------------------------------
- def increase_dk_actor_luck(increase)
- @dk_actor_stat[:luk] += increase
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Attunement
- #--------------------------------------------------------------------------
- def increase_dk_actor_atn(increase)
- @dk_actor_stat[:atn] += increase
- update_number_of_slot
- end
- #--------------------------------------------------------------------------
- # * Learn Skill
- #--------------------------------------------------------------------------
- def learn_skill(skill_id)
- @skills.push(skill_id)
- @used_memory_slot = 0 if used_memory_slot == nil
- @used_memory_slot += $data_skills[skill_id].get_memory_slot_required
- @skills.sort!
- end
- #--------------------------------------------------------------------------
- # * Forget Skill
- #--------------------------------------------------------------------------
- def forget_skill(skill_id)
- @skills.delete(skill_id)
- @used_memory_slot -= $data_skills[skill_id].get_memory_slot_required
- @skills.sort!
- end
- #--------------------------------------------------------------------------
- # * Check Skill if Learned
- #--------------------------------------------------------------------------
- def is_learned?(skill)
- return @skills.include?(skill)
- end
- #--------------------------------------------------------------------------
- # * New Method: Enable Physical Attack
- #--------------------------------------------------------------------------
- def activate_physical_attribute
- @physical_attribute = true
- end
- #--------------------------------------------------------------------------
- # * New Method: Enable Magical Attack
- #--------------------------------------------------------------------------
- def activate_magical_attribute
- @magical_attribute = true
- end
- #--------------------------------------------------------------------------
- # * New Method: Enable Magical Attack
- #--------------------------------------------------------------------------
- def activate_faith_attribute
- @faith_attribute = true
- end
- #--------------------------------------------------------------------------
- # * New Method: Disable Physical Attack
- #--------------------------------------------------------------------------
- def deactivate_physical_attribute
- @physical_attribute = false
- end
- #--------------------------------------------------------------------------
- # * New Method: Disable Magical Attack
- #--------------------------------------------------------------------------
- def deactivate_magical_attribute
- @magical_attribute = false
- end
- #--------------------------------------------------------------------------
- # * New Method: Disable Faith Attack
- #--------------------------------------------------------------------------
- def deactivate_faith_attribute
- @faith_attribute = false
- end
- #--------------------------------------------------------------------------
- # * Get Equipment Slot Array
- #--------------------------------------------------------------------------
- def equip_slots
- return [0,0,1,2,3,4,4] # Show Weapon ,Shield, and Two Accessory Slots
- end
- #--------------------------------------------------------------------------
- # * New Method: Deactive Physical, Magical, and Faith Attribute
- #--------------------------------------------------------------------------
- def deactivate_previous_attribute(slot_id)
- item = @equips[slot_id].object
- if item != nil && item.note =~ /Physical/
- deactivate_physical_attribute
- end
- if item != nil && item.note =~ /Magical/
- deactivate_magical_attribute
- end
- if item != nil && item.note =~ /Faith/
- deactivate_faith_attribute
- end
- if slot_id == 1
- item = @equips[2].object
- if item != nil && item.note =~ /Physical/
- deactivate_physical_attribute
- end
- if item != nil && item.note =~ /Magical/
- deactivate_magical_attribute
- end
- if item != nil && item.note =~ /Faith/
- deactivate_faith_attribute
- end
- end
- if slot_id == 2
- item = @equips[1].object
- if item != nil && item.note =~ /Physical/
- deactivate_physical_attribute
- end
- if item != nil && item.note =~ /Magical/
- deactivate_magical_attribute
- end
- if item != nil && item.note =~ /Faith/
- deactivate_faith_attribute
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Initialize Equipment
- # equips: An array of initial equipment
- #--------------------------------------------------------------------------
- def init_equips(equips)
- @equips = Array.new(equip_slots.size) { Game_BaseItem.new }
- equips.each_with_index do |item_id, i|
- etype_id = index_to_etype_id(i)
- slot_id = empty_slot(etype_id)
- @equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # * Change Equipment
- # slot_id: Equipment slot ID
- # item: Weapon/armor (remove equipment if nil)
- #--------------------------------------------------------------------------
- def change_equip(slot_id, item)
- return unless trade_item_with_party(item, equips[slot_id])
- return if item && equip_slots[slot_id] != item.etype_id
- @equips[slot_id].object = item
- refresh
- end
- #--------------------------------------------------------------------------
- # * New Method: Change Destroyed Equipment
- # slot_id: Equipment slot ID
- # item: Weapon/armor (remove equipment if nil)
- #--------------------------------------------------------------------------
- def change_destroyed_equip(slot_id, item)
- return unless trade_item_with_party(item, equips[slot_id])
- return if item && equip_slots[slot_id] != item.etype_id
- @equips[slot_id].object = item
- RPG::SE.new("Break", 100, 100).play
- refresh
- end
- #--------------------------------------------------------------------------
- # * Processing Performed When Player Takes 1 Step
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_system_Game_Actor_on_player_walk on_player_walk
- def on_player_walk
- ggslayer_dark_souls_system_Game_Actor_on_player_walk
- check_floor_region
- end
- #--------------------------------------------------------------------------
- # * Determine Floor Region Effect
- #--------------------------------------------------------------------------
- def check_floor_region
- execute_floor_durability_damage if $game_player.on_region_floor? == Durability_Effect_Region_ID
- end
- #--------------------------------------------------------------------------
- # * Floor Damage Processing
- #--------------------------------------------------------------------------
- def execute_floor_durability_damage
- (self.equips[3]).decrease_durability(Durability_Decrease_from_Field) if (self.equips[3]) != nil
- (self.equips[4]).decrease_durability(Durability_Decrease_from_Field) if (self.equips[4]) != nil
- (self.equips[5]).decrease_durability(Durability_Decrease_from_Field) if (self.equips[5]) != nil
- (self.equips[6]).decrease_durability(Durability_Decrease_from_Field) if (self.equips[6]) != nil
- perform_map_damage_effect
- check_armor_condition
- end
- #--------------------------------------------------------------------------
- # * new Method: Check Armor Condition
- #--------------------------------------------------------------------------
- def check_armor_condition
- self.change_destroyed_equip(3, nil) if (self.equips[3]) != nil && (self.equips[3]).get_durability == 0
- self.change_destroyed_equip(4, nil) if (self.equips[4]) != nil && (self.equips[4]).get_durability == 0
- self.change_destroyed_equip(5, nil) if (self.equips[5]) != nil && (self.equips[5]).get_durability == 0
- self.change_destroyed_equip(6, nil) if (self.equips[6]) != nil && (self.equips[6]).get_durability == 0
- end
- end
- #==============================================================================
- # ** Game_Player
- #------------------------------------------------------------------------------
- # This class handles the player. It includes event starting determinants and
- # map scrolling functions. The instance of this class is referenced by
- # $game_player.
- #==============================================================================
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # * Determine if Damage Floor
- #--------------------------------------------------------------------------
- def on_region_floor?
- if !in_airship?
- $game_map.region_id(@x, @y)
- end
- end
- end
- #==============================================================================
- # ** Game_Party
- #------------------------------------------------------------------------------
- # This class handles parties. Information such as gold and items is included.
- # Instances of this class are referenced by $game_party.
- #==============================================================================
- class Game_Party < Game_Unit
- attr_reader :exp
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias dk_dark_souls_stat_point_game_party_initialize initialize
- def initialize
- dk_dark_souls_stat_point_game_party_initialize
- @exp = 0
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Exp
- #--------------------------------------------------------------------------
- def gain_exp(amount)
- @exp = [[@exp + amount, 0].max, max_exp].min
- end
- #--------------------------------------------------------------------------
- # * New Method: Decrease Exp
- #--------------------------------------------------------------------------
- def lose_exp(amount)
- gain_exp(-amount)
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Maximum Value of Exp
- #--------------------------------------------------------------------------
- def max_exp
- return 99999999
- end
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # This is a super class of all windows within the game.
- #==============================================================================
- class Window_Base < Window
- include GGSlayer::Dark_Souls_System
- #--------------------------------------------------------------------------
- # * Draw Icon
- # enabled : Enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_system_window_base_draw_icon draw_icon
- def draw_icon(icon_index, x, y, enabled = true, ds_used = false)
- if ds_used
- bitmap = Cache.system(DS_ICONS)
- rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
- contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- else
- ggslayer_dark_souls_system_window_base_draw_icon(icon_index, x, y, enabled)
- end
- end
- end
- #==============================================================================
- # ** Window_Exp
- #------------------------------------------------------------------------------
- # This window displays the party's exp.
- #==============================================================================
- class Window_Exp < Window_Base
- include GGSlayer::Dark_Souls_System
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, fitting_height(1))
- refresh
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return 160
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_exp_value(exp_value, 4, 0, contents.width - 8)
- end
- #--------------------------------------------------------------------------
- # * Draw Exp
- #--------------------------------------------------------------------------
- def draw_exp_value(value, x, y, width)
- draw_icon(EXP_ICON, width - 15, y, true, true)
- change_color(normal_color)
- draw_text(x, y, width - 17, line_height, value, 2)
- end
- #--------------------------------------------------------------------------
- # * Get Party Exp
- #--------------------------------------------------------------------------
- def exp_value
- return $game_party.exp
- end
- #--------------------------------------------------------------------------
- # * Open Window
- #--------------------------------------------------------------------------
- def open
- refresh
- super
- end
- end
- #==============================================================================
- # ** Window_Status_Point
- #------------------------------------------------------------------------------
- # This window displays full status specs on the status screen
- # Also, Level Up Chosen Actor.
- #==============================================================================
- class Window_Status_Point < Window_Selectable
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, Graphics.width, Graphics.height)
- @actor = actor
- refresh
- activate
- end
- #--------------------------------------------------------------------------
- # * Set Actor
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_block1 (line_height * 0)
- draw_horz_line(line_height * 1)
- draw_block2 (line_height * 2)
- draw_horz_line(line_height * 6)
- draw_block3 (line_height * 7)
- end
- #--------------------------------------------------------------------------
- # * Draw Block 1
- #--------------------------------------------------------------------------
- def draw_block1(y)
- draw_actor_name(@actor, 4, y)
- draw_actor_class(@actor, 128, y)
- draw_actor_nickname(@actor, 288, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Block 2
- #--------------------------------------------------------------------------
- def draw_block2(y)
- draw_actor_face(@actor, 8, y)
- draw_basic_info(136, y)
- draw_exp_info(304, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Block 3
- #--------------------------------------------------------------------------
- def draw_block3(y)
- draw_parameters(288, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Get Color of Horizontal Line
- #--------------------------------------------------------------------------
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- #--------------------------------------------------------------------------
- # * Draw Basic Information
- #--------------------------------------------------------------------------
- def draw_basic_info(x, y)
- draw_actor_level(@actor, x, y + line_height * 0)
- draw_actor_icons(@actor, x, y + line_height * 1)
- draw_actor_hp(@actor, x, y + line_height * 2)
- draw_actor_mp(@actor, x, y + line_height * 3)
- end
- #--------------------------------------------------------------------------
- # * Draw Level
- #--------------------------------------------------------------------------
- def draw_actor_level(actor, x, y)
- change_color(system_color)
- draw_text(x, y, 32, line_height, Vocab::level_a)
- change_color(normal_color)
- draw_text(x + 32, y, 24, line_height, actor.get_dk_actor_level, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw HP
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 124)
- draw_gauge(x, y - 6, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
- change_color(system_color)
- draw_text(x, y - 11, 30, line_height, Vocab::hp_a)
- draw_current_and_max_values(x, y - 11, width, actor.hp, actor.mhp,
- hp_color(actor), normal_color)
- end
- #--------------------------------------------------------------------------
- # * Draw MP
- #--------------------------------------------------------------------------
- def draw_actor_mp(actor, x, y, width = 124)
- draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
- change_color(system_color)
- draw_text(x, y - 5, 30, line_height, Vocab::mp_a)
- draw_current_and_max_values(x, y - 5, width, actor.mp, actor.mmp,
- mp_color(actor), normal_color)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Increase and Decrease of HP
- #--------------------------------------------------------------------------
- def draw_actor_hp_change(actor, x, y, change, width = 124)
- contents.clear_rect(x + width - 42, y, 42, line_height)
- change_color(system_color)
- change_color(normal_color) if change == 0
- if actor.mhp + change > 9999
- draw_text(x + width - 42, y + 3, 42, line_height, 9999, 2)
- else
- draw_text(x + width - 42, y + 3, 42, line_height, actor.mhp + change, 2)
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Increase and Decrease of MP
- #--------------------------------------------------------------------------
- def draw_actor_mp_change(actor, x, y, change, width = 124)
- contents.clear_rect(x + width - 42, y, 42, line_height)
- change_color(system_color)
- change_color(normal_color) if change == 0
- draw_text(x + width - 42, y + 3, 42, line_height, actor.mmp + change, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Increase and Decrease of Level
- #--------------------------------------------------------------------------
- def draw_actor_level_change(actor, x, y, change)
- contents.clear_rect(x + 32, y, 24, line_height)
- change_color(system_color)
- change_color(normal_color) if change == 0
- draw_text(x + 32, y, 24, line_height, actor.get_dk_actor_level + change, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Increase and Decrease of Exp
- #--------------------------------------------------------------------------
- def draw_actor_level_exp_change(x, y, actor_exp, actor_lv)
- s1 = @actor.max_level_at_level_up?(actor_lv) ? "-------" : actor_exp
- s2 = @actor.max_level_at_level_up?(actor_lv) ? "-------" : @actor.exp_for_level(actor_lv + 1) - @actor.exp_for_level(actor_lv)
- contents.clear_rect(x, y + line_height * 1, 180, line_height)
- contents.clear_rect(x, y + line_height * 3, 180, line_height)
- change_color(system_color)
- change_color(normal_color) if actor_exp == @actor.get_dk_actor_exp
- draw_text(x, y + line_height * 1, 180, line_height, s1, 2)
- draw_text(x, y + line_height * 3, 180, line_height, s2, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Parameters
- #--------------------------------------------------------------------------
- def draw_actor_param(actor, x, y, param_id)
- change_color(system_color)
- draw_text(x, y + 17, 120, line_height, Vocab::param(param_id))
- change_color(normal_color)
- draw_text(x + 100, y + 17, 36, line_height, actor.param(param_id), 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Actor Memory Slot
- #--------------------------------------------------------------------------
- def draw_actor_memory_slot(actor, x, y)
- change_color(system_color)
- draw_text(x, y + 17, 120, line_height, "ATN")
- change_color(normal_color)
- draw_text(x + 100, y + 17, 36, line_height, actor.get_number_of_slot, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Parameters
- #--------------------------------------------------------------------------
- def draw_parameters(x, y)
- 6.times {|i| draw_actor_param(@actor, x, y + line_height * i, i + 2) }
- draw_actor_memory_slot(@actor, x, y + line_height * 6)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Increase and Decrease of Parameters
- #--------------------------------------------------------------------------
- def draw_actor_param_change(actor, x, y, location, change, param_id)
- contents.clear_rect(x + 100, y + line_height * location + 17, 36, line_height)
- change_color(system_color)
- change_color(normal_color) if change == 0
- draw_text(x + 100, y + line_height * location + 17, 36, line_height, actor.param(param_id) + change, 2) if param_id != 8
- draw_text(x + 100, y + line_height * location + 17, 36, line_height, change, 2) if param_id == 8
- end
- #--------------------------------------------------------------------------
- # * Draw Experience Information
- #--------------------------------------------------------------------------
- def draw_exp_info(x, y)
- s1 = @actor.max_level? ? "-------" : @actor.get_dk_actor_exp
- s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp_for_level(@actor.get_dk_actor_level)
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- change_color(system_color)
- draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
- draw_text(x, y + line_height * 2, 180, line_height, s_next)
- change_color(normal_color)
- draw_text(x, y + line_height * 1, 180, line_height, s1, 2)
- draw_text(x, y + line_height * 3, 180, line_height, s2, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw Exp With Normal Color After Increase
- #--------------------------------------------------------------------------
- def return_exp_color(x = 304, y = 48)
- s1 = @actor.max_level? ? "-------" : @actor.get_dk_actor_exp
- s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp_for_level(@actor.get_dk_actor_level)
- contents.clear_rect(x, y + line_height * 1, 180, line_height)
- contents.clear_rect(x, y + line_height * 3, 180, line_height)
- change_color(normal_color)
- draw_text(x, y + line_height * 1, 180, line_height, s1, 2)
- draw_text(x, y + line_height * 3, 180, line_height, s2, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw Parameters With Normal Color After Increase
- #--------------------------------------------------------------------------
- def return_parameters_color(x = 288, y = 168)
- contents.clear_rect(x, y, x, y + line_height * 6)
- draw_parameters(x, y)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw Level With Normal Color After Increase
- #--------------------------------------------------------------------------
- def return_actor_level_normal_color(actor, x = 136, y = 48)
- contents.clear_rect(x + 32, y, 24, line_height)
- change_color(normal_color)
- draw_text(x + 32, y, 24, line_height, actor.get_dk_actor_level, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw HP With Normal Color After Increase
- #--------------------------------------------------------------------------
- def return_actor_hp_normal_color(actor, x = 136, y = 82, width = 124)
- contents.clear_rect(x + width - 42, y, 42, line_height)
- change_color(normal_color)
- draw_text(x + width - 42, y + 3, 42, line_height, actor.mhp, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw MP With Normal Color After Increase
- #--------------------------------------------------------------------------
- def return_actor_mp_normal_color(actor, x = 136, y = 112, width = 124)
- contents.clear_rect(x + width - 42, y, 42, line_height)
- change_color(normal_color)
- draw_text(x + width - 42, y + 3, 42, line_height, actor.mmp, 2)
- end
- #--------------------------------------------------------------------------
- # * Handling Processing for OK and Cancel Etc.
- #--------------------------------------------------------------------------
- def process_handling
- return unless open? && active
- return process_cancel if cancel_enabled? && Input.trigger?(:B)
- end
- end
- #==============================================================================
- # ** Window_MenuStatus
- #------------------------------------------------------------------------------
- # This window displays party member status on the menu screen.
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # * Draw Level
- #--------------------------------------------------------------------------
- alias ggslayer_Dark_souls_stat_points_window_menustatus_draw_actor_level draw_actor_level
- def draw_actor_level(actor, x, y)
- change_color(system_color)
- draw_text(x, y, 32, line_height, Vocab::level_a)
- change_color(normal_color)
- draw_text(x + 32, y, 24, line_height, actor.get_dk_actor_level, 2)
- end
- end
- #==============================================================================
- # ** Stat_Commands
- #------------------------------------------------------------------------------
- # This window deals with Actor Status command choices.
- #==============================================================================
- class Stat_Commands < Window_Command
- include GGSlayer::Dark_Souls_System
- attr_accessor :exp
- attr_accessor :last_vit
- attr_accessor :last_int
- attr_accessor :last_fth
- attr_accessor :last_str
- attr_accessor :lat_dex
- attr_accessor :last_luck
- attr_accessor :last_atn
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, actor)
- super(x, y)
- @actor = actor
- @exp = $game_party.exp
- @last_vit = @actor.get_dk_actor_vit
- @last_int = @actor.get_dk_actor_int
- @last_fth = @actor.get_dk_actor_fth
- @last_str = @actor.get_dk_actor_str
- @last_dex = @actor.get_dk_actor_dex
- @last_luck = @actor.get_dk_actor_luck
- @last_atn = @actor.get_dk_actor_atn
- draw_party_exp
- draw_stat(@actor)
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return 200
- end
- #--------------------------------------------------------------------------
- # * Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- return 250
- end
- #--------------------------------------------------------------------------
- # * Get Rectangle for Drawing Items
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new
- rect.width = 158
- rect.height = item_height
- rect.x = index % col_max * (item_width + spacing)
- rect.y = (index / col_max * item_height) + 24
- rect
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Vitality
- #--------------------------------------------------------------------------
- def draw_increase_vit(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_vit += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Intelligent
- #--------------------------------------------------------------------------
- def draw_increase_int(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_int += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Faith
- #--------------------------------------------------------------------------
- def draw_increase_fth(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_fth += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Strength
- #--------------------------------------------------------------------------
- def draw_increase_str(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_str += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Dexterity
- #--------------------------------------------------------------------------
- def draw_increase_dex(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_dex += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Luck
- #--------------------------------------------------------------------------
- def draw_increase_luck(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_luck += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Increase Of Attunement
- #--------------------------------------------------------------------------
- def draw_increase_atn(y, next_level_exp)
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- draw_text(4,0, 155, line_height, @exp -= next_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_atn += 1, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Vitality
- #--------------------------------------------------------------------------
- def draw_decrease_vit(y, previous_level_exp)
- @last_vit -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_vit == @actor.get_dk_actor_vit
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_vit, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of intelligent
- #--------------------------------------------------------------------------
- def draw_decrease_int(y, previous_level_exp)
- @last_int -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_int == @actor.get_dk_actor_int
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_int, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Faith
- #--------------------------------------------------------------------------
- def draw_decrease_fth(y, previous_level_exp)
- @last_fth -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_fth == @actor.get_dk_actor_fth
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_fth, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Strength
- #--------------------------------------------------------------------------
- def draw_decrease_str(y, previous_level_exp)
- @last_str -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_str == @actor.get_dk_actor_str
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_str, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Dexterity
- #--------------------------------------------------------------------------
- def draw_decrease_dex(y, previous_level_exp)
- @last_dex -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_dex == @actor.get_dk_actor_dex
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_dex, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Luck
- #--------------------------------------------------------------------------
- def draw_decrease_luck(y, previous_level_exp)
- @last_luck -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_luck == @actor.get_dk_actor_luck
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_luck, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Temporary Decrease Of Attumenet
- #--------------------------------------------------------------------------
- def draw_decrease_atn(y, previous_level_exp)
- @last_atn -= 1
- contents.clear_rect(50,0, 150, line_height)
- contents.clear_rect(100,y, 100, line_height)
- change_color(system_color)
- change_color(normal_color) if @last_atn == @actor.get_dk_actor_atn
- draw_text(4,0, 155, line_height, @exp += previous_level_exp, 2)
- draw_text(4,y, 155, line_height, @last_atn, 2)
- end
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- @list.push({:name=>"", :symbol=>:vit, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:int, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:fth, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:str, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:dex, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:luck, :enabled=>true, :ext=>nil})
- @list.push({:name=>"", :symbol=>:atn, :enabled=>true, :ext=>nil})
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Party Exp
- #--------------------------------------------------------------------------
- def draw_party_exp
- draw_icon(EXP_ICON, 4, 0, true, true)
- change_color(normal_color)
- draw_text(4, 0, 155, line_height, @exp, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Draw Actor Stat
- #--------------------------------------------------------------------------
- def draw_stat(actor)
- draw_icon(VIT_ICON, 4, line_height, true, true)
- draw_icon(INT_ICON, 4, line_height * 2, true, true)
- draw_icon(FTH_ICON, 4, line_height * 3, true, true)
- draw_icon(STR_ICON, 4, line_height * 4, true, true)
- draw_icon(DEX_ICON, 4, line_height * 5, true, true)
- draw_icon(LUK_ICON, 4, line_height * 6, true, true)
- draw_icon(ATN_ICON, 4, line_height * 7, true, true)
- change_color(normal_color)
- draw_text(4, line_height, 155, line_height, actor.get_dk_actor_vit, 2)
- draw_text(4, line_height * 2, 155, line_height, actor.get_dk_actor_int, 2)
- draw_text(4, line_height * 3, 155, line_height, actor.get_dk_actor_fth, 2)
- draw_text(4, line_height * 4, 155, line_height, actor.get_dk_actor_str, 2)
- draw_text(4, line_height * 5, 155, line_height, actor.get_dk_actor_dex, 2)
- draw_text(4, line_height * 6, 155, line_height, actor.get_dk_actor_luck, 2)
- draw_text(4, line_height * 7, 155, line_height, actor.get_dk_actor_atn, 2)
- end
- #--------------------------------------------------------------------------
- # * New Method: Redraw Actor Stat After
- #--------------------------------------------------------------------------
- def return_actor_stat_normal_color(actor)
- contents.clear_rect(100, 0, 155, line_height)
- contents.clear_rect(100, 24, 155, line_height)
- contents.clear_rect(100, 48, 155, line_height)
- contents.clear_rect(100, 72, 155, line_height)
- contents.clear_rect(100, 98, 155, line_height)
- contents.clear_rect(100, 122, 155, line_height)
- contents.clear_rect(100, 146, 155, line_height)
- contents.clear_rect(100, 170, 155, line_height)
- change_color(normal_color)
- draw_text(4, 0, 155, line_height, @exp, 2)
- draw_text(4, 24, 155, line_height, actor.get_dk_actor_vit, 2)
- draw_text(4, 48, 155, line_height, actor.get_dk_actor_int, 2)
- draw_text(4, 72, 155, line_height, actor.get_dk_actor_fth, 2)
- draw_text(4, 98, 155, line_height, actor.get_dk_actor_str, 2)
- draw_text(4, 122, 155, line_height, actor.get_dk_actor_dex, 2)
- draw_text(4, 146, 155, line_height, actor.get_dk_actor_luck, 2)
- draw_text(4, 170, 155, line_height, actor.get_dk_actor_atn, 2)
- end
- #--------------------------------------------------------------------------
- # * Handling Processing for OK and Cancel Etc.
- #--------------------------------------------------------------------------
- def process_handling
- return unless open? && active
- return process_ok if ok_enabled? && Input.trigger?(:C)
- return process_cancel if cancel_enabled? && Input.trigger?(:B)
- return process_increase if handle?(:increase) && Input.trigger?(:RIGHT)
- return process_decrease if handle?(:decrease) && Input.trigger?(:LEFT)
- end
- #--------------------------------------------------------------------------
- # * Call Increase Handler
- #--------------------------------------------------------------------------
- def call_increase_handler
- call_handler(:increase)
- end
- #--------------------------------------------------------------------------
- # * Call Decrease Handler
- #--------------------------------------------------------------------------
- def call_decrease_handler
- call_handler(:decrease)
- end
- #--------------------------------------------------------------------------
- # * Call Level UP Handler
- #--------------------------------------------------------------------------
- def call_level_up_handler
- call_handler(:ok)
- end
- #--------------------------------------------------------------------------
- # * Processing When Increase Button Is Pressed
- #--------------------------------------------------------------------------
- def process_increase
- Sound.play_buzzer if call_increase_handler == false
- end
- #--------------------------------------------------------------------------
- # * Processing When Decrease Button Is Pressed
- #--------------------------------------------------------------------------
- def process_decrease
- Sound.play_buzzer if call_decrease_handler == false
- end
- #--------------------------------------------------------------------------
- # * Processing When OK Button Is Pressed
- #--------------------------------------------------------------------------
- def process_ok
- if call_level_up_handler
- Sound.play_ok
- else
- Sound.play_buzzer
- end
- end
- end
- #==============================================================================
- # ** Window_Equip_Stat
- #------------------------------------------------------------------------------
- # This window displays choices when opting to change equipment on the
- # equipment screen.
- #==============================================================================
- class Window_Equip_Stat < Window_Base
- def initialize(x, y, width, height)
- super
- @equipment_stat = 0
- draw_icon(STR_ICON, 0, 0, true, true) # Strength Icon
- draw_icon(DEX_ICON, 100, 0, true, true) # Dexterity Icon
- draw_icon(INT_ICON, 200, 0, true, true) # Intelligent Icon
- draw_icon(FTH_ICON, 300, 0, true, true) # Faith Icon
- draw_icon(DURABILITY_ICON, 400, 0, true, true) # Durability Icon
- end
- #--------------------------------------------------------------------------
- # * Draw Equipment Stat
- #--------------------------------------------------------------------------
- def draw_equipment_stat(stat_name, stat, slot_id)
- change_color(knockout_color)
- change_color(tp_gauge_color1) if stat_compatible?(stat_name, stat, slot_id)
- draw_text(0, 0, 70, line_height, @equipment_stat.to_s, 2) if stat_name.to_s == "str"
- draw_text(100, 0, 70, line_height, @equipment_stat.to_s, 2) if stat_name.to_s == "dex"
- draw_text(200, 0, 70, line_height, @equipment_stat.to_s, 2) if stat_name.to_s == "int"
- draw_text(300, 0, 70, line_height, @equipment_stat.to_s, 2) if stat_name.to_s == "fth"
- end
- #--------------------------------------------------------------------------
- # * Draw Equipment Durability
- #--------------------------------------------------------------------------
- def draw_equipment_durability(equipment)
- change_color(tp_gauge_color1)
- change_color(knockout_color) if equipment.get_durability <= 0
- draw_text(400, 0, 70, line_height, equipment.get_durability.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Clear Previous Stat
- #--------------------------------------------------------------------------
- def clear_previous_stat
- contents.clear_rect(30, 0, 50, line_height)
- contents.clear_rect(130, 0, 50, line_height)
- contents.clear_rect(230, 0, 50, line_height)
- contents.clear_rect(330, 0, 50, line_height)
- contents.clear_rect(430, 0, 50, line_height)
- end
- #--------------------------------------------------------------------------
- # * Show Weapon Neaded Stat
- #--------------------------------------------------------------------------
- def show_weapon_stat(equipment, slot_id)
- clear_previous_stat
- if equipment != nil && equipment.note != ""
- if equipment.note =~ /<(\w+):\s(\d+)>/
- draw_equipment_stat($1, $2, slot_id)
- draw_equipment_durability(equipment)
- elsif equipment.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_equipment_stat($1, $2, slot_id)
- draw_equipment_stat($3, $4, slot_id)
- draw_equipment_durability(equipment)
- elsif equipment.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_equipment_stat($1, $2, slot_id)
- draw_equipment_stat($3, $4, slot_id)
- draw_equipment_stat($5, $6, slot_id)
- draw_equipment_durability(equipment)
- elsif equipment.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_equipment_stat($1, $2, slot_id)
- draw_equipment_stat($3, $4, slot_id)
- draw_equipment_stat($5, $6, slot_id)
- draw_equipment_stat($7, $8, slot_id)
- draw_equipment_durability(equipment)
- else
- draw_equipment_durability(equipment) # for accessory
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Check Weapon Stats Compatibility
- #--------------------------------------------------------------------------
- def stat_compatible?(stat_name, stat, slot_id)
- if slot_id == 1 && (stat_name.to_s == "str" || stat_name.to_s == "dex")
- @equipment_stat = (stat.to_i * 1.5).ceil
- @equipment_stat = 99 if @equipment_stat > 99
- return @actor.dk_actor_stat[stat_name.to_sym] >= @equipment_stat
- else
- @equipment_stat = stat.to_i
- return @actor.dk_actor_stat[stat_name.to_sym] >= @equipment_stat
- end
- end
- #--------------------------------------------------------------------------
- # * Set Actor
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- end
- end
- #==============================================================================
- # ** Window_EquipItem
- #------------------------------------------------------------------------------
- # This window displays choices when opting to change equipment on the
- # equipment screen.
- #==============================================================================
- class Window_EquipItem < Window_ItemList
- #--------------------------------------------------------------------------
- # * New Method: Set Stat Window
- #--------------------------------------------------------------------------
- def stat_window=(stat_wind)
- @stat_window = stat_wind
- call_update_help
- end
- #--------------------------------------------------------------------------
- # * Update Help Text
- #--------------------------------------------------------------------------
- def update_help
- super
- if @actor && @status_window && @stat_window
- temp_actor = Marshal.load(Marshal.dump(@actor))
- temp_actor.force_change_equip(@slot_id, item)
- @status_window.set_temp_actor(temp_actor)
- @stat_window.show_weapon_stat(item, @slot_id) # To Show Weapon Stat Needed
- end
- end
- end
- #==============================================================================
- # ** Window_EquipSlot
- #------------------------------------------------------------------------------
- # This window displays items the actor is currently equipped with on the
- # equipment screen.
- #==============================================================================
- class Window_EquipSlot < Window_Selectable
- #--------------------------------------------------------------------------
- # * Get Number of Lines to Show
- #--------------------------------------------------------------------------
- def visible_line_number
- return 7 # To Show All Slots
- end
- #--------------------------------------------------------------------------
- # * New Method: Show Selected Slot
- #--------------------------------------------------------------------------
- def show_slot
- return index
- end
- end
- #==============================================================================
- # ** Window_Equip_Skill_Status
- #------------------------------------------------------------------------------
- # This window displays full status specs on the status screen.
- #==============================================================================
- class Window_Equip_Skill_Status < Window_Selectable
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(actor, y, height)
- super(0, y, Graphics.width, height)
- @actor = actor
- refresh
- activate
- end
- #--------------------------------------------------------------------------
- # * Set Actor
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_block (0)
- end
- #--------------------------------------------------------------------------
- # * Draw Block
- #--------------------------------------------------------------------------
- def draw_block(y)
- draw_actor_face(@actor, 8, y + line_height)
- draw_actor_name(@actor, 4, y)
- draw_basic_info(136, y)
- draw_actor_memory_slot(304, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Actor Memory Slot
- #--------------------------------------------------------------------------
- def draw_actor_memory_slot(x, y)
- draw_text_ex(x, y + line_height * 2, "Memory Slot = " + (@actor.get_number_of_slot - @actor.get_used_memory_slot).to_s)
- end
- #--------------------------------------------------------------------------
- # * Draw Basic Information
- #--------------------------------------------------------------------------
- def draw_basic_info(x, y)
- draw_actor_level(@actor, x, y + line_height * 0)
- draw_actor_icons(@actor, x, y + line_height * 1)
- draw_actor_hp(@actor, x, y + line_height * 2)
- draw_actor_mp(@actor, x, y + line_height * 3)
- end
- end
- #==============================================================================
- # ** Window_SkillList
- #------------------------------------------------------------------------------
- # This window is for displaying a list of available skills on the skill window.
- #==============================================================================
- class Window_Equip_SkillList < Window_ItemList
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super
- @actor = nil
- end
- #--------------------------------------------------------------------------
- # * Set Actor
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- refresh
- self.oy = 0
- end
- #--------------------------------------------------------------------------
- # * Include in Item List?
- #--------------------------------------------------------------------------
- def include?(item)
- return true if item == nil
- return true if item.is_a?(RPG::Item) && item.key_item? && item.is_skill?
- return false
- end
- #--------------------------------------------------------------------------
- # * Display in Enabled State?
- #--------------------------------------------------------------------------
- def enable?(item)
- return true
- end
- #--------------------------------------------------------------------------
- # * Create Item List
- #--------------------------------------------------------------------------
- def make_item_list
- @data = $game_party.items.select {|item| include?(item) }
- @data.push(nil) if include?(nil)
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- if item
- rect = item_rect(index)
- rect.width -= 4
- draw_item_name(item, rect.x, rect.y, enable?(item))
- draw_item_condition(rect, item)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Number of Items
- #--------------------------------------------------------------------------
- def draw_item_condition(rect, item)
- if @actor.is_learned?(item.get_skill_id)
- draw_text(rect, "L", 2)
- else
- draw_text(rect, "NL", 2)
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Set Stat Window
- #--------------------------------------------------------------------------
- def stat_window=(stat_wind)
- @stat_window = stat_wind
- call_update_help
- end
- #--------------------------------------------------------------------------
- # * Update Help Text
- #--------------------------------------------------------------------------
- def update_help
- super
- if @actor && @stat_window
- @stat_window.show_skill_stat($data_skills[item.skill_id]) if item # To Show Skill Stat Needed
- end
- end
- end
- #==============================================================================
- # ** Window_Skill_Stat
- #------------------------------------------------------------------------------
- # This window displays Stats Needed for Skill To be Learned
- #==============================================================================
- class Window_Skill_Stat < Window_Base
- def initialize(x, y, width, height)
- super
- @skill_stat = 0
- draw_icon(STR_ICON, 0, 0, true, true) # Strength Icon
- draw_icon(DEX_ICON, 100, 0, true, true) # Dexterity Icon
- draw_icon(INT_ICON, 200, 0, true, true) # Intelligent Icon
- draw_icon(FTH_ICON, 300, 0, true, true) # Faith Icon
- draw_icon(MS_ICON, 400, 0, true, true) # Memory Slot Icon
- end
- #--------------------------------------------------------------------------
- # * Draw Skill Stat
- #--------------------------------------------------------------------------
- def draw_skill_stat(stat_name, stat)
- change_color(knockout_color)
- change_color(tp_gauge_color1) if stat_compatible?(stat_name, stat)
- draw_text(0, 0, 70, line_height, @skill_stat.to_s, 2) if stat_name.to_s == "str"
- draw_text(100, 0, 70, line_height, @skill_stat.to_s, 2) if stat_name.to_s == "dex"
- draw_text(200, 0, 70, line_height, @skill_stat.to_s, 2) if stat_name.to_s == "int"
- draw_text(300, 0, 70, line_height, @skill_stat.to_s, 2) if stat_name.to_s == "fth"
- end
- #--------------------------------------------------------------------------
- # * Clear Previous Stat
- #--------------------------------------------------------------------------
- def clear_previous_stat
- contents.clear_rect(30, 0, 50, line_height)
- contents.clear_rect(130, 0, 50, line_height)
- contents.clear_rect(230, 0, 50, line_height)
- contents.clear_rect(330, 0, 50, line_height)
- contents.clear_rect(430, 0, 100, line_height)
- end
- #--------------------------------------------------------------------------
- # * Draw Skill Memory Slot Required
- #--------------------------------------------------------------------------
- def draw_skill_slot_required(skill)
- change_color(knockout_color)
- change_color(tp_gauge_color1) if @actor.memory_slot >= skill.get_memory_slot_required
- draw_text(400, 0, 70, line_height, skill.get_memory_slot_required, 2)
- end
- #--------------------------------------------------------------------------
- # * Show Skill Neaded Stat
- #--------------------------------------------------------------------------
- def show_skill_stat(skill)
- clear_previous_stat
- if skill != nil && skill.note != ""
- if skill.note =~ /<(\w+):\s(\d+)>/
- draw_skill_stat($1, $2)
- draw_skill_slot_required(skill)
- elsif skill.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_skill_stat($1, $2)
- draw_skill_stat($3, $4)
- draw_skill_slot_required(skill)
- elsif skill.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_skill_stat($1, $2)
- draw_skill_stat($3, $4)
- draw_skill_stat($5, $6)
- draw_skill_slot_required(skill)
- elsif skill.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- draw_skill_stat($1, $2)
- draw_skill_stat($3, $4)
- draw_skill_stat($5, $6)
- draw_skill_stat($7, $8)
- draw_skill_slot_required(skill)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Check Skill Stats Compatibility
- #--------------------------------------------------------------------------
- def stat_compatible?(stat_name, stat)
- @skill_stat = stat.to_i
- return @actor.dk_actor_stat[stat_name.to_sym] >= @skill_stat
- end
- #--------------------------------------------------------------------------
- # * Set Actor
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- end
- end
- #==============================================================================
- # ** Window_BlackSmith_Command
- #------------------------------------------------------------------------------
- # This window is for selecting buy/sell on the shop screen.
- #==============================================================================
- class Window_blacksmith_Command < Window_HorzCommand
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(window_width)
- @window_width = window_width
- super(0, 0)
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- @window_width
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 3
- end
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("Upgrade", :upgrade)
- add_command("Infuse", :infuse)
- add_command("Repair", :repair)
- end
- end
- #==============================================================================
- # ** Window_Blacksmith_ItemCategory
- #------------------------------------------------------------------------------
- # This window is for selecting a category of equipment
- # on the Blacksmith screen.
- #==============================================================================
- class Window_Blacksmith_ItemCategory < Window_ItemCategory
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::weapon, :weapon)
- add_command(Vocab::armor, :armor)
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 2
- end
- end
- #==============================================================================
- # ** Window_Upgrade_Status
- #------------------------------------------------------------------------------
- # This window displays the actor's equipment on the Blacksmith After Update.
- #==============================================================================
- class Window_Upgrade_Status < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- @item = nil
- @page_index = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_equip_info(4, line_height * 2) if @item.is_a?(RPG::EquipItem)
- end
- #--------------------------------------------------------------------------
- # * Set Item
- #--------------------------------------------------------------------------
- def item=(item)
- @item = item
- refresh
- end
- #--------------------------------------------------------------------------
- # * Draw Equipment Information
- #--------------------------------------------------------------------------
- def draw_equip_info(x, y)
- status_members.each_with_index do |actor, i|
- draw_actor_equip_info(x, y + line_height * (i * 2.4), actor)
- end
- end
- #--------------------------------------------------------------------------
- # * Array of Actors for Which to Draw Equipment Information
- #--------------------------------------------------------------------------
- def status_members
- $game_party.members[@page_index * page_size, page_size]
- end
- #--------------------------------------------------------------------------
- # * Number of Actors Displayable at Once
- #--------------------------------------------------------------------------
- def page_size
- return 4
- end
- #--------------------------------------------------------------------------
- # * Get Maximum Number of Pages
- #--------------------------------------------------------------------------
- def page_max
- ($game_party.members.size + page_size - 1) / page_size
- end
- #--------------------------------------------------------------------------
- # * Draw Actor Equipment Information
- #--------------------------------------------------------------------------
- def draw_actor_equip_info(x, y, actor)
- enabled = actor.equippable?(@item)
- change_color(normal_color, enabled)
- draw_text(x, y, 112, line_height, actor.name)
- item1 = current_equipped_item(actor, @item.etype_id)
- draw_actor_param_change(x, y, actor, item1) if enabled
- draw_item_name(item1, x, y + line_height, enabled)
- end
- #--------------------------------------------------------------------------
- # * Draw Actor Parameter Change
- #--------------------------------------------------------------------------
- def draw_actor_param_change(x, y, actor, item1)
- rect = Rect.new(x, y, contents.width - 4 - x, line_height)
- change = @item.fake_upgrade(param_id) - (item1 ? item1.params[param_id] : 0)
- change_color(param_change_color(change))
- draw_text(rect, sprintf("%+d", change), 2)
- end
- #--------------------------------------------------------------------------
- # * Get Parameter ID Corresponding to Selected Item
- # By default, ATK if weapon and DEF if armor.
- #--------------------------------------------------------------------------
- def param_id
- @item.is_a?(RPG::Weapon) ? 2 : 3
- end
- #--------------------------------------------------------------------------
- # * Get Current Equipment
- # Returns the weaker equipment if there is more than one of the same type,
- # such as with dual wield.
- #--------------------------------------------------------------------------
- def current_equipped_item(actor, etype_id)
- list = []
- actor.equip_slots.each_with_index do |slot_etype_id, i|
- list.push(actor.equips[i]) if slot_etype_id == etype_id
- end
- list.max_by {|item| item ? item.params[param_id] : 0}
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- update_page
- end
- #--------------------------------------------------------------------------
- # * Update Page
- #--------------------------------------------------------------------------
- def update_page
- if visible && Input.trigger?(:A) && page_max > 1
- @page_index = (@page_index + 1) % page_max
- refresh
- end
- end
- end
- #==============================================================================
- # ** Window_Blacksmith_Upgrade
- #------------------------------------------------------------------------------
- # This window displays a list of Equipment in possession for repair on the
- # Blacksmith screen.
- #==============================================================================
- class Window_Blacksmith_Upgrade < Window_ItemList
- attr_reader :status_window # Status window
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, height)
- super(x, y, window_width, height)
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return 304
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 1
- end
- #--------------------------------------------------------------------------
- # * Get Activation State of Selection Item
- #--------------------------------------------------------------------------
- def current_item_enabled?
- enable?(@data[index])
- end
- #--------------------------------------------------------------------------
- # * Display in Enabled State?
- #--------------------------------------------------------------------------
- def enable?(item)
- item && calculate_upgrade_cost(item) <= $game_party.gold
- end
- #--------------------------------------------------------------------------
- # * Draw Reapir Cost of Items
- #--------------------------------------------------------------------------
- def draw_item_upgrade_cost(rect, item)
- draw_text(rect, calculate_upgrade_cost(item), 2)
- end
- #--------------------------------------------------------------------------
- # * New Methof: Calculate Repair Cost
- #--------------------------------------------------------------------------
- def calculate_upgrade_cost(item)
- return ((1 + item.equip_lv) * 0.1 * item.price).to_i
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- if item
- rect = item_rect(index)
- rect.width -= 4
- draw_item_name(item, rect.x, rect.y, enable?(item))
- draw_item_upgrade_cost(rect, item)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Item Name
- # enabled : Enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- contents.font.size = 15
- contents.font.bold = true
- change_color(normal_color, enabled)
- draw_text(x + 2, y, 15, 15, "E") unless $game_party.has_item?(item)
- contents.font.size = Font.default_size
- contents.font.bold = Font.default_bold
- draw_icon(item.icon_index, x + 10, y, enabled)
- change_color(normal_color, enabled)
- draw_text(x + 34, y, width, line_height, item.name)
- end
- #--------------------------------------------------------------------------
- # * Create Item List
- #--------------------------------------------------------------------------
- def make_item_list
- @data = $game_party.equip_items.select {|item| include?(item) if (item.get_equip_lv < 10) }
- $game_party.members.each do |actor|
- actor.equips.each do |equipment|
- @data.push(equipment) if include?(equipment) && equipment.get_equip_lv < 10
- end
- end
- @data.push(nil) if include?(nil)
- end
- #--------------------------------------------------------------------------
- # * Set Status Window
- #--------------------------------------------------------------------------
- def status_window=(status_window)
- @status_window = status_window
- call_update_help
- end
- #--------------------------------------------------------------------------
- # * Update Help Text
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_item(item) if @help_window
- @status_window.item = item if @status_window
- end
- end
- #==============================================================================
- # ** Window_Blacksmith_Repair
- #------------------------------------------------------------------------------
- # This window displays a list of Equipment in possession for repair on the
- # Blacksmith screen.
- #==============================================================================
- class Window_Blacksmith_Repair < Window_ItemList
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- end
- #--------------------------------------------------------------------------
- # * Get Activation State of Selection Item
- #--------------------------------------------------------------------------
- def current_item_enabled?
- enable?(@data[index])
- end
- #--------------------------------------------------------------------------
- # * Display in Enabled State?
- #--------------------------------------------------------------------------
- def enable?(item)
- item && calculate_repair_cost(item) <= $game_party.gold
- end
- #--------------------------------------------------------------------------
- # * Draw Reapir Cost of Items
- #--------------------------------------------------------------------------
- def draw_item_repair_cost(rect, item)
- draw_text(rect, calculate_repair_cost(item), 2)
- end
- #--------------------------------------------------------------------------
- # * New Methof: Calculate Repair Cost
- #--------------------------------------------------------------------------
- def calculate_repair_cost(item)
- return ((1.0 - (item.get_durability.to_f / item.get_original_durability.to_f)) * 0.75 * item.price).to_i
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- if item
- rect = item_rect(index)
- rect.width -= 4
- draw_item_name(item, rect.x, rect.y, enable?(item))
- draw_item_repair_cost(rect, item)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Item Name
- # enabled : Enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- contents.font.size = 15
- contents.font.bold = true
- change_color(normal_color, enabled)
- draw_text(x + 2, y, 15, 15, "E") unless $game_party.has_item?(item)
- contents.font.size = Font.default_size
- contents.font.bold = Font.default_bold
- draw_icon(item.icon_index, x + 10, y, enabled)
- change_color(normal_color, enabled)
- draw_text(x + 34, y, width, line_height, item.name)
- end
- #--------------------------------------------------------------------------
- # * Create Item List
- #--------------------------------------------------------------------------
- def make_item_list
- @data = $game_party.equip_items.select {|item| include?(item) if (item.get_original_durability > item.get_durability) }
- $game_party.members.each do |actor|
- actor.equips.each do |equipment|
- @data.push(equipment) if include?(equipment) && (equipment.get_original_durability > equipment.get_durability)
- end
- end
- @data.push(nil) if include?(nil)
- end
- end
- #==============================================================================
- # ** Window_Blacksmith_Infuse
- #------------------------------------------------------------------------------
- # This window displays a list of Equipment in possession for Infuse on the
- # Blacksmith screen.
- #==============================================================================
- class Window_Blacksmith_Infuse < Window_ItemList
- include GGSlayer::Dark_Souls_System
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- end
- #--------------------------------------------------------------------------
- # * Get Activation State of Selection Item
- #--------------------------------------------------------------------------
- def current_item_enabled?
- enable?(@data[index])
- end
- #--------------------------------------------------------------------------
- # * Display in Enabled State?
- #--------------------------------------------------------------------------
- def enable?(item)
- item && infuse_cost(item) <= $game_party.gold
- end
- #--------------------------------------------------------------------------
- # * Draw Infuse Cost
- #--------------------------------------------------------------------------
- def draw_infuse_cost(rect, item)
- draw_text(rect, infuse_cost(item), 2)
- end
- #--------------------------------------------------------------------------
- # * New Methof: Calculate Repair Cost
- #--------------------------------------------------------------------------
- def infuse_cost(item)
- return INFUSE_COST
- end
- #--------------------------------------------------------------------------
- # * Draw Item Name
- # enabled : Enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- contents.font.size = 15
- contents.font.bold = true
- change_color(normal_color, enabled)
- draw_text(x + 2, y, 15, 15, "E") unless $game_party.has_item?(item)
- contents.font.size = Font.default_size
- contents.font.bold = Font.default_bold
- draw_icon(item.icon_index, x + 10, y, enabled)
- change_color(normal_color, enabled)
- draw_text(x + 34, y, width, line_height, item.name)
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- if item
- rect = item_rect(index)
- rect.width -= 4
- draw_item_name(item, rect.x, rect.y, enable?(item))
- draw_infuse_cost(rect, item)
- end
- end
- #--------------------------------------------------------------------------
- # * Create Item List
- #--------------------------------------------------------------------------
- def make_item_list
- @data = $game_party.weapons.select {|item| include?(item)}
- $game_party.armors.select {|item| @data.push(item) if include?(item) && item.etype_id == 1}
- $game_party.members.each do |actor|
- slot_number = 0
- actor.equips.each do |equipment|
- @data.push(equipment) if include?(equipment) && slot_number < 3
- slot_number += 1
- end
- end
- @data.push(nil) if include?(nil)
- end
- end
- #==============================================================================
- # ** Window_Element
- #------------------------------------------------------------------------------
- # This window displays a list of Equipment in possession for Infuse on the
- # Blacksmith screen.
- #==============================================================================
- class Window_Element < Window_Command
- include GGSlayer::Dark_Souls_System
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y)
- element_pic
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return 300
- end
- #--------------------------------------------------------------------------
- # * Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- fitting_height(visible_line_number)
- end
- #--------------------------------------------------------------------------
- # * Get Number of Lines to Show
- #--------------------------------------------------------------------------
- def visible_line_number
- return 4
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 5
- end
- #--------------------------------------------------------------------------
- # * Get Spacing for Items Arranged Side by Side
- #--------------------------------------------------------------------------
- def spacing
- return 0
- end
- #--------------------------------------------------------------------------
- # * Get Alignment
- #--------------------------------------------------------------------------
- def alignment
- return 1
- end
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("", :none)
- add_command("", :fire)
- add_command("", :ice)
- add_command("", :thunder)
- add_command("", :water)
- add_command("", :earth)
- add_command("", :wind)
- add_command("", :holy)
- add_command("", :dark)
- end
- #--------------------------------------------------------------------------
- # * Create Images for Element
- #--------------------------------------------------------------------------
- def element_pic
- pos_x = (item_width - 25) / 2
- pos_y = (item_width - 10)
- draw_icon(NO_ELEMENT_ICON, pos_x + item_width * 0, 5, true, true)
- draw_icon(FIRE_ELEMENT_ICON, pos_x + (item_width) * 1, 5, true, true)
- draw_icon(ICE_ELEMENT_ICON, pos_x + (item_width) * 2, 5, true, true)
- draw_icon(THUNDER_ELEMENT_ICON, pos_x + (item_width) * 3, 5, true, true)
- draw_icon(WATER_ELEMENT_ICON, pos_x + (item_width) * 4, 5, true, true)
- draw_icon(EARTH_ELEMENT_ICON, pos_x + (item_width) * 0, pos_y, true, true)
- draw_icon(WIND_ELEMENT_ICON, pos_x + (item_width) * 1, pos_y, true, true)
- draw_icon(HOLY_ELEMNT_ICON, pos_x + (item_width) * 2, pos_y, true, true)
- draw_icon(DARK_ELEMENT_ICON, pos_x + (item_width) * 3, pos_y, true, true)
- end
- #--------------------------------------------------------------------------
- # * Get Rectangle for Drawing Items
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = item_width - 15
- rect.x = index % col_max * (item_width + spacing)
- rect.y = index / col_max * (item_width - 15)
- rect
- end
- end
- #==============================================================================
- # ** Window_SkillList
- #------------------------------------------------------------------------------
- # This window is for displaying a list of available skills on the skill window.
- #==============================================================================
- class Window_SkillList < Window_Selectable
- attr_accessor :actor
- #--------------------------------------------------------------------------
- # * Display Skill in Active State?
- #--------------------------------------------------------------------------
- def enable?(item)
- @actor && @actor.usable?(item) && item_attribute_active?(item)
- end
- #--------------------------------------------------------------------------
- # * New Method: Check Skill Attribute is Active
- #--------------------------------------------------------------------------
- def item_attribute_active?(item)
- return true if item.note =~ /Physical/ && @actor.physical_attribute
- return true if item.note =~ /Magical/ && @actor.magical_attribute
- return true if item.note =~ /Faith/ && @actor.faith_attribute
- return false
- end
- end
- #==============================================================================
- # ** Window_Status
- #------------------------------------------------------------------------------
- # This window displays full status specs on the status screen.
- #==============================================================================
- class Window_Status < Window_Selectable
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_block1 (line_height * 0)
- draw_horz_line(line_height * 1)
- draw_block2 (line_height * 2 - 15)
- draw_horz_line(line_height * 6 - 5)
- draw_block3 (line_height * 6 + 5)
- draw_horz_line(line_height * 13 + 15)
- draw_block4 (line_height * 14)
- end
- #--------------------------------------------------------------------------
- # * Draw Level
- #--------------------------------------------------------------------------
- def draw_actor_level(actor, x, y)
- change_color(system_color)
- draw_text(x, y, 32, line_height, Vocab::level_a)
- change_color(normal_color)
- draw_text(x + 32, y, 24, line_height, actor.get_dk_actor_level, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block 3
- #--------------------------------------------------------------------------
- def draw_block3(y)
- draw_stats(32, y)
- draw_parameters(160, y)
- draw_equipments(320, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- contents.fill_rect(0, y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Draw Experience Information
- #--------------------------------------------------------------------------
- def draw_exp_info(x, y)
- s1 = @actor.max_level? ? "-------" : @actor.get_dk_actor_exp
- s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp_for_level(@actor.get_dk_actor_level)
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- change_color(system_color)
- draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
- draw_text(x, y + line_height * 2, 180, line_height, s_next)
- change_color(normal_color)
- draw_text(x, y + line_height * 1, 180, line_height, s1, 2)
- draw_text(x, y + line_height * 3, 180, line_height, s2, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Parameters
- #--------------------------------------------------------------------------
- def draw_parameters(x, y)
- 6.times {|i| draw_actor_param(@actor, x, y + line_height * i, i + 2) }
- draw_actor_memory_slot(@actor, x, y + line_height * 6)
- end
- #--------------------------------------------------------------------------
- # * Draw Parameters
- #--------------------------------------------------------------------------
- def draw_actor_param(actor, x, y, param_id)
- change_color(system_color)
- draw_text(x, y, 120, line_height, Vocab::param(param_id))
- change_color(normal_color)
- draw_text(x + 100, y, 36, line_height, actor.param(param_id), 1)
- end
- #--------------------------------------------------------------------------
- # * Draw Actor Memory Slot
- #--------------------------------------------------------------------------
- def draw_actor_memory_slot(actor, x, y)
- change_color(system_color)
- draw_text(x, y, 120, line_height, "ATN")
- change_color(normal_color)
- draw_text(x + 100, y, 36, line_height, actor.get_number_of_slot, 1)
- end
- #--------------------------------------------------------------------------
- # * Draw Stats
- #--------------------------------------------------------------------------
- def draw_stats(x, y)
- change_color(system_color)
- draw_icon(VIT_ICON, x, y, true, true)
- draw_icon(INT_ICON, x, y + line_height, true, true)
- draw_icon(FTH_ICON, x, y + line_height * 2, true, true)
- draw_icon(STR_ICON, x, y + line_height * 3, true, true)
- draw_icon(DEX_ICON, x, y + line_height * 4, true, true)
- draw_icon(LUK_ICON, x, y + line_height * 5, true, true)
- draw_icon(ATN_ICON, x, y + line_height * 6, true, true)
- change_color(normal_color)
- draw_text(x, y, 155, line_height, @actor.get_dk_actor_vit, 1)
- draw_text(x, y + line_height, 155, line_height, @actor.get_dk_actor_int, 1)
- draw_text(x, y + line_height * 2, 155, line_height, @actor.get_dk_actor_fth, 1)
- draw_text(x, y + line_height * 3, 155, line_height, @actor.get_dk_actor_str, 1)
- draw_text(x, y + line_height * 4, 155, line_height, @actor.get_dk_actor_dex, 1)
- draw_text(x, y + line_height * 5, 155, line_height, @actor.get_dk_actor_luck, 1)
- draw_text(x, y + line_height * 6, 155, line_height, @actor.get_dk_actor_atn, 1)
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_stat_points_Scene_Menu_start start
- def start
- ggslayer_dark_souls_stat_points_Scene_Menu_start()
- create_exp_window
- end
- #--------------------------------------------------------------------------
- # * New Method: Create Exp Window
- #--------------------------------------------------------------------------
- def create_exp_window
- @exp_window = Window_Exp.new
- @exp_window.x = 0
- @exp_window.y = Graphics.height - (2 * @exp_window.height)
- end
- end
- #==============================================================================
- # ** Scene_Status_Point
- #------------------------------------------------------------------------------
- # This class performs the Actor Status Point screen processing.
- #==============================================================================
- class Scene_Status_Point < Scene_MenuBase
- include GGSlayer::Dark_Souls_System
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- @actor = get_actor($actor_name)
- @lv = 1
- @total_exp = @actor.get_dk_actor_exp
- @vit_called = 0
- @int_called = 0
- @fth_called = 0
- @str_called = 0
- @dex_called = 0
- @luck_called = 0
- @atn_called = 0
- @status_point_window = Window_Status_Point.new(@actor)
- @commands = Stat_Commands.new(28, 160, @actor)
- @commands.opacity = 0
- @status_point_window.set_handler(:cancel, method(:return_scene))
- @status_point_window.set_handler(:pagedown, method(:next_actor))
- @status_point_window.set_handler(:pageup, method(:prev_actor))
- @commands.set_handler(:increase, method(:increase_state))
- @commands.set_handler(:decrease, method(:decrease_state))
- @commands.set_handler(:ok, method(:level_up_character))
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor
- #--------------------------------------------------------------------------
- def get_actor(name)
- $game_party.members.each do |actor|
- if actor.name == name
- return actor
- end
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Submit Actor Level UP Points
- #--------------------------------------------------------------------------
- def level_up_character
- if @lv > 1
- @actor.dk_level_up(@lv - 1)
- @actor.increase_dk_actor_exp(get_total_exp)
- if @vit_called > 0
- @actor.increase_dk_actor_vit(@vit_called)
- @actor.add_param(0, @vit_called * Parameter_Increase_Per_Stat[:mhp]) if @actor.mhp < 9999
- @actor.add_param(3, @vit_called * Parameter_Increase_Per_Stat[:def])
- end
- if @int_called > 0
- @actor.increase_dk_actor_int(@int_called)
- @actor.add_param(1, @int_called * Parameter_Increase_Per_Stat[:mmp])
- @actor.add_param(4, @int_called * Parameter_Increase_Per_Stat[:mat])
- @actor.add_param(5, @int_called * Parameter_Increase_Per_Stat[:mdf])
- end
- if @fth_called > 0
- @actor.increase_dk_actor_fth(@fth_called)
- @actor.add_param(1, @fth_called * Parameter_Increase_Per_Stat[:mmp])
- @actor.add_param(3, @fth_called * Parameter_Increase_Per_Stat[:def])
- @actor.add_param(5, @fth_called * Parameter_Increase_Per_Stat[:mdf])
- end
- if @str_called > 0
- @actor.increase_dk_actor_str(@str_called)
- @actor.add_param(2, @str_called * Parameter_Increase_Per_Stat[:att])
- @actor.add_param(3, @str_called * Parameter_Increase_Per_Stat[:def])
- end
- if @dex_called > 0
- @actor.increase_dk_actor_dex(@dex_called)
- @actor.add_param(2, @dex_called * Parameter_Increase_Per_Stat[:att])
- @actor.add_param(6, @dex_called * Parameter_Increase_Per_Stat[:agi])
- end
- if @luck_called > 0
- @actor.increase_dk_actor_luck(@luck_called)
- @actor.add_param(0, @luck_called * Parameter_Increase_Per_Stat[:mhp]) if @actor.mhp < 9999
- @actor.add_param(7, @luck_called * Parameter_Increase_Per_Stat[:luk])
- end
- if @atn_called > 0
- @actor.increase_dk_actor_atn(@atn_called)
- @actor.add_param(6, @atn_called * Parameter_Increase_Per_Stat[:agi])
- end
- $game_party.lose_exp(@total_exp)
- @total_exp = @actor.get_dk_actor_exp
- @lv = 1
- @vit_called = 0
- @int_called = 0
- @fth_called = 0
- @str_called = 0
- @dex_called = 0
- @luck_called = 0
- @atn_called = 0
- return_normal_color
- return true
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Actor Stat
- #--------------------------------------------------------------------------
- def increase_state
- @lv = 1 if @lv == 0
- if get_exp_increase_value < @commands.exp
- if @commands.current_symbol == :vit && (@actor.get_dk_actor_vit + @vit_called) < 99
- @vit_called += 1
- @vit_called += @luck_called if @luck_called > 0
- @commands.draw_increase_vit(24, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @status_point_window.draw_actor_hp_change(@actor, 136, 82, Parameter_Increase_Per_Stat[:mhp] * @vit_called)
- @vit_called -= @luck_called if @luck_called > 0
- @vit_called += @str_called if @str_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 1, Parameter_Increase_Per_Stat[:def] * @vit_called, 3)
- @vit_called -= @str_called if @str_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :int && (@actor.get_dk_actor_int + @int_called) < 99
- @int_called += 1
- @commands.draw_increase_int(48, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @int_called += @fth_called if @fth_called > 0
- @status_point_window.draw_actor_mp_change(@actor, 136, 112, Parameter_Increase_Per_Stat[:mmp] * @int_called)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 2, Parameter_Increase_Per_Stat[:mat] * @int_called, 4)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 3, Parameter_Increase_Per_Stat[:mdf] * @int_called, 5)
- @int_called -= @fth_called if @fth_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :fth && (@actor.get_dk_actor_fth + @fth_called) < 99
- @fth_called += 1
- @commands.draw_increase_fth(72, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @fth_called += @int_called if @int_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 2, Parameter_Increase_Per_Stat[:mat] * @fth_called, 4)
- @status_point_window.draw_actor_mp_change(@actor, 136, 112, Parameter_Increase_Per_Stat[:mmp] * @fth_called)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 3, Parameter_Increase_Per_Stat[:mdf] * @fth_called, 5)
- @fth_called -= @int_called if @int_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :str && (@actor.get_dk_actor_str + @str_called) < 99
- @str_called += 1
- @commands.draw_increase_str(98, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @str_called += @dex_called if @dex_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 0, Parameter_Increase_Per_Stat[:att] * @str_called, 2)
- @str_called -= @dex_called if @dex_called > 0
- @str_called += @vit_called if @vit_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 1, Parameter_Increase_Per_Stat[:def] * @str_called, 3)
- @str_called -= @vit_called if @vit_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :dex && (@actor.get_dk_actor_dex + @dex_called) < 99
- @dex_called += 1
- @commands.draw_increase_dex(122, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @dex_called += @str_called if @str_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 0, Parameter_Increase_Per_Stat[:att] * @dex_called, 2)
- @dex_called -= @str_called if @str_called > 0
- @dex_called += @atn_called if @atn_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 4, Parameter_Increase_Per_Stat[:agi] * @dex_called, 6)
- @dex_called -= @atn_called if @atn_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :luck && (@actor.get_dk_actor_luck + @luck_called) < 99
- @luck_called += 1
- @commands.draw_increase_luck(146, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @luck_called += @vit_called if @vit_called > 0
- @status_point_window.draw_actor_hp_change(@actor, 136, 82, Parameter_Increase_Per_Stat[:mhp] * @luck_called)
- @luck_called -= @vit_called if @vit_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 5, Parameter_Increase_Per_Stat[:luk] * @luck_called, 7)
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- elsif @commands.current_symbol == :atn && (@actor.get_dk_actor_atn + @atn_called) < 99
- @atn_called += 1
- @commands.draw_increase_atn(170, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv)
- @atn_called += @dex_called if @dex_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 4, Parameter_Increase_Per_Stat[:agi] * @atn_called, 6)
- @atn_called -= @dex_called if @dex_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 6, ((@actor.get_dk_actor_atn + @atn_called) / 5), 8) if ((@actor.get_dk_actor_atn + @atn_called) % 5 == 0)
- @status_point_window.draw_actor_level_exp_change(304, 48, increase_total_exp, (@actor.get_dk_actor_level) + @lv)
- @lv += 1
- else
- return false
- end
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Decraese Actor Stat
- #--------------------------------------------------------------------------
- def decrease_state
- if @lv > 0
- if @commands.current_symbol == :vit && @vit_called > 0
- @vit_called -= 1
- @lv -= 1
- @vit_called += @luck_called if @luck_called > 0
- @commands.draw_decrease_vit(24, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @status_point_window.draw_actor_hp_change(@actor, 136, 82, Parameter_Increase_Per_Stat[:mhp] * @vit_called)
- @vit_called -= @luck_called if @luck_called > 0
- @vit_called += @str_called if @str_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 1, Parameter_Increase_Per_Stat[:def] * @vit_called, 3)
- @vit_called -= @str_called if @str_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :int && @int_called > 0
- @int_called -= 1
- @lv -= 1
- @commands.draw_decrease_int(48, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @int_called += @fth_called if @fth_called > 0
- @status_point_window.draw_actor_mp_change(@actor, 136, 112, Parameter_Increase_Per_Stat[:mmp] * @int_called)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 2, Parameter_Increase_Per_Stat[:mat] * @int_called, 4)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 3, Parameter_Increase_Per_Stat[:mdf] * @int_called, 5)
- @int_called -= @fth_called if @fth_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :fth && @fth_called > 0
- @fth_called -= 1
- @lv -= 1
- @commands.draw_decrease_fth(72, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @fth_called += @int_called if @int_called > 0
- @status_point_window.draw_actor_mp_change(@actor, 136, 112, Parameter_Increase_Per_Stat[:mmp] * @fth_called)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 2, Parameter_Increase_Per_Stat[:mat] * @fth_called, 4)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 3, Parameter_Increase_Per_Stat[:mdf] * @fth_called, 5)
- @fth_called -= @int_called if @int_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :str && @str_called > 0
- @str_called -= 1
- @lv -= 1
- @commands.draw_decrease_str(98, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 0, Parameter_Increase_Per_Stat[:att] * @str_called, 2)
- @str_called += @vit_called if @vit_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 1, Parameter_Increase_Per_Stat[:def] * @str_called, 3)
- @str_called -= @vit_called if @vit_called > 0
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :dex && @dex_called > 0
- @dex_called -= 1
- @lv -= 1
- @commands.draw_decrease_dex(122, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @dex_called += @str_called if @str_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 0, Parameter_Increase_Per_Stat[:att] * @dex_called, 2)
- @dex_called -= @str_called if @str_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 4, Parameter_Increase_Per_Stat[:agi] * @dex_called, 6)
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :luck && @luck_called > 0
- @luck_called -= 1
- @lv -= 1
- @commands.draw_decrease_luck(146, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @luck_called += @vit_called if @vit_called > 0
- @status_point_window.draw_actor_hp_change(@actor, 136, 82, Parameter_Increase_Per_Stat[:mhp] * @luck_called)
- @luck_called -= @vit_called if @vit_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 5, Parameter_Increase_Per_Stat[:luk] * @luck_called, 7)
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- elsif @commands.current_symbol == :atn && @atn_called > 0
- @atn_called -= 1
- @lv -= 1
- @commands.draw_decrease_atn(170, get_exp_increase_value)
- @status_point_window.draw_actor_level_change(@actor, 136, 48, @lv - 1)
- @atn_called += @dex_called if @dex_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 4, Parameter_Increase_Per_Stat[:agi] * @atn_called, 6)
- @atn_called -= @dex_called if @dex_called > 0
- @status_point_window.draw_actor_param_change(@actor, 288, 168, 6, ((@actor.get_dk_actor_atn + @atn_called) / 5), 8) if !((@actor.get_dk_actor_atn + @atn_called) % 5 == 0)
- @status_point_window.draw_actor_level_exp_change(304, 48, decrease_total_exp, (@actor.get_dk_actor_level) + @lv - 1)
- else
- return false
- end
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Call Redraw Methods
- #--------------------------------------------------------------------------
- def return_normal_color
- @status_point_window.return_actor_level_normal_color(@actor)
- @status_point_window.return_actor_hp_normal_color(@actor)
- @status_point_window.return_actor_mp_normal_color(@actor)
- @status_point_window.return_exp_color
- @status_point_window.return_parameters_color
- @commands.return_actor_stat_normal_color(@actor)
- end
- #--------------------------------------------------------------------------
- # * New Method: Increase Temporary Exp
- #--------------------------------------------------------------------------
- def increase_total_exp
- @total_exp += get_exp_increase_value
- end
- #--------------------------------------------------------------------------
- # * New Method: Decrease Temporary Exp
- #--------------------------------------------------------------------------
- def decrease_total_exp
- @total_exp -= get_exp_increase_value
- end
- #--------------------------------------------------------------------------
- # * New Method: Return Temporary Exp
- #--------------------------------------------------------------------------
- def get_total_exp
- @total_exp -= @actor.get_dk_actor_exp
- end
- #--------------------------------------------------------------------------
- # * New Method: Return Increase In Temporary Exp
- #--------------------------------------------------------------------------
- def get_exp_increase_value
- (@actor.exp_for_level(@actor.get_dk_actor_level + @lv) - @actor.exp_for_level(@actor.get_dk_actor_level + @lv - 1))
- end
- end
- #==============================================================================
- # ** Scene_Equip
- #------------------------------------------------------------------------------
- # This class performs the equipment screen processing.
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- alias ggslayer_dark_souls_stat_points_Scene_Equip_start start
- def start
- super
- create_help_window
- create_status_window
- create_slot_window
- create_weapon_stat_window
- create_item_window
- end
- #--------------------------------------------------------------------------
- # * Create Slot Window
- #--------------------------------------------------------------------------
- def create_slot_window
- wx = @status_window.width
- wy = @help_window.height
- ww = Graphics.width - @status_window.width
- @slot_window = Window_EquipSlot.new(wx, wy, ww)
- @slot_window.viewport = @viewport
- @slot_window.help_window = @help_window
- @slot_window.status_window = @status_window
- @slot_window.actor = @actor
- @slot_window.set_handler(:ok, method(:on_slot_ok))
- @slot_window.set_handler(:cancel, method(:return_scene))
- @slot_window.activate
- @slot_window.select(0)
- end
- #--------------------------------------------------------------------------
- # * Create Item Window
- #--------------------------------------------------------------------------
- def create_item_window
- wx = 0
- wy = @slot_window.y + @slot_window.height
- ww = Graphics.width
- wh = Graphics.height - wy - 50
- @item_window = Window_EquipItem.new(wx, wy, ww, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.status_window = @status_window
- @item_window.stat_window = @stat_weapon
- @item_window.actor = @actor
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- @slot_window.item_window = @item_window
- end
- #--------------------------------------------------------------------------
- # * New Method: Create Weapon Stat Window
- #--------------------------------------------------------------------------
- def create_weapon_stat_window
- y = Graphics.height - 50
- @stat_weapon = Window_Equip_Stat.new(0, y, Graphics.width, 50)
- @stat_weapon.actor = @actor
- end
- #--------------------------------------------------------------------------
- # * Slot [OK]
- #--------------------------------------------------------------------------
- def on_slot_ok
- @item_window.activate
- @item_window.select(0)
- end
- #--------------------------------------------------------------------------
- # * Item [OK]
- #--------------------------------------------------------------------------
- def on_item_ok
- if @item_window.item != nil && @item_window.item.note != ""
- if @item_window.item.note =~ /<(\w+):\s(\d+)>/
- if @stat_weapon.stat_compatible?($1, $2, @slot_window.show_slot) &&
- @item_window.item.get_durability > 0
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1
- @actor.change_equip(1, nil) if @slot_window.index == 2
- @actor.activate_physical_attribute if @item_window.item.note =~ /Physical/
- @actor.activate_magical_attribute if @item_window.item.note =~ /Magical/
- @actor.activate_faith_attribute if @item_window.item.note =~ /Faith/
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif @item_window.item.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_weapon.stat_compatible?($1, $2, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($3, $4, @slot_window.show_slot) &&
- @item_window.item.get_durability > 0
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1
- @actor.change_equip(1, nil) if @slot_window.index == 2
- @actor.activate_physical_attribute if @item_window.item.note =~ /Physical/
- @actor.activate_magical_attribute if @item_window.item.note =~ /Magical/
- @actor.activate_faith_attribute if @item_window.item.note =~ /Faith/
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif @item_window.item.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_weapon.stat_compatible?($1, $2, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($3, $4, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($5, $6, @slot_window.show_slot) &&
- @item_window.item.get_durability > 0
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1
- @actor.change_equip(1, nil) if @slot_window.index == 2
- @actor.activate_physical_attribute if @item_window.item.note =~ /Physical/
- @actor.activate_magical_attribute if @item_window.item.note =~ /Magical/
- @actor.activate_faith_attribute if @item_window.item.note =~ /Faith/
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif @item_window.item.note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_weapon.stat_compatible?($1, $2, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($3, $4, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($5, $6, @slot_window.show_slot) &&
- @stat_weapon.stat_compatible?($7, $8, @slot_window.show_slot) &&
- @item_window.item.get_durability > 0
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1
- @actor.change_equip(1, nil) if @slot_window.index == 2
- @actor.activate_physical_attribute if @item_window.item.note =~ /Physical/
- @actor.activate_magical_attribute if @item_window.item.note =~ /Magical/
- @actor.activate_faith_attribute if @item_window.item.note =~ /Faith/
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif @item_window.item.get_durability > 0
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1 && @item_window.item != nil
- @actor.change_equip(1, nil) if @slot_window.index == 2 && @item_window.item != nil
- @actor.activate_physical_attribute if @item_window.item.note =~ /Physical/
- @actor.activate_magical_attribute if @item_window.item.note =~ /Magical/
- @actor.activate_faith_attribute if @item_window.item.note =~ /Faith/
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- else
- Sound.play_equip
- @actor.deactivate_previous_attribute(@slot_window.index)
- @actor.change_equip(@slot_window.index, @item_window.item)
- @actor.change_equip(2, nil) if @slot_window.index == 1 && @item_window.item != nil
- @actor.change_equip(1, nil) if @slot_window.index == 2 && @item_window.item != nil
- @slot_window.activate
- @slot_window.refresh
- @item_window.unselect
- @item_window.refresh
- end
- end
- end
- #==============================================================================
- # ** Scene_Skill_Equip
- #------------------------------------------------------------------------------
- # This class performs the Skill screen processing.
- #==============================================================================
- class Scene_Skill_Equip < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- @actor = get_actor($actor_name)
- create_help_window
- create_status_window
- create_skill_stat_window
- create_skill_window
- end
- #--------------------------------------------------------------------------
- # * Create Status Window
- #--------------------------------------------------------------------------
- def create_status_window
- wy = @help_window.y + @help_window.height
- @status_window = Window_Equip_Skill_Status.new(@actor, wy, 150)
- end
- #--------------------------------------------------------------------------
- # * Create Item Window
- #--------------------------------------------------------------------------
- def create_skill_window
- wx = 0
- wy = @status_window.y + @status_window.height
- ww = Graphics.width
- wh = Graphics.height - wy - 50
- @item_window = Window_Equip_SkillList.new(wx, wy, ww, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.stat_window = @stat_skill
- @item_window.actor = @actor
- @item_window.activate
- @item_window.select(0)
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # * Create Skill Stat Window
- #--------------------------------------------------------------------------
- def create_skill_stat_window
- y = Graphics.height - 50
- @stat_skill = Window_Skill_Stat.new(0, y, Graphics.width, 50)
- @stat_skill.actor = @actor
- end
- #--------------------------------------------------------------------------
- # * Item [OK]
- #--------------------------------------------------------------------------
- def on_item_ok
- if @item_window.item != nil && !@actor.is_learned?(@item_window.item.skill_id)
- equip_skill
- elsif @item_window.item != nil
- unequip_skill(@item_window.item.skill_id)
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Equip Skill For Actor
- #--------------------------------------------------------------------------
- def equip_skill
- if @item_window.item != nil && @item_window.item.note != ""
- if $data_skills[@item_window.item.skill_id].note =~ /<(\w+):\s(\d+)>/
- if @stat_skill.stat_compatible?($1, $2) &&
- @actor.memory_slot >= (@actor.get_used_memory_slot + $data_skills[@item_window.item.skill_id].get_memory_slot_required)
- Sound.play_equip
- @actor.learn_skill(@item_window.item.skill_id)
- @status_window.refresh
- @item_window.activate
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif $data_skills[@item_window.item.skill_id].note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_skill.stat_compatible?($1, $2) &&
- @stat_skill.stat_compatible?($3, $4) &&
- @actor.memory_slot >= (@actor.get_used_memory_slot + $data_skills[@item_window.item.skill_id].get_memory_slot_required)
- Sound.play_equip
- @actor.learn_skill(@item_window.item.skill_id)
- @status_window.refresh
- @item_window.activate
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif $data_skills[@item_window.item.skill_id].note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_skill.stat_compatible?($1, $2) &&
- @stat_skill.stat_compatible?($3, $4) &&
- @stat_skill.stat_compatible?($5, $6) &&
- @actor.memory_slot >= (@actor.get_used_memory_slot + $data_skills[@item_window.item.skill_id].get_memory_slot_required)
- Sound.play_equip
- @actor.learn_skill(@item_window.item.skill_id)
- @status_window.refresh
- @item_window.activate
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- elsif $data_skills[@item_window.item.skill_id].note =~ /<(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+),\s(\w+):\s(\d+)>/
- if @stat_skill.stat_compatible?($1, $2) &&
- @stat_skill.stat_compatible?($3, $4) &&
- @stat_skill.stat_compatible?($5, $6) &&
- @stat_skill.stat_compatible?($7, $8) &&
- @actor.memory_slot >= (@actor.get_used_memory_slot + $data_skills[@item_window.item.skill_id].get_memory_slot_required)
- Sound.play_equip
- @actor.learn_skill(@item_window.item.skill_id)
- @status_window.refresh
- @item_window.activate
- @item_window.refresh
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- else
- Sound.play_buzzer
- @item_window.activate
- @item_window.refresh
- end
- end
- #--------------------------------------------------------------------------
- # * New Method: Unequip Skill For Actor
- #--------------------------------------------------------------------------
- def unequip_skill(skill_id)
- @actor.forget_skill(skill_id)
- @status_window.refresh
- @item_window.activate
- @item_window.refresh
- end
- #--------------------------------------------------------------------------
- # * New Method: Get Actor
- #--------------------------------------------------------------------------
- def get_actor(name)
- $game_party.members.each do |actor|
- if actor.name == name
- return actor
- end
- end
- end
- end
- #==============================================================================
- # ** Scene_Blacksmith
- #------------------------------------------------------------------------------
- # This class performs Repair screen processing.
- #==============================================================================
- class Scene_Blacksmith < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- create_help_window
- create_gold_window
- create_command_window
- create_dummy_window
- create_category_window
- create_status_window
- create_blacksmith_upgrade_window
- create_blacksmith_repair_window
- create_blacksmith_infuse_window
- create_element_select_window
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_blacksmith_Command.new(@gold_window.x)
- @command_window.viewport = @viewport
- @command_window.y = @help_window.height
- @command_window.set_handler(:upgrade, method(:command_upgrade))
- @command_window.set_handler(:infuse, method(:command_infuse))
- @command_window.set_handler(:repair, method(:command_repair))
- @command_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # * Create Category Window
- #--------------------------------------------------------------------------
- def create_category_window
- #For Infuse Equipment
- @category_window = Window_Blacksmith_ItemCategory.new
- @category_window.viewport = @viewport
- @category_window.help_window = @help_window
- @category_window.y = @dummy_window.y
- @category_window.hide.deactivate
- @category_window.set_handler(:ok, method(:on_category_ok))
- @category_window.set_handler(:cancel, method(:on_category_cancel))
- #For Repair Equipment
- @category_window_r = Window_Blacksmith_ItemCategory.new
- @category_window_r.viewport = @viewport
- @category_window_r.help_window = @help_window
- @category_window_r.y = @dummy_window.y
- @category_window_r.hide.deactivate
- @category_window_r.set_handler(:ok, method(:on_category_ok))
- @category_window_r.set_handler(:cancel, method(:on_category_cancel))
- #For Upgrade Equipment
- @category_window_up = Window_Blacksmith_ItemCategory.new
- @category_window_up.viewport = @viewport
- @category_window_up.help_window = @help_window
- @category_window_up.y = @dummy_window.y
- @category_window_up.hide.deactivate
- @category_window_up.set_handler(:ok, method(:on_category_ok))
- @category_window_up.set_handler(:cancel, method(:on_category_cancel))
- end
- #--------------------------------------------------------------------------
- # * Create Status Window
- #--------------------------------------------------------------------------
- def create_status_window
- wx = 304
- wy = @category_window.y + @category_window.height
- ww = Graphics.width - wx
- wh = Graphics.height - wy
- @status_window = Window_Upgrade_Status.new(wx, wy, ww, wh)
- @status_window.viewport = @viewport
- @status_window.hide
- end
- #--------------------------------------------------------------------------
- # * Create Blacksmith Infuse Window
- #--------------------------------------------------------------------------
- def create_blacksmith_upgrade_window
- wy = @category_window.y + @category_window.height
- wh = Graphics.height - wy
- @blacksmith_upgrade_window = Window_Blacksmith_Upgrade.new(0, wy, wh)
- @blacksmith_upgrade_window.viewport = @viewport
- @blacksmith_upgrade_window.help_window = @help_window
- @blacksmith_upgrade_window.status_window = @status_window
- @blacksmith_upgrade_window.hide
- @blacksmith_upgrade_window.set_handler(:ok, method(:on_upgrade_ok))
- @blacksmith_upgrade_window.set_handler(:cancel, method(:on_upgrade_cancel))
- @category_window_up.item_window = @blacksmith_upgrade_window
- end
- #--------------------------------------------------------------------------
- # * Create Gold Window
- #--------------------------------------------------------------------------
- def create_gold_window
- @gold_window = Window_Gold.new
- @gold_window.viewport = @viewport
- @gold_window.x = Graphics.width - @gold_window.width
- @gold_window.y = @help_window.height
- end
- #--------------------------------------------------------------------------
- # * Create Dummy Window
- #--------------------------------------------------------------------------
- def create_dummy_window
- wy = @command_window.y + @command_window.height
- wh = Graphics.height - wy
- @dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
- @dummy_window.viewport = @viewport
- end
- #--------------------------------------------------------------------------
- # * Create Blacksmith Repair Window
- #--------------------------------------------------------------------------
- def create_blacksmith_repair_window
- wy = @category_window.y + @category_window.height
- wh = Graphics.height - wy
- @blacksmith_repair_window = Window_Blacksmith_Repair.new(0, wy, Graphics.width, wh)
- @blacksmith_repair_window.viewport = @viewport
- @blacksmith_repair_window.help_window = @help_window
- @blacksmith_repair_window.hide
- @blacksmith_repair_window.set_handler(:ok, method(:on_repair_ok))
- @blacksmith_repair_window.set_handler(:cancel, method(:on_repair_cancel))
- @category_window_r.item_window = @blacksmith_repair_window
- end
- #--------------------------------------------------------------------------
- # * Create Blacksmith Infuse Window
- #--------------------------------------------------------------------------
- def create_blacksmith_infuse_window
- wy = @category_window.y + @category_window.height
- wh = Graphics.height - wy
- @blacksmith_infuse_window = Window_Blacksmith_Infuse.new(0, wy, Graphics.width, wh)
- @blacksmith_infuse_window.viewport = @viewport
- @blacksmith_infuse_window.help_window = @help_window
- @blacksmith_infuse_window.hide
- @blacksmith_infuse_window.set_handler(:ok, method(:on_infuse_ok))
- @blacksmith_infuse_window.set_handler(:cancel, method(:on_infuse_cancel))
- @category_window.item_window = @blacksmith_infuse_window
- end
- #--------------------------------------------------------------------------
- # * Create Element Select Window
- #--------------------------------------------------------------------------
- def create_element_select_window
- wx = (Graphics.width.to_f/2).to_i - 160
- wy = (Graphics.height.to_f/2).to_i
- @elements_window = Window_Element.new(wx, wy)
- @elements_window.z = 200
- @elements_window.hide.deactivate
- @elements_window.set_handler(:none, method(:on_element_ok))
- @elements_window.set_handler(:fire, method(:on_element_ok))
- @elements_window.set_handler(:ice, method(:on_element_ok))
- @elements_window.set_handler(:thunder, method(:on_element_ok))
- @elements_window.set_handler(:water, method(:on_element_ok))
- @elements_window.set_handler(:earth, method(:on_element_ok))
- @elements_window.set_handler(:wind, method(:on_element_ok))
- @elements_window.set_handler(:holy, method(:on_element_ok))
- @elements_window.set_handler(:dark, method(:on_element_ok))
- @elements_window.set_handler(:cancel, method(:on_element_cancel))
- end
- #--------------------------------------------------------------------------
- # * [Upgrade] Command
- #--------------------------------------------------------------------------
- def command_upgrade
- @dummy_window.hide
- @category_window_up.show.activate
- @status_window.show
- @blacksmith_upgrade_window.show
- end
- #--------------------------------------------------------------------------
- # * [Infuse] Command
- #--------------------------------------------------------------------------
- def command_infuse
- @dummy_window.hide
- @category_window.show.activate
- @blacksmith_infuse_window.show
- end
- #--------------------------------------------------------------------------
- # * [Repair] Command
- #--------------------------------------------------------------------------
- def command_repair
- @dummy_window.hide
- @category_window_r.show.activate
- @blacksmith_repair_window.show
- end
- #--------------------------------------------------------------------------
- # * Repair [OK]
- #--------------------------------------------------------------------------
- def on_repair_ok
- @item = @blacksmith_repair_window.item
- do_work(@blacksmith_repair_window.calculate_repair_cost(@item))
- @item.repair(@item.get_original_durability)
- @gold_window.refresh
- @blacksmith_repair_window.refresh
- @blacksmith_repair_window.activate
- end
- #--------------------------------------------------------------------------
- # * Repair [Cancel]
- #--------------------------------------------------------------------------
- def on_repair_cancel
- @blacksmith_repair_window.unselect
- @category_window_r.activate
- @help_window.clear
- end
- #--------------------------------------------------------------------------
- # * Infuse [OK]
- #--------------------------------------------------------------------------
- def on_infuse_ok
- @item = @blacksmith_infuse_window.item
- @elements_window.show.activate
- end
- #--------------------------------------------------------------------------
- # * Infuse [Cancel]
- #--------------------------------------------------------------------------
- def on_infuse_cancel
- @blacksmith_infuse_window.unselect
- @category_window.activate
- @help_window.clear
- end
- #--------------------------------------------------------------------------
- # * Element [OK]
- #--------------------------------------------------------------------------
- def on_element_ok
- @element = 1 if @elements_window.current_symbol == :none
- @element = 3 if @elements_window.current_symbol == :fire
- @element = 4 if @elements_window.current_symbol == :ice
- @element = 5 if @elements_window.current_symbol == :thunder
- @element = 6 if @elements_window.current_symbol == :water
- @element = 7 if @elements_window.current_symbol == :earth
- @element = 8 if @elements_window.current_symbol == :wind
- @element = 9 if @elements_window.current_symbol == :holy
- @element = 10 if @elements_window.current_symbol == :dark
- @elements_window.hide.deactivate
- @blacksmith_infuse_window.activate
- @item.change_atk_element(@element) if @category_window.current_symbol == :weapon
- @item.change_def_element(@element) if @category_window.current_symbol == :armor
- do_work(@blacksmith_infuse_window.infuse_cost(@item))
- @blacksmith_infuse_window.refresh
- end
- #--------------------------------------------------------------------------
- # * Element [Cancel]
- #--------------------------------------------------------------------------
- def on_element_cancel
- @elements_window.hide.deactivate
- @blacksmith_infuse_window.activate
- end
- #--------------------------------------------------------------------------
- # * Upgrade [OK]
- #--------------------------------------------------------------------------
- def on_upgrade_ok
- @item = @blacksmith_upgrade_window.item
- do_work(@blacksmith_upgrade_window.calculate_upgrade_cost(@item))
- @item.upgrade_equip
- @gold_window.refresh
- @blacksmith_upgrade_window.refresh
- @blacksmith_upgrade_window.activate
- end
- #--------------------------------------------------------------------------
- # * Upgrade [Cancel]
- #--------------------------------------------------------------------------
- def on_upgrade_cancel
- @blacksmith_upgrade_window.unselect
- @category_window_up.activate
- @help_window.clear
- end
- #--------------------------------------------------------------------------
- # * Category [OK]
- #--------------------------------------------------------------------------
- def on_category_ok
- activate_blacksmith_upgrade_window if @command_window.current_symbol == :upgrade
- @blacksmith_upgrade_window.select(0) if @command_window.current_symbol == :upgrade
- activate_blacksmith_repair_window if @command_window.current_symbol == :repair
- @blacksmith_repair_window.select(0) if @command_window.current_symbol == :repair
- activate_blacksmith_infuse_window if @command_window.current_symbol == :infuse
- @blacksmith_infuse_window.select(0) if @command_window.current_symbol == :infuse
- end
- #--------------------------------------------------------------------------
- # * Category [Cancel]
- #--------------------------------------------------------------------------
- def on_category_cancel
- @command_window.activate
- @dummy_window.show
- @category_window.hide
- @category_window_r.hide
- @category_window_up.hide
- @blacksmith_repair_window.hide
- @blacksmith_infuse_window.hide
- @blacksmith_upgrade_window.hide
- @status_window.hide
- end
- #--------------------------------------------------------------------------
- # * Activate BlackSmith Update Window
- #--------------------------------------------------------------------------
- def activate_blacksmith_upgrade_window
- @dummy_window.hide
- @category_window_up.deactivate
- @blacksmith_upgrade_window.refresh
- @blacksmith_upgrade_window.show.activate
- end
- #--------------------------------------------------------------------------
- # * Activate BlackSmith Repair Window
- #--------------------------------------------------------------------------
- def activate_blacksmith_repair_window
- @dummy_window.hide
- @category_window_r.deactivate
- @blacksmith_repair_window.refresh
- @blacksmith_repair_window.show.activate
- end
- #--------------------------------------------------------------------------
- # * Activate BlackSmith Infuse Window
- #--------------------------------------------------------------------------
- def activate_blacksmith_infuse_window
- @dummy_window.hide
- @category_window.deactivate
- @blacksmith_infuse_window.refresh
- @blacksmith_infuse_window.show.activate
- end
- #--------------------------------------------------------------------------
- # * Execute Repair Cost
- #--------------------------------------------------------------------------
- def do_work(cost)
- $game_party.lose_gold(cost)
- RPG::SE.new("Hammer", 100, 100).play
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #------------------------------------------------------------------------------
- # This class performs battle screen processing.
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Skill [OK]
- #--------------------------------------------------------------------------
- def on_skill_ok
- @skill = @skill_window.item
- if @skill != nil && @skill.note =~ /Physical/
- if @skill_window.actor.physical_attribute
- BattleManager.actor.input.set_skill(@skill.id)
- BattleManager.actor.last_skill.object = @skill
- if !@skill.need_selection?
- @skill_window.hide
- next_command
- elsif @skill.for_opponent?
- select_enemy_selection
- else
- select_actor_selection
- end
- else
- Sound.play_buzzer
- @skill_window.activate
- end
- elsif @skill != nil && @skill.note =~ /Magical/
- if @skill_window.actor.magical_attribute
- BattleManager.actor.input.set_skill(@skill.id)
- BattleManager.actor.last_skill.object = @skill
- if !@skill.need_selection?
- @skill_window.hide
- next_command
- elsif @skill.for_opponent?
- select_enemy_selection
- else
- select_actor_selection
- end
- else
- Sound.play_buzzer
- @skill_window.activate
- end
- elsif @skill != nil && @skill.note =~ /Faith/
- if @skill_window.actor.faith_attribute
- BattleManager.actor.input.set_skill(@skill.id)
- BattleManager.actor.last_skill.object = @skill
- if !@skill.need_selection?
- @skill_window.hide
- next_command
- elsif @skill.for_opponent?
- select_enemy_selection
- else
- select_actor_selection
- end
- else
- Sound.play_buzzer
- @skill_window.activate
- end
- elsif @skill != nil
- BattleManager.actor.input.set_skill(@skill.id)
- BattleManager.actor.last_skill.object = @skill
- if !@skill.need_selection?
- @skill_window.hide
- next_command
- elsif @skill.for_opponent?
- select_enemy_selection
- else
- select_actor_selection
- end
- else
- Sound.play_buzzer
- @skill_window.activate
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment