-20%
Le deal à ne pas rater :
-20% Récupérateur à eau mural 300 litres (Anthracite)
79 € 99 €
Voir le deal

Aller en bas
lulu56250
lulu56250
Membre

Nombre de messages : 192
Age : 26
Localisation : Chez moi
Distinction : aucune
Date d'inscription : 30/10/2009

Probleme de combat Empty Probleme de combat

Mer 11 Nov 2009 - 11:36
Salue j'ai un problème avec mon mode de combat
c'est un mode combat à la zelda mais quand je teste mon jeu
et que je me fait tuer je revien directement à la vie esce que c'est normal ??? Probleme de combat 264173



ba en faite je dois tuer des loup mais au lieu d'avoir un game over je retrouve toute ma vie


Dernière édition par lulu56250 le Mer 11 Nov 2009 - 11:49, édité 1 fois
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

Probleme de combat Empty Re: Probleme de combat

Mer 11 Nov 2009 - 11:45
s'est dans entraide que tu aurais dut poster pas dans les tuto
en plus tu explique mal ton problème
alors édit et demande à un modo de déplacé ton sujet avent que ce soit eux qui te trouve^^
et oui car :modo: ^^
j'aime les modo
yakzawik
yakzawik
Staffeux retraité

Nombre de messages : 1845
Age : 33
Localisation : Dans un trou perdu avec ma copine !
Distinction : Yakzawiki, l'encyclopédie libre !
[Elisa']
Force Zinzoline au fond de son coeur
Il est TROPDARKMECHAN
[Coco' Probleme de combat 522164]
Date d'inscription : 31/05/2008

Probleme de combat Empty Re: Probleme de combat

Mer 11 Nov 2009 - 12:33
Voilà, c'est déplacé.
Ce doit être un problème dans ton script.
Peux-tu nous montrer quel script tu utilises ?
lulu56250
lulu56250
Membre

Nombre de messages : 192
Age : 26
Localisation : Chez moi
Distinction : aucune
Date d'inscription : 30/10/2009

Probleme de combat Empty Re: Probleme de combat

Mer 11 Nov 2009 - 12:38
ABS:
#==============================================================================
# Crissaegrim ABS
# Traduit par nova
# http://rpgnation.free.fr
#==============================================================================
#--------------------------------------------------------------
# Crédits : Vlad, Chronos, Drod, nova (traduction)
#--------------------------------------------------------------
# Pour créer un monstre, créer un event :
# Enemy ID - L'ID de l'ennemi correspond à la base de données;
# Die X - onde X = 0 ou 1,2,3,4 (0 disparait après l'avoir tué, 1 active l'interupteur local 'A', 2 active l'interupteur local 'B', 3 active l'interupteur local 'C', 4 active l'interupteur local 'D')
# OBS.: entre X et X > 4 ,activer un interupteur X;
# Follow X - Pour que l'event suit le héros. X indique le nombre de pas necessaire pour que l'event se déplace en direction du héros.
#--------------------------------------------------------------
# Configuration général
#--------------------------------------------------------------
module Crissaegrim_ABS
#--------------------------------------------------------------
# Pour lancer une attaque physique, appuyez sur A :
Attack_Button = Input::X
#--------------------------------------------------------------
# Pour lancer une compétence, appuyez sur S ou D :
Skill_Button = {Input::Y=> 0,
Input::Z => 0}
#--------------------------------------------------------------
# Pour utiliser un objet, appuyez sur Q ou W :
Item_Button = {Input::L => 0,
Input::R => 0}
#--------------------------------------------------------------
Distance_Weapons = {}
# Armes à distance.
# Pour utiliser une arme à distance, faites U :
# U : ID de l'arme, V:Cases, W:Vitesse, X:Distance, Y:Munitions, Z:Temps d'attente avant l'attaque
# PS: Le graphique de projectile doit être seul.
Distance_Weapons[4] = ["!$Arrow", 6, 5, 21, 30]
#--------------------------------------------------------------
Distance_Skills = {}
# Compétences à distance.
# Pour utiliser une compétence à distance, faites: Distance_Skills[V] = [W, X, Y, Z] e mude:
# U : ID de l'arme, V:Cases, W:Vitesse, X:Distance, Y:Munitions, Z:Temps d'attente avant l'attaque
# PS: Le graphique de projectile doit être seul.
Distance_Skills[59] = ["!$FireBall", 4, 5, 60]
Distance_Skills[63] = ["!$EnergyBall_2", 4, 5, 60]
Distance_Skills[67] = ["!$EnergyBall_6", 4, 5, 60]
Distance_Skills[71] = ["!$EnergyBall", 4, 5, 60]
Distance_Skills[73] = ["!$EnergyBall_6", 4, 5, 60]
Distance_Skills[76] = ["!$EnergyBall_5", 4, 5, 60]
Distance_Skills[79] = ["!$EnergyBall_4", 4, 5, 60]
#--------------------------------------------------------------
Distance_Items = {}
# Objets à distances.
# Pour utiliser un objet à distance, faites: Distance_Items[U] = [V, W, X, Y, Z] e mude:
## U : ID de l'arme, V:Cases, W:Vitesse, X:Distance, Y:Munitions, Z:Temps d'attente avant l'attaque
# PS: Le graphique de projectile doit être seul.
Distance_Items[16] = ["!$EnergyBall_3", 6, 5, 16, 30]
Distance_Items[18] = ["!$EnergyBall", 6, 5, 18, 30]
Distance_Items[20] = ["!$EnergyBall_6", 6, 5, 20, 30]
#--------------------------------------------------------------
# Animation quand le héros passe au niveau supérieur.
#Changement de 40 à l'ID de l'animation.
LevelUp_Ani = 40
#--------------------------------------------------------------
#Animation de l'attaque ennemi, faites Enemy_atk_ani[X] = Y
# et faites remplacer le X par l'ID de l'ennemi, et Y par l'ID de l'animation.
Enemy_atk_ani = {}
Enemy_atk_ani[2] = 13
Enemy_atk_ani[3] = 19
#--------------------------------------------------------------
end
#==============================================================================

#--------------------------------------------------------------
# Game Character
#--------------------------------------------------------------
class Game_Character
attr_accessor :hp
attr_accessor :mp
attr_accessor :damage
attr_accessor :critical
attr_accessor :wait_action
attr_accessor :die
alias crissaegrim_abs_gchar_initialize initialize
def initialize
@hp = 0
@mp = 0
@die = 0
@wait_action = 0
@damage = nil
@critical = false
crissaegrim_abs_gchar_initialize
end
def recive_atk(attacker)
attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_actors[1])
receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_actors[1])
if self.is_a?(Game_Player)
$game_actors[1].attack_effect(attacker_status)
dmg = $game_actors[1].make_attack_damage_value(attacker_status)
$game_player.damage = dmg
$scene = Scene_Gameover.new if $game_actors[1].hp <= 0
elsif self.is_a?(Game_Event)
self.enemy_status.make_attack_damage_value(attacker_status)
dmg = self.enemy_status.make_attack_damage_value(attacker_status)
self.damage = dmg
self.hp -= dmg
self.kill_enemy if self.hp <= 0
end
end
def recive_skill(attacker, skill)
attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_actors[1])
receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_actors[1])
if self.is_a?(Game_Player)
dmag = $game_actors[1].make_obj_damage_value($game_actors[1], $data_skills[skill])
$game_actors[1].skill_effect($game_actors[1], $data_skills[skill])
$game_player.damage = dmag
$scene = Scene_Gameover.new if $game_actors[1].hp <= 0
elsif self.is_a?(Game_Event)
dmg = enemy_status.make_obj_damage_value(enemy_status, $data_skills[skill])
enemy_status.skill_effect(enemy_status, $data_skills[skill])
self.hp -= dmg
self.damage = dmg
self.kill_enemy if self.hp <= 0
end
end
def recive_itemeffect(attacker, item)
attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_actors[1])
receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_actors[1])
if self.is_a?(Game_Player)
dmag = $game_actors[1].make_obj_damage_value($game_actors[1], $data_items[item])
$game_actors[1].item_effect($game_actors[1], $data_items[item])
$game_player.damage = dmag
$scene = Scene_Gameover.new if $game_actors[1].hp <= 0
elsif self.is_a?(Game_Event)
dmg = enemy_status.make_obj_damage_value(enemy_status, $data_items[item])
enemy_status.item_effect($game_actors[1], $data_items[item])
self.hp -= dmg
self.damage = dmg
self.kill_enemy if self.hp <= 0
end
end
def kill_enemy
$game_actors[1].gain_exp(enemy_status.exp, 1)
Sound::play_enemy_collapse
if @die == 0
self.erase
elsif @die == 1
key = [$game_map.map_id, self.id, "A"]
$game_self_switches[key] = true
elsif @die == 2
key = [$game_map.map_id, self.id, "B"]
$game_self_switches[key] = true
elsif @die == 3
key = [$game_map.map_id, self.id, "C"]
$game_self_switches[key] = true
elsif @die == 4
key = [$game_map.map_id, self.id, "D"]
$game_self_switches[key] = true
else
$game_switches[@die] = true
$game_map.need_refresh = true
end
@automove = false
refresh
end
def follow_hero(dx, dy)
sx = @x - dx
sy = @y - dy
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if abs_sx == 0
sy > 0 ? move_up : move_down
if not moving? and sx != 0
sx > 0 ? move_left : move_right
end
return
elsif abs_sy == 0
sx > 0 ? move_left : move_right
if not moving? and sy != 0
sy > 0 ? move_up : move_down
end
return
end
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx > abs_sy
sx > 0 ? move_left : move_right
if not moving? and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if not moving? and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end

#--------------------------------------------------------------
# Game Event
#--------------------------------------------------------------
class Game_Event < Game_Character
attr_reader :inimigo
attr_reader :enemy_status
attr_accessor :move_speed
attr_accessor :through
alias crissaegrim_abs_gevent_initialize initialize
alias crissaegrim_abs_gevent_update update
alias crissaegrim_abs_gevent_refresh refresh
def initialize(map_id, event)
@inimigo = false
@automove = false
crissaegrim_abs_gevent_initialize(map_id, event)
end
def update
crissaegrim_abs_gevent_update
if self.wait_action > 0
self.wait_action -= 1
end
if @inimigo
new_x = (@x + (@direction == 4 ? -1 : @direction == 6 ? 1 : 0))
new_y = (@y + (@direction == 8 ? -1 : @direction == 2 ? 1 : 0))
if $game_player.x == new_x and $game_player.y == new_y and self.wait_action <= 0
for action in $data_enemies[@enemy_id].actions
next unless enemy_status.conditions_met?(action)
case action.kind
when 0
case action.basic
when 0
$game_player.recive_atk(self)
$game_player.animation_id = self.enemy_atk_animation_id
$game_player.jump(0,0)
when 1..3
return
end
when 1
case $data_skills[action.skill_id].scope
when 1..6
if $data_enemies[@enemy_id].maxmp >= $data_skills[action.skill_id].mp_cost
$data_enemies[@enemy_id].maxmp -= $data_skills[action.skill_id].mp_cost
$game_player.animation_id = $data_skills[action.skill_id].animation_id
$game_player.jump(0,0)
$game_player.recive_skill(self, action.skill_id)
end
when 7..11
if $data_enemies[@enemy_id].maxmp >= $data_skills[action.skill_id].mp_cost
$data_enemies[@enemy_id].maxmp -= $data_skills[action.skill_id].mp_cost
enemy_status.skill_effect(enemy_status, $data_skills[action.skill_id])
rec = enemy_status.make_obj_damage_value(enemy_status, $data_skills[action.skill_id])
self.hp -= rec
self.animation_id = $data_skills[action.skill_id].animation_id
end
end
end
end
speed = $data_enemies[@enemy_id].agi / 10
self.wait_action = 60 - speed
end
end
if @automove
unless moving?
self.follow_hero($game_player.x, $game_player.y) if in_range?(self, $game_player, @follow_distance)
end
end
end
def in_range?(event, target, distance)
x = (event.x - target.x) * (event.x - target.x)
y = (event.y - target.y) * (event.y - target.y)
r = x + y
return true if r <= (distance * distance)
return false
end
def refresh
crissaegrim_abs_gevent_refresh
@inimigo = false
@enemy_id = check_comment("Enemy")
@die = check_comment("Die")
@follow_distance = check_comment("Follow")
@automove = true if @follow_distance > 0
if @enemy_id > 0
@inimigo = true
@enemy_status = Game_Enemy.new(1, @enemy_id)
self.hp = @enemy_status.maxhp
self.mp = @enemy_status.maxmp
end
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
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 enemy_atk_animation_id
if Crissaegrim_ABS::Enemy_atk_ani[@enemy_id]
return (@enemy_status.nil? ? 0 : Crissaegrim_ABS::Enemy_atk_ani[@enemy_id])
else
return (@enemy_status.nil? ? 0 : 1)
end
end
end

#--------------------------------------------------------------
# Game Player
#--------------------------------------------------------------
class Game_Player < Game_Character
alias crissaegrim_abs_gplayer_initialize initialize
alias crissaegrim_abs_gplayer_update update
alias crissaegrim_abs_gplayer_refresh refresh
def initialize
crissaegrim_abs_gplayer_initialize
@distance = Distance_Base.new
end
def update
crissaegrim_abs_gplayer_update
if self.wait_action > 0
self.wait_action -= 1
end
@distance.update
#--------------------------------------------------------------
if Input.trigger?(Crissaegrim_ABS::Attack_Button) and self.wait_action <= 0
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_actors[1].weapon_id)
hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
if $game_party.has_item?($data_items[Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][3]])
$game_map.events[1].moveto(hero_x, hero_y)
$game_map.events[1].set_graphic(Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][0],0)
$game_map.events[1].move_speed = Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][1]
$game_map.events[1].through = true
$game_party.consume_item($data_items[Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][3]])
case $game_player.direction
when 2
$game_map.events[1].turn_down
when 4
$game_map.events[1].turn_left
when 6
$game_map.events[1].turn_right
when 8
$game_map.events[1].turn_up
end
end
self.wait_action = Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][4]
end
else
new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
for event in $game_map.events.values
if event.inimigo
if event.x == new_x and event.y == new_y
event.recive_atk(self)
event.animation_id = self.player_atk_animation_id
event.jump(0,0)
speed = $game_actors[1].agi / 10
self.wait_action = 60 - speed
break
end
end
end
end
end
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_actors[1].weapon_id)
$game_map.events[1].refresh
weapon_x = $game_map.events[1].x
weapon_y = $game_map.events[1].y
for event in $game_map.events.values
if event.inimigo
if event.x == weapon_x and event.y == weapon_y
event.recive_atk(self)
event.animation_id = self.player_atk_animation_id
event.jump(0,0)
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0,0)
end
end
end
end
#--------------------------------------------------------------
for button in Crissaegrim_ABS::Skill_Button.keys
if Input.trigger?(button) and Crissaegrim_ABS::Skill_Button[button] != nil and Crissaegrim_ABS::Skill_Button[button] != 0 and $game_actors[1].mp >= $data_skills[Crissaegrim_ABS::Skill_Button[button]].mp_cost and self.wait_action <= 0
@skl = Crissaegrim_ABS::Skill_Button[button]
$game_temp.common_event_id = $data_skills[@skl].common_event_id if $data_skills[@skl].common_event_id > 0
Sound.play_use_skill
if Crissaegrim_ABS::Distance_Skills.has_key?(@skl)
hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
if $game_actors[1].mp >= $data_skills[@skl].mp_cost
$game_map.events[1].moveto(hero_x, hero_y)
$game_map.events[1].set_graphic(Crissaegrim_ABS::Distance_Skills[@skl][0],0)
$game_map.events[1].move_speed = Crissaegrim_ABS::Distance_Skills[@skl][1]
$game_map.events[1].through = true
$game_actors[1].mp -= $game_actors[1].calc_mp_cost($data_skills[@skl])
case $game_player.direction
when 2
$game_map.events[1].turn_down
when 4
$game_map.events[1].turn_left
when 6
$game_map.events[1].turn_right
when 8
$game_map.events[1].turn_up
end
end
self.wait_action = Crissaegrim_ABS::Distance_Skills[@skl][3]
end
else
case $data_skills[@skl].scope
when 1..6
new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
for event in $game_map.events.values
if event.inimigo
if event.x == new_x and event.y == new_y
$game_actors[1].mp -= $game_actors[1].calc_mp_cost($data_skills[@skl])
event.recive_skill(self, @skl)
event.animation_id = self.player_skl_animation_id(@skl)
event.jump(0,0)
end
end
end
when 7..11
$game_actors[1].mp -= $game_actors[1].calc_mp_cost($data_skills[@skl])
$game_player.animation_id = player_skl_animation_id(@skl)
$game_actors[1].skill_effect($game_actors[1], $data_skills[@skl])
end
speed = $game_actors[1].agi / 10
self.wait_action = 60 - speed
break
end
end
end
if Crissaegrim_ABS::Distance_Skills.has_key?(@skl)
$game_map.events[1].refresh
weapon_x = $game_map.events[1].x
weapon_y = $game_map.events[1].y
for event in $game_map.events.values
if event.inimigo
if event.x == weapon_x and event.y == weapon_y
event.recive_skill(self, @skl)
event.animation_id = self.player_skl_animation_id(@skl)
event.jump(0,0)
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0,0)
end
end
end
end
#--------------------------------------------------------------
for button in Crissaegrim_ABS::Item_Button.keys
if Input.trigger?(button) and Crissaegrim_ABS::Item_Button[button] != nil and Crissaegrim_ABS::Item_Button[button] != 0 and $game_party.item_number($data_items[Crissaegrim_ABS::Item_Button[button]]) > 0 and self.wait_action <= 0
@itm = Crissaegrim_ABS::Item_Button[button]
$game_temp.common_event_id = $data_items[@itm].common_event_id if $data_items[@itm].common_event_id > 0
if Crissaegrim_ABS::Distance_Items.has_key?(@itm)
hero_x = ($game_player.x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
hero_y = ($game_player.y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
if $game_map.passable?(hero_x, hero_y) or $game_map.passable?(hero_x, hero_y, 0x02)
if $game_party.has_item?($data_items[Crissaegrim_ABS::Distance_Items[@itm][3]])
$game_map.events[1].moveto(hero_x, hero_y)
$game_map.events[1].set_graphic(Crissaegrim_ABS::Distance_Items[@itm][0],0)
$game_map.events[1].move_speed = Crissaegrim_ABS::Distance_Items[@itm][1]
$game_map.events[1].through = true
$game_party.consume_item($data_items[Crissaegrim_ABS::Distance_Items[@itm][3]])
case $game_player.direction
when 2
$game_map.events[1].turn_down
when 4
$game_map.events[1].turn_left
when 6
$game_map.events[1].turn_right
when 8
$game_map.events[1].turn_up
end
end
self.wait_action = Crissaegrim_ABS::Distance_Items[@itm][4]
end
else
case $data_items[@itm].scope
when 1..6
new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
for event in $game_map.events.values
if event.inimigo
if event.x == new_x and event.y == new_y
event.recive_itemeffect(self, @itm)
event.animation_id = $data_items[@itm].animation_id
$game_party.consume_item($data_items[@itm])
event.jump(0,0)
end
end
end
when 7..11
$game_player.animation_id = player_item_animation_id(@itm)
$game_actors[1].item_effect($game_actors[1], $data_items[@itm])
$game_party.consume_item($data_items[@itm])
$game_temp.common_event_id = $data_items[@itm].common_event_id if $data_items[@itm].common_event_id > 0
end
speed = $game_actors[1].agi / 10
self.wait_action = 60 - speed
end
end
end
if Crissaegrim_ABS::Distance_Items.has_key?(@itm)
$game_map.events[1].refresh
weapon_x = $game_map.events[1].x
weapon_y = $game_map.events[1].y
for event in $game_map.events.values
if event.inimigo
if event.x == weapon_x and event.y == weapon_y
event.recive_itemeffect(self, @itm)
event.animation_id = $data_items[@itm].animation_id
event.jump(0,0)
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0,0)
end
end
end
end
#--------------------------------------------------------------
def player_atk_animation_id
return ($game_actors[1].nil? ? 0 : $game_actors[1].atk_animation_id)
end
def player_skl_animation_id(skl)
return ($game_actors[1].nil? ? 0 : $data_skills[skl].animation_id)
end
def player_item_animation_id(itm)
return ($game_actors[1].nil? ? 0 : $data_items[itm].animation_id)
end
end
end

#--------------------------------------------------------------
# Game Actor
#--------------------------------------------------------------
class Game_Actor
alias crissaegrim_abs_change_exp change_exp
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
show_level_up
end
crissaegrim_abs_change_exp(exp,show)
end
def show_level_up
$game_player.animation_id = Crissaegrim_ABS::LevelUp_Ani
$game_actors[1].hp = $game_actors[1].maxhp
$game_actors[1].mp = $game_actors[1].maxmp
$game_player.damage = "Niv. +"
end
end

#--------------------------------------------------------------
# Distance Weapons
#--------------------------------------------------------------
class Distance_Base < Game_Character
def initialize
refresh
end
def refresh
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_actors[1].weapon_id)
weapondistance_x = ($game_map.events[1].x + ($game_map.events[1].direction == 4 ? -1 : $game_map.events[1].direction == 6 ? 1 : 0))
weapondistance_y = ($game_map.events[1].y + ($game_map.events[1].direction == 8 ? -1 : $game_map.events[1].direction == 2 ? 1 : 0))
if $game_map.passable?(weapondistance_x, weapondistance_y) or $game_map.passable?(weapondistance_x, weapondistance_y, 0x02)
unless $game_map.events[1].moving?; $game_map.events[1].move_away_from_player end
end
if $game_map.events[1].moving? == false
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
for button in Crissaegrim_ABS::Skill_Button.keys
if Crissaegrim_ABS::Distance_Skills.has_key?(Crissaegrim_ABS::Skill_Button[button])
weapondistance_x = ($game_map.events[1].x + ($game_map.events[1].direction == 4 ? -1 : $game_map.events[1].direction == 6 ? 1 : 0))
weapondistance_y = ($game_map.events[1].y + ($game_map.events[1].direction == 8 ? -1 : $game_map.events[1].direction == 2 ? 1 : 0))
if $game_map.passable?(weapondistance_x, weapondistance_y) or $game_map.passable?(weapondistance_x, weapondistance_y, 0x02)
unless $game_map.events[1].moving?; $game_map.events[1].move_away_from_player end
end
if $game_map.events[1].moving? == false
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
end
for key in Crissaegrim_ABS::Item_Button.keys
if Crissaegrim_ABS::Distance_Items.has_key?(Crissaegrim_ABS::Item_Button[key])
weapondistance_x = ($game_map.events[1].x + ($game_map.events[1].direction == 4 ? -1 : $game_map.events[1].direction == 6 ? 1 : 0))
weapondistance_y = ($game_map.events[1].y + ($game_map.events[1].direction == 8 ? -1 : $game_map.events[1].direction == 2 ? 1 : 0))
if $game_map.passable?(weapondistance_x, weapondistance_y) or $game_map.passable?(weapondistance_x, weapondistance_y, 0x02)
unless $game_map.events[1].moving?; $game_map.events[1].move_away_from_player end
end
if $game_map.events[1].moving? == false
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
end
end
def update
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_actors[1].weapon_id)
case $game_player.direction
when 2
map_height = $game_player.y + Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][2]
when 4
map_width = $game_player.x - Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][2]
when 6
map_width = $game_player.x + Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][2]
when 8
map_height = $game_player.y - Crissaegrim_ABS::Distance_Weapons[$game_actors[1].weapon_id][2]
end
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_actors[1].weapon_id)
if map_width == $game_map.events[1].x or $game_map.events[1].x == 0
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
elsif map_height == $game_map.events[1].y or $game_map.events[1].y == 0
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
refresh
end
for button in Crissaegrim_ABS::Skill_Button.keys
if Crissaegrim_ABS::Distance_Skills.has_key?(Crissaegrim_ABS::Skill_Button[button])
case $game_player.direction
when 2
map_height = $game_player.y + Crissaegrim_ABS::Distance_Skills[Crissaegrim_ABS::Skill_Button[button]][2]
when 4
map_width = $game_player.x - Crissaegrim_ABS::Distance_Skills[Crissaegrim_ABS::Skill_Button[button]][2]
when 6
map_width = $game_player.x + Crissaegrim_ABS::Distance_Skills[Crissaegrim_ABS::Skill_Button[button]][2]
when 8
map_height = $game_player.y - Crissaegrim_ABS::Distance_Skills[Crissaegrim_ABS::Skill_Button[button]][2]
end
if Crissaegrim_ABS::Distance_Skills.has_key?(Crissaegrim_ABS::Skill_Button[button])
if map_width == $game_map.events[1].x or $game_map.events[1].x == 0
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
elsif map_height == $game_map.events[1].y or $game_map.events[1].y == 0
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
refresh
end
end
for key in Crissaegrim_ABS::Item_Button.keys
if Crissaegrim_ABS::Distance_Items.has_key?(Crissaegrim_ABS::Item_Button[key])
case $game_player.direction
when 2
map_height = $game_player.y + Crissaegrim_ABS::Distance_Items[Crissaegrim_ABS::Item_Button[key]][2]
when 4
map_width = $game_player.x - Crissaegrim_ABS::Distance_Items[Crissaegrim_ABS::Item_Button[key]][2]
when 6
map_width = $game_player.x + Crissaegrim_ABS::Distance_Items[Crissaegrim_ABS::Item_Button[key]][2]
when 8
map_height = $game_player.y - Crissaegrim_ABS::Distance_Items[Crissaegrim_ABS::Item_Button[key]][2]
end
if Crissaegrim_ABS::Distance_Items.has_key?(Crissaegrim_ABS::Item_Button[key])
if map_width == $game_map.events[1].x
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
elsif map_height == $game_map.events[1].y
$game_map.events[1].set_graphic("",0)
$game_map.events[1].moveto(0, 0)
end
end
refresh
end
end
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] / 2
sprite.y = @animation_oy - cell_data[i, 2] / 2
sprite.angle = (360 - cell_data[i, 4])
sprite.mirror = (cell_data[i, 5] == 0)
else
sprite.x = @animation_ox + cell_data[i, 1] / 2
sprite.y = @animation_oy + cell_data[i, 2] / 2
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] / 200.0
sprite.zoom_y = cell_data[i, 3] / 200.0
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 crissaegrim_abs_spchar_update update
def initialize(viewport, character = nil)
super(viewport)
@character = character
@balloon_duration = 0
@_damage_duration = 0
update
end
def update
super
if @_damage_duration > 0
@_damage_duration -=1
@_damage_sprite.x = self.x
if @_damage_duration <= 0
dispose_damage
end
end
if @character != nil and @character.damage != nil
damage(@character.damage, @character.critical)
@character.damage = nil
@character.critical = false
end
crissaegrim_abs_spchar_update
end
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Georgia"
bitmap.font.size = 22
bitmap.font.italic = true
if value.is_a?(Numeric) and value <= 0
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(1, 13, 160, 36, "Miss", 1)
bitmap.font.color.set(255, 245, 155)
bitmap.draw_text(0, 12, 160, 36, "Miss", 1)
else
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(1, 13, 160, 36, damage_string, 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
end
if critical
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(1, 6, 160, 20, "Critical", 1)
bitmap.font.color.set(255, 245, 155)
bitmap.draw_text(0, 5, 160, 20, "Critical", 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 - 40
@_damage_sprite.z += 99999
@_damage_duration = 30
end
def show_text(string, size=16, color=0)
dispose_damage
damage_string = string
if string.is_a?(Array)
array = true
else
array = false
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Georgia"
bitmap.font.size = size
bitmap.font.italic = true
if array
for i in 0..string.size
next if damage_string[i] == nil
bitmap.font.color.set(96, 96-20, 0) if color == 0
bitmap.font.color.set(0, 0, 0) if color != 0
bitmap.draw_text(-1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
bitmap.draw_text(+1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
bitmap.draw_text(-1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
bitmap.draw_text(+1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
bitmap.font.color.set(255, 245, 155) if color == 0
bitmap.font.color.set(144, 199, 150) if color == 1
bitmap.font.color.set(197, 147, 190)if color == 2
bitmap.font.color.set(138, 204, 198)if color == 3
bitmap.draw_text(0, (12+(16*i))-16, 160, 36, damage_string[i], 1)
end
else
bitmap.font.color.set(96, 96-20, 0) if color == 0
bitmap.font.color.set(0, 0, 0) if color != 0
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
bitmap.font.color.set(255, 245, 155) if color == 0
bitmap.font.color.set(144, 199, 150) if color == 1
bitmap.font.color.set(197, 147, 190)if color == 2
bitmap.font.color.set(138, 204, 198)if color == 3
bitmap.draw_text(0, 12, 160, 36, damage_string, 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
@_damage_sprite.z = 3000
@_damage_duration = 30
end
def dispose_damage
if @_damage_sprite != nil
@_damage_sprite.dispose
@_damage_sprite = nil
end
end
end

#--------------------------------------------------------------
# Window Skill
#--------------------------------------------------------------
class Window_Skill < Window_Selectable
alias crissaegrim_abs_wskill_draw_item draw_item
def draw_item(index)
crissaegrim_abs_wskill_draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = true
draw_item_name(skill, rect.x, rect.y, enabled)
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
end
class Scene_Skill
alias crissaegrim_abs_sskill_start start
alias crissaegrim_abs_sskill_update update
alias crissaegrim_abs_sskill_update_skill_selection update_skill_selection
def start
@memory = Window_Command.new(150, ["Mémoriser !"])
@memory.active = false
@memory.visible = false
@memory.x = (544 - @memory.width) / 2
@memory.y = (416 - @memory.height) / 2
@memory.z = 1500
crissaegrim_abs_sskill_start
end
def update
@memory.update if @memory.active
crissaegrim_abs_sskill_update
return update_memory if @memory.active
end
def update_skill_selection
crissaegrim_abs_sskill_update_skill_selection
for button in Crissaegrim_ABS::Skill_Button.keys
if Input.trigger?(button)
Sound.play_decision
Crissaegrim_ABS::Skill_Button[button] = @skill_window.skill.id
@memory.active = @memory.visible = true
@skill_window.active = false
end
end
end
def update_memory
if Input.trigger?(Input::C)
Sound.play_decision
@memory.active = @memory.visible = false
@skill_window.active = true
end
end
end

#--------------------------------------------------------------
# Window Item
#--------------------------------------------------------------
class Scene_Item
alias crissaegrim_abs_sitem_start start
alias crissaegrim_abs_sitem_update update
alias crissaegrim_abs_sitem_update_item_selection update_item_selection
def start
@memory = Window_Command.new(150, ["Mémoriser !"])
@memory.active = false
@memory.visible = false
@memory.x = (544 - @memory.width) / 2
@memory.y = (416 - @memory.height) / 2
@memory.z = 1500
crissaegrim_abs_sitem_start
end
def update
@memory.update if @memory.active
crissaegrim_abs_sitem_update
return update_memory if @memory.active
end
def update_item_selection
crissaegrim_abs_sitem_update_item_selection
for button in Crissaegrim_ABS::Item_Button.keys
if Input.trigger?(button)
Sound.play_decision
Crissaegrim_ABS::Item_Button[button] = @item_window.item.id
@memory.active = @memory.visible = true
@item_window.active = false
end
end
end
def update_memory
if Input.trigger?(Input::C)
Sound.play_decision
@memory.active = @memory.visible = false
@item_window.active = true
end
end
end

#--------------------------------------------------------------
# Fim do ABS
#--------------------------------------------------------------




HUD:
=================================
# Window Hud
# Traduit par nova
# http://rpgnation.free.fr
#=================================
module CrissaegrimHud
#----------------------------------------------------------
# Image du HUD
Picture_Base = "HUD-Base"

# Image des compétences
Picture_Hot_Skills = "HUD-Skills"

# Image des objets
Picture_Hot_Items = "HUD-Items"

# Active ou désactive le HUD
# Si = 0, alors le HUD restera affiché
OnOff_Hud_Switch = 0
#----------------------------------------------------------
end
#----------------------------------------------------------
class Window_CrissaegrimHud < Window_Base
def initialize
super(-12,-12,190,117)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Base)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 148, 85))
refresh
end
def refresh
actor = $game_actors[1]
draw_actor_hp(actor, 16, 0, 96)
draw_actor_mp(actor, 16, 24, 96)
draw_actor_level(actor, 16, 48)
show_state(actor, 119, 2)
end
def show_state(actor, x, y, width = 32)
count = 0
for state in actor.states
draw_icon(state.icon_index, x, y + 28 * count)
count += 1
break if (24 * count > height - 24)
end
end
end
#----------------------------------------------------------
class Window_CrissaegrimHud2 < Window_Base
def initialize
super(40,347,296,80)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Hot_Skills)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 156, 48))
skill_count = 0
for button in Crissaegrim_ABS::Skill_Button.keys
next if button == nil
skill = $data_skills[Crissaegrim_ABS::Skill_Button[button]]
next if skill == nil
show_icon(skill, 10 + 28 * skill_count, Cool
self.contents.font.size = 16
# self.contents.draw_text(16 + 28 * skill_count, 26, 32, 18, "")
skill_count += 1
end
end
def show_icon(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
end
end
#----------------------------------------------------------
class Window_CrissaegrimHud3 < Window_Base
def initialize
super(-12,225,80,202)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Hot_Items)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 48, 170))
item_count = 0
for button in Crissaegrim_ABS::Item_Button.keys
next if button == nil
item = $data_items[Crissaegrim_ABS::Item_Button[button]]
next if item == nil
show_item_icon(item, 4, 8 + 30 * item_count)
self.contents.font.size = 16
self.contents.draw_text(28, 12 + 30 * item_count, 32, 18, $game_party.item_number(item))
item_count += 1
end
end
def show_item_icon(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
end
end
#----------------------------------------------------------
class Scene_Map
alias hud_start start
alias hud_update update
alias hud_terminate terminate
def start
super
@hud = Window_CrissaegrimHud.new
@hud2 = Window_CrissaegrimHud2.new
@hud3 = Window_CrissaegrimHud3.new
hud_start
end
def update
super
@hud.update
@hud2.update
@hud3.update
hud_update
end
def terminate
super
@hud.dispose
@hud2.dispose
@hud3.dispose
hud_terminate
end
end
Contenu sponsorisé

Probleme de combat Empty Re: Probleme de combat

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum