(Credits by Vlad)
Ja! Das neue Action Battle System ist draußen.
Für die beste Benutzung empfehle ich, die Demo als Schablone für ein Neues Spiel zu benutzen.
Dann vielleicht die Maps übertragen und die Kämpfe halt so umändern, dass die Events halt die Gegner sind.
So nun kommen wir zum Tutorial für Leute die besser deutsch lesen als englisch und die Kommentare im Skript auch nicht lesen ;)
Die Kreierung eines neuen Gegners:
Um einen Gegner zu erstellen, macht ihr folgende Kommentare bei einem Event auf der Map.
Enemy X - Ersetzt X mit der ID des Gegners, den der Feind trägt wie zum beispiel Enemy 1 dann habt ihr einen gegner mit der Stärke eines Slimes;
Die Erase - Löscht das Event wenn Gegner besiegt;
Die Self Switch A - Wenn Gegner besiegt, wird Self Switch A aktiviert;
Die Self Switch B - Wenn Gegner besiegt, wird Self Switch B aktiviert;
Die Self Switch C - Wenn Gegner besiegt, wird Self Switch C aktiviert;
Die Self Switch D - Wenn Gegner besiegt, wird Self Switch D aktiviert;
Die Switch X - Ersetzt X mit der ID des Switches der nach dem ''Tot'' des Gegners aktiviert wird(NICHT NAME);
Die Variable X - Ersetzt X mit der ID der Variable die +1 bekommt;
(Für den Rest werde ich nicht mehr erklären, was X bedeutet!)
Follow X - Gegner geht selber zum Spieler und greift ihn automatisch an, wenn die Länge vom Event bis zum Spieler X Tiles lang ist(Meistens wichtig, da sich der Gegner sonst nicht bewegt);
Kill With Weapon X - Gegner kann nur ''sterben'' wenn mit einer Waffe attackiert, die die ID X trägt;
Kill With Skill X - Gegner kann nur ''sterben'' wenn mit einem Skill attackiert, der die ID X trägt;
Kill With Item X - Gegner kann nur ''sterben'' wenn mit einem Item attackiert, das die ID X trägt;
Object - Der Gegner wird zu einem Objekt und dadurch unsterblich
Puzzle - Gegner wird zu einem Puzzle, sodass die HP anzeige nicht angezeigt wird, die dann meistens 1 und die Ausweichchancen sollten auf 0 sein, und dadurch kann man diesen Gegner zu einem Schalter oder so machen, wenn man ihn angreift(Bei Kombinationen mit Switch);
Respawn X - Bei Parkour-artigen Maps meistens ungebrauchbar da der Gegner dann nach X Frames wieder erscheint. am selben Platz, an dem er getötet wurde;
Boss - Die HP Anzeige des gegners wird oben ganz Groß auf dem Bildschirm angezeigt.
Screenshot zum Bosskampf: (http://i43.tinypic.com/jkf251.jpg)
So da wir nun mit den Comments fertig sind, gehen wir zu den Notes von Items, Skills, Weapons, Armors und Enemies über.
Leider ist dieser Teil auf Englisch, da ich es dann nicht zu übersetzen bräuchte sondern einfach nur kopieren und einfügen ^^:
That commands, you need put on NOTES of skills, items, weapons, armors and states.
The script makes the remains.
Commands valids for skills, weapons and items:
Ranged (That command says to script, that weapon, skill or item is ranged)
Graphic = X (Change X for character name, default is nil)
Index = X (Change X for character index, default is 0)
Speed = X (Change X for movement speed of projectile, default is 4)
Range = X (Change X for distance that percorred for the projectile, default is 5)
Delay = X (Change X for delay of projectile, default is 60)
Shot SE = X (Change X for SE name that is playerd when attack, default is nil)
Commands valids only for Skills and Items:
Explosive (That command, says to script, that is a skill or item explosive)
Area = X (Change X for area (in tiles) that explosion affects the enemies, default is 3)
Command valid only for items:
Bomb (This command says to script, that item is a bomb)
Commands valids only for weapons:
Combo Hits = X (Change X for number of hits needed to gets a combo damage, default is 5)
Combo Rate = X (Change X for % of chance to get a combo damage, default is 75%)
Ammo1 = X (Change X for ID of item that is ammunition 1, default is nil)
Ammo2 = X (Change X for ID of item that is ammunition 2, default is nil)
Commands valids only for armors:
Defense Rate = X (Change X for defense rate (in %) that shield block attacks for enemies, default is 50%)
Commands valids only for states:
Animation = X (Change X for a animation id of state, default is 0)
Walk Slower (That command says to script, that skill makes player or enemy walk slower)
Walk Faster (That command says to script, that skill makes player or enemy walk faster)
Don't Walk (That command says to script, that skill makes player or enemy don't walk)
Duration = X (Change X for duration (in frames) that actor stay infected, default is 300)
Commands valids only for enemies:
Attack Animation = X (Change X to ID of animation for attack of enemy)
Die Animation = X (Change X to ID of animation that will showed when enemy dies)
Die SE = X (Change X to a SE name that will played when enemy dies)
Weapon Icon = X (Change X for the Index of a icon that be showed like a weapon when enemy attack)
Shield Icon = X (Change X for the Index of icon that will be showed like a shield when enemy defend)
Defense Rate = X (Change X to defense rate (in %) of the enemy, default is 50%)
Die Hauptaktionstasten sind a und s. Falls ein Schwert equipped ist, wird A für Angriff und S für Block sein, bei einem Bogen A Für Munition 1 und S für Benutzung von Munition 2 (Wie zum Beispiel A für normale Pfeile und B für explosive Pfeile)
DOWNLOAD
http://www.megaupload.com/?d=M3C1BY13 (http://www.megaupload.com/?d=M3C1BY13)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
AddOns
Die FOlgenden AddOn Scripts können nur kompatibel werden, wird das Script ''Requim Masterpiece'' benötigt.
Dieses Script ist jedoch schon in der Demo dabei. Falls ihr aber lieber mit dem Original Battle System oder dem SKS arbeitet, könnt ihr es gerne einfügen(Nur Masterpiece ist in der Demo enthalten, und das HUD, der Rest NICHT:
#==============================================================================
# Requiem Masterpiece
#==============================================================================
# This module is necessary to activate and enhance compatibility of all Requiem's Scripts
#------------------------------------------------------------------------------
module Requiem_Masterpiece
Version = 1.1
@scripts = {}
@warnings = {}
def self.register(script, version, date)
@scripts[script] = [version, date]
end
def self.enabled?(script, version = nil)
if version != nil and @scripts.include?(script)
if @scripts[script][0] >= version
return true
elsif @warnings[script].nil?
print "'#{script}' is obsolete.\r\nSome functions won't work correctly"
@warnings[script] = ["is obsolete"]
self.write_log
end
end
return true if @scripts[script] != nil
if @scripts[script].nil? and $TEST and @warnings[script].nil?
print "Unable to find script '#{script}' or it is placed in wrong place.\r\nSome functions won't work correctly"
@warnings[script] = ["Unable to find"]
self.write_log
end
return false
end
def self.show_scripts(alert=true)
list = "Requiem Scripts [#{@scripts.size}]:\r\n\r\n"
@scripts.each { |key, value| list += "#{key.gsub("Requiem ", "")} #{value[0]} #{value[1]}\r\n" }
list += "\r\nWarnings:\r\n" if @warnings != {}
@warnings.each { |key, value| list += "#{key} #{value}\r\n" }
return print list if alert
return list
end
def self.write_log
file = File.new("Requiem_Log-#{Time.now.strftime("%m_%d_%Y")}.txt", "wb")
file.write(self.show_scripts(false))
file.close
end
end
So nun kommen wir zu den AddOns:
8-Dir Movement (Ihr könnt in alle 8 richtungen Laufen)
#==============================================================================
# Requiem 8 Dir Movement
#==============================================================================
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem 8 Dir Mov", 1.0, "04/02/2009")
#------------------------------------------------------------------------------
class Game_Player < Game_Character
def move_by_input
if Requiem_Masterpiece.enabled?("Requiem ABS")
return if self.freeze or (self.anime_attack/2) > 0
end
return unless movable?
return if $game_map.interpreter.running?
case Input.dir8
when 1
move_lower_left
when 2
move_down
when 3
move_lower_right
when 4
move_left
when 6
move_right
when 7
move_upper_left
when 8
move_up
when 9
move_upper_right
end
end
end
Advanced Message:
#==============================================================================
# Requiem Requiem Advanced Message
#==============================================================================
Name_Window_Font_Name = Font.default_name # Font Name of the name window
=begin
\D[X] - Shows text in X speed
\E[X] - Shows enemy X name
\I[X] - Shows the name and icon of X item
\W[X] - Shows the name and icon of X weapon
\A[X] - Shows the name and icon of X armor
\S[X] - Shows the name and icon of X skill
\SE[X] - Plays the SE X
\FN[X] - Changes the current font to X (nil return to default font)
\FS[X] - Changes the current font size to X (0 returns to default font size)
\Name[X] - Shows X written in a window
\Map - Shows the map name
=end
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Advanced Message", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
class Window_Message < Window_Selectable
alias requiem_message_initialize initialize
alias requiem_message_update update
alias requiem_message_dispsoe dispose
alias requiem_message_terminate_message terminate_message
alias requiem_message_convert_special_characters convert_special_characters
def initialize
requiem_message_initialize
@text_delay = 0
end
def update
requiem_message_update
@name_window.update if @name_window != nil
end
def dispose
requiem_message_dispsoe
close_name_window
end
def terminate_message
requiem_message_terminate_message
close_name_window
end
def convert_special_characters
requiem_message_convert_special_characters
@text.gsub!(/\\D\[([0-9]+)\]/i) { "\x09[#{$1}]" }
@text.gsub!(/\\E\[([0-9]+)\]/i) { "#{$data_enemies[$1.to_i].name}" }
@text.gsub!(/\\I\[([0-9]+)\]/i) { "\x10[#{$data_items[$1.to_i].icon_index}]#{$data_items[$1.to_i].name}" }
@text.gsub!(/\\W\[([0-9]+)\]/i) { "\x10[#{$data_weapons[$1.to_i].icon_index}]#{$data_weapons[$1.to_i].name}" }
@text.gsub!(/\\A\[([0-9]+)\]/i) { "\x10[#{$data_armors[$1.to_i].icon_index}]#{$data_armors[$1.to_i].name}" }
@text.gsub!(/\\S\[([0-9]+)\]/i) { "\x10[#{$data_skills[$1.to_i].icon_index}]#{$data_skills[$1.to_i].name}" }
@text.gsub!(/\\SE\[(.*?)\]/i) { "\x11[#{$1}]" }
@text.gsub!(/\\Map/i) { "#{$game_map.map_name}" }
@text.gsub!(/\\CE/i) { "#{$game_map.map_name}" }
@text.gsub!(/\\Name\[(.*?)\]/i) { "\x12[#{$1}]" }
@text.gsub!(/\\FN\[(.*?)\]/i) { "\x13[#{$1}]" }
@text.gsub!(/\\FS\[(.*?)\]/i) { "\x14[#{$1}]" }
end
def update_message
loop do
c = @text.slice!(/./m)
case c
when nil
finish_message
break
when "\x00"
new_line
if @line_count >= MAX_LINE
unless @text.empty?
self.pause = true
break
end
end
when "\x01"
@text.sub!(/\[([0-9]+)\]/, "")
contents.font.color = text_color($1.to_i)
next
when "\x02"
@gold_window.refresh
@gold_window.open
when "\x03"
@wait_count = 15
break
when "\x04"
@wait_count = 60
break
when "\x05"
self.pause = true
break
when "\x06"
@line_show_fast = true
when "\x07"
@line_show_fast = false
when "\x08"
@pause_skip = true
when "\x09"
@text.sub!(/\[([0-9]+)\]/, "")
@text_delay = $1.to_i
when "\x10"
@text.sub!(/\[([0-9]+)\]/, "")
bitmap = Cache.system("Iconset")
draw_icon($1.to_i, @contents_x, @contents_y)
@contents_x += 26
when "\x11"
@text.sub!(/\[(.*?)\]/, "")
RPG::SE.new($1.to_s).play
when "\x12"
@text.sub!(/\[(.*?)\]/, "")
create_name_window("#{$1}")
when "\x13"
@text.sub!(/\[(.*?)\]/, "")
if $1.to_s != "nil"
self.contents.font.name = $1.to_s
else
self.contents.font.name = Font.default_name
end
when "\x14"
@text.sub!(/\[(.*?)\]/, "")
if $1.to_i > 0
self.contents.font.size = $1.to_i
else
self.contents.font.size = Font.default_size
end
else
contents.draw_text(@contents_x, @contents_y, 40, self.contents.font.size+2, c)
c_width = contents.text_size(c).width
@contents_x += c_width
if @text_delay > 0
for i in 0..@text_delay - 1
Graphics.update
end
end
end
break unless @show_fast or @line_show_fast
end
end
def create_name_window(text="")
close_name_window
@name_window = Window.new
@name_window.windowskin = Cache.system("Window")
@name_window.x = self.x
@name_window.y = self.y-(((Font.default_size+32)/3)*2)
@name_window.contents = Bitmap.new(text.size*10,Font.default_size)
@name_window.width = @name_window.contents.width + 32
@name_window.height = @name_window.contents.height + 32
@name_window.z = self.z + 1
@name_window.back_opacity = 200
@name_window.contents.font.name = Name_Window_Font_Name
@name_window.contents.draw_text(0,0,@name_window.contents.width,@name_window.contents.height,text,1)
end
def close_name_window
return if @name_window.nil?
@name_window.dispose
@name_window = nil
end
end
#------------------------------------------------------------------------------
class Game_Map
def map_name
mpname = load_data("Data/MapInfos.rvdata")
mpname[@map_id].name
end
end
Bestiary:
#==============================================================================
# Requiem Bewstiary
#==============================================================================
module Requiem_Bestiary
# Show all enemies? (true = yes / false = no)
Show_All = false
# Enemies that will not appear in bestiary:
Dont_Appear = []
# Attributes that will be showed in bestiary:
Attributes = [1, 2, 3, 4, 5, 6, 7, 8]
# Attributes Icons:
Attribute_Icons = {1 => 104, 2 => 105, 3 => 106, 4 => 107, 5 => 108, 6 => 109, 7 => 110, 8 => 111}
end
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Bestiary", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
class Window_RequiemBestiaryMenu < Window_Selectable
def initialize
super(0, 0, 128, 416)
@index = 0
refresh
end
def refresh
@data = []
self.contents.clear
for i in $data_enemies
next if Requiem_Bestiary::Dont_Appear.include?(i.id)
@data << i
end
@data.compact!
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
def enemy
return @data[@index]
end
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 4
self.contents.clear_rect(rect)
i = @data[index]
return if i.nil?
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
if $game_system.enemy_defeated[i.id] >= 1 or Requiem_Bestiary::Show_All == true
self.contents.draw_text(rect, "#{i.name}")
else
self.contents.draw_text(rect, "?????")
end
end
end
#------------------------------------------------------------------------------
class Window_RequiemBestiaryInfo < Window_Base
def initialize
super(128, 0, 416, 416)
end
def update(enemy)
self.contents.clear
if Requiem_Bestiary::Show_All == false
return if $game_system.enemy_defeated[enemy.id] < 1
end
bitmap = Cache.battler(enemy.battler_name, enemy.battler_hue)
self.contents.blt(0, WLH, bitmap, bitmap.rect)
self.contents.font.color = crisis_color
self.contents.draw_text(0, 0, contents.width, WLH, "#{enemy.name}", 1)
self.contents.font.color = system_color
self.contents.draw_text(224, WLH, 128, WLH, Vocab.hp+":")
self.contents.draw_text(224, WLH*2, 128, WLH, Vocab.mp+":")
self.contents.draw_text(224, WLH*3, 128, WLH, Vocab.atk+":")
self.contents.draw_text(224, WLH*4, 128, WLH, Vocab.def+":")
self.contents.draw_text(224, WLH*5, 128, WLH, Vocab.spi+":")
self.contents.draw_text(224, WLH*6, 128, WLH, Vocab.agi+":")
self.contents.draw_text(224, WLH*8, 128, WLH, "EXP:")
self.contents.draw_text(224, WLH*10, 128, WLH, "Drop:")
self.contents.draw_text(224, WLH*11, 128, WLH, Vocab::gold)
self.contents.draw_text(224, WLH*15, 128, WLH, "Killed:")
self.contents.font.color = normal_color
self.contents.draw_text(288, WLH, 96, WLH, enemy.maxhp, 2)
self.contents.draw_text(288, WLH*2, 96, WLH, enemy.maxmp, 2)
self.contents.draw_text(288, WLH*3, 96, WLH, enemy.atk, 2)
self.contents.draw_text(288, WLH*4, 96, WLH, enemy.def, 2)
self.contents.draw_text(288, WLH*5, 96, WLH, enemy.spi, 2)
self.contents.draw_text(288, WLH*6, 96, WLH, enemy.agi, 2)
self.contents.draw_text(288, WLH*8, 96, WLH, enemy.exp, 2)
self.contents.draw_text(288, WLH*11, 96, WLH, enemy.gold, 2)
self.contents.draw_text(288, WLH*15, 96, WLH, "#{$game_system.enemy_defeated[enemy.id]}", 2)
draw_dropped_item(enemy, 224, WLH*12)
draw_weakness(enemy, 0, WLH*10)
draw_resistences(enemy, 0, WLH*13)
end
def draw_dropped_item(enemy, x, y)
items = []
for i in [enemy.drop_item1, enemy.drop_item2]
case i.kind
when 1
items.push($data_items[i.item_id])
when 2
items.push($data_weapons[i.weapon_id])
when 3
items.push($data_armors[i.armor_id])
end
end
for i in 0...items.size
next if i.nil?
draw_item_name(items[i], x, y+(i*24))
end
end
def draw_weakness(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 96, WLH, "Weakness:")
enemy = Game_Enemy.new(0, enemy.id)
weakness = []
for element_id in Requiem_Bestiary::Attributes
weakness << element_id if enemy.element_rate(element_id) > 100
end
for i in 0...weakness.size
element_id = weakness[i]
x = 32 * (i%5)
y2 = WLH * (i/5)
icon_index = Requiem_Bestiary::Attribute_Icons[element_id]
draw_icon(icon_index, x, y2+(y+WLH))
element = $data_system.elements[element_id]
end
end
def draw_resistences(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 128, WLH, "Resistences:")
enemy = Game_Enemy.new(0, enemy.id)
resistences = []
for element_id in Requiem_Bestiary::Attributes
resistences << element_id if enemy.element_rate(element_id) < 100
end
for i in 0...resistences.size
element_id = resistences[i]
x = 32 * (i%5)
y2 = WLH * (i/5)
icon_index = Requiem_Bestiary::Attribute_Icons[element_id]
draw_icon(icon_index, x, y2+(y+WLH))
element = $data_system.elements[element_id]
end
end
end
#------------------------------------------------------------------------------
class Game_System
attr_accessor:enemy_defeated
alias requiem_sbabs_gsystem_initialize initialize
def initialize
requiem_sbabs_gsystem_initialize
@enemy_defeated = []
for i in 1...$data_enemies.size
@enemy_defeated[i] = 0
end
end
end
#------------------------------------------------------------------------------
if Requiem_Masterpiece.enabled?("Requiem ABS", 5.0)
class Game_Event < Game_Character
alias requiem_bestiary_kill_enemy kill_enemy
def kill_enemy
$game_system.enemy_defeated[@enemy_id] += 1 unless @killed
requiem_bestiary_kill_enemy
end
end
end
#------------------------------------------------------------------------------
class Scene_RequiemBestiary < Scene_Base
def initialize(from_menu=false)
@from_menu = from_menu
end
def start
super
create_menu_background
@menu_window = Window_RequiemBestiaryMenu.new
@info_window = Window_RequiemBestiaryInfo.new
end
def update
super
update_menu_background
@menu_window.update
@info_window.update(@menu_window.enemy)
if Input.trigger?(Input::B)
Sound.play_cancel
if @from_menu
$scene = Scene_Menu.new(6)
else
$scene = Scene_Map.new
end
end
end
def terminate
super
dispose_menu_background
@menu_window.dispose
@info_window.dispose
end
end
Customized Vehicles
#==============================================================================
# Requiem Customized Vehicles
#==============================================================================
BOAT_GRAPHIC = ["",0] # Sprite Name and Index of Boat
SHIP_GRAPHIC = ["",0] # Sprite Name and Index of Ship
AIRSHIP_GRAPHIC = ["",0] # Sprite Name and Index of Airplane
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Custom Vehicles", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
class Game_Vehicle < Game_Character
alias requiem_change_vehicle_get_on get_on
alias requiem_change_vehicle_get_off get_off
def get_on
requiem_change_vehicle_get_on
@char_bak = @character_name
@index_bak = @character_index
case @type
when 0
return if BOAT_GRAPHIC[0] == ""
@character_name = BOAT_GRAPHIC[0]
@character_index = BOAT_GRAPHIC[1]
when 1
return if SHIP_GRAPHIC[0] == ""
@character_name = SHIP_GRAPHIC[0]
@character_index = SHIP_GRAPHIC[1]
when 2
return if AIRSHIP_GRAPHIC[0] == ""
@character_name = AIRSHIP_GRAPHIC[0]
@character_index = AIRSHIP_GRAPHIC[1]
end
end
def get_off
requiem_change_vehicle_get_off
@character_name = @char_bak
@character_index = @index_bak
end
end
Day & Night
#==============================================================================
# Requiem Day and Night
#==============================================================================
Day_Lengh = 5 # Minutes that have 1 day
Day_Tone = Tone.new(0,0,0,0)
Afternoon_Tone = Tone.new(25,0,-25,0)
Night_Tone = Tone.new(-75, -75, -75, 25)
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Day & Night", 1.0, "04/05/2009")
#------------------------------------------------------------------------------
class Game_Map
alias requiem_day_night_setup setup
alias requiem_day_night_update update
def setup(map_id)
requiem_day_night_setup(map_id)
reset_screen_tone
end
def update
requiem_day_night_update
update_day_night
end
def update_day_night
@hour = Graphics.frame_count % (60*60*Day_Lengh)
if map_name.include?("&")
if is_day? and !@day
@screen.start_tone_change(Day_Tone, 60)
@day = true; @afternoon = @night = false
elsif is_afternoon? and !@afternoon
@screen.start_tone_change(Afternoon_Tone, 60)
@afternoon = true; @day = @night = false
elsif is_night? and !@night
@screen.start_tone_change(Night_Tone, 60)
@night = true; @day = @afternoon = false
end
end
end
def reset_screen_tone
if map_name.include?("&")
if is_day?
@screen.start_tone_change(Day_Tone, 0)
elsif is_afternoon?
@screen.start_tone_change(Afternoon_Tone, 0)
elsif is_night?
@screen.start_tone_change(Night_Tone, 0)
end
else
@screen.start_tone_change(Tone.new(0,0,0,0), 0)
end
end
def is_day?
return true if @hour < ((60*60*Day_Lengh)/3)
return false
end
def is_afternoon?
return true if @hour > ((60*60*Day_Lengh)/3) and @hour < (((60*60*Day_Lengh)/3)*2)
return false
end
def is_night?
return true if @hour > (((60*60*Day_Lengh)/3)*2)
return false
end
def map_name
map = load_data("Data/MapInfos.rvdata")
return map[@map_id].name
end
end
Extendet Movements
#==============================================================================
# Requiem Extended Movements
#==============================================================================
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Extended Movements", 1.0, "03/31/2009")
#------------------------------------------------------------------------------
class Game_Character
attr_accessor (:character_name, :character_index, :move_route, :direction_fix,
:walk_anime, :step_anime, :move_speed, :through, :priority_type)
def in_range?(parent, target, range)
x = (parent.x - target.x) * (parent.x - target.x)
y = (parent.y - target.y) * (parent.y - target.y)
r = x + y
return true if r <= (range * range)
return false
end
def in_direction?(parent, target)
return true if parent.direction == 2 and target.y >= parent.y and target.x == parent.x
return true if parent.direction == 4 and target.x <= parent.x and target.y == parent.y
return true if parent.direction == 6 and target.x >= parent.x and target.y == parent.y
return true if parent.direction == 8 and target.y <= parent.y and target.x == parent.x
return false
end
def in_front?(parent, target)
return true if parent.direction == 2 and parent.x == target.x and (parent.y+1) == target.y
return true if parent.direction == 4 and (parent.x-1) == target.x and parent.y == target.y
return true if parent.direction == 6 and (parent.x+1) == target.x and parent.y == target.y
return true if parent.direction == 8 and parent.x == target.x and (parent.y-1) == target.y
return false
end
def in_behind?(parent, target)
return true if parent.direction == 2 and target.direction == 2 and parent.x == target.x and (parent.y+1) == target.y
return true if parent.direction == 4 and target.direction == 4 and (parent.x-1) == target.x and parent.y == target.y
return true if parent.direction == 6 and target.direction == 6 and (parent.x+1) == target.x and parent.y == target.y
return true if parent.direction == 8 and target.direction == 8 and parent.x == target.x and (parent.y-1) == target.y
return false
end
def in_beside?(parent, target)
return true if target.direction == 2 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y
return true if target.direction == 2 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y
return true if target.direction == 4 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1)
return true if target.direction == 4 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1)
return true if target.direction == 6 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1)
return true if target.direction == 6 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1)
return true if target.direction == 8 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y
return true if target.direction == 8 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y
return false
end
def face_to_face?(parent, target)
return true if parent.direction == 2 and target.direction == 8
return true if parent.direction == 4 and target.direction == 6
return true if parent.direction == 6 and target.direction == 4
return true if parent.direction == 8 and target.direction == 2
return false
end
def is_passable?(object, dir)
x = dir == 4 ? -1 : dir == 6 ? 1 : 0
y = dir == 2 ? 1 : dir == 8 ? -1 : 0
return false if !$game_map.passable?(object.x+x, object.y+y)
return true
end
def events_xy(object, dir)
x = dir == 4 ? -1 : dir == 6 ? 1 : 0
y = dir == 2 ? 1 : dir == 8 ? -1 : 0
for i in $game_map.events.values
return true if i.x == object.x+x and i.y == object.y+y and !i.through
end
return false
end
def move_toward(target)
sx = distance_x_from(target)
sy = distance_y_from(target)
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_left : move_right
if @move_failed and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if @move_failed and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
def turn_toward(target)
sx = distance_x_from(target)
sy = distance_y_from(target)
if sx.abs > sy.abs
sx > 0 ? turn_left : turn_right
elsif sx.abs < sy.abs
sy > 0 ? turn_up : turn_down
end
end
def distance_x_from(target)
sx = @x - target.x
if $game_map.loop_horizontal?
if sx.abs > $game_map.width / 2
sx -= $game_map.width
end
end
return sx
end
def distance_y_from(target)
sy = @y - target.y
if $game_map.loop_vertical?
if sy.abs > $game_map.height / 2
sy -= $game_map.height
end
end
return sy
end
end
#------------------------------------------------------------------------------
class Game_Event < Game_Character
def check_value(comment)
return 0 if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0].downcase =~ /#{comment.downcase}[ ]?(\d+)?/
return $1.to_i
end
end
end
return 0
end
def check_comment(comment)
return false if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0].downcase.include?(comment.downcase)
return true
end
end
end
return false
end
end
Fog
#==============================================================================
# Requiem Fog
#==============================================================================
# To create a fog, put in Parallax folder, a image with "_Fog" in its name (without quote)
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Fog", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
class Spriteset_Map
alias requiem_fog_initialize initialize
alias requiem_fog_update update
alias requiem_fog_dispose dispose
alias requiem_fog_update_parallax update_parallax
def initialize
create_fog
requiem_fog_initialize
end
def update
requiem_fog_update
update_fog
end
def dispose
requiem_fog_dispose
dispose_fog
end
def create_fog
@fog = Plane.new(@viewport1)
@fog.z = 200
@fog.opacity = 64
end
def update_parallax
return if $game_map.parallax_name.include?("Fog")
requiem_fog_update_parallax
end
def update_fog
return unless $game_map.parallax_name.include?("Fog")
if @fog_name != $game_map.parallax_name
@fog_name = $game_map.parallax_name
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = Cache.parallax(@fog_name)
end
Graphics.frame_reset
end
@fog.ox = $game_map.calc_parallax_x(@fog.bitmap)
@fog.oy = $game_map.calc_parallax_y(@fog.bitmap)
end
def dispose_fog
@fog.dispose
end
end
Global Self Switches
#==============================================================================
# Requiem Global Self Switches
#==============================================================================
# Call: Requiem_GSS.turn_on(event_id, switch_id) to turn on the switch
# Call: Requiem_GSS.turn_off(event_id, switch_id) to turn off the switch
# switch_id is: ""A", "B", "C" od "D" (WITH QUOTES!!!)
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Global Self Switches", 1.0, "04/05/2009")
#------------------------------------------------------------------------------
module Requiem_GSS
def self.turn_on(event_id, self_switch)
key = [$game_map.map_id, $game_map.events[event_id].id, self_switch]
$game_self_switches[key] = true
$game_map.need_refresh = true
end
def self.turn_off(event_id, self_switch)
key = [$game_map.map_id, $game_map.events[event_id].id, self_switch]
$game_self_switches[key] = false
$game_map.need_refresh = true
end
end
Grab
#==============================================================================
# Requiem Grab
#==============================================================================
Grab_Button = Input::Letters["H"]
Move_Sound = "Push" # Sound playerd when you move the object
Throw_Sound = "Earth1" # Sound playerd when you yhrow the object
Hit_Animation_id = 84 # Animation showed when object colide when something
Item_Needed = 0 # ID of Item needed to allows player to grab objects
# Add folowing comments in a event that will be a movable object:
# Grabable - Allows the event to be grabable and pushable;
# Throwable - Allows the event to be throwable;
# Add folowing comments in a event that will be a place to put the object:
# Place X . Change X to ID of Event taht is the Object;
# Place Self Switch A: If Object is above the Place, self switch A will be activated;
# Place Self Switch B: If Object is above the Place, self switch B will be activated;
# Place Self Switch C: If Object is above the Place, self switch C will be activated;
# Place Self Switch D: If Object is above the Place, self switch D will be activated;
# Place Switch X: If Object is above the Place, switch X will be activated;
# Place Variable X: If Object is above the Place, variable X will increased +1;
# PS: Script REQUIEM EXTENDED MOVEMETS is needed!
#------------------------------------------------------------------------------
if Requiem_Masterpiece.enabled?("Requiem Extended Movements")
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Grab", 1.1, "03/31/2009")
#------------------------------------------------------------------------------
class Game_Player < Game_Character
attr_accessor (:grabbed, :grabbed_event)
alias requiem_grab_gplayer_update update
alias requiem_grab_gplayer_dash dash?
def update
requiem_grab_gplayer_update
update_grab
end
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
case Input.dir4
when 2
return unless move_grabing?(2)
move_down
grab_event(2)
when 4
return unless move_grabing?(4)
move_left
grab_event(4)
when 6
return unless move_grabing?(6)
move_right
grab_event(6)
when 8
return unless move_grabing?(8)
move_up
grab_event(8)
end
end
def update_grab
return unless Item_Needed <= 0 or $game_party.has_item?($data_items[Item_Needed])
for event in $game_map.events.values
if event.grabable and Input.press?(Grab_Button) and in_front?(self, event) and !Input.trigger?(Input::C)
next if event.grabbed
@grabbed_event = event
old_direction_fix = @direction_fix
old_event_dir_fix = event.direction_fix
@direction_fix = true
event.direction_fix = true
event.move_speed = 4
event.grabbed = true
elsif Input.trigger?(Input::C) and event.throwable and event.grabbed
RPG::SE.new(Throw_Sound, 80).play if Throw_Sound != ""
event.direction_fix = false
event.set_direction(@direction)
event.direction_fix = true
event.move_speed = 6
event.throw = true
event.grabbed = false
@grabbed_event = nil
elsif !Input.press?(Grab_Button)
if event.grabbed
event.direction_fix = old_event_dir_fix
event.grabbed = false
end
@direction_fix = old_direction_fix
@grabbed_event = nil
end
end
end
def grab_event(dir)
return if @grabbed_event.nil?
return if @grabbed_event.moving?
case dir
when 2
@grabbed_event.move_down
when 4
@grabbed_event.move_left
when 6
@grabbed_event.move_right
when 8
@grabbed_event.move_up
end
RPG::SE.new(Move_Sound, 80).play if Move_Sound != ""
end
def move_grabing?(dir)
return true if @grabbed_event.nil?
return false if events_xy(@grabbed_event, dir)
return false if !is_passable?(@grabbed_event, dir)
case dir
when 2
return false if events_xy(self, dir) and @direction != 2
return false if !is_passable?(self, dir)
when 4
return false if events_xy(self, dir) and @direction != 4
return false if !is_passable?(self, dir)
when 6
return false if events_xy(self, dir) and @direction != 6
return false if !is_passable?(self, dir)
when 8
return false if events_xy(self, dir) and @direction != 8
return false if !is_passable?(self, dir)
end
return true
end
def dash?
return false unless @grabbed_event.nil?
requiem_grab_gplayer_dash
end
end
#------------------------------------------------------------------------------
class Game_Event < Game_Character
attr_reader (:grabable, :throwable, :place, :place_self_switch_a, :place_self_switch_b,
:place_self_switch_c, :place_self_switch_d, :place_switch, :place_variable)
attr_accessor (:grabbed, :throw)
alias requiem_grab_gevent_initialize initialize
alias requiem_grab_gevent_update update
alias requiem_grab_gevent_refresh refresh
alias requiem_grab_gevent_check_event_trigger_touch check_event_trigger_touch
def initialize(map_id, event)
@grabable = false
@grabbed = false
@throwable = false
@throw = false
@place = false
@place_properties = false
requiem_grab_gevent_initialize(map_id, event)
end
def update
requiem_grab_gevent_update
throwself if @throw
put_in_place
end
def refresh
requiem_grab_gevent_refresh
@grabable = check_comment("Grabable")
@throwable = check_comment("Throwable")
@place = check_value("Place")
@place_self_switch_a = check_comment("Place Self Switch A")
@place_self_switch_b = check_comment("Place Self Switch B")
@place_self_switch_c = check_comment("Place Self Switch C")
@place_self_switch_d = check_comment("Place Self Switch D")
@place_switch = check_value("Place Switch")
@place_variable = check_value("Place Variable")
end
def throwself
move_forward unless moving?
@throw = false if stopping?
end
def check_event_trigger_touch(x, y)
requiem_grab_gevent_check_event_trigger_touch(x, y)
return unless Requiem_Masterpiece.enabled?("Requiem ABS", 5.0)
for event in $game_map.events.values
next unless event.x == x and event.y == y and event.in_battle and @throw
event.animation_id = Hit_Animation_id
event.actor.attack_effect($game_player.actor)
@throw = false
end
end
def put_in_place
for event in $game_map.events.values
next if event == self
next unless event.place > 0
next if @id != event.place
next unless @x == event.x and @y == event.y
if event.place_self_switch_a
key = [$game_map.map_id, event.id, "A"]
$game_self_switches[key] = !$game_self_switches[key]
elsif event.place_self_switch_b
key = [$game_map.map_id, event.id, "B"]
$game_self_switches[key] = !$game_self_switches[key]
elsif event.place_self_switch_c
key = [$game_map.map_id, event.id, "C"]
$game_self_switches[key] = !$game_self_switches[key]
elsif event.place_self_switch_d
key = [$game_map.map_id, event.id, "D"]
$game_self_switches[key] = !$game_self_switches[key]
elsif event.place_switch > 0
$game_switches[event.place_switch] = !$game_switches[event.place_switch]
elsif event.place_variable > 0
$game_variables[event.place_variable] += 1
end
$game_map.need_refresh = true
end
end
end
#------------------------------------------------------------------------------
end
Jump
#==============================================================================
# Requiem Jump
#==============================================================================
Jump_Key = Input::Letters["C"] # Key used to jump
Jump_Far_When_Dashing = true # Jump far when dashing? (true = yes/ false = no)
Jump_Distance = 2 # Range (in tiles) that hero jump
Jump_Dash_Distance = 3 # Range of jump when player is dashing
Jump_Item = 0 # Item needed to jump (keep 0 if item is not necessary)
Jump_Switch = 0 # Switch needed to jump (keep 0 if switch is not necessary)
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Jump", 1.1, "03/30/2009")
#------------------------------------------------------------------------------
class Game_Player
alias requiem_jump_initialize initialize
alias requiem_jump_update update
def initialize
requiem_jump_initialize
@jump_delay = 0
end
def update
requiem_jump_update
@jump_delay -= 1 if @jump_delay > 0
jumping
end
def jumping
return if Requiem_Masterpiece.enabled?("Requiem Transformations") and @bat_form
return if Jump_Item > 0 and !$game_party.has_item?($data_items[Jump_Item])
return if Jump_Switch > 0 and !$game_switches[Jump_Switch]
return if $game_map.interpreter.running?
if Input.trigger?(Jump_Key) and @jump_delay <= 0
if Input.press?(Input::DOWN)
if dash? and Jump_Far_When_Dashing
jump(0, Jump_Dash_Distance) if passable?(@x, @y+Jump_Dash_Distance)
else
jump(0, Jump_Distance) if passable?(@x, @y+Jump_Distance)
end
elsif Input.press?(Input::LEFT)
if dash? and Jump_Far_When_Dashing
jump(-Jump_Dash_Distance, 0) if passable?(@x-Jump_Dash_Distance, @y)
else
jump(-Jump_Distance, 0) if passable?(@x-Jump_Distance, @y)
end
elsif Input.press?(Input::RIGHT)
if dash? and Jump_Far_When_Dashing
jump(Jump_Dash_Distance, 0) if passable?(@x+Jump_Dash_Distance, @y)
elsif passable?(@x+Jump_Distance, @y)
jump(Jump_Distance, 0) if passable?(@x+Jump_Distance, @y)
end
elsif Input.press?(Input::UP)
if dash? and Jump_Far_When_Dashing
jump(0, -Jump_Dash_Distance) if passable?(@x, @y-Jump_Dash_Distance)
else
jump(0, -Jump_Distance) if passable?(@x, @y-Jump_Distance)
end
else
jump(0, 0)
end
@jump_delay = 30
end
end
end
Map Name
#==============================================================================
# Requiem Map Name
#==============================================================================
# To show the names of the maps, put "*" in the name of the map (whitout quotes)
Font_Name = "Arial" # Name of the font
Font_Size = 32 # Size of the font
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Map Name", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
class Game_Map
def map_name
map = load_data("Data/MapInfos.rvdata")
return map[@map_id].name
end
end
#------------------------------------------------------------------------------
class Window_MapName < Window_Base
def initialize
super(0, 320, 544, 64)
self.opacity = self.contents_opacity = 0
self.visible = false
refresh
end
def refresh
self.contents.clear
self.contents.font.name = Font_Name
self.contents.font.size = Font_Size
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(0, 0, contents.width, self.contents.font.size, $game_map.map_name.gsub("*", ""), 1)
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(1, 1, contents.width, self.contents.font.size, $game_map.map_name.gsub("*", ""), 1)
end
end
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
attr_reader (:mapname_delay, :showed)
alias requiem_mapname_start start
alias
Max Level Changer
[code]#====================================================================
Oha, ich finde, dass Woratanas Mouse Script hier so oder so ausgeschlossen werden müsste. Naja.
Der Post ist leider schon zu groß, es gibt noch 6 weitere Scripts von Requiem, eins davon ist ein Mouse Module, versuch das mal:
#==============================================================================
# Requiem Mouse Module (Tanks to AWorks)
#==============================================================================
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem Mouse Module", 1.0, "03/30/2009")
#------------------------------------------------------------------------------
module Mouse
GetCursorPos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
ScreenToClient = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
GetClientRect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
GetPrivateString = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
FindWindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
module_function
def self.global_pos
pos = [0, 0].pack('ll')
if GetCursorPos.call(pos) != 0
return pos.unpack('ll')
else
return nil
end
end
def self.pos
x, y = self.screen_to_client(*Mouse.global_pos)
width, height = self.client_size
begin
if (x >= 0 and y >= 0 and x < width and y < height)
return x, y
else
return [-32,-32]
end
rescue
return [-32,-32]
end
end
def self.screen_to_client(x, y)
return nil unless x and y
pos = [x, y].pack('ll')
if ScreenToClient.call(self.hwnd, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
def self.hwnd
game_name = "\0" * 256
GetPrivateString.call('Game',' Title', '', game_name, 255, ".\\Game.ini")
game_name.delete!("\0")
return FindWindow.call('RGSS Player', game_name)
end
def self.client_size
rect = [0, 0, 0, 0].pack('l4')
GetClientRect.call(self.hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
#------------------------------------------------------------------------------
class Sprite_Mouse < Sprite
def initialize
super
self.x = self.y = 0
self.z = 999999999
self.bitmap = Bitmap.new(24, 24)
@cursor = 0
refresh
update
end
def update
super
self.x, self.y = Mouse.pos
end
def dispose
super
self.bitmap.dispose
end
def cursor=(c)
@cursor = c
refresh
end
def refresh
self.bitmap.clear
graphic = Cache.system("Cursors")
rect = Rect.new(@cursor % 3 * 24, @cursor / 3 * 24, 24, 24)
self.bitmap.blt(0, 0, graphic, rect)
end
def tile
x = ($game_map.display_x / 256) + (self.x / 32)
y = ($game_map.display_y / 256) + (self.y / 32)
return x, y
end
def in_area?(x, y, width=24, height=24)
return false if self.x < 0 or self.y < 0
return true if self.x.between?(x, x+width) and self.y.between?(y, y+height)
return false
end
def over?(x, y)
return false if self.x < 0 or self.y < 0
return true if tile[0] == x and tile[1] == y
return false
end
end
#------------------------------------------------------------------------------
class Scene_Base
alias requiem_mouse_module_start start
alias requiem_mouse_module_update update
alias requiem_mouse_module_terminate terminate
def start
requiem_mouse_module_start
$mouse = Sprite_Mouse.new
end
def update
requiem_mouse_module_update
$mouse.update
end
def terminate
requiem_mouse_module_terminate
$mouse.dispose
end
end
#------------------------------------------------------------------------------
Win32API.new('user32','ShowCursor','i','i').call(0)