Witam chciałbym poprosić kogoś kto zna się lepiej ode mnie na RGSS a na pewno jest takich ludzi wiele ;P
mój problem polega na tym ze próbuję edytować skrypt który wyświetla informacje o przedmiotach i umiejętnościach w ten sposób:
chciałbym aby wyświetlał mi wszystkie atrybuty przedmiotu, udało mi się dodać obronę magiczną ale przy opcjach takich jak siła wywala błąd.
Ja niestety nie jestem za dobry w RGSS dlatego zwracam się z prosba do osób które znają się na rzeczy, za wszelka pomoc dziękuję.
#==============================================================================
# ** Window Help Item
#------------------------------------------------------------------------------
# By Valentine
#==============================================================================
class Window_Help2 < Window_Base
def initialize(x,y,a,b)
super(x,y,a,b)
self.contents = Bitmap.new(self.width-32, self.height-32)
self.windowskin = RPG::Cache.windowskin("Help")
self.back_opacity = 230
self.z = 9999999
actor = 0
refresh
end
def refresh
self.contents.clear
if $help_trade == true
@item = $trade_w.item
end
if $help_trade_2 == true
@item = $trade_w_2.item
end
if $help_loja == true
@item = $loja_w.item
elsif $help_loja != true and $help_trade != true and $help_trade_2 != true
@item = $item_w.item
end
@actor = $game_party.actors[0]
if @item != nil
self.contents.font.color = Color.new(0,128,255)
rect = Rect.new(4, -10, self.contents.width - 8, 32)
self.contents.draw_text(rect, @item.name, 1)
self.contents.font.color = Color.new(0,0,0)
if @item.is_a?(RPG::Armor)
self.contents.draw_text(4, 22, 400, 32, LANGUAGE::HELPSKILLATK + "0", 0)
self.contents.draw_text(4, 37, 400, 32, LANGUAGE::HELPSKILLDEF + $data_armors[@item.id].pdef.to_s, 0)
self.contents.draw_text(4, 52, 400, 32, LANGUAGE::HELPSKILLINT + $data_armors[@item.id].int_plus.to_s, 0)
self.contents.draw_text(4, 67, 400, 32, LANGUAGE::HELPSKILLAGI + $data_armors[@item.id].agi_plus.to_s, 0)
end
if @item.is_a?(RPG::Item)
if @item.id != Item_Ouro::Item_Id.to_i
self.contents.draw_text(4, 22, 400, 32, LANGUAGE::HELPSKILLATK + "0", 0)
self.contents.draw_text(4, 37, 400, 32, LANGUAGE::HELPSKILLDEF + "0", 0)
self.contents.draw_text(4, 52, 400, 32, LANGUAGE::HELPSKILLINT + "0", 0)
self.contents.draw_text(4, 67, 400, 32, LANGUAGE::HELPSKILLAGI + "0", 0)
else
self.contents.draw_text(4, 22, 400, 32, LANGUAGE::HELPITEMGOLD, 0)
end
end
if $help_loja == true
rect = Rect.new(4, 117, self.contents.width - 8, 32)
self.contents.draw_text(rect, "$ "+@item.price.to_s, 1)
else
if @item.id != Item_Ouro::Item_Id.to_i
rect = Rect.new(4, 117, self.contents.width - 8, 32)
self.contents.draw_text(rect, "$ "+(@item.price/2).to_s, 1)
else
if !@item.is_a?(RPG::Item)
rect = Rect.new(4, 117, self.contents.width - 8, 32)
self.contents.draw_text(rect, "$ "+(@item.price/2).to_s, 1)
end
end
end
if @item.is_a?(RPG::Weapon)
self.contents.draw_text(4, 22, 400, 32, LANGUAGE::HELPSKILLATK + $data_weapons[@item.id].atk.to_s, 0)
self.contents.draw_text(4, 37, 400, 32, LANGUAGE::HELPSKILLDEF + $data_weapons[@item.id].pdef.to_s, 0)
self.contents.draw_text(4, 52, 400, 32, LANGUAGE::HELPSKILLINT + $data_weapons[@item.id].int_plus.to_s, 0)
self.contents.draw_text(4, 67, 400, 32, LANGUAGE::HELPSKILLAGI + $data_weapons[@item.id].agi_plus.to_s, 0)
weapon_set = $data_classes[@actor.class_id].weapon_set
if weapon_set.include?(@item.id)
@resposta = LANGUAGE::HELPITEMCAN
self.contents.font.color = Color.new(65,255,65)
else
@resposta = LANGUAGE::HELPITEMNOTCAN
self.contents.font.color = Color.new(255,43,43)
end
rect = Rect.new(-1, 87, self.contents.width + 3, 32)
self.contents.draw_text(rect, "#{@resposta} "+LANGUAGE::CANEQUIPPED, 1)
rect2 = Rect.new(4, 100, self.contents.width - 8, 32)
self.contents.draw_text(rect2, "#{$data_classes[$game_party.actors[0].class_id].name}", 1)
elsif @item.is_a?(RPG::Armor)
armor_set = $data_classes[@actor.class_id].armor_set
if armor_set.include?(@item.id)
@resposta = LANGUAGE::HELPITEMCAN
self.contents.font.color = Color.new(65,255,65)
else
@resposta = LANGUAGE::HELPITEMNOTCAN
self.contents.font.color = Color.new(255,43,43)
end
rect = Rect.new(-1, 87, self.contents.width + 3, 32)
self.contents.draw_text(rect, "#{@resposta} "+LANGUAGE::CANEQUIPPED, 1)
rect2 = Rect.new(4, 100, self.contents.width - 8, 32)
self.contents.draw_text(rect2, "#{$data_classes[$game_party.actors[0].class_id].name}", 1)
end
end
end
end