#The code goes from the first script, then second, then third
# it should be like this
#code one
#code two
#code three
#Code one begin
# ▼▲▼ XRXS.RGSSä¿®æ£ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚º ver..07 ▼▲▼
# by 桜雅 在土
#==============================================================================
# â–¡ カスタマイズãƒã‚¤ãƒ³ãƒˆ
#==============================================================================
class Game_Battler
# 「乗算属性修æ£ã€
# ("特殊効果詰ã‚åˆã‚ã›"使用時㯠true ã«ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚falseã ã¨ã€Œæœ€é«˜å€çŽ‡ã€)
ELEMENT_CORRECT_BY_MULTI = true
end
class Game_Actor < Game_Battler
# 「スã‚ル使用å¯èƒ½æ¡ä»¶ã‚’スã‚ルを習得ã—ã¦ã„ã‚‹ã‹å¦ã‹ã«ä¾å˜ã—ãªã„ã€(falseã ã¨ä¾å˜)
INDEPEND_SKILL_USABLE_ON_LEARNED = false
end
class Window_Skill < Window_Selectable
# 「消費SP0ã‚’éš ã™ã€(falseã«ã™ã‚‹ã¨ã€"スã‚ルå : 0"ã¨ã‚¼ãƒã‚’表示ã—ã¾ã™)
HIDE_ZERO_SP_COST = true
end
#==============================================================================
=begin
 å‰æ›¸ã
    ã“ã‚Œã¯RGSSã‚’XMS.RPGツクールXPスクリプトシェルフを
より開発ã—ã‚„ã™ãã™ã‚‹ç‚ºã«ä½œã‚‰ã‚ŒãŸä¿®æ£ã®è©°ã‚åˆã‚ã›ã§ã™ã€‚
ã€€ã‚³ãƒ”ãƒ¼å ´æ‰€
    「Scene_Debugより下ã§Mainより上。
     スクリプトシェルフç‰ã‚’利用ã—ã¦ã„ã‚‹å ´åˆã¯ãれら全ã¦ã‚ˆã‚Šä¸Šã€‚ã€
※Scene_Debug以上を書ãæ›ãˆã¦ã„ã‚‹å ´åˆã€
ãれらã®å¤‰æ›´ãŒç„¡åŠ¹ã«ãªã£ã¦ã—ã¾ã†å ´åˆãŒã‚ã‚Šã¾ã™ã€‚
ä¿®æ£å†…容---------------------------------------------------------------------
ä¿®æ£/è¿½åŠ éƒ¨åˆ†
Game_Battler 属性修æ£ã®è¨ˆç®—「乗算属性修æ£ã€ã¸ã®å¯¾å¿œ
Game_Actor 「スã‚ル使用å¯èƒ½æ¡ä»¶ã€ã¸ã®å¯¾å¿œ
オートステートã®æ›´æ–°
   Window_Item @column_maxã¸ã®å¯¾å¿œ
   Window_SKill @column_maxã¸ã®å¯¾å¿œ
SP消費 0 を表示ã•ã›ãªã„機能をæ載。
   Window_EquipItem @column_maxã¸ã®å¯¾å¿œ
   Window_ShopSell @column_maxã¸ã®å¯¾å¿œ
  Scene_Map 戦闘開始時ã®BGMåœæ¢ã‚’削除
åŒã˜BGMã®å ´åˆã¯å¼•ã続ãã®æ¼”å¥ãŒå‡ºæ¥ã‚‹æ§˜ã«ä¿®æ£ã€‚
Scene_Battle ãƒãƒˆãƒ«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸å‡¦ç†è»½æ¸›ã€‚
ãƒãƒˆãƒ«çµ‚了時ã«MEをフェードアウト後ã«åœæ¢äºˆç´„
リファクタリング 部分
Game_Battler 行動ã®åŠ¹æžœé©ç”¨ã®éƒ¨åˆ†ã®ãƒªãƒ•ã‚¡ã‚¯ã‚¿ãƒªãƒ³ã‚°
Game_Actor Xä½ç½®ã®ã‚·ãƒ•ãƒˆå€¤
Window_Item æ¦å™¨ãªã©ã®@dataã¸ã®ãƒ—ッシュ
Window_MenuStatus draw_actor_menu_status
Window_EquipItem æ¦å™¨ãªã©ã®@dataã¸ã®ãƒ—ッシュ
Window_ShopSell æ¦å™¨ãªã©ã®@dataã¸ã®ãƒ—ッシュ
Window_BattleStatus draw_actor_battle_status
Scene_Equip 装備変更後ã®ãƒ‘ラメータをå–å¾— 1~4
実際ã«è£…ç€
(è¿½åŠ )refresh軽é‡åŒ–
Scene_Battle make_basic_action_target_set
battle_exp
battle_gold
è¿½åŠ ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
XRXS_Check_ElementName_Set 属性å判定
-------------------------------------------------------------ä¿®æ£å†…容ã“ã“ã¾ã§
=end
#------------------------------------------------------------------------------
#
#
# â–½ ä¿®æ£/è¿½åŠ éƒ¨åˆ†
#
#
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠属性修æ£ã®è¨ˆç®— + å€çŽ‡è¨ˆç®—å¼
#--------------------------------------------------------------------------
alias xrxs_rgss_amendcustomize_elements_correct elements_correct
def elements_correct(element_set)
if ELEMENT_CORRECT_BY_MULTI
# 無属性ã®å ´åˆ 100 ã‚’è¿”ã™
return 100 if element_set == []
# 与ãˆã‚‰ã‚ŒãŸå±žæ€§ã®ãƒ¬ãƒ¼ãƒˆã‚’å…¨ã¦ä¹—ç®—
result = 100
for i in element_set
result *= self.element_rate(i) / 100.0
end
return result.to_i
else
return xrxs_rgss_amendcustomize_elements_correct
end
end
end
#==============================================================================
# â– Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ◠スã‚ルã®ä½¿ç”¨å¯èƒ½åˆ¤å®š + 習得判定無効化è¨å®šå¯
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
# INDEPEND_SKILL_USABLE_ON_LEARNED ㌠true ã§ã‚ã‚Œã°ã‚¹ã‚ル習得判定を飛ã°ã™
if not skill_learn?(skill_id) and not INDEPEND_SKILL_USABLE_ON_LEARNED
return false
end
return super
end
#--------------------------------------------------------------------------
# ◠オートステートã®æ›´æ–°
# old_armor : 外ã—ãŸé˜²å…·
# new_armor : 装備ã—ãŸé˜²å…·
#--------------------------------------------------------------------------
def update_auto_state(old_armor, new_armor)
# 外ã—ãŸé˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆã‚’強制解除
if old_armor != nil and old_armor.auto_state_id != 0
# 外ã™é˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆãŒã€
# ä»–ã®è£…å‚™ä¸ã®é˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆã¨ä¸€è‡´ã™ã‚‹å ´åˆã€è§£é™¤ã‚’è¡Œã‚ãªã„
bool = armors_auto_state_include?(old_armor)
unless bool
remove_state(old_armor.auto_state_id, true)
end
end
# 装備ã—ãŸé˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆã‚’強制付åŠ
if new_armor != nil and new_armor.auto_state_id != 0
add_state(new_armor.auto_state_id, true)
end
end
#--------------------------------------------------------------------------
# ◠指定ã®é˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆãŒç¾åœ¨è£…å‚™ä¸ã®é˜²å…·ã®ã‚ªãƒ¼ãƒˆã‚¹ãƒ†ãƒ¼ãƒˆã«å«ã¾ã‚Œã‚‹ã‹ï¼Ÿ
#--------------------------------------------------------------------------
def armors_auto_state_include?(old_armor)
return false if old_armor.nil?
bool = false
# ç¾åœ¨è£…å‚™ä¸ã®é˜²å…·ã‚’å–å¾—
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
# 外ã•ã‚ŒãŸç®‡æ‰€ã‚’特定
case old_armor
when armor1
current_armor = armor1
when armor2
current_armor = armor2
when armor3
current_armor = armor3
when armor4
current_armor = armor4
end
# 判定
if current_armor != armor1 and !armor1.nil?
bool |= (old_armor.auto_state_id == armor1.auto_state_id)
end
if current_armor != armor2 and !armor2.nil?
bool |= (old_armor.auto_state_id == armor2.auto_state_id)
end
if current_armor != armor3 and !armor3.nil?
bool |= (old_armor.auto_state_id == armor3.auto_state_id)
end
if current_armor != armor4 and !armor4.nil?
bool |= (old_armor.auto_state_id == armor4.auto_state_id)
end
return bool
end
end
#------------------------------------------------------------------------------
#
#
# ▽ リファクタリング 部分
#
#
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠通常攻撃ã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’計算
#--------------------------------------------------------------------------
def attack_damage(attacker)
# 基本ダメージを計算
atk = [attacker.atk - self.pdef / 2, 0].max
damage = atk * (20 + attacker.str) / 20
return damage
end
#--------------------------------------------------------------------------
# ◠スã‚ルã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’計算
#--------------------------------------------------------------------------
def skill_damage(user, skill)
# å¨åŠ›ã‚’計算
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# å€çŽ‡ã‚’計算
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# 基本ダメージを計算
damage = power * rate / 20
return damage
end
#--------------------------------------------------------------------------
# ◠第一命ä¸åŠ›
#--------------------------------------------------------------------------
def first_hit_percent(user, skill = nil)
# skillãŒnilãªã‚‰ã°é€šå¸¸æ”»æ’ƒã€ã§ãªã‘ã‚Œã°ã‚¹ã‚ルã€ã¨ã„ã†åˆ¤åˆ¥ã€‚
if skill == nil
return user.hit
else
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
return hit
end
end
#--------------------------------------------------------------------------
# ◠第二命ä¸åŠ›
#--------------------------------------------------------------------------
def second_hit_percent(user, skill = nil)
# skillãŒnilãªã‚‰ã°é€šå¸¸æ”»æ’ƒã€ã§ãªã‘ã‚Œã°ã‚¹ã‚ルã€ã¨ã„ã†åˆ¤åˆ¥ã€‚
eva = 8 * self.agi / user.dex + self.eva
if skill == nil
hit = self.damage < 0 ? 100 : 100 - eva
else
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
end
hit = self.cant_evade? ? 100 : hit
return hit
end
#--------------------------------------------------------------------------
# ◠クリティカル発生確率ã®è¨ˆç®—
#--------------------------------------------------------------------------
def critical_percent(user, skill = nil)
# skillãŒnilãªã‚‰ã°é€šå¸¸æ”»æ’ƒã€ã§ãªã‘ã‚Œã°ã‚¹ã‚ルã€ã¨ã„ã†åˆ¤åˆ¥ã€‚
if skill == nil
return 4 * user.dex / self.agi
else
return 0
end
end
#--------------------------------------------------------------------------
# ◠防御ã®åŠ¹æžœé©ç”¨
#--------------------------------------------------------------------------
def guarding_effect(damage)
return damage / 2
end
#--------------------------------------------------------------------------
# â— HP ã‹ã‚‰ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’減算
#--------------------------------------------------------------------------
def subtract_damage_from_hp(user, skill = nil)
last_hp = self.hp
self.hp -= self.damage
return self.hp != last_hp
end
#--------------------------------------------------------------------------
# ◠通常攻撃ã®åŠ¹æžœé©ç”¨
# attacker : 攻撃者 (ãƒãƒˆãƒ©ãƒ¼)
#--------------------------------------------------------------------------
def attack_effect(attacker)
# クリティカルフラグをクリア
self.critical = false
# 第一命ä¸åˆ¤å®š
hit_result = (rand(100) < first_hit_percent(attacker))
# 命ä¸ã®å ´åˆ
if hit_result == true
# 通常攻撃ã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’計算
self.damage = attack_damage(attacker)
# 属性修æ£
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# ダメージã®ç¬¦å·ãŒæ£ã®å ´åˆ
if self.damage > 0
# クリティカル修æ£
if rand(100) < critical_percent(attacker)
self.damage *= 2
self.critical = true
end
# 防御修æ£
if self.guarding?
self.damage = guarding_effect(self.damage)
end
end
# 分散
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 第二命ä¸åˆ¤å®š
hit_result = (rand(100) < second_hit_percent(attacker))
end
# 命ä¸ã®å ´åˆ
if hit_result == true
# ステートè¡æ’ƒè§£é™¤
remove_states_shock
# HP ã‹ã‚‰ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’減算
subtract_damage_from_hp(attacker)
# ステート変化
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# ミスã®å ´åˆ
else
# ダメージ㫠"Miss" ã‚’è¨å®š
self.damage = "Miss"
# クリティカルフラグをクリア
self.critical = false
end
# メソッド終了
return true
end
#--------------------------------------------------------------------------
# ◠スã‚ルã®åŠ¹æžœé©ç”¨
# user : スã‚ルã®ä½¿ç”¨è€… (ãƒãƒˆãƒ©ãƒ¼)
# skill : スã‚ル
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# クリティカルフラグをクリア
self.critical = false
# スã‚ルã®åŠ¹æžœç¯„囲㌠HP 1 以上ã®å‘³æ–¹ã§ã€è‡ªåˆ†ã® HP ㌠0ã€
# ã¾ãŸã¯ã‚¹ã‚ルã®åŠ¹æžœç¯„囲㌠HP 0 ã®å‘³æ–¹ã§ã€è‡ªåˆ†ã® HP ㌠1 以上ã®å ´åˆ
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# メソッド終了
return false
end
# 有効フラグをクリア
effective = false
# コモンイベント ID ãŒæœ‰åŠ¹ã®å ´åˆã¯æœ‰åŠ¹ãƒ•ãƒ©ã‚°ã‚’セット
effective |= skill.common_event_id > 0
# 第一命ä¸åˆ¤å®š
hit_result = (rand(100) < first_hit_percent(user, skill))
# ä¸ç¢ºå®Ÿãªã‚¹ã‚ルã®å ´åˆã¯æœ‰åŠ¹ãƒ•ãƒ©ã‚°ã‚’セット
effective |= hit < 100
# 命ä¸ã®å ´åˆ
if hit_result == true
# スã‚ルã®ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’計算
self.damage = skill_damage(user, skill)
# 属性修æ£
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# ダメージã®ç¬¦å·ãŒæ£ã®å ´åˆ
if self.damage > 0
# クリティカル修æ£
if rand(100) < critical_percent(user, skill)
self.damage *= 2
self.critical = true
end
# 防御修æ£
if self.guarding?
self.damage = guarding_effect(self.damage)
end
end
# 分散
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# 第二命ä¸åˆ¤å®š
hit_result = (rand(100) < second_hit_percent(user, skill))
# ä¸ç¢ºå®Ÿãªã‚¹ã‚ルã®å ´åˆã¯æœ‰åŠ¹ãƒ•ãƒ©ã‚°ã‚’セット
effective |= hit < 100
end
# 命ä¸ã®å ´åˆ
if hit_result == true
# å¨åŠ› 0 以外ã®ç‰©ç†æ”»æ’ƒã®å ´åˆ
if skill.power != 0 and skill.atk_f > 0
# ステートè¡æ’ƒè§£é™¤
remove_states_shock
# 有効フラグをセット
effective = true
end
# HP ã‹ã‚‰ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’減算
effective |= subtract_damage_from_hp(user, skill)
# ステート変化
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# å¨åŠ›ãŒ 0 ã®å ´åˆ
if skill.power == 0
# ダメージã«ç©ºæ–‡å—列をè¨å®š
self.damage = ""
# ステートã«å¤‰åŒ–ãŒãªã„å ´åˆ
unless @state_changed
# ダメージ㫠"Miss" ã‚’è¨å®š
self.damage = "Miss"
end
end
# ミスã®å ´åˆ
else
# ダメージ㫠"Miss" ã‚’è¨å®š
self.damage = "Miss"
end
# 戦闘ä¸ã§ãªã„å ´åˆ
unless $game_temp.in_battle
# ダメージ㫠nil ã‚’è¨å®š
self.damage = nil
end
# メソッド終了
return effective
end
end
#==============================================================================
# â– Window_Item
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾—
get_data_of_draw_items
# é …ç›®æ•°ãŒ 0 ã§ãªã‘ã‚Œã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# â— æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾— @data
#--------------------------------------------------------------------------
def get_data_of_draw_items
# アイテムを追åŠ
set_own_item_data
# 戦闘ä¸ä»¥å¤–ãªã‚‰æ¦å™¨ã¨é˜²å…·ã‚‚追åŠ
unless $game_temp.in_battle
set_own_weapon_data
set_own_armor_data
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_item_data
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items
)
end
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®æ¦å™¨ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_weapon_data
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons)
end
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®é˜²å…·ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_armor_data
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors)
end
end
end
end
#==============================================================================
# â– Window_EquipRight
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
# åˆæœŸåŒ–
self.contents.clear
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@data = []
@caption = []
# æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾—
set_data_of_draw_items
@item_max = @data.size
# æ写
for i in 0...@data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * i, 92, 32, @caption)
draw_item_name(@data, 92, 32 * i)
end
end
#--------------------------------------------------------------------------
# â— æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾—
#--------------------------------------------------------------------------
def set_data_of_draw_items
# アイテムデータ
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
# ã‚ャプションデータ
@caption.push($data_system.words.weapon)
@caption.push($data_system.words.armor1)
@caption.push($data_system.words.armor2)
@caption.push($data_system.words.armor3)
@caption.push($data_system.words.armor4)
end
end
#==============================================================================
# â– Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾—
get_data_of_draw_items
# 空白を追åŠ
@data.push(nil)
# ビットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# â— æ写ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å–å¾— @data
#--------------------------------------------------------------------------
def get_data_of_draw_items
case @equip_type
when 0 # 装備å¯èƒ½ãªæ¦å™¨ã‚’追åŠ
set_equipable_weapon_data(@actor.class_id)
when 1..4 # 装備å¯èƒ½ãªé˜²å…·ã‚’追åŠ
set_equipable_armor_data(@actor.class_id)
end
end
#--------------------------------------------------------------------------
# ◠指定クラスãŒè£…å‚™å¯èƒ½ã€ã‹ã¤æ‰€æœ‰ã—ã¦ã„ã‚‹æ¦å™¨ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_equipable_weapon_data(class_id)
weapon_set = $data_classes[class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons)
end
end
end
#--------------------------------------------------------------------------
# ◠指定クラスãŒè£…å‚™å¯èƒ½ã€ã‹ã¤æ‰€æœ‰ã—ã¦ã„る防具を @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_equipable_armor_data(class_id)
armor_set = $data_classes[class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors.kind == @equip_type-1
@data.push($data_armors)
end
end
end
end
end
#==============================================================================
# â– Window_ShopSell
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
set_own_item_data
set_own_weapon_data
set_own_armor_data
# é …ç›®æ•°ãŒ 0 ã§ãªã‘ã‚Œã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_item_data
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items)
end
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®æ¦å™¨ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_weapon_data
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons)
end
end
end
#--------------------------------------------------------------------------
# ◠所有数㌠1 以上ã®é˜²å…·ã‚’ @data ã«è¿”ã™
#--------------------------------------------------------------------------
def set_own_armor_data
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors)
end
end
end
end
#==============================================================================
# â– Scene_Equip
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ◠リフレッシュ + 軽é‡åŒ–処ç†
#--------------------------------------------------------------------------
def refresh
# アイテムウィンドウã®å¯è¦–状態è¨å®š
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
# ç¾åœ¨è£…å‚™ä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item1 = @right_window.item
# ç¾åœ¨ã®ã‚¢ã‚¤ãƒ†ãƒ ウィンドウを @item_window ã«è¨å®š
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @right_window.active
# 装備変更後ã®ãƒ‘ラメータを消去
@left_window.set_new_parameters(nil, nil, nil)
@item_window_cursor = -1
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @item_window.active
# カーソルä½ç½®ãŒå¤‰ã‚ã£ã¦ã„ãªã‘ã‚Œã°ãƒªã‚¿ãƒ¼ãƒ³
return if @item_window_cursor == @item_window.index
@item_window_cursor = @item_window.index
# HP/SPã‚’ä¿æŒ
last_hp = @actor.hp
last_sp = @actor.sp
after_equip_parameter # â–½ 装備変更後ã®ãƒ‘ラメータをå–å¾—
@actor.hp = last_hp
@actor.sp = last_sp
end
end
#--------------------------------------------------------------------------
# ◠装備変更後ã®ãƒ‘ラメータをå–å¾— 1~4
#--------------------------------------------------------------------------
def after_equip_parameter
# ç¾åœ¨é¸æŠžä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item2 = @item_window.item
# 装備を変更
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(get_equip_type, item2 == nil ? 0 : item2.id)
# 装備変更後ã®ãƒ‘ラメータをå–å¾—
after_equip_parameter_phase2
# ç¾åœ¨è£…å‚™ä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item1 = @right_window.item
# 装備を戻ã™
@actor.equip(get_equip_type, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# レフトウィンドウã«æç”»
after_equip_parameter_phase4
end
def after_equip_parameter_phase2
# 装備変更後ã®ãƒ‘ラメータをå–å¾—
@new_atk = @actor.atk
@new_pdef = @actor.pdef
@new_mdef = @actor.mdef
end
def after_equip_parameter_phase4
# レフトウィンドウã«æç”»
@left_window.set_new_parameters(@new_atk, @new_pdef, @new_mdef)
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_item
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# 実際ã«è£…ç€
update_item_do_equip
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@item_window.refresh
return
end
end
#--------------------------------------------------------------------------
# ◠実際ã«è£…ç€
#--------------------------------------------------------------------------
def update_item_do_equip
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•ã‚Œã¦ã„るデータをå–å¾—
item = @item_window.item
# 装備を変更
@actor.equip(get_equip_type, item == nil ? 0 : item.id)
end
#--------------------------------------------------------------------------
# â— equip_typeã®å–å¾—
#--------------------------------------------------------------------------
def get_equip_type
return @right_window.index
end
end
#------------------------------------------------------------------------------
#
#
# â–½ è¿½åŠ ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
#
#
#==============================================================================
# â—‡ ä»˜åŠ å±žæ€§å称判定モジュール
#==============================================================================
module XRXS_Check_ElementName_Set
#--------------------------------------------------------------------------
# ◠マテリアルãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def material_element_include?(material, element_name)
case material
when RPG::Item
return item_element_include?(material, element_name)
when RPG::Weapon
return weapon_element_include?(material, element_name)
when RPG::Armor
return armor_element_include?(material, element_name)
end
return [false, 0, 0]
end
#--------------------------------------------------------------------------
# ◠スã‚ルãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def skill_element_include?(skill, element_name)
return [false, 0, 0] unless skill.is_a?(RPG::Skill)
returnar = [false, 0, 0] # å˜åœ¨ã—ãŸã‹?, 固定値ã®åˆè¨ˆã€%値ã®åˆè¨ˆ
for i in skill.element_set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
#--------------------------------------------------------------------------
# ◠アイテムãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def item_element_include?(item, element_name)
return [false, 0, 0] unless item.is_a?(RPG::Item)
returnar = [false, 0, 0] # å˜åœ¨ã—ãŸã‹?, 固定値ã®åˆè¨ˆã€%値ã®åˆè¨ˆ
for i in item.element_set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
#--------------------------------------------------------------------------
# â— æ¦å™¨ãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def weapon_element_include?(weapon, element_name)
return weapon_id_element_include?(weapon.id, element_name)
end
#--------------------------------------------------------------------------
# ◠指定IDã®æ¦å™¨ãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def weapon_id_element_include?(weapon_id, element_name)
return [false, 0, 0] if weapon_id == nil or weapon_id <= 0
returnar = [false, 0, 0] # å˜åœ¨ã—ãŸã‹?, 固定値ã®åˆè¨ˆã€%値ã®åˆè¨ˆ
for i in $data_weapons[weapon_id].element_set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
#--------------------------------------------------------------------------
# ◠防具ãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def armor_element_include?(armor, element_name)
returnar = [false, 0, 0] # å˜åœ¨ã—ãŸã‹?, 固定値ã®åˆè¨ˆã€%値ã®åˆè¨ˆ
return returnar unless armor.is_a?(RPG::Armor)
for i in armor.guard_element_set
if $data_system.elements =~ /#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
#--------------------------------------------------------------------------
# ◠防具ãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def armor_id_element_include?(armor_id, element_name)
return [false, 0, 0] if armor_id == nil
return armor_element_include?($data_armors[armor_id], element_name)
end
#--------------------------------------------------------------------------
# ◠防具ãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤å ´åˆãã®å¾Œã«ä»˜ã接尾テã‚ストをå–å¾—
#--------------------------------------------------------------------------
def armor_id_element_suftext(armor_id, element_name)
return nil if armor_id == nil or armor_id == 0
armor = $data_armors[armor_id]
for i in armor.guard_element_set
if $data_system.elements =~ /#{element_name}(.*)/
return $1
end
end
return nil
end
#--------------------------------------------------------------------------
# ◠アクターãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤æ¦å™¨ã‚’装備ã—ã¦ã„ã‚‹ã‹ã‹åˆ¤å®š
#--------------------------------------------------------------------------
def equip_weapon_element_include?(actor, element_name)
return [false, 0, 0] unless actor.is_a?(Game_Actor)
return [false, 0, 0] if actor.weapon_id == nil or actor.weapon_id <= 0
bool = false
one_total = two_total = 0
# 判定
for i in $data_weapons[actor.weapon_id].element_set
if $data_system.elements =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
if $2 == nil
one_total += $1.to_i
else
two_total += $1.to_i
end
bool = true
end
end # å˜åœ¨ã—ãŸã‹ã€%ç„¡ã数値ã®åˆè¨ˆã€%有る数値ã®åˆè¨ˆã€€ã‚’è¿”ã™
# 値を返ã™
return [bool, one_total, two_total]
end
#--------------------------------------------------------------------------
# ◠アクターãŒæŒ‡å®šåã®å±žæ€§ã‚’æŒã¤æ¦å™¨ï¼é˜²å…·ã‚’装備ä¸ã‹åˆ¤å®šã€€æ•°å€¤ã®åˆè¨ˆã‚‚ä¿æŒ
#--------------------------------------------------------------------------
def actor_element_equip?(actor, element_name)
return [false, 0, 0] unless actor.is_a?(Game_Actor)
weapon = $data_weapons[actor.weapon_id]
armor1 = $data_armors[actor.armor1_id]
armor2 = $data_armors[actor.armor2_id]
armor3 = $data_armors[actor.armor3_id]
armor4 = $data_armors[actor.armor4_id]
bool = false
one_total = two_total = 0
# æ¦å™¨
returnar = equip_weapon_element_include?(actor, element_name)
bool |= returnar[0]
one_total += returnar[1].to_i
two_total += returnar[2].to_i
# 盾
returnar = armor_element_include?(armor1, element_name)
bool |= returnar[0]
one_total += returnar[1].to_i
two_total += returnar[2].to_i
# é 防具
returnar = armor_element_include?(armor2, element_name)
bool |= returnar[0]
one_total += returnar[1].to_i
two_total += returnar[2].to_i
# 身体防具
returnar = armor_element_include?(armor3, element_name)
bool |= returnar[0]
one_total += returnar[1].to_i
two_total += returnar[2].to_i
# 装飾å“
returnar = armor_element_include?(armor4, element_name)
bool |= returnar[0]
one_total += returnar[1].to_i
two_total += returnar[2].to_i
# å˜åœ¨ã—ãŸã‹ã€%ç„¡ã数値ã®åˆè¨ˆã€%有る数値ã®åˆè¨ˆã€€ã‚’è¿”ã™
return [bool, one_total, two_total]
end
end
#code one end