Materia (RPG-Maker)

Materia (RPG-Maker)

ICh fang mal selbst an ich willn remake von
FF7 machen hab aber probleme ein Materiasystem zu erstellen bitte helft mir
Problematik dabei ist das dieses System ein Extra menü brauch und die Waffen auch verschiedene freie Felder für die Materia haben sollen diese Materia soll wenn sie ausgerüsstet wird einen skill adden der wieder verschwindet beim weglegen der materia auserdem giebts noch extra features wie die materia Alle die eien Zauber auf alle gegner oder freunde lenkt und zum schluss sollte die materia eine art Level up system haben sodass wenn sie oft genug eingesetzt wurde ein neuen Skill beeinhalltet (Weiß ist viel aber es muss irgendwie gehen)
Punkte un Absätze bitte! xD

Ich habe leider nur FF:CC und kenne dieses Materia-System leider nicht.

Wäre nett, wenn du es mal ausfürlich erklären könntest, da ich im Moment da nicht so ganz durchblicke... ^^"
Also die Waffen haben in einem externen menü
slots für Materia (die Zauber) diese Slots haben zwei typen (einzeln und gekoppelte) dann sind die Materia noch in versch typen unterteilt (Zauber Beschwörung zusatzt und ausrüstung)(Zauber is Zaubern beschwörung is dasselbe zusatz ist ein zusatz effect wie alle(zauber auf alle) wirkt aber nur in koppelslots mit dem gekoppelten zauber
ausrüstungen sind solche wie Präwentivangriff(greift immer zuerst an) oder unterwasser
(unterwasseratmen im kampf(kein ertrinken))
Jede Materia bekommt auch wenn sie im kampf ausgerüstet war exp und erreicht level 1-5oder 1-7
je höher das level desto höher der effekt oder bei Zauber materia erlernt die materia einen neuen zauber.ab level Max.teilt die materia sich in die auf lv.max und die gleiche in lv0 .
Ich habn neues problem.Ich wollte beim Spiel in der Worldmap eine Karte unten in die ecke zaubern auf der man die aktuelle position von dem chara und den Fahrzeugen sieht.
Aber ich bekomme es nichtal hin es so zu skripten ds ein Pfeil immer in sichtweite des charas zum fahrrzeucg zu erstellen
Bitte helft mir
Ark, da du FF7 kennst, weißt du ja auch, wie extrem umfangreich es wäre ein qualitatives Substanz-System ohne Bug zu machen (ich meine, so wie du es oben erklärt hast, wird es jemand, der FF7 noch nicht gespielt hat, nicht richtig verstehen).

Natürlich wäre es möglich, keine Frage, ich hatte mir vor längerer Zeit selbst mal eins gemacht (allerdings ohne gescheite Grafiken und mit nur einer Unterstützungssubstanz (blaue Substanz), aber es ist wie gesagt ein enormer Aufwand, gerade wegen den blauen Substanzen.
Wahrscheinlich wäre es sogar genauso umfangreich wie ein eigenes SV-KS (wenn man wirklich ein gescheites Substanz-System haben will) - du wirst also niemanden finden, der dir das mal eben so nebenbei macht oder schnell erklärt.

Du selbst bräuchtest jedenfalls ein sehr gutes Technikwissen, d.h. Sachen wie Switches, Variablen, Bedingungen und Tastenbelegungen sollten ein Kinderspiel sein.
Zudem musst auch wissen, wie man ein eigenes Menü macht. Also Anordnungen der einzelnen Substanzen im Menü usw..

Aber gerade wenn man viele blaue Substanzen mit einbauen will, können viele Bugs entstehen, d.h. man muss auf verdammt vieles achten. Wenn ein Charakter z.b. zwei Feuer-Substanzen ausgerüstet hat und eine von diesen koppelt er mit Alle, dann sollte dieser Charakter nur über die Feuertechnik, die auf alle Gegner geht, verfügen und nicht noch über den einfachen Feuerzauber.
Oder wenn der Spieler dann eine von den Feuer-Substanzen wieder abrüstet, darf der Feuerzauber nicht verlernt werden, da die andere Feuer-Substanz ja noch ausgerüstet ist.

Lauter so Sachen, bei denen man sehr viele Variablen und Switches braucht...

Ich weiß jetzt nicht, wie weit dein Technikwissen geht, aber du könntest ja mal Schritt für Schritt langsam vorgehen.
Aber jemanden, der dir ein wirklich gutes und umfangreiches Substanz-System bietet, wirst du nicht finden. Wenn du das System stark beschränken würdest (also dass man beispielsweise jede Substanz nur einmal besitzen kann oder dass es nur ganz wenige blaue Substanzen gibt), würde es vielleicht noch gehen, sonst aber ist es wie gesagt extrem viel Arbeit.
Ich weiß es ist bei mir halt schon ein jahr her als ich das ff7 dasletztemal durchgezockt hatte aber über das wissen verfüge ich ich hab mir sogar schon angefangen eins zu skripten
nur ich hab in letzter zeit keine zeit für so viel skripten (versetztungsprobleme) ich hab vor 1/2 nem Jahr mit dem Maken angefangen. währe froh wenn du mich adden würdest (Ark626:nickname oder 211-867-220)


Hab aber nochn prob also ich wolte vor kurzem mein game auf einem Computer installieren ohne Rpgmaker200 es ging aber beim start sagte der comp:Runtimepackage not found woher kommt das bei mir lief es einwandfrei und als ich den maker installierte funktionierte es hab schon einiges versucht (Utilyfull etc)
Aber es geht trotzdem nich woher kommt das?

Ist der Grund dafür vielleicht dass ich einige Daten ins Rtp geaddet habe ohne das Import prog zu verwenden?
Könnte daran liegen ja. Man sollte immer lieber die Import-Funktion benutzen.

Mit ICQ bin ich nur noch selten online, momentan kann ich eh nichts mehr damit machen, da mein Rechner schrott ist (geht nach einigen Minuten immer aus...) und mein Vater will auf seinem Rechner kein ICQ.
Momentan habe ich aber sowieso kaum Zeit für sowas (wegen WM, Prüfungen und Arbeiten für eine Internetseite).
Überhaupt habe ich schon seit längerem mit dem Maker wegen Zeitgründen kaum noch was am Hut, deswegen guck ich auch nicht mehr all so oft ins Maker-Forum.
Ich hab mal wieder (nen knall) ne idee mim RpgmakerXP müsste das doch machbar sein (Scripteditor XD) hat irgendjemand ein Script dafür so selbstgemacht oder wieauchimmer schon angefangen??
Das geht mit jedem Maker, ist aber ne riesige Menge Aufwand.
Im Allgemeinen ist das mit Scripts so ne Sache.
Du usst das ja auch Anwenden können, es erweitern können.
Ein Script bringt dir nur dann was, wenn du es vol und ganz verstehst.
^^ Keine panic (ich hab schon öfter als einmal gescripted^^ aber son Materia Script is riesig un ich hab nich genug erfahrung (wennnich eins vor mir hätt würd ichs verstehen aber auf sowas zu kommen wow das ist richtig gut^^)
?Hat jemand n link zu nem script??
Verdammt ich finde dieses blöde Limit/OverDrive script nichmehr hat jemand von euch nen Link???
www.rpg2000.de
Schätze ich mal, da gibt e soswas jedenfalls...
Aber wo exakt liegt das problem? Nimm ne Variable und Fork die HP deines Helden ab.
Wenn du da Probleme hast, dann lass die Finger vond er Materia-Geschichte. oO
Nein so wars nich gemeint!!!! Ich meinte für den XP
n Script da gibts schon so eins (das fürn 2000/2003 is ja kleinkindergeburtstag!!)Ich hab mir mitlerweile n script für materia gezogen (wers will soll fragen^^)
hab nur nochn paar probleme mit der Entwicklung neuer Materia(hab schon ne Materia gemacht und sie zeigt alles perfect an aber den skill den man lernt is immer feuer)egal auf jeden fall hab ich DAS ORIGINAL OverDrivescript für den XP gemeint
Juhuu geschafft(problem war das die Attribute (Boni z.B.Atk+3 Def-5usw.)sich von den bereits erschaffenen Materia unterscheiden musten mind. eine dieser Atribute^^supi jetzt funtzt perfekt^^
Stells doch ma rein. ^^
is exstrem Compliziert^^
Titel
** Materia CONSTANTS

# DEFINE CONSTANTS HERE

# Below: Pink and Purple Materia IDs (armor IDs)
M_COUNTERATTACK = 39
M_ADDED_EFFECT = 40
M_ELEMENT = 41

# Below: Attribute IDs
IS_MATERIA = 17
M_SLOT1U = 18
M_SLOT2U = 19
M_SLOT3U = 20
M_SLOT4U = 21
M_SLOT5U = 22
M_SLOT6U = 23
M_SLOT7U = 24
M_SLOT8U = 25
M_SLOT2L = 26
M_SLOT4L = 27
M_SLOT6L = 28
M_SLOT8L = 29

# Below is used for Materia that has skills that will not
# be added to the actor's skill list. (ie: Steal)
M_NO_SKILL = 34

# Below is the array that holds Skill IDs that are
# commands instead of skills (like "Steal")
M_COMMANDS = []
M_COMMANDS[0] = 82

# Below: Materia Actor ID
M_ACTOR = 9

# Below: "Skill ID" for the All Materia
M_ALL = 81

# Below: Skill Resistances
M_RESIST_ALL = 30 # Attribute to resist "All" effect when linked to "All" Materia

# Below: Max Materia to hold and "nil" number
M_MAX = 255
M_NIL = M_MAX+1

#Below: Enemy multiplier attributes
E_STR = 31
E_DEX = 32
E_AGI = 33
Materia:Game

#==============================================================================
# + Game_Actor
#------------------------------------------------------------------------------

class Game_Actor < Game_Battler
attr_accessor :materia_weapon
attr_accessor :materia_armor1
attr_accessor :materia_armor2
attr_accessor :materia_armor3
attr_accessor :materia_armor4

def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@limit = 0
@limitmax = maxhp * 2

@materia_weapon = []
@materia_armor1 = []
@materia_armor2 = []
@materia_armor3 = []
@materia_armor4 = []
@materia_slots = [0, 0, 0, 0, 0] # 0=Weapon, 1=Armor1, 2=Armor2, etc...
fix_materia_nil
fix_slots
@skills_all = [] # ammt. times you can use all for skill
@skills_use_all = [] # ammt. times you can use all for skill (decremented in battle when used)
@skills_scope = [] # skill scope
fill_skill_scope
@use_select_all = false

for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end

def selected_all?
return @use_select_all
end

def use_select_all(val)
@use_select_all = val
end

def fix_materia_nil
for i in 0..7
if @materia_weapon == nil
@materia_weapon = M_NIL
end
if @materia_armor1 == nil
@materia_armor1 = M_NIL
end
if @materia_armor2 == nil
@materia_armor2 = M_NIL
end
if @materia_armor3 == nil
@materia_armor3 = M_NIL
end
if @materia_armor4 == nil
@materia_armor4 = M_NIL
end
end
end

def skill_scope_all(id)
return @skills_use_all[id]
end

def use1_skill_scope_all(id)
@skills_use_all[id] -= 1
end

def skill_scope(id)
return @skills_scope[id]
end

alias old_equip equip
def equip(equip_type, id)
remove_all_materia(equip_type)
old_equip(equip_type, id)
end


# id: Materia ID
# equipTo: 0 = Weapon, 1 = Shield, 3 = Helm, etc...
# slot: 0 = Slot 1, 1 = Slot 2, etc...
def equip_materia(id, equipTo, slot)
fix_materia_nil
new = id
case equipTo
when 0 # Weapon
current = @materia_weapon[slot]
when 1 # Armor 1
current = @materia_armor1[slot]
when 2 # Armor 2
current = @materia_armor2[slot]
when 3 # Armor 3
current = @materia_armor3[slot]
when 4 # Armor 4
current = @materia_armor4[slot]
end
materia = $game_party.materias[current]
if materia != nil
deequip_materia(current, equipTo, slot) # deequip old materia, Empty the slot
end
case equipTo
when 0 # Weapon
@materia_weapon[slot] = id
when 1 # Armor 1
@materia_armor1[slot] = id
when 2 # Armor 2
@materia_armor2[slot] = id
when 3 # Armor 3
@materia_armor3[slot] = id
when 4 # Armor 4
@materia_armor4[slot] = id
end
materia = $game_party.materias[new]
if materia != nil
materia.equipTo(@actor_id) # equip new materia
end
update_skills
end

def deequip_materia(id, equipTo, slot)
case equipTo
when 0 # Weapon
@materia_weapon[slot] = M_NIL
when 1 # Armor 1
@materia_armor1[slot] = M_NIL
when 2 # Armor 2
@materia_armor2[slot] = M_NIL
when 3 # Armor 3
@materia_armor3[slot] = M_NIL
when 4 # Armor 4
@materia_armor4[slot] = M_NIL
end
materia = $game_party.materias[id]
if materia != nil
materia.equipTo(0) # deequip old materia
end
update_skills
end

def remove_all_materia(type)
case type
when 0
item = @materia_weapon
when 1
item = @materia_armor1
when 2
item = @materia_armor2
when 3
item = @materia_armor3
when 4
item = @materia_armor4
end
for i in 0..7
id = item
deequip_materia(id, type, i)
end
end

def fix_slots
for i in 0..4
s_total = 0
case i
when 0
item = $data_weapons[@weapon_id]
when 1
item = $data_armors[@armor1_id]
when 2
item = $data_armors[@armor2_id]
when 3
item = $data_armors[@armor3_id]
when 4
item = $data_armors[@armor4_id]
end
if item != nil and i==0
if item.element_set.include?(M_SLOT8L) or item.element_set.include?(M_SLOT8U)
s_total += 8
end
if item.element_set.include?(M_SLOT6L) or item.element_set.include?(M_SLOT6U)
s_total += 6
end
if item.element_set.include?(M_SLOT4L) or item.element_set.include?(M_SLOT4U)
s_total += 4
end
if item.element_set.include?(M_SLOT2L) or item.element_set.include?(M_SLOT2U)
s_total += 2
end
if item.element_set.include?(M_SLOT1U)
s_total += 1
end
if item.element_set.include?(M_SLOT3U)
s_total += 3
end
if item.element_set.include?(M_SLOT5U)
s_total += 5
end
if item.element_set.include?(M_SLOT7U)
s_total += 7
end
end
if item != nil and i>0
if item.guard_element_set.include?(M_SLOT8L) or item.guard_element_set.include?(M_SLOT8U)
s_total += 8
end
if item.guard_element_set.include?(M_SLOT6L) or item.guard_element_set.include?(M_SLOT6U)
s_total += 6
end
if item.guard_element_set.include?(M_SLOT4L) or item.guard_element_set.include?(M_SLOT4U)
s_total += 4
end
if item.guard_element_set.include?(M_SLOT2L) or item.guard_element_set.include?(M_SLOT2U)
s_total += 2
end
if item.guard_element_set.include?(M_SLOT1U)
s_total += 1
end
if item.guard_element_set.include?(M_SLOT3U)
s_total += 3
end
if item.guard_element_set.include?(M_SLOT5U)
s_total += 5
end
if item.guard_element_set.include?(M_SLOT7U)
s_total += 7
end
end
@materia_slots = s_total
end
end

def no_slots?(index)
if @materia_slots[index] == 0
return true
else
return false
end
end

def update_skills
for m in 1..2 #Look through 2 times
for i in 1...$data_skills.size
if self.skill_learn?(i)
self.forget_skill(i) # Forget all skills
end
end
for k in 0..4 # Learn all new skills
for i in 0..7
m_id=nil
case k
when 0
if @weapon_id != 0
m_id = @materia_weapon
item = $data_weapons[@weapon_id]
end
when 1
if @armor1_id != 0
m_id = @materia_armor1
item = $data_armors[@armor1_id]
end
when 2
if @armor2_id != 0
m_id = @materia_armor2
item = $data_armors[@armor2_id]
end
when 3
if @armor3_id != 0
m_id = @materia_armor3
item = $data_armors[@armor3_id]
end
when 4
if @armor4_id != 0
m_id = @materia_armor4
item = $data_armors[@armor4_id]
end
end
if m_id != nil and m_id != M_NIL
materia = $game_party.materias[m_id] # I now have the materia as "materia"
item = $data_armors[materia.based_on]

#Find out about the linked materia
linked = linked_slot(k, i) #type, slot
materia.all_effect = 0
if linked
if linked.is_all? and not materia.is_all? # linked = linked materia or false
# We know here that the linked materia is an
# "All" materia, and that it's in a linked slot.
# Also, we have the linked materia
materia.all_effect = (linked.level)
end
if materia.is_all? and not linked.is_all? # linked = linked materia or false
# We know here that the materia is an
# "All" materia, and that it's in a linked slot.
# Also, we have the linked materia
linked.all_effect = (materia.level)
end
end

for skill in $data_skills
id = skill.id
if materia.skill_learn?(id) and not self.skill_learn?(id) and id != M_ALL
self.learn_skill(id) # Learn the new skill
scope = set_scope(id)
@skills_scope[id] = scope
all_effect = (materia.all_effect)
@skills_all[id] = all_effect
@skills_use_all[id] = all_effect
#print (skill.name), " can be used on all x ", all_effect.to_s
end
end

end
end # i
end # k
end
end

def fill_skill_scope
for skill in @skills # set all scopes to data default
@skills_scope[skill.id] = (skill.scope)
end
end

def set_scope(id)
skill = $data_skills[id]
if skill != nil
if not skill.element_set.include?(M_RESIST_ALL)
scope = skill.scope
if scope == 1 or scope == 3
scope += 1
end
return scope
else
return skill.scope
end
else
print id
end
end

# is_linked_slot?(type, slot) returns false if the slot
# isn't linked to anything. If slot is linked to another
# slot, it returns the linked slot number
def linked_slot(type, slot)
case type
when 0
item = $data_weapons[@weapon_id]
item_set = item.element_set
m_id = @materia_weapon
when 1
item = $data_armors[@armor1_id]
item_set = item.guard_element_set
m_id = @materia_armor1
when 2
item = $data_armors[@armor2_id]
item_set = item.guard_element_set
m_id = @materia_armor2
when 3
item = $data_armors[@armor3_id]
item_set = item.guard_element_set
m_id = @materia_armor3
when 4
item = $data_armors[@armor4_id]
item_set = item.guard_element_set
m_id = @materia_armor4
end
other_slot = nil
if item_set.include?(M_SLOT8L) or item_set.include?(M_SLOT6L) or item_set.include?(M_SLOT4L) or item_set.include?(M_SLOT2L)
if slot == 0
other_slot = 1
end
if slot == 1
other_slot = 0
end
end
if item_set.include?(M_SLOT8L) or item_set.include?(M_SLOT6L) or item_set.include?(M_SLOT4L)
if slot == 2
other_slot = 3
end
if slot == 3
other_slot = 2
end
end
if item_set.include?(M_SLOT8L) or item_set.include?(M_SLOT6L)
if slot == 4
other_slot = 5
end
if slot == 5
other_slot = 4
end
end
if item_set.include?(M_SLOT8L)
if slot == 6
other_slot = 7
end
if slot == 7
other_slot = 6
end
end
if other_slot
# Set materia to linked materia
materia = $game_party.materias[m_id[other_slot]]
return materia
end
return false
end

end















#==============================================================================
# + Game_Materia
#------------------------------------------------------------------------------

class Game_Materia

attr_reader :name
attr_reader :class_id
attr_reader :level
attr_reader :exp
attr_reader :skills

def initialize(materia_id, based_on)
super()
setup(materia_id, based_on)
end

def setup(materia_id, based_on)
materia = $data_armors[based_on]
@materia_id = materia_id
@based_id = based_on
if materia != nil
@name = materia.name
@class_id = materia.pdef
@final_level = $data_armors[@based_id].eva
@exp_influence = materia.mdef
@equippedOn = 0 # actor ID (0 = Available to be equipped)
@level = 1
@exp_list = Array.new(101)
make_exp_list
@exp = 0
@skills = []
@all_effect = 0 # Number of times "All" can be used

for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end

end
end

def id
return @materia_id
end

def based_on
return @based_id
end

def based_id=(id)
@based_id = id
end

def all_effect
return @all_effect
end

def all_effect=(number)
@all_effect = number
end

def level
return @level
end

def index
return $game_party.materias.index(self)
end

def make_exp_list
actor = $data_actors[M_ACTOR]
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..100
if i > @final_level
@exp_list = 0
else
pow_n = 2 + (i * 7/10)
n = actor.exp_basis * ((i + pow_n) ** pow_i) / (5 ** pow_i)
n = return_nice(n)
@exp_list = Integer(n)
end
end
end

def return_nice(n)
n *= 250
n = Integer((n * @exp_influence) / 100)
#n = @exp_list[i-1] + Integer(n)
# Set "n" to be a nice number
for j in 2..7
nice = 10 ** j
case j
when 2 #100
if n > nice
n = Integer(n/100)
n *= 100
end
when 3..4 # 1,000 or 10,000
if n > nice
n = Integer(n/1000)
n *= 1000
end
when 5..6 # 100,000 or 1,000,000
if n > nice
n = Integer(n/10000)
n *= 10000
end
when 7 # 10,000,000
if n > nice
n = Integer(n/100000)
n *= 100000
end
end
end

return n
end

def exp_s
#return @exp.to_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
end

def next_exp_s
#return @exp_list[@level+1].to_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
end

def next_rest_exp_s
#return (@exp_list[@level] - @exp).to_s
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "-------"
end

def is_equipped?
if @equippedOn == 0
return false
else
return true
end
end

def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
end

def level=(level)
level = [[level, @final_level].min, 1].max
self.exp = @exp_list[level]
end

def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@skills.sort!
end
end

def forget_skill(skill_id)
@skills.delete(skill_id)
end

def skill_learn?(skill_id)
return @skills.include?(skill_id)
end

def equipTo(id)
@equippedOn = id
end

def equippedOn
return @equippedOn
end

def is_all?
if skill_learn?(M_ALL)
return true
end
return false
end

def final_level
return @final_level
end

end








#==============================================================================
# + Game_Materias
#------------------------------------------------------------------------------

class Game_Materias

def initialize
@data = []
# Set all Materia from list
@data[0] = 0
i=0
for i in 1..($data_armors.size - 1)
armor = $data_armors
if armor.guard_element_set.include?(IS_MATERIA)
armor_id = armor.id
#print armor_id
@data = Game_Materia.new(i, armor_id)
i += 1
end
end
end

def [](materia_id)
if materia_id > M_MAX or $data_armors[materia_id] == nil
return nil
end
if @data[materia_id] == nil
@data[materia_id] = Game_Materia.new(materia_id, $temp_based_on)
end
return @data[materia_id]
end
end














#==============================================================================
# + Game_Enemy
#------------------------------------------------------------------------------

class Game_Enemy < Game_Battler

alias old_initialize initialize
def initialize(troop_id, member_index)
old_initialize(troop_id, member_index)
@enemy = $data_enemies[@enemy_id]
@ap = get_ap
end

def get_ap
base = @enemy.exp
multiplier = get_multiplier
ap = ((base * 19) * (multiplier * 12)) / 10000
return ap
end

def get_multiplier
multiplier = nil
if element_rank(E_STR) < 3
multiplier = @enemy.str
elsif element_rank(E_DEX) < 3
multiplier = @enemy.dex
elsif element_rank(E_AGI) < 3
multiplier = @enemy.agi
else
multiplier = @enemy.int
end
return multiplier
end

def element_rank(id)
return @enemy.element_ranks[id]
end

def ap
return @ap
end

end














#==============================================================================
# + Game_Party
#------------------------------------------------------------------------------

class Game_Party

attr_reader :materias

def initialize
@actors = []
@gold = 0
@steps = 0
@items = {}
@weapons = {}
@armors = {}
@materias = []
end

def add_materia(based_on)
$temp_based_on = based_on # armor ID
materia_id = (@materias.size + 1) # New ID assigned

# At this point, based_on = armor ID and
# materia_id = the amount of materia held by
# the party, plus 1

# Look through Game_Materias for the based_on ID
# for materia in $game_materias
# if materia.based_on == based_on
# based_on_materia = materia.id
# end
# end

# Now, based_on_materia = the materia in
# Game_Materias off of which this new one is based

#print "Game_Party, add_materia, materia_id = ", materia_id
materia = Game_Materia.new(materia_id, based_on)
if @materias.size < M_MAX and not @materias.include?(materia)
@materias.push(materia)
$game_player.refresh
end
end

def remove_materia(materia_id)
# Look for the materia to delete (materia_id)
for materia in @materias
if materia.id == materia_id
@materias.delete(materia)
end
end
$game_player.refresh
end
end
Materia:Window

#==============================================================================
# + Window_EquipMateria
#------------------------------------------------------------------------------

class Window_EquipMateria < Window_Selectable

def initialize(actor, type=5) #5=all, 0=weapon, 1=armor1, etc...
super(272, 0, 368, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize

@actor = actor
@type = type
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# Draw A Picture Using draw_picture
#--------------------------------------------------------------------------
def draw_picture(image, x, y)
bitmap = RPG::Cache.picture(image)
iw=bitmap.width
ih=bitmap.height
self.contents.blt(x, y , bitmap, Rect.new(0, 0, iw, ih))
end


def item
return @data[self.index]
end

def m_id
materias = $game_party.materias
i = self.index
case @type
when 0
materia_id = @actor.materia_weapon
when 1
materia_id = @actor.materia_armor1
when 2
materia_id = @actor.materia_armor2
when 3
materia_id = @actor.materia_armor3
when 4
materia_id = @actor.materia_armor4
end
if materia_id < M_NIL
this_id = materias[materia_id].id
end
if materia_id == nil
return nil
else
return this_id
end
end


def refresh
self.contents.clear


@num_items = [0, 0, 0, 0, 0]
# Draw Materia Slots
if @type == 5
for i in 0..4
draw_slots(i)
end
else
draw_slots(@type)
end

self.contents.font.color = system_color
@materias = $game_party.materias

@data = []
case @type
when 0
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
materia_equ = @actor.materia_weapon
when 1
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
materia_equ = @actor.materia_armor1
when 2
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
materia_equ = @actor.materia_armor2
when 3
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
materia_equ = @actor.materia_armor3
when 4
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
materia_equ = @actor.materia_armor4
when 5
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
@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])
end

# Draw Materia Spheres
if @type != 5 # Draw only needed materia spheres
for i in 0..@num_items[@type]
materia_id = materia_equ
if materia_id != M_NIL and materia_id != nil
icon_id = @materias[materia_id].based_on
item = $data_armors[icon_id]
draw_materia(item, 92 + (i * 24), 32 * @type)
end
end
for i in 0..(@num_items[@type] - 1)
@data.push(materia_equ)
end
else
for j in 0..4
for i in 0..@num_items[j]
case j
when 0
materia_id = @actor.materia_weapon
when 1
materia_id = @actor.materia_armor1
when 2
materia_id = @actor.materia_armor2
when 3
materia_id = @actor.materia_armor3
when 4
materia_id = @actor.materia_armor4
end
if materia_id != M_NIL and materia_id != nil
icon_id = @materias[materia_id].based_on
item = $data_armors[icon_id]
draw_materia(item, 92 + (i * 24), 32 * j)
end
end
end
end

@item_max = @data.size # @item_max used for Window_Selectable options

end

def item_base
item = nil
case @type
when 0
materia_id = @actor.materia_weapon[self.index]
when 1
materia_id = @actor.materia_armor1[self.index]
when 2
materia_id = @actor.materia_armor2[self.index]
when 3
materia_id = @actor.materia_armor3[self.index]
when 4
materia_id = @actor.materia_armor4[self.index]
end
if @type != 5 and materia_id != M_NIL
icon_id = @materias[materia_id].based_on
item = $data_armors[icon_id]
end
return item
end

def draw_slots(i)
case i
when 0
item = $data_weapons[@actor.weapon_id]
when 1
item = $data_armors[@actor.armor1_id]
when 2
item = $data_armors[@actor.armor2_id]
when 3
item = $data_armors[@actor.armor3_id]
when 4
item = $data_armors[@actor.armor4_id]
end
x = 92
y = 32 * (i)
if item != nil and i==0
if item.element_set.include?(M_SLOT8L)
# Add 8 slots, linked
draw_materia_slots(x, y, 8, 2)
x+=192
@num_items += 8
end
if item.element_set.include?(M_SLOT6L)
# Add 6 slots, linked
draw_materia_slots(x, y, 6, 2)
x+=144
@num_items += 6
end
if item.element_set.include?(M_SLOT4L)
# Add 4 slots, linked
draw_materia_slots(x, y, 4, 2)
x+=96
@num_items += 4
end
if item.element_set.include?(M_SLOT2L)
# Add 2 slots, linked
draw_materia_slots(x, y, 2, 2)
x+=48
@num_items += 2
end
if item.element_set.include?(M_SLOT1U)
# Add 1 slot
draw_materia_slots(x, y, 1, 1)
x+=24
@num_items += 1
end
if item.element_set.include?(M_SLOT2U)
# Add 2 slots, unlinked
draw_materia_slots(x, y, 2, 1)
x+=48
@num_items += 2
end
if item.element_set.include?(M_SLOT3U)
# Add 3 slots, unlinked
draw_materia_slots(x, y, 3, 1)
x+=72
@num_items += 3
end
if item.element_set.include?(M_SLOT4U)
# Add 4 slots, unlinked
draw_materia_slots(x, y, 4, 1)
x+=96
@num_items += 4
end
if item.element_set.include?(M_SLOT5U)
# Add 5 slots, unlinked
draw_materia_slots(x, y, 5, 1)
x+=120
@num_items += 5
end
if item.element_set.include?(M_SLOT6U)
# Add 6 slots, unlinked
draw_materia_slots(x, y, 6, 1)
x+=144
@num_items += 6
end
if item.element_set.include?(M_SLOT7U)
# Add 7 slots, unlinked
draw_materia_slots(x, y, 7, 1)
x+=168
@num_items += 7
end
if item.element_set.include?(M_SLOT8U)
# Add 8 slots, unlinked
draw_materia_slots(x, y, 8, 1)
x+=192
@num_items += 8
end
end
if item != nil and i>0
if item.guard_element_set.include?(M_SLOT8L)
# Add 8 slots, linked
draw_materia_slots(x, y, 8, 2)
x+=192
@num_items += 8
end
if item.guard_element_set.include?(M_SLOT6L)
# Add 6 slots, linked
draw_materia_slots(x, y, 6, 2)
x+=144
@num_items += 6
end
if item.guard_element_set.include?(M_SLOT4L)
# Add 4 slots, linked
draw_materia_slots(x, y, 4, 2)
x+=96
@num_items += 4
end
if item.guard_element_set.include?(M_SLOT2L)
# Add 2 slots, linked
draw_materia_slots(x, y, 2, 2)
x+=48
@num_items += 2
end
if item.guard_element_set.include?(M_SLOT1U)
# Add 1 slot
draw_materia_slots(x, y, 1, 1)
x+=24
@num_items += 1
end
if item.guard_element_set.include?(M_SLOT2U)
# Add 2 slots, unlinked
draw_materia_slots(x, y, 2, 1)
x+=48
@num_items += 2
end
if item.guard_element_set.include?(M_SLOT3U)
# Add 3 slots, unlinked
draw_materia_slots(x, y, 3, 1)
x+=72
@num_items += 3
end
if item.guard_element_set.include?(M_SLOT4U)
# Add 4 slots, unlinked
draw_materia_slots(x, y, 4, 1)
x+=96
@num_items += 4
end
if item.guard_element_set.include?(M_SLOT5U)
# Add 5 slots, unlinked
draw_materia_slots(x, y, 5, 1)
x+=120
@num_items += 5
end
if item.guard_element_set.include?(M_SLOT6U)
# Add 6 slots, unlinked
draw_materia_slots(x, y, 6, 1)
x+=144
@num_items += 6
end
if item.guard_element_set.include?(M_SLOT7U)
# Add 7 slots, unlinked
draw_materia_slots(x, y, 7, 1)
x+=168
@num_items += 7
end
if item.guard_element_set.include?(M_SLOT8U)
# Add 8 slots, unlinked
draw_materia_slots(x, y, 8, 1)
x+=192
@num_items += 8
end
end
end

def update_help
if @equipping == 5 # Set help window text
text = "Select equipment to change its materia"
@help_window.set_text(text, 1)
else
item = item_base
@help_window.set_text(item == nil ? "" : item.description)
end
end

alias old_update_cursor_rect update_cursor_rect
def update_cursor_rect
if @type !=5
t_index = @index
x = (t_index * 24) + 92
y = @type * 32
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(x,y, 24, 32)
end
else
old_update_cursor_rect
end
end

alias old_update update
def update
old_update
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end

if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
end
end


end







#==============================================================================
# + Window_Base
#------------------------------------------------------------------------------

class Window_Base < Window
def draw_materia(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
end


def draw_materia_slots(x, y, num, type)
if type == 1
bitmap = RPG::Cache.icon("slot-1.png")
wid = 24
else
bitmap = RPG::Cache.icon("slot-2.png")
wid = 48
end
num /= type
y += 4
for i in 1..num
self.contents.blt(x, y, bitmap, Rect.new(0, 0, wid, 24))
x += wid
end
end


def draw_materia_name(materia, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, materia.name)
end

def draw_materia_level(materia, x, y)
bitmap = RPG::Cache.icon('star')
flv = materia.final_level
for i in 1..flv
opacity = 255
if i > materia.level
opacity = 50
end
self.contents.blt(x + ((i - 1) * 24), y, bitmap, Rect.new(0, 0, 24, 24), opacity)
end
end

def draw_materia_ap(materia, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "AP")
self.contents.font.color = normal_color
self.contents.draw_text(x + 24, y, 84, 32, materia.exp_s, 2)
self.contents.draw_text(x + 108, y, 12, 32, "/", 1)
self.contents.draw_text(x + 120, y, 84, 32, materia.next_exp_s)
end

def draw_materia_skills(materia, x, y)
nudge = 0
for skill in $data_skills
id = skill.id
#if not skill.element_set.include?(M_NO_SKILL)
#self.contents.draw_text(x, y + nudge, 128, 32, skill.name)
#end
end
end
end









#==============================================================================
# + Window_Equip_Materia_Item
#------------------------------------------------------------------------------

class Window_Materia_Item < Window_Selectable

def initialize(actor)
super(272, 256, 368, 224)
@actor = actor
@column_max = 1
refresh
self.active = false
self.index = -1
end

def item
#return @data[self.index]
return @game_party_index[self.index]
end

def m_id
materia = @data[self.index]
if materia == nil
return nil
else
return materia.id
end
end

def m_based_on
materia_id = self.item
if materia_id != nil and materia_id != M_NIL
materia = $game_party.materias[materia_id]
return $data_armors[materia.based_on]
else
return nil
end
end

def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
@based_on = []
@game_party_index = []
m_total = ($game_party.materias.size) - 1
for i in 0..m_total
materia = $game_party.materias
if not materia.is_equipped?
@data.push(materia)
armor = $data_armors[materia.based_on]
@based_on.push(armor)
@game_party_index.push(i)
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max-1
draw_item(i)
end
s = @data.size-1
self.contents.draw_text(4, s*32, 100, 32, "- Remove -")
end

def draw_item(index)
item = @based_on[index]
materia = @data[index]
x = 4
y = index * 32
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
#self.contents.draw_text(x + 304, y, 24, 32, materia.id.to_s, 2) # Draw the ID
end

def update_help
@help_window.set_text(self.m_based_on == nil ? "" : self.m_based_on.description)
end
end














#==============================================================================
# + Window_MateriaStatus
#------------------------------------------------------------------------------

class Window_MateriaStatus < Window_Base

def initialize(materia_id = nil)
super(0, 256, 272, 224)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
if materia_id != nil and materia_id != M_NIL
set_materia(materia_id)
else
self.contents.clear
end
end

def set_materia(materia_id)
@materia = nil
for materia in $game_party.materias
if materia.id == materia_id
@materia = materia
end
end
refresh
end

def refresh
self.contents.clear
if @materia != nil and @materia != M_NIL
draw_materia_name(@materia, 5, 5) # draw materia name
draw_materia_level(@materia, 100, 5) # draw materia level (stars)
draw_materia_ap(@materia, 5, 32) # draw materia AP & next (exp)
draw_materia_skills(@materia, 0, 76) # draws the materia's learnable skills
end
end

end


















#==============================================================================
# + Window_Skill
#------------------------------------------------------------------------------

class Window_Skill < Window_Selectable

def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
@switch = 0
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end

def skill
return @data[self.index]
end

def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills]
if skill != nil
@data.push(skill)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end

def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 212, y, 48, 32, skill.sp_cost.to_s, 2)
@all_uses = @actor.skill_scope_all(skill.id)
if @all_uses
self.contents.font.color = system_color
self.contents.font.size -= 4
self.contents.draw_text(x + 232, y, 48, 32, @all_uses.to_s, 2)
self.contents.font.size += 4
end
end

def update_help
@switch += 1
if @switch < 60
text = (self.skill == nil ? "" : self.skill.description)
elsif @switch >= 60
text = "Press Q or W to select all while in battle!"
end
if @switch > 120
@switch = 0
end
@help_window.set_text(text)
end
end











#==============================================================================
# + Window_BattleResult
#------------------------------------------------------------------------------

class Window_BattleResult < Window_Base

alias old_initialize initialize
def initialize(exp, gold, treasures, ap=0)
@ap = ap
@exp = exp
@gold = gold
@treasures = treasures
super(140, 0, 360, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end

def refresh
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("EXP").width
self.contents.draw_text(x, 0, 64, 32, "EXP")
x += cx + 16
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)

x += cx + 16
self.contents.font.color = normal_color
cx = contents.text_size(@ap.to_s).width
self.contents.draw_text(x, 0, cx, 32, @ap.to_s)
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("AP").width
self.contents.draw_text(x, 0, 64, 32, "AP")

y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end




class Fake_Window < Window_Base

def initialize(x, y, w, h)
super(x, y, w, h)
end

end
Materia:Scene


#==============================================================================
# + Scene_Materia
#------------------------------------------------------------------------------

class Scene_Materia

def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
@equipping = 5 # 5=All visible, 0=Weapon visible, 1=Armor1 visible, etc...
end

def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipMateria.new(@actor)
@materia_window = Window_Materia_Item.new(@actor)
@materia_status = Window_MateriaStatus.new

@right_materia1 = Window_EquipMateria.new(@actor, 0)
@right_materia2 = Window_EquipMateria.new(@actor, 1)
@right_materia3 = Window_EquipMateria.new(@actor, 2)
@right_materia4 = Window_EquipMateria.new(@actor, 3)
@right_materia5 = Window_EquipMateria.new(@actor, 4)

# Help Windows
@right_window.help_window = @help_window
@right_materia1.help_window = @help_window
@right_materia2.help_window = @help_window
@right_materia3.help_window = @help_window
@right_materia4.help_window = @help_window
@right_materia5.help_window = @help_window
@materia_window.help_window = @help_window

@right_window.index = @equip_index

# Set Window Positions
@help_window.y += 192
@left_window.y -= 64
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@right_materia1.dispose
@right_materia2.dispose
@right_materia3.dispose
@right_materia4.dispose
@right_materia5.dispose
@materia_window.dispose
@materia_status.dispose
end

def refresh
# Make correct window visible
@right_window.visible = (@equipping == 5)
@right_materia1.visible = (@equipping == 0)
@right_materia2.visible = (@equipping == 1)
@right_materia3.visible = (@equipping == 2)
@right_materia4.visible = (@equipping == 3)
@right_materia5.visible = (@equipping == 4)
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil)
end

# Update Materia Window
@materia_status.refresh

case @equipping
when 0
@active_right_window = @right_materia1
when 1
@active_right_window = @right_materia2
when 2
@active_right_window = @right_materia3
when 3
@active_right_window = @right_materia4
when 4
@active_right_window = @right_materia5
when 5
@active_right_window = @right_window
end
end

def update
@left_window.update
@materia_window.update
refresh
@active_right_window.update
if @right_window.active
update_right
@materia_status.set_materia(nil)

text = "Select equipment to change its materia"
@help_window.set_text(text, 1)

return
elsif @materia_window.active
update_item
materia_id = nil
if @equipping != 5
materia_id = @materia_window.m_id
@materia_status.set_materia(materia_id)
end
return
else
update_right_materia
materia_id = nil
if @equipping != 5
materia_id = @active_right_window.m_id
@materia_status.set_materia(materia_id)
end
end
end

def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index) or @actor.no_slots?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
#Open individual materia equip window
@equipping = @right_window.index
@right_window.active = false
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Materia.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Materia.new(@actor_index, @right_window.index)
return
end
end

def update_right_materia
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@equipping = 5
return
end
if Input.trigger?(Input::C)
if @actor.no_slots?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_right_window.active = false
@materia_window.active = true
@materia_window.index = 0
return
end

if Input.trigger?(Input::L)
materia_id = @active_right_window.m_id
#print materia_id
return
end

end

def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@active_right_window.active = true
@materia_window.active = false
@materia_window.index = -1
return
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
materia_index = @materia_window.item
#Equip Materia
@actor.equip_materia(materia_index == nil ? M_NIL : materia_index, @equipping, @active_right_window.index) #MATERIA ID, EQUIPMENT, SLOT
@active_right_window.active = true
@materia_window.active = false
@materia_window.index = -1
@right_window.refresh
@active_right_window.refresh
@materia_window.refresh
return
end

if Input.trigger?(Input::L)
materia_id = @materia_window.m_id
#print materia_id
return
end

end

end


#==============================================================================
# + Scene_Materia
#------------------------------------------------------------------------------

class Scene_Materia

def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
@equipping = 5 # 5=All visible, 0=Weapon visible, 1=Armor1 visible, etc...
end

def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipMateria.new(@actor)
@materia_window = Window_Materia_Item.new(@actor)
@materia_status = Window_MateriaStatus.new

@right_materia1 = Window_EquipMateria.new(@actor, 0)
@right_materia2 = Window_EquipMateria.new(@actor, 1)
@right_materia3 = Window_EquipMateria.new(@actor, 2)
@right_materia4 = Window_EquipMateria.new(@actor, 3)
@right_materia5 = Window_EquipMateria.new(@actor, 4)

# Help Windows
@right_window.help_window = @help_window
@right_materia1.help_window = @help_window
@right_materia2.help_window = @help_window
@right_materia3.help_window = @help_window
@right_materia4.help_window = @help_window
@right_materia5.help_window = @help_window
@materia_window.help_window = @help_window

@right_window.index = @equip_index

# Set Window Positions
@help_window.y += 192
@left_window.y -= 64
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@right_materia1.dispose
@right_materia2.dispose
@right_materia3.dispose
@right_materia4.dispose
@right_materia5.dispose
@materia_window.dispose
@materia_status.dispose
end

def refresh
# Make correct window visible
@right_window.visible = (@equipping == 5)
@right_materia1.visible = (@equipping == 0)
@right_materia2.visible = (@equipping == 1)
@right_materia3.visible = (@equipping == 2)
@right_materia4.visible = (@equipping == 3)
@right_materia5.visible = (@equipping == 4)
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil)
end

# Update Materia Window
@materia_status.refresh

case @equipping
when 0
@active_right_window = @right_materia1
when 1
@active_right_window = @right_materia2
when 2
@active_right_window = @right_materia3
when 3
@active_right_window = @right_materia4
when 4
@active_right_window = @right_materia5
when 5
@active_right_window = @right_window
end
end

def update
@left_window.update
@materia_window.update
refresh
@active_right_window.update
if @right_window.active
update_right
@materia_status.set_materia(nil)

text = "Select equipment to change its materia"
@help_window.set_text(text, 1)

return
elsif @materia_window.active
update_item
materia_id = nil
if @equipping != 5
materia_id = @materia_window.m_id
@materia_status.set_materia(materia_id)
end
return
else
update_right_materia
materia_id = nil
if @equipping != 5
materia_id = @active_right_window.m_id
@materia_status.set_materia(materia_id)
end
end
end

def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index) or @actor.no_slots?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
#Open individual materia equip window
@equipping = @right_window.index
@right_window.active = false
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Materia.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Materia.new(@actor_index, @right_window.index)
return
end
end

def update_right_materia
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@equipping = 5
return
end
if Input.trigger?(Input::C)
if @actor.no_slots?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_right_window.active = false
@materia_window.active = true
@materia_window.index = 0
return
end

if Input.trigger?(Input::L)
materia_id = @active_right_window.m_id
#print materia_id
return
end

end

def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@active_right_window.active = true
@materia_window.active = false
@materia_window.index = -1
return
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
materia_index = @materia_window.item
#Equip Materia
@actor.equip_materia(materia_index == nil ? M_NIL : materia_index, @equipping, @active_right_window.index) #MATERIA ID, EQUIPMENT, SLOT
@active_right_window.active = true
@materia_window.active = false
@materia_window.index = -1
@right_window.refresh
@active_right_window.refresh
@materia_window.refresh
return
end

if Input.trigger?(Input::L)
materia_id = @materia_window.m_id
#print materia_id
return
end

end

end






















#==============================================================================
# + Scene_Title
#------------------------------------------------------------------------------

class Scene_Title
def command_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_materias = Game_Materias.new

$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
end



#==============================================================================
# + Scene_Save
#------------------------------------------------------------------------------

class Scene_Save < Scene_File
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
characters.push([actor.character_name, actor.character_hue])
end
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
$game_system.save_count += 1

$game_system.magic_number = $data_system.magic_number
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
Marshal.dump($game_materias, file)
end
end


#==============================================================================
# + Scene_Load
#------------------------------------------------------------------------------

class Scene_Load < Scene_File
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
$game_materias = Marshal.load(file)

if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end

# If the scope of the skill is 3 (One ally of HP 1 or more)
# or 4 (All allies of HP 1 or more) and the target's HP is 0,
# or the scope of the skill is 5 (One ally with HP 0) or 6
# (All allies with HP 0), the method returns without doing
# any further processing

# Change: "def make_skill_action_result" under Scene_Battle:
# set_target_battlers(@skill.scope)
# to:
# if @active_battler.skill_scope_all[@skill.id] > 0
# set_target_battlers(@active_battler.skill_scope[@skill.id])
# else
# set_target_battlers(@skill.scope)
# end









#==============================================================================
# + Scene_Battle
#------------------------------------------------------------------------------

class Scene_Battle

alias old_main main
def main
for actor in $game_party.actors
actor.update_skills # Update all the actors' skills
end
old_main
end

def make_skill_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@active_battler.sp -= @skill.sp_cost
@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id

#set_target_battlers(@skill.scope)
if @active_battler.is_a?(Game_Actor)
if @active_battler.skill_scope_all(@skill.id) > 0 and @active_battler.selected_all?
set_target_battlers(@active_battler.skill_scope(@skill.id))
@active_battler.use1_skill_scope_all(@skill.id)
#print "Uses left: ", @active_battler.skill_scope_all(@skill.id).to_s
else
set_target_battlers(@skill.scope)
end
else
set_target_battlers(@skill.scope)
end

for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end

alias old_update_phase3_skill_select update_phase3_skill_select
def update_phase3_skill_select
old_update_phase3_skill_select
if Input.trigger?(Input::C)
@active_battler.use_select_all(false)
end
if Input.trigger?(Input::R) or Input.trigger?(Input::L)
#print "Select All!"
@active_battler.use_select_all(true)

@skill = @skill_window.skill
if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end

if @active_battler.skill_scope_all(@skill.id) <= 0
$game_system.se_play($data_system.buzzer_se)
return
end

$game_system.se_play($data_system.decision_se)
@active_battler.current_action.skill_id = @skill.id
@skill_window.visible = false
if @active_battler.skill_scope(@skill.id) == 1
start_enemy_select
elsif @active_battler.skill_scope(@skill.id) == 3 or @active_battler.skill_scope(@skill.id) == 5
start_actor_select
else
end_skill_select
phase3_next_actor
end

return
end
end

alias old_start_phase5 start_phase5
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
ap = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
ap += enemy.ap
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]
actors = $game_party.actors
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end

gain_ap(actors, ap)

$game_party.gain_gold(gold)
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
@result_window = Window_BattleResult.new(exp, gold, treasures, ap)
@phase5_wait_count = 100
end

def gain_ap(actors, ap)
materias = $game_party.materias
for materia in materias
for actor in actors
if materia.equippedOn == actor.id
old_lv = materia.level
materia.exp += ap
new_lv = materia.level
if old_lv < new_lv
actor.update_skills
if new_lv == materia.final_level
$game_party.add_materia(materia.based_on)
end
end
end
end
end
end


end
Scene_Liste_Monstres

#==============================
# &#9632; Scene_Liste_Monstres v2 par Krazplay
#------------------------------
# Ce scrîpt fonctionne avec les scrîpts Window_Monstres et Window_details_monstre.
# N'oubliez pas que les variables 4001 à 4000+Nbre de monstres dans votre database
# sont utilisés pour mémoriser le nombre de monstres tués de chaque sorte.
# Pour appeller ce menu il suffit d'écrire la ligne suivante :
# $scene = Scene_Liste_Monstres.new
# Si vous venez depuis un menu vous pouvez ajouter cela :
# $vientdumenu = 1
# Cela permet de revenir dans le menu et non sur la carte après avoir consulter
# le bestiaire.
# A propos de @detailspardefaut et @nomspardefaut respectivement ligne 26 et 197
# Ces 2 variables sont mis en vrai par défaut, mais vous pouvez les mettre en
# false. Si @detailspardefaut est mis en false vous ne pourrez voir les détails
# des ennemis que si vous en avez tuer au moins un, si @nomspardefaut est mis
# en false vous ne verrez pas le nom des ennemis que vous n'avez jamais tué.
# Je remercie aussi celui qui a créé le graphique de défense élémentale, seule
# chose que je n'ai pas faite moi-même, j'ai du y opérer quelques modifications
# mais il fonctionne parfaitement ;)
#==============================

class Scene_Liste_Monstres

def initialize
@detailspardefaut = true
end

def main
@monstres_window = Window_Monstres.new(0,0)
Graphics.transition
@monstres_window.refresh
loop do
Graphics.update #Efface ce qu'on pourrait voir par transparence
Input.update
update_command
if $scene != self #Si la scène ne doit plus être celle-ci
@monstres_window.dispose #On efface la fenêtre des monstres
break #On casse la boucle sinon on restera tjs ici
end
end
end #main

def update_command
if Input.trigger?(Input::B) #B = Bouton échap
$game_system.se_play($data_system.cancel_se)
if @monstres_window.active? == 1
if $vientdumenu == 1
$vientdumenu = 0
$scene = Scene_Menu.new(5) #On repart dans le menu (curseur sur Objets)
else
$scene = Scene_Menu.new(5)
end
Graphics.freeze #Pour éviter une transition trop brutal
end
if @Window_details_monstre_active == 1
@Window_details_monstre.dispose
@Window_details_monstre_active = 0
@monstres_window = Window_Monstres.new(@memo[0], @memo[1])
end
end


if Input.trigger?(Input::RIGHT)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.pageplusun
@monstres_window.refresh
end
if @Window_details_monstre_active == 1 and @monstres_window.selection+@pagetourne < $data_enemies.size-1
if $game_variables[4000 + @monstres_window.selection+@pagetourne+1] != 0 or @detailspardefaut == true
@Window_details_monstre.dispose
@pagetourne += 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection+@pagetourne)
end
end
end

if Input.trigger?(Input::LEFT)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.pagemoinsun
@monstres_window.refresh
end
if @Window_details_monstre_active == 1 and @monstres_window.selection+@pagetourne > 1
if $game_variables[4000 + @monstres_window.selection+@pagetourne-1] != 0 or @detailspardefaut == true
@Window_details_monstre.dispose
@pagetourne -= 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection+@pagetourne)
end
end
end

if Input.trigger?(Input::UP)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.ligneplusun
@monstres_window.refresh
end
end

if Input.trigger?(Input::DOWN)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.lignemoinsun
@monstres_window.refresh
end
end

if Input.trigger?(Input::C) #Confirmer
if @monstres_window.active? == 1 and @Window_details_monstre_active != 1
if $game_variables[4000 + @monstres_window.selection] != 0 or @detailspardefaut == true
@pagetourne = 0
@memo = @monstres_window.inactive
@monstres_window.dispose
@Window_details_monstre_active = 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection)
end
end
end

end #update_command
end #class Scene_Liste_Monstres

#==============================
# &#9632; Window_details_monstre v2 par Krazplay
#------------------------------
#Permet de créer une fenêtre avec les détails d'un ennemi
#==============================
class Window_details_monstre < Window_Base

def initialize(monstre_id)
super(5, 5, 630, 470)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.clear
draw_actor_battler($data_enemies[monstre_id], 215, 220)
self.contents.font.size = 29
self.contents.font.color = Color.new(255, 155, 155, 255)
monster_name_width = contents.text_size($data_enemies[monstre_id].name).width
self.contents.draw_text(300 - (monster_name_width / 2), 0, 500, 32, $data_enemies[monstre_id].name)
self.contents.font.size = 24
self.contents.font.color = normal_color
self.contents.draw_text(50, 30, 300, 32, "HP : " + $data_enemies[monstre_id].maxhp.to_s)
self.contents.draw_text(50, 55, 300, 32, "SP : " + $data_enemies[monstre_id].maxsp.to_s)
self.contents.draw_text(400, 50, 300, 32, "Attaque :")
self.contents.draw_text(550, 50, 300, 32, $data_enemies[monstre_id].atk.to_s)
self.contents.draw_text(400, 80, 300, 32, "Déf physique :")
self.contents.draw_text(550, 80, 300, 32, $data_enemies[monstre_id].pdef.to_s)
self.contents.draw_text(400, 110, 300, 32, "Déf magique :")
self.contents.draw_text(550, 110, 300, 32, $data_enemies[monstre_id].mdef.to_s)
self.contents.draw_text(400, 140, 300, 32, "Force :")
self.contents.draw_text(550, 140, 300, 32, $data_enemies[monstre_id].str.to_s)
self.contents.draw_text(400, 170, 300, 32, "Dextérité :")
self.contents.draw_text(550, 170, 300, 32, $data_enemies[monstre_id].dex.to_s)
self.contents.draw_text(400, 200, 300, 32, "Agilité :")
self.contents.draw_text(550, 200, 300, 32, $data_enemies[monstre_id].agi.to_s)
self.contents.draw_text(400, 230, 300, 32, "Intelligence :")
self.contents.draw_text(550, 230, 300, 32, $data_enemies[monstre_id].int.to_s)
self.contents.draw_text(10, 360, 300, 30, "Expérience : " + $data_enemies[monstre_id].exp.to_s)
self.contents.draw_text(10, 385, 300, 30, "Argent : " + $data_enemies[monstre_id].gold.to_s)
self.contents.draw_text(10, 410, 300, 30, "Objet détenu : ")

if $data_enemies[monstre_id].weapon_id != 0
bitmap = RPG::Cache.icon($data_weapons[$data_enemies[monstre_id].weapon_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_weapons[$data_enemies[monstre_id].weapon_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
if $data_enemies[monstre_id].armor_id != 0
bitmap = RPG::Cache.icon($data_armors[$data_enemies[monstre_id].armor_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_armors[$data_enemies[monstre_id].armor_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
if $data_enemies[monstre_id].item_id != 0
bitmap = RPG::Cache.icon($data_items[$data_enemies[monstre_id].item_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_items[$data_enemies[monstre_id].item_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
self.draw_enemy_element_radar_graph($data_enemies[monstre_id], 400, 270, radius = 30)
end #def initialize
end


#==============================
# &#9632; Window_Monstres v2 par Krazplay
#------------------------------
#Permet de créer une fenêtre avec le nom de tout les ennemis tués et combien de
#fois ils ont été tués.
#==============================
class Window_Monstres < Window_Base

def initialize(page, ligne)
@nomspardefaut = true
@active = 1
@page = page
@ligne = ligne
#Taille du cadre que l'on voie, mais dont on ne peut pas écrire dessus :
super(0, 0, 640, 480)
#Image invisible où l'on va pouvoir écrire dessus :
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
self.contents.clear
self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :")
self.contents.draw_text(400, 0, 500, 32, "Nombres tués :")
#Call'aile du canard de la dernière page :
@dernierepage = Integer($data_enemies.size / 15) + 1
@derniereligne = Integer($data_enemies.size % 15) - 1
refresh
end #def initialize

def refresh
self.contents.draw_text(240, 420, 500, 32, "Page " + (@page+1).to_s + " / " + @dernierepage.to_s)
self.cursor_rect.set(0, (40 + 26*@ligne), 580, 27)
m = 1
if @page == @dernierepage - 1
monstremoins = 15 - (($data_enemies.size - 1) % 15)
else
monstremoins = 0
end
for i in (1 + 15*@page)...(16 + 15*@page - monstremoins)
if $game_variables[4000 + i] != 0 or @nomspardefaut == true
self.contents.draw_text(20, (26 * m) + 15, 500, 26, $data_enemies.name)
else
self.contents.draw_text(20, (26 * m) + 15, 500, 26, "Ennemi inconnu")
end
self.contents.draw_text(470, (26 * m) + 15, 500, 26, $game_variables[4000 + i].to_s)
m += 1
end
end #end refresh
def pageplusun
if @page < @dernierepage -1
@page += 1
end
if @ligne > @derniereligne -1 and @page == @dernierepage -1
@ligne = @derniereligne -1
end
end
def pagemoinsun
if @page > 0
@page -= 1
end
end
def ligneplusun
if @ligne > 0
@ligne -= 1
end
end
def lignemoinsun
if @ligne < 14
unless @ligne >= @derniereligne -1 and @page == @dernierepage -1
@ligne += 1
end
end
end
def selection
return (@ligne+1) + (@page*15)
end
def nettoyage
self.contents.clear
self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :")
self.contents.draw_text(400, 0, 500, 32, "Nombres tués :")
end
def active?
return @active
end
def inactive
@active=0
return [@page,@ligne]
end
end #class Window_Monstres

#------------------------------
# &#9679; draw_actor_battler de Krazplay
# Dessine le battler de l'acteur aux coordonnées x,y
# L'acteur peut aussi bien être un monstre qu'un personnage
#------------------------------
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect)
end
end

#==============================
# Graphic_Def_Elem
#==============================
class Window_Base
FONT_SIZE = 18
WORD_ELEMENT_GUARD = "Déf. Elémentale"
NUMBER_OF_ELEMENTS = 8
ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
end
#==============================
# &#65533;¡ Window_Status
#==============================
class Window_Base
#------------------------------
def draw_enemy_element_radar_graph(enemy, x, y, radius = 56)
cx = x + radius + FONT_SIZE + 48
cy = y + radius + FONT_SIZE + 32
self.contents.font.color = system_color
#self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
for loop_i in 0..NUMBER_OF_ELEMENTS
if loop_i == 0

else
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
end
if loop_i == NUMBER_OF_ELEMENTS
eo = ELEMENT_ORDER[0]
else
eo = ELEMENT_ORDER[loop_i]
end
er = element_pourcent(enemy, eo)
estr = $data_system.elements[eo]
@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
@now_x = cx + (radius * Math.cos(th)).floor
@now_y = cy - (radius * Math.sin(th)).floor
@now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
@now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
@now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_ex = cx + (er.abs*radius/100 * Math.cos(th)).floor
@now_ey = cy - (er.abs*radius/100 * Math.sin(th)).floor
if loop_i == 0
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
else

end
next if loop_i == 0
self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
self.contents.font.size = FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
self.contents.font.color = Color.new(255,255,255,128)
self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2)
end
end
#end

#------------------------------
# &#9679; &#23646;&#24615;&#35036;&#27491;&#20516;&#12398;&#21462;&#24471;
# element_id : &#23646;&#24615; ID
#------------------------------
def element_pourcent(enemy, element_id)
table = [0,200,150,100,50,0,-100]
return table[enemy.element_ranks[element_id]]
end
end
#==============================
# &#65533;¸ ¦O&#65533;&#65533;&#65533;&#65533;&#65533;C&#65533;u&#65533;&#65533;&#65533;¦
#==============================
class Bitmap
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
Ach du scheiße... O.O
Ich wusste nicht, dass wir hier von RGSS reden. o_O"

Kannst du es mal... als Projekt hochladen? xD
So für die RGSS-total-n00bs? xD

Ich ahbe keinen Peil was das da oben bedeutet... xD
Jop mach ich aber die erklärung damit man neue Materias reintun kann^^:

Da währe noch einiges zu sagen:
zuerst muss ein Charackter namens - Materia - erschaffen werden
Dann muss man noch in den Attributen einiges ändern:Siehe Scrennshoot1
Danach muss man für jede materia eine Class einrichten
(Die Fähigkeiten die die Materia lernen soll in der Skil liste
eintragen
Danach muss man nur noch Items erschaffen die die Materia an
sich Symbolisieren
dabei muss man nur beachten das die Wwrte Physical defense :
ist z.B. der wert der die materia durchnumerirt fängt bei 10
an und geht jede Materia
1 aufwärts ;
Magic Defense sind die AP die die Materia benötigt um level zu steigen
1 zu 100 ;
Evasion ist die Anzahl an Level die die Materia hat
(Master level=Evasionszahl)
Außerdem muss die Materia das Atribute --Materia-- haben das man
erstellen muss siehe Screenshoots
Die Waffen die die Materia slots haben müssen den Atributen zugeordnet
werden wie 1 Unlinked oder 8 Linked

Wichtig!!!:
Die Materia Atribute müssen ab 17 anfangen(andere sind egal )Die Slots
17-34 müssen ihren jeweiligen namen haben siehe Screnshoot
Ach und zum Menü;

Ihr müsst nen Ordner Namens Faces in die Graphics/Chars
reinmachen und dort
n Face das den selben Namen wie die Walkgraphic eurer Helden hat
reintun
Nen mir mal bitte ne Uploadsite dann mach ichs^^
Ich kapier das script auch nur wenn ichs vor mir hab (sowas selbstmachen is bestimmt sau schwer)
www.rapidshare.de

Und was für Screenshots? o.o"
okay ich lad die Screnshots im Archive meines Secret of Time Trailers hoch^^ich

(gehts eigentlich auch ohne RPGMaker xp aufm rechner das script zu spielen?)
((hat14Mb)sagts wenn was nich funzt^^)
Hier der Link: http://rapidshare.de/files/28560420/Secret_of_Time_3.rar.html
Hier das Screenshot archieve(sind 4 screnshots drin die helfen das system zu begreifen^^:


http://rapidshare.de/files/28605660/Screnshots_Materiasystem.rar.html
Kann man das mit den Materia auch beim RPG Maker 2003 mache`n???
Naja das is so ne sache(das wird zwar leichter als son script aber wesentlich aufwendiger(habs versucht aber nach 3 tagen Powerprogging und trotzdem noch soooviele bugs hab ichs seingelassen(nicht empfelenswert)^^ aber wennde keinen Xp hast frag mich im ICQ^^ Ark626 is icqname (Einmalig)
Wie fndet ihr den Gametrailer eigentlich(wenn jemand will kann ich ihm auch SoT 1 oder 2 geben
1 is für Rpgmaker 2000(nich als schlecht abstempeln
nur wegem maker is gut geworden)
hat drei Storys normal (mit Ark wenn man das fertighat Bass(Forte und nach dieser noch Sephiroth
Is noch nicht ganz fertig aber schon gänzlich spielbar^^fehlen nchnpaar quests nichts wichtiges^^)
und das 2er is für den 2003er(is erst n anfang
ungefährespielzeit
1std mit jeder der beiden storys(Forte und Vincent)
Aprospos alle SoT teile Spielen nicht gänzlich unabhängig voneinander aber fast (SoT3 Spielt vor 1und2 SoT2Spielt Zwischen 1 und 3 also
Vergangenheit von SoT 2 ist 1 und die Vergangenheit von 1 und 2 ist 3^^hoffe es war wenigstens ein bisschen verständlich^^
Achja und es gibt nochne Testversion(so zusagen n SoT0)
Hi die seite die du uns gegeben hast ist nicht mehr aktiv.
shit sorry addet mich im ICQ ARK626 und fragt mich dort ich bin aber immoment net so oft on^^
Und wann bist du wieder mal im icq
Ich?Ich bin eigentlich immer on ^^ Sorry fürs lange warten
Ich habn besseres Materiasystem gefunden ^^
Is sau easy zu bedienen ich lads hoch wenn ich zuhause bin (bin am Schul comp.)
also ich such dich in ICQ doch es wird keiner angezeigt mit diesen namen...
gib lieber deine nummer bitte^^
211-867-220
wenn de mit der nummer auch pech hast dann schreib deine nummer ich adde dich dann
Logge dich ein um einen Beitrag zu schreiben.