Kolejny dzisiaj skrypt
Skrypt do RPG Makera XP daje nam moĹźliwoĹÄ wiÄkszego wpĹywu na rozwĂłj bohaterĂłw.
Co ich poziom mamy do rozdysponowania okreĹlonÄ na poczÄ tku liczbÄ punktĂłw, za ktĂłre moĹźemy zwiÄkszaÄ ich statsy ^@^
MoĹźemy zwiÄkszaÄ im cztery gĹĂłwne statsy; czyli siĹÄ, inteligencjÄ, zrÄcznoĹÄ i szybkoĹÄ.
O punktach ktĂłre moĹźemy rozdaÄ informuje nas ikonka poziomu pokazujÄ ca siÄ na ekranie. MoĹźemy jÄ ofkors wyĹÄ czyÄ
def sum
result = 0
self.each {|i| result += i if i.is_a?(Numeric)}
return result
end
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
attr_reader :points
alias setup_sds_later setup
def setup(actor_id)
@points = BlizzCFG::STARTING_POINTS
setup_sds_later(actor_id)
end
alias exp_sds_later exp=
def exp=(exp)
old_level = @level
exp_sds_later(exp)
add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
end
def add_stat_points(val)
@points += val if val > 0
end
def remove_stat_points(val)
@points = [@points-val, 0].max
end
alias draw_actor_parameter_sds_later draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
if type == 7
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
else
draw_actor_parameter_sds_later(actor, x, y, type)
end
end
end
#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
attr_accessor :actor
def initialize(actor)
super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
@actor = actor
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
elsif $defaultfonttype != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
end
refresh
end
def remove_points(num)
if @points > 0 && @att[index] > 0
@points = [@points - num, 0].max
@att[index] = [@att[index] - num, 0].max
return true
end
return false
end
def update
super
return unless self.active
if Input.press?(Input::R)
if Input.repeat?(Input::RIGHT)
if add_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.press?(Input::L)
if Input.repeat?(Input::RIGHT)
if add_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.repeat?(Input::RIGHT)
if add_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
def update_cursor_rect
if @index < 0 || !self.active
self.cursor_rect.empty
else
self.cursor_rect.set(32, (@index+1)*64, 64, 32)
end
end
end
#====================================================================
class Window_Sure < Window_Command
#====================================================================
attr_accessor :actor
def update
if @command_window.active
@command_window.update
update_main_command
elsif @sure_window != nil
@sure_window.update
update_sure
elsif @distro_window.active
@distro_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active, @distro_window.active = true, false
end
end
end
def update_main_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @distro_window.points != 0
@command_window.index, @command_window.active = 3, false
make_sure_window
else
$scene = @scene.new
end
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 0 then @command_window.active, @distro_window.active = false, true
when 1
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 2
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 3
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
$scene = @scene.new
end
end
end
end
def update_sure
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@sure_window.dispose
@sure_window, @command_window.active = nil, true
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 1
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 2
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 3
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
$scene = @scene.new
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
end
end
end
end
#====================================================================
class Scene_Battle
#====================================================================
alias main_sds_later main
def main
main_sds_later
if BlizzCFG::AUTOMATIC_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
end
#====================================================================
class Scene_Map
#====================================================================
alias main_sds_later main
def main
main_sds_later
@notify.dispose if @notify != nil
end
alias upd_sds_later update
def update
check_icon if BlizzCFG::DISPLAY_ICON
upd_sds_later
if BlizzCFG::AUTOMATIC_MAP_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
def check_icon
if $game_party.actors.any? {|actor| actor.points > 0}
if @notify == nil
@notify = RPG::Sprite.new
end
end
#====================================================================
# www.ultimateam.pl
#====================================================================
Spoko skrypt. Widzialem juz kiedys podobny ale nie mozna bylo ustawic maxa dla statystyk. Dzienks, przyda sie na pewno ale znowu bede musial zmienic mechanike gry. Trudno :)
def sum
result = 0
self.each {|i| result += i if i.is_a?(Numeric)}
return result
end
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
attr_reader :points
alias setup_sds_later setup
def setup(actor_id)
@points = BlizzCFG::STARTING_POINTS
setup_sds_later(actor_id)
end
alias exp_sds_later exp=
def exp=(exp)
old_level = @level
exp_sds_later(exp)
add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
end
def add_stat_points(val)
@points += val if val > 0
end
def remove_stat_points(val)
@points = [@points-val, 0].max
end
alias draw_actor_parameter_sds_later draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
if type == 7
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
else
draw_actor_parameter_sds_later(actor, x, y, type)
end
end
end
#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
attr_accessor :actor
def initialize(actor)
super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
@actor = actor
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
elsif $defaultfonttype != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
end
refresh
end
def remove_points(num)
if @points > 0 && @att[index] > 0
@points = [@points - num, 0].max
@att[index] = [@att[index] - num, 0].max
return true
end
return false
end
def update
super
return unless self.active
if Input.press?(Input::R)
if Input.repeat?(Input::RIGHT)
if add_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.press?(Input::L)
if Input.repeat?(Input::RIGHT)
if add_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.repeat?(Input::RIGHT)
if add_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
def update_cursor_rect
if @index < 0 || !self.active
self.cursor_rect.empty
else
self.cursor_rect.set(32, (@index+1)*64, 64, 32)
end
end
end
#====================================================================
class Window_Sure < Window_Command
#====================================================================
attr_accessor :actor
def update
if @command_window.active
@command_window.update
update_main_command
elsif @sure_window != nil
@sure_window.update
update_sure
elsif @distro_window.active
@distro_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active, @distro_window.active = true, false
end
end
end
def update_main_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @distro_window.points != 0
@command_window.index, @command_window.active = 3, false
make_sure_window
else
$scene = @scene.new
end
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 0 then @command_window.active, @distro_window.active = false, true
when 1
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 2
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 3
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
$scene = @scene.new
end
end
end
end
def update_sure
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@sure_window.dispose
@sure_window, @command_window.active = nil, true
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 1
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 2
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 3
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
$scene = @scene.new
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
end
end
end
end
#====================================================================
class Scene_Battle
#====================================================================
alias main_sds_later main
def main
main_sds_later
if BlizzCFG::AUTOMATIC_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
end
#====================================================================
class Scene_Map
#====================================================================
alias main_sds_later main
def main
main_sds_later
@notify.dispose if @notify != nil
end
alias upd_sds_later update
def update
check_icon if BlizzCFG::DISPLAY_ICON
upd_sds_later
if BlizzCFG::AUTOMATIC_MAP_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
def check_icon
if $game_party.actors.any? {|actor| actor.points > 0}
if @notify == nil
@notify = RPG::Sprite.new
end
end
#====================================================================
# www.ultimateam.pl
#====================================================================
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Sro 30 Gru, 2009 20:56
To dlatego, Ĺźe zapis gry musi zawieraÄ skrypt... innymi sĹowy, dopiero po umieszczeniu skryptu powinieneĹ zapisaÄ grÄ, a wtedy bez problemu siÄ wczyta.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum