Ogłoszenie |
Administracja Forum
|
Zamknięty przez: Ayene Sro 28 Wrz, 2011 19:27 |
Prośba o skrypt z save'm. |
Autor |
Wiadomość |
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 21:08
|
|
Prośba o skrypt z save'm.
|
Chciałbym, aby w menu ( jak w trakcie gry wcisniemy ESC), aby nie było save'a. Widziałem już takie rzeczy na forum, jednak prosiłbym, aby skrypt działał z dzienniczkiem misji oraz z dodawaniem punktów co poziom. Po prostu korzystając z tamtych skryptów, to usuwało mi z menu dziennik misji i punkty co poziom, a zostawał zapis. Proszę o to jak najszybciej. Z góry dziękuje, o wszelkie pytania dotyczące mojego problemu proszę zgłaszac w tym temacie, bede sie starał jak najszybciej na nie odpowiedziec. Z góry dziękuję.
Olix. |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 21:32
|
|
|
Coś patrzyłem i próbowałem, spóbuję jeszcze raz i Cię poinformuje. :) |
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 21:50
|
|
|
Niestety, nic się nie dodaje,nic się nie odejmuje, ciągle jest tak samo, więc proszę o pomoc!! |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:04
|
|
|
Pewnie dlatego, że w innych skryptach masz fragmenty, które nadpisują klasę Scene_Menu. Znajdź je i usuń w dodatkowych skryptach, wtedy zacznij swoje modyfikacje |
________________________
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 22:17
|
|
|
Mógłbym prosic o to Ciebie?
Masz dwa skrypty, które są w menu , proszę wyślij mi gotowe. Obiecuje pomógł. ; )
Kod: | #==============================================================================
# Dziennik Misji / Quest Journal
# Author: modern algebra
# Tłumaczenie: Ayene
# www.ultimateam.pl
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instrukcja:
# Najważniejsza konfiguracja znajduje się w poniższym module. Może ona
# przyspożyć problemów. Wszelkie pytania proszę zgłaszać na forum
# [www.ultimateam.pl]
#
# Aktywacja misji odbywa się dzięki wywołaniu skryptu:
#
# $game_party.quests[id_misji]
#
# Istnieje kilka metod, które wymuszają konkretne działanie:
#
# $game_party.quests[id_misji].reveal_objective (id_zadania)
# $game_party.quests[id_misji].conceal_objective (id_zadania)
# $game_party.quests[id_misji].complete_objective (id_zadania)
# $game_party.quests[id_misji].uncomplete_objective (id_zadania)
# $game_party.quests[id_misji].fail_objective (id_zadania)
# $game_party.quests[id_misji].unfail_objective (id_zadania)
# $game_party.quests[id_misji].complete?
# $game_party.quests[id_misji].failed?
# $game_party.quests[id_misji].reward_given = true/false
# $game_party.quests[id_misji].concealed = true/false
# $game_party.quests.remove (id_misji)
#
# Są jeszcze inne metody, lecz najwązniejsze zostały wykazane powyżej.
# Z zasady kod reveal_objective powoduje, że przyporządkowane zadanie
# pojawia się w oknie Misji, zaś complete_objective - sprawia, że zadanie
# oznaczane jest jako zakończone. Logicznym zatem jest, że kod fail_objective
# oznakowuje zadanie jako nieudane.
#
# complete? - przyjmuje wartość true, gdy wszystkie wymagane zadania są spełnione
# failed? - przyjmuje wartość true, gdy któryś z wymaganych zadań jest nieudane.
#
# Zdarzenie z wynagrodzeniem za wykonanie misji można ułożyć według
# poniższego wzoru:
#
# @> Conditional Branch: Script: $game_party.quests[id_misji].complete?
# @> Conditional Branch: Script: $game_party.quests[id_misji].reward_given
# @> ...Dziękuję lub coś innego (po tym jak gracz otrzyma nagrodę).
# @> Else
# @> ...Daj nagrodę
# @> Script: $game_party.quests[id_misji].reward_given = true
# @> Branch End
# @> Branch End
#
#
# Można również zablokować dostęp do okna Misji wywołując skrypt:
# $game_system.quest_disabled = true
#
# Dostęp do okna misji można zmienić w dowolnym momencie gry:
#
# $game_system.quest_keyaccess = true / false # NA MAPIE
# $game_system.quest_menuaccess = true / false # W MENU
#
# Ponadto, dzięki komendzie \nq[id_misji] umieszczopnej w wiadomości, można
# wyświetlić nazwę misji.
#================================================================================
# *** Quest Data
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This is the configuration class for the Quest Journal
#================================================================================
module ModAlg_QuestData
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Constants
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Editable Region
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QUESTS_LABEL = 'Questy' # Nazwa okna, np. 'Misje'
ACTIVE_QUEST_ICON = 149 # ID ikony dla misji aktywnych
COMPLETE_QUEST_ICON = 150 # ID ikony dla misji zakończonych
FAILED_QUEST_ICON = 179 # ID ikony dla misji nieudanych
BULLET_CHARACTER = '●' # Punktator misji
ACTIVE_COLOUR = 0 # Kolor misji aktywnych
COMPLETE_COLOUR = 11 # Kolor misji zakończonych
FAILED_COLOUR = 18 # Kolor misji nieudanych
MENU_ACCESS = true # Wejście do okna przez Menu
MENU_INDEX = 4 # Jeśli true, to należy podać miejsce w menu
KEY_ACCESS = true # Wejście do okna po wciśnięciu przycisku
MAPKEY_BUTTON = Input::L # Jeśli true, to należy podać, jaki to przycisk
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Quest Data
#----------------------------------------------------------------------------
# Dane wzorcowe
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def self.quest_data (id)
objectives = []
name = '??????'
description = '??????????'
icon_index = 0
case id
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * POCZĄTEK KONFIGURACJI SKRYPTU
#------------------------------------------------------------------------
# Każda misja musi mieć przyporządkowane indywidualne ID.
#
# Ogólny wzór konfiguracji misji to:
#
# when <id_misji> # przyporządkuj konkretne ID (jakaś liczba)
# name = '<nazwa_misji>'
# description = '<opis_misji>'
# objectives[0] = '<pierwsze_zadanie>'
# ...
# objectives[n] = '<kolejne zadanie>'
# prime = [<id_zadania>, ..., <id_zadania>]
# icon_index = <id_ikony_dla_zadania>
#
# Powyższe parametry odpowiadają za:
# name to nazwa misji
# opis to krótka charakterystyka misji - najczęściej jej cel
# objective[0..n] poszczególne zadania w misji (jej części składowe)
# primes to wymagania, czyli które elementy misji muszą zostać wykonane,
# by została ona uznana za zakończoną.
# icon_index to ikonka przyporządkowana misji
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
when 1 # Pierwszy quest
name = 'Pierwszy quest'
description = 'Starzec tłumaczy Ci większosc rzeczy o grze!'
objectives[0] = 'Podejdź do pianina'
objectives[1] = 'Wróc do starca!'
objectives[2] = 'Popływaj statkiem'
objectives[3] = 'Połóż się spac!'
objectives[4] = 'Wróc do starca!'
objectives[5] = 'Przynieś pluszowego misia!'
objectives[6] = 'Wróc do starca!'
prime = [0, 1, 2, 3, 4, 5, 6]
icon_index = 137
when 2 # Żywiołowa legenda
name = 'Żywiołowa legenda'
description = 'Pomóz uratowac świat!'
objectives[0] = 'Znajdź,zabij żywioły i wróc do starca!'
prime = [0]
icon_index = 204
when 3 # Zanieczyszczony ogródek
name = 'Zanieczyszczony ogródek'
description = 'Pomóz starszej pani, zabij szczury w jej ogrodzie!'
objectives[0] = 'Zabij szczury i wróc do pani!'
prime = [0]
icon_index = 51
when 4 # Nieudana misja
name = 'Praca dla złodzieja'
description = 'Pomóż złodziejowi okraśc dom!'
objectives[0] = 'Idź do domu Burmistrza i ukradnij amulet!'
objectives[1] = 'Wróc do złodzieja(nie wyrzucaj amuletu)!'
prime = [0, 1]
icon_index = 136
when 5 # Dla mnie
name = 'Nauka'
description = 'Naucz małego Bartka kilku rzeczy'
objectives[0] = 'Naucz Bartka j.polskiego'
objectives[1] = 'Naucz Bartka matematyki'
objectives[2] = 'Wróc do nauczyciela'
objectives[3] = 'Czekaj na sprawdzenie testu'
prime = [0, 1, 2, 3]
icon_index = 176
when 6 # Dla mnie 2
name = 'Zagadkowy klucz'
description = 'Znajdź klucz dla dziewczynki'
objectives[0] = 'Znajdź klucz'
objectives[1] = 'Oddaj klucz dziewczynce'
prime = [0, 1]
icon_index = 83
when 7 # Dla mnie 3
name = 'Inny świat'
description = 'Aby wyjsc z tego świata musisz znaleźc kamień'
objectives[0] = 'Idź do portalu'
objectives[1] = 'Znajdź 1 połowę kamienia'
objectives[2] = 'Znajdź 2 połowę kamienia'
objectives[3] = 'Idź do kowala, złącz połówki'
objectives[4] = 'Czekaj na kowala'
objectives[5] = 'Wróc do świata'
prime = [0, 1, 2, 3, 4, 5]
icon_index = 85
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * KONIEC KONFIGURACJI SKRYPTU
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
return name, description, objectives, prime, icon_index
end
#============================================================================
# ** Quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Holds in-game data for a quest
#============================================================================
class Quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :name
attr_reader :id
attr_reader :description
attr_reader :objectives
attr_reader :prime_objectives
attr_reader :icon_index
attr_reader :revealed_objectives
attr_reader :complete_objectives
attr_reader :failed_objectives
attr_accessor :reward_given
attr_accessor :concealed
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize (id)
@id = id
@name, @description, @objectives, prime, @icon_index = ModAlg_QuestData.quest_data (id)
if prime.nil?
prime = []
for i in 0...@objectives.size
prime.push (i)
end
end
@prime_objectives = prime
@revealed_objectives = []
@complete_objectives = []
@failed_objectives = []
@reward_given = false
@concealed = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Reveal Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def reveal_objective (index)
return if index >= @objectives.size
@revealed_objectives |= [index]
@revealed_objectives.sort!
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Conceal Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def conceal_objective (index)
@revealed_objectives.delete (index)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Complete Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def complete_objective (index)
return if index >= @objectives.size
return if @failed_objectives.include? (index)
reveal_objective (index) unless @revealed_objectives.include? (index)
@complete_objectives |= [index]
@complete_objectives.sort!
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Uncomplete Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def uncomplete_objective (index)
@complete_objectives.delete (index)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fail Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def fail_objective (index)
return if index >= @objectives.size
reveal_objective (index) unless @revealed_objectives.include? (index)
@failed_objectives |= [index]
@failed_objectives.sort!
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Unfail Objective
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def unfail_objective (index)
@failed_objectives.delete (index)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Complete?
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def complete?
return (@complete_objectives & @prime_objectives) == @prime_objectives
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Failed?
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def failed?
return (@failed_objectives & @prime_objectives) != []
end
end
end
#==============================================================================
# ** Ellipse
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stores an ellipse object.
#==============================================================================
class Ellipse
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :a
attr_reader :b
attr_reader :x
attr_reader :y
attr_reader :h
attr_reader :k
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
# x : the top left x position
# y : the top left y position
# a : the width of oval from origin to the side
# b : the height of oval from origin. If nil, then a is radius of circle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize (x, y, a, b = nil)
@x = x
@y = y
@a = a
@b = b.nil? ? a : b
@h = x + a
@k = y + @b
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Within?
# x : the x coordinate being tested
# y : the y coordinate being tested
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def within? (x, y)
x_square = ((x - @h)*(x - @h)).to_f / (@a*@a)
y_square = ((y - @k)*(y - @k)).to_f / (@b*@b)
return (x_square + y_square) <= 1
end
end
#==============================================================================
# ** Bitmap
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This adds the methods fill_ellipse, outline_ellipse, and fill_rounded_rect
#==============================================================================
class Bitmap
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Outline Ellipse
# ellipse : the ellipse being drawn
# width : the width of the bar
# colour : the colour of the outline
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def outline_ellipse (ellipse, colour = font.color, width = 1, steps = 0)
a, b = ellipse.a, ellipse.b
steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
radian_modifier = (2*Math::PI) / steps
for i in 0...steps
t = (radian_modifier*i) % (2*Math::PI)
x = (ellipse.h + (a*Math.cos(t)))
y = (ellipse.k + (b*Math.sin(t)))
set_pixel (x, y, colour)
end
if width > 1
ellipse = Ellipse.new (ellipse.x + 1, ellipse.y + 1, ellipse.a - 1, ellipse.b - 1)
outline_ellipse (ellipse, colour, width - 1, steps)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fill Ellipse
# ellipse : the ellipse being drawn
# colour : the colour of the outline
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def fill_ellipse (ellipse, colour = font.color, steps = 0)
a, b = ellipse.a, ellipse.b
steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
radian_modifier = (2*Math::PI) / steps
for i in 0...(steps / 2)
t = (radian_modifier*i) % (2*Math::PI)
x = ellipse.h + (a*Math.cos(t))
y = ellipse.k - (b*Math.sin(t))
fill_rect (x, y, 1, 2*(ellipse.k - y), colour)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fill Rounded Rectangle
# rect : the rectangle being drawn
# colour : the colour of the outline
# w : the number of pixels to cover by rounding
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Used to fill a rectangle with rounded corners
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def fill_rounded_rect (rect, colour = font.color, w = 8)
fill_rect (rect.x + w, rect.y, rect.width - 2*w, rect.height, colour)
fill_rect (rect.x, rect.y + w, w, rect.height - 2*w, colour)
x = rect.x + rect.width - w
fill_rect (x, rect.y + w, w, rect.height - 2*w, colour)
circle = Ellipse.new (0, 0, w)
for i in 0...w
for j in 0...w
set_pixel (rect.x + i, rect.y + j, colour) if circle.within? (i, j)
set_pixel (rect.x + rect.width - w + i, rect.y + j, colour) if circle.within? (i + w, j)
set_pixel (rect.x + i, rect.y + rect.height - w + j, colour) if circle.within? (i, j + w)
set_pixel (rect.x + rect.width - w + i, rect.y + rect.height - w + j, colour) if circle.within? (i + w, j + w)
end
end
end
end
#==============================================================================
# ** Window_VarySizeHelp
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This window is the same as Window_Help, but with variable size
#==============================================================================
class Window_VarySizeHelp < Window_Help
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize (h_x = 0, h_y = 0, h_width = Graphics.width, h_height = WLH + 32)
super ()
self.x, self.y, self.width, self.height = h_x, h_y, h_width, h_height
contents.dispose
self.contents = Bitmap.new (h_width - 32, h_height - 32)
end
end
#==============================================================================
# ** Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new instance variables - quest_disabled, quest_keyaccess
# aliased method - initialize
#==============================================================================
class Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :quest_disabled # Can you access quest journal at this time
attr_accessor :quest_keyaccess # Is it accessible by key?
attr_accessor :quest_menuaccess # Is it accessible through the menu
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_qst_jrnl_system_init_quests initialize
def initialize
modalg_qst_jrnl_system_init_quests
@quest_disabled = false
@quest_keyaccess = ModAlg_QuestData::KEY_ACCESS
@quest_menuaccess = ModAlg_QuestData::MENU_ACCESS
end
end
#==============================================================================
# ** Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new instance variable - quests
# aliased method - initialize
#==============================================================================
class Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :quests
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_qst_jrnl_party_init_quests initialize
def initialize
modalg_qst_jrnl_party_init_quests
@quests = Game_Quests.new
end
end
#==============================================================================
# ** Game_Quests
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This class handles Quests. It is a wrapper for the built-in class "Hash".
# The instance of this class is accessed by $game_party.quests
#==============================================================================
class Game_Quests
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
@data = {}
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Quest
# quest_id : the ID of the quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def [] (quest_id)
@data[quest_id] = ModAlg_QuestData::Quest.new (quest_id) if @data[quest_id] == nil
return @data[quest_id]
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Quest List
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def list
quest_list = @data.values
quest_list.each { |i| quest_list.delete (i) if i.concealed }
return quest_list
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Completed Quest List
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def completed_list
complete_quests = []
list.each { |i| complete_quests.push (i) if i.complete? }
return complete_quests
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Failed Quest List
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def failed_list
failed_quests = []
list.each { |i| failed_quests.push (i) if i.failed? }
return failed_quests
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Active Quest List
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def active_list
return list - failed_list - completed_list
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Revealed?
# quest_id : the ID of a checked quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def revealed? (quest_id)
return @data[quest_id] != nil
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Remove Quest
# quest_id : the ID of a checked quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def remove (quest_id)
@data.delete (quest_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Clear
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def clear
@data.clear
end
end
#==============================================================================
# ** Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new instance variable - disabled_commands
# aliased method - initialize, draw_item
#==============================================================================
class Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :disabled_commands
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Initialize
# width : window width
# commands : command string array
# column_max : digit count (if 2 or more, horizontal selection)
# row_max : row count (0: match command count)
# spacing : blank space when items are arrange horizontally
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_jrnl_intlz initialize
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
@disabled_commands = []
modalg_quest_jrnl_intlz (width, commands, column_max, row_max, spacing)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_jrnl_itm_drw draw_item
def draw_item (index, enabled = true)
modalg_quest_jrnl_itm_drw (index, enabled)
enabled ? @disabled_commands.delete (index) : @disabled_commands.push (index)
end
end
#==============================================================================
# ** Window_Message
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliaed method - convert_special_characters
#==============================================================================
class Window_Message
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Convert Special Characters
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_jrnl_spec_char_convert convert_special_characters
def convert_special_characters
@text.gsub! (/\\NQ\[(\d+)\]/i) { $game_party.quests[$1.to_i] }
modalg_quest_jrnl_spec_char_convert
end
end
#==============================================================================
# ** Window_QuestLabel
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This window signifies that this is a quest list
#==============================================================================
class Window_QuestLabel < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
super (0, 0, 160 + WLH, 32 + WLH)
create_contents
contents.font.color = system_color
contents.draw_text (0, 0, contents.width, WLH, ModAlg_QuestData::QUESTS_LABEL, 1)
end
end
#==============================================================================
# ** Window_QuestCategory
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This window displays which category is being viewed
#==============================================================================
class Window_QuestCategory < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
super (0, WLH + 32, 160 + WLH, 64)
create_contents
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
# category_index : icon to highlight -
# 0 => All, 1 => Active, 2 => Complete, 3 => Failed
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh (category_index = 0)
contents.clear
bitmap = Cache.system("Iconset")
icon_index = ModAlg_QuestData::ACTIVE_QUEST_ICON
active_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
icon_index = ModAlg_QuestData::COMPLETE_QUEST_ICON
complete_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
icon_index = ModAlg_QuestData::FAILED_QUEST_ICON
failed_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
all_icon = Bitmap.new (40, 32)
all_icon.blt (0, 0, bitmap, complete_rect)
all_icon.blt (20, 0, bitmap, failed_rect)
all_icon.blt (8, 10, bitmap, active_rect)
distance = (contents.width - 112) / 3
x = 0
contents.blt (x, 0, all_icon, all_icon.rect, category_index == 0 ? 255 : 128)
x += 40 + distance
contents.blt (x, 4, bitmap, active_rect, category_index == 1 ? 255 : 128)
x += 24 + distance
contents.blt (x, 4, bitmap, complete_rect, category_index == 2 ? 255 : 128)
x += 24 + distance
contents.blt (x, 4, bitmap, failed_rect, category_index == 3 ? 255 : 128)
end
end
#==============================================================================
# ** Window_QuestList
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This window displays the list of quests
#==============================================================================
class Window_QuestList < Window_Selectable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize (category_index = 0, index = 0)
super (0, 64 + (WLH + 32), 160 + WLH, Graphics.height - 64 - 2*(WLH + 32))
@data = []
@column_max = 1
refresh (category_index)
self.index = index
self.active = true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Quest
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def quest
return @data[self.index]
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
# category_index : List to show -
# 0 => All, 1 => Active, 2 => Complete, 3 => Failed
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh (category_index = 0)
font = Font.new
@data.clear
self.index = 0
case category_index
when 0
@data = $game_party.quests.list
when 1
@data = $game_party.quests.active_list
font.color = text_color (ModAlg_QuestData::ACTIVE_COLOUR)
when 2
@data = $game_party.quests.completed_list
font.color = text_color (ModAlg_QuestData::COMPLETE_COLOUR)
when 3
@data = $game_party.quests.failed_list
font.color = text_color (ModAlg_QuestData::FAILED_COLOUR)
end
@item_max = @data.size
unless contents == nil
contents.clear
return if @data.empty?
contents.dispose
end
self.contents = Bitmap.new (width - 32, WLH*@data.size)
contents.font = font
for i in 0...@data.size
quest = @data[i]
if category_index == 0
if quest.complete?
contents.font.color = text_color (ModAlg_QuestData::COMPLETE_COLOUR)
elsif quest.failed?
contents.font.color = text_color (ModAlg_QuestData::FAILED_COLOUR)
else # Active
contents.font.color = text_color (ModAlg_QuestData::ACTIVE_COLOUR)
end
end
draw_icon (quest.icon_index, 0, i*WLH)
contents.draw_text (24, i*WLH, contents.width - 24, WLH, quest.name)
end
end
end
#==============================================================================
# ** Window_QuestInfo
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This window displays the information on the quest being viewed
#==============================================================================
class Window_QuestInfo < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
super (160 + WLH, 0, Graphics.width - (160 + WLH), Graphics.height - (32 + WLH))
create_contents
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh (quest = nil)
contents.clear
return if quest == nil
contents.font.color = normal_color
contents.draw_text (0, 0, contents.width, WLH, quest.name, 1)
if contents.text_size ('w').width == contents.text_size ('i').width
formatter = Paragrapher::Formatter_2.new
else
formatter = Paragrapher::Formatter.new
end
desc_bitmap = Bitmap.new (contents.width - 16, (2.4*WLH).to_i)
desc_bitmap.font.size -= 4
formatted_desc = formatter.format (quest.description, desc_bitmap)
box_height = [WLH*(formatted_desc.lines.size + 1), 3*WLH].min
rect = Rect.new (2, (1.5*WLH).to_i, contents.width - 4, box_height)
contents.fill_rounded_rect (rect, system_color, 10)
rect.x, rect.y = rect.x + 2, rect.y + 2
rect.width, rect.height = rect.width - 4, rect.height - 4
contents.fill_rounded_rect (rect, Color.new (0, 0, 0, 0), 10)
tw = contents.text_size ('Opis').width
contents.fill_rect (32, (1.5*WLH).to_i, tw + 4, 2, Color.new (0, 0, 0, 0))
contents.font.color = system_color
contents.draw_text (33, WLH, tw, WLH, 'Opis')
artist = Paragrapher::Artist.new
if formatted_desc.lines.size < 2
formatted_desc.bitmap = Bitmap.new (contents.width - 16, formatted_desc.lines.size*WLH)
formatted_desc.bitmap.font.size -= 4
end
bmp = artist.draw (formatted_desc)
y = rect.y + 4 + (rect.height - bmp.height) / 2
contents.blt (8, y, bmp, bmp.rect)
bmp.dispose
y = 2*WLH + rect.height + 4
contents.font.color = system_color
tw = contents.text_size ('Zadania').width
contents.draw_text (32, y, tw, WLH, 'Zadania')
y += WLH
quest.revealed_objectives.each { |i|
contents.font.color = quest.complete_objectives.include? (i) ?
text_color (ModAlg_QuestData::COMPLETE_COLOUR) : quest.failed_objectives.include? (i) ?
text_color (ModAlg_QuestData::FAILED_COLOUR) : text_color (ModAlg_QuestData::ACTIVE_COLOUR)
objective = quest.objectives[i]
tw = contents.text_size (ModAlg_QuestData::BULLET_CHARACTER).width
x = 8
contents.draw_text (x, y, tw, WLH, ModAlg_QuestData::BULLET_CHARACTER)
x += tw + 4
obj_bitmap = Bitmap.new (contents.width - x, 2*WLH)
obj_bitmap.font = contents.font
obj_bitmap.font.size -= 4
formatted_obj = formatter.format (objective, obj_bitmap)
bmp = artist.draw (formatted_obj)
contents.blt (x, y + 4, bmp, bmp.rect)
y += WLH*([formatted_obj.lines.size, 2].min)
}
end
end
#==============================================================================
# ** Scene_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased method - update
#==============================================================================
class Scene_Map < Scene_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_journal_map_upd_key_access update
def update
modalg_quest_journal_map_upd_key_access
if $game_system.quest_keyaccess && !$game_system.quest_disabled && !$game_party.quests.list.empty?
$scene = Scene_Quest.new if Input.trigger? (ModAlg_QuestData::MAPKEY_BUTTON)
end
end
end
#==============================================================================
# ** Scene_Menu
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased methods - initialize, create_command_window, update_command_selection
#==============================================================================
class Scene_Menu < Scene_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
# menu_index : command cursor's initial position
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_jrnl_init initialize
def initialize(menu_index = 0)
modalg_quest_jrnl_init (menu_index)
return unless $game_system.quest_menuaccess
if @menu_index == 'Quest'
@menu_index = ModAlg_QuestData::MENU_INDEX
elsif @menu_index >= ModAlg_QuestData::MENU_INDEX
@menu_index += 1
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Command Window
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_journal_menu_cmmnd_win_create create_command_window
def create_command_window
modalg_quest_journal_menu_cmmnd_win_create
return unless $game_system.quest_menuaccess
c = @command_window.commands
c.insert (ModAlg_QuestData::MENU_INDEX, ModAlg_QuestData::QUESTS_LABEL)
width = @command_window.width
disabled = @command_window.disabled_commands
@command_window.dispose
@command_window = Window_Command.new(width, c)
@command_window.index = @menu_index
disabled.each { |i|
i += 1 if i >= ModAlg_QuestData::MENU_INDEX
@command_window.draw_item (i, false)
}
if $game_system.quest_disabled || $game_party.quests.list.empty?
@command_window.draw_item (ModAlg_QuestData::MENU_INDEX, false)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Command Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_journal_menu_cmmnd_select_upd update_command_selection
def update_command_selection
if $game_system.quest_menuaccess
changed = false
if @command_window.index == ModAlg_QuestData::MENU_INDEX && Input.trigger? (Input::C)
if $game_system.quest_disabled || $game_party.quests.list.empty?
Sound.play_buzzer
else
Sound.play_decision
$scene = Scene_Quest.new
end
return
end
if @command_window.index > ModAlg_QuestData::MENU_INDEX
@command_window.index = (@command_window.index - 1) % @command_window.commands.size
changed = true
end
end
modalg_quest_journal_menu_cmmnd_select_upd
return unless $game_system.quest_menuaccess
@command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Actor Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_quest_jrnl_actor_selection_upd update_actor_selection
def update_actor_selection
changed = false
if $game_system.quest_menuaccess && @command_window.index > ModAlg_QuestData::MENU_INDEX
@command_window.index = (@command_window.index - 1) % @command_window.commands.size
changed = true
end
modalg_quest_jrnl_actor_selection_upd
return unless $game_system.quest_menuaccess
@command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
end
end
#==============================================================================
# ** Scene_Quest
#------------------------------------------------------------------------------
# This class performs the quest screen processing.
#==============================================================================
class Scene_Quest < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(category_index = 0, quest_index = 0)
@category_index = category_index
@quest_index = quest_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@label_window = Window_QuestLabel.new
@category_window = Window_QuestCategory.new
@category_window.refresh (@category_index)
@list_window = Window_QuestList.new (@category_index, @quest_index)
@info_window = Window_QuestInfo.new
@info_window.refresh (@list_window.quest)
@help_window = Window_VarySizeHelp.new
@help_window.y = Graphics.height - @help_window.height
@help_window.set_text ('Użyj poziomych strzałek, by zmienić kategorię', 1)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@label_window.dispose
@category_window.dispose
@list_window.dispose
@info_window.dispose
@help_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@list_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
if $game_system.quest_menuaccess
$scene = Scene_Menu.new ('Quest')
else
$scene = Scene_Map.new
end
elsif Input.trigger? (Input::C)
elsif Input.trigger? (Input::LEFT)
Sound.play_cursor
@category_index = (@category_index - 1) % 4
@category_window.refresh (@category_index)
@list_window.refresh (@category_index)
@info_window.refresh (@list_window.quest)
elsif Input.trigger? (Input::RIGHT)
Sound.play_cursor
@category_index = (@category_index + 1) % 4
@category_window.refresh (@category_index)
@list_window.refresh (@category_index)
@info_window.refresh (@list_window.quest)
elsif Input.trigger? (Input::DOWN) || Input.trigger? (Input::UP)
@info_window.refresh (@list_window.quest)
end
end
end |
I drugi:
Kod: | #==============================================================================
# Requiem Upgrade
#==============================================================================
Points_Gained = 1 # Points that hero will gain when level-up
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
attr_accessor :points
alias requiem_upgwnd_initialize initialize
alias requiem_upgwnd_lvlup level_up
def initialize(actor_id)
requiem_upgwnd_initialize(actor_id)
@points = 0
end
def level_up
requiem_upgwnd_lvlup
@points += Points_Gained
end
end
#------------------------------------------------------------------------------
class Requiem_UpgradeWindow < Window_Base
def initialize(actor)
super(0,0,320,320)
@actor = actor
update
end
def update
self.contents.clear
draw_actor_face(@actor,0,0,92)
draw_actor_name(@actor,160,0)
self.contents.font.color = normal_color
self.contents.draw_text(224,32,64,WLH,@actor.level)
self.contents.draw_text(224,24*2,64,WLH,@actor.points)
self.contents.draw_text(128,24*5,96,WLH,@actor.maxhp)
self.contents.draw_text(128,24*6,96,WLH,@actor.maxmp)
self.contents.draw_text(128,24*7,96,WLH,@actor.atk)
self.contents.draw_text(128,24*8,96,WLH,@actor.def)
self.contents.draw_text(128,24*9,96,WLH,@actor.spi)
self.contents.draw_text(128,24*10,96,WLH,@actor.agi)
refresh
end
def refresh
self.contents.font.color = system_color
self.contents.draw_text(128,32,128,WLH,Vocab::level+":")
self.contents.draw_text(128,24*2,128,WLH,"Punkty:")
self.contents.draw_text(0,24*5,128,WLH,Vocab::hp_a+":")
self.contents.draw_text(0,24*6,128,WLH,Vocab::mp_a+":")
self.contents.draw_text(0,24*7,128,WLH,Vocab::atk+":")
self.contents.draw_text(0,24*8,128,WLH,Vocab::def+":")
self.contents.draw_text(0,24*9,128,WLH,Vocab::spi+":")
self.contents.draw_text(0,24*10,128,WLH,Vocab::agi+":")
end
end
#------------------------------------------------------------------------------
class Scene_RequiemUpgrade < Scene_Base
def initialize(actor_index=0, from_menu=false)
create_menu_background
@actor_index = actor_index
@from_menu = from_menu
end
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
@requiem_upgwindow.x = (544 - @requiem_upgwindow.width) / 2
@requiem_upgwindow.y = (416 - @requiem_upgwindow.height) / 2
@requiem_upgcmdwnd = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
@requiem_upgcmdwnd.index = 0
@requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
@requiem_upgcmdwnd.y = @requiem_upgwindow.y + 120
@requiem_upgcmdwnd.opacity = 0
end
def update
super
update_menu_background
@requiem_upgwindow.update
@requiem_upgcmdwnd.update
if Input.trigger?(Input::B)
Sound.play_cancel
if @from_menu
$scene = Scene_Menu.new(4)
else
$scene = Scene_Map.new
end
elsif Input.trigger?(Input::C)
if @actor.points > 0
Sound.play_decision
else
Sound.play_buzzer
return
end
case @requiem_upgcmdwnd.index
when 0
@actor.points -= 1
@actor.maxhp += 5
when 1
@actor.points -= 1
@actor.maxmp += 5
when 2
@actor.points -= 1
@actor.atk += 1
when 3
@actor.points -= 1
@actor.def += 1
when 4
@actor.points -= 1
@actor.spi += 1
when 5
@actor.points -= 1
@actor.agi += 1
end
end
end
def terminate
super
dispose_menu_background
@requiem_upgwindow.dispose
@requiem_upgcmdwnd.dispose
end
end
#------------------------------------------------------------------------------
class Scene_Menu < Scene_Base
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Dodaj punkty"
s6 = Vocab::save
s7 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
@command_window.index = @menu_index
if $game_party.members.size == 0
@command_window.draw_item(0, false)
@command_window.draw_item(1, false)
@command_window.draw_item(2, false)
@command_window.draw_item(3, false)
end
if $game_system.save_disabled
@command_window.draw_item(4, false)
end
end
def update_command_selection
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
case @command_window.index
when 0
$scene = Scene_Item.new
when 1,2,3,4
start_actor_selection
when 5
$scene = Scene_File.new(true, false, false)
when 6
$scene = Scene_End.new
end
end
end
def 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
case @command_window.index
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
when 4
$scene = Scene_RequiemUpgrade.new(@status_window.index,true)
end
end
end
end
#------------------------------------------------------------------------------
class Scene_File < Scene_Base
def return_scene
if @from_title
$scene = Scene_Title.new
elsif @from_event
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(5)
end
end
end
#------------------------------------------------------------------------------
class Scene_End < Scene_Base
def return_scene
$scene = Scene_Menu.new(6)
end
end |
Z góry dziękuję. ; ) |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:23
|
|
|
A próbowałeś Dziennik Misji przesunąć pod skrypt na rozdawanie punktów? |
________________________
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 22:27
|
|
|
Naprawdę jestem zielony, nic nie rozuiem, początkujący jestem, bez żadnej pomocy nic nie zdziałam, musisz i lepiej wytłumaczyc lub pokazac, bo nie zrozumiem. |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:31
|
|
|
Zapytałam o kolejność skryptów nad Main. Gdy wklejasz je do edytora skryptów, masz osobne zakładki, czy Dziennik Misji jest u Ciebie pod czy nad skryptem na rozdawanie punktów? Innymi słowy, czy jest bliżej czy dalej Main? |
________________________
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 22:39
|
|
|
Dziennik jest pod punktami, czyli jest dalej main, więc co mam zrobic? |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:43
|
|
|
Nie, dziennik skoro jest pod punktami to jest bliżej Main, bo Main powinieneś mieć na samym dole Poszukaj na forum, już niejednokrotnie była prośba o dostosowanie menu. Sprawdź to http://www.ultimateam.pl/...scene_quest.new |
________________________
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 22:45
|
|
|
Dobrze mowisz wszystko mam jak trzeba, to mój błąd. ; ) Dziennik jest blizej menu, więc co teraz? Przerobisz dla mnie te skrypty, tzn usuniesz to Scene_Menu, czy co? |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:46
|
|
|
Dałam Tobie u góry rozwiązanie, przyjrzyj się dokładniej |
________________________
|
|
|
|
Olix
Preferowany:
Dołączył: 14 Sty 2011 Posty: 13 Skąd: Z Klina
|
Wysłany: Wto 27 Wrz, 2011 22:52
|
|
|
A do tego jeszcze musze zrobic to co dalas na poczatku, czyli usuniecie save'a?
Oczywiscie dostajesz ,,Pomogła''
Dzieki, ja lece, pa. ; ) |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 27 Wrz, 2011 22:53
|
|
|
Tak, ale na pewno dasz sobie radę |
________________________
|
|
|
|
|
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
|
Dodaj temat do Ulubionych Wersja do druku
|
|