Hallo Leute!
Ich benutze das "Erfolge" Skript und das "Level Up".
Das Erfolgs-Skript funktioniert super, nur wenn ich in den Level Up Punk in dem Menü einsteige, kommt folgender Fehler:
(http://www.img-load.de/thumb_30344_sfd.gif) (http://www.img-load.de/img_30344_sfd)
Was kann der Fehler sein? Hier beide Skripte die ich verwende:
Erfolge:
#===============================================================================
#
# MK3 - Phoenix Power Productions Presents: Erfolge 0.81
# Letztes Update: Mittwoch, 07.10.2009
# Level: Leicht, Normal
#
# Dieses Script erweitert das Spiel um die Möglichkeit, einen Gamerscore ähnlich
# dem bei der XBox 360 einzubauen.
# Ferner hat es noch ein Custom Menu eingebaut bekommen, dieses ist allerdings
# noch nicht so umfangreich ausgebaut und wird später wahrscheinlich in ein
# eigenes Script übertragen.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 05.10.2009 - Beginn des Scripts.
# o 06.10.2009 - Vollendung der Pre-A, offiziell Version 0.51a
# o 07.10.2009 - Erweiterung des Moduls, Einbau eines Custom-Menus, V 0.81
#===============================================================================
# Installation und Anleitung
#===============================================================================
#
# Platziere dieses Script irgendwo zwischen Material und Main.
# Im Modul Erfolge nach dieser Einleitung gibt es einen Punkt "ERFOLGE_LISTE".
# In diesen können sämtliche Erfolge eingetragen werden, müssen dabei allerdings
# durchgezählt sein, sonst findet die Scene sie nicht.
# Mit "Geheime_Erfolge" können die Erfolge angegeben werden, welche nicht von
# Anfang ausführlich angezeigt werden.
# Will man einem Spieler einen Erfolg verleihen (sprich: er hat ihn erreicht),
# so funktioniert dies mit dem Befehl "gib_erfolg(ID)" unter 'Script' im Event-
# Command 'Advance'. Dabei steht ID für die Nummer, unter welcher der Erfolg in
# Aufzählung ERFOLGE_LISTE zu finden ist.
# Seit Version 0.80 unterstützt das Script auch die Möglichkeit, in anderen Scripts
# mit dem Befehl "$mk.gib_erfolg(id)" Erfolge nach denselben Regeln freizuschalten,
# wie dies in Events bisher möglich war.
#
#===============================================================================
#
# Kompatibilität
# - Alias: Game_System: initialize
# - Alias: Scene_Title: start
# - Alias: Scene_File: write_save_data, load_save_data
# - Alias: Scene_Menu: create_command_window, update_command_selection
# - Overwrite: Scene_Menu: update
#
#===============================================================================
module MK3
module Erfolge
# Mit diesem Namen wird der Erfolgs-Bildschirm-Aufruf betitelt, wenn man ihn
# über das Custom Menu aufruft.
ERFOLGE_NAME = "Erfolge"
# Dieser Schalter bestimmt, ob Erfolge über das Menü aufgerufen werden kann.
# Es wird außerdem für die Custom-Menu-Funktionen unten in diesem Modul be-
# nötigt.
MENU_ACCESS = true
# Mit dieser Liste bestimmt ihr die Reihenfolge der Menü-Einträge. Aller-
# dings unterstützt sie nur die Grundelemente und das Erfolgs-Script (Rest
# muss noch getestet werden). Wer mehr Punkte integrieren möchte, braucht
# sich nur dieses Script:
#
# http://pockethouse.wordpress.com/vx/scene-menu-redux/
#
# zu besorgen und sich dari ein wenig einzuarbeiten. Es ist nicht schwierig.
#
# Die ID muss mit den Zahlen in MENU_SORT übereinstimmen, der erste Eintrag
# im Array ist die Scene, welche aufgerufen wird (wenn Parameter übergeben
# werden müssen, unterstützt dieses Scriptdabei nur jene aus dem Grundpro-
# gramm). Der zweite Eintrag schließlich ist der Name, mit welchem die Scenes
# im Menü eingetragen werden.
MENU_LIST = {
# ID Scene zum Aufruf Name im Menü
1 => ["Scene_Item", "Item"],
2 => ["Scene_Skill", "Fähigkeiten"],
3 => ["Scene_Equip", "Ausrüstung"],
4 => ["Scene_Status", "Status"],
5 => ["Scene_Erfolge", ERFOLGE_NAME],
6 => ["Scene_File", "Speichen"],
7 => ["Scene_End", "Spiel Beenden"],
}
# In dem Array unter diesem Kommentar werden die Aufrufe in der Reihenfolge
# eingegeben, wie sie im Menü erscheinen sollen. Sie müssen hierbei exakt
# mit den IDs in MENU_LIST übereinstimmen.
MENU_SORT = [1, 2, 3, 4, 5, 6, 7]
# In diesem Array müssen alle Scenes stehen, bei welchen man zuvor eine
# Actor-Auswahl im Menü-Status machen möchte. Standardmäßig sind dies 2 für
# Skill, 3 für Equip und 4 für Status.
# Dieses Feature ist noch nicht fertig ausgebaut und unterstützt deshalb nur
# Skill, Equip und Status, die ID muss mit der in MENU_LIST übereinstimmen.
CHAR_WAHL = [2, 3, 4]
# In der folgenden Liste kannst du alle Erfolge einrichten. Die ID ist die
# Nummer, mit welcher du Erfolge verwalten kannst, Titel ist der Name des
# Erfolgs, welcher in der Liste angezeigt wird, Beschreibung sind ein paar
# nähere Worte zu dem Erfolg und Score ist die Punktzahl, welche er bringt.
# Bei Beschreibung kann man mit dem Zeichen "|" einen Zeilenumbruch anzeigen.
# Hierbei empfehle ich aber, nicht mehr als zwei Zeilen zu verwenden, da es
# sonst wahrscheinlich nicht richtig angezeigt wird (habe es noch nicht ge-
# testet).
ERFOLGE_LISTE = {
# ID Titel Beschreibung Score
1 => ["Unter der Erde", "Verlasse dein Haus in der Kanalstadt", 5],
2 => ["Kleiner Reichtum", "Sammel 150 Gold an.", 10],
3 => ["Wanderslust", "Betritt die Oberfläche", 10],
4 => ["Saufbold", "Trinke 10 Starkbier", 10],
5 => ["Schläger", "Töte 10 Kreaturen", 10],
6 => ["Schmerzbringer", "Töte 25 Kreaturen", 10],
7 => ["Terminator", "Töte 50 Kreaturen", 20],
8 => ["Schatzsucher", "Finde 3 verborgene Schätze", 10],
9 => ["Terminator", "Töte 50 Kreaturen", 10],
10 => ["Terminator", "Töte 50 Kreaturen", 10],
}
# Im Event-Command "Advanced - Script" kannst du mit dem Befehl "gib_erfolg(ID)
# den Erfolg freischalten. Damit wird dem Spieler die Punktzahl des Erfolgs
# gutgeschrieben und der Erfolg als erhalten gekennzeichnet
# Der Schalter bestimmt, ob ein Icon gezeigt wird oder nicht.
ICON_ZEIGEN = true
# Gibt den Index des Icons an, welches bei erhaltenen Erfolgen gezeigt wird
ERHALTEN_ICON = 36
# In diese Liste kannst du alle Erfolge aufzählen, welche vor Erhalt nicht
# näher beschrieben werden, sobald sie (mit "gib_erfolg(ID)") freigeschaltet
# wurden, werden sie jedoch wie gewohnt angezeigt
Geheime_Erfolge = [2]
# Diese Liste funktioniert fast wie die Liste Geheime_Erfolge, nur versteckt
# sie lediglich den beschreibenden Text, der Titel wird hingegen angezeigt.
GEHEIME_BESCHREIBUNG = [3]
# Dieser Name wird für den Erfolg angezeigt, wenn er in der Liste Geheime_Erfolge
# steht und noch nicht freigeschaltet wurde
GEHEIM_TITEL = "Geheim"
# Diese Beschreibung erhält man, wenn man einen geheimen, nicht freigeschalteten
# Erfolg anwählt. Genauso wie bei den Beschreibungen in der ERFOLGE_LISTE kann
# auch diese mit "|" mit Zeilenumbruch versehen werden (trotzdem sollte es bei
# zwei Zeilen bleiben).
GEHEIM_BESCHREIBUNG = "Dies ist ein geheimer Erfolg, du musst ihn erst freischalten,|um ihn betrachten zu können"
# Dieser Schalter bestimmt, ob im Hilfe-Fenster die Zahl der gesammelten/
# insgesamten Erfolge angezeigt werden sollen
# Steht der Schalter auf false, sollte der Text in ERFOLGE_HILFE dement-
# sprechend angepasst werden
ERFOLGSZAHL_ZEIGEN = true
# Diese Nachricht steht im Hilfe-Fenster, ist "ERFOLGSZAHL_ZEIGEN" (s. oben)
# true, so wird der Text um X/Y erweitert, wobei X für die Anzahl bereits
# freigeschalteter Bilder steht und Y für die Gesamtzahl aller Erfolge
ERFOLGE_HILFE = "Dies sind deine Erfolge, du hast "
end
end
$imported = {} if $imported == nil
$imported["Erfolge"] = true
module MK3::Commands
def gib_erfolg(id)
if !$Erfolge_erhalten.include?(id) then
$Erfolge_erhalten << id
end
end
end
class Game_Interpreter
include MK3::Commands
end
class MK3_Commands
def initialize
end
def gib_erfolg(id)
if !$Erfolge_erhalten.include?(id)
$Erfolge_erhalten << id
end
end
end
class Game_System
alias mk_initialize initialize
def initialize
mk_initialize
$mk = MK3_Commands.new
end
end
class Window_Help < Window_Base
def initialize(x = 0, y = 0, width = 544, height = WLH + 32)
super(x, y, width, height)
end
end
class Window_ErfolgsScore < Window_Base
def initialize(x, y, width, height)
super(x, y, width, height)
create_contents
now_score = get_score
text = now_score.to_s + "/" + $score.to_s + " Punkte"
contents.draw_text (0, 0, contents.width, WLH, text, 1)
end
def get_score
now_score = 0
for id in $Erfolge_erhalten do
erfolg = MK3::Erfolge::ERFOLGE_LISTE[id]
next unless erfolg != nil
now_score += erfolg[2]
end
return now_score
end
end
class Window_Erfolge < Window_Selectable
WLH = 24
def initialize(x, y, width, height, spacing = 76)
super(x, y, width, height, spacing)
self.index = 0
refresh
end
def refresh
self.contents.clear
@data = []
for id in $Erfolge_erhalten do
@data.push(id)
end
MK3::Erfolge::ERFOLGE_LISTE.each_key do |key|
if !$Erfolge_erhalten.include?(key) then
@data.push(key)
end
end
@item_max = @data.size
create_contents
for i in 1...@item_max+1
draw_erfolg(i)
end
end
def draw_erfolg(id)
if MK3::Erfolge::Geheime_Erfolge.include?(id) and !$Erfolge_erhalten.include?(id) then
text = MK3::Erfolge::GEHEIM_TITEL
elsif $Erfolge_erhalten.include?(id) then
if MK3::Erfolge::ICON_ZEIGEN then
draw_icon(MK3::Erfolge::ERHALTEN_ICON, 0, (WLH * id)-WLH)
end
erfolg = MK3::Erfolge::ERFOLGE_LISTE[id]
if erfolg != nil
text = erfolg[0]
end
else
erfolg = MK3::Erfolge::ERFOLGE_LISTE[id]
if erfolg != nil
text = erfolg[0]
end
end
self.contents.draw_text(25, WLH * (id - 1), 480, 24, text, 0)
end
def draw_medal(medal_name, x = 0, y = 0)
return if medal_name == nil
bitmap = Cache.picture(medal_name)
rect = Rect.new(0, 0, 72, 72)
self.contents.blt(x, y, bitmap, rect)
end
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = ((contents.width + @spacing) / @column_max - @spacing) - 25
rect.height = WLH
rect.x = (index % @column_max * (rect.width + @spacing)) + 25
rect.y = index / @column_max * WLH # Faktor muss identisch sein mit y-Faktor bei Titel
return rect
end
def update
super
end
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max)
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
end
class Window_ErfolgsBeschreibung < Window_Base
def initialize(x, y, width, height)
super(x, y, width, height)
end
end
class Scene_Title < Scene_Base
alias mk_start start
def start
mk_start
if $Erfolge_erhalten == nil then
$Erfolge_erhalten = []
end
get_erfolgpoints
end
def get_erfolgpoints
$score = 0
MK3::Erfolge::ERFOLGE_LISTE.each_value do |val|
$score += val[2]
end
end
end
class Scene_Menu < Scene_Base
alias mk_create_command_window create_command_window
alias mk_update_command_selection update_command_selection
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
if MK3::Erfolge::MENU_ACCESS then
mk_update_actor_selection
else
update_actor_selection
end
end
end
def create_command_window
if MK3::Erfolge::MENU_ACCESS
@liste = MK3::Erfolge::MENU_SORT
@command = []
@liste.each do |id|
name = MK3::Erfolge::MENU_LIST[id]
@command << name[1]
end
@command_window = Window_Command.new(160, @command)
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
else
mk_create_command_window
end
end
def update_command_selection
if MK3::Erfolge::MENU_ACCESS
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
befehl = @liste
aufruf = MK3::Erfolge::MENU_LIST[befehl[@command_window.index]]
if MK3::Erfolge::CHAR_WAHL.include?(@command_window.index + 1)
start_actor_selection
return
end
scene = aufruf[0] + ".new"
case scene
when "Scene_File.new" then
scene += "(true, false, false)"
end
$scene = eval(scene)
end
else
mk_update_command_selection
end
end
def mk_update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
position = MK3::Erfolge::MENU_SORT[@command_window.index]
from = MK3::Erfolge::MENU_LIST[position]
if Input.trigger?(Input::C)
case from[0]
when "Scene_Skill" # skill
$scene = Scene_Skill.new(@status_window.index)
when "Scene_Equip" # equipment
$scene = Scene_Equip.new(@status_window.index)
when "Scene_Status" # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
end
class Scene_File < Scene_Base
alias mk_write_save_data write_save_data
alias mk_read_save_data read_save_data
def write_save_data(file)
mk_write_save_data(file)
Marshal.dump($Erfolge_erhalten, file)
end
def read_save_data(file)
mk_read_save_data(file)
$Erfolge_erhalten = Marshal.load(file)
end
end
class Scene_Erfolge < Scene_Base
def initialize(scene = Scene_Menu)
@scene = scene
end
def start
create_menu_background
text = MK3::Erfolge::ERFOLGE_HILFE
if MK3::Erfolge::ERFOLGSZAHL_ZEIGEN
text += $Erfolge_erhalten.length.to_s + "/" + MK3::Erfolge::ERFOLGE_LISTE.length.to_s
end
@help_window = Window_Help.new(0, 0, 404)
@help_window.contents.clear
@help_window.set_text (text, 1)
@score_window = Window_ErfolgsScore.new(404, 0, 140, 56)
@erfolg_titel_window = Window_Erfolge.new(0, 56, 544, 275)
@erfolg_def_window = Window_ErfolgsBeschreibung.new(0, 331, 544, 85)
@erfolg_titel_window.active = true
end
def terminate
super
dispose_menu_background
@help_window.dispose
@score_window.dispose
@erfolg_titel_window.active = false
@erfolg_titel_window.dispose
@erfolg_def_window.dispose
end
def update
super
update_menu_background
@erfolg_titel_window.update
@erfolg_def_window.update
update_erfolg_def(@erfolg_titel_window.index)
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = @scene.new()
end
end
def update_erfolg_def(id)
id += 1
if (MK3::Erfolge::GEHEIME_BESCHREIBUNG.include?(id) or MK3::Erfolge::Geheime_Erfolge.include?(id)) and !$Erfolge_erhalten.include?(id)
text = MK3::Erfolge::GEHEIM_BESCHREIBUNG
else
erfolg = MK3::Erfolge::ERFOLGE_LISTE[id]
text = erfolg[1]
end
@erfolg_def_window.contents.clear
@erfolg_def_window.create_contents
y = 0
txsize = 24
nwidth = 512
buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
lines = buf.split(/(?:[|]|\\n)/i)
lines.each_with_index { |l, i|
l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
@erfolg_def_window.contents.draw_text(0, i * txsize + y, nwidth, 24, l, 0)
}
end
end
Level up
[code]#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ? ????????? - KGC_DistributeParameter ? VX ?
#_/ ? Last update : 2008/02/23 ?
#_/ Criador:KGC Softwares
#_/ Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/ Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# Customização
#==============================================================================
module KGC
module DistributeParameter
#~ Defina do seguinte modo
#~ :maxhp => [1, 30, 50]
#~ :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
GAIN_PARAMETER = {
:maxhp => [1, 30, 500], # MaxHP
:maxmp => [1, 3, 500], # MaxMP
:atk => [1, 2, 500], # ???
:def => [1, 2, 500], # ???
:spi => [1, 2, 500], # ???
:agi => [1, 2, 500], # ???
:hit => [3, 1, 200], # ???
:eva => [3, 1, 200], # ???
:cri => [3, 1, 200], # ???????
} # ? ?? } ????????
# ? RP (Reinforce Point) ???
VOCAB_RP = "Punkte"
# ? RP ??? (?)
VOCAB_RP_A = "Kosten"
#~ Pontos para distribuir
#~ ao aumentar de level
GAIN_RP_EXP = "3"
# ????? 10% + 1 ???????
# GAIN_RP_EXP = "level / 10 + 1"
#~ Vocabulario
VOCAB_PARAM = {
:hit => "Schlag", # ???
:eva => "Fliehen/Ausweihen", # ???
:cri => "Kritische Schläge", # ???????
}
DISTRIBUTE_SCENE_CAPTION = ""
#~ Cores para a barrinha
#~
#~ Quando estiver enchendo
GAUGE_START_COLOR = 28
#~ Quando estiver cheia
GAUGE_END_COLOR = 29
#~ Vai pararecer no menu?
USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
# ? ?????????????????????????
VOCAB_MENU_DISTRIBUTE_PARAMETER = "Level up Punkte"
#~ Pode retirar pontos?
ENABLE_REVERSE_DISTRIBUTE = true
end
end
#???????????????????????????????????????
$imported = {} if $imported == nil
$imported["DistributeParameter"] = true
module KGC::DistributeParameter
# ???????????
PARAMS = [:maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :cri]
end
#???????????????????????????????????????
#==============================================================================
# ? Vocab
#==============================================================================
module Vocab
# ???
def self.hit
return KGC::DistributeParameter::VOCAB_PARAM[:hit]
end
# ???
def self.eva
return KGC::DistributeParameter::VOCAB_PARAM[:eva]
end
# ???????
def self.cri
return KGC::DistributeParameter::VOCAB_PARAM[:cri]
end
# RP
def self.rp
return KGC::DistributeParameter::VOCAB_RP
end
# RP (?)
def self.rp_a
return KGC::DistributeParameter::VOCAB_RP_A
end
# ?????????
def self.distribute_parameter
return KGC::DistributeParameter::VOCAB_MENU_DISTRIBUTE_PARAMETER
end
end
#???????????????????????????????????????
#==============================================================================
# ? KGC::Commands
#==============================================================================
module KGC::Commands
module_function
#--------------------------------------------------------------------------
# ? ???????????????????
#--------------------------------------------------------------------------
def check_distribution_values
(1...$data_actors.size).each { |i|
$game_actors.check_distribution_values
}
end
#--------------------------------------------------------------------------
# ? RP ???
# actor_id : ???? ID
# value : ???
#--------------------------------------------------------------------------
def gain_rp(actor_id, value)
actor = $game_actors[actor_id]
return if actor == nil
actor.gain_rp(value)
end
#--------------------------------------------------------------------------
# ? ????????????????
# actor_index : ??????????
#--------------------------------------------------------------------------
def call_distribute_parameter(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :distribute_parameter
$game_temp.next_scene_actor_index = actor_index
end
end
class Game_Interpreter
include KGC::Commands
end
#???????????????????????????????????????
#==============================================================================
# ? Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ? ?????????????
#--------------------------------------------------------------------------
alias clear_extra_values_KGC_DistributeParameter clear_extra_values
def clear_extra_values
clear_extra_values_KGC_DistributeParameter
clear_distribution_values
end
#--------------------------------------------------------------------------
# ? ??????????????????
#--------------------------------------------------------------------------
def clear_distribution_values
@distributed_count = {}
KGC::DistributeParameter::PARAMS.each { |param|
@distributed_count[param] = 0
}
end
#--------------------------------------------------------------------------
# ? ???????????????????
#--------------------------------------------------------------------------
def check_distribution_values
last_distributed_count = @distributed_count
clear_distribution_values
@distributed_count = last_distributed_count if last_distributed_count != nil
end
end
#???????????????????????????????????????
#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ??????
# actor_id : ???? ID
#--------------------------------------------------------------------------
alias setup_KGC_DistributeParameter setup
def setup(actor_id)
setup_KGC_DistributeParameter(actor_id)
@rp = calc_init_rp
end
#--------------------------------------------------------------------------
# ? ?????????????
# param : ?????? Symbol
#--------------------------------------------------------------------------
def distributed_param(param)
n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
return n * distributed_count(param)
end
#--------------------------------------------------------------------------
# ? ?? MaxHP ???
#--------------------------------------------------------------------------
alias base_maxhp_KGC_DistributeParameter base_maxhp
def base_maxhp
n = base_maxhp_KGC_DistributeParameter + distributed_param(:maxhp)
return n
end
#--------------------------------------------------------------------------
# ? ?? MaxMP ???
#--------------------------------------------------------------------------
alias base_maxmp_KGC_DistributeParameter base_maxmp
def base_maxmp
n = base_maxmp_KGC_DistributeParameter + distributed_param(:maxmp)
return n
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_atk_KGC_DistributeParameter base_atk
def base_atk
n = base_atk_KGC_DistributeParameter + distributed_param(:atk)
return n
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_def_KGC_DistributeParameter base_def
def base_def
n = base_def_KGC_DistributeParameter + distributed_param(:def)
return n
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_spi_KGC_DistributeParameter base_spi
def base_spi
n = base_spi_KGC_DistributeParameter + distributed_param(:spi)
return n
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
alias base_agi_KGC_DistributeParameter base_agi
def base_agi
n = base_agi_KGC_DistributeParameter + distributed_param(:agi)
return n
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias hit_KGC_DistributeParameter hit
def hit
n = hit_KGC_DistributeParameter + distributed_param(:hit)
return n
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias eva_KGC_DistributeParameter eva
def eva
n = eva_KGC_DistributeParameter + distributed_param(:eva)
return n
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
alias cri_KGC_DistributeParameter cri
def cri
n = cri_KGC_DistributeParameter + distributed_param(:cri)
return n
end
#--------------------------------------------------------------------------
# ? RP ???
#--------------------------------------------------------------------------
def rp
@rp = calc_init_rp if @rp == nil
return @rp
end
#--------------------------------------------------------------------------
# ? RP ??????
#--------------------------------------------------------------------------
def calc_init_rp
n = 0
rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
(1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
return n
end
#--------------------------------------------------------------------------
# ? ?????????
# param : ?????????? (Symbol)
#--------------------------------------------------------------------------
def distributed_count(param)
clear_distribution_values if @distributed_count == nil
@distributed_count[param] = 0 if @distributed_count[param] == nil
return @distributed_count[param]
end
#--------------------------------------------------------------------------
# ? RP ???
# value : ???
#--------------------------------------------------------------------------
def gain_rp(value)
@rp = [self.rp + value, 0].max
end
#--------------------------------------------------------------------------
# ? ?????????
# param : ?????????? (Symbol)
# value : ???
#--------------------------------------------------------------------------
def gain_distributed_count(param, value = 1)
n = distributed_count(param)
@distributed_count[param] += value if n.is_a?(Integer)
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias level_up_KGC_DistributeParameter level_up
def level_up
level_up_KGC_DistributeParameter
gain_level_up_rp
end
#--------------------------------------------------------------------------
# ? ????????? RP ???
#--------------------------------------------------------------------------
def gain_level_up_rp
n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
gain_rp(n)
end
#--------------------------------------------------------------------------
# ? RP ?????????????
# param : ?????????? (Symbol)
# reverse : ??????? true
#--------------------------------------------------------------------------
def rp_growth_effect(param, reverse = false)
gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
return if gain == nil # ????????
if reverse
return if distributed_count(param) == 0 # ?????
else
return unless can_distribute?(param)
end
gain_rp(gain[0] * (reverse ? 1 : -1))
gain_distributed_count(param, reverse ? -1 : 1)
end
#--------------------------------------------------------------------------
# ? ?????????????
# param : ?????????? (Symbol)
#--------------------------------------------------------------------------
def can_distribute?(param)
gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
return false if gain == nil # ????????
return false if self.rp < gain[0] # RP ??
return false if gain[2] <= distributed_count(param) # ????
return true
end
end
#???????????????????????????????????????
#==============================================================================
# ? Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ? RP ???????
# actor : ????
#--------------------------------------------------------------------------
def rp_color(actor)
return (actor.rp == 0 ? knockout_color : normal_color)
end
#--------------------------------------------------------------------------
# ? ????????? 1 ???
#--------------------------------------------------------------------------
def distribute_gauge_color1
color = KGC::DistributeParameter::GAUGE_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ? ????????? 2 ???
#--------------------------------------------------------------------------
def distribute_gauge_color2
color = KGC::DistributeParameter::GAUGE_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ? RP ???
# actor : ????
# x : ??? X ??
# y : ??? Y ??
# width : ?
#--------------------------------------------------------------------------
def draw_actor_rp(actor, x, y, width = 120)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, WLH, Vocab::rp)
self.contents.font.color = rp_color(actor)
xr = x + width
self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# ? ??????????
# actor : ????
# param : ?????
# x : ??? X ??
# y : ??? Y ??
# width : ?
#--------------------------------------------------------------------------
def draw_actor_distribute_gauge(actor, param, x, y, width = 120)
gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
return if gain == nil
gw = width * actor.distributed_count(param) / [gain[2], 1].max
gc1 = distribute_gauge_color1
gc2 = distribute_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
end
#???????????????????????????????????????
#==============================================================================
# ? Window_Command
#==============================================================================
class Window_Command < Window_Selectable
unless method_defined?(:add_command)
#--------------------------------------------------------------------------
# ? ???????
# ?????????
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end
#???????????????????????????????????????
#==============================================================================
# ? Window_DistributeParameterActor
#------------------------------------------------------------------------------
# ????????????????????????????
#==============================================================================
class Window_DistributeParameterActor < Window_Base
#--------------------------------------------------------------------------
# ? ?????????
# x : ?????? X ??
# y : ?????? Y ??
# actor : ????
#--------------------------------------------------------------------------
def initialize(x, y, actor)
super(x, y, Graphics.width, WLH + 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_rp(@actor, 240, 0, 80)
end
end
#???????????????????????????????????????
#==============================================================================
# ? Window_DistributeParameterList
#------------------------------------------------------------------------------
# ???????????????????????????????
#==============================================================================
class Window_DistributeParameterList < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????
# actor : ????
#--------------------------------------------------------------------------
def initialize(actor)
off_h = (WLH + 32) * 2
super(0, off_h, Graphics.width / 2 + 80, Graphics.height - off_h)
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ? ?????????? Symbol ???
#--------------------------------------------------------------------------
def parameter_symbol
return @data[self.index]
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
@data = []
gain_params = KGC::DistributeParameter::GAIN_PARAMETER
KGC::DistributeParameter::PARAMS.each { |param|
next if gain_params[param] == nil
@data << param
}
@item_max = @data.size
create_contents
draw_caption
@item_max.times { |i| draw_item(i, @actor.can_distribute?(@data)) }
end
#--------------------------------------------------------------------------
# ? ????????????
# index : ????
#--------------------------------------------------------------------------
def item_rect(index)
rect = super(index)
rect.y += WLH
return rect
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def draw_caption
self.contents.font.color = system_color
self.contents.draw_text( 4, 0, 96, WLH, "Parameter")
self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
self.contents.draw_text(240, 0, 80, WLH, "Maximum", 2)
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# ? ?????
# index : ????
# enabled : ?????
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
draw_parameter(rect.x, rect.y, @data[index], enabled)
end
end
#--------------------------------------------------------------------------
# ? ??????
# x : ??? X ??
# y : ??? Y ??
# type : ??????
# enabled : ?????
#--------------------------------------------------------------------------
def draw_parameter(x, y, type, enabled)
case type
when :maxhp
name = Vocab.hp
when :maxmp
name = Vocab.mp
when :atk
name = Vocab.atk
when :def
name = Vocab.def
when :spi
name = Vocab.spi
when :agi
name = Vocab.agi
when :hit
name = Vocab.hit
when :eva
name = Vocab.eva
when :cri
name = Vocab.cri
else
return
end
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 4, y, 96, WLH, name)
gain = KGC::DistributeParameter::GAIN_PARAMETER[type]
self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
value = sprintf("%+d", gain[1])
self.contents.draw_text(x + 190, y, 40, WLH, value, 2)
value = sprintf("%3d/%3d", @actor.distributed_count(type), gain[2])
self.contents.draw_text(x + 236, y, 80, WLH, value, 2)
self.contents.font.color = normal_color
end
end
#???????????????????????????????????????
#==============================================================================
# ? Window_DistributeParameterStatus
#------------------------------------------------------------------------------
# ???????????????????????????????
#==============================================================================
class Window_DistributeParameterStatus < Window_Base
#--------------------------------------------------------------------------
# ? ?????????
# actor : ????
#--------------------------------------------------------------------------
def initialize(actor)
dx = Graphics.width / 2 + 80
off_h = (WLH + 32) * 2
super(dx, off_h, Graphics.width - dx, Graphics.height - off_h)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, width - 32, WLH, "Parameter", 1)
self.contents.font.color = normal_color
dy = WLH
gain_params = KGC::DistributeParameter::GAIN_PARAMETER
KGC::DistributeParameter::PARAMS.each { |param|
next if gain_params[param] == nil
draw_parameter(0, dy, param)
dy += WLH
}
end
#--------------------------------------------------------------------------
# ? ??????
# x : ??? X ??
# y : ??? Y ??
# type : ??????
#--------------------------------------------------------------------------
def draw_parameter(x, y, type)
case type
when :maxhp
name = Vocab.hp
value = @actor.maxhp
when :maxmp
name = Vocab.mp
value = @actor.maxmp
when :atk
name = Vocab.atk
value = @actor.atk
when :def
name = Vocab.def
value = @actor.def
when :spi
name = Vocab.spi
value = @actor.spi
when :agi
name = Vocab.agi
value = @actor.agi
when :hit
name = Vocab.hit
value = @actor.hit
when :eva
name = Vocab.eva
value = @actor.eva
when :cri
name = Vocab.cri
value = @actor.cri
else
return
end
draw_actor_distribute_gauge(@actor, type, x + 106, y, 48)
self.contents.font.color = system_color
self.contents.draw_text(x + 4, y, 96, WLH, name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 106, y, 48, WLH, value, 2)
end
end
#???????????????????????????????????????
#==============================================================================
# ? Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias update_scene_change_KGC_DistributeParameter update_scene_change
def update_scene_change
return if $game_player.moving? # ??????????
if $game_temp.next_scene == :distribute_parameter
call_distribute_parameter
return
end
update_scene_change_KGC_DistributeParameter
end
#--------------------------------------------------------------------------
# ? ?????????????????
#--------------------------------------------------------------------------
def call_distribute_parameter
$game_temp.next_scene = nil
$scene = Scene_DistributeParameter.new(
$game_temp.next_scene_actor_index,
0,
Scene_DistributeParameter::HOST_MAP)
end
end
#???????????????????????????????????????
#==============================================================================
# ? Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
if KGC::DistributeParameter::USE_MENU_DISTRIBUTE_PARAMETER_COMMAND
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
alias create_command_window_KGC_DistributeParameter create_command_window
def create_command_window
create_command_window_KGC_DistributeParameter
return if $imported["CustomMenuCommand"]
@__command_distribute_parameter_index =
@command_window.add_command(Vocab.distribute_parameter)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
@command_window.index = @menu_index
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias update_command_selection_KGC_DistributeParameter update_command_selection
def update_command_selection
call_distribute_parameter_flag = false
if Input.trigger?(Input::C)
case @command_window.index
when @__command_distribute_parameter_index # ?????????
call_distribute_parameter_flag = true
end
end
# ??????????????
if call_distribute_parameter_flag
if $game_party.members.size == 0
Sound.play_buzzer
return
end
Sound.play_decision
start_actor_selection
return
end
update_command_selection_KGC_DistributeParameter
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias update_actor_selection_KGC_DistributeParameter update_actor_selection
def update_actor_selection
if Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when @__command_distribute_parameter_index # ?????????
$scene = Scene_DistributeParameter.new(
@status_window.index,
@__command_distribute_parameter_index,
Scene_DistributeParameter::HOST_MENU)
return
end
end
update_actor_selection_KGC_DistributeParameter
end
end
#???????????????????????????????????????
#==============================================================================
# ? Scene_DistributeParameter
#------------------------------------------------------------------------------
# ???????????????????????
#==============================================================================
class Scene_DistributeParameter < Scene_Base