collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Variable mit Equipment ändern?  (Gelesen 743 mal)

Offline Michel

  • Event-Jongleur
  • **
  • Beiträge: 57
Variable mit Equipment ändern?
« am: September 25, 2011, 15:47:25 »
Hat sich erledigt.

Die Lösung:

# <variable X, Y>
# X = ID of Variable
# Y = Value Added when equipped or subtracted when unequipped

class Game_Actor < Game_Battler
  alias req_change_equip change_equip
  def change_equip(equip_type, item, test = false)
    last_item = equips[equip_type] 
    req_change_equip(equip_type, item, test)
    unless test
      variate_equip(item)
      variate_equip(last_item, false)
    end
  end
 
  def variate_equip(item, adding = true)
    return if item.nil?
    for line in item.note.split(/[\r\n]+/)
      if line =~ /<(?:VARIABLE|variable)\s*(\d+), \s*(\d+)>/i
        if adding
          $game_variables[$1.to_i] += $2.to_i
        else
          $game_variables[$1.to_i] -= $2.to_i
        end
      end
    end
  end
end
« Letzte Änderung: September 29, 2011, 16:05:47 von Michel »

 


 Bild des Monats

rooftop party

Views: 3615
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal