Partagez
Aller en bas
Mikenatoli
Mikenatoli
Membre

Nombre de messages : 27
Age : 28
Distinction : aucune
Date d'inscription : 28/09/2009

Problème script [Résolu] Empty Problème script [Résolu]

le Ven 26 Fév 2010 - 17:07
Bonjour,

J'ai un soucis, dans ma page de titre, lorsque je met nouveau jeux il me note cela:

Spoiler:
Problème script [Résolu] Blemew

Sa ma fait cela depuis que j'ai inséré le script pour le titre. Voici le script du titre

Spoiler:
##################################################
# Scene Title Screen Miria V1.0 #
##################################################
# By Moghunter
# http://www.atelier-rgss.com
##################################################
# Tela de titulo animada.
# Crie uma pasta com o nome deTitle dentro da pasta
# Graphics e coloque todas as imagens dentro dela.
# São necessárias as seguintes imagens.
#
# Title #Imagem que contem o texto do titulo
# Transition #Imagem da transição de tela
# Plane1 #Imagem da camada 1
# Plane2 #Imagem da camada 2
# Plane3 #Imagem da camada 3
# Com_01 #Imagem do menu seleção NEW GAME
# Com_02 #Imagem do menu seleção CONTINUE
# Com_03 #Imagem do menu seleção EXIT
#
#-------------------------------------------------
#############
# CONFIG #
#############
module MOG_VX01
#Ativar tela cheia. (true = Ativar ou false = Desativar)
FULL_SCREEN = false
# Tempo de transição.
TT = 120
#Ativar movimento de Onda no texto do titulo.
# (true = Ativar ou false = Desativar)
TWAVE = true
#Opacidade da imagem camada 1.
TPLANE1_OPA = 255
#Opacidade da imagem camada 2.
TPLANE2_OPA = 200
#Opacidade da imagem camada 3
TPLANE3_OPA = 170
# Velocidade de movimento da camada 1 na horizontal.
TPLANE1_X = 1
# Velocidade de movimento da camada 1 na vertical.
TPLANE1_Y = 0
# Velocidade de movimento da camada 2 na horizontal.
TPLANE2_X = 2
# Velocidade de movimento da camada 2 na vertical.
TPLANE2_Y = 0
# Velocidade de movimento da camada 2 na horizontal.
TPLANE3_X = 4
# Velocidade de movimento da camada 2 na vertical.
TPLANE3_Y = 0
end
#-------------------------------------------------
$mogscript = {} if $mogscript == nil
$mogscript["title_miria"] = true
#-------------------------------------------------
###############
# Module Cache #
###############
module Cache
def self.title(filename)
load_bitmap("Graphics/Title/", filename)
end
end
#############
# Scene_Title #
#############
$full_screen = 0
class Scene_Title
include MOG_VX01
def main
if $BTEST
battle_test
return
end
$full_screen += 1
if MOG_VX01::FULL_SCREEN == true and $full_screen == 1
$showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ' '
$showm.call(18,0,0,0)
$showm.call(13,0,0,0)
$showm.call(13,0,2,0)
$showm.call(18,0,2,0)
end
start
perform_transition
post_start
Input.update
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.update
pre_terminate
Graphics.freeze
terminate
end
def start
load_database
create_game_objects
check_continue
create_title_graphic
create_command_window
play_title_music
end
def perform_transition
Graphics.transition(TT , "Graphics/Title/Transition")
end
def post_start
open_command_window
end
def pre_terminate
close_command_window
end
def terminate
dispose_command_window
snapshot_for_background
dispose_title_graphic
end
def update
@command_window.update
case @command_window.index
when 0
@com.bitmap = Cache.title("Com_01")
when 1
@com.bitmap = Cache.title("Com_02")
when 2
@com.bitmap = Cache.title("Com_03")
end
@sprite_title.opacity += 2
@com.opacity += 2 if @sprite_title.opacity > 150
@sprite.ox += TPLANE1_X
@sprite.oy += TPLANE1_Y
@sprite2.ox += TPLANE2_X
@sprite2.oy += TPLANE2_Y
@sprite3.ox += TPLANE3_X
@sprite3.oy += TPLANE3_Y
@sprite_title.update if TWAVE == true
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
def update_slide
@sprite.ox += TPLANE1_X
@sprite.oy += TPLANE1_Y
@sprite2.ox += TPLANE2_X
@sprite2.oy += TPLANE2_Y
@sprite3.ox += TPLANE3_X
@sprite3.oy += TPLANE3_Y
@sprite_title.update if TWAVE == true
end
def load_database
$data_actors = load_data("Data/Actors.rvdata")
$data_classes = load_data("Data/Classes.rvdata")
$data_skills = load_data("Data/Skills.rvdata")
$data_items = load_data("Data/Items.rvdata")
$data_weapons = load_data("Data/Weapons.rvdata")
$data_armors = load_data("Data/Armors.rvdata")
$data_enemies = load_data("Data/Enemies.rvdata")
$data_troops = load_data("Data/Troops.rvdata")
$data_states = load_data("Data/States.rvdata")
$data_animations = load_data("Data/Animations.rvdata")
$data_common_events = load_data("Data/CommonEvents.rvdata")
$data_system = load_data("Data/System.rvdata")
$data_areas = load_data("Data/Areas.rvdata")
end
def load_bt_database
$data_actors = load_data("Data/BT_Actors.rvdata")
$data_classes = load_data("Data/BT_Classes.rvdata")
$data_skills = load_data("Data/BT_Skills.rvdata")
$data_items = load_data("Data/BT_Items.rvdata")
$data_weapons = load_data("Data/BT_Weapons.rvdata")
$data_armors = load_data("Data/BT_Armors.rvdata")
$data_enemies = load_data("Data/BT_Enemies.rvdata")
$data_troops = load_data("Data/BT_Troops.rvdata")
$data_states = load_data("Data/BT_States.rvdata")
$data_animations = load_data("Data/BT_Animations.rvdata")
$data_common_events = load_data("Data/BT_CommonEvents.rvdata")
$data_system = load_data("Data/BT_System.rvdata")
end
def create_game_objects
$game_temp = Game_Temp.new
$game_message = Game_Message.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
end
def check_continue
@continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
end
def create_title_graphic
@sprite_title = Sprite.new
@sprite_title.bitmap = Cache.title("Title")
@sprite_title.opacity = 0
@com = Sprite.new
@com.bitmap = Cache.title("Com_01")
@com.opacity = 0
@sprite = Plane.new
@sprite.bitmap = Cache.title("Plane1")
@sprite2 = Plane.new
@sprite2.bitmap = Cache.title("Plane2")
@sprite3 = Plane.new
@sprite3.bitmap = Cache.title("Plane3")
@sprite.opacity = TPLANE1_OPA
@sprite2.opacity = TPLANE2_OPA
@sprite3.opacity = TPLANE3_OPA
@sprite.z = 1
@sprite2.z = 2
@sprite3.z = 3
@com.z = 4
@sprite_title.z = 5
if TWAVE == true
@sprite_title.wave_amp = 8
@sprite_title.wave_length = 240
@sprite_title.wave_speed = 320
end
end
def dispose_title_graphic
@sprite.bitmap.dispose
@sprite2.bitmap.dispose
@sprite3.bitmap.dispose
@com.bitmap.dispose
@sprite_title.bitmap.dispose
@sprite.dispose
@sprite2.dispose
@sprite3.dispose
@com.dispose
@sprite_title.dispose
end
def create_command_window
s1 = Vocab::new_game
s2 = Vocab::continue
s3 = Vocab::shutdown
@command_window = Window_Command.new(172, [s1, s2, s3])
@command_window.opacity = 0
@command_window.contents_opacity = 0
if @continue_enabled
@command_window.index = 1
else
@command_window.draw_item(1, false)
end
end
def title_fade
if TWAVE == true
@sprite_title.wave_amp = 34
@sprite_title.wave_length =120
@sprite_title.wave_speed = 800
end
for i in 0..120
@sprite_title.opacity -= 3
@sprite_title.update if TWAVE == true
@com.opacity -= 3
case @command_window.index
when 0
@sprite.zoom_x += 0.01
@sprite.zoom_y += 0.01
@sprite2.zoom_x += 0.01
@sprite2.zoom_y += 0.01
@sprite3.zoom_x += 0.01
@sprite3.zoom_y += 0.01
@sprite.ox += 2
@sprite.oy += 2
@sprite2.ox += 2
@sprite2.oy += 2
@sprite3.ox += 2
@sprite3.oy += 2
end
update_slide
Graphics.update
end
end
def dispose_command_window
@command_window.dispose
end
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
def confirm_player_location
if $data_system.start_map_id == 0
print "プレイヤーの初期位置が設定されていません。"
exit
end
end
def command_new_game
confirm_player_location
Sound.play_decision
title_fade
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(1500)
close_command_window
Graphics.fadeout(60)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
def command_continue
if @continue_enabled
Sound.play_decision
title_fade
$scene = Scene_File.new(false, true, false)
else
Sound.play_buzzer
end
end
def command_shutdown
Sound.play_decision
title_fade
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
def battle_test
load_bt_database
create_game_objects
Graphics.frame_count = 0
$game_party.setup_battle_test_members
$game_troop.setup($data_system.test_troop_id)
$game_troop.can_escape = true
$game_system.battle_bgm.play
snapshot_for_background
$scene = Scene_Battle.new
end
def snapshot_for_background
$game_temp.background_bitmap.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
$game_temp.background_bitmap.blur
end
end


Dernière édition par Mikenatoli le Ven 26 Fév 2010 - 23:59, édité 1 fois
Mikenatoli
Mikenatoli
Membre

Nombre de messages : 27
Age : 28
Distinction : aucune
Date d'inscription : 28/09/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 17:08
Voici le script qui bug, Requiem ABS 4:

Spoiler:
#==============================================================================
# Requiem ABS Version 4.0
#==============================================================================
#------------------------------------------------------------------------------
# Credits: Vlad | Email: demon_of_lust@live.com
# Traduit en français par : Calion
#------------------------------------------------------------------------------

# Pour créer une ennemi, mettre les commentaire suivant sur un évènement, sur une map:
#(Pour modifier les commentaires à mettre pour les commandes qui suivent, voir de la ligne 706 à 723.)

# Enemy ID - Remplacer "ID" par le numéro de l'ID du monstre dont l'ennemi doit avoir les caractéristiques.
# Die Erase - Efface l'ennemi lorsqu'il meurt;
# Die Self Switch A - Active l'interrupteur local A quand l'ennemi meurt;
# Die Self Switch B - Active l'interrupteur local B quand l'ennemi meurt;
# Die Self Switch C - Active l'interrupteur local C quand l'ennemi meurt;
# Die Self Switch D - Active l'interrupteur local D quand l'ennemi meurt;
# Die Switch X - Active l'interrupteur "X " quand l'ennemi meurt;
# Die Variable X - Ajoute +1 à la variable "X";
# Follow X - Changer "X" par la vitesse de déplacement de l'ennemi, il suivra automatiquement le joueur.
# Kill With Weapon X - L'ennemi mourra seulement si il est attaqué par l'arme à l'ID "X"
# Kill With Skill X - L'ennemi mourra seulement si il est attaqué par la compétence à l'ID "X"
# Kill With Item X - L'ennemi mourra seulement si il est attaqué par l'objet à l'ID "X"
# Object - Fait que l'ennemi est un objet, et ne peut pas être tué.
# Puzzle - Fait que l'ennemi est un puzzle, il peut être tué mais les alliés ne le suivent pas, les dommages et la
#barre de vie ne sont pas montrés.
# Respawn X - Fait que l'ennemi ressuscite automatiquement après "X" frames.
# Boss - Montre la barre de vie du boss

#------------------------------------------------------------------------------
# GENERAL CONFIGURATIONS
#------------------------------------------------------------------------------
module Requiem_ABS
#------------------------------------------------------------------------------
# Main droite touche d'attaque:
Right_Attack_Button = Input::Letters["A"]

# Main gauche touche d'attaque et Bouclier:
Left_Attack_and_Shield_Button = Input::Letters["S"]

# Touches de compétences:
Skill_Buttons = [Input::Numberkeys[1], Input::Numberkeys[2], Input::Numberkeys[3]]

# Touches d'objets:
Item_Buttons = [Input::Numberkeys[4], Input::Numberkeys[5], Input::Numberkeys[6]]

# Texte qui apparait lorsqu'une compétence ou un objet est mémorisé.
Memorize_Text = "Memorisé !"

# Temps d'attaque pour le joueur (in frames)
Hero_Attack_Time = 60

# Temps d'attaque pour l'ennemi (in frames)
Enemy_Attack_Time = 90

# Divize la taille des animations par :
Animations_Divide_By = 3

# Utiliser les animations des attaques ? (true = oui / false = non)
Allow_Weapons_Graphics = true

# Utiliser le bouclier ? (true = oui / false = non)
Allow_Shields_Graphics = true

# Utiliser les combos ? (true = oui / false = non)
Combo_Damage = true

# Animation de l'augmentation de niveau : ( changer 40 par le numéro de l'ID de l'animation voulu )
LevelUp_Animation = 40

# Restaurer les PV et les PM quand le niveau du joueur augmente ? (true = oui / false = non)
Restaure_When_UpLevel = true

# ID de l'icone d'argent : ( changer 147 par le numéro de l'ID de l'icone voulu )
Gold_Drop_Graphic = 147

# Pourcentage de chance que de l'or tombe d'un ennemi
Gold_Drop_Rate = 75#%

# Temps de récupération avant la disparition d'un objet (en frames):
Drop_Duration_Time = 450

# Montrer le nom des objets tombés ? (true = oui / false = non)
Show_Reward = true

# Son quand de l'argent tombe :
Drop_Money_SE = "DropMoney"

# Son quand un objet tombe:
Drop_Item_SE = "DropItem"

# Son quand de l'argent ou un objet est récupéré :
Get_Reward_SE = "Getitem"

# Configuration des textes de dommages :
Damage_Properties = []
Damage_Properties[1] = "Georgia" # Police d'écritures des dommages
Damage_Properties[2] = 22 # Taille du texte
Damage_Properties[3] = false # Texte en gras ? (true = oui / false = non)
Damage_Properties[4] = true # Texte en italique ? (true = oui / false = non)
Damage_Properties[5] = "Coup Critique !" # Texte de dommages critiques
Damage_Properties[6] = "Manqué" # Texte d'attaque manqué

Damage_Properties[7] = "Hits" # Texte quand un coup est donné
Damage_Properties[8] = "Times New Roman" # Police d'écriture du texte
Damage_Properties[9] = 26 # Taille du texte
Damage_Properties[10] = true # Texte en gras ? (true = oui / false = non)
Damage_Properties[11] = true # Texte en italique ? (true = oui / false = non)
Damage_Properties[12] = "Combo" # Texte lors d'un combo

Damage_Properties[13] = Color.new(255,255,255) # Couleur de l'écriture des dommages
Damage_Properties[14] = Color.new(125,200,115) # Couleur de l'écriture lorsque le joueur se régènere
Damage_Properties[15] = Color.new(255,255,128) # Couleur de l'écriture des dommages critiques
Damage_Properties[16] = Color.new(245,150,120) # Couleur de l'écriture des dommages en combo
Damage_Properties[17] = Color.new(210,160,210) # Couleur de l'écriture des coups

Damage_Properties[18] = "Guard" # Texte de Défense

Damage_Properties[19] = "Level Up" # Texte d'augmentation de niveau.
#------------------------------------------------------------------------------
end
#==============================================================================

#------------------------------------------------------------------------------
# Module RPG
#------------------------------------------------------------------------------
module RPG

class State

def animation_id
self.note.each_line { |line|
return line.gsub('Animation = ', '').to_i if line.include?('Animation = ')
}
return 0
end

def walk_slower?
self.note.each_line { |line| return true if line.include?("Walk Slower") }
return false
end

def walk_faster?
self.note.each_line { |line| return true if line.include?("Walk Faster") }
return false
end

def dont_walk?
self.note.each_line { |line| return true if line.include?("Don't Walk") }
return false
end

def duration
self.note.each_line { |line|
return line.gsub('Duration = ', '').to_i if line.include?('Duration = ')
}
return 300
end

end

class BaseItem

def ranged?
self.note.each_line { |line| return true if line.include?("Ranged") }
return false
end

def explosive?
self.note.each_line { |line| return true if line.include?("Explosive") }
return false
end

def bomb?
self.note.each_line { |line| return true if line.include?("Bomb") }
return false
end

def graphic
self.note.each_line { |line|
if line.include?('Graphic = ')
graphic = line.gsub!('Graphic = ', '')
return graphic.chop
end
}
return ""
end

def index
self.note.each_line { |line|
return line.gsub('Index = ', '').to_i if line.include?('Index = ')
}
return 0
end

def move_speed
self.note.each_line { |line|
return line.gsub('Speed = ', '').to_i if line.include?('Speed = ')
}
return 4
end

def range
self.note.each_line { |line|
return line.gsub('Range = ', '').to_i if line.include?('Range = ')
}
return 5
end

def delay
self.note.each_line { |line|
return line.gsub('Delay = ', '').to_i if line.include?('Delay = ')
}
return 60
end

def area
self.note.each_line { |line|
return line.gsub('Area = ', '').to_i if line.include?('Area = ')
}
return 3
end

def shot_se
self.note.each_line { |line|
return line.gsub('Shot SE = ', '').to_s if line.include?('Shot SE = ')
}
return nil
end

def combo_hits
self.note.each_line { |line|
return line.gsub('Combo Hits = ', '').to_i if line.include?('Combo Hits = ')
}
return 5
end

def combo_rate
self.note.each_line { |line|
return line.gsub('Combo Rate = ', '').to_i if line.include?('Combo Rate = ')
}
return 75
end

def ammo1
self.note.each_line { |line|
return $data_items[line.gsub('Ammo1 = ', '').to_i] if line.include?('Ammo1 = ')
}
return nil
end

def ammo2
self.note.each_line { |line|
return $data_items[line.gsub('Ammo2 = ', '').to_i] if line.include?('Ammo2 = ')
}
return nil
end

def defense_rate
self.note.each_line { |line|
return line.gsub('Defense Rate = ', '').to_i if line.include?('Defense Rate = ')
}
return 75
end

end

end

#------------------------------------------------------------------------------
# Game Battler
#------------------------------------------------------------------------------
class Game_Battler

attr_accessor (:combo, :state_turns)

alias requiem_abs_gbattler_execute_damage execute_damage

def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2
damage = 0 if damage < 0
damage *= elements_max_rate(attacker.element_set)
damage /= 100
if damage == 0
damage = rand(2)
elsif damage > 0
@critical = (rand(100) < attacker.cri)
@critical = false if prevent_critical
damage *= 2 if @critical
if attacker.is_a?(Game_Actor) and Requiem_ABS::Combo_Damage
if $game_player.right_attack_on and attacker.weapons[0] != nil
hits = attacker.weapons[0].combo_hits
rate = attacker.weapons[0].combo_rate
elsif $game_player.left_attack_on and attacker.weapons[1] != nil
hits = attacker.weapons[1].combo_hits
rate = attacker.weapons[1].combo_rate
elsif $game_player.right_attack_on and attacker.weapons[0].nil?
hits = 5
rate = 75
elsif $game_player.left_attack_on and attacker.weapons[1].nil?
hits = 5
rate = 75
else
hits = rate = 0
end
@combo = ($game_player.hits >= hits and rand(100) <= rate)
else
@combo = false
end
damage *= 3 if @combo
damage = apply_variance(damage, 20)
damage = apply_guard(damage)
@hp_damage = damage
end
end

def remove_state(state_id)
return unless state?(state_id)
@states.delete(state_id)
@state_turns.delete(state_id)
end

end

#------------------------------------------------------------------------------
# Game Actor
#------------------------------------------------------------------------------
class Game_Actor

attr_accessor (:skill_hotkeys, :item_hotkeys)

alias requiem_abs_gactor_initialize initialize

def initialize(actor_id)
requiem_abs_gactor_initialize(actor_id)
reset_keys
end

def display_level_up(new_skills)
$game_system.battle_end_me.play
$game_player.animation_id = Requiem_ABS::LevelUp_Animation
if Requiem_ABS::Restaure_When_UpLevel
$game_player.actor.hp = $game_player.actor.maxhp
$game_player.actor.mp = $game_player.actor.maxmp
end
end

def atk_animation_id2
if two_swords_style
return weapons[1].nil? ? 1 : weapons[1].animation_id
else
return 1
end
end

def reset_keys
skil_key = {}
key_skil = []
for s in Requiem_ABS::Skill_Buttons
key_skil.push(s)
skil_key[s] = 0
end
@skill_hotkeys = skil_key
conjure_key = {}
item_key = {}
key_item = []
for i in Requiem_ABS::Item_Buttons
key_item.push(i)
item_key[i] = 0
end
@item_hotkeys = item_key
end

end

#------------------------------------------------------------------------------
# Game Enemy
#------------------------------------------------------------------------------
class Game_Enemy < Game_Battler

def attack_animation_id
enemy.note.each_line { |line|
return line.gsub('Attack Animation = ', '').to_i if line.include?('Attack Animation = ')
}
return 1
end

def die_animation_id
enemy.note.each_line { |line|
return line.gsub('Die Animation = ', '').to_i if line.include?('Die Animation = ')
}
return nil
end

def die_se
enemy.note.each_line { |line|
return line.gsub('Die SE = ', '').to_s if line.include?('Die SE = ')
}
return nil
end

end

#------------------------------------------------------------------------------
# Game Map
#------------------------------------------------------------------------------
class Game_Map

def passable?(x, y, flag = 0x01)
all_passable?(x, y, flag)
end

def hero_passable?(x, y, flag = 0x01)
all_passable?(x, y, flag)
end

def range_passable?(x, y, flag = 0x01)
return true if @passages[@map.data[x,y,0]] == 9
all_passable?(x, y, flag)
end

def all_passable?(x, y, flag = 0x01)
for drop in $game_drop
next if drop.nil?
return false if drop.x == x and drop.y == y
end
for event in events_xy(x, y)
next if event.tile_id == 0
next if event.priority_type > 0
next if event.through
pass = @passages[event.tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
for i in [2, 1, 0]
tile_id = @map.data[x, y, i]
return false if tile_id.nil?
pass = @passages[tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
return false
end

def update_events
for event in @events.values
if in_range?(event) or event.trigger == 3 or event.trigger == 4
event.update
end
end
for common_event in @common_events.values
common_event.update
end
end

def in_range?(object)
return false if object.real_x < (@display_x-256)
return false if object.real_x > (@display_x+(Graphics.width*Cool+64)
return false if object.real_y < (@display_y-256)
return false if object.real_y > (@display_y+(Graphics.height*Cool+64)
return true
end

end

#------------------------------------------------------------------------------
# Game Character
#------------------------------------------------------------------------------
class Game_Character

alias requiem_abs_gchar_initialize initialize
alias requiem_abs_gchar_update update

attr_accessor (:actor, :damage, :critical, :combo, :hit, :state_id, :ani_time,
:state_time, :weapon1_attack_time, :weapon2_attack_time, :skill_attack_time,
:item_attack_time, :recovery_time, :assigned_skill, :deffending,
:target, :character_name, :character_index, :show_bar, :graphic_name,
:graphic_index, :freeze, :original_move_speed, :anime_attack,
:right_attack_on, :left_attack_on, :priority_type)

def initialize
requiem_abs_gchar_initialize
@state_id = 0
@ani_time = 0
@state_time = 0
@weapon1_attack_time = 0
@weapon2_attack_time = 0
@skill_attack_time = 0
@item_attack_time = 0
@recovery_time = 0
@assigned_skill = 0
@original_move_speed = 0
@anime_attack = 0
@actor = nil
@damage = nil
@hit = nil
@target = nil
@critical = false
@combo = false
@deffending = false
@show_bar = false
@freeze = false
@right_attack_on = false
@left_attack_on = false
end

def update
requiem_abs_gchar_update
return if $game_party.members.size <= 0
decrease_counters
states_properties
$game_temp.next_scene = "gameover" if $game_party.members[0].dead?
end

def decrease_counters
@ani_time -= 1 if @ani_time > 0
@weapon1_attack_time -= 1 if @weapon1_attack_time > 0
@weapon2_attack_time -= 1 if @weapon2_attack_time > 0
@skill_attack_time -= 1 if @skill_attack_time > 0
@item_attack_time -= 1 if @item_attack_time > 0
@recovery_time -= 1 if @recovery_time > 0
@anime_attack -= 1 if @anime_attack > 0
if @anime_attack <= 0
@right_attack_on = false
@left_attack_on = false
end
end

def states_properties
if self.is_a?(Game_Event) and self.in_battle or self.is_a?(Game_Player)
anime_states
remove_state
states_effects
end
end

def anime_states
@state_id = 0
for state in @actor.states
return if state.nil? or state == 0
@state_id = state.id
end
end

def remove_state
return if @state_id.nil? or @state_id == 0
if @state_time < @actor.state_turns[@state_id] * 60
@state_time += 1
elsif @state_time >= @actor.state_turns[@state_id] * 60
for state in @actor.states
@freeze = false if state.dont_walk?
@move_speed = @original_move_speed if state.walk_slower?
@move_speed = @original_move_speed if state.walk_faster?
end
@actor.remove_state(@state_id)
@state_time = 0
end
end

def states_effects
for state in @actor.states
@freeze = true if state.dont_walk?
@move_speed = 2 if state.walk_slower?
@move_speed = 5 if state.walk_faster?
if self.is_a?(Game_Event) and @actor.slip_damage? and Graphics.frame_count % 60 <= 0
@actor.hp -= (@actor.maxhp*10/100)
end
end
end

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 guard?(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 movable?
return false if moving?
return false if @move_route_forcing
return true
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

#------------------------------------------------------------------------------
# Game Event
#------------------------------------------------------------------------------
class Game_Event < Game_Character

attr_reader (:in_battle, :kill_with_weapon, :kill_with_skill, :kill_with_item,
:respawn, :boss, :object, :puzzle)

alias requiem_abs_gevent_initialize initialize
alias requiem_abs_gevent_setup setup
alias requiem_abs_gevent_update update
alias requiem_abs_gevent_refresh refresh

def initialize(map_id, event)
@enemy_id = 0
@respawn = nil
@in_battle = false
@boss = false
@object = false
@puzzle = false
requiem_abs_gevent_initialize(map_id, event)
self.target = $game_player
end

def setup(new_page)
requiem_abs_gevent_setup(new_page)
self.original_move_speed = @move_speed
end

def update
requiem_abs_gevent_update
@respawn -= 1 if !@in_battle and self.actor.nil? and @respawn != nil and @respawn > 0
if @in_battle and !self.actor.dead?
make_attack($data_enemies[@enemy_id])
elsif @in_battle and self.actor.dead?
kill_enemy
erasing
elsif !@in_battle and self.actor.nil? and @respawn != nil and @respawn <= 0
@erased = false
@starting = false
refresh
end
end

def refresh
requiem_abs_gevent_refresh
@enemy_id = check_comment("Enemy")
@follow_distance = check_comment("Follow")
@erase = check_com("Die Erase")
@switch_local_a = check_com("Die Self Switch A")
@switch_local_b = check_com("Die Self Switch B")
@switch_local_c = check_com("Die Self Switch C")
@switch_local_d = check_com("Die Self Switch D")
@switch = check_comment("Die Switch")
@variable = check_comment("Die Variable")
@kill_with_weapon = check_comment("Kill With Weapon")
@kill_with_skill = check_comment("Kill With Skill")
@kill_with_item = check_comment("Kill With Item")
@boss = check_com("Boss")
@object = check_com("Object")
@puzzle = check_com("Puzzle")
if @enemy_id > 0 and !@in_battle
@respawn = check_comment("Respawn")
@respawn = nil if @respawn <= 0
self.actor = Game_Enemy.new(0, @enemy_id)
self.actor.recover_all
@in_battle = true
@killed = false
elsif @enemy_id <= 0
@in_battle = false
end
@opacity = 255
@blend_type = 0
end

def make_attack(enemy)
return if $game_map.interpreter.running?
return if $game_player.in_vehicle? or $game_player.in_airship?
for action in enemy.actions
next unless self.actor.conditions_met?(action) or rand(11) < action.rating
case action.kind
when 0
case action.basic
when 0
attack_normal
when 1
self.deffending = true
end
when 1
return if self.weapon1_attack_time > 0
self.assigned_skill = $data_skills[action.skill_id]
return if self.assigned_skill.nil?
case self.assigned_skill.scope
when 1..6
if self.assigned_skill.ranged?
if in_direction?(self, $game_player) and in_range?(self, $game_player, self.assigned_skill.range)
skill_range
elsif action.rating == 10
skill_range
end
else
skill_normal
end
when 7..11
skill_recover
end
end
end
end

def attack_normal
if in_front?(self,$game_player) and self.weapon1_attack_time <= 0
return if $game_player.actor.nil?
$game_player.animation_id = self.actor.attack_animation_id
if $game_player.deffending and $game_player.guard?(self, $game_player) and (rand(100)) <= $game_player.actor.equips[1].defense_rate
$game_player.damage = Requiem_ABS::Damage_Properties[18]
else
$game_player.actor.attack_effect(self.actor)
if $game_player.actor.hp_damage > 0
$game_player.damage = $game_player.actor.hp_damage
$game_player.critical = true if $game_player.actor.critical
else
$game_player.damage = Requiem_ABS::Damage_Properties[6]
end
$game_player.jump(0,0)
end
self.weapon1_attack_time = Requiem_ABS::Enemy_Attack_Time
end
end

def skill_normal
if self.actor.mp >= self.assigned_skill.mp_cost and in_front?(self, $game_player) and self.weapon1_attack_time <= 0
return if $game_player.actor.nil?
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
$game_player.animation_id = self.assigned_skill.animation_id
if $game_player.deffending and $game_player.guard?(self, $game_player) and !self.assigned_skill.ignore_defense and (rand(100)) <= $game_player.actor.equips[1].defense_rate
$game_player.damage = Requiem_ABS::Damage_Properties[18]
else
$game_player.actor.skill_effect(self.actor, self.assigned_skill)
if $game_player.actor.hp_damage > 0
$game_player.damage = $game_player.actor.hp_damage
else
$game_player.damage = Requiem_ABS::Damage_Properties[6]
end
$game_player.jump(0,0)
end
self.weapon1_attack_time = Requiem_ABS::Enemy_Attack_Time
end
end

def skill_range
if self.actor.mp >= self.assigned_skill.mp_cost and self.weapon1_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
$game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 3))
self.weapon1_attack_time = self.assigned_skill.delay
RPG::SE.new(self.assigned_skill.shot_se).play if self.assigned_skill.shot_se != nil
end
end

def skill_recover
if self.actor.mp >= self.assigned_skill.mp_cost and self.actor.hp <= (self.actor.maxhp*25/100) and self.weapon1_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
@animation_id = self.assigned_skill.animation_id
self.actor.skill_effect(self.actor, self.assigned_skill)
if self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
elsif self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
end
self.weapon1_attack_time = Requiem_ABS::Enemy_Attack_Time
end
for event in $game_map.events.values
if event.in_battle and in_range?(self, event, 5)
if self.actor.mp >= self.assigned_skill.mp_cost and event.actor.hp <= (event.actor.maxhp*25/100) and self.weapon1_attack_time <= 0
self.actor.mp -= self.assigned_skill.mp_cost
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
event.animation_id = self.assigned_skill.animation_id
event.actor.skill_effect(self.actor, self.assigned_skill)
if event.actor.hp_damage < 0
event.damage = event.actor.hp_damage
elsif self.actor.mp_damage < 0
event.damage = event.actor.mp_damage
end
self.weapon1_attack_time = Requiem_ABS::Enemy_Attack_Time
end
end
end
end

def erasing
return if @puzzle
@blend_type = 2
@opacity -= 5
end

def kill_enemy
dying unless @killed
if @opacity <= 0 or @puzzle
self.actor = nil
desactive_enemy
@in_battle = false
self.show_bar = false
$game_player.hits = 0
end
end

def dying
$game_player.actor.gain_exp(self.actor.exp, 1)
make_drop
unless @puzzle
if self.actor.die_animation_id != nil
@animation_id = self.actor.die_animation_id
end
if self.actor.die_se != nil
RPG::SE.new(self.actor.die_se).play
else
Sound.play_enemy_collapse
end
end
@killed = true
end

def desactive_enemy
if @erase
erase
elsif @switch_local_a
key = [$game_map.map_id, self.id, "A"]
$game_self_switches[key] = !$game_self_switches[key]
elsif @switch_local_b
key = [$game_map.map_id, self.id, "B"]
$game_self_switches[key] = !$game_self_switches[key]
elsif @switch_local_c
key = [$game_map.map_id, self.id, "C"]
$game_self_switches[key] = !$game_self_switches[key]
elsif @switch_local_d
key = [$game_map.map_id, self.id, "D"]
$game_self_switches[key] = !$game_self_switches[key]
elsif @switch > 0
$game_switches[@switch] = !$game_switches[@switch]
elsif @variable > 0
$game_variables[@variable] += 1
end
$game_map.need_refresh = true
end

def make_drop
for item in make_item1
next if item.nil?
$game_drop.push(Game_Drop.new(self, item.icon_index, [item] ,0))
end
for item in make_item2
next if item.nil?
$game_drop.push(Game_Drop.new(self, item.icon_index, [item] ,0))
end
if self.actor.gold > 0 and (rand(100)) <= Requiem_ABS::Gold_Drop_Rate
$game_drop.push(Game_Drop.new(self, Requiem_ABS::Gold_Drop_Graphic, [], self.actor.gold))
end
end

def make_item1
drop_items = []
for i in [self.actor.drop_item1]
next if i.kind <= 0
next if rand(i.denominator) != 0
if i.kind == 1
drop_items.push($data_items[i.item_id])
elsif i.kind == 2
drop_items.push($data_weapons[i.weapon_id])
elsif i.kind == 3
drop_items.push($data_armors[i.armor_id])
end
end
return drop_items
end

def make_item2
drop_items = []
for i in [self.actor.drop_item2]
next if i.kind <= 0
next if rand(i.denominator) != 0
if i.kind == 1
drop_items.push($data_items[i.item_id])
elsif i.kind == 2
drop_items.push($data_weapons[i.weapon_id])
elsif i.kind == 3
drop_items.push($data_armors[i.armor_id])
end
end
return drop_items
end

def update_self_movement
return if self.freeze
if @in_battle and in_range?(self, self.target, @follow_distance) and @stop_count > 30 * (5 - @move_frequency)
return unless movable?
move_toward(self.target)
elsif @stop_count > 30 * (5 - @move_frequency)
case @move_type
when 1
move_type_random
when 2
move_type_toward_player
when 3
move_type_custom
end
end
end

def check_comment(comentario)
com = comentario.downcase
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 =~ /#{com}[ ]?(\d+)?/
return $1.to_i
end
end
end
return 0
end

def check_com(comentario)
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?(comentario.downcase)
return true
end
end
end
return false
end

end

#------------------------------------------------------------------------------
# Game Player
#------------------------------------------------------------------------------
class Game_Player < Game_Character

attr_accessor (:hits, :hit_time, :assigned_item, :bomb_already, :reward)

alias requiem_abs_gplayer_initialize initialize
alias requiem_abs_gplayer_update update
alias requiem_abs_gplayer_perform_transfer perform_transfer
alias requiem_abs_gplayer_move_by_input move_by_input

def initialize
requiem_abs_gplayer_initialize
@hits = 0
@hit_time = 0
@assigned_item = 0
@bomb_already = false
@reward = nil
self.original_move_speed = 4
end

def update
self.actor = $game_party.members[0]
requiem_abs_gplayer_update
return if $game_map.interpreter.running?
return if self.actor.nil?
attack_with_weapon
attack_with_skill
attack_with_item
auto_recovery
if self.right_attack_on and @attack_weapon != nil
@hits = 0 if @hit_time <= 0 or @hits >= @attack_weapon.combo_hits
elsif self.left_attack_on and @attack_weapon_and_Shield != nil
@hits = 0 if @hit_time <= 0 or @hits >= @attack_weapon_and_Shield.combo_hits
elsif self.right_attack_on and @attack_weapon.nil?
@hits = 0 if @hit_time <= 0 or @hits >= 5
elsif self.left_attack_on and @attack_weapon_and_Shield.nil?
@hits = 0 if @hit_time <= 0 or @hits >= 5
end
@hit_time -= 1 if @hit_time > 0
end

def hit_count
return unless Requiem_ABS::Combo_Damage
@hits += 1
@hit = "#{@hits}"
end

def attack_with_weapon
if Input.trigger?(Requiem_ABS::Right_Attack_Button) and self.weapon1_attack_time <= 0 and !self.deffending
@attack_weapon = self.actor.equips[0]
RPG::SE.new(@attack_weapon.shot_se).play if @attack_weapon != nil and @attack_weapon.shot_se != nil
self.anime_attack = 20
self.right_attack_on = true
self.left_attack_on = false
if @attack_weapon != nil and @attack_weapon.ranged?
range_attack_right
self.weapon1_attack_time = @attack_weapon.delay
else
normal_attack_right
self.weapon1_attack_time = Requiem_ABS::Hero_Attack_Time
@hit_time = self.weapon1_attack_time + 15
end
end
if Input.press?(Requiem_ABS::Left_Attack_and_Shield_Button)
self.deffending = (self.actor.equips[1].is_a?(RPG::Armor) and Requiem_ABS::Allow_Shields_Graphics)
else
self.deffending = false
end
if Input.trigger?(Requiem_ABS::Left_Attack_and_Shield_Button) and self.weapon2_attack_time <= 0 and !self.deffending
@attack_weapon_and_Shield = (self.actor.two_swords_style ? self.actor.equips[1] : self.actor.equips[0])
RPG::SE.new(@attack_weapon_and_Shield.shot_se).play if @attack_weapon_and_Shield != nil and @attack_weapon_and_Shield.shot_se != nil
self.anime_attack = 20
self.right_attack_on = false
self.left_attack_on = true
if @attack_weapon_and_Shield != nil and @attack_weapon_and_Shield.ranged?
range_attack_left
self.weapon2_attack_time = @attack_weapon_and_Shield.delay
elsif self.actor.two_swords_style
normal_attack_left
self.weapon2_attack_time = Requiem_ABS::Hero_Attack_Time
@hit_time = self.weapon1_attack_time + 15
end
end
end

def attack_with_skill
for button in self.actor.skill_hotkeys.keys
if Input.trigger?(button) and self.actor.skill_hotkeys[button] != nil and self.actor.skill_hotkeys[button] != 0
self.assigned_skill = $data_skills[self.actor.skill_hotkeys[button]]
if self.assigned_skill.scope == 2
skill_attack_all
elsif self.assigned_skill.ranged?
skill_attack_range
elsif self.assigned_skill.explosive?
skill_exlpode_range
elsif self.assigned_skill.scope >= 7
skill_recover
else
skill_attack_normal
end
end
end
end

def attack_with_item
for button in self.actor.item_hotkeys.keys
if Input.trigger?(button) and self.actor.item_hotkeys[button] != nil and self.actor.item_hotkeys[button] != 0
@assigned_item = $data_items[self.actor.item_hotkeys[button]]
if @assigned_item.ranged?
item_attack_range
elsif @assigned_item.explosive?
item_attack_explode
elsif @assigned_item.bomb?
item_attack_bomb
else
case @assigned_item.scope
when 1
item_normal_attack
when 2
item_attack_all
when 3...6
item_normal_attack
when 7..11
item_recover
end
end
end
end
end

def normal_attack_right
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object
event.animation_id = self.actor.atk_animation_id
hit_count
if event.deffending and guard?(self,event) or
event.kill_with_weapon > 0 and @attack_weapon != event.kill_with_weapon or
event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
end
end
end
end

def range_attack_right
if $game_party.has_item?(@attack_weapon.ammo1)
$game_party.consume_item(@attack_weapon.ammo1)
$game_range.push(Game_Range.new(self, @attack_weapon.graphic, @attack_weapon.index, @attack_weapon.move_speed, @attack_weapon.range, 1))
end
end

def normal_attack_left
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object
event.animation_id = self.actor.atk_animation_id2
hit_count
if event.deffending and guard?(self,event) or
event.kill_with_weapon > 0 and @attack_weapon_and_Shield != event.kill_with_weapon or
event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
end
end
end
end

def range_attack_left
if $game_party.has_item?(@attack_weapon_and_Shield.ammo2)
$game_party.consume_item(@attack_weapon_and_Shield.ammo2)
$game_range.push(Game_Range.new(self, @attack_weapon_and_Shield.graphic, @attack_weapon_and_Shield.index, @attack_weapon_and_Shield.move_speed, @attack_weapon_and_Shield.range, 2))
end
end

def skill_attack_normal
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event) and self.skill_attack_time <= 0
return if event.actor.dead? or event.object
if self.actor.mp >= self.assigned_skill.mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
event.animation_id = self.assigned_skill.animation_id
if event.deffending and guard?(self,event) and !self.assigned_skill.ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and event.kill_with_skill != self.assigned_skill.id
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, self.assigned_skill)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
self.skill_attack_time = Requiem_ABS::Hero_Attack_Time
end
end
end
end
end

def skill_attack_range
if self.actor.mp >= self.assigned_skill.mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
$game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 3))
self.skill_attack_time = self.assigned_skill.delay
RPG::SE.new(self.assigned_skill.shot_se).play if self.assigned_skill.shot_se != nil
end
end

def skill_attack_all
if self.actor.mp >= self.assigned_skill.mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
for event in $game_map.events.values
if event.in_battle
return if event.actor.dead? or event.object
event.animation_id = self.assigned_skill.animation_id
if event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and event.kill_with_skill != self.assigned_skill.id
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, self.assigned_skill)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
self.skill_attack_time = Requiem_ABS::Hero_Attack_Time
end
end
end
end

def skill_exlpode_range
if self.actor.mp >= self.assigned_skill.mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
$game_range.push(Game_Range.new(self, self.assigned_skill.graphic, self.assigned_skill.index, self.assigned_skill.move_speed, self.assigned_skill.range, 4))
self.skill_attack_time = self.assigned_skill.delay
RPG::SE.new(self.assigned_skill.shot_se).play if self.assigned_skill.shot_se != nil
end
end

def skill_recover
if self.actor.mp >= self.assigned_skill.mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost(self.assigned_skill)
$game_temp.common_event_id = self.assigned_skill.common_event_id if self.assigned_skill.common_event_id > 0
self.actor.skill_effect(self.actor, self.assigned_skill)
if self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
elsif self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
end
@animation_id = self.assigned_skill.animation_id
self.skill_attack_time = Requiem_ABS::Hero_Attack_Time
end
end

def item_normal_attack
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event) and self.item_attack_time <= 0
return if event.actor.dead? or event.object
if $game_party.has_item?(@assigned_item) and self.item_attack_time <= 0
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
event.animation_id = @assigned_item.animation_id
if event.deffending and guard?(self,event) and !@assigned_item.ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_skill > 0 or
event.kill_with_item > 0 and event.kill_with_item != self.assigned_item.id
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.item_effect(self.actor, @assigned_item)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
self.item_attack_time = Requiem_ABS::Hero_Attack_Time
end
end
end
end
end

def item_attack_range
if $game_party.has_item?(@assigned_item) and self.item_attack_time <= 0
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
$game_range.push(Game_Range.new(self, @assigned_item.graphic, @assigned_item.index, @assigned_item.move_speed, @assigned_item.range, 5))
self.item_attack_time = @assigned_item.delay
RPG::SE.new(@assigned_item.shot_se).play if @assigned_item.shot_se != nil
end
end

def item_attack_explode
if $game_party.has_item?(@assigned_item) and self.item_attack_time <= 0
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
$game_range.push(Game_Range.new(self, @assigned_item.graphic, @assigned_item.index, @assigned_item.move_speed, @assigned_item.range, 6))
self.item_attack_time = @assigned_item.delay
RPG::SE.new(@assigned_item.shot_se).play if @assigned_item.shot_se != nil
end
end

def item_recover
if $game_party.has_item?(@assigned_item) and self.item_attack_time <= 0
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
self.actor.item_effect(self.actor, @assigned_item)
if self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
elsif self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
end
@animation_id = @assigned_item.animation_id
self.item_attack_time = Requiem_ABS::Hero_Attack_Time
end
end

def item_attack_all
if $game_party.has_item?(@assigned_item) and self.item_attack_time <= 0
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
for event in $game_map.events.values
if event.in_battle
return if event.actor.dead? or event.object
event.animation_id = @assigned_item.animation_id
if event.kill_with_weapon > 0 or event.kill_with_skill > 0 or
event.kill_with_item > 0 and event.kill_with_item != self.assigned_item.id
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.item_effect(self.actor, @assigned_item)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
event.target = self
self.item_attack_time = Requiem_ABS::Hero_Attack_Time
end
end
end
end

def item_attack_bomb
if $game_party.has_item?(@assigned_item) and !@bomb_already
$game_party.consume_item(@assigned_item)
$game_temp.common_event_id = @assigned_item.common_event_id if @assigned_item.common_event_id > 0
$game_bomb.push(Game_Bomb.new(self, @assigned_item, @assigned_item.icon_index, @assigned_item.area, @assigned_item.delay))
end
end

def auto_recovery
if self.actor.auto_hp_recover and self.recovery_time <= 0
self.actor.hp += (self.actor.maxhp*10/100)
self.recovery_time = 1800
end
end

def perform_transfer
requiem_abs_gplayer_perform_transfer
for range in $game_range
next if range.nil?
range.destroy = true
end
for drop in $game_drop
next if drop.nil?
drop.destroy = true
end
$game_map.need_refresh = true
end

def map_passable?(x, y)
case @vehicle_type
when 0
return $game_map.boat_passable?(x, y)
when 1
return $game_map.ship_passable?(x, y)
when 2
return true
else
return $game_map.hero_passable?(x, y)
end
end

def move_by_input
return if self.freeze or (self.anime_attack/3) > 0
requiem_abs_gplayer_move_by_input
end

end
Mikenatoli
Mikenatoli
Membre

Nombre de messages : 27
Age : 28
Distinction : aucune
Date d'inscription : 28/09/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 17:09
Suite du script Requiem ABS 4:
Spoiler:


#------------------------------------------------------------------------------
# Game Range
#------------------------------------------------------------------------------
class Game_Range < Game_Character

attr_accessor (:draw, :destroy, :character_name)

def initialize(parent, chara_name="", chara_index=0, speed=4, range=0, type=0)
super()
@parent = parent
@character_name = chara_name
@character_index = chara_index
@move_speed = speed
@range = range
@type = type
@step = 0
@destroy = false
@draw = false
moveto(@parent.x, @parent.y)
@direction = @parent.direction
end

def update
super
return @destroy = true if @step > @range
move_route
end

def move_route
return unless movable?
move_forward
@step += 1
end

def check_event_trigger_touch(x,y)
return if @destroy
for event in $game_map.events.values
if event.in_battle
hurt_hero if $game_player.pos?(x,y) and @parent.is_a?(Game_Event)
hurt_enemy_weapon_right(event) if event.pos?(x,y) and @type == 1 and @parent.is_a?(Game_Player)
hurt_enemy_weapon_left(event) if event.pos?(x,y) and @type == 2 and @parent.is_a?(Game_Player)
hurt_enemy_skill(event) if event.pos?(x,y) and @type == 3 and @parent.is_a?(Game_Player)
hurt_enemy_skill_explode if event.pos?(x,y) and @type == 4 and @parent.is_a?(Game_Player)
hurt_enemy_item(event) if event.pos?(x,y) and @type == 5 and @parent.is_a?(Game_Player)
hurt_enemy_item_explode if event.pos?(x,y) and @type == 6 and @parent.is_a?(Game_Player)
end
end
end

def hurt_hero
@destroy = true
$game_player.animation_id = @parent.assigned_skill.animation_id
probability = rand(100)
if $game_player.deffending and guard?($game_player,@parent) and !@parent.assigned_skill.ignore_defense and probability <= $game_player.actor.equips[1].defense_rate
$game_player.damage = Requiem_ABS::Damage_Properties[18]
else
$game_party.members[0].skill_effect(@parent.actor, @parent.assigned_skill)
if $game_party.members[0].hp_damage > 0
$game_player.damage = $game_party.members[0].hp_damage
else
$game_player.damage = Requiem_ABS::Damage_Properties[6]
end
$game_player.jump(0,0)
end
end

def hurt_enemy_weapon_right(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object
enemy.target = @parent
enemy.animation_id = @parent.actor.equips[0].ammo1.animation_id if @parent.actor.equips[0].ammo1 != nil
if enemy.deffending and guard?(self, enemy) or
enemy.kill_with_weapon > 0 and @parent.actor.weapon_id != enemy.kill_with_weapon or
enemy.kill_with_skill > 0 or enemy.kill_with_item > 0
enemy.damage = Requiem_ABS::Damage_Properties[18]
else
enemy.actor.attack_effect(@parent.actor)
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_ABS::Damage_Properties[6]
end
enemy.jump(0,0) unless enemy.puzzle
end
end

def hurt_enemy_weapon_left(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object
enemy.target = @parent
if @parent.actor.two_swords_style
@weapon = @parent.actor.equips[1]
else
@weapon = @parent.actor.equips[0]
end
enemy.animation_id = @weapon.ammo2.animation_id if @weapon.ammo2 != nil
if enemy.deffending and guard?(self, enemy) or
enemy.kill_with_weapon > 0 and @weapon.id != enemy.kill_with_weapon or
enemy.kill_with_skill > 0 or enemy.kill_with_item > 0
enemy.damage = Requiem_ABS::Damage_Properties[18]
else
enemy.actor.attack_effect(@parent.actor)
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_ABS::Damage_Properties[6]
end
enemy.jump(0,0) unless enemy.puzzle
end
end

def hurt_enemy_skill(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object
enemy.target = @parent
enemy.animation_id = @parent.assigned_skill.animation_id
if enemy.deffending and guard?(self, enemy) or
enemy.kill_with_weapon > 0 or enemy.kill_with_item > 0 or enemy.kill_with_skill > 0 and @parent.assigned_skill.id != enemy.kill_with_skill
enemy.damage = Requiem_ABS::Damage_Properties[18]
else
enemy.actor.skill_effect(@parent.actor, @parent.assigned_skill)
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_ABS::Damage_Properties[6]
end
enemy.jump(0,0) unless enemy.puzzle
end
end

def hurt_enemy_item(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object
enemy.animation_id = @parent.assigned_item.animation_id
if enemy.deffending and guard?(self, enemy) or
enemy.kill_with_weapon > 0 or enemy.kill_with_skill > 0 or
enemy.kill_with_item > 0 and @parent.assigned_item != enemy.kill_with_item
enemy.damage = Requiem_ABS::Damage_Properties[18]
else
enemy.actor.item_effect(@parent.actor, @parent.assigned_item)
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_ABS::Damage_Properties[6]
end
enemy.jump(0,0) unless enemy.puzzle
end
end

def hurt_enemy_skill_explode
@destroy = true
for event in $game_map.events.values
if event.in_battle
event.target = @parent
if in_range?(self, event, @parent.assigned_skill.area)
return if event.actor.dead? or event.object
event.animation_id = @parent.assigned_skill.animation_id
if event.deffending and guard?(self,event) or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and @parent.assigned_skill != event.kill_with_skill
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.skill_effect(@parent.actor, @parent.assigned_skill)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
event.jump(0,0) unless event.puzzle
end
end
end
end
end

def hurt_enemy_item_explode
@destroy = true
for event in $game_map.events.values
if event.in_battle and in_range?(self, event, @parent.assigned_item.area)
return if event.actor.dead? or event.object
event.animation_id = @parent.assigned_item.animation_id
if event.deffending and guard?(self, event) or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and @parent.assigned_item != event.kill_with_skill
event.damage = Requiem_ABS::Damage_Properties[18]
else
event.actor.item_effect(@parent.actor, @parent.assigned_item)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_ABS::Damage_Properties[6]
end
end
event.jump(0,0) unless event.puzzle
end
end
end

def map_passable?(x, y)
return $game_map.range_passable?(x, y)
end

end

#------------------------------------------------------------------------------
# Game Bomb
#------------------------------------------------------------------------------
class Game_Bomb < Game_Character

attr_accessor (:draw, :destroy, :graphic_name)

def initialize(parent, item, graph_index=0, area=0, time=0)
super()
@destroy = false
@draw = false
@parent = parent
@item = item
@graphic_name = "IconSet"
@graphic_index = graph_index
@area = area
@time = time
self.priority_type = 2
case @parent.direction
when 2
moveto(@parent.x, @parent.y+1)
when 4
moveto(@parent.x-1, @parent.y)
when 6
moveto(@parent.x+1, @parent.y)
when 8
moveto(@parent.x, @parent.y-1)
end
RPG::SE.new(Requiem_ABS::Drop_Item_SE).play if Requiem_ABS::Drop_Item_SE != ""
move_random if !moving? and !$game_map.passable?(@x, @y) or !moving? and $game_map.events_xy(@x, @y)
$game_player.bomb_already = true
jump(0,0)
end

def update
super
return if @destroy
if @item.shot_se != nil and Graphics.frame_count % 60 <= 0
RPG::SE.new(@item.shot_se).play
end
@time -= 1 if @time > 0
explode if @time <= 0
end

def explode
self.animation_id = @item.animation_id
if in_range?(self, $game_player, @area)
$game_player.actor.item_effect(@parent.actor, @item)
if $game_player.actor.hp_damage > 0
$game_player.damage = $game_player.actor.hp_damage
else
$game_player.damage = Requiem_SBABS::Damage_Properties[6]
end
$game_player.jump(0, 0)
end
for event in $game_map.events.values
if event.in_battle and in_range?(self, event, @area)
event.actor.item_effect(@parent.actor, @item)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0, 0) unless event.puzzle
end
end
$game_player.bomb_already = false
@destroy = true
end

def check_event_trigger_touch(x, y)
end

end

#------------------------------------------------------------------------------
# Game Drop
#------------------------------------------------------------------------------
class Game_Drop < Game_Character

attr_accessor (:draw, :destroy, :graphic_name)

def initialize(parent, graph_index=0, items=[], gold=0)
super()
@graphic_name = "IconSet"
@graphic_index = graph_index
@items = items
@gold = gold
@drop_time = Requiem_ABS::Drop_Duration_Time
moveto(parent.x,parent.y)
move_random unless moving?
RPG::SE.new(Requiem_ABS::Drop_Item_SE).play if Requiem_ABS::Drop_Item_SE != "" and @items != nil
RPG::SE.new(Requiem_ABS::Drop_Money_SE).play if Requiem_ABS::Drop_Money_SE != "" and @gold > 0
@destroy = false
@draw = false
jump(0,0)
end

def update
super
return if @destroy
if Input.trigger?(Input::C)
if in_range?($game_player,self,1) and in_direction?($game_player,self)
get_reward
end
end
@drop_time -= 1 if @drop_time > 0
@destroy = true if @drop_time <= 0
end

def get_reward
RPG::SE.new(Requiem_ABS::Get_Reward_SE).play if Requiem_ABS::Get_Reward_SE != ""
if @gold > 0
$game_party.gain_gold(@gold)
$game_player.reward = "$ #{@gold}" if Requiem_ABS::Show_Reward
end
for item in @items
case item
when RPG::Item
$game_party.gain_item($data_items[item.id],1)
$game_player.reward = $data_items[item.id].name if Requiem_ABS::Show_Reward
when RPG::Weapon
$game_party.gain_item($data_weapons[item.id],1)
$game_player.reward = $data_weapons[item.id].name if Requiem_ABS::Show_Reward
when RPG::Armor
$game_party.gain_item($data_armors[item.id],1)
$game_player.reward = $data_armors[item.id].name if Requiem_ABS::Show_Reward
end
end
@destroy = true
end

def check_event_trigger_touch(x, y)
end

end

#------------------------------------------------------------------------------
# Sprite Base
#------------------------------------------------------------------------------
class Sprite_Base

alias animation animation_set_sprites

def animation_set_sprites(frame)
cell_data = frame.cell_data
for i in 0..15
sprite = @animation_sprites[i]
next if sprite.nil?
pattern = cell_data[i, 0]
if pattern.nil? or pattern == -1
sprite.visible = false
next
end
if pattern < 100
sprite.bitmap = @animation_bitmap1
else
sprite.bitmap = @animation_bitmap2
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192,
pattern % 100 / 5 * 192, 192, 192)
if @animation_mirror
sprite.x = @animation_ox - cell_data[i, 1] / Requiem_ABS::Animations_Divide_By
sprite.y = @animation_oy - cell_data[i, 2] / Requiem_ABS::Animations_Divide_By
sprite.angle = (360 - cell_data[i, 4])
sprite.mirror = (cell_data[i, 5] == 0)
else
sprite.x = @animation_ox + cell_data[i, 1] / Requiem_ABS::Animations_Divide_By
sprite.y = @animation_oy + cell_data[i, 2] / Requiem_ABS::Animations_Divide_By
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
end
sprite.z = self.z + 300
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / (100.0 * Requiem_ABS::Animations_Divide_By)
sprite.zoom_y = cell_data[i, 3] / (100.0 * Requiem_ABS::Animations_Divide_By)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end

end

#------------------------------------------------------------------------------
# Sprite Character
#------------------------------------------------------------------------------
class Sprite_Character < Sprite_Base

alias requiem_abs_spchar_initialize initialize
alias requiem_abs_spchar_update update
alias requiem_abs_spchar_dispose dispose

def initialize(viewport, character=nil)
@character = character
@_damage_duration = 0
@_hit_duration = 0
@_reward_duration = 0
requiem_abs_spchar_initialize(viewport,@character)
end

def update
requiem_abs_spchar_update
update_show_dmg
update_show_hit
update_show_reward
update_show_state_ani
end

def dispose
requiem_abs_spchar_dispose
dispose_damage
dispose_hit
dispose_reward
end

def update_show_dmg
if @_damage_duration > 0
@_damage_duration -=1
@_damage_sprite.y -= 1
@_damage_sprite.opacity -= 5 if @_damage_duration <= 30
@_damage_sprite.x = self.x
if @_damage_duration <= 0
dispose_damage
end
end
if @character != nil and @character.damage != nil
return if @character.is_a?(Game_Event) and @character.puzzle
damage(@character.damage, @character.critical, @character.combo)
@character.damage = nil
@character.critical = false
@character.combo = false
end
end

def update_show_hit
if @_hit_duration > 0
@_hit_duration -=1
@_hit_sprite.opacity -= 5 if @_hit_duration <= 40
elsif @_hit_duration <= 0
dispose_hit
end
if @character != nil and @character.hit != nil
hit(@character.hit)
@character.hit = nil
end
end

def update_show_reward
if @_reward_duration > 0
@_reward_duration -= 1
@_reward_sprite.opacity -= 5 if @_reward_duration <= 1000
if @_reward_duration <= 0
dispose_reward
end
end
if @character.is_a?(Game_Player) and @character.reward != nil
show_reward(@character.reward)
@character.reward = nil
end
end

def update_show_state_ani
return if @character.actor.nil?
for state in @character.actor.states
next if state.nil? or state.animation_id <= 0
if @character.ani_time <= 0
@character.animation_id = state.animation_id
@character.ani_time = $data_animations[@character.animation_id].frame_max * 4 + 1
end
end
end

def damage(value, critical, combo)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160,100)
bitmap.font.name = Requiem_ABS::Damage_Properties[1]
bitmap.font.size = Requiem_ABS::Damage_Properties[2]
bitmap.font.bold = Requiem_ABS::Damage_Properties[3]
bitmap.font.italic = Requiem_ABS::Damage_Properties[4]
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,(Requiem_ABS::Damage_Properties[2]*2)+5,160,Requiem_ABS::Damage_Properties[2]+2,damage_string,1)
if value.is_a?(Numeric) and value <= 0
bitmap.font.color = Requiem_ABS::Damage_Properties[14]
else
bitmap.font.color = Requiem_ABS::Damage_Properties[13]
end
bitmap.draw_text(0,(Requiem_ABS::Damage_Properties[2]*2)+4,160,Requiem_ABS::Damage_Properties[2]+2,damage_string,1)
if critical
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,Requiem_ABS::Damage_Properties[2]+5,160,Requiem_ABS::Damage_Properties[2]+2,Requiem_ABS::Damage_Properties[5],1)
bitmap.font.color = Requiem_ABS::Damage_Properties[15]
bitmap.draw_text(0,Requiem_ABS::Damage_Properties[2]+4,160,Requiem_ABS::Damage_Properties[2]+2,Requiem_ABS::Damage_Properties[5],1)
end
if combo
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,1,160,Requiem_ABS::Damage_Properties[2]+2,Requiem_ABS::Damage_Properties[12],1)
bitmap.font.color = Requiem_ABS::Damage_Properties[16]
bitmap.draw_text(0,0,160,Requiem_ABS::Damage_Properties[2]+2,Requiem_ABS::Damage_Properties[12],1)
end
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y-self.oy/2-60
@_damage_sprite.z += 99999
@_damage_duration = 60
end

def hit(value)
dispose_hit
if value.is_a?(Numeric)
hit_string = value.abs.to_s
else
hit_string = value.to_s
end
bitmap = Bitmap.new(160, Requiem_ABS::Damage_Properties[9])
bitmap.font.name = Requiem_ABS::Damage_Properties[8]
bitmap.font.size = Requiem_ABS::Damage_Properties[9]
bitmap.font.bold = Requiem_ABS::Damage_Properties[10]
bitmap.font.italic = Requiem_ABS::Damage_Properties[11]
bitmap.font.color.set(255,255,255)
@_hit_sprite = ::Sprite.new(self.viewport)
@_hit_sprite.bitmap = bitmap
@_hit_sprite.x = 374
@_hit_sprite.y = 208 - Requiem_ABS::Damage_Properties[9]
@_hit_sprite.z += 99999
@_hit_duration = 80
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,1,160,36,"#{hit_string}"+" "+"#{Requiem_ABS::Damage_Properties[7]}",2)
bitmap.font.color = Requiem_ABS::Damage_Properties[17]
bitmap.draw_text(0,0,160,36,"#{hit_string}"+" "+"#{Requiem_ABS::Damage_Properties[7]}",2)
end

def show_reward(reward)
dispose_reward
bitmap = Bitmap.new(200, 24)
bitmap.font.size = 16
bitmap.font.color = Color.new(0,0,0)
bitmap.draw_text(1, 1, bitmap.width, 24, reward)
bitmap.font.color = Color.new(255,255,255)
bitmap.draw_text(0, 0, bitmap.width, 24, reward)
@_reward_sprite = ::Sprite.new(self.viewport)
@_reward_sprite.bitmap = bitmap
@_reward_sprite.x = 10
@_reward_sprite.y = 196
@_reward_sprite.z = 99999
@_reward_duration = 1100
end

def dispose_damage
if @_damage_sprite != nil
@_damage_sprite.dispose
@_damage_sprite = nil
end
end

def dispose_hit
if @_hit_sprite != nil
@_hit_sprite.dispose
@_hit_sprite = nil
end
end

def dispose_reward
if @_reward_sprite != nil
@_reward_sprite.dispose
@_reward_sprite = nil
end
end

end

#------------------------------------------------------------------------------
# Sprite Drop
#------------------------------------------------------------------------------
class Sprite_Drop < Sprite_Base

attr_accessor :character

def initialize(viewport, character=nil)
super(viewport)
@character = character
update
end

def update
super
update_bitmap
self.visible = (not @character.transparent)
update_src_rect
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
start_animation(animation)
@character.animation_id = 0
end
if @character.balloon_id != 0
@balloon_id = @character.balloon_id
start_balloon
@character.balloon_id = 0
end
end

def update_bitmap
if @tile_id != @character.tile_id or
@graphic_name != @character.graphic_name or
@graphic_index != @character.graphic_index
@tile_id = @character.tile_id
@graphic_name = @character.graphic_name
@graphic_index = @character.graphic_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
end
end

def update_src_rect
if @tile_id == 0
index = @character.graphic_index
sx = index % 16 * 24
sy = index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end

end

#------------------------------------------------------------------------------
# Sprite Weapon
#------------------------------------------------------------------------------
class Sprite_Weapon < Sprite_Base

attr_accessor (:character, :graphic_name)

def initialize(viewport, character=nil)
super(viewport)
@character = character
update
end

def update
super
return unless Requiem_ABS::Allow_Weapons_Graphics
if @character.anime_attack > 0
self.visible = true
else
self.visible = false
end
update_bitmap
update_src_rect
change_direction
end

def update_bitmap
if @tile_id != @character.tile_id or @graphic_name != "Iconset" or @graphic_index != weapon_index
@tile_id = @character.tile_id
@graphic_name = "Iconset"
@graphic_index = weapon_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
self.zoom_x = 0.80
self.zoom_y = 0.80
end
end

def update_src_rect
if @tile_id == 0
sx = weapon_index % 16 * 24
sy = weapon_index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end

def change_direction
case @character.direction
when 2
self.x = @character.screen_x+10
self.z = @character.screen_z+1
self.mirror = false
change_angle(45,90,135)
when 4
self.x = @character.screen_x-10
self.z = @character.screen_z+1
self.mirror = false
change_angle(-45,0,45)
when 6
self.x = @character.screen_x+10
self.z = @character.screen_z-1
self.mirror = true
change_angle(45,0,-45)
when 8
self.x = @character.screen_x+10
self.z = @character.screen_z-1
self.mirror = true
change_angle(45,0,-45)
end
self.y = @character.screen_y-4
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
end

def change_angle(a,b,c)
if @character.anime_attack >= 20
self.angle = a
elsif @character.anime_attack >= 15
self.angle = b
elsif @character.anime_attack >= 10
self.angle = c
end
end

def weapon_index
return 0 if @character.actor.nil?
if @character.actor.is_a?(Game_Actor) and @character.right_attack_on and @character.actor.weapon_id > 0
return @character.actor.equips[0].icon_index
elsif @character.actor.is_a?(Game_Actor) and @character.left_attack_on
if @character.actor.two_swords_style and @character.actor.armor1_id > 0
return @character.actor.equips[1].icon_index
elsif @character.actor.two_hands_legal? and @character.actor.weapon_id > 0 and @character.actor.equips[0].ranged?
return @character.actor.equips[0].icon_index
else
return 0
end
end
return 0
end

end

#------------------------------------------------------------------------------
# Sprite Shield
#------------------------------------------------------------------------------
class Sprite_Shield < Sprite_Base

attr_accessor (:character, :graphic_name)

def initialize(viewport, character = nil)
super(viewport)
@character = character
update
end

def update
super
return unless Requiem_ABS::Allow_Shields_Graphics
update_bitmap
self.visible = (@character.deffending)
update_src_rect
case @character.direction
when 2
self.mirror = true
self.x = @character.screen_x+6
self.z = @character.screen_z+1
when 4
self.mirror = false
self.x = @character.screen_x-6
self.z = @character.screen_z+1
when 6
self.mirror = true
self.x = @character.screen_x+6
self.z = @character.screen_z-1
when 8
self.mirror = false
self.x = @character.screen_x-6
self.z = @character.screen_z-1
end
self.y = @character.screen_y
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.moving?
self.wave_amp = 1
self.wave_length = 1
self.wave_speed = 6
else
self.wave_amp = 0
end
end

def update_bitmap
if @tile_id != @character.tile_id or @graphic_name != "Iconset" or @graphic_index != shield_index
@tile_id = @character.tile_id
@graphic_name = "Iconset"
@graphic_index = shield_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
self.zoom_x = 0.80
self.zoom_y = 0.80
end
end

def update_src_rect
if @tile_id == 0
sx = shield_index % 16 * 24
sy = shield_index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end

def shield_index
return 0 if @character.actor.nil?
if @character.actor.is_a?(Game_Actor) and !@character.actor.two_swords_style and @character.actor.armor1_id > 0
return $data_armors[@character.actor.armor1_id].icon_index
else
return 0
end
end

end

#------------------------------------------------------------------------------
# Spriteset Map
#------------------------------------------------------------------------------
class Spriteset_Map

attr_accessor :viewport3

alias requiem_abs_sp_map_create_characters create_characters
alias requiem_abs_sp_map_dispose_characters dispose_characters

def create_characters
@range_sprites = []
for range in $game_range
next if range.nil?
@range_sprites.push(Sprite_Character.new(@viewport1, range))
end
@drop_sprites = []
for drop in $game_drop
next if drop.nil?
@drop_sprites.push(Sprite_Drop.new(@viewport1, drop))
end
for bomb in $game_bomb
next if bomb.nil?
@drop_sprites.push(Sprite_Drop.new(@viewport1, bomb))
end
@weapon_sprites = []
@weapon_sprites.push(Sprite_Weapon.new(@viewport1, $game_player))
@shield_sprites = []
@shield_sprites.push(Sprite_Shield.new(@viewport1, $game_player))
requiem_abs_sp_map_create_characters
end

def update_characters
for sprite in @character_sprites
if sprite.character.is_a?(Game_Event)
if $game_map.in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4
sprite.update
end
else
sprite.update
end
end
for range in @range_sprites
next if range.nil? or !$game_map.in_range?(range.character)
range.update
end
for drop in @drop_sprites
next if drop.nil? or !$game_map.in_range?(drop.character)
drop.update
end
for weapon in @weapon_sprites
next if weapon.nil? or !$game_map.in_range?(weapon.character)
weapon.update
end
for shield in @shield_sprites
next if shield.nil? or !$game_map.in_range?(shield.character)
shield.update
end
for range in $game_range
next if range.nil?
unless range.draw
@range_sprites.push(Sprite_Character.new(@viewport1,range))
range.draw = true
end
if range.destroy
$game_range.delete(range)
range.character_name = ""
end
end
for drop in $game_drop
next if drop.nil?
unless drop.draw
@drop_sprites.push(Sprite_Drop.new(@viewport1,drop))
drop.draw = true
end
if drop.destroy
$game_drop.delete(drop)
drop.graphic_name = ""
end
end
for bomb in $game_bomb
next if bomb.nil?
unless bomb.draw
@drop_sprites.push(Sprite_Drop.new(@viewport1, bomb))
bomb.draw = true
end
if bomb.destroy
$game_bomb.delete(bomb)
bomb.graphic_name = ""
end
end
end

def dispose_characters
requiem_abs_sp_map_dispose_characters
for range in @range_sprites
next if range.nil?
range.dispose
end
for drop in @drop_sprites
next if drop.nil?
drop.dispose
end
for weapon in @weapon_sprites
next if weapon.nil?
weapon.dispose
end
for shield in @shield_sprites
next if shield.nil?
shield.dispose
end
end

end

#------------------------------------------------------------------------------
# Window Base
#------------------------------------------------------------------------------
class Window_Base < Window

def draw_actor_head(actor, x, y, enabled=true)
char_name = actor.character_name
char_index = actor.character_index
bitmap = Cache.character(char_name)
sign = char_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
enbl = (enabled ? 255 : 128)
src_rect = Rect.new((char_index%4*3+1)*cw, (char_index/4*4)*ch, cw, ch/3*2)
self.contents.blt(x,y,bitmap,src_rect,enbl)
end

end

#------------------------------------------------------------------------------
# Scene Title
#------------------------------------------------------------------------------
class Scene_Title < Scene_Base

alias requiem_abs_scenetitle_create_game_objects create_game_objects

def create_game_objects
requiem_abs_scenetitle_create_game_objects
$game_range = []
$game_drop = []
$game_bomb = []
end

end

#------------------------------------------------------------------------------
# Scene Map
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base

alias requiem_abs_smap_update update
alias requiem_abs_smap_terminate terminate

def update
requiem_abs_smap_update
for range in $game_range
next if range.nil? or !$game_map.in_range?(range)
range.update
end
for drop in $game_drop
next if drop.nil? or !$game_map.in_range?(drop)
drop.update
end
for bomb in $game_bomb
next if bomb.nil? or !$game_map.in_range?(bomb)
bomb.update
end
end

def update_encounter
end

end

#------------------------------------------------------------------------------
# Scene Item
#------------------------------------------------------------------------------
class Window_Item < Window_Selectable

def update_help
if $scene.is_a?(Scene_Item) and $scene.message != nil
@help_window.set_text($scene.message)
else
@help_window.set_text(item == nil ? "" : item.description)
end
end

end

#------------------------------------------------------------------------------
class Scene_Item < Scene_Base

attr_accessor :message
attr_accessor :delay

alias requiem_abs_sitem_start start
alias requiem_abs_sitem_update update
alias requiem_abs_sitem_update_item_selection update_item_selection

def start
requiem_abs_sitem_start
@actor = $game_party.members[0]
@message = nil
@delay = 0
end

def update
requiem_abs_sitem_update
if @delay <= 0
@message = nil
else
@delay -= 1
end
end

def update_item_selection
requiem_abs_sitem_update_item_selection
for button in @actor.item_hotkeys.keys
if Input.trigger?(button) and @item_window.item.is_a?(RPG::Item)
Sound.play_decision
@actor.item_hotkeys[button] = @item_window.item.id
@message = Requiem_ABS::Memorize_Text
@delay = 120
end
end
end

end

#------------------------------------------------------------------------------
# Scene Skill
#------------------------------------------------------------------------------
class Window_Skill < Window_Selectable

def update_help
if $scene.is_a?(Scene_Skill) and $scene.message != nil
@help_window.set_text($scene.message)
else
@help_window.set_text(skill == nil ? "" : skill.description)
end
end

end

#------------------------------------------------------------------------------
class Scene_Skill < Scene_Base

attr_accessor :message
attr_accessor :delay

alias requiem_abs_sskill_start start
alias requiem_abs_sskill_update update
alias requiem_abs_sskill_update_skill_selection update_skill_selection

def start
requiem_abs_sskill_start
@message = nil
@delay = 0
end

def update
requiem_abs_sskill_update
if @delay <= 0
@message = nil
else
@delay -= 1
end
end

def update_skill_selection
requiem_abs_sskill_update_skill_selection
for button in @actor.skill_hotkeys.keys
if Input.trigger?(button)
Sound.play_decision
@actor.skill_hotkeys[button] = @skill_window.skill.id
@message = "Memorisé!"
@delay = 120
end
end
end

end

#------------------------------------------------------------------------------
# Scene File
#------------------------------------------------------------------------------
class Scene_File < Scene_Base

alias requiem_abs_sfile_write_save_data write_save_data
alias requiem_abs_sfile_read_save_data read_save_data

def write_save_data(file)
requiem_abs_sfile_write_save_data(file)
Marshal.dump($game_range, file)
Marshal.dump($game_drop, file)
Marshal.dump($game_bomb, file)
end

def read_save_data(file)
requiem_abs_sfile_read_save_data(file)
$game_range = Marshal.load(file)
$game_drop = Marshal.load(file)
$game_bomb = Marshal.load(file)
end

end

#------------------------------------------------------------------------------
# End of ABS
#------------------------------------------------------------------------------

Je ne sais pas si l'erreur est facile à voir, mais j'en sais rien du tout car je ne comprend pas ce language, j'espère que quelqu'un trouvera.

Merci d'avance! =)
Elphealer
Elphealer
Membre

Nombre de messages : 52
Age : 30
Localisation : Lyon
Distinction : aucune
Date d'inscription : 07/12/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 20:07
Pour ma part, je vais avoir du mal à trouver, il n'y pas de 'each' à la ligne 2296. Il n'y rien d'autre sur la page de ton script ?
Mikenatoli
Mikenatoli
Membre

Nombre de messages : 27
Age : 28
Distinction : aucune
Date d'inscription : 28/09/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 20:12
Tout est là malheureusement =(
Azuma-01
Azuma-01
Membre

Nombre de messages : 94
Age : 27
Localisation : Amos
Distinction : aucune
Date d'inscription : 22/09/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 20:50
Ton script de menu est en dessus ou en dessous de ceux de Requiem ABS 4?
Mettre le au dessus sinon il réécrit la scène sans contenir les variables du ABS.
Balbereith
Balbereith
Staffeux retraité

Nombre de messages : 4129
Age : 26
Localisation : dans l'ombre...
Distinction : Péripatéticienne à temps perdu
Helly n°666 [Coco' ;D]
mon ptit balbounet p'tit jardinier en herbe(les râteaux ça le connait) [tonton Adurna]
Cultivateur professionnel de la commu' (il a de bons outils en de nombreux exemplaires Problème script [Résolu] 522164 ) [Coco' Smile]
Date d'inscription : 13/05/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 21:44
ouh le triple post... arrange çà c'est dangereux ^^
ZangtherOld
ZangtherOld
Membre

Nombre de messages : 1711
Date d'inscription : 07/08/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 21:59
Et si tu nous mettazis cette fameuse ligne qui bug ?
J'ai la flemme de chercher dans les milliers de lignes de ce script.


@Balbereith a écrit:ouh le triple post... arrange çà c'est dangereux ^^

Tu sais que les modos sont là pour ce genre de choses ? En plus ton message est d'autant plus inutile car il a surement fait triple post pour pouvoir poster tout les scripts qui ne retraient pas dans le même message...
Djidane
Djidane
Membre

Nombre de messages : 1444
Age : 26
Localisation : Paris
Distinction : Héritier d'Alexdream (mais on l'aime quand même).
Lèche cul professionnel
et il aime ça!!!
Date d'inscription : 30/12/2008

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 22:06
Commençons pas à faire des remarques sur le triple poste (Ou sur le message de Balb' ) . Contentez vous d'aider .

Le bug vien de ton Script de menu ? Si tu le retire tu es sur que tout va bien ? Je dit sa car dans aucun cas le ABS de modifie le menu . Sinon une remarque à été faite au sujet du placement de ce script . Met le en dessous des scripts ABS.
Mikenatoli
Mikenatoli
Membre

Nombre de messages : 27
Age : 28
Distinction : aucune
Date d'inscription : 28/09/2009

Problème script [Résolu] Empty Re: Problème script [Résolu]

le Ven 26 Fév 2010 - 23:59
Magnifique le problème est résolu! Il fallait placer le script pour l'écran titre avant celui du Requiem ABS 4!

Merci beaucoup tous le monde!

(les 3 post c'est parce que sa ne rentrais pas en 1 seul et ni en 2 ^^')
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum