#==============================================================================
# ** RPG Advocate's Advanced Shop Status Window
#------------------------------------------------------------------------------
#==============================================================================
#--------------------------------------------------------------------------
# * SDK Log
#--------------------------------------------------------------------------
SDK.log('Advanced Shop Status Window', 'RPG Advocate', 2.0, '')
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Advanced Shop Status Window')
class Window_ShopStatus < Window_Base
def rel(var1,var2,typ)
if var1 > var2
case typ
when 0
return 1
when 1
return "+"
when 2
return up_color
end
end
if var1 < var2
case typ
when 0
return -1
when 1
return "-"
when 2
return down_color
end
end
if var1 = var2
case typ
when 0
return 0
when 1
return ""
when 2
return normal_color
end
end
end
# ---------------------------------------
def min(array)
min=0
for i in 0...array.size - 1
if array[i]<array[i + 1]
if array[i]<=array[min]
min=i
end
end
end
return min
end
#--------------------------------------
def find(array, index)#gibt position des ersten index zur?ck
find =-1
for i in 0...array.size
if index == array[i]
return i
end
end
return find
end
#--------------------------------------
def initialize
if SDK.enabled?('Realistic Shop')
super(320, 128, 320, 352)
else
super(368, 128, 272, 352)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@item = nil
refresh
end
# ---------------------------------------
def refresh
self.contents.clear
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
kind_word = $data_system.words.item
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
kind_word = $data_system.words.weapon
when RPG::Armor
number = $game_party.armor_number(@item.id)
@default_names = [$data_system.words.armor1,$data_system.words.armor2,$data_system.words.armor3,$data_system.words.armor4]
if @item.kind<4
kind_word = @default_names[@item.kind]
elsif SDK.enabled?('Multi-slot equipment script') #Add zu Multi-slot equipment script
@extra_slot_names = G7_MS_MOD::EXTRA_SLOT_NAMES
if @item.kind - 4< @extra_slot_names.size
kind_word = @extra_slot_names[@item.kind - 4]
else
kind_word = '???'
end
else
kind_word = '???'
end
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "Possessed:")
self.contents.draw_text(4, 15, 200, 32, "Kind:")
self.contents.font.color = normal_color
self.contents.draw_text(self.width - 68, 0, 32, 32, number.to_s, 2)
self.contents.draw_text(self.width - 72, 15, 32, 32, kind_word, 2)
$game_party.actors.each_with_index do |actor, i|
# If equippable, then set to normal text color. If not, set to
# invalid text color.
new = []
old = []
change = []
self.contents.font.size = $fontsize
if SDK.enabled?('Animated Chars')
draw_actor_graphic(actor, 15, 100 + i * 64)
@actor_sprites[actor].visible =
[email protected]_a?(RPG::Item)
if @item.is_a?(RPG::Item)
next
end
@actor_sprites[actor].animate = actor.equippable?(@item)
if actor.equippable?(@item)
@actor_sprites[actor].tone = Tone.new(0, 0, 0, 0)
self.contents.font.color = normal_color
else
@actor_sprites[actor].frame = 0
@actor_sprites[actor].tone = Tone.new(0, 0, 0, 255)
end
else
if @item.is_a?(RPG::Item)
next
end
draw_actor_name(actor, 0, 80 + i * 64)
end
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif SDK.enabled?('Multi-slot equipment script')#Add zu Multi-slot equipment script
item1 = $data_armors[actor.armor_ids[find(actor.armor_slots,@item.kind+1)]]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
if actor.equippable?(@item)
old[3] = item1 != nil ? item1.str_plus : 0
new[3] = @item != nil ? @item.str_plus : 0
old[4] = item1 != nil ? item1.dex_plus : 0
new[4] = @item != nil ? @item.dex_plus : 0
old[5] = item1 != nil ? item1.agi_plus : 0
new[5] = @item != nil ? @item.agi_plus : 0
old[6] = item1 != nil ? item1.int_plus : 0
new[6] = @item != nil ? @item.int_plus : 0
old[1] = item1 != nil ? item1.pdef : 0
new[1] = @item != nil ? @item.pdef : 0
old[2] = item1 != nil ? item1.mdef : 0
new[2] = @item != nil ? @item.mdef : 0
if @item.is_a?(RPG::Weapon)
old[0] = item1 != nil ? item1.atk : 0
new[0] = @item != nil ? @item.atk : 0
old[7] = 0
new[7] = 0
end
if @item.is_a?(RPG::Armor)
old[7] = item1 != nil ? item1.eva : 0
new[7] = @item != nil ? @item.eva : 0
old[0] = 0
new[0] = 0
end
for j in 0...7
change[j] = new[j] - old[j]
end
if item1 == nil
name1 = ""
else
name1 = item1.name
end
if @item == nil
name2 = ""
else
name2 = @item.name
end
self.contents.font.size = $fontsize
self.contents.font.color = normal_color
if change - [0] == [] && name1 != name2
self.contents.draw_text(32, 54 + 64 * i, 150, 32, "No Change")
end
if name1 == name2
self.contents.draw_text(32, 54 + 64 * i, 200, 32, "Currently Equipped")
end
self.contents.font.name = $fontface
self.contents.font.size = $fontsize - 2
names = ["ATK", "PDF","MDF", "STR", "DEX", "AGI", "AGI", "EVA"]
if @item.is_a?(RPG::Weapon) && change[0] != 0
self.contents.font.color = normal_color
self.contents.draw_text(32, 42 + 64 * i, 32, 32, names[0])
self.contents.font.color = rel(new[0],old[0],2)
self.contents.draw_text(60, 42 + 64 * i, 4, 32, rel(new[0],old[0],1))
self.contents.draw_text(62, 42 + 64 * i, 24, 32, change[0].abs.to_s, 2)
end
if @item.is_a?(RPG::Armor) && change[7] != 0
self.contents.font.color = normal_color
self.contents.draw_text(32, 42 + 64 * i, 32, 32, names[j])
self.contents.font.color = rel(new[7],old[7],2)
self.contents.draw_text(60, 42 + 64 * i, 4, 32, rel(new[7],old[7],1))
self.contents.draw_text(62, 42 + 64 * i, 24, 32, change[7].abs.to_s, 2)
end
for j in 0...6
if change[j] != 0
self.contents.font.color = normal_color
self.contents.draw_text(32+j/3*80, 42+ j%3*16 + 64 * i, 32, 32, names[j])
self.contents.font.color = rel(new[j],old[j],2)
self.contents.draw_text(60+j/3*80, 42+ j%3*16 + 64 * i, 4, 32, rel(new[j],old[j],1))
self.contents.draw_text(62+j/3*80,42+ j%3*16 + 64 * i, 24, 32, change[j].abs.to_s, 2)
end
end
else
self.contents.font.color = disabled_color
self.contents.draw_text(32, 54 + 64 * i, 150, 32, "Cannot Equip")
end
end
end
# ---------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
# ---------------------------------------
end
#==============================================================================
end
#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
Expand to see the code.